@gajae-code/coding-agent 0.11.10 → 0.12.0

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 (249) hide show
  1. package/CHANGELOG.md +86 -2
  2. package/dist/types/cli/read-cli.d.ts +1 -0
  3. package/dist/types/cli.d.ts +8 -1
  4. package/dist/types/commands/deep-interview.d.ts +9 -0
  5. package/dist/types/commands/harness.d.ts +22 -0
  6. package/dist/types/commands/read.d.ts +6 -0
  7. package/dist/types/config/model-profile-activation.d.ts +1 -0
  8. package/dist/types/config/model-profile-contract.d.ts +2 -0
  9. package/dist/types/config/model-registry.d.ts +4 -0
  10. package/dist/types/config/provider-auth-health.d.ts +14 -0
  11. package/dist/types/config/provider-ranking.d.ts +59 -0
  12. package/dist/types/config/settings-schema.d.ts +86 -3
  13. package/dist/types/config/settings.d.ts +3 -0
  14. package/dist/types/extensibility/extensions/types.d.ts +43 -2
  15. package/dist/types/extensibility/shared-events.d.ts +6 -0
  16. package/dist/types/gjc-runtime/deep-interview-ambiguity.d.ts +5 -12
  17. package/dist/types/gjc-runtime/deep-interview-recorder.d.ts +17 -32
  18. package/dist/types/gjc-runtime/deep-interview-stage.d.ts +37 -0
  19. package/dist/types/gjc-runtime/deep-interview-state.d.ts +4 -135
  20. package/dist/types/gjc-runtime/gc-runtime.d.ts +1 -1
  21. package/dist/types/gjc-runtime/linux-proc.d.ts +22 -14
  22. package/dist/types/gjc-runtime/memory-guard-owner-claims.d.ts +47 -0
  23. package/dist/types/gjc-runtime/ralplan-runtime.d.ts +112 -1
  24. package/dist/types/gjc-runtime/state-runtime.d.ts +3 -1
  25. package/dist/types/gjc-runtime/state-writer.d.ts +5 -46
  26. package/dist/types/gjc-runtime/team-launch.d.ts +1 -1
  27. package/dist/types/gjc-runtime/team-runtime.d.ts +2 -1
  28. package/dist/types/gjc-runtime/team-store.d.ts +12 -0
  29. package/dist/types/gjc-runtime/team-worker-memory-guard.d.ts +92 -0
  30. package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +7 -0
  31. package/dist/types/gjc-runtime/ultragoal-receipt-freshness.d.ts +8 -0
  32. package/dist/types/gjc-runtime/workflow-manifest.d.ts +3 -5
  33. package/dist/types/internal-urls/local-root-gc.d.ts +2 -0
  34. package/dist/types/main.d.ts +1 -1
  35. package/dist/types/memories/index.d.ts +2 -0
  36. package/dist/types/modes/acp/acp-agent.d.ts +22 -9
  37. package/dist/types/modes/components/assistant-message.d.ts +3 -1
  38. package/dist/types/modes/components/irc-sidebar.d.ts +41 -0
  39. package/dist/types/modes/components/queue-pane.d.ts +8 -0
  40. package/dist/types/modes/components/queued-message-selector.d.ts +6 -0
  41. package/dist/types/modes/components/read-tool-group.d.ts +4 -4
  42. package/dist/types/modes/components/session-observer-overlay.d.ts +4 -0
  43. package/dist/types/modes/components/settings-selector.d.ts +2 -0
  44. package/dist/types/modes/components/tool-execution.d.ts +8 -0
  45. package/dist/types/modes/components/welcome.d.ts +1 -0
  46. package/dist/types/modes/controllers/event-controller.d.ts +3 -0
  47. package/dist/types/modes/interactive-mode.d.ts +7 -1
  48. package/dist/types/modes/irc-observation-ledger.d.ts +17 -1
  49. package/dist/types/modes/types.d.ts +2 -0
  50. package/dist/types/modes/utils/ui-helpers.d.ts +16 -0
  51. package/dist/types/runtime/memory-domain.d.ts +9 -0
  52. package/dist/types/runtime/memory-guard-contract.d.ts +71 -0
  53. package/dist/types/runtime/memory-guard.d.ts +39 -0
  54. package/dist/types/runtime/memory-limit.d.ts +11 -0
  55. package/dist/types/runtime-mcp/manager.d.ts +8 -0
  56. package/dist/types/runtime-mcp/smithery-auth.d.ts +5 -0
  57. package/dist/types/sdk/acp/final-text.d.ts +19 -0
  58. package/dist/types/sdk/acp/mcp.d.ts +23 -0
  59. package/dist/types/sdk/broker/lifecycle.d.ts +7 -0
  60. package/dist/types/sdk/bus/chat-daemon-control.d.ts +2 -1
  61. package/dist/types/sdk/bus/control-drain-lease.d.ts +52 -0
  62. package/dist/types/sdk/bus/index.d.ts +18 -2
  63. package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +37 -0
  64. package/dist/types/sdk/bus/prompt-reconciliation.d.ts +2 -1
  65. package/dist/types/sdk/bus/rate-limit-pool.d.ts +2 -0
  66. package/dist/types/sdk/bus/reconciliation-store.d.ts +65 -0
  67. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +6 -4
  68. package/dist/types/sdk/bus/telegram-daemon.d.ts +23 -3
  69. package/dist/types/sdk/host/control/operations.d.ts +2 -1
  70. package/dist/types/sdk/host/host.d.ts +2 -0
  71. package/dist/types/sdk/host/query/handlers.d.ts +5 -0
  72. package/dist/types/sdk/lifecycle-session.d.ts +10 -1
  73. package/dist/types/sdk/startup-capability.d.ts +6 -0
  74. package/dist/types/session/agent-session.d.ts +51 -19
  75. package/dist/types/session/fallback-chain-controller.d.ts +18 -2
  76. package/dist/types/session/internal/managed-session-scope.d.ts +27 -0
  77. package/dist/types/session/memory-guard-checkpoint-participant.d.ts +69 -0
  78. package/dist/types/session/session-manager.d.ts +59 -13
  79. package/dist/types/session/streaming-output.d.ts +60 -5
  80. package/dist/types/skill-state/active-state.d.ts +0 -4
  81. package/dist/types/skill-state/workflow-hud.d.ts +3 -0
  82. package/dist/types/task/executor.d.ts +6 -0
  83. package/dist/types/task/types.d.ts +36 -0
  84. package/dist/types/task/ultragoal-redteam-activation.d.ts +33 -0
  85. package/dist/types/tools/browser/launch.d.ts +7 -0
  86. package/dist/types/tools/fetch.d.ts +17 -1
  87. package/dist/types/tools/output-meta.d.ts +21 -1
  88. package/dist/types/tools/read-internals.d.ts +12 -0
  89. package/dist/types/tools/read.d.ts +45 -1
  90. package/dist/types/tools/resource-gc.d.ts +23 -0
  91. package/dist/types/tools/tool-result.d.ts +7 -1
  92. package/package.json +9 -13
  93. package/scripts/benchmark-sticky-viewport-pr1.ts +239 -0
  94. package/scripts/capture-sticky-viewport-showcase.ts +292 -0
  95. package/scripts/generate-sdk-operation-inventory.ts +4 -0
  96. package/scripts/run-test-manifest.ts +6 -4
  97. package/scripts/verify-gjc-sdk-canonicalization.ts +122 -18
  98. package/scripts/verify-sticky-viewport-showcase.ts +611 -0
  99. package/src/capability/index.ts +8 -0
  100. package/src/cli/args.ts +14 -8
  101. package/src/cli/fast-help.ts +1 -1
  102. package/src/cli/read-cli.ts +2 -1
  103. package/src/cli.ts +49 -2
  104. package/src/commands/deep-interview.ts +29 -9
  105. package/src/commands/harness.ts +35 -12
  106. package/src/commands/read.ts +11 -2
  107. package/src/commands/sdk.ts +91 -7
  108. package/src/commands/team.ts +1 -1
  109. package/src/config/model-profile-activation.ts +1 -0
  110. package/src/config/model-profile-contract.ts +13 -0
  111. package/src/config/model-profiles.ts +24 -0
  112. package/src/config/model-registry.ts +21 -2
  113. package/src/config/provider-auth-health.ts +42 -0
  114. package/src/config/provider-ranking.ts +119 -0
  115. package/src/config/settings-schema.ts +84 -3
  116. package/src/config/settings.ts +254 -108
  117. package/src/defaults/gjc/skills/deep-interview/SKILL.md +229 -82
  118. package/src/defaults/gjc/skills/ralplan/SKILL.md +78 -26
  119. package/src/defaults/gjc/skills/team/SKILL.md +1 -1
  120. package/src/defaults/gjc/skills/ultragoal/SKILL.md +26 -16
  121. package/src/eval/py/executor.ts +7 -2
  122. package/src/extensibility/extensions/runner.ts +4 -0
  123. package/src/extensibility/extensions/types.ts +42 -4
  124. package/src/extensibility/shared-events.ts +5 -0
  125. package/src/gjc-runtime/deep-interview-ambiguity.ts +47 -68
  126. package/src/gjc-runtime/deep-interview-recorder.ts +227 -310
  127. package/src/gjc-runtime/deep-interview-runtime.ts +109 -270
  128. package/src/gjc-runtime/deep-interview-stage.ts +1016 -0
  129. package/src/gjc-runtime/deep-interview-state.ts +12 -921
  130. package/src/gjc-runtime/gc-render.ts +1 -0
  131. package/src/gjc-runtime/gc-runtime.ts +11 -1
  132. package/src/gjc-runtime/linux-proc.ts +70 -36
  133. package/src/gjc-runtime/memory-guard-owner-claims.ts +389 -0
  134. package/src/gjc-runtime/ralplan-runtime.ts +979 -71
  135. package/src/gjc-runtime/state-runtime.ts +50 -12
  136. package/src/gjc-runtime/state-writer.ts +70 -222
  137. package/src/gjc-runtime/team-launch.ts +34 -5
  138. package/src/gjc-runtime/team-runtime.ts +970 -33
  139. package/src/gjc-runtime/team-store.ts +32 -0
  140. package/src/gjc-runtime/team-worker-memory-guard.ts +363 -0
  141. package/src/gjc-runtime/team-workers.ts +1 -0
  142. package/src/gjc-runtime/tmux-owner-isolation.ts +18 -0
  143. package/src/gjc-runtime/ultragoal-receipt-freshness.ts +20 -0
  144. package/src/gjc-runtime/ultragoal-runtime.ts +13 -7
  145. package/src/gjc-runtime/workflow-manifest.generated.json +97 -350
  146. package/src/gjc-runtime/workflow-manifest.ts +34 -179
  147. package/src/hooks/native-skill-hook.ts +17 -4
  148. package/src/hooks/skill-state.ts +1 -23
  149. package/src/internal-urls/docs-index.generated.ts +10 -11
  150. package/src/internal-urls/local-protocol.ts +23 -4
  151. package/src/internal-urls/local-root-gc.ts +127 -0
  152. package/src/main.ts +9 -5
  153. package/src/memories/index.ts +10 -0
  154. package/src/modes/DESIGN.md +47 -0
  155. package/src/modes/acp/acp-agent.ts +597 -67
  156. package/src/modes/acp/acp-event-mapper.ts +106 -12
  157. package/src/modes/acp/acp-mode.ts +39 -3
  158. package/src/modes/components/assistant-message.ts +123 -22
  159. package/src/modes/components/irc-sidebar.ts +176 -62
  160. package/src/modes/components/model-selector.ts +76 -5
  161. package/src/modes/components/notifications-settings-editor.ts +1 -1
  162. package/src/modes/components/oauth-selector.ts +42 -12
  163. package/src/modes/components/queue-pane.ts +55 -9
  164. package/src/modes/components/queued-message-selector.ts +53 -10
  165. package/src/modes/components/read-tool-group.ts +82 -14
  166. package/src/modes/components/session-observer-overlay.ts +187 -32
  167. package/src/modes/components/settings-selector.ts +60 -18
  168. package/src/modes/components/tool-execution.ts +138 -27
  169. package/src/modes/components/tool-status-header.ts +1 -4
  170. package/src/modes/components/welcome.ts +18 -3
  171. package/src/modes/controllers/command-controller.ts +4 -0
  172. package/src/modes/controllers/event-controller.ts +109 -27
  173. package/src/modes/controllers/extension-ui-controller.ts +23 -12
  174. package/src/modes/controllers/input-controller.ts +62 -6
  175. package/src/modes/controllers/selector-controller.ts +83 -37
  176. package/src/modes/interactive-mode.ts +127 -29
  177. package/src/modes/irc-observation-ledger.ts +71 -15
  178. package/src/modes/runtime-init.ts +20 -2
  179. package/src/modes/types.ts +2 -0
  180. package/src/modes/utils/ui-helpers.ts +94 -1
  181. package/src/prompts/agents/architect.md +9 -1
  182. package/src/prompts/agents/critic.md +9 -0
  183. package/src/prompts/agents/executor.md +1 -1
  184. package/src/prompts/system/system-prompt.md +0 -1
  185. package/src/prompts/tools/read.md +4 -2
  186. package/src/runtime/memory-domain.ts +66 -0
  187. package/src/runtime/memory-guard-contract.ts +73 -0
  188. package/src/runtime/memory-guard.ts +292 -0
  189. package/src/runtime/memory-limit.ts +50 -0
  190. package/src/runtime-mcp/manager.ts +26 -6
  191. package/src/runtime-mcp/smithery-auth.ts +17 -2
  192. package/src/runtime-mcp/smithery-connect.ts +11 -1
  193. package/src/sdk/acp/adapter.ts +8 -1
  194. package/src/sdk/acp/final-text.ts +40 -0
  195. package/src/sdk/acp/mcp.ts +26 -0
  196. package/src/sdk/broker/lifecycle.ts +107 -7
  197. package/src/sdk/bus/chat-daemon-cli.ts +2 -2
  198. package/src/sdk/bus/chat-daemon-control.ts +4 -3
  199. package/src/sdk/bus/config.ts +1 -1
  200. package/src/sdk/bus/control-drain-lease.ts +104 -0
  201. package/src/sdk/bus/index.ts +503 -60
  202. package/src/sdk/bus/kind-aware-reconciliation.ts +242 -0
  203. package/src/sdk/bus/prompt-reconciliation.ts +2 -1
  204. package/src/sdk/bus/rate-limit-pool.ts +8 -0
  205. package/src/sdk/bus/reconciliation-store.ts +224 -0
  206. package/src/sdk/bus/telegram-daemon-contract.ts +6 -4
  207. package/src/sdk/bus/telegram-daemon.ts +531 -53
  208. package/src/sdk/host/control/dispatch.ts +7 -1
  209. package/src/sdk/host/control/operations.ts +2 -1
  210. package/src/sdk/host/host.ts +25 -3
  211. package/src/sdk/host/query/handlers.ts +55 -0
  212. package/src/sdk/lifecycle-session.ts +19 -3
  213. package/src/sdk/mcp/server.ts +46 -18
  214. package/src/sdk/protocol/operation-inventory.generated.json +76 -0
  215. package/src/sdk/protocol/operation-registry.ts +8 -2
  216. package/src/sdk/session.ts +25 -2
  217. package/src/sdk/startup-capability.ts +6 -0
  218. package/src/session/agent-session.ts +720 -190
  219. package/src/session/fallback-chain-controller.ts +47 -8
  220. package/src/session/internal/managed-session-scope.ts +40 -10
  221. package/src/session/internal/native-publish-outcome.ts +8 -3
  222. package/src/session/memory-guard-checkpoint-participant.ts +131 -0
  223. package/src/session/session-manager.ts +1372 -42
  224. package/src/session/streaming-output.ts +262 -43
  225. package/src/setup/provider-onboarding.ts +19 -4
  226. package/src/skill-state/active-state.ts +0 -10
  227. package/src/skill-state/workflow-hud.ts +25 -2
  228. package/src/skill-state/workflow-mutation-guard.ts +65 -7
  229. package/src/task/executor.ts +11 -3
  230. package/src/task/index.ts +2 -0
  231. package/src/task/types.ts +22 -11
  232. package/src/task/ultragoal-redteam-activation.ts +75 -0
  233. package/src/tools/ask.ts +89 -69
  234. package/src/tools/browser/launch.ts +41 -6
  235. package/src/tools/fetch.ts +114 -23
  236. package/src/tools/output-meta.ts +176 -9
  237. package/src/tools/path-utils.ts +5 -1
  238. package/src/tools/read-internals.ts +44 -0
  239. package/src/tools/read.ts +1542 -310
  240. package/src/tools/resource-gc.ts +665 -125
  241. package/src/tools/tool-result.ts +14 -1
  242. package/src/web/search/providers/codex.ts +1 -1
  243. package/src/workflow/workflow-intent-diff.ts +4 -1
  244. package/dist/types/gjc-runtime/deep-interview-draft.d.ts +0 -8
  245. package/dist/types/gjc-runtime/deep-interview-payload.d.ts +0 -41
  246. package/dist/types/gjc-runtime/deep-interview-repair.d.ts +0 -17
  247. package/src/gjc-runtime/deep-interview-draft.ts +0 -843
  248. package/src/gjc-runtime/deep-interview-payload.ts +0 -262
  249. package/src/gjc-runtime/deep-interview-repair.ts +0 -1674
@@ -45,6 +45,10 @@ export declare const taskItemSchema: z.ZodObject<{
45
45
  id: z.ZodString;
46
46
  description: z.ZodString;
47
47
  assignment: z.ZodString;
48
+ executionMode: z.ZodOptional<z.ZodEnum<{
49
+ default: "default";
50
+ "ultragoal-red-team": "ultragoal-red-team";
51
+ }>>;
48
52
  inheritContext: z.ZodOptional<z.ZodEnum<{
49
53
  bounded: "bounded";
50
54
  full: "full";
@@ -69,6 +73,10 @@ export declare const taskSchema: z.ZodObject<{
69
73
  id: z.ZodString;
70
74
  description: z.ZodString;
71
75
  assignment: z.ZodString;
76
+ executionMode: z.ZodOptional<z.ZodEnum<{
77
+ default: "default";
78
+ "ultragoal-red-team": "ultragoal-red-team";
79
+ }>>;
72
80
  inheritContext: z.ZodOptional<z.ZodEnum<{
73
81
  bounded: "bounded";
74
82
  full: "full";
@@ -100,6 +108,10 @@ export declare const taskSchemaNoIsolation: z.ZodObject<{
100
108
  id: z.ZodString;
101
109
  description: z.ZodString;
102
110
  assignment: z.ZodString;
111
+ executionMode: z.ZodOptional<z.ZodEnum<{
112
+ default: "default";
113
+ "ultragoal-red-team": "ultragoal-red-team";
114
+ }>>;
103
115
  inheritContext: z.ZodOptional<z.ZodEnum<{
104
116
  bounded: "bounded";
105
117
  full: "full";
@@ -131,6 +143,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
131
143
  id: z.ZodString;
132
144
  description: z.ZodString;
133
145
  assignment: z.ZodString;
146
+ executionMode: z.ZodOptional<z.ZodEnum<{
147
+ default: "default";
148
+ "ultragoal-red-team": "ultragoal-red-team";
149
+ }>>;
134
150
  inheritContext: z.ZodOptional<z.ZodEnum<{
135
151
  bounded: "bounded";
136
152
  full: "full";
@@ -161,6 +177,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
161
177
  id: z.ZodString;
162
178
  description: z.ZodString;
163
179
  assignment: z.ZodString;
180
+ executionMode: z.ZodOptional<z.ZodEnum<{
181
+ default: "default";
182
+ "ultragoal-red-team": "ultragoal-red-team";
183
+ }>>;
164
184
  inheritContext: z.ZodOptional<z.ZodEnum<{
165
185
  bounded: "bounded";
166
186
  full: "full";
@@ -191,6 +211,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
191
211
  id: z.ZodString;
192
212
  description: z.ZodString;
193
213
  assignment: z.ZodString;
214
+ executionMode: z.ZodOptional<z.ZodEnum<{
215
+ default: "default";
216
+ "ultragoal-red-team": "ultragoal-red-team";
217
+ }>>;
194
218
  inheritContext: z.ZodOptional<z.ZodEnum<{
195
219
  bounded: "bounded";
196
220
  full: "full";
@@ -221,6 +245,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
221
245
  id: z.ZodString;
222
246
  description: z.ZodString;
223
247
  assignment: z.ZodString;
248
+ executionMode: z.ZodOptional<z.ZodEnum<{
249
+ default: "default";
250
+ "ultragoal-red-team": "ultragoal-red-team";
251
+ }>>;
224
252
  inheritContext: z.ZodOptional<z.ZodEnum<{
225
253
  bounded: "bounded";
226
254
  full: "full";
@@ -251,6 +279,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
251
279
  id: z.ZodString;
252
280
  description: z.ZodString;
253
281
  assignment: z.ZodString;
282
+ executionMode: z.ZodOptional<z.ZodEnum<{
283
+ default: "default";
284
+ "ultragoal-red-team": "ultragoal-red-team";
285
+ }>>;
254
286
  inheritContext: z.ZodOptional<z.ZodEnum<{
255
287
  bounded: "bounded";
256
288
  full: "full";
@@ -281,6 +313,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
281
313
  id: z.ZodString;
282
314
  description: z.ZodString;
283
315
  assignment: z.ZodString;
316
+ executionMode: z.ZodOptional<z.ZodEnum<{
317
+ default: "default";
318
+ "ultragoal-red-team": "ultragoal-red-team";
319
+ }>>;
284
320
  inheritContext: z.ZodOptional<z.ZodEnum<{
285
321
  bounded: "bounded";
286
322
  full: "full";
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Decide whether an executor assignment should inject the ultragoal red-team
3
+ * prompt fragment.
4
+ *
5
+ * Preference order (parse, don't re-validate later):
6
+ * 1. Explicit typed `executionMode` on the task / ExecutorOptions — authoritative.
7
+ * 2. Assignment text heuristics — only explicit Ultragoal QA/red-team phrasing.
8
+ *
9
+ * Bare mentions of `executorQa` (docs, quality-gate field names, negative
10
+ * instructions) must not flip the mode (#2698 / #2456).
11
+ *
12
+ * Mirrors `executor.md`:
13
+ * "activates only when the assignment explicitly labels Executor as Ultragoal
14
+ * completion QA/red-team or asks for `executorQa` red-team evidence."
15
+ */
16
+ export declare const EXECUTOR_EXECUTION_MODES: readonly ["default", "ultragoal-red-team"];
17
+ export type ExecutorExecutionMode = (typeof EXECUTOR_EXECUTION_MODES)[number];
18
+ export declare function isExecutorExecutionMode(value: unknown): value is ExecutorExecutionMode;
19
+ /**
20
+ * Parse a caller-supplied mode. Unknown values fail closed to `undefined`
21
+ * so the assignment heuristic (or default off) still applies — never invent on.
22
+ */
23
+ export declare function parseExecutorExecutionMode(value: unknown): ExecutorExecutionMode | undefined;
24
+ export declare function assignmentRequestsUltragoalRedTeam(assignment: string | undefined): boolean;
25
+ export interface ResolveUltragoalRedTeamArgs {
26
+ readonly executionMode?: unknown;
27
+ readonly assignment?: string;
28
+ }
29
+ /**
30
+ * Final activation decision for the executor prompt fragment.
31
+ * Typed mode wins; assignment text is a compatibility fallback only.
32
+ */
33
+ export declare function resolveUltragoalRedTeamActivation(args: ResolveUltragoalRedTeamArgs): boolean;
@@ -13,6 +13,13 @@ export declare const DEFAULT_VIEWPORT: {
13
13
  export declare const BROWSER_PROTOCOL_TIMEOUT_MS = 60000;
14
14
  export declare function loadPuppeteer(): Promise<typeof Puppeteer>;
15
15
  export declare function loadPuppeteerInWorker(safeDir: string): Promise<typeof Puppeteer>;
16
+ /** Test seam: the browser launch overrides as resolved from trusted env. */
17
+ export declare function resolveBrowserEnvOverridesForTest(): {
18
+ executablePath: string | undefined;
19
+ proxy: string | undefined;
20
+ proxyBypassLoopback: boolean;
21
+ ignoreCertErrors: boolean;
22
+ };
16
23
  export interface LaunchHeadlessOptions {
17
24
  headless: boolean;
18
25
  viewport?: {
@@ -4,6 +4,7 @@ import type { Settings } from "../config/settings";
4
4
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
5
5
  import { type Theme } from "../modes/theme/theme";
6
6
  import type { ToolSession } from "../sdk";
7
+ import { type TruncationDirection } from "../session/streaming-output";
7
8
  import type { RenderResult } from "../web/scrapers/types";
8
9
  import { type OutputMeta } from "./output-meta";
9
10
  export declare function isReadableUrlPath(value: string): boolean;
@@ -50,7 +51,12 @@ interface ReadUrlCacheEntry {
50
51
  artifactId?: string;
51
52
  details: ReadUrlToolDetails;
52
53
  image?: FetchImagePayload;
54
+ /** Complete URL output, including its preamble and body. */
53
55
  output: string;
56
+ /** UTF-16 code-unit offset of the preamble in `output`. */
57
+ preambleChars: number;
58
+ /** Offset of the preamble after `wrapUntrustedContent(output)` is persisted. */
59
+ wrappedPreambleChars?: number;
54
60
  }
55
61
  export declare function loadReadUrlCacheEntry(session: ToolSession, params: {
56
62
  path: string;
@@ -59,11 +65,21 @@ export declare function loadReadUrlCacheEntry(session: ToolSession, params: {
59
65
  ensureArtifact?: boolean;
60
66
  preferCached?: boolean;
61
67
  }): Promise<ReadUrlCacheEntry>;
68
+ export declare const WRAP_PREFIX_CHARS: number;
69
+ export declare function escapeUntrustedContent(content: string): string;
62
70
  export declare function wrapUntrustedContent(content: string): string;
71
+ /**
72
+ * Remove only the outer URL-output wrapper before line pagination. The content
73
+ * remains escaped exactly as persisted; it is deliberately never unescaped.
74
+ */
75
+ export declare function prepareReadUrlSelectorInput(output: string, preambleChars: number, wrappedPreambleChars?: number): {
76
+ text: string;
77
+ preambleChars: number;
78
+ };
63
79
  export declare function executeReadUrl(session: ToolSession, params: {
64
80
  path: string;
65
81
  raw?: boolean;
66
- }, signal?: AbortSignal): Promise<AgentToolResult<ReadUrlToolDetails>>;
82
+ }, signal?: AbortSignal, direction?: TruncationDirection): Promise<AgentToolResult<ReadUrlToolDetails>>;
67
83
  /** Render URL read call (URL preview) */
68
84
  export declare function renderReadUrlCall(args: {
69
85
  path?: string;
@@ -7,12 +7,15 @@
7
7
  import type { AgentTool } from "@gajae-code/agent-core";
8
8
  import { type Settings } from "../config/settings";
9
9
  import type { Theme } from "../modes/theme/theme";
10
- import { type OutputSummary, type TruncationResult } from "../session/streaming-output";
10
+ import { type OutputSummary, type ReadWindow, type TruncationResult } from "../session/streaming-output";
11
11
  /**
12
12
  * Truncation metadata for the output notice.
13
13
  */
14
14
  export interface TruncationMeta {
15
15
  direction: "head" | "tail" | "middle";
16
+ /** Coordinate basis for shown/head/tail ranges. Omitted means file coordinates; "window" is the selected-range coordinate system. */
17
+ rangeBase?: "file" | "window";
18
+ noticeOwner?: "body";
16
19
  truncatedBy: "lines" | "bytes" | "middle";
17
20
  totalLines: number;
18
21
  totalBytes: number;
@@ -33,6 +36,12 @@ export interface TruncationMeta {
33
36
  start: number;
34
37
  end: number;
35
38
  };
39
+ /** Partial source-line preview retained by a directional window. */
40
+ partialLine?: {
41
+ line: number;
42
+ bytes: number;
43
+ sourceBytes: number;
44
+ };
36
45
  /** Bytes elided from the middle. */
37
46
  elidedBytes?: number;
38
47
  /** Lines elided from the middle. */
@@ -96,11 +105,14 @@ export interface TruncationOptions {
96
105
  startLine?: number;
97
106
  totalFileLines?: number;
98
107
  artifactId?: string;
108
+ maxBytes?: number;
109
+ noticeOwner?: "body";
99
110
  }
100
111
  export interface TruncationSummaryOptions {
101
112
  direction: "head" | "tail" | "middle";
102
113
  startLine?: number;
103
114
  totalFileLines?: number;
115
+ noticeOwner?: "body";
104
116
  }
105
117
  export interface TruncationTextOptions {
106
118
  direction: "head" | "tail" | "middle";
@@ -108,6 +120,7 @@ export interface TruncationTextOptions {
108
120
  totalBytes?: number;
109
121
  maxBytes?: number;
110
122
  artifactId?: string;
123
+ noticeOwner?: "body";
111
124
  }
112
125
  /**
113
126
  * Fluent builder for OutputMeta.
@@ -125,6 +138,13 @@ export declare class OutputMetaBuilder {
125
138
  #private;
126
139
  /** Add truncation info from TruncationResult. No-op if not truncated. */
127
140
  truncation(result: TruncationResult, options: TruncationOptions): this;
141
+ /** Add metadata from the actual head/tail windows retained by middle truncation. */
142
+ truncationWindows(windows: ReadWindow, options?: {
143
+ artifactId?: string;
144
+ noticeOwner?: "body";
145
+ maxBytes?: number;
146
+ rangeBase?: "file" | "window";
147
+ }): this;
128
148
  /** Add truncation info from OutputSummary. No-op if not truncated. */
129
149
  truncationFromSummary(summary: OutputSummary, options: TruncationSummaryOptions): this;
130
150
  /** Add truncation info from truncated output text. No-op if truncation not detected. */
@@ -0,0 +1,12 @@
1
+ import type { Settings } from "../config/settings";
2
+ import type { TruncationDirection } from "../session/streaming-output";
3
+ /**
4
+ * Read execution routes that have distinct truncation-default contracts.
5
+ * Routes that share the same default are grouped only when their truncation
6
+ * policy is identical; selection and rendering remain owned by read.ts.
7
+ */
8
+ export type ReadRoute = "local-bare-stream" | "local-bare-acp" | "archive-member-bare" | "local-range" | "local-multi-range" | "local-raw" | "local-summary" | "url-reader" | "url-cache-page" | "dir-local" | "dir-archive" | "sqlite-list" | "sqlite-rows" | "converted";
9
+ /** Resolve the configured default for a route; explicit parameters bypass it. */
10
+ export declare function pathDefault(route: ReadRoute, settings: Settings): TruncationDirection;
11
+ /** Resolve the effective caller-facing direction with explicit precedence. */
12
+ export declare function resolveEffectiveDirection(explicitParam: TruncationDirection | undefined, route: ReadRoute, settings: Settings): TruncationDirection;
@@ -4,10 +4,49 @@ import * as z from "zod/v4";
4
4
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
5
5
  import { type Theme } from "../modes/theme/theme";
6
6
  import type { ToolSession } from "../sdk";
7
- import { type TruncationResult } from "../session/streaming-output";
7
+ import type { ReadWindow, TruncationResult } from "../session/streaming-output";
8
8
  import { type OutputMeta } from "./output-meta";
9
+ export declare function streamLinesFromFile(filePath: string, startLine: number, maxLinesToCollect: number, maxBytes: number, selectedLineLimit: number | null, signal?: AbortSignal, collect?: "head" | "tail" | "both", collectEndExclusive?: number | null): Promise<{
10
+ lines: string[];
11
+ totalFileLines: number;
12
+ collectedBytes: number;
13
+ stoppedByByteLimit: boolean;
14
+ firstLinePreview?: {
15
+ text: string;
16
+ bytes: number;
17
+ };
18
+ firstLineByteLength?: number;
19
+ selectedBytesTotal: number;
20
+ windowBytesTotal: number;
21
+ windowLinesTotal: number;
22
+ windowStartIndex: number;
23
+ tailPartial?: {
24
+ text: string;
25
+ bytes: number;
26
+ sourceIndex: number;
27
+ sourceLineBytes: number;
28
+ };
29
+ maxBytes: number;
30
+ headLines?: string[];
31
+ headBytes?: number;
32
+ headStartIndex?: number;
33
+ degenerateTailBudget: boolean;
34
+ degenerateHeadBudget: boolean;
35
+ headStoppedByBytes: boolean;
36
+ headStoppedByLines: boolean;
37
+ ringBudgetLines: number;
38
+ ringEvictedForBytes: boolean;
39
+ ringEvictedForLines: boolean;
40
+ tailDroppedForBytes: boolean;
41
+ }>;
42
+ export declare function streamResultWindow(result: Awaited<ReturnType<typeof streamLinesFromFile>>, collect: "tail" | "both", startLine: number, collectEndExclusive: number | null): ReadWindow;
9
43
  declare const readSchema: z.ZodObject<{
10
44
  path: z.ZodString;
45
+ truncation: z.ZodOptional<z.ZodEnum<{
46
+ both: "both";
47
+ head: "head";
48
+ last: "last";
49
+ }>>;
11
50
  }, z.core.$strict>;
12
51
  export type ReadToolInput = z.infer<typeof readSchema>;
13
52
  /** Project paths and output sizes without exposing read content or remote URLs. */
@@ -60,6 +99,11 @@ export declare class ReadTool implements AgentTool<typeof readSchema, ReadToolDe
60
99
  readonly description: string;
61
100
  readonly parameters: z.ZodObject<{
62
101
  path: z.ZodString;
102
+ truncation: z.ZodOptional<z.ZodEnum<{
103
+ both: "both";
104
+ head: "head";
105
+ last: "last";
106
+ }>>;
63
107
  }, z.core.$strict>;
64
108
  readonly nonAbortable = true;
65
109
  readonly strict = true;
@@ -1,4 +1,6 @@
1
+ import type { WindowsJobMemoryProbeResult } from "@gajae-code/natives";
1
2
  import type { Settings } from "../config/settings";
3
+ import type { MemoryGuardWorkerSample } from "../runtime/memory-guard-contract";
2
4
  import { type TabGcSnapshot } from "./browser/tab-supervisor";
3
5
  export interface BrowserGcPolicy {
4
6
  enabled: boolean;
@@ -16,7 +18,10 @@ export declare function resolveSweepIntervalMs(settings: Settings): number;
16
18
  /** Injectable seams so the controller is fully testable without real browsers/filesystem/RSS. */
17
19
  export interface ResourceGcDeps {
18
20
  now: () => number;
21
+ monotonicNow: () => number;
19
22
  rssBytes: () => number;
23
+ memorySnapshot: () => Promise<MemoryPressureSnapshot>;
24
+ runGc: () => void;
20
25
  logWarn: (msg: string, meta?: Record<string, unknown>) => void;
21
26
  listTabs: () => TabGcSnapshot[];
22
27
  releaseTab: (name: string, policy: {
@@ -31,10 +36,13 @@ export interface ResourceGcDeps {
31
36
  removed: number;
32
37
  }>;
33
38
  screenshotArmed: () => boolean;
39
+ listTeamWorkers?: (cwd: string, sessionId: string) => Promise<MemoryGuardWorkerSample[]>;
40
+ applyTeamWorkerGuard?: (cwd: string, sessionId: string, workerId: string, excessBytes: number, incidentId: string) => Promise<void>;
34
41
  }
35
42
  export interface ResourceGcRegistration {
36
43
  sessionId: string;
37
44
  settings: Settings;
45
+ cwd?: string | (() => string);
38
46
  }
39
47
  /**
40
48
  * Register a session with the resource GC. Starts the single shared timer on the first
@@ -43,6 +51,21 @@ export interface ResourceGcRegistration {
43
51
  */
44
52
  export declare function registerResourceGcSession(reg: ResourceGcRegistration): () => void;
45
53
  export declare function sweepOnce(d?: ResourceGcDeps): Promise<void>;
54
+ export interface MemoryPressureDomain {
55
+ hardCapBytes: number;
56
+ totalUsageBytes: number;
57
+ source: MemoryPressureSnapshot["source"];
58
+ }
59
+ export interface MemoryPressureSnapshot {
60
+ hardCapBytes: number;
61
+ totalUsageBytes: number;
62
+ parentBytes: number;
63
+ source: "host" | "linux_cgroup_v2" | "linux_cgroup_v1" | "windows_job" | "windows_process_job_limit";
64
+ domains?: MemoryPressureDomain[];
65
+ }
66
+ export declare function __sampleLinuxCgroupHierarchyForTest(mountInfo: string, membership: string, fsType: "cgroup" | "cgroup2", hostBytes: number, parentBytes: number): Promise<MemoryPressureSnapshot | null>;
67
+ export declare function __sampleWindowsJobMemoryForTest(hostBytes: number, parentBytes: number, probeResult?: WindowsJobMemoryProbeResult): MemoryPressureSnapshot | null;
68
+ export declare function __selectMemoryPressureDomainForTest(snapshot: MemoryPressureSnapshot, policyLimitBytes: number | null): MemoryPressureSnapshot;
46
69
  export declare function __setResourceGcDepsForTest(overrides: Partial<ResourceGcDeps>): void;
47
70
  export declare function __setResourceGcSchedulerNowForTest(now: () => number): void;
48
71
  export declare function __runResourceGcTickForTest(): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import type { AgentToolResult } from "@gajae-code/agent-core";
2
2
  import type { ImageContent, TextContent } from "@gajae-code/ai";
3
- import type { OutputSummary, TruncationResult } from "../session/streaming-output";
3
+ import type { OutputSummary, ReadWindow, TruncationResult } from "../session/streaming-output";
4
4
  import type { OutputMeta, TruncationOptions, TruncationSummaryOptions, TruncationTextOptions } from "./output-meta";
5
5
  type ToolContent = Array<TextContent | ImageContent>;
6
6
  type DetailsWithMeta = {
@@ -12,6 +12,12 @@ export declare class ToolResultBuilder<TDetails extends DetailsWithMeta> {
12
12
  text(text: string): this;
13
13
  content(content: ToolContent): this;
14
14
  truncation(result: TruncationResult, options: TruncationOptions): this;
15
+ truncationWindows(windows: ReadWindow, options?: {
16
+ artifactId?: string;
17
+ noticeOwner?: "body";
18
+ maxBytes?: number;
19
+ rangeBase?: "file" | "window";
20
+ }): this;
15
21
  truncationFromSummary(summary: OutputSummary, options: TruncationSummaryOptions): this;
16
22
  truncationFromText(text: string, options: TruncationTextOptions): this;
17
23
  limits(limits: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/coding-agent",
4
- "version": "0.11.10",
4
+ "version": "0.12.0",
5
5
  "description": "Gajae Code CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://gajae-code.com",
7
7
  "author": "Yeachan-Heo and Gajae Code Contributors",
@@ -50,16 +50,16 @@
50
50
  "check:sdk-closure": "bun ../../scripts/telegram-daemon-generation-guard.ts --validate-current-tree && bun test ../../scripts/telegram-daemon-generation-guard.test.ts && bun scripts/generate-sdk-operation-inventory.ts --check && bun scripts/generate-sdk-adapter-parity-manifest.ts --check && bun scripts/run-test-manifest.ts test/manifests/sdk-adapter-parity-v1.json && bun scripts/generate-telegram-baseline-manifest.ts --check && bun scripts/run-test-manifest.ts test/manifests/telegram-baseline-v1.json && bun test test/sdk-downgrade-rollback.test.ts test/sdk-downgrade-unknown-version.test.ts && bun scripts/verify-gjc-sdk-canonicalization.ts --self-test && bun scripts/verify-gjc-sdk-canonicalization.ts && bun scripts/verify-gjc-sdk-rename.ts"
51
51
  },
52
52
  "dependencies": {
53
- "@agentclientprotocol/sdk": "1.2.1",
53
+ "@agentclientprotocol/sdk": "1.3.0",
54
54
  "@babel/parser": "^7.29.3",
55
55
  "@mozilla/readability": "^0.6.0",
56
- "@gajae-code/stats": "0.11.10",
57
- "@gajae-code/agent-core": "0.11.10",
58
- "@gajae-code/ai": "0.11.10",
59
- "@gajae-code/bridge-client": "0.11.10",
60
- "@gajae-code/natives": "0.11.10",
61
- "@gajae-code/tui": "0.11.10",
62
- "@gajae-code/utils": "0.11.10",
56
+ "@gajae-code/stats": "0.12.0",
57
+ "@gajae-code/agent-core": "0.12.0",
58
+ "@gajae-code/ai": "0.12.0",
59
+ "@gajae-code/bridge-client": "0.12.0",
60
+ "@gajae-code/natives": "0.12.0",
61
+ "@gajae-code/tui": "0.12.0",
62
+ "@gajae-code/utils": "0.12.0",
63
63
  "@puppeteer/browsers": "^2.13.0",
64
64
  "@types/turndown": "5.0.6",
65
65
  "@xterm/headless": "^6.0.0",
@@ -343,10 +343,6 @@
343
343
  "types": "./dist/types/extensibility/custom-commands/bundled/ci-green/index.d.ts",
344
344
  "import": "./src/extensibility/custom-commands/bundled/ci-green/index.ts"
345
345
  },
346
- "./extensibility/custom-commands/bundled/review": {
347
- "types": "./dist/types/extensibility/custom-commands/bundled/review/index.d.ts",
348
- "import": "./src/extensibility/custom-commands/bundled/review/index.ts"
349
- },
350
346
  "./extensibility/custom-tools": {
351
347
  "types": "./dist/types/extensibility/custom-tools/index.d.ts",
352
348
  "import": "./src/extensibility/custom-tools/index.ts"