@gajae-code/coding-agent 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +1 -1
  3. package/dist/types/async/job-manager.d.ts +7 -0
  4. package/dist/types/cli/args.d.ts +3 -1
  5. package/dist/types/commands/deep-interview.d.ts +3 -0
  6. package/dist/types/commands/launch.d.ts +6 -0
  7. package/dist/types/config/keybindings.d.ts +5 -0
  8. package/dist/types/config/model-profile-activation.d.ts +30 -0
  9. package/dist/types/config/model-profiles.d.ts +19 -0
  10. package/dist/types/config/model-registry.d.ts +8 -0
  11. package/dist/types/config/model-resolver.d.ts +1 -1
  12. package/dist/types/config/models-config-schema.d.ts +47 -0
  13. package/dist/types/config/settings-schema.d.ts +14 -4
  14. package/dist/types/debug/crash-diagnostics.d.ts +45 -0
  15. package/dist/types/debug/runtime-gauges.d.ts +6 -0
  16. package/dist/types/deep-interview/render-middleware.d.ts +1 -0
  17. package/dist/types/eval/py/executor.d.ts +2 -0
  18. package/dist/types/eval/py/kernel.d.ts +2 -0
  19. package/dist/types/exec/bash-executor.d.ts +10 -0
  20. package/dist/types/gjc-runtime/cli-write-receipt.d.ts +24 -0
  21. package/dist/types/gjc-runtime/deep-interview-runtime.d.ts +1 -0
  22. package/dist/types/gjc-runtime/state-migrations.d.ts +9 -0
  23. package/dist/types/gjc-runtime/state-schema.d.ts +317 -0
  24. package/dist/types/gjc-runtime/state-writer.d.ts +10 -0
  25. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +2 -1
  26. package/dist/types/gjc-runtime/workflow-command-ref.d.ts +43 -0
  27. package/dist/types/harness-control-plane/control-endpoint.d.ts +3 -2
  28. package/dist/types/hooks/skill-state.d.ts +21 -0
  29. package/dist/types/internal-urls/agent-protocol.d.ts +2 -2
  30. package/dist/types/internal-urls/artifact-protocol.d.ts +2 -2
  31. package/dist/types/internal-urls/registry-helpers.d.ts +8 -7
  32. package/dist/types/internal-urls/types.d.ts +4 -0
  33. package/dist/types/lsp/index.d.ts +10 -10
  34. package/dist/types/main.d.ts +10 -1
  35. package/dist/types/modes/bridge/auth.d.ts +12 -0
  36. package/dist/types/modes/bridge/bridge-client-bridge.d.ts +9 -0
  37. package/dist/types/modes/bridge/bridge-mode.d.ts +44 -0
  38. package/dist/types/modes/bridge/bridge-ui-context.d.ts +88 -0
  39. package/dist/types/modes/bridge/event-stream.d.ts +8 -0
  40. package/dist/types/modes/components/custom-editor.d.ts +6 -0
  41. package/dist/types/modes/components/custom-provider-wizard.d.ts +10 -0
  42. package/dist/types/modes/components/jobs-overlay-model.d.ts +31 -0
  43. package/dist/types/modes/components/jobs-overlay.d.ts +30 -0
  44. package/dist/types/modes/components/model-selector.d.ts +6 -1
  45. package/dist/types/modes/components/provider-onboarding-selector.d.ts +1 -1
  46. package/dist/types/modes/components/status-line/types.d.ts +2 -0
  47. package/dist/types/modes/components/status-line.d.ts +2 -0
  48. package/dist/types/modes/controllers/input-controller.d.ts +1 -0
  49. package/dist/types/modes/controllers/selector-controller.d.ts +9 -0
  50. package/dist/types/modes/index.d.ts +1 -0
  51. package/dist/types/modes/interactive-mode.d.ts +1 -0
  52. package/dist/types/modes/jobs-observer.d.ts +57 -0
  53. package/dist/types/modes/rpc/host-tools.d.ts +1 -16
  54. package/dist/types/modes/rpc/host-uris.d.ts +1 -38
  55. package/dist/types/modes/shared/agent-wire/command-dispatch.d.ts +20 -0
  56. package/dist/types/modes/shared/agent-wire/command-validation.d.ts +2 -0
  57. package/dist/types/modes/shared/agent-wire/event-envelope.d.ts +24 -0
  58. package/dist/types/modes/shared/agent-wire/handshake.d.ts +46 -0
  59. package/dist/types/modes/shared/agent-wire/host-tool-bridge.d.ts +16 -0
  60. package/dist/types/modes/shared/agent-wire/host-uri-bridge.d.ts +17 -0
  61. package/dist/types/modes/shared/agent-wire/protocol.d.ts +44 -0
  62. package/dist/types/modes/shared/agent-wire/responses.d.ts +4 -0
  63. package/dist/types/modes/shared/agent-wire/scopes.d.ts +18 -0
  64. package/dist/types/modes/shared/agent-wire/ui-request-broker.d.ts +42 -0
  65. package/dist/types/modes/shared/agent-wire/ui-result.d.ts +27 -0
  66. package/dist/types/modes/types.d.ts +2 -0
  67. package/dist/types/sdk.d.ts +3 -1
  68. package/dist/types/session/agent-session.d.ts +11 -1
  69. package/dist/types/skill-state/workflow-state-contract.d.ts +1 -2
  70. package/dist/types/skill-state/workflow-state-version.d.ts +3 -0
  71. package/dist/types/task/executor.d.ts +1 -0
  72. package/dist/types/task/id.d.ts +7 -0
  73. package/dist/types/task/index.d.ts +5 -0
  74. package/dist/types/task/receipt.d.ts +85 -0
  75. package/dist/types/task/spawn-gate.d.ts +38 -0
  76. package/dist/types/task/types.d.ts +143 -11
  77. package/dist/types/tools/cron.d.ts +6 -0
  78. package/dist/types/tools/hindsight-recall.d.ts +0 -2
  79. package/dist/types/tools/hindsight-reflect.d.ts +0 -2
  80. package/dist/types/tools/hindsight-retain.d.ts +0 -2
  81. package/dist/types/tools/index.d.ts +6 -4
  82. package/dist/types/tools/path-utils.d.ts +1 -0
  83. package/dist/types/tools/subagent.d.ts +15 -0
  84. package/package.json +7 -7
  85. package/scripts/build-binary.ts +7 -0
  86. package/src/async/job-manager.ts +36 -0
  87. package/src/cli/args.ts +19 -2
  88. package/src/commands/deep-interview.ts +1 -0
  89. package/src/commands/harness.ts +289 -19
  90. package/src/commands/launch.ts +10 -2
  91. package/src/commands/state.ts +2 -1
  92. package/src/commands/team.ts +22 -4
  93. package/src/config/keybindings.ts +6 -0
  94. package/src/config/model-profile-activation.ts +157 -0
  95. package/src/config/model-profiles.ts +155 -0
  96. package/src/config/model-registry.ts +19 -0
  97. package/src/config/model-resolver.ts +3 -2
  98. package/src/config/models-config-schema.ts +36 -0
  99. package/src/config/settings-schema.ts +16 -3
  100. package/src/dap/client.ts +17 -3
  101. package/src/debug/crash-diagnostics.ts +223 -0
  102. package/src/debug/runtime-gauges.ts +20 -0
  103. package/src/deep-interview/render-middleware.ts +6 -0
  104. package/src/defaults/gjc/skills/deep-interview/SKILL.md +1 -1
  105. package/src/defaults/gjc/skills/ralplan/SKILL.md +31 -2
  106. package/src/defaults/gjc/skills/ultragoal/SKILL.md +39 -3
  107. package/src/defaults/gjc/skills/ultragoal/ai-slop-cleaner.md +61 -0
  108. package/src/defaults/gjc-defaults.ts +7 -0
  109. package/src/eval/py/executor.ts +21 -1
  110. package/src/eval/py/kernel.ts +15 -0
  111. package/src/exec/bash-executor.ts +41 -0
  112. package/src/gjc-runtime/cli-write-receipt.ts +31 -0
  113. package/src/gjc-runtime/deep-interview-runtime.ts +69 -32
  114. package/src/gjc-runtime/ralplan-runtime.ts +213 -36
  115. package/src/gjc-runtime/state-migrations.ts +54 -7
  116. package/src/gjc-runtime/state-runtime.ts +461 -64
  117. package/src/gjc-runtime/state-schema.ts +192 -0
  118. package/src/gjc-runtime/state-writer.ts +32 -1
  119. package/src/gjc-runtime/team-runtime.ts +177 -105
  120. package/src/gjc-runtime/ultragoal-runtime.ts +231 -38
  121. package/src/gjc-runtime/workflow-command-ref.ts +239 -0
  122. package/src/gjc-runtime/workflow-manifest.generated.json +108 -4
  123. package/src/gjc-runtime/workflow-manifest.ts +3 -1
  124. package/src/harness-control-plane/control-endpoint.ts +19 -8
  125. package/src/harness-control-plane/owner.ts +57 -10
  126. package/src/harness-control-plane/state-machine.ts +2 -1
  127. package/src/hooks/skill-state.ts +176 -26
  128. package/src/internal-urls/agent-protocol.ts +68 -21
  129. package/src/internal-urls/artifact-protocol.ts +12 -17
  130. package/src/internal-urls/docs-index.generated.ts +8 -10
  131. package/src/internal-urls/registry-helpers.ts +19 -16
  132. package/src/internal-urls/types.ts +4 -0
  133. package/src/lsp/client.ts +18 -2
  134. package/src/main.ts +88 -6
  135. package/src/modes/bridge/auth.ts +41 -0
  136. package/src/modes/bridge/bridge-client-bridge.ts +47 -0
  137. package/src/modes/bridge/bridge-mode.ts +520 -0
  138. package/src/modes/bridge/bridge-ui-context.ts +200 -0
  139. package/src/modes/bridge/event-stream.ts +70 -0
  140. package/src/modes/components/custom-editor.ts +101 -0
  141. package/src/modes/components/custom-provider-wizard.ts +318 -0
  142. package/src/modes/components/hook-selector.ts +61 -18
  143. package/src/modes/components/jobs-overlay-model.ts +109 -0
  144. package/src/modes/components/jobs-overlay.ts +172 -0
  145. package/src/modes/components/model-selector.ts +108 -18
  146. package/src/modes/components/provider-onboarding-selector.ts +6 -1
  147. package/src/modes/components/status-line/presets.ts +7 -5
  148. package/src/modes/components/status-line/segments.ts +25 -0
  149. package/src/modes/components/status-line/types.ts +2 -0
  150. package/src/modes/components/status-line.ts +9 -1
  151. package/src/modes/controllers/extension-ui-controller.ts +39 -3
  152. package/src/modes/controllers/input-controller.ts +97 -9
  153. package/src/modes/controllers/selector-controller.ts +86 -1
  154. package/src/modes/index.ts +1 -0
  155. package/src/modes/interactive-mode.ts +27 -0
  156. package/src/modes/jobs-observer.ts +204 -0
  157. package/src/modes/rpc/host-tools.ts +1 -186
  158. package/src/modes/rpc/host-uris.ts +1 -235
  159. package/src/modes/rpc/rpc-client.ts +25 -10
  160. package/src/modes/rpc/rpc-mode.ts +12 -381
  161. package/src/modes/shared/agent-wire/command-dispatch.ts +341 -0
  162. package/src/modes/shared/agent-wire/command-validation.ts +131 -0
  163. package/src/modes/shared/agent-wire/event-envelope.ts +108 -0
  164. package/src/modes/shared/agent-wire/handshake.ts +117 -0
  165. package/src/modes/shared/agent-wire/host-tool-bridge.ts +194 -0
  166. package/src/modes/shared/agent-wire/host-uri-bridge.ts +236 -0
  167. package/src/modes/shared/agent-wire/protocol.ts +96 -0
  168. package/src/modes/shared/agent-wire/responses.ts +17 -0
  169. package/src/modes/shared/agent-wire/scopes.ts +89 -0
  170. package/src/modes/shared/agent-wire/ui-request-broker.ts +150 -0
  171. package/src/modes/shared/agent-wire/ui-result.ts +48 -0
  172. package/src/modes/types.ts +2 -0
  173. package/src/prompts/memories/consolidation.md +1 -1
  174. package/src/prompts/memories/read-path.md +6 -7
  175. package/src/prompts/memories/unavailable.md +2 -2
  176. package/src/prompts/tools/bash.md +1 -1
  177. package/src/prompts/tools/irc.md +1 -1
  178. package/src/prompts/tools/read.md +2 -2
  179. package/src/prompts/tools/recall.md +1 -0
  180. package/src/prompts/tools/reflect.md +1 -0
  181. package/src/prompts/tools/retain.md +1 -0
  182. package/src/prompts/tools/subagent.md +12 -7
  183. package/src/prompts/tools/task-summary.md +3 -9
  184. package/src/prompts/tools/task.md +5 -1
  185. package/src/sdk.ts +5 -1
  186. package/src/session/agent-session.ts +214 -38
  187. package/src/skill-state/deep-interview-mutation-guard.ts +23 -4
  188. package/src/skill-state/workflow-state-contract.ts +7 -4
  189. package/src/skill-state/workflow-state-version.ts +3 -0
  190. package/src/slash-commands/builtin-registry.ts +9 -1
  191. package/src/task/executor.ts +31 -5
  192. package/src/task/id.ts +33 -0
  193. package/src/task/index.ts +259 -67
  194. package/src/task/output-manager.ts +5 -4
  195. package/src/task/receipt.ts +297 -0
  196. package/src/task/render.ts +48 -131
  197. package/src/task/spawn-gate.ts +132 -0
  198. package/src/task/types.ts +48 -7
  199. package/src/tools/ask.ts +73 -33
  200. package/src/tools/ast-edit.ts +1 -0
  201. package/src/tools/ast-grep.ts +1 -0
  202. package/src/tools/bash.ts +1 -1
  203. package/src/tools/cron.ts +48 -0
  204. package/src/tools/find.ts +4 -1
  205. package/src/tools/hindsight-recall.ts +0 -2
  206. package/src/tools/hindsight-reflect.ts +0 -2
  207. package/src/tools/hindsight-retain.ts +0 -2
  208. package/src/tools/index.ts +6 -18
  209. package/src/tools/path-utils.ts +3 -2
  210. package/src/tools/read.ts +4 -3
  211. package/src/tools/search.ts +1 -0
  212. package/src/tools/skill.ts +6 -1
  213. package/src/tools/subagent.ts +237 -84
package/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.3.2] - 2026-06-05
6
+
7
+ ### Added
8
+
9
+ - Added model profiles with a `--mpreset <profile>` CLI flag and a `/model` selector "Profiles" section that activate a named profile's default model plus per-agent-role model overrides in one step, validating required-provider credentials before applying and surfacing a custom provider onboarding wizard for missing API-compatible providers.
10
+ - Integrated `ai-slop-cleaner` as an internal Ultragoal sub-skill fragment that runs as the mandatory completion-gate cleanup sweep over a story's changed files, reporting blocking and advisory findings without editing code or mutating `.gjc/` state.
11
+
12
+ ### Fixed
13
+
14
+ - Reconciled native Ultragoal commands with workflow mode-state and the HUD: `gjc ultragoal create-goals`, `complete-goals`, `checkpoint`, steering, review-blocker recording, and status now sync `.gjc/state/ultragoal-state.json` plus `skill-active-state.json` from the durable `.gjc/ultragoal` plan/ledger, clearing stale active HUD chips after all goals complete.
15
+ - Forwarded the parent session id when task subagents validate configured role-agent model overrides, preventing session-scoped OAuth providers from being misread as unauthenticated and falling back to the parent chat model.
16
+ - Removed unintended public memory-tool guidance and registration: Hindsight retain/recall/reflect helpers are now compatibility-only, local memory prompt injection no longer advertises `memory://` reads, and regression tests guard the public tool surface.
17
+ - Fixed `read` hashline anchors drifting on truncated reads so the `line+hash` anchors consumed by `edit`/`apply_patch` stay correct when a file is read past the truncation boundary.
18
+
19
+ ## [0.3.1] - 2026-06-05
20
+ ### Added
21
+
22
+ - Added opt-in crash diagnostics for subprocess failures, with a shared crash taxonomy/report writer, bash/Python/LSP/DAP crash notices, and a native Rust panic-report hook gated by `GJC_NATIVE_CRASH_DIAGNOSTICS` / `GJC_CRASH_DIAGNOSTICS`.
23
+ - Started the GJC backend bridge foundation with a shared agent-wire protocol module, event envelopes, RPC command scope matrix, UI request broker, typed unsupported UI results, a guarded `--mode bridge` handshake surface, and RPC mode dispatch refactored onto the shared command dispatcher.
24
+ - Documented the experimental `--mode bridge` protocol in `docs/bridge.md` and the `GJC_BRIDGE_*` environment variables in `docs/environment-variables.md` (TLS-mandatory startup, bearer auth, coarse command scopes with a `prompt` floor, single live `AgentSession` per process, bounded event-stream replay with `reset`, and the semantic-not-pixel UI capability matrix), and added bridge event-stream/idempotency regression tests plus a docs-conformance check that pins the docs against the protocol version, scope/command catalog, negotiated capabilities/frame types, and unsupported UI surfaces. The bridge protocol/SDK are experimental (`BRIDGE_PROTOCOL_VERSION` 1) and may change in additive, version-negotiated ways.
25
+
26
+ ### Fixed
27
+
28
+ - Made opt-in crash diagnostics create/chmod report directories to `0700` and report files to `0600` so captured command, cwd, and stderr previews are private even under a permissive umask.
29
+ - Scoped `agent://` and `artifact://` resolution to the caller's artifacts directory plus explicitly authorized parent/child tree directories, removed registry-wide live-session lookup/enumeration, and made missing agent-output metadata sidecars fail closed.
30
+ - Fail-closed experimental bridge session endpoints by default for 0.3.1: events, commands, controller ownership, UI responses, host tool results, and host URI results are disabled unless an internal endpoint matrix explicitly enables them; only health/help and the authenticated handshake remain available, with the handshake advertising no enabled session surface by default.
31
+ - Render terminal-pasted clipboard image temp paths as compact `[image N]` prompt placeholders while attaching the image payload, instead of inserting raw `/var/folders/.../clipboard-*.png` path text.
32
+ - Preserved `gjc harness` `owner-vanished:*` blockers when a replacement owner becomes live so unrecovered prior-owner evidence remains visible until explicit recovery or terminal completion evidence; only safe startup liveness false-negatives such as `detached-owner-not-live` are auto-cleared.
33
+ - Fixed the interactive agent unexpectedly stopping after automatic context maintenance instead of resuming the in-flight task. Post-compaction continuation now schedules exactly one source per completion (overflow retry → queued messages → synthetic auto-continue prompt), the threshold/handoff auto-continue prompt skips a redundant pre-send compaction check, overflow retry strips only the context-overflow failed turn (never normal/aborted/silent-abort tails), and non-resumable or superseded continuations log a structured reason instead of stranding the session.
34
+ - Fixed the native Stop skill-state hook letting active GJC workflow skills stop prematurely. The Stop hook no longer treats a missing/unreadable mode-state file as terminal for handoff workflows, and handoff skills (`deep-interview`, `ralplan`) now keep blocking Stop even in the `handoff` phase until they are demoted (`active:false`) or cleared, so they always end by offering the next handoff step via the ask tool. Non-handoff skills (`team`, `ultragoal`) retain the fail-open safety valve when their mode-state file is corrupt or invalid.
35
+
5
36
  ## [0.3.0] - 2026-06-03
6
37
 
7
38
  ### Added
@@ -9,6 +40,7 @@
9
40
  - Added runtime-enforced Ultragoal executor QA/red-team evidence matrices for completion checkpoints, with plan-first contract coverage, user-surface evidence, adversarial cases, artifact references, scoped Executor red-team guidance, and focused rejection tests for shallow or contradictory QA evidence.
10
41
  ### Fixed
11
42
 
43
+ - Made `gjc harness observe` preserve completed RPC owner evidence after the owner exits, including a `completedOwnerExited` diagnostic and durable terminal-result cursor.
12
44
  - Clarified that `gjc team` requires an existing tmux-backed leader session from `gjc --tmux`, with actionable help, docs, and failure text.
13
45
  - Kept deep-interview ask options visible for long prompts by adding an opt-in scrollable selector title panel with selector-local `PageUp`/`PageDown` prompt scrolling, while leaving normal ask dialogs and global keybinding configuration unchanged.
14
46
 
package/README.md CHANGED
@@ -17,7 +17,7 @@ The agent supports three mutually-exclusive memory backends, selected via the `m
17
17
 
18
18
  - `off` (default) — no memory subsystem runs.
19
19
  - `local` — existing rollout-summarisation pipeline; writes `memory_summary.md` and consolidated artifacts under the agent dir.
20
- - `hindsight` — talks to a [Hindsight](https://hindsight.vectorize.io) server (Cloud or self-hosted Docker), retains transcripts every Nth user turn, recalls memories on the first turn of a session, and exposes `retain`, `recall`, and `reflect`.
20
+ - `hindsight` — talks to a [Hindsight](https://hindsight.vectorize.io) server (Cloud or self-hosted Docker). Hindsight uses private backend lifecycle hooks to retain transcripts and recall context; compatibility-only internals remain for legacy backend calls, but GJC does not expose public coding-harness memory tools such as `retain`, `recall`, or `reflect`.
21
21
 
22
22
  ### Hindsight quickstart
23
23
 
@@ -26,6 +26,8 @@ export interface AsyncJobMetadata {
26
26
  description?: string;
27
27
  assignment?: string;
28
28
  };
29
+ /** True when this bash job was started by the `monitor` tool (vs plain async bash). */
30
+ monitor?: boolean;
29
31
  }
30
32
  /**
31
33
  * Typed outcome a subagent task run may produce. A `paused` outcome is
@@ -139,6 +141,11 @@ export declare class AsyncJobManager {
139
141
  /** Reset the process-global instance. Test-only. */
140
142
  static resetForTests(): void;
141
143
  constructor(options: AsyncJobManagerOptions);
144
+ /**
145
+ * Subscribe to live-job-set change events. Returns an unsubscribe function.
146
+ * Listener errors are isolated so one bad subscriber cannot break others.
147
+ */
148
+ onChange(cb: () => void): () => void;
142
149
  register(type: "bash" | "task", label: string, run: (ctx: {
143
150
  jobId: string;
144
151
  signal: AbortSignal;
@@ -2,7 +2,7 @@
2
2
  * CLI argument parsing and help display
3
3
  */
4
4
  import { type Effort } from "@gajae-code/ai";
5
- export type Mode = "text" | "json" | "rpc" | "acp" | "rpc-ui";
5
+ export type Mode = "text" | "json" | "rpc" | "acp" | "rpc-ui" | "bridge";
6
6
  export interface Args {
7
7
  cwd?: string;
8
8
  allowHome?: boolean;
@@ -11,6 +11,8 @@ export interface Args {
11
11
  smol?: string;
12
12
  slow?: string;
13
13
  plan?: string;
14
+ mpreset?: string;
15
+ default?: boolean;
14
16
  apiKey?: string;
15
17
  systemPrompt?: string;
16
18
  appendSystemPrompt?: string;
@@ -39,6 +39,9 @@ export default class DeepInterview extends Command {
39
39
  deliberate: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
40
40
  description: string;
41
41
  };
42
+ force: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
43
+ description: string;
44
+ };
42
45
  json: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
43
46
  description: string;
44
47
  };
@@ -25,6 +25,12 @@ export default class Index extends Command {
25
25
  plan: import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
26
26
  description: string;
27
27
  };
28
+ mpreset: import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
29
+ description: string;
30
+ };
31
+ default: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
32
+ description: string;
33
+ };
28
34
  provider: import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
29
35
  description: string;
30
36
  };
@@ -26,6 +26,7 @@ interface AppKeybindings {
26
26
  "app.session.fork": true;
27
27
  "app.session.resume": true;
28
28
  "app.session.observe": true;
29
+ "app.jobs.open": true;
29
30
  "app.session.togglePath": true;
30
31
  "app.session.toggleSort": true;
31
32
  "app.session.rename": true;
@@ -258,6 +259,10 @@ export declare const KEYBINDINGS: {
258
259
  readonly defaultKeys: "ctrl+s";
259
260
  readonly description: "Observe subagent sessions";
260
261
  };
262
+ readonly "app.jobs.open": {
263
+ readonly defaultKeys: "alt+j";
264
+ readonly description: "Open monitor/cron jobs overlay";
265
+ };
261
266
  readonly "app.session.togglePath": {
262
267
  readonly defaultKeys: "ctrl+p";
263
268
  readonly description: "Toggle session path display";
@@ -0,0 +1,30 @@
1
+ import type { ThinkingLevel } from "@gajae-code/agent-core";
2
+ import type { Api, Model } from "@gajae-code/ai";
3
+ import type { AgentSession } from "../session/agent-session";
4
+ import { type ModelRegistry } from "./model-registry";
5
+ import type { Settings } from "./settings";
6
+ export interface PrepareModelProfileActivationOptions {
7
+ session: Pick<AgentSession, "model" | "thinkingLevel" | "sessionId">;
8
+ modelRegistry: Pick<ModelRegistry, "getModelProfile" | "getModelProfiles" | "getAvailableModelProfileNames" | "getApiKeyForProvider" | "getAll" | "resolveCanonicalModel" | "getCanonicalVariants" | "getCanonicalId">;
9
+ settings: Pick<Settings, "get">;
10
+ profileName: string;
11
+ }
12
+ export interface PreparedModelProfileActivation {
13
+ profileName: string;
14
+ session: Pick<AgentSession, "model" | "thinkingLevel" | "sessionId" | "setModelTemporary">;
15
+ settings: Pick<Settings, "get" | "override" | "set" | "flush">;
16
+ previousModel: Model<Api> | undefined;
17
+ previousThinkingLevel: ThinkingLevel | undefined;
18
+ previousAgentModelOverrides: Record<string, string>;
19
+ defaultModel: Model<Api> | undefined;
20
+ defaultThinkingLevel: ThinkingLevel | undefined;
21
+ agentModelOverrides: Record<string, string>;
22
+ }
23
+ export declare function formatModelProfileCredentialError(profileName: string, providers: readonly string[]): string;
24
+ export declare function prepareModelProfileActivation(options: PrepareModelProfileActivationOptions): Promise<PreparedModelProfileActivation>;
25
+ export declare function applyPreparedModelProfileActivation(prepared: PreparedModelProfileActivation, options?: {
26
+ persistDefault?: boolean;
27
+ }): Promise<void>;
28
+ export declare function activateModelProfile(options: PrepareModelProfileActivationOptions, applyOptions?: {
29
+ persistDefault?: boolean;
30
+ }): Promise<void>;
@@ -0,0 +1,19 @@
1
+ import type { GjcModelAssignmentTargetId } from "./model-registry";
2
+ import type { ModelsConfig } from "./models-config-schema";
3
+ export type ModelProfileRole = GjcModelAssignmentTargetId;
4
+ export interface ModelProfileDefinition {
5
+ name: string;
6
+ requiredProviders: string[];
7
+ modelMapping: Partial<Record<ModelProfileRole, string>>;
8
+ source: "builtin" | "user";
9
+ }
10
+ export interface ResolvedProfileBinding {
11
+ defaultSelector?: string;
12
+ agentModelOverrides: Partial<Record<Exclude<ModelProfileRole, "default">, string>>;
13
+ }
14
+ export declare function deriveModelProfileMappedProviders(definition: Pick<ModelProfileDefinition, "modelMapping">): string[];
15
+ export declare function aggregateModelProfileRequiredProviders(requiredProviders: readonly string[], definition: Pick<ModelProfileDefinition, "modelMapping">): string[];
16
+ export declare const BUILTIN_MODEL_PROFILES: readonly ModelProfileDefinition[];
17
+ export declare function mergeModelProfiles(userProfiles?: ModelsConfig["profiles"]): Map<string, ModelProfileDefinition>;
18
+ export declare function resolveProfileBindings(definition: ModelProfileDefinition): ResolvedProfileBinding;
19
+ export declare function formatAvailableProfileNames(profiles: ReadonlyMap<string, ModelProfileDefinition>): string;
@@ -4,6 +4,7 @@ import { type ThemeColor } from "../modes/theme/theme";
4
4
  import type { AuthStorage } from "../session/auth-storage";
5
5
  import { type ConfigError, ConfigFile } from "./config-file";
6
6
  import { type CanonicalModelIndex, type CanonicalModelRecord, type CanonicalModelVariant, type ModelEquivalenceConfig } from "./model-equivalence";
7
+ import { type ModelProfileDefinition } from "./model-profiles";
7
8
  import { type Settings } from "./settings";
8
9
  export type { CanonicalModelIndex, CanonicalModelRecord, CanonicalModelVariant, ModelEquivalenceConfig };
9
10
  export declare const kNoAuth = "N/A";
@@ -244,6 +245,10 @@ export declare const ModelsConfigFile: ConfigFile<{
244
245
  overrides?: Record<string, string> | undefined;
245
246
  exclude?: string[] | undefined;
246
247
  } | undefined;
248
+ profiles?: Record<string, {
249
+ required_providers: string[];
250
+ model_mapping: Partial<Record<"architect" | "critic" | "default" | "executor" | "planner", string>>;
251
+ }> | undefined;
247
252
  }>;
248
253
  /** Provider override config (baseUrl, headers, apiKey, compat, transport) without custom models */
249
254
  interface ProviderOverride {
@@ -306,6 +311,9 @@ export declare class ModelRegistry {
306
311
  * Get any error from loading models.json (undefined if no error).
307
312
  */
308
313
  getError(): ConfigError | undefined;
314
+ getModelProfiles(): Map<string, ModelProfileDefinition>;
315
+ getModelProfile(name: string): ModelProfileDefinition | undefined;
316
+ getAvailableModelProfileNames(): string[];
309
317
  applyConfiguredModelBindings(targetSettings: Settings): void;
310
318
  /**
311
319
  * Get all models (built-in + custom).
@@ -128,7 +128,7 @@ export declare function resolveModelOverride(modelPatterns: string[], modelRegis
128
128
  * primary resolution unchanged so the existing error path still surfaces
129
129
  * a meaningful failure downstream.
130
130
  */
131
- export declare function resolveModelOverrideWithAuthFallback(modelPatterns: string[], parentActiveModelPattern: string | undefined, modelRegistry: ModelLookupRegistry & Pick<ModelRegistry, "getApiKey">, settings?: Settings): Promise<{
131
+ export declare function resolveModelOverrideWithAuthFallback(modelPatterns: string[], parentActiveModelPattern: string | undefined, modelRegistry: ModelLookupRegistry & Pick<ModelRegistry, "getApiKey">, settings?: Settings, sessionId?: string): Promise<{
132
132
  model?: Model<Api>;
133
133
  thinkingLevel?: ThinkingLevel;
134
134
  explicitThinkingLevel: boolean;
@@ -53,6 +53,41 @@ export declare const OpenAICompatSchema: z.ZodObject<{
53
53
  none: "none";
54
54
  }>>;
55
55
  }, z.core.$strip>;
56
+ export declare const ProfileRoleSchema: z.ZodEnum<{
57
+ architect: "architect";
58
+ critic: "critic";
59
+ default: "default";
60
+ executor: "executor";
61
+ planner: "planner";
62
+ }>;
63
+ export declare const ProfileModelSelectorSchema: z.ZodString;
64
+ export declare const ProfileModelMappingSchema: z.ZodRecord<z.ZodEnum<{
65
+ architect: "architect";
66
+ critic: "critic";
67
+ default: "default";
68
+ executor: "executor";
69
+ planner: "planner";
70
+ }> & z.core.$partial, z.ZodString>;
71
+ export declare const ProfileDefinitionSchema: z.ZodObject<{
72
+ required_providers: z.ZodArray<z.ZodString>;
73
+ model_mapping: z.ZodRecord<z.ZodEnum<{
74
+ architect: "architect";
75
+ critic: "critic";
76
+ default: "default";
77
+ executor: "executor";
78
+ planner: "planner";
79
+ }> & z.core.$partial, z.ZodString>;
80
+ }, z.core.$strict>;
81
+ export declare const ProfilesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
82
+ required_providers: z.ZodArray<z.ZodString>;
83
+ model_mapping: z.ZodRecord<z.ZodEnum<{
84
+ architect: "architect";
85
+ critic: "critic";
86
+ default: "default";
87
+ executor: "executor";
88
+ planner: "planner";
89
+ }> & z.core.$partial, z.ZodString>;
90
+ }, z.core.$strict>>;
56
91
  export declare const ModelOverrideSchema: z.ZodObject<{
57
92
  name: z.ZodOptional<z.ZodString>;
58
93
  reasoning: z.ZodOptional<z.ZodBoolean>;
@@ -547,5 +582,17 @@ export declare const ModelsConfigSchema: z.ZodObject<{
547
582
  overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
548
583
  exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
549
584
  }, z.core.$strip>>;
585
+ profiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
586
+ required_providers: z.ZodArray<z.ZodString>;
587
+ model_mapping: z.ZodRecord<z.ZodEnum<{
588
+ architect: "architect";
589
+ critic: "critic";
590
+ default: "default";
591
+ executor: "executor";
592
+ planner: "planner";
593
+ }> & z.core.$partial, z.ZodString>;
594
+ }, z.core.$strict>>>;
550
595
  }, z.core.$strict>;
551
596
  export type ModelsConfig = z.infer<typeof ModelsConfigSchema>;
597
+ export type ModelProfileConfig = z.infer<typeof ProfileDefinitionSchema>;
598
+ export type ModelProfilesConfig = z.infer<typeof ProfilesSchema>;
@@ -24,7 +24,7 @@ export declare const TAB_METADATA: Record<SettingTab, {
24
24
  icon: `tab.${string}`;
25
25
  }>;
26
26
  /** Status line segment identifiers */
27
- export type StatusLineSegmentId = "gajae" | "pi" | "model" | "mode" | "path" | "git" | "pr" | "subagents" | "token_in" | "token_out" | "token_total" | "token_rate" | "cost" | "context_pct" | "context_total" | "time_spent" | "time" | "session" | "hostname" | "cache_read" | "cache_write" | "session_name" | "usage";
27
+ export type StatusLineSegmentId = "gajae" | "pi" | "model" | "mode" | "path" | "git" | "pr" | "subagents" | "jobs" | "token_in" | "token_out" | "token_total" | "token_rate" | "cost" | "context_pct" | "context_total" | "time_spent" | "time" | "session" | "hostname" | "cache_read" | "cache_write" | "session_name" | "usage";
28
28
  /** Submenu choice metadata. */
29
29
  export type SubmenuOption<V extends string = string> = {
30
30
  value: V;
@@ -189,6 +189,16 @@ export declare const SETTINGS_SCHEMA: {
189
189
  readonly type: "record";
190
190
  readonly default: Record<string, string>;
191
191
  };
192
+ readonly "modelProfile.default": {
193
+ readonly type: "string";
194
+ readonly default: undefined;
195
+ readonly ui: {
196
+ readonly tab: "model";
197
+ readonly label: "Default Model Profile";
198
+ readonly description: "Model profile applied automatically at startup";
199
+ readonly options: "runtime";
200
+ };
201
+ };
192
202
  readonly modelTags: {
193
203
  readonly type: "record";
194
204
  readonly default: ModelTagsSettings;
@@ -2697,11 +2707,11 @@ export declare const SETTINGS_SCHEMA: {
2697
2707
  };
2698
2708
  readonly "task.maxConcurrency": {
2699
2709
  readonly type: "number";
2700
- readonly default: 32;
2710
+ readonly default: 8;
2701
2711
  readonly ui: {
2702
2712
  readonly tab: "tasks";
2703
2713
  readonly label: "Max Concurrent Tasks";
2704
- readonly description: "Concurrent limit for subagents";
2714
+ readonly description: "Safer concurrent limit for subagents; higher fan-out still requires an explicit plan above 4 tasks.";
2705
2715
  readonly options: readonly [{
2706
2716
  readonly value: "0";
2707
2717
  readonly label: "Unlimited";
@@ -2762,7 +2772,7 @@ export declare const SETTINGS_SCHEMA: {
2762
2772
  readonly ui: {
2763
2773
  readonly tab: "tasks";
2764
2774
  readonly label: "Fork Context Max Tokens";
2765
- readonly description: "Approximate token cap for fork-context seeds. 0 uses 25% of the target model context window.";
2775
+ readonly description: "Approximate token cap for explicit full fork-context seeds. 0 uses 15% of the target model context window, with a 15k fallback when the window is unknown.";
2766
2776
  };
2767
2777
  };
2768
2778
  readonly "task.maxRecursionDepth": {
@@ -0,0 +1,45 @@
1
+ export type CrashProcessKind = "bash" | "python" | "lsp" | "dap" | "mcp" | "browser" | "worker" | "native" | "unknown";
2
+ export type CrashClass = "clean_exit" | "non_zero_exit" | "signal_exit" | "timeout" | "cancelled" | "spawn_error" | "protocol_exit" | "native_panic" | "unknown";
3
+ export interface CrashClassificationInput {
4
+ kind: CrashProcessKind;
5
+ command?: string[];
6
+ exitCode?: number | null;
7
+ signal?: string | null;
8
+ cancelled?: boolean;
9
+ timedOut?: boolean;
10
+ spawnError?: unknown;
11
+ stderr?: string;
12
+ protocol?: string;
13
+ }
14
+ export interface CrashClassification {
15
+ kind: CrashProcessKind;
16
+ class: CrashClass;
17
+ crashed: boolean;
18
+ exitCode: number | null;
19
+ signal: string | null;
20
+ command?: string[];
21
+ protocol?: string;
22
+ reason: string;
23
+ }
24
+ export interface CrashReport extends CrashClassification {
25
+ schemaVersion: 1;
26
+ createdAt: string;
27
+ pid: number;
28
+ cwd: string;
29
+ stderrPreview?: string;
30
+ spawnError?: string;
31
+ }
32
+ export interface CrashReportWriteResult {
33
+ report: CrashReport;
34
+ path: string | null;
35
+ enabled: boolean;
36
+ }
37
+ export declare function crashDiagnosticsEnabled(env?: NodeJS.ProcessEnv): boolean;
38
+ export declare function getCrashDiagnosticsDirectory(env?: NodeJS.ProcessEnv): string;
39
+ export declare function classifyProcessCrash(input: CrashClassificationInput): CrashClassification;
40
+ export declare function writeCrashReport(input: CrashClassificationInput, options?: {
41
+ cwd?: string;
42
+ env?: NodeJS.ProcessEnv;
43
+ now?: Date;
44
+ }): Promise<CrashReportWriteResult>;
45
+ export declare function formatCrashDiagnosticNotice(result: CrashReportWriteResult): string | null;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Current runtime owner counts, keyed by `<owner>.<resource>`. Extend as more
3
+ * owners (Python kernels, LSP clients, browser tabs, async jobs, streaming
4
+ * queues) expose count getters.
5
+ */
6
+ export declare function getRuntimeResourceCounts(): Record<string, number>;
@@ -2,4 +2,5 @@ import { type Component } from "@gajae-code/tui";
2
2
  import { type Theme } from "../modes/theme/theme";
3
3
  export declare function renderDeepInterviewAssistantText(text: string, uiTheme: Theme): Component | null;
4
4
  export declare function renderDeepInterviewAskQuestion(question: string, uiTheme: Theme): Component | null;
5
+ export declare function isDeepInterviewAskQuestion(question: string): boolean;
5
6
  export declare function formatDeepInterviewSelectorPrompt(question: string): string | null;
@@ -52,6 +52,8 @@ export interface PythonExecutorOptions {
52
52
  }
53
53
  export interface PythonKernelExecutor {
54
54
  execute: (code: string, options?: KernelExecuteOptions) => Promise<KernelExecuteResult>;
55
+ getExitCode?: () => number | null;
56
+ peekStderr?: () => string;
55
57
  }
56
58
  export interface PythonResult {
57
59
  /** Combined stdout + stderr output (sanitized, possibly truncated) */
@@ -55,6 +55,8 @@ export declare class PythonKernel {
55
55
  private constructor();
56
56
  static start(options: KernelStartOptions): Promise<PythonKernel>;
57
57
  isAlive(): boolean;
58
+ getExitCode(): number | null;
59
+ peekStderr(): string;
58
60
  execute(code: string, options?: KernelExecuteOptions): Promise<KernelExecuteResult>;
59
61
  interrupt(): Promise<void>;
60
62
  shutdown(options?: KernelShutdownOptions): Promise<KernelShutdownResult>;
@@ -43,6 +43,16 @@ export interface BashResult {
43
43
  outputBytes: number;
44
44
  artifactId?: string;
45
45
  }
46
+ /** Number of persistent shell sessions currently retained (owner gauge). */
47
+ export declare function getShellSessionCount(): number;
48
+ /**
49
+ * Dispose all persistent shell sessions: abort in-flight work and drop the
50
+ * strong references so the native shells can be finalized. Healthy persistent
51
+ * sessions are otherwise retained for the whole process lifetime (MEM-7). This
52
+ * is registered as a postmortem cleanup so shutdown/signals release native
53
+ * shell resources, and is also callable directly (e.g. on owner teardown).
54
+ */
55
+ export declare function disposeAllShellSessions(): Promise<void>;
46
56
  /** Translate `ShellMinimizerSettings` into native `MinimizerOptions`, or `undefined` when disabled. */
47
57
  export declare function buildMinimizerOptions(group: ShellMinimizerSettings): MinimizerOptions | undefined;
48
58
  export declare function executeBash(command: string, options?: BashExecutorOptions): Promise<BashResult>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * CLI write/mutation receipt shaping (Workstream B, v4).
3
+ *
4
+ * `CliWriteReceipt` is the compact **stdout presentation** returned by a GJC
5
+ * mutation command. It carries only routing/audit fields a caller needs; it
6
+ * NEVER echoes the persisted body (full `state` envelope, ultragoal `plan`,
7
+ * team task body, ralplan `task`, etc.) — echoing those back is a redundant
8
+ * token leak because the caller already has the content it just wrote.
9
+ *
10
+ * This is intentionally a *separate* concept from the persisted
11
+ * `WorkflowStateReceipt` (the on-disk envelope `receipt` integrity field).
12
+ * Do NOT use `CliWriteReceipt` as a persistence schema or validate persisted
13
+ * envelopes against it.
14
+ */
15
+ export interface CliWriteReceipt {
16
+ ok: boolean;
17
+ [field: string]: unknown;
18
+ }
19
+ /**
20
+ * Serialize a write/mutation receipt to compact stdout JSON.
21
+ * `undefined` fields are dropped so optional routing fields stay absent
22
+ * rather than serialized as `null`.
23
+ */
24
+ export declare function renderCliWriteReceipt(receipt: Record<string, unknown>): string;
@@ -20,6 +20,7 @@ export interface ResolvedDeepInterviewSpecWriteArgs {
20
20
  json: boolean;
21
21
  deliberate: boolean;
22
22
  handoff?: "ralplan";
23
+ force: boolean;
23
24
  }
24
25
  export interface PersistedDeepInterviewSpec {
25
26
  slug: string;
@@ -1,3 +1,4 @@
1
+ import type { CanonicalGjcWorkflowSkill } from "../skill-state/active-state";
1
2
  export interface NormalizeLegacyStateResult {
2
3
  state: Record<string, unknown>;
3
4
  changed: boolean;
@@ -12,6 +13,14 @@ export interface MigrateAndPersistLegacyStateResult {
12
13
  migrated: boolean;
13
14
  path: string;
14
15
  }
16
+ export interface MigrateWorkflowStateResult {
17
+ state: Record<string, unknown>;
18
+ fromVersion: number;
19
+ toVersion: number;
20
+ changed: boolean;
21
+ }
22
+ export type WorkflowStateMigration = (state: Record<string, unknown>, skill: CanonicalGjcWorkflowSkill) => Record<string, unknown>;
23
+ export declare function migrateWorkflowState(raw: Record<string, unknown>, skill: string): MigrateWorkflowStateResult;
15
24
  /**
16
25
  * Pure legacy state normalizer for background/internal readers.
17
26
  *