@gajae-code/coding-agent 0.3.0 → 0.3.1

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 (175) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/types/async/job-manager.d.ts +7 -0
  3. package/dist/types/cli/args.d.ts +1 -1
  4. package/dist/types/commands/deep-interview.d.ts +3 -0
  5. package/dist/types/config/keybindings.d.ts +5 -0
  6. package/dist/types/config/settings-schema.d.ts +4 -4
  7. package/dist/types/debug/crash-diagnostics.d.ts +45 -0
  8. package/dist/types/debug/runtime-gauges.d.ts +6 -0
  9. package/dist/types/deep-interview/render-middleware.d.ts +1 -0
  10. package/dist/types/eval/py/executor.d.ts +2 -0
  11. package/dist/types/eval/py/kernel.d.ts +2 -0
  12. package/dist/types/exec/bash-executor.d.ts +10 -0
  13. package/dist/types/gjc-runtime/cli-write-receipt.d.ts +24 -0
  14. package/dist/types/gjc-runtime/deep-interview-runtime.d.ts +1 -0
  15. package/dist/types/gjc-runtime/state-migrations.d.ts +9 -0
  16. package/dist/types/gjc-runtime/state-schema.d.ts +317 -0
  17. package/dist/types/gjc-runtime/state-writer.d.ts +10 -0
  18. package/dist/types/gjc-runtime/workflow-command-ref.d.ts +43 -0
  19. package/dist/types/harness-control-plane/control-endpoint.d.ts +3 -2
  20. package/dist/types/hooks/skill-state.d.ts +21 -0
  21. package/dist/types/internal-urls/agent-protocol.d.ts +2 -2
  22. package/dist/types/internal-urls/artifact-protocol.d.ts +2 -2
  23. package/dist/types/internal-urls/registry-helpers.d.ts +8 -7
  24. package/dist/types/internal-urls/types.d.ts +4 -0
  25. package/dist/types/lsp/index.d.ts +10 -10
  26. package/dist/types/modes/bridge/auth.d.ts +12 -0
  27. package/dist/types/modes/bridge/bridge-client-bridge.d.ts +9 -0
  28. package/dist/types/modes/bridge/bridge-mode.d.ts +44 -0
  29. package/dist/types/modes/bridge/bridge-ui-context.d.ts +88 -0
  30. package/dist/types/modes/bridge/event-stream.d.ts +8 -0
  31. package/dist/types/modes/components/custom-editor.d.ts +6 -0
  32. package/dist/types/modes/components/jobs-overlay-model.d.ts +31 -0
  33. package/dist/types/modes/components/jobs-overlay.d.ts +30 -0
  34. package/dist/types/modes/components/status-line/types.d.ts +2 -0
  35. package/dist/types/modes/components/status-line.d.ts +2 -0
  36. package/dist/types/modes/controllers/input-controller.d.ts +1 -0
  37. package/dist/types/modes/controllers/selector-controller.d.ts +8 -0
  38. package/dist/types/modes/index.d.ts +1 -0
  39. package/dist/types/modes/interactive-mode.d.ts +1 -0
  40. package/dist/types/modes/jobs-observer.d.ts +57 -0
  41. package/dist/types/modes/rpc/host-tools.d.ts +1 -16
  42. package/dist/types/modes/rpc/host-uris.d.ts +1 -38
  43. package/dist/types/modes/shared/agent-wire/command-dispatch.d.ts +20 -0
  44. package/dist/types/modes/shared/agent-wire/command-validation.d.ts +2 -0
  45. package/dist/types/modes/shared/agent-wire/event-envelope.d.ts +24 -0
  46. package/dist/types/modes/shared/agent-wire/handshake.d.ts +46 -0
  47. package/dist/types/modes/shared/agent-wire/host-tool-bridge.d.ts +16 -0
  48. package/dist/types/modes/shared/agent-wire/host-uri-bridge.d.ts +17 -0
  49. package/dist/types/modes/shared/agent-wire/protocol.d.ts +44 -0
  50. package/dist/types/modes/shared/agent-wire/responses.d.ts +4 -0
  51. package/dist/types/modes/shared/agent-wire/scopes.d.ts +18 -0
  52. package/dist/types/modes/shared/agent-wire/ui-request-broker.d.ts +42 -0
  53. package/dist/types/modes/shared/agent-wire/ui-result.d.ts +27 -0
  54. package/dist/types/modes/types.d.ts +1 -0
  55. package/dist/types/sdk.d.ts +2 -0
  56. package/dist/types/session/agent-session.d.ts +11 -1
  57. package/dist/types/skill-state/workflow-state-contract.d.ts +1 -2
  58. package/dist/types/skill-state/workflow-state-version.d.ts +3 -0
  59. package/dist/types/task/id.d.ts +7 -0
  60. package/dist/types/task/index.d.ts +5 -0
  61. package/dist/types/task/receipt.d.ts +85 -0
  62. package/dist/types/task/spawn-gate.d.ts +38 -0
  63. package/dist/types/task/types.d.ts +143 -11
  64. package/dist/types/tools/cron.d.ts +6 -0
  65. package/dist/types/tools/index.d.ts +2 -0
  66. package/dist/types/tools/path-utils.d.ts +1 -0
  67. package/dist/types/tools/subagent.d.ts +15 -0
  68. package/package.json +7 -7
  69. package/scripts/build-binary.ts +7 -0
  70. package/src/async/job-manager.ts +36 -0
  71. package/src/cli/args.ts +9 -2
  72. package/src/commands/deep-interview.ts +1 -0
  73. package/src/commands/harness.ts +289 -19
  74. package/src/commands/launch.ts +2 -2
  75. package/src/commands/state.ts +2 -1
  76. package/src/commands/team.ts +22 -4
  77. package/src/config/keybindings.ts +6 -0
  78. package/src/config/settings-schema.ts +6 -3
  79. package/src/dap/client.ts +17 -3
  80. package/src/debug/crash-diagnostics.ts +223 -0
  81. package/src/debug/runtime-gauges.ts +20 -0
  82. package/src/deep-interview/render-middleware.ts +6 -0
  83. package/src/defaults/gjc/skills/deep-interview/SKILL.md +1 -1
  84. package/src/defaults/gjc/skills/ralplan/SKILL.md +31 -2
  85. package/src/defaults/gjc/skills/ultragoal/SKILL.md +28 -2
  86. package/src/eval/py/executor.ts +21 -1
  87. package/src/eval/py/kernel.ts +15 -0
  88. package/src/exec/bash-executor.ts +41 -0
  89. package/src/gjc-runtime/cli-write-receipt.ts +31 -0
  90. package/src/gjc-runtime/deep-interview-runtime.ts +69 -32
  91. package/src/gjc-runtime/ralplan-runtime.ts +213 -36
  92. package/src/gjc-runtime/state-migrations.ts +54 -7
  93. package/src/gjc-runtime/state-runtime.ts +461 -64
  94. package/src/gjc-runtime/state-schema.ts +192 -0
  95. package/src/gjc-runtime/state-writer.ts +32 -1
  96. package/src/gjc-runtime/team-runtime.ts +177 -105
  97. package/src/gjc-runtime/ultragoal-runtime.ts +114 -26
  98. package/src/gjc-runtime/workflow-command-ref.ts +239 -0
  99. package/src/gjc-runtime/workflow-manifest.generated.json +108 -4
  100. package/src/gjc-runtime/workflow-manifest.ts +3 -1
  101. package/src/harness-control-plane/control-endpoint.ts +19 -8
  102. package/src/harness-control-plane/owner.ts +57 -10
  103. package/src/harness-control-plane/state-machine.ts +2 -1
  104. package/src/hooks/skill-state.ts +176 -26
  105. package/src/internal-urls/agent-protocol.ts +68 -21
  106. package/src/internal-urls/artifact-protocol.ts +12 -17
  107. package/src/internal-urls/docs-index.generated.ts +3 -2
  108. package/src/internal-urls/registry-helpers.ts +19 -16
  109. package/src/internal-urls/types.ts +4 -0
  110. package/src/lsp/client.ts +18 -2
  111. package/src/main.ts +21 -5
  112. package/src/modes/bridge/auth.ts +41 -0
  113. package/src/modes/bridge/bridge-client-bridge.ts +47 -0
  114. package/src/modes/bridge/bridge-mode.ts +520 -0
  115. package/src/modes/bridge/bridge-ui-context.ts +200 -0
  116. package/src/modes/bridge/event-stream.ts +70 -0
  117. package/src/modes/components/custom-editor.ts +101 -0
  118. package/src/modes/components/hook-selector.ts +61 -18
  119. package/src/modes/components/jobs-overlay-model.ts +109 -0
  120. package/src/modes/components/jobs-overlay.ts +172 -0
  121. package/src/modes/components/status-line/presets.ts +7 -5
  122. package/src/modes/components/status-line/segments.ts +25 -0
  123. package/src/modes/components/status-line/types.ts +2 -0
  124. package/src/modes/components/status-line.ts +9 -1
  125. package/src/modes/controllers/extension-ui-controller.ts +39 -3
  126. package/src/modes/controllers/input-controller.ts +97 -9
  127. package/src/modes/controllers/selector-controller.ts +29 -0
  128. package/src/modes/index.ts +1 -0
  129. package/src/modes/interactive-mode.ts +27 -0
  130. package/src/modes/jobs-observer.ts +204 -0
  131. package/src/modes/rpc/host-tools.ts +1 -186
  132. package/src/modes/rpc/host-uris.ts +1 -235
  133. package/src/modes/rpc/rpc-client.ts +25 -10
  134. package/src/modes/rpc/rpc-mode.ts +12 -381
  135. package/src/modes/shared/agent-wire/command-dispatch.ts +341 -0
  136. package/src/modes/shared/agent-wire/command-validation.ts +131 -0
  137. package/src/modes/shared/agent-wire/event-envelope.ts +108 -0
  138. package/src/modes/shared/agent-wire/handshake.ts +117 -0
  139. package/src/modes/shared/agent-wire/host-tool-bridge.ts +194 -0
  140. package/src/modes/shared/agent-wire/host-uri-bridge.ts +236 -0
  141. package/src/modes/shared/agent-wire/protocol.ts +96 -0
  142. package/src/modes/shared/agent-wire/responses.ts +17 -0
  143. package/src/modes/shared/agent-wire/scopes.ts +89 -0
  144. package/src/modes/shared/agent-wire/ui-request-broker.ts +150 -0
  145. package/src/modes/shared/agent-wire/ui-result.ts +48 -0
  146. package/src/modes/types.ts +1 -0
  147. package/src/prompts/tools/subagent.md +12 -7
  148. package/src/prompts/tools/task-summary.md +3 -9
  149. package/src/prompts/tools/task.md +5 -1
  150. package/src/sdk.ts +4 -0
  151. package/src/session/agent-session.ts +214 -38
  152. package/src/skill-state/deep-interview-mutation-guard.ts +23 -4
  153. package/src/skill-state/workflow-state-contract.ts +7 -4
  154. package/src/skill-state/workflow-state-version.ts +3 -0
  155. package/src/slash-commands/builtin-registry.ts +8 -0
  156. package/src/task/executor.ts +29 -5
  157. package/src/task/id.ts +33 -0
  158. package/src/task/index.ts +257 -67
  159. package/src/task/output-manager.ts +5 -4
  160. package/src/task/receipt.ts +297 -0
  161. package/src/task/render.ts +48 -131
  162. package/src/task/spawn-gate.ts +132 -0
  163. package/src/task/types.ts +48 -7
  164. package/src/tools/ask.ts +73 -33
  165. package/src/tools/ast-edit.ts +1 -0
  166. package/src/tools/ast-grep.ts +1 -0
  167. package/src/tools/bash.ts +1 -1
  168. package/src/tools/cron.ts +48 -0
  169. package/src/tools/find.ts +4 -1
  170. package/src/tools/index.ts +2 -0
  171. package/src/tools/path-utils.ts +3 -2
  172. package/src/tools/read.ts +1 -0
  173. package/src/tools/search.ts +1 -0
  174. package/src/tools/skill.ts +6 -1
  175. package/src/tools/subagent.ts +237 -84
@@ -1,11 +1,14 @@
1
1
  import type { ThinkingLevel } from "@gajae-code/agent-core";
2
2
  import type { Usage } from "@gajae-code/ai";
3
3
  import * as z from "zod/v4";
4
+ import type { TaskResultReceipt } from "./receipt";
4
5
  import { type TaskSimpleMode } from "./simple-mode";
6
+ import type { SpawnPlanReceipt } from "./spawn-gate";
5
7
  import type { NestedRepoPatch } from "./worktree";
6
8
  /** Source of an agent definition */
7
9
  export type AgentSource = "bundled" | "user" | "project";
8
10
  export type ForkContextPolicy = "forbidden" | "allowed";
11
+ export type ForkContextMode = "none" | "receipt" | "last-turn" | "bounded" | "full";
9
12
  /** Maximum output bytes per agent */
10
13
  export declare const MAX_OUTPUT_BYTES: number;
11
14
  /** Maximum output lines per agent */
@@ -41,7 +44,13 @@ export declare const taskItemSchema: z.ZodObject<{
41
44
  id: z.ZodString;
42
45
  description: z.ZodString;
43
46
  assignment: z.ZodString;
44
- inheritContext: z.ZodOptional<z.ZodBoolean>;
47
+ inheritContext: z.ZodOptional<z.ZodEnum<{
48
+ bounded: "bounded";
49
+ full: "full";
50
+ "last-turn": "last-turn";
51
+ none: "none";
52
+ receipt: "receipt";
53
+ }>>;
45
54
  }, z.core.$strip>;
46
55
  export type TaskItem = z.infer<typeof taskItemSchema>;
47
56
  export declare const taskSchema: z.ZodObject<{
@@ -50,7 +59,20 @@ export declare const taskSchema: z.ZodObject<{
50
59
  id: z.ZodString;
51
60
  description: z.ZodString;
52
61
  assignment: z.ZodString;
53
- inheritContext: z.ZodOptional<z.ZodBoolean>;
62
+ inheritContext: z.ZodOptional<z.ZodEnum<{
63
+ bounded: "bounded";
64
+ full: "full";
65
+ "last-turn": "last-turn";
66
+ none: "none";
67
+ receipt: "receipt";
68
+ }>>;
69
+ }, z.core.$strip>>;
70
+ spawnPlan: z.ZodOptional<z.ZodObject<{
71
+ whyParallel: z.ZodString;
72
+ whyNotLocal: z.ZodString;
73
+ independence: z.ZodString;
74
+ expectedReceiptShape: z.ZodString;
75
+ maxInlineTokens: z.ZodNumber;
54
76
  }, z.core.$strip>>;
55
77
  }, z.core.$strip>;
56
78
  export declare const taskSchemaNoIsolation: z.ZodObject<{
@@ -59,7 +81,20 @@ export declare const taskSchemaNoIsolation: z.ZodObject<{
59
81
  id: z.ZodString;
60
82
  description: z.ZodString;
61
83
  assignment: z.ZodString;
62
- inheritContext: z.ZodOptional<z.ZodBoolean>;
84
+ inheritContext: z.ZodOptional<z.ZodEnum<{
85
+ bounded: "bounded";
86
+ full: "full";
87
+ "last-turn": "last-turn";
88
+ none: "none";
89
+ receipt: "receipt";
90
+ }>>;
91
+ }, z.core.$strip>>;
92
+ spawnPlan: z.ZodOptional<z.ZodObject<{
93
+ whyParallel: z.ZodString;
94
+ whyNotLocal: z.ZodString;
95
+ independence: z.ZodString;
96
+ expectedReceiptShape: z.ZodString;
97
+ maxInlineTokens: z.ZodNumber;
63
98
  }, z.core.$strip>>;
64
99
  }, z.core.$strip>;
65
100
  declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
@@ -68,7 +103,20 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
68
103
  id: z.ZodString;
69
104
  description: z.ZodString;
70
105
  assignment: z.ZodString;
71
- inheritContext: z.ZodOptional<z.ZodBoolean>;
106
+ inheritContext: z.ZodOptional<z.ZodEnum<{
107
+ bounded: "bounded";
108
+ full: "full";
109
+ "last-turn": "last-turn";
110
+ none: "none";
111
+ receipt: "receipt";
112
+ }>>;
113
+ }, z.core.$strip>>;
114
+ spawnPlan: z.ZodOptional<z.ZodObject<{
115
+ whyParallel: z.ZodString;
116
+ whyNotLocal: z.ZodString;
117
+ independence: z.ZodString;
118
+ expectedReceiptShape: z.ZodString;
119
+ maxInlineTokens: z.ZodNumber;
72
120
  }, z.core.$strip>>;
73
121
  }, z.core.$strip>, z.ZodObject<{
74
122
  agent: z.ZodString;
@@ -76,7 +124,20 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
76
124
  id: z.ZodString;
77
125
  description: z.ZodString;
78
126
  assignment: z.ZodString;
79
- inheritContext: z.ZodOptional<z.ZodBoolean>;
127
+ inheritContext: z.ZodOptional<z.ZodEnum<{
128
+ bounded: "bounded";
129
+ full: "full";
130
+ "last-turn": "last-turn";
131
+ none: "none";
132
+ receipt: "receipt";
133
+ }>>;
134
+ }, z.core.$strip>>;
135
+ spawnPlan: z.ZodOptional<z.ZodObject<{
136
+ whyParallel: z.ZodString;
137
+ whyNotLocal: z.ZodString;
138
+ independence: z.ZodString;
139
+ expectedReceiptShape: z.ZodString;
140
+ maxInlineTokens: z.ZodNumber;
80
141
  }, z.core.$strip>>;
81
142
  }, z.core.$strip>, z.ZodObject<{
82
143
  agent: z.ZodString;
@@ -84,7 +145,20 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
84
145
  id: z.ZodString;
85
146
  description: z.ZodString;
86
147
  assignment: z.ZodString;
87
- inheritContext: z.ZodOptional<z.ZodBoolean>;
148
+ inheritContext: z.ZodOptional<z.ZodEnum<{
149
+ bounded: "bounded";
150
+ full: "full";
151
+ "last-turn": "last-turn";
152
+ none: "none";
153
+ receipt: "receipt";
154
+ }>>;
155
+ }, z.core.$strip>>;
156
+ spawnPlan: z.ZodOptional<z.ZodObject<{
157
+ whyParallel: z.ZodString;
158
+ whyNotLocal: z.ZodString;
159
+ independence: z.ZodString;
160
+ expectedReceiptShape: z.ZodString;
161
+ maxInlineTokens: z.ZodNumber;
88
162
  }, z.core.$strip>>;
89
163
  }, z.core.$strip>, z.ZodObject<{
90
164
  agent: z.ZodString;
@@ -92,7 +166,20 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
92
166
  id: z.ZodString;
93
167
  description: z.ZodString;
94
168
  assignment: z.ZodString;
95
- inheritContext: z.ZodOptional<z.ZodBoolean>;
169
+ inheritContext: z.ZodOptional<z.ZodEnum<{
170
+ bounded: "bounded";
171
+ full: "full";
172
+ "last-turn": "last-turn";
173
+ none: "none";
174
+ receipt: "receipt";
175
+ }>>;
176
+ }, z.core.$strip>>;
177
+ spawnPlan: z.ZodOptional<z.ZodObject<{
178
+ whyParallel: z.ZodString;
179
+ whyNotLocal: z.ZodString;
180
+ independence: z.ZodString;
181
+ expectedReceiptShape: z.ZodString;
182
+ maxInlineTokens: z.ZodNumber;
96
183
  }, z.core.$strip>>;
97
184
  }, z.core.$strip>, z.ZodObject<{
98
185
  agent: z.ZodString;
@@ -100,7 +187,20 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
100
187
  id: z.ZodString;
101
188
  description: z.ZodString;
102
189
  assignment: z.ZodString;
103
- inheritContext: z.ZodOptional<z.ZodBoolean>;
190
+ inheritContext: z.ZodOptional<z.ZodEnum<{
191
+ bounded: "bounded";
192
+ full: "full";
193
+ "last-turn": "last-turn";
194
+ none: "none";
195
+ receipt: "receipt";
196
+ }>>;
197
+ }, z.core.$strip>>;
198
+ spawnPlan: z.ZodOptional<z.ZodObject<{
199
+ whyParallel: z.ZodString;
200
+ whyNotLocal: z.ZodString;
201
+ independence: z.ZodString;
202
+ expectedReceiptShape: z.ZodString;
203
+ maxInlineTokens: z.ZodNumber;
104
204
  }, z.core.$strip>>;
105
205
  }, z.core.$strip>, z.ZodObject<{
106
206
  agent: z.ZodString;
@@ -108,7 +208,20 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
108
208
  id: z.ZodString;
109
209
  description: z.ZodString;
110
210
  assignment: z.ZodString;
111
- inheritContext: z.ZodOptional<z.ZodBoolean>;
211
+ inheritContext: z.ZodOptional<z.ZodEnum<{
212
+ bounded: "bounded";
213
+ full: "full";
214
+ "last-turn": "last-turn";
215
+ none: "none";
216
+ receipt: "receipt";
217
+ }>>;
218
+ }, z.core.$strip>>;
219
+ spawnPlan: z.ZodOptional<z.ZodObject<{
220
+ whyParallel: z.ZodString;
221
+ whyNotLocal: z.ZodString;
222
+ independence: z.ZodString;
223
+ expectedReceiptShape: z.ZodString;
224
+ maxInlineTokens: z.ZodNumber;
112
225
  }, z.core.$strip>>;
113
226
  }, z.core.$strip>];
114
227
  type DynamicTaskSchema = (typeof ALL_TASK_SCHEMAS)[number];
@@ -123,6 +236,7 @@ export interface TaskParams {
123
236
  agent: string;
124
237
  context?: string;
125
238
  schema?: string;
239
+ spawnPlan?: SpawnPlanReceipt;
126
240
  tasks: TaskItem[];
127
241
  isolated?: boolean;
128
242
  }
@@ -273,6 +387,8 @@ export interface SingleResult {
273
387
  branchName?: string;
274
388
  /** Nested repo patches to apply after parent merge */
275
389
  nestedPatches?: NestedRepoPatch[];
390
+ /** Whether isolated execution produced a non-empty root or nested patch. */
391
+ producedChanges?: boolean;
276
392
  /** Data extracted by registered subprocess tool handlers (keyed by tool name) */
277
393
  extractedToolData?: Record<string, unknown[]>;
278
394
  /**
@@ -289,16 +405,32 @@ export interface SingleResult {
289
405
  outputMeta?: {
290
406
  lineCount: number;
291
407
  charCount: number;
408
+ byteSize?: number;
409
+ sha256?: string;
410
+ };
411
+ /** Fork-context seed accounting for this subagent, when inherited parent context was cloned. */
412
+ forkContext?: {
413
+ mode: ForkContextMode;
414
+ clonedTokens: number;
292
415
  };
293
416
  }
294
417
  /** Tool details for TUI rendering */
295
418
  export interface TaskToolDetails {
296
419
  projectAgentsDir: string | null;
297
- results: SingleResult[];
420
+ results: TaskResultReceipt[];
298
421
  totalDurationMs: number;
299
422
  /** Aggregated usage across all subagents. */
300
423
  usage?: Usage;
301
- outputPaths?: string[];
424
+ /** Aggregate cloned tokens copied into fork-context seeds across subagents. */
425
+ forkContextClonedTokens?: number;
426
+ roiSummary?: {
427
+ childCount: number;
428
+ totalTokens: number;
429
+ totalCostTotal?: number;
430
+ totalClonedTokens?: number;
431
+ /** Advisory ids for terminal children that spent tokens without detectable output/review/changes. */
432
+ lowRoiChildIds: string[];
433
+ };
302
434
  progress?: AgentProgress[];
303
435
  async?: {
304
436
  state: "running" | "paused" | "queued" | "completed" | "failed";
@@ -52,6 +52,12 @@ export interface CronDeleteToolDetails {
52
52
  export declare function clearOwnerSchedules(ownerId: string | undefined): void;
53
53
  /** Reset every owner's schedule store. Test-only. */
54
54
  export declare function resetCronRegistryForTests(): void;
55
+ /** Subscribe to cron schedule-set changes. Returns an unsubscribe function. */
56
+ export declare function onCronChange(cb: () => void): () => void;
57
+ /** Snapshot the scheduled cron jobs for an owner (or all owners when omitted). */
58
+ export declare function listCronSnapshots(ownerId?: string): CronJobSnapshot[];
59
+ /** Delete a scheduled cron job by owner-scoped id. Returns true when removed. */
60
+ export declare function deleteCronJobById(ownerId: string | undefined, id: string): boolean;
55
61
  export declare function validateCronExpression(expression: string): void;
56
62
  export declare function findNextCronMatchMs(expression: string, afterMs: number, deadlineMs?: number): number | undefined;
57
63
  export declare function calculateCronFireTimeMs(params: {
@@ -102,6 +102,8 @@ export interface ToolSession {
102
102
  requireYieldTool?: boolean;
103
103
  /** Task recursion depth (0 = top-level, 1 = first child, etc.) */
104
104
  taskDepth?: number;
105
+ /** Current role-agent type/name for nested task sessions. */
106
+ currentAgentType?: string;
105
107
  /** Get session file */
106
108
  getSessionFile: () => string | null;
107
109
  /** Get eval kernel owner ID for session-scoped retained-kernel cleanup. */
@@ -116,6 +116,7 @@ export declare function resolveReadPath(filePath: string, cwd: string): string;
116
116
  export interface ToolScopeOptions {
117
117
  rawPaths: string[];
118
118
  cwd: string;
119
+ getArtifactsDir?: () => string | null;
119
120
  /** Verb used in the "Cannot {action} internal URL without a backing file: …" message. */
120
121
  internalUrlAction: string;
121
122
  /** Collect absolute paths flagged immutable by their internal-URL handler. */
@@ -13,10 +13,16 @@ declare const subagentSchema: z.ZodObject<{
13
13
  steer: "steer";
14
14
  }>;
15
15
  ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
16
+ id: z.ZodOptional<z.ZodString>;
16
17
  message: z.ZodOptional<z.ZodString>;
17
18
  pause: z.ZodOptional<z.ZodBoolean>;
18
19
  timeout_ms: z.ZodOptional<z.ZodNumber>;
19
20
  limit: z.ZodOptional<z.ZodNumber>;
21
+ verbosity: z.ZodOptional<z.ZodEnum<{
22
+ full: "full";
23
+ preview: "preview";
24
+ receipt: "receipt";
25
+ }>>;
20
26
  }, z.core.$strip>;
21
27
  type SubagentParams = z.infer<typeof subagentSchema>;
22
28
  type SubagentStatus = "running" | "paused" | "queued" | "completed" | "failed" | "cancelled" | "not_found" | "already_completed";
@@ -32,6 +38,9 @@ export interface SubagentSnapshot {
32
38
  durationMs: number;
33
39
  resultText?: string;
34
40
  errorText?: string;
41
+ resultPreview?: string;
42
+ outputRef?: string;
43
+ truncated?: boolean;
35
44
  guidance?: string;
36
45
  }
37
46
  export interface SubagentToolDetails {
@@ -55,10 +64,16 @@ export declare class SubagentTool implements AgentTool<typeof subagentSchema, Su
55
64
  steer: "steer";
56
65
  }>;
57
66
  ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
+ id: z.ZodOptional<z.ZodString>;
58
68
  message: z.ZodOptional<z.ZodString>;
59
69
  pause: z.ZodOptional<z.ZodBoolean>;
60
70
  timeout_ms: z.ZodOptional<z.ZodNumber>;
61
71
  limit: z.ZodOptional<z.ZodNumber>;
72
+ verbosity: z.ZodOptional<z.ZodEnum<{
73
+ full: "full";
74
+ preview: "preview";
75
+ receipt: "receipt";
76
+ }>>;
62
77
  }, z.core.$strip>;
63
78
  readonly strict = true;
64
79
  readonly loadMode = "discoverable";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/coding-agent",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "description": "Gajae Code CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://gaebal-gajae.dev",
7
7
  "author": "Yeachan-Heo",
@@ -48,12 +48,12 @@
48
48
  "@agentclientprotocol/sdk": "0.21.0",
49
49
  "@babel/parser": "^7.29.3",
50
50
  "@mozilla/readability": "^0.6.0",
51
- "@gajae-code/stats": "0.3.0",
52
- "@gajae-code/agent-core": "0.3.0",
53
- "@gajae-code/ai": "0.3.0",
54
- "@gajae-code/natives": "0.3.0",
55
- "@gajae-code/tui": "0.3.0",
56
- "@gajae-code/utils": "0.3.0",
51
+ "@gajae-code/stats": "0.3.1",
52
+ "@gajae-code/agent-core": "0.3.1",
53
+ "@gajae-code/ai": "0.3.1",
54
+ "@gajae-code/natives": "0.3.1",
55
+ "@gajae-code/tui": "0.3.1",
56
+ "@gajae-code/utils": "0.3.1",
57
57
  "@puppeteer/browsers": "^2.13.0",
58
58
  "@types/turndown": "5.0.6",
59
59
  "@xterm/headless": "^6.0.0",
@@ -4,6 +4,7 @@ import * as path from "node:path";
4
4
 
5
5
  const packageDir = path.join(import.meta.dir, "..");
6
6
  const outputPath = path.join(packageDir, "dist", "gjc");
7
+ const nativeDir = path.join(packageDir, "..", "natives", "native");
7
8
 
8
9
  function shouldAdhocSignDarwinBinary(): boolean {
9
10
  return process.platform === "darwin";
@@ -21,6 +22,11 @@ async function runCommand(command: string[], env: NodeJS.ProcessEnv = Bun.env):
21
22
  throw new Error(`Command failed with exit code ${exitCode}: ${command.join(" ")}`);
22
23
  }
23
24
  }
25
+ async function stageWorkspaceNativeAddons(): Promise<void> {
26
+ await Array.fromAsync(new Bun.Glob("pi_natives.*.node").scan({ cwd: nativeDir }), async filename => {
27
+ await Bun.write(path.join(packageDir, "dist", filename), Bun.file(path.join(nativeDir, filename)));
28
+ });
29
+ }
24
30
 
25
31
  async function main(): Promise<void> {
26
32
  await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--generate"]);
@@ -62,6 +68,7 @@ async function main(): Promise<void> {
62
68
  buildEnv,
63
69
  );
64
70
 
71
+ await stageWorkspaceNativeAddons();
65
72
  // Bun 1.3.12 emits a truncated Mach-O signature on darwin builds.
66
73
  if (shouldAdhocSignDarwinBinary()) {
67
74
  await runCommand(["codesign", "--force", "--sign", "-", outputPath]);
@@ -35,6 +35,8 @@ export interface AsyncJobMetadata {
35
35
  description?: string;
36
36
  assignment?: string;
37
37
  };
38
+ /** True when this bash job was started by the `monitor` tool (vs plain async bash). */
39
+ monitor?: boolean;
38
40
  }
39
41
 
40
42
  /**
@@ -224,6 +226,12 @@ export class AsyncJobManager {
224
226
  #resumeSeq = 0;
225
227
  #resumeRunner?: (subagentId: string, message?: string, descriptor?: ResumeDescriptor) => string | undefined;
226
228
  readonly #resumeDescriptors = new Map<string, ResumeDescriptor>();
229
+ /**
230
+ * Change listeners notified on any mutation that can alter the live job set
231
+ * (register, terminal/eviction transitions, dispose). Used by the status-line
232
+ * jobs widget / overlay to refresh event-driven without polling.
233
+ */
234
+ readonly #changeListeners = new Set<() => void>();
227
235
 
228
236
  #filterJobs(jobs: Iterable<AsyncJob>, filter?: AsyncJobFilter): AsyncJob[] {
229
237
  const ownerId = filter?.ownerId;
@@ -241,6 +249,29 @@ export class AsyncJobManager {
241
249
  this.#retentionMs = Math.max(0, Math.floor(options.retentionMs ?? DEFAULT_RETENTION_MS));
242
250
  }
243
251
 
252
+ /**
253
+ * Subscribe to live-job-set change events. Returns an unsubscribe function.
254
+ * Listener errors are isolated so one bad subscriber cannot break others.
255
+ */
256
+ onChange(cb: () => void): () => void {
257
+ this.#changeListeners.add(cb);
258
+ return () => {
259
+ this.#changeListeners.delete(cb);
260
+ };
261
+ }
262
+
263
+ #notifyChange(): void {
264
+ for (const cb of this.#changeListeners) {
265
+ try {
266
+ cb();
267
+ } catch (error) {
268
+ logger.warn("Async job change listener failed", {
269
+ error: error instanceof Error ? error.message : String(error),
270
+ });
271
+ }
272
+ }
273
+ }
274
+
244
275
  register(
245
276
  type: "bash" | "task",
246
277
  label: string,
@@ -336,6 +367,7 @@ export class AsyncJobManager {
336
367
  })();
337
368
 
338
369
  this.#jobs.set(id, job);
370
+ this.#notifyChange();
339
371
  return id;
340
372
  }
341
373
 
@@ -880,6 +912,8 @@ export class AsyncJobManager {
880
912
  this.#liveHandles.clear();
881
913
  this.#resumeDescriptors.clear();
882
914
  this.#resumeQueue.length = 0;
915
+ this.#notifyChange();
916
+ this.#changeListeners.clear();
883
917
  return drained;
884
918
  }
885
919
 
@@ -909,6 +943,7 @@ export class AsyncJobManager {
909
943
  }
910
944
 
911
945
  #scheduleEviction(jobId: string): void {
946
+ this.#notifyChange();
912
947
  if (this.#retentionMs <= 0) {
913
948
  this.#jobs.delete(jobId);
914
949
  this.#suppressedDeliveries.delete(jobId);
@@ -926,6 +961,7 @@ export class AsyncJobManager {
926
961
  this.#suppressedDeliveries.delete(jobId);
927
962
  this.#watchedJobs.delete(jobId);
928
963
  this.#outputState.delete(jobId);
964
+ this.#notifyChange();
929
965
  }, this.#retentionMs);
930
966
  timer.unref();
931
967
  this.#evictionTimers.set(jobId, timer);
package/src/cli/args.ts CHANGED
@@ -7,7 +7,7 @@ import chalk from "chalk";
7
7
  import { parseEffort } from "../thinking";
8
8
  import { BUILTIN_TOOLS } from "../tools";
9
9
 
10
- export type Mode = "text" | "json" | "rpc" | "acp" | "rpc-ui";
10
+ export type Mode = "text" | "json" | "rpc" | "acp" | "rpc-ui" | "bridge";
11
11
 
12
12
  export interface Args {
13
13
  cwd?: string;
@@ -96,7 +96,14 @@ export function parseArgs(args: string[]): Args {
96
96
  result.allowHome = true;
97
97
  } else if (arg === "--mode" && i + 1 < args.length) {
98
98
  const mode = args[++i];
99
- if (mode === "text" || mode === "json" || mode === "rpc" || mode === "acp" || mode === "rpc-ui") {
99
+ if (
100
+ mode === "text" ||
101
+ mode === "json" ||
102
+ mode === "rpc" ||
103
+ mode === "acp" ||
104
+ mode === "rpc-ui" ||
105
+ mode === "bridge"
106
+ ) {
100
107
  result.mode = mode;
101
108
  }
102
109
  } else if (arg === "--continue" || arg === "-c") {
@@ -21,6 +21,7 @@ export default class DeepInterview extends Command {
21
21
  deliberate: Flags.boolean({
22
22
  description: "Shortcut for --write handoff to ralplan in deliberate consensus mode",
23
23
  }),
24
+ force: Flags.boolean({ description: "Overwrite corrupt existing deep-interview state during --write" }),
24
25
  json: Flags.boolean({ description: "Output JSON" }),
25
26
  };
26
27
  static examples = [