Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 102 additions & 102 deletions bun.lock

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions docs/scripts/generate-llms-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,16 @@ const indexContent = readFileSync(indexPath, "utf-8");
const indexTitle = extractTitle(indexContent) ?? "Home";
const indexBody = stripJsx(stripFrontmatter(indexContent)).trim();
if (indexBody) {
parts.push(`## ${indexTitle}`, "", `Source: ${fileToUrl(indexPath)}`, "");
parts.push(indexBody, "", "---", "");
parts.push(
`## ${indexTitle}`,
"",
`Source: ${fileToUrl(indexPath)}`,
"",
indexBody,
"",
"---",
""
);
}

// Process each section in order
Expand Down Expand Up @@ -126,9 +134,12 @@ for (const section of sections) {
`## ${section.label}: ${title}`,
"",
`Source: ${fileToUrl(file)}`,
"",
body,
"",
"---",
""
);
parts.push(body, "", "---", "");
}
}

Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@
},
"devDependencies": {
"@commander-js/extra-typings": "15.0.0",
"@commitlint/cli": "21.0.1",
"@commitlint/config-conventional": "21.0.1",
"@sentry/node-core": "10.54.0",
"@commitlint/cli": "21.1.0",
"@commitlint/config-conventional": "21.1.0",
"@sentry/node-core": "10.60.0",
"@simple-release/npm": "2.3.0",
"@types/bun": "1.3.14",
"conventional-changelog": "7.2.0",
"conventional-changelog": "7.2.1",
"conventional-changelog-angular": "8.3.1",
"czg": "1.13.1",
"fast-check": "4.8.0",
"inquirer": "14.0.0",
"knip": "6.14.2",
"inquirer": "14.0.2",
"knip": "6.18.0",
"meriyah": "7.1.0",
"oxfmt": "0.52.0",
"oxlint": "1.67.0",
"posthog-node": "5.35.5",
"oxfmt": "0.56.0",
"oxlint": "1.71.0",
"posthog-node": "5.38.4",
"zod": "4.4.3"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { trackCheckResult } from "../helpers/telemetry";
const maxWarningsOption = new Option(
"--max-warnings <n>",
"Fail (exit 1) when the number of warnings exceeds this threshold (0 = fail on any warning)"
).argParser((val) => parseInt(val, 10));
).argParser((val) => Math.trunc(Number(val)));

export function registerCheckCommand(program: Command) {
program
Expand Down
4 changes: 2 additions & 2 deletions src/commands/session-context/claude-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { readClaudeCodeSession } from "../../helpers/session-context";
const maxEntriesOption = new Option(
"--max-entries <n>",
"maximum entries to return (default: 200)"
).argParser((val) => parseInt(val, 10));
).argParser((val) => Math.trunc(Number(val)));

const skipOption = new Option(
"--skip <n>",
"skip the N most recent sessions (useful when running as a sub-agent)"
)
.argParser((val) => parseInt(val, 10))
.argParser((val) => Math.trunc(Number(val)))
.default(0);

export function registerClaudeCodeSessionContextCommand(parent: Command) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/session-context/copilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { readCopilotSession } from "../../helpers/session-context-copilot";
const maxEntriesOption = new Option(
"--max-entries <n>",
"maximum entries to return (default: 200)"
).argParser((val) => parseInt(val, 10));
).argParser((val) => Math.trunc(Number(val)));

const skipOption = new Option(
"--skip <n>",
"skip the N most recent sessions (useful when running as a sub-agent)"
)
.argParser((val) => parseInt(val, 10))
.argParser((val) => Math.trunc(Number(val)))
.default(0);

export function registerCopilotSessionContextCommand(parent: Command) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/session-context/cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { readCursorSession } from "../../helpers/session-context";
const maxEntriesOption = new Option(
"--max-entries <n>",
"maximum entries to return (default: 200)"
).argParser((val) => parseInt(val, 10));
).argParser((val) => Math.trunc(Number(val)));

const skipOption = new Option(
"--skip <n>",
"skip the N most recent sessions (useful when running as a sub-agent)"
)
.argParser((val) => parseInt(val, 10))
.argParser((val) => Math.trunc(Number(val)))
.default(0);

export function registerCursorSessionContextCommand(parent: Command) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/session-context/opencode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { readOpencodeSession } from "../../helpers/session-context-opencode";
const maxEntriesOption = new Option(
"--max-entries <n>",
"maximum entries to return (default: 200)"
).argParser((val) => parseInt(val, 10));
).argParser((val) => Math.trunc(Number(val)));

const skipOption = new Option(
"--skip <n>",
"skip the N most recent sessions (useful when running as a sub-agent)"
)
.argParser((val) => parseInt(val, 10))
.argParser((val) => Math.trunc(Number(val)))
.default(0);

export function registerOpencodeSessionContextCommand(parent: Command) {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/adr-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export function buildIdMap(
const nextId = nextIdByPrefix.get(prefix)!;
idMap.push({ original: adr.originalId, newId: nextId, title: adr.title });

const num = parseInt(nextId.replace(`${prefix}-`, ""), 10) + 1;
const num = Math.trunc(Number(nextId.replace(`${prefix}-`, ""))) + 1;
nextIdByPrefix.set(prefix, `${prefix}-${String(num).padStart(3, "0")}`);
}

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/adr-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function getNextId(adrsDir: string, prefix: string): string {
for (const file of files) {
const match = file.match(new RegExp(`^${prefix}-(\\d+)`, "u"));
if (match) {
const num = parseInt(match[1], 10);
const num = Math.trunc(Number(match[1]));
if (num > maxNum) maxNum = num;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/binary-upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export async function downloadReleaseBinary(
if (onProgress && response.body) {
// Stream the response so we can report progress incrementally.
const contentLength = response.headers.get("content-length");
const totalBytes = contentLength ? parseInt(contentLength, 10) : null;
const totalBytes = contentLength ? Math.trunc(Number(contentLength)) : null;

const reader = response.body.getReader();
const chunks: Uint8Array[] = [];
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/update-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function checkForUpdatesIfNeeded(

if (cacheExists) {
const raw = await cacheEntry.text();
const lastCheck = parseInt(raw.trim(), 10);
const lastCheck = Math.trunc(Number(raw.trim()));
if (!isNaN(lastCheck) && Date.now() - lastCheck < CACHE_TTL_MS) {
logDebug("Update check skipped — checked recently");
return null;
Expand Down
4 changes: 2 additions & 2 deletions tests/helpers/update-check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe("checkForUpdatesIfNeeded", () => {

// Cache file should contain a numeric timestamp
const content = await Bun.file(cacheFile).text();
const timestamp = parseInt(content.trim(), 10);
const timestamp = Math.trunc(Number(content.trim()));
expect(isNaN(timestamp)).toBe(false);
// Timestamp should be within the last 5 seconds
expect(Date.now() - timestamp).toBeLessThan(5_000);
Expand Down Expand Up @@ -182,7 +182,7 @@ describe("checkForUpdatesIfNeeded", () => {

// Cache file should have been rewritten with a fresh timestamp
const content = await Bun.file(cacheFile).text();
const newTimestamp = parseInt(content.trim(), 10);
const newTimestamp = Math.trunc(Number(content.trim()));
expect(newTimestamp).toBeGreaterThan(staleTimestamp);
expect(Date.now() - newTimestamp).toBeLessThan(5_000);
});
Expand Down
Loading