Skip to content
Closed
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
254 changes: 142 additions & 112 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,114 +1,144 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"includes": ["**", "!!**/dist", "!!**/packages/@ant"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off",
"noAssignInExpressions": "off",
"noDoubleEquals": "off",
"noRedeclare": "off",
"noImplicitAnyLet": "off",
"noGlobalIsNan": "off",
"noFallthroughSwitchClause": "off",
"noShadowRestrictedNames": "off",
"noArrayIndexKey": "off",
"noConsole": "off",
"noConfusingLabels": "off",
"useIterableCallbackReturn": "off"
},
"style": {
"useConst": "off",
"noNonNullAssertion": "off",
"noParameterAssign": "off",
"useDefaultParameterLast": "off",
"noUnusedTemplateLiteral": "off",
"useTemplate": "off",
"useNumberNamespace": "off",
"useNodejsImportProtocol": "off",
"useImportType": "off"
},
"complexity": {
"noForEach": "off",
"noBannedTypes": "off",
"noUselessConstructor": "off",
"noStaticOnlyClass": "off",
"useOptionalChain": "off",
"noUselessSwitchCase": "off",
"noUselessFragments": "off",
"noUselessTernary": "off",
"noUselessLoneBlockStatements": "off",
"noUselessEmptyExport": "off",
"useArrowFunction": "off",
"useLiteralKeys": "off"
},
"correctness": {
"noUnusedVariables": "off",
"noUnusedImports": "off",
"useExhaustiveDependencies": "off",
"noSwitchDeclarations": "off",
"noUnreachable": "off",
"useHookAtTopLevel": "off",
"noVoidTypeReturn": "off",
"noConstantCondition": "off",
"noUnusedFunctionParameters": "off"
},
"a11y": {
"recommended": false
},
"nursery": {
"recommended": false
}
}
},
"json": {
"formatter": {
"enabled": false
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"semicolons": "asNeeded",
"arrowParentheses": "asNeeded",
"trailingCommas": "all"
}
},
"overrides": [
{
"includes": ["**/*.tsx"],
"javascript": {
"formatter": {
"semicolons": "always"
}
},
"formatter": {
"lineWidth": 120
}
},
{
"includes": ["scripts/**", "packages/**", "**/*.js", "**/*.mjs", "**/*.jsx"],
"formatter": {
"enabled": false
}
}
],
"assist": {
"enabled": false
}
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"includes": [
"**",
"!!**/dist",
"!!**/packages/@ant"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off",
"noAssignInExpressions": "off",
"noDoubleEquals": "off",
"noRedeclare": "off",
"noImplicitAnyLet": "off",
"noGlobalIsNan": "off",
"noFallthroughSwitchClause": "off",
"noShadowRestrictedNames": "off",
"noArrayIndexKey": "off",
"noConsole": "off",
"noConfusingLabels": "off",
"useIterableCallbackReturn": "off",
"noControlCharactersInRegex": "off",
"noSelfCompare": "off",
"noTemplateCurlyInString": "off",
"noAsyncPromiseExecutor": "off"
},
"style": {
"useConst": "off",
"noNonNullAssertion": "off",
"noParameterAssign": "off",
"useDefaultParameterLast": "off",
"noUnusedTemplateLiteral": "off",
"useTemplate": "off",
"useNumberNamespace": "off",
"useNodejsImportProtocol": "off",
"useImportType": "off"
},
"complexity": {
"noForEach": "off",
"noBannedTypes": "off",
"noUselessConstructor": "off",
"noStaticOnlyClass": "off",
"useOptionalChain": "off",
"noUselessSwitchCase": "off",
"noUselessFragments": "off",
"noUselessTernary": "off",
"noUselessLoneBlockStatements": "off",
"noUselessEmptyExport": "off",
"useArrowFunction": "off",
"useLiteralKeys": "off"
},
"correctness": {
"noUnusedVariables": "off",
"noUnusedImports": "off",
"useExhaustiveDependencies": "off",
"noSwitchDeclarations": "off",
"noUnreachable": "off",
"useHookAtTopLevel": "off",
"noVoidTypeReturn": "off",
"noConstantCondition": "off",
"noUnusedFunctionParameters": "off",
"useYield": "off",
"noUnusedPrivateClassMembers": "off",
"noUnusedLabels": "off"
},
"a11y": {
"recommended": false
},
"nursery": {
"recommended": false
},
"security": {
"noDangerouslySetInnerHtml": "off"
}
}
},
"json": {
"formatter": {
"enabled": false
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"semicolons": "asNeeded",
"arrowParentheses": "asNeeded",
"trailingCommas": "all"
}
},
"overrides": [
{
"includes": [
"**/*.tsx"
],
"javascript": {
"formatter": {
"semicolons": "always"
}
},
"formatter": {
"lineWidth": 120
}
},
{
"includes": [
"scripts/**",
"packages/**",
"**/*.js",
"**/*.mjs",
"**/*.jsx"
],
"formatter": {
"enabled": false
}
},
{
"includes": [
"**/*.css"
],
"linter": {
"enabled": false
}
}
],
"assist": {
"enabled": false
}
}
1 change: 0 additions & 1 deletion packages/@ant/ink/src/core/ink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,6 @@ export default class Ink {
}

patchConsole(): () => void {
// biome-ignore lint/suspicious/noConsole: intentionally patching global console
const con = console
const originals: Partial<Record<keyof Console, Console[keyof Console]>> = {}
const toDebug = (...args: unknown[]) =>
Expand Down
2 changes: 0 additions & 2 deletions packages/@ant/ink/src/core/reconciler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: unknown) {
if (error instanceof Error && (error as NodeJS.ErrnoException).code === 'ERR_MODULE_NOT_FOUND') {
// biome-ignore lint/suspicious/noConsole: intentional warning
console.warn(
`
The environment variable DEV is set to true, so Ink tried to import \`react-devtools-core\`,
Expand Down Expand Up @@ -197,7 +196,6 @@ let _prepareAt = 0

/** Debug log helper — replaces fs.appendFileSync with console.warn. */
function debugLog(message: string): void {
// biome-ignore lint/suspicious/noConsole: debug instrumentation
console.warn(`[ink-commit] ${message}`)
}
// --- END ---
Expand Down
1 change: 0 additions & 1 deletion packages/@ant/ink/src/core/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ const wrappedRender = async (
await Promise.resolve()
const instance = renderSync(node, options)
if (process.env.CLAUDE_CODE_DEBUG_REPAINTS === '1') {
// biome-ignore lint/suspicious/noConsole: debug instrumentation
console.warn(
`[render] first ink render: ${Math.round(process.uptime() * 1000)}ms since process start`,
)
Expand Down
4 changes: 2 additions & 2 deletions packages/builtin-tools/src/tools/BashTool/BashTool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ async function* runShellCommand({
let lastProgressOutput = ''
let lastTotalLines = 0
let lastTotalBytes = 0
let backgroundShellId: string | undefined = undefined
let backgroundShellId: string | undefined
let assistantAutoBackgrounded = false

// Progress signal: resolved by onProgress callback from the shared poller,
Expand Down Expand Up @@ -1314,7 +1314,7 @@ async function* runShellCommand({

// Wait for the initial threshold before showing progress
const startTime = Date.now()
let foregroundTaskId: string | undefined = undefined
let foregroundTaskId: string | undefined

{
const initialResult = await Promise.race([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export async function getImageProcessor(): Promise<SharpFunction> {
return sharpFn
} catch {
// Fall back to sharp if native module is not available
// biome-ignore lint/suspicious/noConsole: intentional warning
console.warn(
'Native image processor not available, falling back to sharp',
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export const NotebookEditTool = buildTool({
}

const language = notebook.metadata.language_info?.name ?? 'python'
let new_cell_id = undefined
let new_cell_id
if (
notebook.nbformat > 4 ||
(notebook.nbformat === 4 && notebook.nbformat_minor >= 5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ async function* runPowerShellCommand({
let lastProgressOutput = ''
let lastTotalLines = 0
let lastTotalBytes = 0
let backgroundShellId: string | undefined = undefined
let backgroundShellId: string | undefined
let interruptBackgroundingStarted = false
let assistantAutoBackgrounded = false

Expand Down Expand Up @@ -1109,7 +1109,7 @@ async function* runPowerShellCommand({
// Set up progress yielding with periodic checks
const startTime = Date.now()
let nextProgressTime = startTime + PROGRESS_THRESHOLD_MS
let foregroundTaskId: string | undefined = undefined
let foregroundTaskId: string | undefined

// Progress loop: wrap in try/finally so stopPolling is called on every exit
// path — normal completion, timeout/interrupt backgrounding, and Ctrl+B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe("SSE Writer", () => {

app.get("/stream/:sessionId", (c) => {
const sessionId = c.req.param("sessionId");
const fromSeq = parseInt(c.req.query("fromSeq") || "0");
const fromSeq = parseInt(c.req.query("fromSeq") || "0", 10);
return createSSEStream(c, sessionId, fromSeq);
});

Expand Down
14 changes: 7 additions & 7 deletions packages/remote-control-server/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
export const config = {
version: process.env.RCS_VERSION || "0.1.0",
port: parseInt(process.env.RCS_PORT || "3000"),
port: parseInt(process.env.RCS_PORT || "3000", 10),
host: process.env.RCS_HOST || "0.0.0.0",
apiKeys: (process.env.RCS_API_KEYS || "").split(",").filter(Boolean),
baseUrl: process.env.RCS_BASE_URL || "",
pollTimeout: parseInt(process.env.RCS_POLL_TIMEOUT || "8"),
heartbeatInterval: parseInt(process.env.RCS_HEARTBEAT_INTERVAL || "20"),
jwtExpiresIn: parseInt(process.env.RCS_JWT_EXPIRES_IN || "3600"),
disconnectTimeout: parseInt(process.env.RCS_DISCONNECT_TIMEOUT || "300"),
pollTimeout: parseInt(process.env.RCS_POLL_TIMEOUT || "8", 10),
heartbeatInterval: parseInt(process.env.RCS_HEARTBEAT_INTERVAL || "20", 10),
jwtExpiresIn: parseInt(process.env.RCS_JWT_EXPIRES_IN || "3600", 10),
disconnectTimeout: parseInt(process.env.RCS_DISCONNECT_TIMEOUT || "300", 10),
/** Bun WebSocket idle timeout (seconds). Bun sends protocol-level pings after
* this many seconds of no received data. Must be shorter than any reverse
* proxy's idle timeout (nginx default 60s, Cloudflare 100s). Default 30s. */
wsIdleTimeout: parseInt(process.env.RCS_WS_IDLE_TIMEOUT || "30"),
wsIdleTimeout: parseInt(process.env.RCS_WS_IDLE_TIMEOUT || "30", 10),
/** Server→client keep_alive data-frame interval (seconds). Keeps reverse
* proxies from closing idle connections. Default 20s. */
wsKeepaliveInterval: parseInt(process.env.RCS_WS_KEEPALIVE_INTERVAL || "20"),
wsKeepaliveInterval: parseInt(process.env.RCS_WS_KEEPALIVE_INTERVAL || "20", 10),
} as const;

export function getBaseUrl(): string {
Expand Down
2 changes: 1 addition & 1 deletion packages/remote-control-server/src/routes/acp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ app.get("/channel-groups/:id/events", async (c) => {
// Support Last-Event-ID / from_sequence_num for reconnection
const lastEventId = c.req.header("Last-Event-ID");
const fromSeq = c.req.query("from_sequence_num");
const fromSeqNum = fromSeq ? parseInt(fromSeq) : lastEventId ? parseInt(lastEventId) : 0;
const fromSeqNum = fromSeq ? parseInt(fromSeq, 10) : lastEventId ? parseInt(lastEventId, 10) : 0;

return createAcpSSEStream(c, groupId, fromSeqNum);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ app.get("/:id/worker/events/stream", acceptCliHeaders, sessionIngressAuth, async
// Support Last-Event-ID / from_sequence_num for reconnection
const lastEventId = c.req.header("Last-Event-ID");
const fromSeq = c.req.query("from_sequence_num");
const fromSeqNum = fromSeq ? parseInt(fromSeq) : lastEventId ? parseInt(lastEventId) : 0;
const fromSeqNum = fromSeq ? parseInt(fromSeq, 10) : lastEventId ? parseInt(lastEventId, 10) : 0;

return createWorkerEventStream(c, sessionId, fromSeqNum);
});
Expand Down
Loading
Loading