From c2eb6bff90c0ba0b7e6bcb9d136e9c03247d119a Mon Sep 17 00:00:00 2001 From: DoSun Date: Wed, 13 May 2026 10:36:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B8=85=E7=90=86=20main=20=E5=88=86?= =?UTF-8?q?=E6=94=AF=E7=9A=84=20stub=20.js=20=E6=96=87=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=9C=89=20.ts=20=E6=BA=90=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=91=BD=E4=BB=A4=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@ant/ink/src/types/ink-elements.d.ts | 68 +++++----- packages/@ant/ink/src/types/ink-jsx.d.ts | 66 +++++----- scripts/auto-rebase.ts | 120 ++++++++++++++++++ src/commands/agents-platform/index.js | 1 - src/commands/autofix-pr/index.d.ts | 3 - src/commands/autofix-pr/index.js | 1 - src/commands/break-cache/index.js | 1 - src/commands/ctx_viz/index.d.ts | 3 - src/commands/debug-tool-call/index.js | 1 - src/commands/env/index.js | 1 - src/commands/issue/index.js | 1 - src/commands/onboarding/index.d.ts | 3 - src/commands/onboarding/index.js | 1 - src/commands/perf-issue/index.js | 1 - src/commands/reset-limits/index.js | 4 - src/commands/share/index.js | 1 - src/commands/teleport/index.js | 1 - src/entrypoints/sdk/controlTypes.js | 8 -- src/entrypoints/sdk/runtimeTypes.js | 2 - src/types/global.d.ts | 18 +-- src/types/ink-elements.d.ts | 67 +++++----- src/types/ink-jsx.d.ts | 65 +++++----- src/types/internal-modules.d.ts | 42 +----- src/types/sdk-stubs.d.ts | 73 +++-------- 24 files changed, 275 insertions(+), 277 deletions(-) create mode 100644 scripts/auto-rebase.ts delete mode 100644 src/commands/agents-platform/index.js delete mode 100644 src/commands/autofix-pr/index.d.ts delete mode 100644 src/commands/autofix-pr/index.js delete mode 100644 src/commands/break-cache/index.js delete mode 100644 src/commands/ctx_viz/index.d.ts delete mode 100644 src/commands/debug-tool-call/index.js delete mode 100644 src/commands/env/index.js delete mode 100644 src/commands/issue/index.js delete mode 100644 src/commands/onboarding/index.d.ts delete mode 100644 src/commands/onboarding/index.js delete mode 100644 src/commands/perf-issue/index.js delete mode 100644 src/commands/reset-limits/index.js delete mode 100644 src/commands/share/index.js delete mode 100644 src/commands/teleport/index.js delete mode 100644 src/entrypoints/sdk/controlTypes.js delete mode 100644 src/entrypoints/sdk/runtimeTypes.js diff --git a/packages/@ant/ink/src/types/ink-elements.d.ts b/packages/@ant/ink/src/types/ink-elements.d.ts index b0943fa79..e439ae56b 100644 --- a/packages/@ant/ink/src/types/ink-elements.d.ts +++ b/packages/@ant/ink/src/types/ink-elements.d.ts @@ -1,49 +1,49 @@ // Type declarations for custom Ink JSX elements // Note: The detailed prop types are defined in ink-jsx.d.ts via React module augmentation. // This file provides the global JSX namespace fallback declarations. -import type { ReactNode, Ref } from 'react' -import type { ClickEvent } from '../core/events/click-event.js' -import type { FocusEvent } from '../core/events/focus-event.js' -import type { KeyboardEvent } from '../core/events/keyboard-event.js' -import type { Styles, TextStyles } from '../core/styles.js' -import type { DOMElement } from '../core/dom.js' +import type { ReactNode, Ref } from 'react'; +import type { ClickEvent } from '../core/events/click-event.js'; +import type { FocusEvent } from '../core/events/focus-event.js'; +import type { KeyboardEvent } from '../core/events/keyboard-event.js'; +import type { Styles, TextStyles } from '../core/styles.js'; +import type { DOMElement } from '../core/dom.js'; declare global { namespace JSX { interface IntrinsicElements { 'ink-box': { - ref?: Ref - tabIndex?: number - autoFocus?: boolean - onClick?: (event: ClickEvent) => void - onFocus?: (event: FocusEvent) => void - onFocusCapture?: (event: FocusEvent) => void - onBlur?: (event: FocusEvent) => void - onBlurCapture?: (event: FocusEvent) => void - onMouseEnter?: () => void - onMouseLeave?: () => void - onKeyDown?: (event: KeyboardEvent) => void - onKeyDownCapture?: (event: KeyboardEvent) => void - style?: Styles - stickyScroll?: boolean - children?: ReactNode - } + ref?: Ref; + tabIndex?: number; + autoFocus?: boolean; + onClick?: (event: ClickEvent) => void; + onFocus?: (event: FocusEvent) => void; + onFocusCapture?: (event: FocusEvent) => void; + onBlur?: (event: FocusEvent) => void; + onBlurCapture?: (event: FocusEvent) => void; + onMouseEnter?: () => void; + onMouseLeave?: () => void; + onKeyDown?: (event: KeyboardEvent) => void; + onKeyDownCapture?: (event: KeyboardEvent) => void; + style?: Styles; + stickyScroll?: boolean; + children?: ReactNode; + }; 'ink-text': { - style?: Styles - textStyles?: TextStyles - children?: ReactNode - } + style?: Styles; + textStyles?: TextStyles; + children?: ReactNode; + }; 'ink-link': { - href?: string - children?: ReactNode - } + href?: string; + children?: ReactNode; + }; 'ink-raw-ansi': { - rawText?: string - rawWidth?: number - rawHeight?: number - } + rawText?: string; + rawWidth?: number; + rawHeight?: number; + }; } } } -export {} +export {}; diff --git a/packages/@ant/ink/src/types/ink-jsx.d.ts b/packages/@ant/ink/src/types/ink-jsx.d.ts index 11800b03e..456be9399 100644 --- a/packages/@ant/ink/src/types/ink-jsx.d.ts +++ b/packages/@ant/ink/src/types/ink-jsx.d.ts @@ -8,47 +8,47 @@ * This file must be a module (have an import/export) for `declare module` * augmentation to work correctly. */ -import type { ReactNode, Ref } from 'react' -import type { ClickEvent } from '../core/events/click-event.js' -import type { FocusEvent } from '../core/events/focus-event.js' -import type { KeyboardEvent } from '../core/events/keyboard-event.js' -import type { Styles, TextStyles } from '../core/styles.js' -import type { DOMElement } from '../core/dom.js' +import type { ReactNode, Ref } from 'react'; +import type { ClickEvent } from '../core/events/click-event.js'; +import type { FocusEvent } from '../core/events/focus-event.js'; +import type { KeyboardEvent } from '../core/events/keyboard-event.js'; +import type { Styles, TextStyles } from '../core/styles.js'; +import type { DOMElement } from '../core/dom.js'; declare module 'react' { namespace JSX { interface IntrinsicElements { 'ink-box': { - ref?: Ref - tabIndex?: number - autoFocus?: boolean - onClick?: (event: ClickEvent) => void - onFocus?: (event: FocusEvent) => void - onFocusCapture?: (event: FocusEvent) => void - onBlur?: (event: FocusEvent) => void - onBlurCapture?: (event: FocusEvent) => void - onMouseEnter?: () => void - onMouseLeave?: () => void - onKeyDown?: (event: KeyboardEvent) => void - onKeyDownCapture?: (event: KeyboardEvent) => void - style?: Styles - stickyScroll?: boolean - children?: ReactNode - } + ref?: Ref; + tabIndex?: number; + autoFocus?: boolean; + onClick?: (event: ClickEvent) => void; + onFocus?: (event: FocusEvent) => void; + onFocusCapture?: (event: FocusEvent) => void; + onBlur?: (event: FocusEvent) => void; + onBlurCapture?: (event: FocusEvent) => void; + onMouseEnter?: () => void; + onMouseLeave?: () => void; + onKeyDown?: (event: KeyboardEvent) => void; + onKeyDownCapture?: (event: KeyboardEvent) => void; + style?: Styles; + stickyScroll?: boolean; + children?: ReactNode; + }; 'ink-text': { - style?: Styles - textStyles?: TextStyles - children?: ReactNode - } + style?: Styles; + textStyles?: TextStyles; + children?: ReactNode; + }; 'ink-link': { - href?: string - children?: ReactNode - } + href?: string; + children?: ReactNode; + }; 'ink-raw-ansi': { - rawText?: string - rawWidth?: number - rawHeight?: number - } + rawText?: string; + rawWidth?: number; + rawHeight?: number; + }; } } } diff --git a/scripts/auto-rebase.ts b/scripts/auto-rebase.ts new file mode 100644 index 000000000..755fa3b45 --- /dev/null +++ b/scripts/auto-rebase.ts @@ -0,0 +1,120 @@ +import { execSync } from 'child_process' +import { readFileSync, writeFileSync } from 'fs' + +function run(cmd: string): string { + try { + return execSync(cmd, { encoding: 'utf-8', env: { ...process.env, GIT_EDITOR: 'true' } }) + } catch (e: any) { + return (e.stdout || '') + (e.stderr || '') + } +} + +function getConflictedFiles(): string[] { + const out = run('git diff --name-only --diff-filter=U') + return out.trim().split('\n').filter(Boolean) +} + +function resolveConflictMarkers(content: string): string { + if (!content.includes('<<<<<<<')) return content + const lines = content.split('\n') + const result: string[] = [] + let state: 'normal' | 'ours' | 'theirs' = 'normal' + let oursLines: string[] = [] + let theirsLines: string[] = [] + + for (const line of lines) { + if (line.startsWith('<<<<<<<')) { + state = 'ours' + oursLines = [] + theirsLines = [] + } else if (line === '=======') { + state = 'theirs' + } else if (line.startsWith('>>>>>>>')) { + state = 'normal' + result.push(...oursLines, ...theirsLines) + } else if (state === 'ours') { + oursLines.push(line) + } else if (state === 'theirs') { + theirsLines.push(line) + } else { + result.push(line) + } + } + return result.join('\n') +} + +function resolveConflicts(): boolean { + const files = getConflictedFiles() + if (files.length === 0) return true + console.log(` Conflicted files: ${files.join(', ')}`) + + for (const file of files) { + if (file === 'bun.lock') { + run(`git checkout --theirs "${file}"`) + } else { + try { + const content = readFileSync(file, 'utf-8') + const resolved = resolveConflictMarkers(content) + writeFileSync(file, resolved, 'utf-8') + } catch { + run(`git checkout --theirs "${file}"`) + } + } + run(`git add "${file}"`) + } + return true +} + +console.log('Starting automated rebase...\n') + +let conflictCount = 0 +let iterations = 0 +const maxIterations = 300 + +// Start the rebase +let output = run('git rebase origin/main') +console.log(output.substring(0, 500)) + +while (iterations++ < maxIterations) { + const status = run('git status') + + if (!status.includes('rebasing') && !status.includes('rebase')) { + console.log('\nRebase completed!') + break + } + + const conflicted = getConflictedFiles() + if (conflicted.length > 0) { + conflictCount++ + const commitMatch = status.match(/Could not apply (\w+)/) + const commitInfo = commitMatch ? commitMatch[1] : 'unknown' + console.log(`\n[${iterations}] Conflict #${conflictCount} (${commitInfo}): ${conflicted.join(', ')}`) + + // Handle delete/modify conflicts + for (const file of conflicted) { + const diffOutput = run(`git diff --diff-filter=D -- "${file}"`) + if (diffOutput.includes('deleted in')) { + // If file was deleted in the commit being applied, accept the deletion + run(`git rm "${file}" 2>/dev/null || git checkout --theirs "${file}" && git add "${file}"`) + } + } + + resolveConflicts() + } + + output = run('git rebase --continue') + if (output.includes('successfully rebased')) { + console.log('\nRebase completed successfully!') + break + } + if (output.includes('CONFLICT') || output.includes('could not apply')) { + continue + } + if (output.includes('fatal') || output.includes('error: failed')) { + console.error('Fatal error:', output) + break + } + console.log(output.substring(0, 300)) +} + +console.log(`\nTotal conflicts resolved: ${conflictCount}`) diff --git a/src/commands/agents-platform/index.js b/src/commands/agents-platform/index.js deleted file mode 100644 index 9af11a8c0..000000000 --- a/src/commands/agents-platform/index.js +++ /dev/null @@ -1 +0,0 @@ -export default { name: 'agents-platform', type: 'local', isEnabled: () => false } diff --git a/src/commands/autofix-pr/index.d.ts b/src/commands/autofix-pr/index.d.ts deleted file mode 100644 index 292a8d3fb..000000000 --- a/src/commands/autofix-pr/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Command } from '../../types/command.js' -declare const _default: Command -export default _default diff --git a/src/commands/autofix-pr/index.js b/src/commands/autofix-pr/index.js deleted file mode 100644 index e1a619d25..000000000 --- a/src/commands/autofix-pr/index.js +++ /dev/null @@ -1 +0,0 @@ -export default { isEnabled: () => false, isHidden: true, name: 'stub' }; diff --git a/src/commands/break-cache/index.js b/src/commands/break-cache/index.js deleted file mode 100644 index e1a619d25..000000000 --- a/src/commands/break-cache/index.js +++ /dev/null @@ -1 +0,0 @@ -export default { isEnabled: () => false, isHidden: true, name: 'stub' }; diff --git a/src/commands/ctx_viz/index.d.ts b/src/commands/ctx_viz/index.d.ts deleted file mode 100644 index 292a8d3fb..000000000 --- a/src/commands/ctx_viz/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Command } from '../../types/command.js' -declare const _default: Command -export default _default diff --git a/src/commands/debug-tool-call/index.js b/src/commands/debug-tool-call/index.js deleted file mode 100644 index e1a619d25..000000000 --- a/src/commands/debug-tool-call/index.js +++ /dev/null @@ -1 +0,0 @@ -export default { isEnabled: () => false, isHidden: true, name: 'stub' }; diff --git a/src/commands/env/index.js b/src/commands/env/index.js deleted file mode 100644 index e1a619d25..000000000 --- a/src/commands/env/index.js +++ /dev/null @@ -1 +0,0 @@ -export default { isEnabled: () => false, isHidden: true, name: 'stub' }; diff --git a/src/commands/issue/index.js b/src/commands/issue/index.js deleted file mode 100644 index e1a619d25..000000000 --- a/src/commands/issue/index.js +++ /dev/null @@ -1 +0,0 @@ -export default { isEnabled: () => false, isHidden: true, name: 'stub' }; diff --git a/src/commands/onboarding/index.d.ts b/src/commands/onboarding/index.d.ts deleted file mode 100644 index 292a8d3fb..000000000 --- a/src/commands/onboarding/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Command } from '../../types/command.js' -declare const _default: Command -export default _default diff --git a/src/commands/onboarding/index.js b/src/commands/onboarding/index.js deleted file mode 100644 index e1a619d25..000000000 --- a/src/commands/onboarding/index.js +++ /dev/null @@ -1 +0,0 @@ -export default { isEnabled: () => false, isHidden: true, name: 'stub' }; diff --git a/src/commands/perf-issue/index.js b/src/commands/perf-issue/index.js deleted file mode 100644 index e1a619d25..000000000 --- a/src/commands/perf-issue/index.js +++ /dev/null @@ -1 +0,0 @@ -export default { isEnabled: () => false, isHidden: true, name: 'stub' }; diff --git a/src/commands/reset-limits/index.js b/src/commands/reset-limits/index.js deleted file mode 100644 index b14cedac2..000000000 --- a/src/commands/reset-limits/index.js +++ /dev/null @@ -1,4 +0,0 @@ -const stub = { isEnabled: () => false, isHidden: true, name: 'stub' } -export default stub -export const resetLimits = stub -export const resetLimitsNonInteractive = stub diff --git a/src/commands/share/index.js b/src/commands/share/index.js deleted file mode 100644 index e1a619d25..000000000 --- a/src/commands/share/index.js +++ /dev/null @@ -1 +0,0 @@ -export default { isEnabled: () => false, isHidden: true, name: 'stub' }; diff --git a/src/commands/teleport/index.js b/src/commands/teleport/index.js deleted file mode 100644 index e1a619d25..000000000 --- a/src/commands/teleport/index.js +++ /dev/null @@ -1 +0,0 @@ -export default { isEnabled: () => false, isHidden: true, name: 'stub' }; diff --git a/src/entrypoints/sdk/controlTypes.js b/src/entrypoints/sdk/controlTypes.js deleted file mode 100644 index d53c7b7ea..000000000 --- a/src/entrypoints/sdk/controlTypes.js +++ /dev/null @@ -1,8 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type StdoutMessage = any -export type SDKControlInitializeRequest = any -export type SDKControlInitializeResponse = any -export type SDKControlMcpSetServersResponse = any -export type SDKControlReloadPluginsResponse = any -export type StdinMessage = any -export type SDKPartialAssistantMessage = any diff --git a/src/entrypoints/sdk/runtimeTypes.js b/src/entrypoints/sdk/runtimeTypes.js deleted file mode 100644 index 077755592..000000000 --- a/src/entrypoints/sdk/runtimeTypes.js +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type EffortLevel = 'low' | 'medium' | 'high' | 'xhigh' | 'max' diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 26e2669b1..64dab17c5 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -9,7 +9,6 @@ declare namespace MACRO { export const VERSION: string export const BUILD_TIME: string - export const COMMIT: string export const FEEDBACK_CHANNEL: string export const ISSUES_EXPLAINER: string export const NATIVE_PACKAGE_URL: string @@ -22,9 +21,7 @@ declare namespace MACRO { // These are referenced inside `MACRO(() => ...)` or `false && ...` blocks. // Model resolution (internal) -declare function resolveAntModel( - model: string, -): import('../utils/model/antModels.js').AntModel | undefined +declare function resolveAntModel(model: string): import('../utils/model/antModels.js').AntModel | undefined declare function getAntModels(): import('../utils/model/antModels.js').AntModel[] declare function getAntModelOverrideConfig(): { defaultSystemPromptSuffix?: string @@ -34,13 +31,7 @@ declare function getAntModelOverrideConfig(): { // Companion reactions handled by src/buddy/companionReact.ts (direct import) // Metrics (internal) -type ApiMetricEntry = { - ttftMs: number - firstTokenTime: number - lastTokenTime: number - responseLengthBaseline: number - endResponseLength: number -} +type ApiMetricEntry = { ttftMs: number; firstTokenTime: number; lastTokenTime: number; responseLengthBaseline: number; endResponseLength: number } declare const apiMetricsRef: React.RefObject | null declare function computeTtftText(metrics: ApiMetricEntry[]): string @@ -62,10 +53,7 @@ declare const HOOK_TIMING_DISPLAY_THRESHOLD_MS: number declare type T = unknown // Tungsten (internal) -declare function TungstenPill(props?: { - key?: string - selected?: boolean -}): JSX.Element | null +declare function TungstenPill(props?: { key?: string; selected?: boolean }): JSX.Element | null // ============================================================================ // Build-time constants BUILD_TARGET/BUILD_ENV/INTERFACE_TYPE — removed (zero runtime usage) diff --git a/src/types/ink-elements.d.ts b/src/types/ink-elements.d.ts index 86542b155..f98f08e53 100644 --- a/src/types/ink-elements.d.ts +++ b/src/types/ink-elements.d.ts @@ -1,52 +1,45 @@ // Type declarations for custom Ink JSX elements // Note: The detailed prop types are defined in ink-jsx.d.ts via React module augmentation. // This file provides the global JSX namespace fallback declarations. -import type { ReactNode, Ref } from 'react' -import type { - ClickEvent, - FocusEvent, - KeyboardEvent, - Styles, - TextStyles, - DOMElement, -} from '@anthropic/ink' +import type { ReactNode, Ref } from 'react'; +import type { ClickEvent, FocusEvent, KeyboardEvent, Styles, TextStyles, DOMElement } from '@anthropic/ink'; declare global { namespace JSX { interface IntrinsicElements { 'ink-box': { - ref?: Ref - tabIndex?: number - autoFocus?: boolean - onClick?: (event: ClickEvent) => void - onFocus?: (event: FocusEvent) => void - onFocusCapture?: (event: FocusEvent) => void - onBlur?: (event: FocusEvent) => void - onBlurCapture?: (event: FocusEvent) => void - onMouseEnter?: () => void - onMouseLeave?: () => void - onKeyDown?: (event: KeyboardEvent) => void - onKeyDownCapture?: (event: KeyboardEvent) => void - style?: Styles - stickyScroll?: boolean - children?: ReactNode - } + ref?: Ref; + tabIndex?: number; + autoFocus?: boolean; + onClick?: (event: ClickEvent) => void; + onFocus?: (event: FocusEvent) => void; + onFocusCapture?: (event: FocusEvent) => void; + onBlur?: (event: FocusEvent) => void; + onBlurCapture?: (event: FocusEvent) => void; + onMouseEnter?: () => void; + onMouseLeave?: () => void; + onKeyDown?: (event: KeyboardEvent) => void; + onKeyDownCapture?: (event: KeyboardEvent) => void; + style?: Styles; + stickyScroll?: boolean; + children?: ReactNode; + }; 'ink-text': { - style?: Styles - textStyles?: TextStyles - children?: ReactNode - } + style?: Styles; + textStyles?: TextStyles; + children?: ReactNode; + }; 'ink-link': { - href?: string - children?: ReactNode - } + href?: string; + children?: ReactNode; + }; 'ink-raw-ansi': { - rawText?: string - rawWidth?: number - rawHeight?: number - } + rawText?: string; + rawWidth?: number; + rawHeight?: number; + }; } } } -export {} +export {}; diff --git a/src/types/ink-jsx.d.ts b/src/types/ink-jsx.d.ts index 7b4c6168b..2c8911c71 100644 --- a/src/types/ink-jsx.d.ts +++ b/src/types/ink-jsx.d.ts @@ -8,50 +8,43 @@ * This file must be a module (have an import/export) for `declare module` * augmentation to work correctly. */ -import type { ReactNode, Ref } from 'react' -import type { - ClickEvent, - FocusEvent, - KeyboardEvent, - Styles, - TextStyles, - DOMElement, -} from '@anthropic/ink' +import type { ReactNode, Ref } from 'react'; +import type { ClickEvent, FocusEvent, KeyboardEvent, Styles, TextStyles, DOMElement } from '@anthropic/ink'; declare module 'react' { namespace JSX { interface IntrinsicElements { 'ink-box': { - ref?: Ref - tabIndex?: number - autoFocus?: boolean - onClick?: (event: ClickEvent) => void - onFocus?: (event: FocusEvent) => void - onFocusCapture?: (event: FocusEvent) => void - onBlur?: (event: FocusEvent) => void - onBlurCapture?: (event: FocusEvent) => void - onMouseEnter?: () => void - onMouseLeave?: () => void - onKeyDown?: (event: KeyboardEvent) => void - onKeyDownCapture?: (event: KeyboardEvent) => void - style?: Styles - stickyScroll?: boolean - children?: ReactNode - } + ref?: Ref; + tabIndex?: number; + autoFocus?: boolean; + onClick?: (event: ClickEvent) => void; + onFocus?: (event: FocusEvent) => void; + onFocusCapture?: (event: FocusEvent) => void; + onBlur?: (event: FocusEvent) => void; + onBlurCapture?: (event: FocusEvent) => void; + onMouseEnter?: () => void; + onMouseLeave?: () => void; + onKeyDown?: (event: KeyboardEvent) => void; + onKeyDownCapture?: (event: KeyboardEvent) => void; + style?: Styles; + stickyScroll?: boolean; + children?: ReactNode; + }; 'ink-text': { - style?: Styles - textStyles?: TextStyles - children?: ReactNode - } + style?: Styles; + textStyles?: TextStyles; + children?: ReactNode; + }; 'ink-link': { - href?: string - children?: ReactNode - } + href?: string; + children?: ReactNode; + }; 'ink-raw-ansi': { - rawText?: string - rawWidth?: number - rawHeight?: number - } + rawText?: string; + rawWidth?: number; + rawHeight?: number; + }; } } } diff --git a/src/types/internal-modules.d.ts b/src/types/internal-modules.d.ts index 1ea39dc67..6f94d93e9 100644 --- a/src/types/internal-modules.d.ts +++ b/src/types/internal-modules.d.ts @@ -7,53 +7,25 @@ // ============================================================================ // bun:bundle — compile-time macros // ============================================================================ -declare module 'bun:bundle' { - export function feature(name: string): boolean +declare module "bun:bundle" { + export function feature(name: string): boolean; } -declare module 'bun:ffi' { - export function dlopen< - T extends Record, - >( - path: string, - symbols: T, - ): { - symbols: { [K in keyof T]: (...args: unknown[]) => unknown } - close(): void - } +declare module "bun:ffi" { + export function dlopen>(path: string, symbols: T): { symbols: { [K in keyof T]: (...args: unknown[]) => unknown }; close(): void }; } // Third-party modules without @types packages declare module 'bidi-js' { - function getEmbeddingLevels( - text: string, - defaultDirection?: string, - ): { paragraphLevel: number; levels: Uint8Array } - function getReorderSegments( - text: string, - embeddingLevels: { paragraphLevel: number; levels: Uint8Array }, - start?: number, - end?: number, - ): [number, number][] + function getEmbeddingLevels(text: string, defaultDirection?: string): { paragraphLevel: number; levels: Uint8Array } + function getReorderSegments(text: string, embeddingLevels: { paragraphLevel: number; levels: Uint8Array }, start?: number, end?: number): [number, number][] function getVisualOrder(reorderSegments: [number, number][]): number[] export { getEmbeddingLevels, getReorderSegments, getVisualOrder } export default { getEmbeddingLevels, getReorderSegments, getVisualOrder } } declare module 'asciichart' { - function plot( - series: number[] | number[][], - config?: Record, - ): string + function plot(series: number[] | number[][], config?: Record): string export { plot } export default { plot } } - -declare module '@napi-rs/keyring' { - export class Entry { - constructor(service: string, account: string) - getPassword(): string | null - setPassword(password: string): void - deletePassword(): boolean - } -} diff --git a/src/types/sdk-stubs.d.ts b/src/types/sdk-stubs.d.ts index 272d6f85c..6633a5eb1 100644 --- a/src/types/sdk-stubs.d.ts +++ b/src/types/sdk-stubs.d.ts @@ -9,7 +9,7 @@ // ============================================================================ // coreTypes.generated.js — Generated from coreSchemas.ts Zod schemas // ============================================================================ -declare module '*/sdk/coreTypes.generated.js' { +declare module "*/sdk/coreTypes.generated.js" { // Usage & Model export type ModelUsage = { inputTokens: number @@ -32,20 +32,20 @@ declare module '*/sdk/coreTypes.generated.js' { export type McpServerConfigForProcessTransport = { command: string args: string[] - type?: 'stdio' + type?: "stdio" env?: Record } & { scope: string; pluginSource?: string } export type McpServerStatus = { name: string - status: 'connected' | 'disconnected' | 'error' + status: "connected" | "disconnected" | "error" [key: string]: unknown } // Permissions export type PermissionMode = string export type PermissionResult = - | { behavior: 'allow' } - | { behavior: 'deny'; message?: string } + | { behavior: "allow" } + | { behavior: "deny"; message?: string } export type PermissionUpdate = { path: string permission: string @@ -91,56 +91,21 @@ declare module '*/sdk/coreTypes.generated.js' { // SDK Message types export type SDKMessage = { type: string; [key: string]: unknown } - export type SDKUserMessage = { - type: 'user' - content: unknown - uuid: string - [key: string]: unknown - } + export type SDKUserMessage = { type: "user"; content: unknown; uuid: string; [key: string]: unknown } export type SDKUserMessageReplay = SDKUserMessage - export type SDKAssistantMessage = { - type: 'assistant' - content: unknown - [key: string]: unknown - } - export type SDKAssistantErrorMessage = { - type: 'assistant_error' - error: unknown - [key: string]: unknown - } - export type SDKAssistantMessageError = - | 'authentication_failed' - | 'billing_error' - | 'rate_limit' - | 'invalid_request' - | 'server_error' - | 'unknown' - | 'max_output_tokens' - export type SDKPartialAssistantMessage = { - type: 'partial_assistant' - [key: string]: unknown - } - export type SDKResultMessage = { type: 'result'; [key: string]: unknown } - export type SDKResultSuccess = { - type: 'result_success' - [key: string]: unknown - } - export type SDKSystemMessage = { type: 'system'; [key: string]: unknown } - export type SDKStatusMessage = { type: 'status'; [key: string]: unknown } - export type SDKToolProgressMessage = { - type: 'tool_progress' - [key: string]: unknown - } - export type SDKCompactBoundaryMessage = { - type: 'compact_boundary' - [key: string]: unknown - } - export type SDKPermissionDenial = { - type: 'permission_denial' - [key: string]: unknown - } - export type SDKRateLimitInfo = { type: 'rate_limit'; [key: string]: unknown } - export type SDKStatus = 'active' | 'idle' | 'error' | string + export type SDKAssistantMessage = { type: "assistant"; content: unknown; [key: string]: unknown } + export type SDKAssistantErrorMessage = { type: "assistant_error"; error: unknown; [key: string]: unknown } + export type SDKAssistantMessageError = 'authentication_failed' | 'billing_error' | 'rate_limit' | 'invalid_request' | 'server_error' | 'unknown' | 'max_output_tokens' + export type SDKPartialAssistantMessage = { type: "partial_assistant"; [key: string]: unknown } + export type SDKResultMessage = { type: "result"; [key: string]: unknown } + export type SDKResultSuccess = { type: "result_success"; [key: string]: unknown } + export type SDKSystemMessage = { type: "system"; [key: string]: unknown } + export type SDKStatusMessage = { type: "status"; [key: string]: unknown } + export type SDKToolProgressMessage = { type: "tool_progress"; [key: string]: unknown } + export type SDKCompactBoundaryMessage = { type: "compact_boundary"; [key: string]: unknown } + export type SDKPermissionDenial = { type: "permission_denial"; [key: string]: unknown } + export type SDKRateLimitInfo = { type: "rate_limit"; [key: string]: unknown } + export type SDKStatus = "active" | "idle" | "error" | string export type SDKSessionInfo = { sessionId: string summary?: string