@gajae-code/coding-agent 0.18.11 → 0.18.12

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 (270) hide show
  1. package/CHANGELOG.md +293 -0
  2. package/dist/types/async/job-manager.d.ts +7 -3
  3. package/dist/types/async/result-formatting.d.ts +2 -0
  4. package/dist/types/autoresearch/git.d.ts +1 -1
  5. package/dist/types/capability/fs.d.ts +2 -2
  6. package/dist/types/cli/accounts-cli.d.ts +2 -2
  7. package/dist/types/cli/doctor/install-repairs.d.ts +4 -1
  8. package/dist/types/cli/install-activation.d.ts +10 -4
  9. package/dist/types/cli/public-command-errors.d.ts +1 -0
  10. package/dist/types/cli/update-cli.d.ts +14 -1
  11. package/dist/types/cli-ordinary.d.ts +2 -2
  12. package/dist/types/commands/accounts.d.ts +2 -1
  13. package/dist/types/commands/migrate.d.ts +1 -1
  14. package/dist/types/commands/sdk.d.ts +5 -0
  15. package/dist/types/commit/changelog/index.d.ts +1 -0
  16. package/dist/types/config/autorouting-tier-map.d.ts +30 -0
  17. package/dist/types/config/config-hot-reload-trust.d.ts +12 -0
  18. package/dist/types/config/config-hot-reload.d.ts +39 -0
  19. package/dist/types/config/file-lock.d.ts +8 -1
  20. package/dist/types/config/model-discovery-manager.d.ts +2 -0
  21. package/dist/types/config/model-profile-activation.d.ts +62 -6
  22. package/dist/types/config/model-registry.d.ts +56 -5
  23. package/dist/types/config/model-resolver.d.ts +2 -0
  24. package/dist/types/config/models-config-schema.d.ts +10 -0
  25. package/dist/types/config/settings-schema.d.ts +46 -3
  26. package/dist/types/config/settings.d.ts +33 -1
  27. package/dist/types/dap/config.d.ts +8 -4
  28. package/dist/types/debug/system-info.d.ts +6 -1
  29. package/dist/types/discovery/mcp-compat.d.ts +3 -1
  30. package/dist/types/edit/modes/patch.d.ts +5 -0
  31. package/dist/types/edit/modes/replace.d.ts +3 -0
  32. package/dist/types/exec/bash-executor.d.ts +12 -0
  33. package/dist/types/gjc-runtime/managed-owner-admission.d.ts +3 -0
  34. package/dist/types/gjc-runtime/session-state-lock.d.ts +2 -0
  35. package/dist/types/gjc-runtime/state-runtime.d.ts +0 -2
  36. package/dist/types/migrate/adapters/codex.d.ts +2 -1
  37. package/dist/types/migrate/adapters/index.d.ts +10 -1
  38. package/dist/types/migrate/executor.d.ts +3 -1
  39. package/dist/types/migrate/types.d.ts +15 -3
  40. package/dist/types/modes/components/settings-selector.d.ts +6 -0
  41. package/dist/types/modes/controllers/selector-controller.d.ts +2 -0
  42. package/dist/types/modes/theme/theme.d.ts +1 -0
  43. package/dist/types/runtime-mcp/content-limits.d.ts +4 -0
  44. package/dist/types/runtime-mcp/manager.d.ts +7 -0
  45. package/dist/types/runtime-mcp/plugin-mcp-name-filter.d.ts +22 -0
  46. package/dist/types/runtime-mcp/tool-bridge.d.ts +4 -0
  47. package/dist/types/sdk/broker/broker-exit.d.ts +2 -2
  48. package/dist/types/sdk/broker/broker.d.ts +7 -1
  49. package/dist/types/sdk/broker/daemon-entry.d.ts +11 -1
  50. package/dist/types/sdk/broker/doctor-restart.d.ts +1 -1
  51. package/dist/types/sdk/broker/ensure.d.ts +136 -7
  52. package/dist/types/sdk/broker/hop.d.ts +36 -0
  53. package/dist/types/sdk/broker/lifecycle-ledger.d.ts +18 -10
  54. package/dist/types/sdk/broker/lock-host-identity.d.ts +5 -0
  55. package/dist/types/sdk/broker/session-index.d.ts +4 -1
  56. package/dist/types/sdk/bus/chat-command-policy.d.ts +2 -1
  57. package/dist/types/sdk/bus/index.d.ts +23 -0
  58. package/dist/types/sdk/bus/reconciliation-store.d.ts +10 -0
  59. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +3 -1
  60. package/dist/types/sdk/cli/session-cli.d.ts +0 -1
  61. package/dist/types/sdk/host/session-runtime.d.ts +32 -0
  62. package/dist/types/sdk/prompt-deadline-flush.d.ts +42 -4
  63. package/dist/types/sdk/prompt-deadline-manager.d.ts +2 -0
  64. package/dist/types/sdk/protocol/adapter-validation.d.ts +10 -4
  65. package/dist/types/sdk/reconciliation-extensions.d.ts +1 -1
  66. package/dist/types/sdk/session-list.d.ts +1 -1
  67. package/dist/types/session/agent-session.d.ts +58 -2
  68. package/dist/types/session/internal/managed-session-scope.d.ts +2 -2
  69. package/dist/types/session/internal/managed-session-storage.d.ts +1 -1
  70. package/dist/types/session/internal/native-publish-outcome.d.ts +1 -1
  71. package/dist/types/session/messages.d.ts +5 -1
  72. package/dist/types/session/session-manager.d.ts +13 -3
  73. package/dist/types/session/startup-auth-config.d.ts +24 -2
  74. package/dist/types/session/streaming-output.d.ts +11 -0
  75. package/dist/types/session/terminal-abort.d.ts +3 -1
  76. package/dist/types/session-import/service.d.ts +1 -1
  77. package/dist/types/skill-state/workflow-mutation-guard.d.ts +7 -3
  78. package/dist/types/slash-commands/helpers/provider-auth-status.d.ts +8 -0
  79. package/dist/types/task/executor.d.ts +19 -2
  80. package/dist/types/tools/ast-edit-write-path.d.ts +10 -0
  81. package/dist/types/tools/atomic-file-write.d.ts +9 -7
  82. package/dist/types/tools/bash-allowed-prefixes.d.ts +11 -0
  83. package/dist/types/tools/descriptors.d.ts +2 -0
  84. package/dist/types/tools/fetch.d.ts +1 -1
  85. package/dist/types/tools/index.d.ts +2 -0
  86. package/dist/types/tools/python.d.ts +1 -1
  87. package/dist/types/tools/report-issue.d.ts +41 -0
  88. package/dist/types/tools/subagent.d.ts +23 -0
  89. package/dist/types/web/scrapers/types.d.ts +8 -1
  90. package/dist/types/web/search/providers/insane.d.ts +7 -1
  91. package/dist/types/web/search/providers/searxng.d.ts +5 -0
  92. package/package.json +8 -8
  93. package/scripts/build-binary.ts +2 -1
  94. package/scripts/capture-subagent-compact-panel-showcase.ts +105 -0
  95. package/scripts/generate-docs-index.ts +8 -1
  96. package/scripts/generate-sdk-operation-inventory.ts +22 -4
  97. package/src/async/job-manager.ts +356 -56
  98. package/src/async/result-formatting.ts +40 -0
  99. package/src/autoresearch/git.ts +9 -2
  100. package/src/autoresearch/prompts/prompt-setup.md +1 -1
  101. package/src/capability/fs.ts +27 -19
  102. package/src/capability/index.ts +2 -2
  103. package/src/cli/accounts-cli.ts +176 -8
  104. package/src/cli/auth-broker-cli.ts +21 -11
  105. package/src/cli/doctor/install-repairs.ts +35 -5
  106. package/src/cli/fast-help.ts +1 -1
  107. package/src/cli/install-activation.ts +47 -4
  108. package/src/cli/migrate-cli.ts +7 -5
  109. package/src/cli/public-command-errors.ts +4 -0
  110. package/src/cli/root-flags.ts +2 -2
  111. package/src/cli/stats-cli.ts +9 -5
  112. package/src/cli/update-cli.ts +224 -7
  113. package/src/cli-ordinary.ts +7 -2
  114. package/src/commands/accounts.ts +10 -5
  115. package/src/commands/migrate.ts +3 -3
  116. package/src/commands/sdk.ts +199 -42
  117. package/src/commands/ultragoal.ts +16 -8
  118. package/src/commit/changelog/index.ts +39 -1
  119. package/src/commit/message.ts +10 -3
  120. package/src/config/autorouting-tier-map.ts +30 -0
  121. package/src/config/config-hot-reload-trust.ts +148 -0
  122. package/src/config/config-hot-reload.ts +734 -0
  123. package/src/config/file-lock.ts +216 -56
  124. package/src/config/model-bindings-applier.ts +85 -47
  125. package/src/config/model-discovery-manager.ts +10 -0
  126. package/src/config/model-profile-activation.ts +716 -113
  127. package/src/config/model-registry.ts +1334 -158
  128. package/src/config/model-resolver.ts +3 -1
  129. package/src/config/models-config-schema.ts +6 -0
  130. package/src/config/settings-schema.ts +60 -3
  131. package/src/config/settings.ts +458 -24
  132. package/src/coordinator-mcp/policy.ts +26 -1
  133. package/src/crash/sanitize.ts +4 -0
  134. package/src/customization/import.ts +3 -1
  135. package/src/dap/config.ts +31 -11
  136. package/src/dap/defaults.json +1 -1
  137. package/src/debug/crash-diagnostics.ts +2 -1
  138. package/src/debug/report-bundle.ts +19 -0
  139. package/src/debug/system-info.ts +8 -3
  140. package/src/defaults/gjc/extensions/grok-cli-vendor/src/shared/base-url.ts +21 -7
  141. package/src/discovery/agents-md.ts +1 -1
  142. package/src/discovery/helpers.ts +1 -2
  143. package/src/discovery/mcp-compat.ts +120 -17
  144. package/src/edit/apply-patch/index.ts +12 -1
  145. package/src/edit/index.ts +13 -17
  146. package/src/edit/modes/patch.ts +187 -8
  147. package/src/edit/modes/replace.ts +136 -0
  148. package/src/eval/js/context-manager.ts +29 -3
  149. package/src/eval/js/worker-entry.ts +51 -18
  150. package/src/eval/py/executor.ts +14 -4
  151. package/src/eval/py/runner.py +144 -5
  152. package/src/exec/bash-executor.ts +81 -4
  153. package/src/exec/bash-shell-guardian.ts +4 -1
  154. package/src/exec/bash-shell-supervisor.ts +8 -4
  155. package/src/exec/isolated-shell.ts +5 -1
  156. package/src/export/html/index.ts +46 -6
  157. package/src/extensibility/custom-tools/wrapper.ts +3 -1
  158. package/src/extensibility/extensions/loader.ts +8 -1
  159. package/src/extensibility/plugins/marketplace/fetcher.ts +2 -2
  160. package/src/gjc-runtime/gc-runtime.ts +33 -6
  161. package/src/gjc-runtime/launch-tmux.ts +7 -2
  162. package/src/gjc-runtime/launch-worktree.test.ts +148 -0
  163. package/src/gjc-runtime/launch-worktree.ts +101 -14
  164. package/src/gjc-runtime/managed-owner-admission.ts +46 -2
  165. package/src/gjc-runtime/session-resolution.ts +38 -6
  166. package/src/gjc-runtime/session-state-lock.ts +59 -14
  167. package/src/gjc-runtime/state-runtime.ts +23 -19
  168. package/src/hooks/native-skill-hook.ts +14 -11
  169. package/src/internal-urls/docs-index.generated.ts +14 -13
  170. package/src/internal-urls/local-protocol.ts +142 -8
  171. package/src/lsp/index.ts +29 -0
  172. package/src/lsp/workspace-path.ts +23 -0
  173. package/src/migrate/action-planner.ts +57 -0
  174. package/src/migrate/adapters/claude-code.ts +23 -4
  175. package/src/migrate/adapters/codex.ts +22 -4
  176. package/src/migrate/adapters/index.ts +22 -4
  177. package/src/migrate/adapters/opencode.ts +6 -1
  178. package/src/migrate/executor.ts +84 -7
  179. package/src/migrate/report.ts +19 -2
  180. package/src/migrate/types.ts +14 -4
  181. package/src/modes/DESIGN.md +51 -0
  182. package/src/modes/acp/permission-mode.ts +18 -1
  183. package/src/modes/components/assistant-message.ts +55 -1
  184. package/src/modes/components/settings-selector.ts +103 -37
  185. package/src/modes/controllers/command-controller.ts +38 -2
  186. package/src/modes/controllers/plan-mode-controller.ts +17 -7
  187. package/src/modes/controllers/selector-controller.ts +62 -6
  188. package/src/modes/interactive-mode.ts +68 -0
  189. package/src/modes/theme/theme.ts +15 -0
  190. package/src/prompts/tools/debug.md +1 -1
  191. package/src/prompts/tools/read.md +1 -1
  192. package/src/prompts/tools/report-issue.md +13 -0
  193. package/src/prompts/tools/task.md +1 -1
  194. package/src/runtime-credential-selector.ts +2 -2
  195. package/src/runtime-mcp/content-limits.ts +7 -0
  196. package/src/runtime-mcp/manager-pool.test.ts +5 -4
  197. package/src/runtime-mcp/manager.ts +32 -0
  198. package/src/runtime-mcp/oauth-flow.ts +32 -6
  199. package/src/runtime-mcp/plugin-mcp-name-filter.ts +62 -0
  200. package/src/runtime-mcp/render.ts +16 -1
  201. package/src/runtime-mcp/tool-bridge.ts +126 -17
  202. package/src/sdk/broker/broker-exit.ts +8 -5
  203. package/src/sdk/broker/broker.ts +342 -82
  204. package/src/sdk/broker/daemon-entry.ts +338 -116
  205. package/src/sdk/broker/doctor-restart.ts +2 -1
  206. package/src/sdk/broker/ensure.ts +1143 -265
  207. package/src/sdk/broker/hop.ts +274 -0
  208. package/src/sdk/broker/lifecycle-ledger.ts +35 -11
  209. package/src/sdk/broker/lock-host-identity.ts +29 -0
  210. package/src/sdk/broker/session-index.ts +62 -12
  211. package/src/sdk/bus/chat-command-policy.ts +16 -3
  212. package/src/sdk/bus/index.ts +52 -21
  213. package/src/sdk/bus/reconciliation-store.ts +201 -8
  214. package/src/sdk/bus/telegram-daemon-contract.ts +3 -1
  215. package/src/sdk/cli/session-cli.ts +21 -6
  216. package/src/sdk/host/session-runtime.test.ts +118 -23
  217. package/src/sdk/host/session-runtime.ts +352 -47
  218. package/src/sdk/lifecycle/service.ts +1 -0
  219. package/src/sdk/prompt-deadline-flush.ts +78 -5
  220. package/src/sdk/prompt-deadline-manager.ts +68 -14
  221. package/src/sdk/protocol/adapter-validation.ts +53 -11
  222. package/src/sdk/protocol/operation-inventory.generated.json +101 -2
  223. package/src/sdk/reconciliation-extensions.ts +1 -0
  224. package/src/sdk/session-list.ts +1 -0
  225. package/src/sdk/session.ts +114 -61
  226. package/src/session/agent-session.ts +1043 -81
  227. package/src/session/internal/managed-session-scope.ts +126 -39
  228. package/src/session/internal/managed-session-storage.ts +14 -11
  229. package/src/session/internal/native-publish-outcome.ts +5 -1
  230. package/src/session/messages.ts +47 -6
  231. package/src/session/session-manager.ts +236 -14
  232. package/src/session/startup-auth-config.ts +116 -8
  233. package/src/session/streaming-output.ts +262 -4
  234. package/src/session/terminal-abort.ts +14 -2
  235. package/src/session-import/service.ts +1 -0
  236. package/src/skill-state/workflow-mutation-guard.ts +491 -32
  237. package/src/slash-commands/builtin-registry.ts +15 -3
  238. package/src/slash-commands/helpers/credential-switch.ts +10 -5
  239. package/src/slash-commands/helpers/provider-auth-status.ts +456 -0
  240. package/src/task/executor.ts +103 -12
  241. package/src/task/index.ts +389 -175
  242. package/src/tools/ast-edit-write-path.ts +64 -0
  243. package/src/tools/ast-edit.ts +18 -1
  244. package/src/tools/atomic-file-write.ts +46 -15
  245. package/src/tools/auto-generated-guard.ts +3 -0
  246. package/src/tools/bash-allowed-prefixes.ts +153 -5
  247. package/src/tools/bash-interactive.ts +14 -2
  248. package/src/tools/bash.ts +14 -0
  249. package/src/tools/debug.ts +7 -6
  250. package/src/tools/descriptors.test.ts +44 -0
  251. package/src/tools/descriptors.ts +34 -2
  252. package/src/tools/fetch.ts +3 -2
  253. package/src/tools/index.ts +2 -0
  254. package/src/tools/output-meta.ts +23 -2
  255. package/src/tools/python.ts +1 -1
  256. package/src/tools/read.ts +17 -35
  257. package/src/tools/report-issue.ts +184 -0
  258. package/src/tools/subagent-render.ts +114 -12
  259. package/src/tools/subagent.ts +108 -1
  260. package/src/tools/todo-write.ts +41 -3
  261. package/src/tools/tool-catalog.generated.ts +31 -3
  262. package/src/tools/write.ts +35 -3
  263. package/src/utils/commit-message-generator.ts +9 -2
  264. package/src/utils/file-mentions.ts +29 -1
  265. package/src/utils/title-generator.ts +7 -2
  266. package/src/web/scrapers/index.ts +3 -1
  267. package/src/web/scrapers/types.ts +8 -0
  268. package/src/web/scrapers/youtube.ts +3 -2
  269. package/src/web/search/providers/insane.ts +91 -28
  270. package/src/web/search/providers/searxng.ts +62 -10
@@ -70,10 +70,13 @@ export interface ForkContextSeedOptions {
70
70
  import type { AuthCredentialSelector } from "@gajae-code/ai/core";
71
71
  import { type AsyncJob, type AsyncJobDeliveryState, AsyncJobManager, type FoldReason, type JobFoldEvent, type SubagentLifecycle } from "../async";
72
72
  import type { Rule } from "../capability/rule";
73
+ import type { ConfigHotReloadCandidate, ConfigHotReloadPaths } from "../config/config-hot-reload";
73
74
  import { type ModelRegistry } from "../config/model-registry";
74
75
  import { type ResolvedModelRoleValue, type ScopedModelSelection } from "../config/model-resolver";
76
+ import { type ModelSelectorValue } from "../config/model-selector-value";
75
77
  import { type PromptTemplate } from "../config/prompt-templates";
76
78
  import type { Settings, SkillsSettings } from "../config/settings";
79
+ import { type SettingPath } from "../config/settings-schema";
77
80
  import { RawSseDebugBuffer } from "../debug/raw-sse-buffer";
78
81
  import { type PythonResult } from "../eval/py/executor";
79
82
  import { type BashArtifactSaveResult, type BashResult } from "../exec/bash-executor";
@@ -99,11 +102,12 @@ import type { NetworkPrewarmRuntime } from "../runtime/network-prewarm-service";
99
102
  import type { WorkspaceTreeRuntime } from "../runtime/workspace-tree-service";
100
103
  import { type ExactMcpServerControlResult, MCPManager } from "../runtime-mcp/manager";
101
104
  import type { NotificationSessionController } from "../sdk/bus/session-control";
102
- import type { SecretObfuscator } from "../secrets/obfuscator";
105
+ import { type SecretObfuscator } from "../secrets/obfuscator";
103
106
  import { type DiscoverableTool, type DiscoverableToolSearchIndex } from "../tool-discovery/tool-index";
104
107
  import type { AskAnswerSource, ToolSession } from "../tools";
105
108
  import type { CheckpointState } from "../tools/checkpoint";
106
109
  import { type TodoItem, type TodoPhase } from "../tools/todo-write";
110
+ import { type EditMode } from "../utils/edit-mode";
107
111
  import { type WorkspaceTree } from "../workspace-tree";
108
112
  import { type DefaultModelSelectionResult } from "./default-model-selection";
109
113
  import { type ConfiguredFallbackChain, type FallbackChainRuntimeState } from "./fallback-chain-controller";
@@ -726,6 +730,40 @@ export interface DefaultFallbackRuntimeState {
726
730
  controller: FallbackChainRuntimeState;
727
731
  exhaustedLastTurn: boolean;
728
732
  }
733
+ export interface AgentSessionProfileInstalledOverrideState {
734
+ modelRoles: ReadonlyMap<string, ModelSelectorValue | undefined>;
735
+ agentModelOverrides: ReadonlyMap<string, ModelSelectorValue | undefined>;
736
+ installedModelRoles: ReadonlyMap<string, ModelSelectorValue>;
737
+ installedAgentModelOverrides: ReadonlyMap<string, ModelSelectorValue>;
738
+ manualModelRoles: ReadonlySet<string>;
739
+ manualAgentModelOverrides: ReadonlySet<string>;
740
+ configuredAgentModelOverrides: ReadonlySet<string>;
741
+ preProfileModel: Model | undefined;
742
+ }
743
+ export interface PreparedProfileModelSelection {
744
+ readonly sessionId: string;
745
+ readonly model: Model;
746
+ readonly thinkingLevel: ThinkingLevel | undefined;
747
+ readonly committedThinkingLevel: ThinkingLevel | undefined;
748
+ readonly previousModel: Model | undefined;
749
+ readonly previousThinkingLevel: ThinkingLevel | undefined;
750
+ readonly previousEditMode: EditMode;
751
+ readonly signal: AbortSignal | undefined;
752
+ }
753
+ export interface ConfigurationReloadResult {
754
+ readonly applied: boolean;
755
+ readonly settingsChanged: boolean;
756
+ readonly modelsChanged: boolean;
757
+ readonly changedSettings: readonly SettingPath[];
758
+ }
759
+ export type ConfigurationReloadErrorCode = "SESSION_UNAVAILABLE" | "PATH_CHANGED" | "SETTINGS_INVALID" | "MODELS_INVALID" | "MODEL_UNAVAILABLE" | "ACTIVE_PROFILE_INVALID" | "PUBLICATION_FAILED" | "VALIDATION_CLEANUP_FAILED";
760
+ export declare class ConfigurationReloadError extends Error {
761
+ readonly code: ConfigurationReloadErrorCode;
762
+ readonly retryable: boolean;
763
+ constructor(code: ConfigurationReloadErrorCode, cause?: unknown, options?: {
764
+ readonly retryable?: boolean;
765
+ });
766
+ }
729
767
  /** A lost continuation may only settle the emitter/session pair that opened it. */
730
768
  export declare function isCurrentWorkflowGateContinuation(currentSessionId: string, expectedSessionId: string, currentEmitter: WorkflowGateEmitter | undefined, expectedEmitter: WorkflowGateEmitter): boolean;
731
769
  export declare class AgentSession {
@@ -1480,6 +1518,7 @@ export declare class AgentSession {
1480
1518
  onMutationStarted?: () => void;
1481
1519
  }): Promise<void>;
1482
1520
  setActiveModelProfile(name: string | undefined): void;
1521
+ markProfileRoleOverrideManual(path: "modelRoles" | "task.agentModelOverrides", role: string): void;
1483
1522
  getActiveModelProfile(): string | undefined;
1484
1523
  setUnavailableModelProfile(name: string | undefined): void;
1485
1524
  getUnavailableModelProfile(): string | undefined;
@@ -1492,6 +1531,9 @@ export declare class AgentSession {
1492
1531
  };
1493
1532
  /** Fence deferred startup profile recovery before an explicit control-surface selection. */
1494
1533
  markUserModelSelection(): void;
1534
+ getConfigurationPaths(): ConfigHotReloadPaths | undefined;
1535
+ validateConfiguration(candidate: ConfigHotReloadCandidate): Promise<void>;
1536
+ reloadConfiguration(candidate: ConfigHotReloadCandidate, signal: AbortSignal): Promise<ConfigurationReloadResult>;
1495
1537
  /**
1496
1538
  * Re-apply vendor-separated delegation after a profile activation changed the
1497
1539
  * role layer. `eagerTasks` is resolved at prompt build time, but under
@@ -1502,7 +1544,18 @@ export declare class AgentSession {
1502
1544
  */
1503
1545
  syncEagerDelegation(): Promise<void>;
1504
1546
  /** Record runtime override keys installed by a profile activation. */
1505
- noteProfileInstalledOverrides(modelRoles: readonly string[], agentModelOverrides: readonly string[], preProfileModel: Model | undefined): void;
1547
+ noteProfileInstalledOverrides(modelRoles: readonly string[], agentModelOverrides: readonly string[], preProfileModel: Model | undefined, baseline?: {
1548
+ modelRoles: Readonly<Record<string, ModelSelectorValue>>;
1549
+ agentModelOverrides: Readonly<Record<string, ModelSelectorValue>>;
1550
+ }, installed?: {
1551
+ modelRoles: Readonly<Record<string, ModelSelectorValue>>;
1552
+ agentModelOverrides: Readonly<Record<string, ModelSelectorValue>>;
1553
+ }, manual?: {
1554
+ modelRoles: readonly string[];
1555
+ agentModelOverrides: readonly string[];
1556
+ }): void;
1557
+ getProfileInstalledOverrideState(): AgentSessionProfileInstalledOverrideState;
1558
+ restoreProfileInstalledOverrideState(state: AgentSessionProfileInstalledOverrideState): void;
1506
1559
  /** Drop the recorded profile-installed override keys after materialization. */
1507
1560
  clearProfileInstalledOverrides(): void;
1508
1561
  /** Current profile-installed override keys, for deriving the activation base. */
@@ -1628,6 +1681,9 @@ export declare class AgentSession {
1628
1681
  shouldMutate?: () => boolean;
1629
1682
  onMutationStarted?: () => void;
1630
1683
  }): Promise<TemporaryProviderSessionScope | void>;
1684
+ prepareModelSelectionForProfileActivation(model: Model, thinkingLevel: ThinkingLevel | undefined, signal?: AbortSignal): Promise<PreparedProfileModelSelection>;
1685
+ commitPreparedProfileModelSelection(prepared: PreparedProfileModelSelection, onThinkingLevelApplied?: (mutationRevision: number) => void): void;
1686
+ finishPreparedProfileModelSelection(prepared: PreparedProfileModelSelection): Promise<void>;
1631
1687
  /** Restore the exact live-model state captured before a failed selector transaction. */
1632
1688
  restoreModelSelectionForRollback(model: Model | undefined, thinkingLevel: ThinkingLevel | undefined): Promise<void>;
1633
1689
  /** Set a durable per-session model from a control surface without exposing credential errors. */
@@ -87,7 +87,7 @@ export declare function managedDirectoryIdentityForScope(scope: ManagedScope): {
87
87
  };
88
88
  export declare function managedRootForScope(scope: ManagedScope): ManagedDirectoryRoot;
89
89
  export type ManagedMigrationPolicy = "copy-retain" | "disabled";
90
- export type ManagedScopeErrorCode = "cwd_missing" | "cwd_not_directory" | "identity_unavailable" | "network_unsupported" | "sessions_root_unavailable" | "binding_conflict" | "binding_invalid" | "migration_busy" | "managed_gc_journal_capacity_exceeded" | "atomic_unavailable" | "invalid_request" | "durability_failed" | "durability_not_provable" | "capacity_exceeded";
90
+ export type ManagedScopeErrorCode = "cwd_missing" | "cwd_not_directory" | "identity_unavailable" | "network_unsupported" | "sessions_root_unavailable" | "binding_conflict" | "binding_invalid" | "migration_busy" | "managed_gc_journal_capacity_exceeded" | "atomic_unavailable" | "invalid_request" | "permission_denied" | "durability_failed" | "durability_not_provable" | "capacity_exceeded";
91
91
  export type ManagedScopeResolution = {
92
92
  kind: "resolved";
93
93
  scope: ManagedScope;
@@ -122,7 +122,7 @@ export type ManagedCandidateListing = {
122
122
  code: "scan_failed" | "unsafe_root" | "invalid_candidate";
123
123
  message: string;
124
124
  };
125
- export type ManagedOpenFailure = "migration_busy" | "binding_conflict" | "binding_invalid" | "destination_conflict" | "source_changed" | "unsafe_artifacts" | "artifact_capacity_exceeded" | "managed_gc_journal_capacity_exceeded" | "durability_failed" | "atomic_unavailable" | "invalid_request" | "durability_not_provable" | "migration_retired" | "legacy_migration_disabled" | "managed_storage_unsupported";
125
+ export type ManagedOpenFailure = "migration_busy" | "binding_conflict" | "binding_invalid" | "destination_conflict" | "source_changed" | "unsafe_artifacts" | "artifact_capacity_exceeded" | "managed_gc_journal_capacity_exceeded" | "durability_failed" | "atomic_unavailable" | "permission_denied" | "invalid_request" | "durability_not_provable" | "migration_retired" | "legacy_migration_disabled" | "managed_storage_unsupported";
126
126
  export type ManagedOpenCandidateResult = {
127
127
  kind: "opened";
128
128
  path: string;
@@ -15,7 +15,7 @@ export declare class ManagedAppendIdentityMismatchError extends Error {
15
15
  constructor(relativePath: string);
16
16
  }
17
17
  export declare class ManagedPublishError extends Error {
18
- readonly classification: "destination_conflict" | "atomic_unavailable" | "invalid_request" | "durability_not_provable" | "identity_mismatch" | "io_error" | "durability_failed";
18
+ readonly classification: "destination_conflict" | "atomic_unavailable" | "invalid_request" | "durability_not_provable" | "identity_mismatch" | "permission_denied" | "io_error" | "durability_failed";
19
19
  readonly diagnostic: string;
20
20
  readonly stagingCleanupSafe: boolean;
21
21
  constructor(classification: ManagedPublishError["classification"], outcome: NativePublishOutcome);
@@ -1,6 +1,6 @@
1
1
  export type NativePublishMutationState = "not_committed" | "committed" | "unknown";
2
2
  export type NativePublishDurabilityState = "not_attempted" | "proven" | "not_provable";
3
- export type NativePublishReason = "none" | "destination_exists" | "atomic_unavailable" | "cross_device" | "permission_denied" | "io_failure" | "interrupted" | "invalid_request" | "identity_violation" | "durability_not_provable" | "unknown";
3
+ export type NativePublishReason = "none" | "destination_exists" | "atomic_unavailable" | "cross_device" | "permission_denied" | "access_denied" | "io_failure" | "interrupted" | "invalid_request" | "identity_violation" | "durability_not_provable" | "unknown";
4
4
  export type NativePublishOperation = "direct_rename" | "retained_file" | "retained_tree";
5
5
  export type NativePublishPrimitive = "renameat2_noreplace" | "linkat_noreplace" | "mkdirat_renameat_noreplace" | "renameatx_np_excl" | "windows_rename_noreplace" | "unsupported" | "unknown";
6
6
  export type NativePublishPhase = "preflight" | "file_sync" | "rename" | "source_unlink" | "source_parent_sync" | "destination_parent_sync" | "terminal_identity" | "complete" | "unknown";
@@ -72,8 +72,12 @@ export declare const PRE_ADMISSION_ARTIFACT_SPILL_TAIL_BYTES = 4096;
72
72
  * Build the deterministic inline receipt for a tool result saved before the
73
73
  * next provider context is constructed. Byte boundaries never split UTF-8
74
74
  * code points, so head/tail recovery remains readable for emoji and CJK text.
75
+ *
76
+ * `redact` runs on the complete text before the cut. The digest stays the
77
+ * caller's hash of the stored artifact; the omitted count is the redacted
78
+ * preview's omitted bytes.
75
79
  */
76
- export declare function createPreAdmissionArtifactSpillPreview(fullText: string, artifactId: string, digest: string): string;
80
+ export declare function createPreAdmissionArtifactSpillPreview(fullText: string, artifactId: string, digest: string, redact?: (text: string) => string): string;
77
81
  /**
78
82
  * Message type for bash executions via the ! command.
79
83
  */
@@ -1152,14 +1152,14 @@ export declare const SessionManagerTestHooks: {
1152
1152
  /**
1153
1153
  * Freshness snapshot captured with every async whole-session persistence
1154
1154
  * preparation. Immediately before the synchronous persistence transaction, the
1155
- * live values are compared: a `sessionFile`/`lifecycleId` change aborts (lifecycle
1156
- * switch); a revision change discards the prepared bytes and re-prepares (bounded),
1155
+ * live values are compared: a logical lifecycle change aborts; a verified storage
1156
+ * relocation or revision change discards prepared bytes and re-prepares (bounded),
1157
1157
  * so a stale snapshot is never published.
1158
1158
  */
1159
1159
  export interface PersistenceInputToken {
1160
1160
  /** Canonical session file path the prepared bytes target. */
1161
1161
  sessionFile: string;
1162
- /** Per-manager lifecycle identity (`sessionId@sessionFile`); changes on switch/open/reset. */
1162
+ /** Logical lifecycle identity; storage-only relocation preserves its verified origin. */
1163
1163
  lifecycleId: string;
1164
1164
  /** Revision of #fileEntries affecting persisted bytes. */
1165
1165
  entryRevision: number;
@@ -1377,6 +1377,16 @@ export declare class SessionManager {
1377
1377
  }): Promise<void>;
1378
1378
  /** Ownership loss remains observable even when an agent event listener aborts the turn. */
1379
1379
  getAppendIdentityMismatch(): ManagedAppendIdentityMismatchError | undefined;
1380
+ /**
1381
+ * Register the same-owner task capability used to follow a parent's managed
1382
+ * artifact root after its session move. The synchronous resolver must return
1383
+ * only the current ArtifactManager for the same parent ID and parent transcript
1384
+ * basename; it retains the last verified manager on a logical successor.
1385
+ * Registration captures the exact original manager identity. Unchanged identity
1386
+ * keeps using the child's retained store; a changed identity triggers strict
1387
+ * destination transcript verification before re-rooting.
1388
+ */
1389
+ registerManagedTranscriptRelocationResolver(resolver: () => ArtifactManager): () => void;
1380
1390
  isPersisted(): boolean;
1381
1391
  stageDefaultModelSelection(model: string, thinkingLevel: string | undefined, options?: {
1382
1392
  readonly appendThinkingLevel: boolean;
@@ -6,7 +6,7 @@
6
6
  * performed. Environment values are trusted credential sources and take
7
7
  * precedence over global config values.
8
8
  */
9
- import type { AuthCredentialSelector, CredentialRankingMode } from "@gajae-code/ai/core";
9
+ import type { AuthCredentialSelector, ConfiguredCredentialPreference, CredentialRankingMode } from "@gajae-code/ai/core";
10
10
  export interface AuthBrokerClientConfig {
11
11
  url: string;
12
12
  token: string;
@@ -19,8 +19,10 @@ export interface StartupAuthConfigSnapshot {
19
19
  credentialPinStoreIdentity?: string;
20
20
  credentialRankingMode: CredentialRankingMode;
21
21
  credentialPins: Readonly<Record<string, string>>;
22
+ /** Ordered soft per-provider preferences; only portable email/`account:` selectors are accepted. */
23
+ credentialPreferences: Readonly<Record<string, readonly ConfiguredCredentialPreference[]>>;
22
24
  }
23
- export type StartupAuthConfigErrorKind = "unreadable" | "invalid-yaml" | "non-mapping-root" | "invalid-auth" | "invalid-broker" | "invalid-gateway" | "invalid-ranking-mode" | "invalid-credential-pins";
25
+ export type StartupAuthConfigErrorKind = "unreadable" | "invalid-yaml" | "non-mapping-root" | "invalid-auth" | "invalid-broker" | "invalid-gateway" | "invalid-ranking-mode" | "invalid-credential-pins" | "invalid-credential-preferences";
24
26
  /** A malformed startup-auth config aborts resolution rather than downgrading to local authority. */
25
27
  export declare class StartupAuthConfigError extends Error {
26
28
  readonly kind: StartupAuthConfigErrorKind;
@@ -31,11 +33,31 @@ export declare class StartupAuthConfigError extends Error {
31
33
  }
32
34
  /** JSON-schema pattern shared with the runtime persisted-selector grammar. */
33
35
  export declare const PERSISTED_CREDENTIAL_SELECTOR_PATTERN = "^(id:[1-9][0-9]*|email:[^@\\s]+@[^@\\s]+|account:\\S+)$";
36
+ export declare function startupAuthConfigError(agentDir: string, kind: StartupAuthConfigErrorKind): StartupAuthConfigError;
34
37
  /** Path to the local bearer token file. Created on the broker host by `gjc auth-broker token`. */
35
38
  export declare function getAuthBrokerTokenFilePath(): string;
36
39
  /** Validate the persisted selector grammar used by `auth.credentialPins`. */
37
40
  export declare function parsePersistedCredentialSelector(value: string): AuthCredentialSelector | undefined;
38
41
  export declare function isValidPersistedCredentialSelector(value: string): boolean;
42
+ /** JSON-schema pattern for a preference account; shared with {@link parsePreferenceAccount}. */
43
+ export declare const PREFERENCE_ACCOUNT_PATTERN = "^(email:[^@\\s]+@[^@\\s]+|account:\\S+|[^@\\s:]+@[^@\\s]+)$";
44
+ /**
45
+ * Parse one `auth.credentialPreferences` account: a bare email, `email:<address>`, or `account:<id>`. Numeric row ids
46
+ * are excluded: they are bound to one credential store, and a preference has no store-identity binding to detect a
47
+ * retargeted row.
48
+ */
49
+ export declare function parsePreferenceAccount(value: string): AuthCredentialSelector | undefined;
50
+ /** A preference cap accepts (0, 100]; 100 moves past the account only once it is blocked. */
51
+ export declare function isValidCredentialPreferenceCap(value: unknown): value is number;
52
+ /** Canonical config text for one preference entry: the account, or a one-key `{ account: cap }` mapping. */
53
+ export type CredentialPreferenceEntryValue = string | Readonly<Record<string, number>>;
54
+ /**
55
+ * Parse one provider's `auth.credentialPreferences` value: a single account, or a non-empty ordered list whose
56
+ * entries are an account (`me@example.com`) or an account with a usage cap in percent (`me@example.com: 75`).
57
+ * Returns undefined for any invalid value, including an account listed twice, so a typo fails closed instead of
58
+ * silently changing the order.
59
+ */
60
+ export declare function parseCredentialPreferenceList(value: unknown): ConfiguredCredentialPreference[] | undefined;
39
61
  /**
40
62
  * Resolve one typed startup-auth snapshot from trusted env and global config.
41
63
  * Project settings are intentionally not read here, so project-scoped pins
@@ -3,6 +3,8 @@ 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
5
  export declare const DEFAULT_ARTIFACT_MAX_BYTES: number;
6
+ /** Run `fn` while column caps can see these plain secrets. */
7
+ export declare function runWithOutputRedaction<T>(plainSecrets: readonly string[], fn: () => T): T;
6
8
  /**
7
9
  * Terminal publisher used when managed artifact storage exposes an ID but no
8
10
  * writable pathname. The sink supplies raw content retained up to its artifact
@@ -167,6 +169,15 @@ export declare function truncateLine(line: string, maxChars?: number): {
167
169
  text: string;
168
170
  wasTruncated: boolean;
169
171
  };
172
+ /**
173
+ * Truncate each line to max characters without leaving a configured plain-secret
174
+ * prefix in the retained text. Prior uncapped lines remain in scope because a
175
+ * later line's cut can split a multiline secret.
176
+ */
177
+ export declare function truncateTextWithSecretAwareness(text: string, maxChars?: number, secrets?: readonly string[]): {
178
+ text: string;
179
+ wasTruncated: boolean;
180
+ };
170
181
  /** Shared helper to build a no-truncation result. */
171
182
  export declare function noTruncResult(content: string, totalLines?: number, totalBytes?: number): TruncationResult;
172
183
  /**
@@ -114,6 +114,8 @@ export declare function registerOwnedRegistration(key: TurnRegistrationKey, opti
114
114
  * scope:"owned" abort of that exact attempt must fail closed to uncertainty
115
115
  * (review thread P2). */
116
116
  export declare function isOwnedAttemptRegistrationIncomplete(lineageIdHash: string, attemptEpoch: number): boolean;
117
+ /** Move fail-closed saturation authority with all ownership state during endpoint rekey. */
118
+ export declare function migrateOwnedAttemptSaturationsForEndpoint(predecessorEndpointId: string, successorEndpointId: string): void;
117
119
  /** Exact (jobId, jobGeneration) lookup for completion-origin classification. */
118
120
  export declare function lookupOwnedRegistration(jobId: string, jobGeneration: string, endpointId?: string): TurnRegistrationKey | undefined;
119
121
  export declare function unregisterOwnedRegistration(key: TurnRegistrationKey): void;
@@ -231,7 +233,7 @@ export declare function registerOwnedIfLineaged(manager: {
231
233
  generation?: string;
232
234
  status?: string;
233
235
  } | undefined;
234
- }, toolCallId: string | undefined, jobId: string, endpointId?: string): void;
236
+ }, toolCallId: string | undefined, jobId: string, endpointId?: string, ownedRegistrationEndpointId?: string): void;
235
237
  /** Retire the exact (endpoint, jobId, jobGeneration) owned registration when
236
238
  * its completion delivery is dead-lettered by the manager (delivery-queue
237
239
  * overflow or retry exhaustion): no message is injected and no later
@@ -1,5 +1,5 @@
1
1
  import { CodexImportError } from "./codex";
2
- export type SessionImportErrorCode = CodexImportError["code"] | "invalid_request" | "binding_invalid" | "content_too_large" | "destination_conflict" | "publish_uncertain" | "atomic_unavailable" | "durability_not_provable" | "durability_failed" | "identity_mismatch" | "validation_failed" | "io_failed" | "internal_failed";
2
+ export type SessionImportErrorCode = CodexImportError["code"] | "invalid_request" | "binding_invalid" | "content_too_large" | "destination_conflict" | "publish_uncertain" | "atomic_unavailable" | "permission_denied" | "durability_not_provable" | "durability_failed" | "identity_mismatch" | "validation_failed" | "io_failed" | "internal_failed";
3
3
  export interface SessionImportFailure {
4
4
  status: "failed";
5
5
  provider: "codex";
@@ -4,9 +4,13 @@ export declare const DEEP_INTERVIEW_MUTATION_BLOCK_MESSAGE = "Deep-interview pha
4
4
  export declare const WORKFLOW_STATE_MUTATION_BLOCK_MESSAGE = ".gjc workflow state and artifacts are runtime-owned. Agent mutation tools cannot edit `.gjc/**`; use the sanctioned `gjc` CLI instead.";
5
5
  export declare const RALPLAN_MUTATION_BLOCK_MESSAGE = "Ralplan planning phase boundary: keep refining the consensus plan and persist plan artifacts through `gjc ralplan --write` (stage scratch files under a temp dir if needed). Product-code mutation tools and patch execution are blocked while ralplan is active; mutate only after the plan is approved and execution begins.";
6
6
  export declare const ULTRAGOAL_GOAL_PLANNING_MUTATION_BLOCK_MESSAGE = "Ultragoal goal-planning phase boundary: finish goal planning and record goals through `gjc ultragoal` before editing code. Product-code mutation tools and patch execution are blocked until goal planning completes and execution begins.";
7
- export declare const AUTORESEARCH_MUTATION_BLOCK_MESSAGE = "Autoresearch research-only boundary: this workflow produces findings, evidence, and a verdict \u2014 never product code. Product-code mutation tools and patch execution are blocked everywhere, on every branch. Mission research artifacts (`autoresearch.sh` at the workdir root and mission state through the sanctioned `gjc autoresearch` CLI) stay writable; run experiments through the `python` tool, or finish the mission and hand off to an approved implementation workflow.";
8
- /** Tools whose execute path can mutate product state. `github` is included so side-effect ops share this guard. */
9
- export declare const WORKFLOW_MUTATION_TOOL_NAMES: readonly ["edit", "write", "ast_edit", "bash", "github"];
7
+ export declare const AUTORESEARCH_MUTATION_BLOCK_MESSAGE = "Autoresearch research-only boundary: this workflow produces findings, evidence, and a verdict \u2014 never product code. Product-code mutation tools and patch execution are blocked everywhere, on every branch. Write the root `autoresearch.sh` only with direct file tools; mission state stays writable through the sanctioned `gjc autoresearch` CLI. Run experiments through the `python` tool, or finish the mission and hand off to an approved implementation workflow.";
8
+ /**
9
+ * Tools whose execute path can mutate product state. `github` is included so
10
+ * side-effect ops share this guard. `eval` and `python` run code that can write
11
+ * files without going through edit, write, or bash.
12
+ */
13
+ export declare const WORKFLOW_MUTATION_TOOL_NAMES: readonly ["edit", "write", "ast_edit", "bash", "github", "eval", "python"];
10
14
  export declare function isWorkflowMutationTool(name: string): boolean;
11
15
  type ToolWithEditMode = AgentTool & {
12
16
  mode?: unknown;
@@ -0,0 +1,8 @@
1
+ import type { ModelRegistry } from "../../config/model-registry";
2
+ import type { AgentSession } from "../../session/agent-session";
3
+ type ProviderAuthStatusSession = Pick<AgentSession, "credentialSessionId"> & {
4
+ modelRegistry: Pick<ModelRegistry, "authStorage" | "getAll" | "getAvailable" | "getConfiguredProviderIds" | "getAuthStorageOwner" | "getProviderConfigApiKeySources" | "getProviderRuntimeApiKeyEnvName" | "hasRuntimeProviderApiKey">;
5
+ };
6
+ /** Format credential provenance for `/provider status` without returning credential values. */
7
+ export declare function buildProviderAuthStatusText(session: ProviderAuthStatusSession): Promise<string>;
8
+ export {};
@@ -14,10 +14,12 @@ import { Settings } from "../config/settings";
14
14
  import { type Skill } from "../extensibility/skills";
15
15
  import type { HindsightSessionState } from "../hindsight/state";
16
16
  import type { LocalProtocolOptions } from "../internal-urls";
17
+ import type { PlanModeState } from "../plan-mode/state";
17
18
  import { AgentRegistry } from "../registry/agent-registry";
18
19
  import type { ForkContextSeed } from "../session/agent-session";
19
20
  import { ArtifactManager } from "../session/artifacts";
20
21
  import type { AuthStorage } from "../session/auth-storage";
22
+ import type { ClientBridge } from "../session/client-bridge";
21
23
  import { SessionManager, type SessionMemoryMode } from "../session/session-manager";
22
24
  import "../tools/yield";
23
25
  import type { ContextFileEntry } from "../tools";
@@ -109,6 +111,21 @@ export interface ExecutorOptions {
109
111
  * the same immutable child settings snapshot.
110
112
  */
111
113
  inheritedServiceTier?: ServiceTier;
114
+ /**
115
+ * Parent ACP/SDK approval mode. `deny` and `prompt` replace the child
116
+ * default (`allow`) before the first prompt. `allow` is that default.
117
+ */
118
+ sdkPermissionMode?: "prompt" | "allow" | "deny";
119
+ /**
120
+ * Parent plan-mode state. Copied onto the child before the first prompt so
121
+ * `enforcePlanModeWrite` still refuses product-file writes.
122
+ */
123
+ planModeState?: PlanModeState;
124
+ /**
125
+ * Parent client bridge. Only `requestPermission` is copied onto the child.
126
+ * Terminal, filesystem, and deferAgentInitiatedTurns stay on the parent.
127
+ */
128
+ clientBridge?: ClientBridge;
112
129
  /** Override local:// protocol options so subagent shares parent's local:// root */
113
130
  localProtocolOptions?: LocalProtocolOptions;
114
131
  /**
@@ -149,12 +166,12 @@ export interface ExecutorOptions {
149
166
  }
150
167
  export declare class ManagedTaskPersistence {
151
168
  #private;
152
- constructor(artifacts: ArtifactManager, taskId: string);
169
+ constructor(artifacts: ArtifactManager, taskId: string, getArtifacts?: () => ArtifactManager);
153
170
  openSession(cwd: string, sessionMemoryMode?: SessionMemoryMode): Promise<SessionManager>;
154
171
  openStagedSession(attemptId?: string): Promise<SessionManager>;
155
172
  publishOutput(rawOutput: string, metadata: Uint8Array): Promise<void>;
156
173
  }
157
- export declare function createManagedTaskPersistence(artifacts: ArtifactManager, taskId: string): ManagedTaskPersistence;
174
+ export declare function createManagedTaskPersistence(artifacts: ArtifactManager, taskId: string, getArtifacts?: () => ArtifactManager): ManagedTaskPersistence;
158
175
  export declare function renderSubagentUserPrompt(assignment: string, independentMode: boolean): string;
159
176
  export interface YieldItem {
160
177
  data?: unknown;
@@ -11,3 +11,13 @@ export declare function canonicalizeAstEditWritePath(absolutePath: string): Prom
11
11
  * or a symlinked workspace), so an in-workspace real path is reattached to `cwd`.
12
12
  */
13
13
  export declare function resolveAstEditPreviewWritePaths(cwd: string, previewedPaths: readonly string[]): Promise<string[]>;
14
+ /** Refusal prefix when a single-file real path leaves its reference root. */
15
+ export declare const AST_EDIT_OUTSIDE_ROOT_MESSAGE = "AST edit target resolves outside its root";
16
+ /**
17
+ * Native astEdit canonicalizes one file and writes that real path. Directory
18
+ * scans do not follow links. A lexical path inside cwd uses the real cwd as
19
+ * the reference root; an explicit path outside cwd uses its real parent, so a
20
+ * direct file there still applies. Returns the lexical path that would leave
21
+ * that root, if any.
22
+ */
23
+ export declare function astEditSingleFileOutsideReferenceRoot(cwd: string, candidatePaths: readonly string[], signal?: AbortSignal): Promise<string | undefined>;
@@ -25,10 +25,11 @@
25
25
  *
26
26
  * Destination symlinks are followed: the referent is replaced, the link stays.
27
27
  * The referent is re-resolved immediately before publication so a retargeted
28
- * link cannot silently repoint the write, and when the lexical destination
29
- * sits inside a session-scoped `gjc-local` root the resolved referent and its
30
- * parent must remain inside that root (a link there must not redirect the
31
- * write out of the trust boundary).
28
+ * link cannot silently repoint the write. When the lexical destination sits
29
+ * inside the active explicit artifacts local root (`<artifacts>/local`) or a
30
+ * session-scoped `gjc-local` root, the resolved referent and its parent must
31
+ * remain inside that root (a link there must not redirect the write out of
32
+ * the trust boundary).
32
33
  *
33
34
  * Staging uses exclusive create (`wx`) so a colliding leftover temp is never
34
35
  * truncated or unlinked; only the temp this call created is cleaned on failure.
@@ -57,9 +58,10 @@ export declare function formatFileWriteError(error: unknown, dest: string, optio
57
58
  export interface WriteFileAtomicallyOptions {
58
59
  /**
59
60
  * Trusted root that a resolved symlink referent and its parent must not
60
- * leave. When omitted, the helper still enforces the session-scoped
61
- * `gjc-local` boundary implied by a lexical destination under
62
- * `<tmpdir>/gjc-local/<session-id>`.
61
+ * leave. When omitted, a destination inside the active explicit artifacts
62
+ * local root (`<artifacts>/local`) uses that root. Otherwise the helper
63
+ * still enforces the session-scoped `gjc-local` boundary implied by a
64
+ * lexical destination under `<tmpdir>/gjc-local/<session-id>`.
63
65
  */
64
66
  trustBoundary?: string;
65
67
  /** Platform override used by deterministic retry tests. */
@@ -3,8 +3,19 @@ export interface BashAllowedPrefixesCheck {
3
3
  reason?: string;
4
4
  }
5
5
  export type BashRestrictionProfile = "workflow" | "read-only";
6
+ /** Session identities and workspace the restricted `gjc` command may name. */
7
+ export interface GjcSessionBinding {
8
+ sessionId?: string | null;
9
+ /** Owner identity already on the tool session. Role-agent ralplan writes use it. */
10
+ credentialSessionId?: string | null;
11
+ /** Session workspace. A `--worktree-root` must be this repo, not a foreign one. */
12
+ worktreeRoot: string;
13
+ /** Child cwd. Relative `--worktree-root` resolves against it, as ralplan does. */
14
+ invocationCwd: string;
15
+ }
6
16
  export interface BashRestrictionOptions {
7
17
  profile?: BashRestrictionProfile;
18
+ gjcSessionBinding?: GjcSessionBinding;
8
19
  }
9
20
  export declare function normalizeReadOnlyBashCommand(command: string): string | undefined;
10
21
  export declare function checkBashAllowedPrefixes(command: string, allowedPrefixes: readonly string[] | undefined, options?: BashRestrictionOptions): BashAllowedPrefixesCheck;
@@ -55,6 +55,8 @@ export declare class LazyAgentTool implements AgentTool<any, any, any> {
55
55
  #private;
56
56
  readonly descriptor: ToolDescriptor;
57
57
  constructor(descriptor: ToolDescriptor, materialized?: AgentTool<any, any, any>, loader?: () => ToolDescriptorLoadResult, session?: ToolSession);
58
+ /** Clear a session-bound materialization after its owning session moves. */
59
+ invalidateForSessionMove(expectedCwd?: string): void;
58
60
  /** Materialize this facade for contract tests without exposing it in production dispatch. */
59
61
  materializeForTests(): Promise<AgentTool<any, any, any>>;
60
62
  get name(): string;
@@ -31,7 +31,7 @@ type FetchRenderResult = RenderResult & {
31
31
  /**
32
32
  * Try all special handlers
33
33
  */
34
- declare function handleSpecialUrls(url: string, timeout: number, signal: AbortSignal | undefined, storage: AgentStorage | null): Promise<FetchRenderResult | null>;
34
+ declare function handleSpecialUrls(url: string, timeout: number, signal: AbortSignal | undefined, storage: AgentStorage | null, settings: Settings): Promise<FetchRenderResult | null>;
35
35
  /** Test-only seam for verifying lazy special-handler loading and dispatch. */
36
36
  export declare const fetchSpecialHandlerTestHooks: {
37
37
  dispatch: typeof handleSpecialUrls;
@@ -317,6 +317,8 @@ export interface ToolSession {
317
317
  from: string;
318
318
  to: string;
319
319
  }>;
320
+ /** Live ACP/SDK approval mode. Task children copy this at spawn; absent means `allow`. */
321
+ getSdkPermissionMode?: () => "prompt" | "allow" | "deny";
320
322
  /** Bridge to the connected client (e.g. ACP editor host). Tools should route fs/terminal/permission requests through this when available. */
321
323
  getClientBridge?: () => ClientBridge | undefined;
322
324
  /** Get compact conversation context for subagents (excludes tool results, system prompts) */
@@ -14,7 +14,7 @@ export interface SessionPythonToolInput {
14
14
  /** Resolve the GJC session id used for the kernel owner and transcript paths. */
15
15
  getSessionId: () => string | null;
16
16
  /** Register cleanup with the current logical session lifecycle. */
17
- registerSessionCleanup: (cleanup: () => Promise<void> | void) => (() => void) | void;
17
+ registerSessionCleanup: (cleanup: () => Promise<void> | void) => (() => void) | undefined;
18
18
  /** Reject execution after the owning session has begun disposal. */
19
19
  assertEvalExecutionAllowed?: () => void;
20
20
  /** Track this whole invocation through its transcript append. */
@@ -0,0 +1,41 @@
1
+ import type { AgentTool, AgentToolResult } from "@gajae-code/agent-core";
2
+ import * as z from "zod/v4";
3
+ import type { ToolSession } from "./index";
4
+ declare const reportIssueSchema: z.ZodObject<{
5
+ tool: z.ZodString;
6
+ report: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export type ReportIssueToolInput = z.infer<typeof reportIssueSchema>;
9
+ export interface ReportIssueToolDetails {
10
+ recorded: boolean;
11
+ tool: string;
12
+ }
13
+ export interface ToolIssueEntry {
14
+ tool: string;
15
+ report: string;
16
+ model: string | null;
17
+ sessionId: string | null;
18
+ }
19
+ /** Normalize and clamp a report to the stored field limits. */
20
+ export declare function normalizeToolIssue(tool: string, report: string): {
21
+ tool: string;
22
+ report: string;
23
+ };
24
+ /** Append one report to the tool-issue database at `dbPath`. */
25
+ export declare function recordToolIssue(dbPath: string, entry: ToolIssueEntry): Promise<void>;
26
+ export declare class ReportIssueTool implements AgentTool<typeof reportIssueSchema, ReportIssueToolDetails> {
27
+ #private;
28
+ readonly name = "report_issue";
29
+ readonly label = "Report Issue";
30
+ readonly loadMode: "essential";
31
+ readonly description: string;
32
+ readonly parameters: z.ZodObject<{
33
+ tool: z.ZodString;
34
+ report: z.ZodString;
35
+ }, z.core.$strip>;
36
+ readonly strict = true;
37
+ readonly intent: "omit";
38
+ constructor(session: ToolSession, dbPath?: string);
39
+ execute(_toolCallId: string, params: ReportIssueToolInput): Promise<AgentToolResult<ReportIssueToolDetails>>;
40
+ }
41
+ export {};
@@ -178,4 +178,27 @@ export declare function capCodePointsAndBytes(text: string, maxCodePoints: numbe
178
178
  /** Shared cadence for await progress refreshes and rendered last-activity age. */
179
179
  export declare const SUBAGENT_ACTIVITY_BUCKET_MS = 5000;
180
180
  export declare function subagentAwaitRenderedStateSignature(subagents: readonly SubagentSnapshot[], receipt?: Pick<SubagentToolDetails, "awaitOutcome" | "interrupted">): string;
181
+ /** A running subagent with no activity for longer than this counts as idle in the compact panel. */
182
+ export declare const SUBAGENT_COMPACT_IDLE_MS = 30000;
183
+ /** Group counts behind the compact await panel's single summary line. */
184
+ export interface SubagentGroupSummary {
185
+ running: number;
186
+ idle: number;
187
+ retrying: number;
188
+ queued: number;
189
+ paused: number;
190
+ completed: number;
191
+ failed: number;
192
+ cancelled: number;
193
+ /** Running subagents in provider retry, per provider; drives the degradation warning. */
194
+ retryingByProvider: Record<string, number>;
195
+ }
196
+ export declare function summarizeSubagentGroup(subagents: readonly SubagentSnapshot[], nowMs: number): SubagentGroupSummary;
197
+ /**
198
+ * Rendered-state signature for the compact await panel. It covers only what the
199
+ * compact view shows (group counts and the single degradation row), so per-subagent activity that does not move
200
+ * a count no longer re-emits: the update rate is bounded by count transitions and
201
+ * the liveness interval instead of growing with the number of live subagents.
202
+ */
203
+ export declare function subagentCompactRenderedStateSignature(subagents: readonly SubagentSnapshot[], nowMs: number, receipt?: Pick<SubagentToolDetails, "awaitOutcome" | "interrupted">): string;
181
204
  export {};
@@ -1,3 +1,4 @@
1
+ import type { Settings } from "../../config/settings";
1
2
  import type { AgentStorage } from "../../session/agent-storage";
2
3
  import type { AddressResolver } from "../insane/url-guard";
3
4
  export { formatNumber } from "@gajae-code/utils";
@@ -11,7 +12,13 @@ export interface RenderResult {
11
12
  truncated: boolean;
12
13
  notes: string[];
13
14
  }
14
- export type SpecialHandler = (url: string, timeout: number, signal?: AbortSignal, storage?: AgentStorage | null) => Promise<RenderResult | null>;
15
+ /**
16
+ * `settings` is the caller's session settings. Handlers must read through it
17
+ * rather than the process-global singleton: the SDK/ACP host path runs tools
18
+ * without ever calling `Settings.init()`, where a global read throws
19
+ * "Settings not initialized" instead of scraping the page.
20
+ */
21
+ export type SpecialHandler = (url: string, timeout: number, signal?: AbortSignal, storage?: AgentStorage | null, settings?: Settings) => Promise<RenderResult | null>;
15
22
  export declare const MAX_OUTPUT_CHARS = 500000;
16
23
  export declare const MAX_BYTES: number;
17
24
  /**