@gajae-code/coding-agent 0.18.10 → 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 +295 -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
@@ -16,6 +16,7 @@ import { AgentStorage } from "../session/agent-storage";
16
16
  import { type EditMode, type EditVariantMatch } from "../utils/edit-mode";
17
17
  import { type CasReceipt } from "./atomic-yaml-patch";
18
18
  import { type AutoroutingEffective } from "./autorouting-contract";
19
+ import type { ConfigHotReloadFileSnapshot } from "./config-hot-reload";
19
20
  import { type ModelSelectorValue } from "./model-selector-value";
20
21
  import { type BashInterceptorRule, type GroupPrefix, type GroupTypeMap, type SettingPath, type SettingsSchemaReport, type SettingValue } from "./settings-schema";
21
22
  export type * from "./settings-schema";
@@ -24,6 +25,23 @@ export * from "./settings-schema";
24
25
  export interface RawSettings {
25
26
  [key: string]: unknown;
26
27
  }
28
+ /** Validated candidate view. `get` includes local patches and effective overlays. */
29
+ export interface SettingsGlobalConfigCandidate {
30
+ readonly configPath: string;
31
+ readonly diagnostics: SettingsSchemaReport;
32
+ get<P extends SettingPath>(settingPath: P): SettingValue<P>;
33
+ /** Candidate global values include pending local patches, but exclude other layers. */
34
+ getGlobal<P extends SettingPath>(settingPath: P): SettingValue<P> | undefined;
35
+ }
36
+ export interface SettingsConfigReloadPublication {
37
+ finalize(): void;
38
+ rollback(): void;
39
+ }
40
+ export declare class SettingsGlobalConfigReloadError extends Error {
41
+ readonly configPath: string | null;
42
+ readonly diagnostics?: SettingsSchemaReport | undefined;
43
+ constructor(message: string, configPath: string | null, diagnostics?: SettingsSchemaReport | undefined);
44
+ }
27
45
  /**
28
46
  * Test-only seams for the config-root workflow migration. Production code
29
47
  * never sets these; tests use them to interleave external filesystem changes
@@ -143,6 +161,18 @@ export declare class Settings implements NotificationSettingsReader {
143
161
  /** Effective merged autorouting state shared by settings diagnostics and routing policy. */
144
162
  getEffectiveAutorouting(): AutoroutingEffective;
145
163
  onChanged(listener: (path: SettingPath) => void): () => void;
164
+ /** The resolved global config.yml path, or null for in-memory settings. */
165
+ getGlobalConfigPath(): string | null;
166
+ /**
167
+ * Validate the watcher's exact snapshot without writing or rereading it.
168
+ * Rebase pending local patches after prior durable operations settle.
169
+ */
170
+ stageGlobalConfigReload(snapshot: ConfigHotReloadFileSnapshot): Promise<SettingsGlobalConfigCandidate>;
171
+ /**
172
+ * Publish a staged global config and its dependent synchronous model commit as
173
+ * one in-memory transaction. A thrown commit restores settings without hooks.
174
+ */
175
+ publishGlobalConfigReload(candidate: SettingsGlobalConfigCandidate, commitSync?: () => void): SettingsConfigReloadPublication;
146
176
  /** Whether durable settings mutations are permitted for the loaded configuration. */
147
177
  canWriteDurableConfig(): boolean;
148
178
  /** Whether this instance can publish a mutation to a durable config file. */
@@ -191,7 +221,9 @@ export declare class Settings implements NotificationSettingsReader {
191
221
  getAgentDir(): string;
192
222
  getPlansDirectory(): string;
193
223
  /**
194
- * Get shell configuration based on settings.
224
+ * Shell configuration for bash and the Python executor.
225
+ * `shellPath` comes from the user/global config only, so a project
226
+ * `.gjc/settings.json` cannot select the binary those executors run.
195
227
  */
196
228
  getShellConfig(): import("@gajae-code/utils/shell-config").ShellConfig;
197
229
  /**
@@ -1,6 +1,10 @@
1
1
  import type { DapAdapterConfig, DapResolvedAdapter } from "./types";
2
2
  export declare function getAdapterConfigs(): Record<string, DapAdapterConfig>;
3
- export declare function resolveAdapter(adapterName: string, cwd: string): DapResolvedAdapter | null;
4
- export declare function getAvailableAdapters(cwd: string): DapResolvedAdapter[];
5
- export declare function selectLaunchAdapter(program: string, cwd: string, adapterName?: string): DapResolvedAdapter | null;
6
- export declare function selectAttachAdapter(cwd: string, adapterName?: string, port?: number): DapResolvedAdapter | null;
3
+ /**
4
+ * `trustCwds` are extra trust roots, such as the session workspace when the command
5
+ * cwd is a different directory. A command controlled by any of them is refused.
6
+ */
7
+ export declare function resolveAdapter(adapterName: string, cwd: string, trustCwds?: readonly string[]): DapResolvedAdapter | null;
8
+ export declare function getAvailableAdapters(cwd: string, trustCwds?: readonly string[]): DapResolvedAdapter[];
9
+ export declare function selectLaunchAdapter(program: string, cwd: string, adapterName?: string, trustCwds?: readonly string[]): DapResolvedAdapter | null;
10
+ export declare function selectAttachAdapter(cwd: string, adapterName?: string, port?: number, trustCwds?: readonly string[]): DapResolvedAdapter | null;
@@ -22,5 +22,10 @@ export interface SystemInfo {
22
22
  export declare function collectSystemInfo(): Promise<SystemInfo>;
23
23
  /** Format system info for display */
24
24
  export declare function formatSystemInfo(info: SystemInfo): string;
25
- /** Sanitize environment variables by redacting sensitive values */
25
+ /**
26
+ * Sanitize environment variables for a debug report.
27
+ * Sensitive names stay fully replaced. Other values keep their text, with the
28
+ * same credential shapes removed that crash records already scrub before they
29
+ * are written to disk.
30
+ */
26
31
  export declare function sanitizeEnv(env: Record<string, string | undefined>): Record<string, string>;
@@ -20,7 +20,9 @@ export declare function normalizeClaudeMcpJson(content: string, sourcePath: stri
20
20
  * Normalize a Codex `config.toml` file body into the internal MCP contract.
21
21
  * Only the `[mcp_servers.*]` sections are read; everything else is ignored.
22
22
  */
23
- export declare function normalizeCodexMcpToml(content: string, sourcePath: string, level?: "project" | "user"): MCPCompatNormalizeResult;
23
+ export declare function normalizeCodexMcpToml(content: string, sourcePath: string, level?: "project" | "user", options?: {
24
+ omitEnvReferences?: boolean;
25
+ }): MCPCompatNormalizeResult;
24
26
  /**
25
27
  * Validate a normalized server against the internal MCP contract. Returns an
26
28
  * error message, or undefined when the definition is importable. Callers use
@@ -50,6 +50,9 @@ export interface ApplyPatchOptions {
50
50
  * object identity is not a durable-lock capability probe.
51
51
  */
52
52
  crossProcessLock?: boolean;
53
+ /** Explicit artifacts `local` root for this call. The caller session owns it. */
54
+ localRoot?: string;
55
+ signal?: AbortSignal;
53
56
  }
54
57
  /** Default filesystem implementation using Bun APIs */
55
58
  export declare const defaultFileSystem: FileSystem;
@@ -61,6 +64,8 @@ export declare const defaultFileSystem: FileSystem;
61
64
  * edits cannot silently overwrite each other (#2900).
62
65
  */
63
66
  export declare function applyPatch(input: PatchInput, options: ApplyPatchOptions): Promise<ApplyPatchResult>;
67
+ /** Read-only mkdir check for one patch hunk. Does not create directories. */
68
+ export declare function preflightPatchMkdir(input: PatchInput, options: ApplyPatchOptions): Promise<void>;
64
69
  /**
65
70
  * Preview what changes a patch would make without applying it.
66
71
  */
@@ -121,3 +121,6 @@ export interface ExecuteReplaceSingleOptions {
121
121
  beginDeferredDiagnosticsForPath: (path: string) => WritethroughDeferredHandle;
122
122
  }
123
123
  export declare function executeReplaceSingle(options: ExecuteReplaceSingleOptions): Promise<AgentToolResult<EditToolDetails, typeof replaceEditEntrySchema>>;
124
+ export declare function executeReplaceEntries(options: Omit<ExecuteReplaceSingleOptions, "params"> & {
125
+ edits: ReplaceEditEntry[];
126
+ }): Promise<AgentToolResult<EditToolDetails, typeof replaceEditSchema>>;
@@ -111,6 +111,18 @@ export declare function getShellSessionCount(): number;
111
111
  * shell resources, and is also callable directly (e.g. on owner teardown).
112
112
  */
113
113
  export declare function disposeAllShellSessions(): Promise<void>;
114
+ type ShellMinimizerSource = {
115
+ getGroup(prefix: "shellMinimizer"): ShellMinimizerSettings;
116
+ getGlobal?(path: "shellMinimizer.settingsPath" | "shellMinimizer.settingsHash"): unknown;
117
+ getOverride?(path: "shellMinimizer.settingsPath"): unknown;
118
+ };
119
+ /**
120
+ * A repo `.gjc/settings.json` must not point the minimizer at a TOML file.
121
+ * The native gate loads that file only when `settingsHash` matches, and the
122
+ * pin is the user/global value. A user path or a runtime override is still
123
+ * passed through. A project path is passed only together with that pin.
124
+ */
125
+ export declare function resolveTrustedShellMinimizer(settings: ShellMinimizerSource): ShellMinimizerSettings;
114
126
  /** Translate `ShellMinimizerSettings` into native `MinimizerOptions`, or `undefined` when disabled. */
115
127
  export declare function buildMinimizerOptions(group: ShellMinimizerSettings): MinimizerOptions | undefined;
116
128
  export declare function executeBash(command: string, options?: BashExecutorOptions): Promise<BashResult>;
@@ -5,6 +5,9 @@ export declare const MANAGED_OWNER_PREDECESSOR_GENERATION_ENV = "GJC_MANAGED_OWN
5
5
  export declare const MANAGED_OWNER_PREDECESSOR_RUN_ID_ENV = "GJC_MANAGED_OWNER_PREDECESSOR_RUN_ID";
6
6
  export declare const MANAGED_OWNER_PREDECESSOR_INCARNATION_ENV = "GJC_MANAGED_OWNER_PREDECESSOR_INCARNATION";
7
7
  export declare const MANAGED_OWNER_TRANSCRIPT_PATH_ENV = "GJC_MANAGED_OWNER_TRANSCRIPT_PATH";
8
+ export declare function trustedManagedOwnerTranscriptPath(env?: NodeJS.ProcessEnv, cwd?: string): string;
9
+ /** Session file forwarded to a replacement child. Same provenance rule. */
10
+ export declare function trustedManagedOwnerLaunchSessionFile(env: NodeJS.ProcessEnv, cwd: string): string;
8
11
  export interface ManagedOwnerRecoveryContext {
9
12
  root: string;
10
13
  binding: ManagedOwnerBinding;
@@ -72,6 +72,8 @@ export declare const SessionStateLockTestHooks: {
72
72
  afterCurrentOwnerValidation?: (file: string) => void | Promise<void>;
73
73
  /** @internal Fault seam immediately before a held owner record rewrite mutates bytes. */
74
74
  beforeOwnerRecordRewrite?: (file: string) => void | Promise<void>;
75
+ /** @internal Fault seam immediately before the pre-rewrite fstat on the owner record handle. */
76
+ beforeOwnerRecordPrewriteStat?: (file: string) => void | Promise<void>;
75
77
  /** @internal Fault seam immediately before final transition-generation validation. */
76
78
  beforeTransitionReleaseLstat?: (transitionDir: string) => void | Promise<void>;
77
79
  /** @internal Fault seam immediately before setup generation capture. */
@@ -47,8 +47,6 @@ export declare const DEEP_INTERVIEW_EXECUTION_APPROVAL_RECORD_FILE = "deep-inter
47
47
  export declare const DEEP_INTERVIEW_EXECUTION_APPROVAL_MAX_AGE_MS: number;
48
48
  export interface ExecutionApprovalTranscriptBoundary {
49
49
  byte_length: number;
50
- device: string;
51
- inode: string;
52
50
  leaf_id: string | null;
53
51
  approval_tool_call_id: string;
54
52
  }
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Codex adapter: reads `~/.codex/config.toml` ([mcp_servers]) and `~/.codex/prompts`.
2
+ * Codex adapter: reads `~/.codex/config.toml` ([mcp_servers]), `~/.codex/prompts`,
3
+ * and user-level `~/.codex/AGENTS.md` instructions. Project AGENTS.md is native GJC input.
3
4
  */
4
5
  import { type Adapter } from "./index";
5
6
  export declare const codexAdapter: Adapter;
@@ -1,13 +1,22 @@
1
- import type { AdapterResult, MigrateSource, SkillCandidate, SourceDiagnostic } from "../types";
1
+ import type { AdapterResult, InstructionCandidate, MigrateSource, SkillCandidate, SourceDiagnostic } from "../types";
2
2
  export interface AdapterOptions {
3
3
  /** Home directory root; overridable for tests. */
4
4
  homeDir: string;
5
+ /** Source scope for instructions; other source files remain home-scoped. */
6
+ scope: "project" | "user";
7
+ /** Project root used when importing project instructions. */
8
+ cwd: string;
5
9
  }
6
10
  export interface Adapter {
7
11
  source: MigrateSource;
8
12
  collect(options: AdapterOptions): Promise<AdapterResult>;
9
13
  }
10
14
  export declare function getAdapter(source: MigrateSource): Adapter;
15
+ /** Collect one source instruction file without interpreting or rewriting its content. */
16
+ export declare function collectInstructionFile(filePath: string, source: MigrateSource): Promise<{
17
+ candidates: InstructionCandidate[];
18
+ diagnostics: SourceDiagnostic[];
19
+ }>;
11
20
  /** Read a text file, classifying absence/IO errors into source diagnostics. */
12
21
  export declare function readSourceText(filePath: string, source: MigrateSource, type: SourceDiagnostic["type"]): Promise<{
13
22
  text: string;
@@ -1,2 +1,4 @@
1
1
  import type { MigrateAction } from "./types";
2
- export declare function executeActions(actions: MigrateAction[]): Promise<MigrateAction[]>;
2
+ export declare function executeActions(actions: MigrateAction[], options?: {
3
+ project?: boolean;
4
+ }): Promise<MigrateAction[]>;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Shared types for `gjc migrate`.
3
3
  *
4
- * Imports MCP servers and skills from other coding agents (Claude Code, Codex,
5
- * OpenCode) into native GJC config. See the consensus plan under
4
+ * Imports MCP servers, skills, and instruction files from other coding agents
5
+ * (Claude Code, Codex, OpenCode) into native GJC config. See the consensus plan under
6
6
  * `.gjc/plans/ralplan/` for the full taxonomy and force/collision semantics.
7
7
  */
8
8
  import type { MCPServerConfig } from "../runtime-mcp/types";
@@ -12,7 +12,7 @@ export declare const MIGRATE_SOURCES: readonly MigrateSource[];
12
12
  /** Canonical, deterministic ordering used when expanding `--from all` / repeated `--from`. */
13
13
  export declare const CANONICAL_SOURCE_ORDER: readonly MigrateSource[];
14
14
  /** What kind of thing an action/coverage row is about. */
15
- export type MigrateItemType = "mcp" | "skill" | "source";
15
+ export type MigrateItemType = "mcp" | "skill" | "instruction" | "source";
16
16
  /**
17
17
  * Per-item outcome taxonomy.
18
18
  *
@@ -42,6 +42,12 @@ export interface SkillCandidate {
42
42
  content: string;
43
43
  warnings: string[];
44
44
  }
45
+ /** An instructions file imported as the active GJC AGENTS.md for its scope. */
46
+ export interface InstructionCandidate {
47
+ source: MigrateSource;
48
+ name: string;
49
+ content: string;
50
+ }
45
51
  /**
46
52
  * Source-level diagnostic for a single source/type pair (e.g. "codex mcp config
47
53
  * was malformed"). Distinct from per-item actions so absent/unreadable sources
@@ -57,6 +63,7 @@ export interface SourceDiagnostic {
57
63
  export interface AdapterResult {
58
64
  mcpCandidates: McpCandidate[];
59
65
  skillCandidates: SkillCandidate[];
66
+ instructionCandidates: InstructionCandidate[];
60
67
  diagnostics: SourceDiagnostic[];
61
68
  }
62
69
  /** A single planned action consumed identically by dry-run and live execution. */
@@ -80,6 +87,9 @@ export interface MigrateAction {
80
87
  skill?: {
81
88
  content: string;
82
89
  };
90
+ instruction?: {
91
+ content: string;
92
+ };
83
93
  }
84
94
  export interface MigrateWarning {
85
95
  source: MigrateSource;
@@ -91,6 +101,7 @@ export type StatusCounts = Record<MigrationStatus, number>;
91
101
  export interface MigrateDestinations {
92
102
  mcpConfigPath: string;
93
103
  skillsDir: string;
104
+ instructionsPath: string;
94
105
  }
95
106
  /** The full machine-readable report emitted with `--json`. */
96
107
  export interface MigrateReport {
@@ -105,6 +116,7 @@ export interface MigrateReport {
105
116
  byType: {
106
117
  mcp: StatusCounts;
107
118
  skill: StatusCounts;
119
+ instruction: StatusCounts;
108
120
  source: StatusCounts;
109
121
  };
110
122
  bySource: Record<MigrateSource, StatusCounts>;
@@ -69,6 +69,10 @@ export interface SettingsCallbacks {
69
69
  onPetCommit?: (mode: string) => boolean;
70
70
  /** Called for status line preview while configuring */
71
71
  onStatusLinePreview?: (settings: StatusLinePreviewSettings) => void;
72
+ /** Called when a status-line submenu begins an uncommitted preview. */
73
+ onStatusLinePreviewStart?: () => void;
74
+ /** Called when a status-line preview is committed, cancelled, or disposed. */
75
+ onStatusLinePreviewEnd?: () => void;
72
76
  /** Get current rendered status line for inline preview */
73
77
  getStatusLinePreview?: (width?: number) => string;
74
78
  /** Render a status-line preview for supplied draft settings without mutating the live status line. */
@@ -97,6 +101,8 @@ export declare class SettingsSelectorComponent extends Container {
97
101
  private readonly notificationsOperations?;
98
102
  constructor(context: SettingsRuntimeContext, callbacks: SettingsCallbacks, notificationsOperations?: NotificationsEditorOperations | undefined);
99
103
  getFocusComponent(): Component;
104
+ /** Refresh saved rows and model-profile choices without replacing active editors. */
105
+ refreshFromConfiguration(availableModelProfiles: readonly string[]): void;
100
106
  dispose(): void;
101
107
  handleInput(data: string): void;
102
108
  }
@@ -84,6 +84,8 @@ export declare class SelectorController {
84
84
  component: Component;
85
85
  focus: Component;
86
86
  }): void;
87
+ /** Refresh accepted disk configuration without discarding an open preview. */
88
+ refreshConfiguration(): void;
87
89
  showCommandPalette(commands: SlashCommand[], actions: CommandPaletteAction[], executeSlashCommand: (name: string) => Promise<void>): void;
88
90
  showProviderOnboarding(): void;
89
91
  showFrictionlessOnboarding(): Promise<void>;
@@ -27,6 +27,7 @@ export declare class Theme {
27
27
  strikethrough(text: string): string;
28
28
  inverse(text: string): string;
29
29
  getFgAnsi(color: ThemeColor): string;
30
+ getSvgPalette(): Readonly<Record<string, string>>;
30
31
  getBgAnsi(color: ThemeBg): string;
31
32
  getColorMode(): ColorMode;
32
33
  getThinkingBorderColor(level: ThinkingLevel | Effort): (str: string) => string;
@@ -1,4 +1,8 @@
1
1
  export declare const MCP_MAX_CONTENT_BYTES: number;
2
+ export declare const MCP_MAX_IMAGES = 16;
3
+ export declare const MCP_MAX_IMAGE_SOURCE_DIMENSION = 8192;
4
+ export declare const MCP_MAX_IMAGE_SOURCE_PIXELS = 16000000;
5
+ export declare const MCP_MAX_IMAGE_OUTPUT_BYTES: number;
2
6
  export declare const MCP_MAX_ERROR_BYTES: number;
3
7
  export declare const MCP_MAX_SSE_REQUEST_MESSAGES = 1024;
4
8
  export declare const MCP_MAX_SSE_BATCH_MESSAGES = 1024;
@@ -71,6 +71,8 @@ export interface MCPToolCatalogSnapshot {
71
71
  publication: MCPToolCatalogPublication;
72
72
  generation: number;
73
73
  }
74
+ /** Drop project stdio servers unless the user/global opt-in is set. */
75
+ export declare function omitUnapprovedProjectStdio(configs: Record<string, MCPServerConfig>, sources: Record<string, SourceMeta>, allowProjectStdio: boolean, toolsOnly?: boolean): void;
74
76
  /** Options for discovering and connecting to MCP servers */
75
77
  export interface MCPDiscoverOptions {
76
78
  /** Whether to load project-level config (default: true) */
@@ -97,6 +99,11 @@ export interface MCPDiscoverOptions {
97
99
  export interface MCPManagerOptions {
98
100
  /** Restrict this instance to tools from an explicit MCP config. */
99
101
  toolsOnly?: boolean;
102
+ /**
103
+ * Spawn stdio servers loaded from a project MCP file. Default false.
104
+ * User-scope servers and an explicit `--mcp-config` file are unaffected.
105
+ */
106
+ allowUntrustedProjectStdio?: boolean;
100
107
  /**
101
108
  * Ceiling for the startup wait, in milliseconds. ACP lifecycle launches and
102
109
  * plugin MCP startup use bounded caller-owned budgets; other consumers keep
@@ -0,0 +1,22 @@
1
+ export declare const GJC_PLUGIN_MCP_PROVIDER = "gjc-plugins";
2
+ /**
3
+ * A repository plugin MCP server must not occupy a normalized tool name that a
4
+ * non-plugin server already published. The whole plugin server is omitted so a
5
+ * sibling tool from that server is not left registered. Non-plugin collisions
6
+ * and the input order stay unchanged.
7
+ */
8
+ export declare function omitPluginMcpNameShadows<T extends {
9
+ name: string;
10
+ }>(tools: readonly T[]): T[];
11
+ /** Normalized names of plugin tools that remain after shadow omission. */
12
+ export declare function survivingPluginMcpToolNames<T extends {
13
+ name: string;
14
+ }>(tools: readonly T[]): string[];
15
+ /**
16
+ * The required-name list is the plugin tools that survived the name filter,
17
+ * plus requested names this batch did not omit. An omitted plugin tool, including
18
+ * a sibling that does not itself collide, is not required.
19
+ */
20
+ export declare function retainPluginMcpMandatoryNames(tools: readonly {
21
+ name: string;
22
+ }[], requested: readonly string[]): string[];
@@ -72,6 +72,8 @@ export declare class MCPTool implements CustomTool<TSchema, MCPToolDetails> {
72
72
  readonly mcpToolName: string;
73
73
  /** Server name */
74
74
  readonly mcpServerName: string;
75
+ /** True when this tool came from a repository GJC plugin bundle. */
76
+ readonly gjcPluginBundle: boolean;
75
77
  private connection;
76
78
  invalidateForSessionControl(): void;
77
79
  /** Create MCPTool instances for all tools from an MCP server lease/connection. */
@@ -98,6 +100,8 @@ export declare class DeferredMCPTool implements CustomTool<TSchema, MCPToolDetai
98
100
  readonly mcpToolName: string;
99
101
  /** Server name */
100
102
  readonly mcpServerName: string;
103
+ /** True when this tool came from a repository GJC plugin bundle. */
104
+ readonly gjcPluginBundle: boolean;
101
105
  invalidateForSessionControl(): void;
102
106
  /** Create DeferredMCPTool instances for all tools from an MCP server */
103
107
  static fromTools(serverName: string, tools: MCPToolDefinition[], getConnection: () => Promise<MCPServerConnection>, source?: SourceMeta, reconnect?: MCPReconnect, options?: MCPToolOptions): DeferredMCPTool[];
@@ -29,7 +29,7 @@ export interface BrokerExitRecord {
29
29
  export interface BrokerStartupExitRecord {
30
30
  version: 1;
31
31
  mode: "startup";
32
- reason: "startup-deadline" | "startup-signal" | "startup-lock-blocked";
32
+ reason: "startup-deadline" | "startup-signal" | "startup-lock-blocked" | "startup-lock-unavailable";
33
33
  fenceReason: null;
34
34
  fencedForMs: 0;
35
35
  uptimeMs: number;
@@ -38,7 +38,7 @@ export interface BrokerStartupExitRecord {
38
38
  exitCode: 1 | 130 | 143;
39
39
  timeoutMs: number | null;
40
40
  writtenAt: number;
41
- /** For lock-blocked reason: path to the retained removal transition. */
41
+ /** For lock refusal reasons: path to the transition or lock that blocked startup. */
42
42
  blockingLockPath?: string;
43
43
  }
44
44
  export type BrokerStartupExitWriteStatus = {
@@ -1,4 +1,4 @@
1
- import type { NativeDirectoryTreeSnapshot } from "@gajae-code/natives";
1
+ import { type NativeDirectoryTreeSnapshot } from "@gajae-code/natives";
2
2
  import type { ModelProfileErrorDetails } from "../../config/model-profile-contract";
3
3
  import type { TaskArtifactOwnerDeletionEvidence, TaskArtifactOwnerRetirementContinuation } from "../../session/task-artifact-owner-codec";
4
4
  import { type SdkHostModelResolver } from "../host/model-pin";
@@ -283,6 +283,7 @@ export declare function reapStaleBrokerLockArtifacts(input: {
283
283
  now?: number;
284
284
  graceMs?: number;
285
285
  pidAlive?: (pid: number) => boolean;
286
+ processIncarnation?: (pid: number) => string | undefined;
286
287
  }): Promise<BrokerLockArtifactReapResult>;
287
288
  export interface StartupAdmissionTiming {
288
289
  now(): number;
@@ -412,6 +413,11 @@ export declare function setTerminalPersistenceHookForTest(broker: Broker, hook:
412
413
  export declare function setAmbiguityGraceForTest(broker: Broker, graceMs: number | undefined): void;
413
414
  /** Test-only hook for shortening the startup lock-artifact reap bound. */
414
415
  export declare function setLockArtifactGraceForTest(broker: Broker, graceMs: number | undefined): void;
416
+ /** Test-only barriers for exercising the cross-process broker-lock reclaim fence. */
417
+ export declare function setBrokerLockReclaimHooksForTest(broker: Broker, hooks: {
418
+ beforeQuarantine?: () => Promise<void>;
419
+ onContended?: () => void;
420
+ } | undefined): void;
415
421
  /** Test-only hook for shortening the bounded liveness deadline. */
416
422
  export declare function setLivenessGraceForTest(broker: Broker, graceMs: number | undefined): void;
417
423
  /** Test-only hook for shortening the bounded wait before a deferred managed close is queued. */
@@ -1,4 +1,6 @@
1
+ import type * as childProcess from "node:child_process";
1
2
  import { type BrokerDiscovery } from "./discovery";
3
+ import { type BrokerLaunchHandoff, type BrokerLaunchResult } from "./ensure";
2
4
  export interface AuthorizedBrokerSuccessorOptions {
3
5
  agentDir: string;
4
6
  requestId: string;
@@ -11,10 +13,14 @@ export type AuthorizedBrokerSuccessorResult = {
11
13
  discovery: BrokerDiscovery;
12
14
  } | {
13
15
  kind: "spawned";
16
+ child: childProcess.ChildProcess;
17
+ realBrokerPid: number | undefined;
18
+ realBrokerIncarnation: string | undefined;
19
+ handoff: BrokerLaunchHandoff | undefined;
14
20
  discovery: BrokerDiscovery;
15
21
  } | {
16
22
  kind: "refused";
17
- reason: "deadline_elapsed" | "intent_not_committed" | "spawn_failed" | "spawn_exited_before_publication" | "publication_timeout";
23
+ reason: "deadline_elapsed" | "intent_not_committed" | "spawn_failed" | "spawn_exited_before_publication" | "publication_timeout" | "startup_lock_unavailable";
18
24
  detail?: string;
19
25
  };
20
26
  /**
@@ -30,6 +36,10 @@ export type AuthorizedBrokerSuccessorResult = {
30
36
  * has been released.
31
37
  */
32
38
  export declare function launchAuthorizedBrokerSuccessor(options: AuthorizedBrokerSuccessorOptions): Promise<AuthorizedBrokerSuccessorResult>;
39
+ /** Test hook: retries exact cleanup before mapping a launch error to refusal. */
40
+ export declare function refuseFailedBrokerLaunchForTest(launched: BrokerLaunchResult): Promise<Extract<AuthorizedBrokerSuccessorResult, {
41
+ kind: "refused";
42
+ }>>;
33
43
  /**
34
44
  * Positive OS-confirmed absence of the exact prior owner, distinguished from
35
45
  * every merely-inconclusive outcome (permission denial, PID reuse ambiguity,
@@ -44,7 +44,7 @@ export type DoctorBrokerRestartOutcome = {
44
44
  kind: "successor_refused";
45
45
  requestId: string;
46
46
  oldOwner: BrokerRestartOwnerIdentity;
47
- reason: "deadline_elapsed" | "intent_not_committed" | "spawn_failed" | "spawn_exited_before_publication" | "publication_timeout";
47
+ reason: "deadline_elapsed" | "intent_not_committed" | "spawn_failed" | "spawn_exited_before_publication" | "publication_timeout" | "startup_lock_unavailable";
48
48
  detail?: string;
49
49
  };
50
50
  export declare function prepareDoctorBrokerRestart(client: SdkClient, discovery: BrokerDiscovery, options: DoctorBrokerRestartOptions & {