@gajae-code/coding-agent 0.5.1 → 0.5.2

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 (98) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -1
  3. package/dist/types/cli/setup-cli.d.ts +8 -1
  4. package/dist/types/commands/setup.d.ts +7 -0
  5. package/dist/types/config/file-lock.d.ts +24 -2
  6. package/dist/types/config/model-registry.d.ts +4 -0
  7. package/dist/types/config/models-config-schema.d.ts +5 -0
  8. package/dist/types/config/settings-schema.d.ts +62 -0
  9. package/dist/types/gjc-runtime/state-writer.d.ts +64 -2
  10. package/dist/types/gjc-runtime/ultragoal-guard.d.ts +10 -0
  11. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +29 -0
  12. package/dist/types/modes/components/provider-onboarding-selector.d.ts +1 -1
  13. package/dist/types/modes/interactive-mode.d.ts +1 -1
  14. package/dist/types/modes/rpc/rpc-mode.d.ts +56 -1
  15. package/dist/types/modes/shared/agent-wire/unattended-session.d.ts +10 -0
  16. package/dist/types/modes/theme/defaults/index.d.ts +302 -0
  17. package/dist/types/modes/theme/theme.d.ts +1 -0
  18. package/dist/types/modes/types.d.ts +1 -1
  19. package/dist/types/session/history-storage.d.ts +2 -2
  20. package/dist/types/session/session-manager.d.ts +10 -1
  21. package/dist/types/setup/credential-import.d.ts +79 -0
  22. package/dist/types/task/executor.d.ts +1 -0
  23. package/dist/types/task/render.d.ts +1 -1
  24. package/dist/types/tools/subagent-render.d.ts +7 -1
  25. package/dist/types/tools/subagent.d.ts +21 -0
  26. package/dist/types/tools/ultragoal-ask-guard.d.ts +5 -0
  27. package/dist/types/web/search/index.d.ts +4 -4
  28. package/dist/types/web/search/provider.d.ts +16 -20
  29. package/dist/types/web/search/providers/base.d.ts +2 -1
  30. package/dist/types/web/search/providers/openai-compatible.d.ts +9 -0
  31. package/dist/types/web/search/types.d.ts +14 -2
  32. package/package.json +7 -7
  33. package/scripts/build-binary.ts +7 -0
  34. package/src/cli/args.ts +2 -0
  35. package/src/cli/fast-help.ts +2 -0
  36. package/src/cli/setup-cli.ts +138 -3
  37. package/src/commands/setup.ts +5 -1
  38. package/src/commands/ultragoal.ts +3 -1
  39. package/src/config/file-lock-gc.ts +14 -2
  40. package/src/config/file-lock.ts +54 -12
  41. package/src/config/model-profile-activation.ts +15 -3
  42. package/src/config/model-profiles.ts +15 -15
  43. package/src/config/model-registry.ts +21 -1
  44. package/src/config/models-config-schema.ts +1 -0
  45. package/src/config/settings-schema.ts +62 -0
  46. package/src/defaults/gjc/skills/ultragoal/SKILL.md +30 -8
  47. package/src/gjc-runtime/deep-interview-recorder.ts +40 -0
  48. package/src/gjc-runtime/launch-tmux.ts +3 -4
  49. package/src/gjc-runtime/ralplan-runtime.ts +174 -12
  50. package/src/gjc-runtime/state-runtime.ts +2 -1
  51. package/src/gjc-runtime/state-writer.ts +254 -7
  52. package/src/gjc-runtime/tmux-gc.ts +2 -1
  53. package/src/gjc-runtime/ultragoal-guard.ts +155 -0
  54. package/src/gjc-runtime/ultragoal-runtime.ts +1227 -31
  55. package/src/gjc-runtime/workflow-manifest.generated.json +44 -0
  56. package/src/gjc-runtime/workflow-manifest.ts +12 -0
  57. package/src/harness-control-plane/owner.ts +3 -2
  58. package/src/harness-control-plane/rpc-adapter.ts +1 -1
  59. package/src/hooks/skill-state.ts +121 -2
  60. package/src/internal-urls/docs-index.generated.ts +13 -9
  61. package/src/lsp/defaults.json +1 -0
  62. package/src/main.ts +14 -4
  63. package/src/modes/acp/acp-agent.ts +4 -2
  64. package/src/modes/bridge/bridge-mode.ts +2 -1
  65. package/src/modes/components/history-search.ts +5 -2
  66. package/src/modes/components/model-selector.ts +26 -0
  67. package/src/modes/components/provider-onboarding-selector.ts +6 -1
  68. package/src/modes/controllers/selector-controller.ts +80 -1
  69. package/src/modes/interactive-mode.ts +11 -1
  70. package/src/modes/rpc/rpc-mode.ts +132 -18
  71. package/src/modes/shared/agent-wire/command-dispatch.ts +5 -2
  72. package/src/modes/shared/agent-wire/host-tool-bridge.ts +3 -0
  73. package/src/modes/shared/agent-wire/unattended-session.ts +16 -1
  74. package/src/modes/theme/defaults/claude-code.json +100 -0
  75. package/src/modes/theme/defaults/codex.json +100 -0
  76. package/src/modes/theme/defaults/index.ts +6 -0
  77. package/src/modes/theme/defaults/opencode.json +102 -0
  78. package/src/modes/theme/theme.ts +2 -2
  79. package/src/modes/types.ts +1 -1
  80. package/src/prompts/agents/executor.md +5 -2
  81. package/src/sdk.ts +12 -1
  82. package/src/session/agent-session.ts +22 -11
  83. package/src/session/history-storage.ts +32 -11
  84. package/src/session/session-manager.ts +70 -18
  85. package/src/setup/credential-import.ts +429 -0
  86. package/src/skill-state/deep-interview-mutation-guard.ts +2 -1
  87. package/src/task/executor.ts +7 -1
  88. package/src/task/render.ts +18 -7
  89. package/src/tools/ask.ts +4 -2
  90. package/src/tools/cron.ts +1 -1
  91. package/src/tools/subagent-render.ts +119 -29
  92. package/src/tools/subagent.ts +147 -7
  93. package/src/tools/ultragoal-ask-guard.ts +39 -0
  94. package/src/web/search/index.ts +25 -25
  95. package/src/web/search/provider.ts +178 -87
  96. package/src/web/search/providers/base.ts +2 -1
  97. package/src/web/search/providers/openai-compatible.ts +151 -0
  98. package/src/web/search/types.ts +47 -22
@@ -125,6 +125,308 @@ export declare const defaultThemes: {
125
125
  };
126
126
  };
127
127
  };
128
+ "claude-code": {
129
+ $schema: string;
130
+ name: string;
131
+ vars: {
132
+ "bg": string;
133
+ "surface": string;
134
+ "surfaceSubtle": string;
135
+ "separator": string;
136
+ "fg": string;
137
+ "muted": string;
138
+ "dim": string;
139
+ "brandTerracotta": string;
140
+ "shimmerTerracotta": string;
141
+ "toolPink": string;
142
+ "lavender": string;
143
+ "autoAcceptPurple": string;
144
+ "successGreen": string;
145
+ "warningAmber": string;
146
+ "errorSoftRed": string;
147
+ "diffAddedBg": string;
148
+ "diffRemovedBg": string;
149
+ "diffRemovedFg": string;
150
+ };
151
+ colors: {
152
+ "accent": string;
153
+ "border": string;
154
+ "borderAccent": string;
155
+ "borderMuted": string;
156
+ "success": string;
157
+ "error": string;
158
+ "warning": string;
159
+ "muted": string;
160
+ "dim": string;
161
+ "text": string;
162
+ "thinkingText": string;
163
+ "selectedBg": string;
164
+ "userMessageBg": string;
165
+ "userMessageText": string;
166
+ "customMessageBg": string;
167
+ "customMessageText": string;
168
+ "customMessageLabel": string;
169
+ "toolPendingBg": string;
170
+ "toolSuccessBg": string;
171
+ "toolErrorBg": string;
172
+ "toolTitle": string;
173
+ "toolOutput": string;
174
+ "mdHeading": string;
175
+ "mdLink": string;
176
+ "mdLinkUrl": string;
177
+ "mdCode": string;
178
+ "mdCodeBlock": string;
179
+ "mdCodeBlockBorder": string;
180
+ "mdQuote": string;
181
+ "mdQuoteBorder": string;
182
+ "mdHr": string;
183
+ "mdListBullet": string;
184
+ "toolDiffAdded": string;
185
+ "toolDiffRemoved": string;
186
+ "toolDiffContext": string;
187
+ "syntaxComment": string;
188
+ "syntaxKeyword": string;
189
+ "syntaxFunction": string;
190
+ "syntaxVariable": string;
191
+ "syntaxString": string;
192
+ "syntaxNumber": string;
193
+ "syntaxType": string;
194
+ "syntaxOperator": string;
195
+ "syntaxPunctuation": string;
196
+ "thinkingOff": string;
197
+ "thinkingMinimal": string;
198
+ "thinkingLow": string;
199
+ "thinkingMedium": string;
200
+ "thinkingHigh": string;
201
+ "thinkingXhigh": string;
202
+ "bashMode": string;
203
+ "pythonMode": string;
204
+ "statusLineBg": string;
205
+ "statusLineSep": string;
206
+ "statusLineModel": string;
207
+ "statusLinePath": string;
208
+ "statusLineGitClean": string;
209
+ "statusLineGitDirty": string;
210
+ "statusLineContext": string;
211
+ "statusLineSpend": string;
212
+ "statusLineStaged": string;
213
+ "statusLineDirty": string;
214
+ "statusLineUntracked": string;
215
+ "statusLineOutput": string;
216
+ "statusLineCost": string;
217
+ "statusLineSubagents": string;
218
+ };
219
+ export: {
220
+ "pageBg": string;
221
+ "cardBg": string;
222
+ "infoBg": string;
223
+ };
224
+ symbols: {
225
+ "preset": string;
226
+ };
227
+ };
228
+ codex: {
229
+ $schema: string;
230
+ name: string;
231
+ vars: {
232
+ "bg": string;
233
+ "surface": string;
234
+ "surfaceBright": string;
235
+ "selection": string;
236
+ "fg": string;
237
+ "muted": string;
238
+ "dim": string;
239
+ "borderNeutral": string;
240
+ "ansiCyan": string;
241
+ "cyanSoft": string;
242
+ "brandMagenta": string;
243
+ "magentaSoft": string;
244
+ "successGreen": string;
245
+ "errorRed": string;
246
+ "warningOrange": string;
247
+ "diffRemovalRed": string;
248
+ "toolSuccessBg": string;
249
+ "toolErrorBg": string;
250
+ };
251
+ colors: {
252
+ "accent": string;
253
+ "border": string;
254
+ "borderAccent": string;
255
+ "borderMuted": string;
256
+ "success": string;
257
+ "error": string;
258
+ "warning": string;
259
+ "muted": string;
260
+ "dim": string;
261
+ "text": string;
262
+ "thinkingText": string;
263
+ "selectedBg": string;
264
+ "userMessageBg": string;
265
+ "userMessageText": string;
266
+ "customMessageBg": string;
267
+ "customMessageText": string;
268
+ "customMessageLabel": string;
269
+ "toolPendingBg": string;
270
+ "toolSuccessBg": string;
271
+ "toolErrorBg": string;
272
+ "toolTitle": string;
273
+ "toolOutput": string;
274
+ "mdHeading": string;
275
+ "mdLink": string;
276
+ "mdLinkUrl": string;
277
+ "mdCode": string;
278
+ "mdCodeBlock": string;
279
+ "mdCodeBlockBorder": string;
280
+ "mdQuote": string;
281
+ "mdQuoteBorder": string;
282
+ "mdHr": string;
283
+ "mdListBullet": string;
284
+ "toolDiffAdded": string;
285
+ "toolDiffRemoved": string;
286
+ "toolDiffContext": string;
287
+ "syntaxComment": string;
288
+ "syntaxKeyword": string;
289
+ "syntaxFunction": string;
290
+ "syntaxVariable": string;
291
+ "syntaxString": string;
292
+ "syntaxNumber": string;
293
+ "syntaxType": string;
294
+ "syntaxOperator": string;
295
+ "syntaxPunctuation": string;
296
+ "thinkingOff": string;
297
+ "thinkingMinimal": string;
298
+ "thinkingLow": string;
299
+ "thinkingMedium": string;
300
+ "thinkingHigh": string;
301
+ "thinkingXhigh": string;
302
+ "bashMode": string;
303
+ "pythonMode": string;
304
+ "statusLineBg": string;
305
+ "statusLineSep": string;
306
+ "statusLineModel": string;
307
+ "statusLinePath": string;
308
+ "statusLineGitClean": string;
309
+ "statusLineGitDirty": string;
310
+ "statusLineContext": string;
311
+ "statusLineSpend": string;
312
+ "statusLineStaged": string;
313
+ "statusLineDirty": string;
314
+ "statusLineUntracked": string;
315
+ "statusLineOutput": string;
316
+ "statusLineCost": string;
317
+ "statusLineSubagents": string;
318
+ };
319
+ export: {
320
+ "pageBg": string;
321
+ "cardBg": string;
322
+ "infoBg": string;
323
+ };
324
+ symbols: {
325
+ "preset": string;
326
+ };
327
+ };
328
+ opencode: {
329
+ $schema: string;
330
+ name: string;
331
+ vars: {
332
+ "background": string;
333
+ "currentLine": string;
334
+ "selection": string;
335
+ "backgroundDarker": string;
336
+ "foreground": string;
337
+ "comment": string;
338
+ "primary": string;
339
+ "secondary": string;
340
+ "accentPurple": string;
341
+ "errorRed": string;
342
+ "warningOrange": string;
343
+ "successGreen": string;
344
+ "infoCyan": string;
345
+ "emphasizedYellow": string;
346
+ "border": string;
347
+ "diffAdded": string;
348
+ "diffRemoved": string;
349
+ "diffContext": string;
350
+ "addedBg": string;
351
+ "removedBg": string;
352
+ };
353
+ colors: {
354
+ "accent": string;
355
+ "border": string;
356
+ "borderAccent": string;
357
+ "borderMuted": string;
358
+ "success": string;
359
+ "error": string;
360
+ "warning": string;
361
+ "muted": string;
362
+ "dim": string;
363
+ "text": string;
364
+ "thinkingText": string;
365
+ "selectedBg": string;
366
+ "userMessageBg": string;
367
+ "userMessageText": string;
368
+ "customMessageBg": string;
369
+ "customMessageText": string;
370
+ "customMessageLabel": string;
371
+ "toolPendingBg": string;
372
+ "toolSuccessBg": string;
373
+ "toolErrorBg": string;
374
+ "toolTitle": string;
375
+ "toolOutput": string;
376
+ "mdHeading": string;
377
+ "mdLink": string;
378
+ "mdLinkUrl": string;
379
+ "mdCode": string;
380
+ "mdCodeBlock": string;
381
+ "mdCodeBlockBorder": string;
382
+ "mdQuote": string;
383
+ "mdQuoteBorder": string;
384
+ "mdHr": string;
385
+ "mdListBullet": string;
386
+ "toolDiffAdded": string;
387
+ "toolDiffRemoved": string;
388
+ "toolDiffContext": string;
389
+ "syntaxComment": string;
390
+ "syntaxKeyword": string;
391
+ "syntaxFunction": string;
392
+ "syntaxVariable": string;
393
+ "syntaxString": string;
394
+ "syntaxNumber": string;
395
+ "syntaxType": string;
396
+ "syntaxOperator": string;
397
+ "syntaxPunctuation": string;
398
+ "thinkingOff": string;
399
+ "thinkingMinimal": string;
400
+ "thinkingLow": string;
401
+ "thinkingMedium": string;
402
+ "thinkingHigh": string;
403
+ "thinkingXhigh": string;
404
+ "bashMode": string;
405
+ "pythonMode": string;
406
+ "statusLineBg": string;
407
+ "statusLineSep": string;
408
+ "statusLineModel": string;
409
+ "statusLinePath": string;
410
+ "statusLineGitClean": string;
411
+ "statusLineGitDirty": string;
412
+ "statusLineContext": string;
413
+ "statusLineSpend": string;
414
+ "statusLineStaged": string;
415
+ "statusLineDirty": string;
416
+ "statusLineUntracked": string;
417
+ "statusLineOutput": string;
418
+ "statusLineCost": string;
419
+ "statusLineSubagents": string;
420
+ };
421
+ export: {
422
+ "pageBg": string;
423
+ "cardBg": string;
424
+ "infoBg": string;
425
+ };
426
+ symbols: {
427
+ "preset": string;
428
+ };
429
+ };
128
430
  "red-claw": {
129
431
  $schema: string;
130
432
  name: string;
@@ -8,6 +8,7 @@ export type SymbolPreset = "unicode" | "nerd" | "ascii";
8
8
  */
9
9
  export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.folder" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.agents" | "icon.cache" | "icon.input" | "icon.output" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.max" | "checkbox.checked" | "checkbox.unchecked" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.editing" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers";
10
10
  export type SpinnerType = "status" | "activity";
11
+ export declare const THEME_COLOR_KEYS: readonly ["accent", "border", "borderAccent", "borderMuted", "success", "error", "warning", "muted", "dim", "text", "thinkingText", "selectedBg", "userMessageBg", "userMessageText", "customMessageBg", "customMessageText", "customMessageLabel", "toolPendingBg", "toolSuccessBg", "toolErrorBg", "toolTitle", "toolOutput", "mdHeading", "mdLink", "mdLinkUrl", "mdCode", "mdCodeBlock", "mdCodeBlockBorder", "mdQuote", "mdQuoteBorder", "mdHr", "mdListBullet", "toolDiffAdded", "toolDiffRemoved", "toolDiffContext", "syntaxComment", "syntaxKeyword", "syntaxFunction", "syntaxVariable", "syntaxString", "syntaxNumber", "syntaxType", "syntaxOperator", "syntaxPunctuation", "thinkingOff", "thinkingMinimal", "thinkingLow", "thinkingMedium", "thinkingHigh", "thinkingXhigh", "bashMode", "pythonMode", "statusLineBg", "statusLineSep", "statusLineModel", "statusLinePath", "statusLineGitClean", "statusLineGitDirty", "statusLineContext", "statusLineSpend", "statusLineStaged", "statusLineDirty", "statusLineUntracked", "statusLineOutput", "statusLineCost", "statusLineSubagents"];
11
12
  export type ThemeColor = "accent" | "border" | "borderAccent" | "borderMuted" | "success" | "error" | "warning" | "muted" | "dim" | "text" | "thinkingText" | "userMessageText" | "customMessageText" | "customMessageLabel" | "toolTitle" | "toolOutput" | "mdHeading" | "mdLink" | "mdLinkUrl" | "mdCode" | "mdCodeBlock" | "mdCodeBlockBorder" | "mdQuote" | "mdQuoteBorder" | "mdHr" | "mdListBullet" | "toolDiffAdded" | "toolDiffRemoved" | "toolDiffContext" | "syntaxComment" | "syntaxKeyword" | "syntaxFunction" | "syntaxVariable" | "syntaxString" | "syntaxNumber" | "syntaxType" | "syntaxOperator" | "syntaxPunctuation" | "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "bashMode" | "pythonMode" | "statusLineSep" | "statusLineModel" | "statusLinePath" | "statusLineGitClean" | "statusLineGitDirty" | "statusLineContext" | "statusLineSpend" | "statusLineStaged" | "statusLineDirty" | "statusLineUntracked" | "statusLineOutput" | "statusLineCost" | "statusLineSubagents";
12
13
  /** Check if a string is a valid ThemeColor value */
13
14
  export declare function isValidThemeColor(color: string): color is ThemeColor;
@@ -93,7 +93,7 @@ export interface InteractiveModeContext {
93
93
  retryLoader: Loader | undefined;
94
94
  autoCompactionEscapeHandler?: () => void;
95
95
  retryEscapeHandler?: () => void;
96
- retryCountdownTimer?: ReturnType<typeof setInterval>;
96
+ retryCountdownTimer?: NodeJS.Timeout;
97
97
  unsubscribe?: () => void;
98
98
  onInputCallback?: (input: SubmittedUserInput) => void;
99
99
  optimisticUserMessageSignature: string | undefined;
@@ -11,6 +11,6 @@ export declare class HistoryStorage {
11
11
  /** @internal Reset the singleton — test-only. */
12
12
  static resetInstance(): void;
13
13
  add(prompt: string, cwd?: string): Promise<void>;
14
- getRecent(limit: number): HistoryEntry[];
15
- search(query: string, limit: number): HistoryEntry[];
14
+ getRecent(limit: number, cwd?: string): HistoryEntry[];
15
+ search(query: string, limit: number, cwd?: string): HistoryEntry[];
16
16
  }
@@ -1,7 +1,7 @@
1
1
  import type { AgentMessage } from "@gajae-code/agent-core";
2
2
  import type { ImageContent, Message, MessageAttribution, ServiceTier, TextContent } from "@gajae-code/ai";
3
3
  import { ArtifactManager } from "./artifacts";
4
- import { type BlobPutResult } from "./blob-store";
4
+ import { type BlobPutResult, BlobStore } from "./blob-store";
5
5
  import { type BashExecutionMessage, type CustomMessage, type FileMentionMessage, type HookMessage, type PythonExecutionMessage } from "./messages";
6
6
  import type { SessionStorage } from "./session-storage";
7
7
  export declare const CURRENT_SESSION_VERSION = 3;
@@ -234,6 +234,15 @@ declare class RecentSessionInfo {
234
234
  export declare function recoverOrphanedBackups(sessionDir: string, storage: SessionStorage): Promise<void>;
235
235
  /** Exported for testing */
236
236
  export declare function findMostRecentSession(sessionDir: string, storage?: SessionStorage): Promise<string | null>;
237
+ declare const RESIDENT_BLOB_SENTINEL_KEY = "__gjcResidentBlob";
238
+ type ResidentBlobKind = "text" | "imageUrl" | "imageData";
239
+ interface ResidentBlobSentinel {
240
+ [RESIDENT_BLOB_SENTINEL_KEY]: true;
241
+ kind: ResidentBlobKind;
242
+ ref: string;
243
+ }
244
+ export declare function residentBlobSentinelForTests(kind: ResidentBlobKind, ref: string): ResidentBlobSentinel;
245
+ export declare function materializeResidentEntriesForPersistenceForTests<T>(entries: T[], textStore: BlobStore, imageStore?: BlobStore): T[];
237
246
  /** Get recent sessions for display in welcome screen */
238
247
  export declare function getRecentSessions(sessionDir: string, limit?: number, storage?: SessionStorage): Promise<RecentSessionInfo[]>;
239
248
  /**
@@ -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>;
@@ -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
  */
@@ -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;