@gajae-code/coding-agent 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +1 -1
  3. package/dist/types/async/job-manager.d.ts +6 -0
  4. package/dist/types/cli/setup-cli.d.ts +8 -1
  5. package/dist/types/commands/setup.d.ts +7 -0
  6. package/dist/types/config/file-lock.d.ts +24 -2
  7. package/dist/types/config/model-registry.d.ts +4 -0
  8. package/dist/types/config/models-config-schema.d.ts +5 -0
  9. package/dist/types/config/settings-schema.d.ts +62 -0
  10. package/dist/types/dap/client.d.ts +2 -1
  11. package/dist/types/edit/read-file.d.ts +6 -0
  12. package/dist/types/eval/js/context-manager.d.ts +3 -0
  13. package/dist/types/eval/js/executor.d.ts +1 -0
  14. package/dist/types/exec/bash-executor.d.ts +2 -0
  15. package/dist/types/gjc-runtime/state-writer.d.ts +64 -2
  16. package/dist/types/gjc-runtime/tmux-sessions.d.ts +7 -1
  17. package/dist/types/gjc-runtime/ultragoal-guard.d.ts +10 -0
  18. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +29 -0
  19. package/dist/types/lsp/types.d.ts +2 -0
  20. package/dist/types/modes/bridge/bridge-mode.d.ts +1 -0
  21. package/dist/types/modes/components/model-selector.d.ts +2 -0
  22. package/dist/types/modes/components/oauth-selector.d.ts +1 -0
  23. package/dist/types/modes/components/provider-onboarding-selector.d.ts +1 -1
  24. package/dist/types/modes/components/runtime-mcp-add-wizard.d.ts +1 -0
  25. package/dist/types/modes/components/tool-execution.d.ts +1 -0
  26. package/dist/types/modes/interactive-mode.d.ts +1 -1
  27. package/dist/types/modes/rpc/rpc-mode.d.ts +56 -1
  28. package/dist/types/modes/shared/agent-wire/unattended-session.d.ts +10 -0
  29. package/dist/types/modes/theme/defaults/index.d.ts +302 -0
  30. package/dist/types/modes/theme/theme.d.ts +1 -0
  31. package/dist/types/modes/types.d.ts +1 -1
  32. package/dist/types/runtime/process-lifecycle.d.ts +108 -0
  33. package/dist/types/runtime-mcp/transports/stdio.d.ts +1 -0
  34. package/dist/types/runtime-mcp/types.d.ts +2 -0
  35. package/dist/types/session/agent-session.d.ts +17 -1
  36. package/dist/types/session/artifacts.d.ts +4 -1
  37. package/dist/types/session/history-storage.d.ts +2 -2
  38. package/dist/types/session/session-manager.d.ts +10 -1
  39. package/dist/types/session/streaming-output.d.ts +5 -0
  40. package/dist/types/setup/credential-import.d.ts +79 -0
  41. package/dist/types/slash-commands/helpers/fast-status-report.d.ts +76 -0
  42. package/dist/types/task/executor.d.ts +1 -0
  43. package/dist/types/task/render.d.ts +1 -1
  44. package/dist/types/tools/bash.d.ts +1 -0
  45. package/dist/types/tools/browser/tab-supervisor.d.ts +9 -0
  46. package/dist/types/tools/sqlite-reader.d.ts +2 -1
  47. package/dist/types/tools/subagent-render.d.ts +7 -1
  48. package/dist/types/tools/subagent.d.ts +21 -0
  49. package/dist/types/tools/ultragoal-ask-guard.d.ts +5 -0
  50. package/dist/types/web/search/index.d.ts +4 -4
  51. package/dist/types/web/search/provider.d.ts +16 -20
  52. package/dist/types/web/search/providers/base.d.ts +2 -1
  53. package/dist/types/web/search/providers/openai-compatible.d.ts +9 -0
  54. package/dist/types/web/search/types.d.ts +14 -2
  55. package/package.json +7 -7
  56. package/scripts/build-binary.ts +7 -0
  57. package/src/async/job-manager.ts +153 -39
  58. package/src/cli/args.ts +2 -0
  59. package/src/cli/fast-help.ts +2 -0
  60. package/src/cli/setup-cli.ts +138 -3
  61. package/src/commands/setup.ts +5 -1
  62. package/src/commands/ultragoal.ts +3 -1
  63. package/src/config/file-lock-gc.ts +14 -2
  64. package/src/config/file-lock.ts +63 -13
  65. package/src/config/model-profile-activation.ts +15 -3
  66. package/src/config/model-profiles.ts +15 -15
  67. package/src/config/model-registry.ts +21 -1
  68. package/src/config/models-config-schema.ts +1 -0
  69. package/src/config/settings-schema.ts +62 -0
  70. package/src/dap/client.ts +105 -64
  71. package/src/dap/session.ts +44 -7
  72. package/src/defaults/gjc/skills/ultragoal/SKILL.md +30 -8
  73. package/src/edit/read-file.ts +19 -1
  74. package/src/eval/js/context-manager.ts +228 -65
  75. package/src/eval/js/executor.ts +2 -0
  76. package/src/eval/js/index.ts +1 -0
  77. package/src/eval/js/worker-core.ts +10 -6
  78. package/src/eval/py/executor.ts +68 -19
  79. package/src/eval/py/kernel.ts +46 -22
  80. package/src/eval/py/runner.py +68 -14
  81. package/src/exec/bash-executor.ts +49 -13
  82. package/src/gjc-runtime/deep-interview-recorder.ts +40 -0
  83. package/src/gjc-runtime/launch-tmux.ts +3 -4
  84. package/src/gjc-runtime/ralplan-runtime.ts +174 -12
  85. package/src/gjc-runtime/state-runtime.ts +2 -1
  86. package/src/gjc-runtime/state-writer.ts +254 -7
  87. package/src/gjc-runtime/tmux-gc.ts +88 -38
  88. package/src/gjc-runtime/tmux-sessions.ts +44 -6
  89. package/src/gjc-runtime/ultragoal-guard.ts +155 -0
  90. package/src/gjc-runtime/ultragoal-runtime.ts +1227 -31
  91. package/src/gjc-runtime/workflow-manifest.generated.json +44 -0
  92. package/src/gjc-runtime/workflow-manifest.ts +12 -0
  93. package/src/harness-control-plane/owner.ts +3 -2
  94. package/src/harness-control-plane/rpc-adapter.ts +1 -1
  95. package/src/hooks/skill-state.ts +121 -2
  96. package/src/internal-urls/artifact-protocol.ts +10 -1
  97. package/src/internal-urls/docs-index.generated.ts +14 -10
  98. package/src/lsp/client.ts +64 -26
  99. package/src/lsp/defaults.json +1 -0
  100. package/src/lsp/index.ts +2 -1
  101. package/src/lsp/lspmux.ts +33 -9
  102. package/src/lsp/types.ts +2 -0
  103. package/src/main.ts +14 -4
  104. package/src/modes/acp/acp-agent.ts +4 -2
  105. package/src/modes/bridge/bridge-mode.ts +23 -1
  106. package/src/modes/components/assistant-message.ts +10 -2
  107. package/src/modes/components/bash-execution.ts +5 -1
  108. package/src/modes/components/eval-execution.ts +5 -1
  109. package/src/modes/components/history-search.ts +5 -2
  110. package/src/modes/components/model-selector.ts +60 -2
  111. package/src/modes/components/oauth-selector.ts +5 -0
  112. package/src/modes/components/provider-onboarding-selector.ts +6 -1
  113. package/src/modes/components/runtime-mcp-add-wizard.ts +58 -7
  114. package/src/modes/components/skill-message.ts +24 -16
  115. package/src/modes/components/tool-execution.ts +6 -0
  116. package/src/modes/controllers/extension-ui-controller.ts +33 -6
  117. package/src/modes/controllers/input-controller.ts +5 -0
  118. package/src/modes/controllers/selector-controller.ts +86 -2
  119. package/src/modes/interactive-mode.ts +11 -1
  120. package/src/modes/rpc/rpc-mode.ts +132 -18
  121. package/src/modes/shared/agent-wire/command-dispatch.ts +5 -2
  122. package/src/modes/shared/agent-wire/host-tool-bridge.ts +3 -0
  123. package/src/modes/shared/agent-wire/unattended-session.ts +16 -1
  124. package/src/modes/theme/defaults/claude-code.json +100 -0
  125. package/src/modes/theme/defaults/codex.json +100 -0
  126. package/src/modes/theme/defaults/index.ts +6 -0
  127. package/src/modes/theme/defaults/opencode.json +102 -0
  128. package/src/modes/theme/theme.ts +2 -2
  129. package/src/modes/types.ts +1 -1
  130. package/src/modes/utils/ui-helpers.ts +5 -2
  131. package/src/prompts/agents/executor.md +5 -2
  132. package/src/runtime/process-lifecycle.ts +400 -0
  133. package/src/runtime-mcp/manager.ts +164 -50
  134. package/src/runtime-mcp/transports/http.ts +12 -11
  135. package/src/runtime-mcp/transports/stdio.ts +64 -38
  136. package/src/runtime-mcp/types.ts +3 -0
  137. package/src/sdk.ts +39 -1
  138. package/src/session/agent-session.ts +190 -33
  139. package/src/session/artifacts.ts +17 -2
  140. package/src/session/blob-store.ts +36 -2
  141. package/src/session/history-storage.ts +32 -11
  142. package/src/session/session-manager.ts +99 -31
  143. package/src/session/streaming-output.ts +54 -3
  144. package/src/setup/credential-import.ts +429 -0
  145. package/src/skill-state/deep-interview-mutation-guard.ts +2 -1
  146. package/src/slash-commands/builtin-registry.ts +30 -3
  147. package/src/slash-commands/helpers/fast-status-report.ts +111 -0
  148. package/src/task/executor.ts +7 -1
  149. package/src/task/render.ts +18 -7
  150. package/src/tools/archive-reader.ts +10 -1
  151. package/src/tools/ask.ts +4 -2
  152. package/src/tools/bash.ts +11 -4
  153. package/src/tools/browser/tab-supervisor.ts +22 -0
  154. package/src/tools/browser.ts +38 -4
  155. package/src/tools/cron.ts +1 -1
  156. package/src/tools/read.ts +11 -12
  157. package/src/tools/sqlite-reader.ts +19 -5
  158. package/src/tools/subagent-render.ts +119 -29
  159. package/src/tools/subagent.ts +147 -7
  160. package/src/tools/ultragoal-ask-guard.ts +39 -0
  161. package/src/web/search/index.ts +25 -25
  162. package/src/web/search/provider.ts +178 -87
  163. package/src/web/search/providers/base.ts +2 -1
  164. package/src/web/search/providers/openai-compatible.ts +151 -0
  165. package/src/web/search/types.ts +47 -22
@@ -2,6 +2,7 @@ import type { AgentToolUpdateCallback } from "@gajae-code/agent-core";
2
2
  export declare const DEFAULT_MAX_LINES = 3000;
3
3
  export declare const DEFAULT_MAX_BYTES: number;
4
4
  export declare const DEFAULT_MAX_COLUMN = 1024;
5
+ export declare const DEFAULT_ARTIFACT_MAX_BYTES: number;
5
6
  export interface OutputSummary {
6
7
  output: string;
7
8
  truncated: boolean;
@@ -19,6 +20,8 @@ export interface OutputSummary {
19
20
  columnTruncatedLines?: number;
20
21
  /** Artifact ID for internal URL access (artifact://<id>) when truncated */
21
22
  artifactId?: string;
23
+ /** Bytes omitted from artifact storage after the artifact hard cap was reached. */
24
+ artifactTruncatedBytes?: number;
22
25
  }
23
26
  export interface OutputSinkOptions {
24
27
  artifactPath?: string;
@@ -38,6 +41,8 @@ export interface OutputSinkOptions {
38
41
  * writes still respect the budget. Default 0 = no per-line cap.
39
42
  */
40
43
  maxColumns?: number;
44
+ /** Hard cap for artifact writes/pending replay. Default DEFAULT_ARTIFACT_MAX_BYTES. */
45
+ artifactMaxBytes?: number;
41
46
  onChunk?: (chunk: string) => void;
42
47
  /** Minimum ms between onChunk calls. 0 = every chunk (default). */
43
48
  chunkThrottleMs?: number;
@@ -0,0 +1,79 @@
1
+ import type { AuthCredential } from "@gajae-code/ai";
2
+ /** gjc provider ids that external credentials map onto. */
3
+ export type ExternalProvider = "anthropic" | "openai-codex";
4
+ /** Where a discovered credential came from. */
5
+ export type CredentialOrigin = "claude-code-file" | "claude-code-keychain" | "codex-file";
6
+ /** Human labels for providers, used in redacted summaries. */
7
+ export declare const EXTERNAL_PROVIDER_LABELS: Record<ExternalProvider, string>;
8
+ /** A credential that can be safely imported into gjc's store. */
9
+ export interface ImportableCredential {
10
+ provider: ExternalProvider;
11
+ origin: CredentialOrigin;
12
+ /** Redacted, human-readable description of where this came from. */
13
+ source: string;
14
+ kind: AuthCredential["type"];
15
+ identity?: {
16
+ email?: string;
17
+ accountId?: string;
18
+ };
19
+ /** Epoch-ms expiry for OAuth credentials, when known. */
20
+ expiresAt?: number;
21
+ /** Redacted access token / API key — safe to display. */
22
+ redactedToken: string;
23
+ /** Opaque credential payload. Never include this in any summary output. */
24
+ credential: AuthCredential;
25
+ }
26
+ /** A source that was found but could not be imported. */
27
+ export interface SkippedCredential {
28
+ origin: CredentialOrigin;
29
+ source: string;
30
+ reason: string;
31
+ }
32
+ /** Ambient environment-backed auth that is already usable without import. */
33
+ export interface EnvironmentCredentialHint {
34
+ provider: ExternalProvider;
35
+ variable: string;
36
+ redactedValue: string;
37
+ }
38
+ export interface CredentialDiscoveryResult {
39
+ importable: ImportableCredential[];
40
+ skipped: SkippedCredential[];
41
+ environment: EnvironmentCredentialHint[];
42
+ }
43
+ export interface DiscoveryOptions {
44
+ /** Override the home directory (defaults to `os.homedir()`). */
45
+ homeDir?: string;
46
+ /** Override the environment (defaults to `process.env`). */
47
+ env?: Record<string, string | undefined>;
48
+ /** Override the platform (defaults to `process.platform`). */
49
+ platform?: NodeJS.Platform;
50
+ /**
51
+ * Reader for the macOS Keychain `Claude Code-credentials` entry. Defaults to
52
+ * shelling out to `security`; injected in tests. Returns the raw JSON string,
53
+ * or `null` when no entry exists.
54
+ */
55
+ readClaudeKeychain?: () => Promise<string | null>;
56
+ }
57
+ export type CredentialUpserter = (provider: string, credential: AuthCredential) => unknown | Promise<unknown>;
58
+ export interface ImportSummary {
59
+ imported: ImportableCredential[];
60
+ failed: Array<{
61
+ credential: ImportableCredential;
62
+ error: string;
63
+ }>;
64
+ }
65
+ /**
66
+ * Discover Claude Code and Codex CLI credentials across files, the macOS
67
+ * Keychain, and environment variables. Never throws for individual unreadable or
68
+ * malformed sources — those land in {@link CredentialDiscoveryResult.skipped}.
69
+ */
70
+ export declare function discoverExternalCredentials(options?: DiscoveryOptions): Promise<CredentialDiscoveryResult>;
71
+ /** Redacted one-line summary of an importable credential. Never includes secrets. */
72
+ export declare function formatCredentialSummary(credential: ImportableCredential): string;
73
+ /** Redacted summary lines for an entire discovery result. Never includes secrets. */
74
+ export declare function formatDiscoverySummary(result: CredentialDiscoveryResult): string[];
75
+ /**
76
+ * Persist discovered credentials via `upsert`. Each credential is imported
77
+ * independently; a failure on one is recorded without aborting the rest.
78
+ */
79
+ export declare function importCredentials(credentials: readonly ImportableCredential[], upsert: CredentialUpserter): Promise<ImportSummary>;
@@ -0,0 +1,76 @@
1
+ import type { Model } from "@gajae-code/ai";
2
+ /**
3
+ * A single line in the `/fast status` report: a labelled model and whether fast
4
+ * mode is effective for it. The `fast` flag is resolved by the caller
5
+ * (`buildFastStatusReport`) so each row can use the correct service tier — the
6
+ * main session tier for the current model / `modelRoles` roles, or the subagent
7
+ * tier (`task.serviceTier`) for `task.agentModelOverrides` roles.
8
+ */
9
+ export interface FastStatusRow {
10
+ /** Display label, e.g. "현재 모델", "DEFAULT", "EXECUTOR". */
11
+ label: string;
12
+ /** Resolved model for this row, if any. */
13
+ model?: Model;
14
+ /** Whether fast mode is effective for this row's model. */
15
+ fast: boolean;
16
+ }
17
+ export interface FormatFastStatusReportArgs {
18
+ rows: FastStatusRow[];
19
+ /** The active theme's fast icon token (`theme.icon.fast`). */
20
+ iconFast: string;
21
+ /** Optional decorator for inactive ("off") text, e.g. theme dim in the TUI. */
22
+ formatInactive?: (text: string) => string;
23
+ }
24
+ /** Title line of the `/fast status` report. */
25
+ export declare const FAST_STATUS_TITLE = "Fast \uBAA8\uB4DC \uC0C1\uD0DC";
26
+ /** The inactive marker shown for rows where fast mode does not apply. */
27
+ export declare const FAST_STATUS_OFF = "off";
28
+ /**
29
+ * Format a multiline `/fast status` report. Pure and shared by the CLI
30
+ * (`handle`) and TUI (`handleTui`) command branches so the two never drift.
31
+ * Each row's fast/off state is decided by the caller (see
32
+ * {@link buildFastStatusReport}) so per-row service-tier differences are honored.
33
+ */
34
+ export declare function formatFastStatusReport(args: FormatFastStatusReportArgs): string;
35
+ /** Minimal session surface needed to build the `/fast status` report. */
36
+ export interface FastStatusSessionLike {
37
+ readonly model?: Model;
38
+ /** Fast predicate against the main session tier (current model + `modelRoles`). */
39
+ isFastForProvider(provider?: string): boolean;
40
+ /** Fast predicate against the effective subagent tier (`task.agentModelOverrides` roles). */
41
+ isFastForSubagentProvider(provider?: string): boolean;
42
+ resolveRoleModelWithThinking(role: string): {
43
+ model?: Model;
44
+ };
45
+ }
46
+ /** A role to enumerate in the report, with the tier source its subagent runs under. */
47
+ export interface FastStatusRoleTarget {
48
+ id: string;
49
+ label: string;
50
+ /**
51
+ * True for `task.agentModelOverrides` roles (executor/architect/planner/critic)
52
+ * that run under `task.serviceTier`; false for `modelRoles` roles (default)
53
+ * that run under the main session tier.
54
+ */
55
+ isSubagentRole: boolean;
56
+ }
57
+ export interface BuildFastStatusReportArgs {
58
+ session: FastStatusSessionLike;
59
+ /** Role targets to enumerate, in display order. */
60
+ roleTargets: ReadonlyArray<FastStatusRoleTarget>;
61
+ /** The active theme's fast icon token (`theme.icon.fast`). */
62
+ iconFast: string;
63
+ /** Optional decorator for inactive ("off") text, e.g. theme dim in the TUI. */
64
+ formatInactive?: (text: string) => string;
65
+ }
66
+ /**
67
+ * Build the `/fast status` report from a live session: the active/current model
68
+ * followed by each assigned role (subagent) model. Unassigned roles are skipped
69
+ * so the report mirrors the `/model` selector, which only badges assigned roles.
70
+ *
71
+ * Subagent roles (`task.agentModelOverrides`) are evaluated against the
72
+ * effective subagent tier (`task.serviceTier`), while the current model and
73
+ * `modelRoles` roles use the main session tier — matching where each model
74
+ * actually runs.
75
+ */
76
+ export declare function buildFastStatusReport(args: BuildFastStatusReportArgs): string;
@@ -105,6 +105,7 @@ interface FinalizeSubprocessOutputResult {
105
105
  export declare const SUBAGENT_WARNING_NULL_YIELD = "SYSTEM WARNING: Subagent called yield with null data.";
106
106
  export declare const SUBAGENT_WARNING_MISSING_YIELD = "SYSTEM WARNING: Subagent exited without calling yield tool after 3 reminders.";
107
107
  export declare function finalizeSubprocessOutput(args: FinalizeSubprocessOutputArgs): FinalizeSubprocessOutputResult;
108
+ export declare function createSubagentSettings(baseSettings: Settings): Settings;
108
109
  /**
109
110
  * Run a single agent in-process.
110
111
  */
@@ -11,7 +11,7 @@ export declare function renderCall(args: TaskParams, _options: RenderResultOptio
11
11
  * `subagent` await panel. Reuses the internal task-progress renderer so the
12
12
  * await panel stays at parity with the inline task panel.
13
13
  */
14
- export declare function renderSubagentLiveProgress(progress: AgentProgress, expanded: boolean, theme: Theme, spinnerFrame?: number): string[];
14
+ export declare function renderSubagentLiveProgress(progress: AgentProgress, expanded: boolean, theme: Theme, spinnerFrame?: number, staticTime?: boolean): string[];
15
15
  /**
16
16
  * Render the tool result.
17
17
  */
@@ -6,6 +6,7 @@ import { type Theme } from "../modes/theme/theme";
6
6
  import type { ToolSession } from ".";
7
7
  import { type OutputMeta } from "./output-meta";
8
8
  export declare const BASH_DEFAULT_PREVIEW_LINES = 10;
9
+ export declare function saveBashOriginalArtifactForTests(session: ToolSession, originalText: string): Promise<string | undefined>;
9
10
  declare const bashSchemaBase: z.ZodObject<{
10
11
  command: z.ZodString;
11
12
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -26,6 +26,8 @@ export interface TabSession {
26
26
  pending: Map<string, PendingRun>;
27
27
  dialogPolicy?: DialogPolicy;
28
28
  kindTag: BrowserKindTag;
29
+ /** Session that acquired this tab; used for session-scoped teardown (F13). */
30
+ ownerId?: string;
29
31
  }
30
32
  export interface AcquireTabOptions {
31
33
  url?: string;
@@ -39,6 +41,8 @@ export interface AcquireTabOptions {
39
41
  signal?: AbortSignal;
40
42
  timeoutMs: number;
41
43
  dialogs?: DialogPolicy;
44
+ /** Owning session id so dispose can release only this session's tabs (F13). */
45
+ ownerId?: string;
42
46
  }
43
47
  export interface AcquireTabResult {
44
48
  tab: TabSession;
@@ -58,6 +62,11 @@ export declare function acquireTab(name: string, browser: BrowserHandle, opts: A
58
62
  export declare function runInTab(name: string, opts: RunInTabOptions): Promise<RunResultOk>;
59
63
  export declare function releaseTab(name: string, opts?: ReleaseTabOptions): Promise<boolean>;
60
64
  export declare function releaseAllTabs(opts?: ReleaseTabOptions): Promise<number>;
65
+ /**
66
+ * Release only the tabs owned by `ownerId` (F13 session-scoped teardown). Tabs acquired
67
+ * by other sessions (or with no owner) are left untouched. No-op for a null/empty owner.
68
+ */
69
+ export declare function releaseTabsForOwner(ownerId: string | null | undefined, opts?: ReleaseTabOptions): Promise<number>;
61
70
  export declare function dropHeadlessTabs(): Promise<void>;
62
71
  export declare function initializeTabWorkerForTest(worker: WorkerHandle, payload: WorkerInitPayload, timeoutMs: number): Promise<ReadyInfo>;
63
72
  export {};
@@ -60,9 +60,10 @@ export declare function getRowByKey(db: Database, table: string, pk: {
60
60
  type?: string;
61
61
  }, key: string): Record<string, unknown> | null;
62
62
  export declare function getRowByRowId(db: Database, table: string, key: string): Record<string, unknown> | null;
63
- export declare function executeReadQuery(db: Database, sql: string): {
63
+ export declare function executeReadQuery(db: Database, sql: string, maxRows?: number): {
64
64
  columns: string[];
65
65
  rows: Record<string, unknown>[];
66
+ truncated: boolean;
66
67
  };
67
68
  export declare function insertRow(db: Database, table: string, data: Record<string, unknown>): void;
68
69
  export declare function updateRowByKey(db: Database, table: string, pk: {
@@ -10,7 +10,13 @@
10
10
  import type { Component } from "@gajae-code/tui";
11
11
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
12
12
  import type { Theme } from "../modes/theme/theme";
13
- import type { SubagentToolDetails } from "./subagent";
13
+ import { type SubagentToolDetails } from "./subagent";
14
+ /** Test-only seam (PR3 deterministic cache-hit assertions). */
15
+ export declare const subagentBodyCacheTestHooks: {
16
+ readonly bodyRenders: number;
17
+ readonly size: number;
18
+ reset(): void;
19
+ };
14
20
  export declare const subagentToolRenderer: {
15
21
  inline: boolean;
16
22
  renderCall(_args: unknown, _options: RenderResultOptions, theme: Theme): Component;
@@ -90,4 +90,25 @@ export declare class SubagentTool implements AgentTool<typeof subagentSchema, Su
90
90
  constructor(session: ToolSession);
91
91
  execute(_toolCallId: string, params: SubagentParams, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<SubagentToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<SubagentToolDetails>>;
92
92
  }
93
+ /**
94
+ * Canonical, value-based rendered-state signature for the `subagent` await panel.
95
+ *
96
+ * Producer-side await gating compares this signature against the last emitted one
97
+ * and only fires `onUpdate` when the *rendered* state actually changed. Unchanged
98
+ * idle ticks therefore stop rebuilding the renderer component and stop mutating
99
+ * transcript lines above the viewport, which is what triggers TUI full-redraw
100
+ * storms (`tui.ts` `firstChanged < viewportTop`).
101
+ *
102
+ * It is deliberately value-based, never object identity: `AsyncJobManager.record-
103
+ * SubagentProgress` stores a `structuredClone` but `getSubagentProgress` returns
104
+ * the retained object by reference, so identity comparison would be both noisy and
105
+ * unsafe.
106
+ *
107
+ * Time-derived fields are intentionally excluded so the panel does not churn while
108
+ * idle: raw durations (`durationMs`), current-tool elapsed (`currentToolStartMs`),
109
+ * and retry countdowns (`retryState.startedAtMs`) are omitted. Idle duration and
110
+ * countdown ticking is sacrificed by design; every real transition still changes
111
+ * the signature.
112
+ */
113
+ export declare function subagentAwaitRenderedStateSignature(subagents: readonly SubagentSnapshot[]): string;
93
114
  export {};
@@ -0,0 +1,5 @@
1
+ import type { AgentTool } from "@gajae-code/agent-core";
2
+ import { type UltragoalAskBlockDiagnostic } from "../gjc-runtime/ultragoal-guard";
3
+ export declare function formatUltragoalAskBlockMessage(diagnostic: UltragoalAskBlockDiagnostic): string;
4
+ export declare function assertUltragoalAskAllowed(cwd: string): Promise<void>;
5
+ export declare function guardToolForUltragoalAsk<T extends AgentTool>(tool: T, getCwd: () => string): T;
@@ -10,7 +10,7 @@ import * as z from "zod/v4";
10
10
  import type { CustomTool } from "../../extensibility/custom-tools/types";
11
11
  import type { ToolSession } from "../../tools";
12
12
  import { type SearchRenderDetails } from "./render";
13
- import type { SearchProviderId } from "./types";
13
+ import type { ActiveSearchModelContext, SearchProviderId } from "./types";
14
14
  /** Web search tool parameters schema */
15
15
  export declare const webSearchSchema: z.ZodObject<{
16
16
  query: z.ZodString;
@@ -40,7 +40,7 @@ export declare function runSearchQuery(params: SearchQueryParams, options?: {
40
40
  authStorage?: AuthStorage;
41
41
  sessionId?: string;
42
42
  signal?: AbortSignal;
43
- activeModelProvider?: string;
43
+ activeModelContext?: ActiveSearchModelContext;
44
44
  }): Promise<{
45
45
  content: Array<{
46
46
  type: "text";
@@ -80,6 +80,6 @@ export declare class WebSearchTool implements AgentTool<typeof webSearchSchema,
80
80
  /** Web search tool as CustomTool (for TUI rendering support) */
81
81
  export declare const webSearchCustomTool: CustomTool<typeof webSearchSchema, SearchRenderDetails>;
82
82
  export declare function getSearchTools(): CustomTool<any, any>[];
83
- export { getSearchProvider, setPreferredSearchProvider } from "./provider";
83
+ export { getSearchProvider, setPreferredSearchProvider, setSearchFallbackProviders } from "./provider";
84
84
  export type { SearchProviderId as SearchProvider, SearchResponse } from "./types";
85
- export { isSearchProviderPreference } from "./types";
85
+ export { isConfigurableSearchProviderId, isSearchProviderPreference } from "./types";
@@ -1,28 +1,24 @@
1
1
  import type { AuthStorage } from "@gajae-code/ai";
2
2
  import type { SearchProvider } from "./providers/base";
3
- import type { SearchProviderId } from "./types";
3
+ import type { ActiveSearchModelContext, SearchProviderId } from "./types";
4
4
  export type { SearchParams } from "./providers/base";
5
5
  export { SearchProvider } from "./providers/base";
6
- /** Cheap, sync metadata accessor — never triggers a provider load. */
7
6
  export declare function getSearchProviderLabel(id: SearchProviderId): string;
8
- /**
9
- * Resolve and cache a provider instance. First call for a given id loads the
10
- * underlying module; subsequent calls return the cached singleton.
11
- */
12
7
  export declare function getSearchProvider(id: SearchProviderId): Promise<SearchProvider>;
13
8
  export declare const SEARCH_PROVIDER_ORDER: SearchProviderId[];
14
- /** Set the preferred web search provider from settings */
15
9
  export declare function setPreferredSearchProvider(provider: SearchProviderId | "auto"): void;
16
- /**
17
- * Resolve the ordered provider chain for a search request.
18
- *
19
- * Resolution is active-model-gated, never credential-scanning:
20
- * 1. An explicitly preferred provider (settings) that is available is primary.
21
- * 2. Otherwise the active model's own native search is primary, but only when
22
- * that provider's own credentials are present (its `isAvailable()`).
23
- * 3. DuckDuckGo (keyless) is always appended as the terminal fallback, so a
24
- * missing primary — or a primary runtime failure — still returns results
25
- * with zero configuration. Keyed standalone providers are never
26
- * auto-selected; they are reachable only via explicit selection (step 1).
27
- */
28
- export declare function resolveProviderChain(authStorage: AuthStorage, preferredProvider?: SearchProviderId | "auto", activeModelProvider?: string): Promise<SearchProvider[]>;
10
+ export declare function setSearchFallbackProviders(ids: readonly string[]): void;
11
+ export interface ResolveProviderChainOptions {
12
+ authStorage: AuthStorage;
13
+ sessionId?: string;
14
+ signal?: AbortSignal;
15
+ preferredProvider?: SearchProviderId | "auto";
16
+ activeModelContext?: ActiveSearchModelContext;
17
+ fallbackProviders?: readonly SearchProviderId[];
18
+ }
19
+ export declare function looksHostedModelId(modelId: string | undefined): boolean;
20
+ export declare function isLocalBaseUrl(baseUrl: string | undefined): boolean;
21
+ export declare function inferNativeProviderFromModel(ctx: ActiveSearchModelContext | undefined): SearchProviderId | undefined;
22
+ export declare function canUseGenericCredentials(authStorage: AuthStorage, ctx: ActiveSearchModelContext | undefined, sessionId?: string, signal?: AbortSignal): Promise<boolean>;
23
+ export declare function shouldTryGenericOpenAICompat(authStorage: AuthStorage, ctx: ActiveSearchModelContext | undefined, sessionId?: string, signal?: AbortSignal): Promise<boolean>;
24
+ export declare function resolveProviderChain(options: ResolveProviderChainOptions): Promise<SearchProvider[]>;
@@ -1,5 +1,5 @@
1
1
  import type { AuthStorage } from "@gajae-code/ai";
2
- import type { SearchProviderId, SearchResponse } from "../types";
2
+ import type { ActiveSearchModelContext, SearchProviderId, SearchResponse } from "../types";
3
3
  /**
4
4
  * Shared web search parameters passed to providers.
5
5
  *
@@ -49,6 +49,7 @@ export interface SearchParams {
49
49
  * caller's agent session when available; otherwise omit.
50
50
  */
51
51
  sessionId?: string;
52
+ activeModelContext?: ActiveSearchModelContext;
52
53
  }
53
54
  /** Base class for web search providers. */
54
55
  export declare abstract class SearchProvider {
@@ -0,0 +1,9 @@
1
+ import type { SearchResponse } from "../types";
2
+ import type { SearchParams } from "./base";
3
+ import { SearchProvider } from "./base";
4
+ export declare class OpenAICompatibleSearchProvider extends SearchProvider {
5
+ readonly id: "openai-compatible";
6
+ readonly label = "OpenAI-compatible";
7
+ isAvailable(): boolean;
8
+ search(params: SearchParams): Promise<SearchResponse>;
9
+ }
@@ -4,9 +4,21 @@
4
4
  * Unified types for web search responses across supported providers.
5
5
  */
6
6
  /** Supported web search providers */
7
- export type SearchProviderId = "duckduckgo" | "exa" | "brave" | "jina" | "kimi" | "zai" | "anthropic" | "perplexity" | "gemini" | "codex" | "tavily" | "parallel" | "kagi" | "synthetic" | "searxng";
7
+ export type SearchProviderId = "duckduckgo" | "exa" | "brave" | "jina" | "kimi" | "zai" | "anthropic" | "perplexity" | "gemini" | "codex" | "tavily" | "parallel" | "kagi" | "synthetic" | "searxng" | "openai-compatible";
8
+ export type WebSearchMode = "on" | "off" | "auto";
9
+ export interface ActiveSearchModelContext {
10
+ provider: string;
11
+ modelId: string;
12
+ wireModelId?: string;
13
+ api: string;
14
+ baseUrl?: string;
15
+ headers?: Record<string, string>;
16
+ webSearch?: WebSearchMode;
17
+ }
18
+ export declare const CONFIGURABLE_SEARCH_PROVIDER_IDS: readonly ["duckduckgo", "exa", "brave", "jina", "kimi", "zai", "anthropic", "perplexity", "gemini", "codex", "tavily", "parallel", "kagi", "synthetic", "searxng"];
8
19
  export declare function isSearchProviderId(value: string): value is SearchProviderId;
9
- export declare function isSearchProviderPreference(value: string): value is SearchProviderId | "auto";
20
+ export declare function isConfigurableSearchProviderId(value: string): value is (typeof CONFIGURABLE_SEARCH_PROVIDER_IDS)[number];
21
+ export declare function isSearchProviderPreference(value: string): value is (typeof CONFIGURABLE_SEARCH_PROVIDER_IDS)[number] | "auto";
10
22
  /** Source returned by search (all providers) */
11
23
  export interface SearchSource {
12
24
  title: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/coding-agent",
4
- "version": "0.5.1",
4
+ "version": "0.5.3",
5
5
  "description": "Gajae Code CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://gaebal-gajae.dev",
7
7
  "author": "Yeachan-Heo",
@@ -51,12 +51,12 @@
51
51
  "@agentclientprotocol/sdk": "0.21.0",
52
52
  "@babel/parser": "^7.29.3",
53
53
  "@mozilla/readability": "^0.6.0",
54
- "@gajae-code/stats": "0.5.1",
55
- "@gajae-code/agent-core": "0.5.1",
56
- "@gajae-code/ai": "0.5.1",
57
- "@gajae-code/natives": "0.5.1",
58
- "@gajae-code/tui": "0.5.1",
59
- "@gajae-code/utils": "0.5.1",
54
+ "@gajae-code/stats": "0.5.3",
55
+ "@gajae-code/agent-core": "0.5.3",
56
+ "@gajae-code/ai": "0.5.3",
57
+ "@gajae-code/natives": "0.5.3",
58
+ "@gajae-code/tui": "0.5.3",
59
+ "@gajae-code/utils": "0.5.3",
60
60
  "@puppeteer/browsers": "^2.13.0",
61
61
  "@types/turndown": "5.0.6",
62
62
  "@xterm/headless": "^6.0.0",
@@ -5,6 +5,12 @@ import * as path from "node:path";
5
5
  const packageDir = path.join(import.meta.dir, "..");
6
6
  const outputPath = path.join(packageDir, "dist", "gjc");
7
7
  const nativeDir = path.join(packageDir, "..", "natives", "native");
8
+ // Lazy native tokenizer entrypoint. `agent-core/compaction` loads this from
9
+ // the explicit native entrypoint instead of a package-name dynamic require of
10
+ // `@gajae-code/natives`, because those fail inside Bun standalone `$bunfs`.
11
+ // Listing the module here makes the absolute target path exist in the compiled
12
+ // bunfs.
13
+ const nativeTokenizerEntrypoint = "../natives/native/index.js";
8
14
 
9
15
  function shouldAdhocSignDarwinBinary(): boolean {
10
16
  return process.platform === "darwin";
@@ -66,6 +72,7 @@ async function main(): Promise<void> {
66
72
  "../stats/src/sync-worker.ts",
67
73
  "./src/tools/browser/tab-worker-entry.ts",
68
74
  "./src/eval/js/worker-entry.ts",
75
+ nativeTokenizerEntrypoint,
69
76
  "--outfile",
70
77
  "dist/gjc",
71
78
  ],