@gajae-code/coding-agent 0.12.0 → 0.12.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 (223) hide show
  1. package/CHANGELOG.md +82 -1
  2. package/dist/types/async/job-manager.d.ts +17 -3
  3. package/dist/types/config/settings-schema.d.ts +54 -0
  4. package/dist/types/exa/mcp-client.d.ts +10 -1
  5. package/dist/types/exec/bash-executor.d.ts +45 -12
  6. package/dist/types/extensibility/extensions/types.d.ts +16 -2
  7. package/dist/types/extensibility/gjc-plugins/index.d.ts +12 -2
  8. package/dist/types/extensibility/gjc-plugins/installer.d.ts +63 -7
  9. package/dist/types/extensibility/gjc-plugins/lifecycle-reconciliation.d.ts +55 -0
  10. package/dist/types/extensibility/gjc-plugins/lifecycle.d.ts +64 -0
  11. package/dist/types/extensibility/gjc-plugins/runtime-quarantine.d.ts +67 -0
  12. package/dist/types/extensibility/gjc-plugins/session-validation.d.ts +3 -1
  13. package/dist/types/extensibility/gjc-plugins/types.d.ts +124 -0
  14. package/dist/types/gjc-runtime/launch-tmux.d.ts +1 -0
  15. package/dist/types/gjc-runtime/ralplan-runtime.d.ts +18 -0
  16. package/dist/types/gjc-runtime/team-launch.d.ts +1 -1
  17. package/dist/types/gjc-runtime/team-runtime.d.ts +25 -0
  18. package/dist/types/gjc-runtime/team-worker-heartbeat.d.ts +43 -0
  19. package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +10 -0
  20. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +31 -80
  21. package/dist/types/modes/acp/acp-agent.d.ts +2 -19
  22. package/dist/types/modes/components/gjc-bundle-settings.d.ts +34 -0
  23. package/dist/types/modes/components/notifications-settings-editor.d.ts +1 -0
  24. package/dist/types/modes/components/session-observer-overlay.d.ts +18 -0
  25. package/dist/types/modes/components/settings-selector.d.ts +9 -0
  26. package/dist/types/modes/components/status-line/gh.d.ts +5 -0
  27. package/dist/types/modes/components/transcript-viewer-overlay.d.ts +18 -1
  28. package/dist/types/reminders/star-reminder.d.ts +3 -13
  29. package/dist/types/runtime-mcp/manager.d.ts +1 -0
  30. package/dist/types/sdk/acp/adapter.d.ts +3 -1
  31. package/dist/types/sdk/broker/transport.d.ts +2 -0
  32. package/dist/types/sdk/bus/attachment-registry.d.ts +1 -0
  33. package/dist/types/sdk/bus/chat-daemon-control.d.ts +4 -1
  34. package/dist/types/sdk/bus/config.d.ts +6 -2
  35. package/dist/types/sdk/bus/index.d.ts +29 -0
  36. package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +8 -1
  37. package/dist/types/sdk/bus/lifecycle-control-runtime.d.ts +4 -0
  38. package/dist/types/sdk/bus/reconciliation-store.d.ts +7 -3
  39. package/dist/types/sdk/bus/rich-draft.d.ts +1 -0
  40. package/dist/types/sdk/bus/rich-render.d.ts +2 -0
  41. package/dist/types/sdk/bus/telegram-adoption-intent.d.ts +165 -0
  42. package/dist/types/sdk/bus/telegram-cli.d.ts +12 -0
  43. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +11 -4
  44. package/dist/types/sdk/bus/telegram-daemon.d.ts +25 -1
  45. package/dist/types/sdk/bus/telegram-reference.d.ts +11 -1
  46. package/dist/types/sdk/bus/threaded-render.d.ts +3 -2
  47. package/dist/types/sdk/bus/topic-registry.d.ts +11 -1
  48. package/dist/types/sdk/host/query/revision-store.d.ts +2 -0
  49. package/dist/types/sdk/host/reverse-leases.d.ts +1 -1
  50. package/dist/types/sdk/prompt-status.d.ts +23 -3
  51. package/dist/types/sdk/session.d.ts +6 -0
  52. package/dist/types/session/agent-session.d.ts +38 -2
  53. package/dist/types/session/artifacts.d.ts +8 -0
  54. package/dist/types/session/blob-store.d.ts +57 -4
  55. package/dist/types/session/internal/managed-session-storage.d.ts +8 -1
  56. package/dist/types/session/session-manager.d.ts +23 -6
  57. package/dist/types/session/session-storage.d.ts +4 -0
  58. package/dist/types/session/streaming-output.d.ts +36 -7
  59. package/dist/types/setup/credential-import.d.ts +12 -0
  60. package/dist/types/skill-state/active-state.d.ts +12 -0
  61. package/dist/types/skill-state/workflow-hud.d.ts +6 -0
  62. package/dist/types/task/executor.d.ts +3 -2
  63. package/dist/types/task/index.d.ts +3 -1
  64. package/dist/types/task/provider-retry-status.d.ts +8 -0
  65. package/dist/types/task/receipt.d.ts +7 -1
  66. package/dist/types/task/types.d.ts +23 -0
  67. package/dist/types/tools/ask-answer-registry.d.ts +2 -2
  68. package/dist/types/tools/bash-interactive.d.ts +4 -1
  69. package/dist/types/tools/bash.d.ts +3 -1
  70. package/dist/types/tools/image-gen.d.ts +4 -0
  71. package/dist/types/tools/index.d.ts +4 -0
  72. package/dist/types/tools/output-meta.d.ts +23 -2
  73. package/dist/types/tools/path-utils.d.ts +1 -0
  74. package/dist/types/tools/read.d.ts +0 -6
  75. package/dist/types/tools/review.d.ts +5 -7
  76. package/dist/types/tools/subagent.d.ts +2 -0
  77. package/dist/types/utils/gh.d.ts +13 -0
  78. package/dist/types/utils/image-resize.d.ts +1 -0
  79. package/dist/types/web/search/providers/kimi.d.ts +2 -0
  80. package/dist/types/web/search/providers/searxng.d.ts +7 -0
  81. package/dist/types/web/search/providers/xai.d.ts +2 -0
  82. package/package.json +10 -8
  83. package/scripts/acp-conformance-agent.ts +218 -0
  84. package/scripts/capture-gjc-bundle-settings.ts +306 -0
  85. package/scripts/generate-sdk-operation-inventory.ts +3 -0
  86. package/scripts/resident-memory-bench.ts +1341 -0
  87. package/scripts/run-acp-conformance.ts +285 -0
  88. package/src/async/job-manager.ts +78 -20
  89. package/src/cli/fast-help.ts +1 -1
  90. package/src/cli/plugin-cli.ts +176 -18
  91. package/src/commands/team.ts +19 -1
  92. package/src/config/file-lock.ts +11 -2
  93. package/src/config/settings-schema.ts +51 -0
  94. package/src/coordinator-mcp/question-gate-codec.ts +1 -1
  95. package/src/coordinator-mcp/server.ts +5 -12
  96. package/src/defaults/gjc/skills/deep-interview/SKILL.md +1 -0
  97. package/src/defaults/gjc/skills/ralplan/SKILL.md +19 -16
  98. package/src/defaults/gjc/skills/team/SKILL.md +2 -0
  99. package/src/defaults/gjc/skills/ultragoal/SKILL.md +37 -24
  100. package/src/defaults/gjc/skills/ultragoal/validation-batch-contracts.md +12 -0
  101. package/src/defaults/gjc-defaults.ts +4 -4
  102. package/src/exa/mcp-client.ts +12 -3
  103. package/src/exec/bash-executor.ts +144 -27
  104. package/src/extensibility/extensions/runner.ts +15 -0
  105. package/src/extensibility/extensions/types.ts +18 -1
  106. package/src/extensibility/gjc-plugins/constrained-hooks.ts +8 -2
  107. package/src/extensibility/gjc-plugins/index.ts +19 -2
  108. package/src/extensibility/gjc-plugins/installer.ts +189 -50
  109. package/src/extensibility/gjc-plugins/lifecycle-reconciliation.ts +199 -0
  110. package/src/extensibility/gjc-plugins/lifecycle.ts +626 -0
  111. package/src/extensibility/gjc-plugins/observability.ts +3 -3
  112. package/src/extensibility/gjc-plugins/prompt-appendix.ts +5 -1
  113. package/src/extensibility/gjc-plugins/runtime-adapters.ts +12 -2
  114. package/src/extensibility/gjc-plugins/runtime-quarantine.ts +121 -0
  115. package/src/extensibility/gjc-plugins/schema.ts +84 -12
  116. package/src/extensibility/gjc-plugins/session-validation.ts +9 -3
  117. package/src/extensibility/gjc-plugins/types.ts +141 -0
  118. package/src/extensibility/gjc-plugins/validation.ts +9 -0
  119. package/src/gjc-runtime/launch-tmux.ts +25 -6
  120. package/src/gjc-runtime/managed-owner-admission.ts +1 -1
  121. package/src/gjc-runtime/ralplan-runtime.ts +411 -17
  122. package/src/gjc-runtime/team-launch.ts +8 -0
  123. package/src/gjc-runtime/team-runtime.ts +140 -32
  124. package/src/gjc-runtime/team-worker-heartbeat.ts +149 -0
  125. package/src/gjc-runtime/tmux-owner-isolation.ts +10 -0
  126. package/src/gjc-runtime/tmux-sessions.ts +58 -13
  127. package/src/gjc-runtime/ultragoal-runtime.ts +401 -611
  128. package/src/gjc-runtime/workflow-manifest.generated.json +8 -99
  129. package/src/gjc-runtime/workflow-manifest.ts +4 -68
  130. package/src/internal-urls/docs-index.generated.ts +15 -15
  131. package/src/modes/DESIGN.md +51 -0
  132. package/src/modes/acp/acp-agent.ts +298 -186
  133. package/src/modes/components/gjc-bundle-settings.ts +508 -0
  134. package/src/modes/components/notifications-settings-editor.ts +12 -1
  135. package/src/modes/components/oauth-selector.ts +68 -30
  136. package/src/modes/components/session-observer-overlay.ts +305 -86
  137. package/src/modes/components/settings-selector.ts +56 -5
  138. package/src/modes/components/status-line/gh.ts +16 -0
  139. package/src/modes/components/tool-status-header.ts +3 -14
  140. package/src/modes/components/transcript-viewer-overlay.ts +99 -24
  141. package/src/modes/controllers/command-controller.ts +4 -0
  142. package/src/modes/controllers/extension-ui-controller.ts +7 -0
  143. package/src/modes/controllers/selector-controller.ts +45 -0
  144. package/src/modes/runtime-init.ts +3 -0
  145. package/src/prompts/agent-fragments/ralplan-persistence.md +4 -3
  146. package/src/prompts/system/eager-todo.md +8 -4
  147. package/src/prompts/system/system-prompt.md +11 -4
  148. package/src/prompts/tools/bash.md +5 -5
  149. package/src/prompts/tools/search-tool-bm25.md +5 -0
  150. package/src/prompts/tools/task.md +1 -1
  151. package/src/reminders/star-reminder.ts +4 -42
  152. package/src/runtime-mcp/manager.ts +19 -4
  153. package/src/sdk/acp/adapter.ts +22 -6
  154. package/src/sdk/broker/transport.ts +35 -3
  155. package/src/sdk/bus/attachment-registry.ts +5 -1
  156. package/src/sdk/bus/chat-daemon-cli.ts +4 -39
  157. package/src/sdk/bus/chat-daemon-control.ts +6 -3
  158. package/src/sdk/bus/config.ts +18 -2
  159. package/src/sdk/bus/index.ts +661 -126
  160. package/src/sdk/bus/kind-aware-reconciliation.ts +148 -73
  161. package/src/sdk/bus/lifecycle-commands.ts +4 -1
  162. package/src/sdk/bus/lifecycle-control-runtime.ts +403 -88
  163. package/src/sdk/bus/reconciliation-store.ts +95 -16
  164. package/src/sdk/bus/rich-draft.ts +1 -1
  165. package/src/sdk/bus/rich-render.ts +2 -2
  166. package/src/sdk/bus/telegram-adoption-intent.ts +574 -0
  167. package/src/sdk/bus/telegram-cli.ts +33 -8
  168. package/src/sdk/bus/telegram-daemon-cli.ts +1 -0
  169. package/src/sdk/bus/telegram-daemon-contract.ts +11 -4
  170. package/src/sdk/bus/telegram-daemon.ts +916 -23
  171. package/src/sdk/bus/telegram-reference.ts +40 -3
  172. package/src/sdk/bus/threaded-render.ts +48 -3
  173. package/src/sdk/bus/topic-registry.ts +20 -0
  174. package/src/sdk/host/query/revision-store.ts +36 -2
  175. package/src/sdk/host/reverse-leases.ts +44 -7
  176. package/src/sdk/prompt-status.ts +16 -3
  177. package/src/sdk/protocol/operation-inventory.generated.json +22 -0
  178. package/src/sdk/session.ts +88 -9
  179. package/src/session/agent-session.ts +822 -172
  180. package/src/session/artifacts.ts +22 -0
  181. package/src/session/auth-broker-config.ts +10 -3
  182. package/src/session/blob-store.ts +915 -24
  183. package/src/session/internal/managed-session-scope.ts +44 -6
  184. package/src/session/internal/managed-session-storage.ts +48 -6
  185. package/src/session/session-manager.ts +1614 -435
  186. package/src/session/session-storage.ts +9 -1
  187. package/src/session/streaming-output.ts +238 -68
  188. package/src/setup/credential-import.ts +75 -13
  189. package/src/skill-state/active-state.ts +32 -0
  190. package/src/skill-state/workflow-hud.ts +17 -0
  191. package/src/skill-state/workflow-mutation-guard.ts +496 -2
  192. package/src/task/executor.ts +122 -39
  193. package/src/task/index.ts +23 -14
  194. package/src/task/provider-retry-status.ts +16 -0
  195. package/src/task/receipt.ts +23 -7
  196. package/src/task/render.ts +6 -2
  197. package/src/task/types.ts +108 -0
  198. package/src/tools/ask-answer-registry.ts +12 -6
  199. package/src/tools/ask.ts +86 -55
  200. package/src/tools/ast-edit.ts +1 -0
  201. package/src/tools/ast-grep.ts +1 -0
  202. package/src/tools/bash-interactive.ts +8 -3
  203. package/src/tools/bash.ts +503 -60
  204. package/src/tools/find.ts +1 -0
  205. package/src/tools/image-gen.ts +29 -5
  206. package/src/tools/index.ts +4 -0
  207. package/src/tools/output-meta.ts +108 -14
  208. package/src/tools/path-utils.ts +3 -2
  209. package/src/tools/read.ts +18 -0
  210. package/src/tools/review.ts +5 -7
  211. package/src/tools/search.ts +1 -0
  212. package/src/tools/subagent-render.ts +6 -2
  213. package/src/tools/subagent.ts +6 -0
  214. package/src/tools/telegram-send.ts +6 -3
  215. package/src/utils/gh.ts +39 -0
  216. package/src/utils/image-resize.ts +3 -0
  217. package/src/web/search/providers/anthropic.ts +4 -4
  218. package/src/web/search/providers/kimi.ts +15 -5
  219. package/src/web/search/providers/searxng.ts +47 -4
  220. package/src/web/search/providers/xai.ts +7 -2
  221. package/dist/types/gjc-runtime/ultragoal-pipeline.d.ts +0 -23
  222. package/src/defaults/gjc/skills/ultragoal/pipeline-validation-contracts.md +0 -30
  223. package/src/gjc-runtime/ultragoal-pipeline.ts +0 -306
@@ -0,0 +1,64 @@
1
+ import type { GjcBundleIdentity, GjcBundleSummary, GjcInstallResult, GjcLifecycleResult, GjcPluginRegistryEntry, GjcPluginRegistrySource, GjcPluginScope, GjcReviewedUpdateToken, GjcToggleResult, GjcUpdateApplyResult, GjcUpdatePreview } from "./types";
2
+ /**
3
+ * GJC bundle lifecycle service.
4
+ *
5
+ * This module is the ONLY policy and persistence writer for GJC bundles: fresh
6
+ * install, update preview/apply, bundle enable/disable, and surface
7
+ * enable/disable. Callers (CLI, Settings) never touch the registry writers or
8
+ * the installer transaction directly.
9
+ */
10
+ export interface GjcLifecycleContext {
11
+ cwd: string;
12
+ }
13
+ export declare function redactSourceLocator(source: GjcPluginRegistrySource): string;
14
+ /** Safe, redacted DTO for one installed bundle. */
15
+ export declare function toBundleSummary(entry: GjcPluginRegistryEntry): GjcBundleSummary;
16
+ /**
17
+ * Rebuild the exact locator an update must re-resolve from. A git ref is stored
18
+ * separately from the URI, so re-resolving the bare URI would silently drop the
19
+ * reviewed branch or tag and update from the default branch instead.
20
+ */
21
+ declare function storedSourceLocator(source: GjcPluginRegistrySource): string;
22
+ /** Exposed for locator-reconstruction tests; not part of the lifecycle API. */
23
+ export declare const storedSourceLocatorForTest: typeof storedSourceLocator;
24
+ /** Exposed so a test can pin parity with the installer's source predicates. */
25
+ export declare const isLocalDirectorySourceForTest: typeof isLocalDirectorySource;
26
+ /** All installed bundles across both scopes, deterministically ordered. */
27
+ export declare function listGjcBundles(ctx: GjcLifecycleContext): Promise<GjcBundleSummary[]>;
28
+ /** One bundle by exact (scope, name) identity. Opposite scope never matches. */
29
+ export declare function getGjcBundle(ctx: GjcLifecycleContext, identity: GjcBundleIdentity): Promise<GjcLifecycleResult<GjcBundleSummary>>;
30
+ /**
31
+ * True only for strings the installer would treat as a local path rather than
32
+ * a remote locator. This deliberately mirrors the installer's own `looksLikeGit`
33
+ * predicate: if the two ever disagreed, a remote locator could be read as a
34
+ * relative path and shadowed by a local directory of the same shape.
35
+ */
36
+ declare function isLocalDirectorySource(source: string): boolean;
37
+ /**
38
+ * Fresh install only. An existing target in the same scope is create-only and
39
+ * is refused identically with or without force; upgrading is a separate,
40
+ * scope-qualified operation.
41
+ */
42
+ export declare function installGjcBundle(ctx: GjcLifecycleContext, scope: GjcPluginScope, source: string): Promise<GjcLifecycleResult<GjcInstallResult>>;
43
+ /**
44
+ * Re-resolve the stored source descriptor and describe what an update would do.
45
+ * The returned token binds the candidate, the exact installed baseline, and the
46
+ * deterministic decision context; apply is a compare-and-swap on all three.
47
+ */
48
+ export declare function previewGjcBundleUpdate(ctx: GjcLifecycleContext, identity: GjcBundleIdentity): Promise<GjcLifecycleResult<GjcUpdatePreview>>;
49
+ /**
50
+ * Apply a previously reviewed update. Any drift in the candidate bytes, the
51
+ * installed baseline, or the decision context returns a typed stale error with
52
+ * zero mutation.
53
+ */
54
+ export declare function applyGjcBundleUpdate(ctx: GjcLifecycleContext, token: GjcReviewedUpdateToken): Promise<GjcLifecycleResult<GjcUpdateApplyResult>>;
55
+ /**
56
+ * Enable or disable a whole bundle. Deterministic quarantine blocks enabling;
57
+ * disabling is always allowed so operators can always de-escalate.
58
+ */
59
+ export declare function setGjcBundleEnabled(ctx: GjcLifecycleContext, identity: GjcBundleIdentity, enabled: boolean): Promise<GjcLifecycleResult<GjcToggleResult>>;
60
+ /** Enable or disable one surface of a bundle by its stable extension ID. */
61
+ export declare function setGjcBundleSurfaceEnabled(ctx: GjcLifecycleContext, identity: GjcBundleIdentity, surfaceId: string, enabled: boolean): Promise<GjcLifecycleResult<GjcToggleResult>>;
62
+ /** Deterministic activation generation for the current persisted state. */
63
+ export declare function currentActivationFingerprint(ctx: GjcLifecycleContext): Promise<string>;
64
+ export {};
@@ -0,0 +1,67 @@
1
+ import type { GjcBundleIdentity, GjcRuntimeFinding, GjcRuntimeSnapshot, GjcRuntimeSnapshotState } from "./types";
2
+ /**
3
+ * Deterministic numeric activation generation for an activation fingerprint.
4
+ *
5
+ * Equal activation inputs yield an equal generation, so a consumer holding a
6
+ * snapshot can tell whether it still describes the state it is rendering.
7
+ * Derived from the fingerprint's leading hex so it stays inside the safe
8
+ * integer range.
9
+ */
10
+ export declare function gjcActivationGenerationFor(activationFingerprint: string): number;
11
+ /**
12
+ * Caller-owned accumulator for scope-qualified runtime evidence.
13
+ *
14
+ * Producers (loaders, adapters, validators) hand findings to an accumulator
15
+ * they were given; they never publish. Exactly one coordinator publishes a
16
+ * complete generation snapshot, and consumers merge it only when the identity
17
+ * and generation match.
18
+ */
19
+ export declare class GjcRuntimeFindingAccumulator {
20
+ readonly generation: number;
21
+ private readonly findings;
22
+ constructor(generation: number);
23
+ add(finding: GjcRuntimeFinding): void;
24
+ addAll(findings: readonly GjcRuntimeFinding[]): void;
25
+ /** Sorted, de-duplicated snapshot for the generation this accumulator owns. */
26
+ snapshot(): GjcRuntimeSnapshot;
27
+ }
28
+ /** Read-only view of the most recently published complete generation. */
29
+ export interface GjcRuntimeSnapshotProvider {
30
+ current(): GjcRuntimeSnapshotState;
31
+ }
32
+ /**
33
+ * Single-writer publisher for runtime evidence.
34
+ *
35
+ * Passes can overlap: the session's prompt rebuild is re-entrant, so a second
36
+ * pass may start while a first is still awaiting its producers. Publication is
37
+ * therefore fenced by a monotonic epoch. A pass reserves an epoch when it
38
+ * begins, which immediately retires whatever was published before, and its
39
+ * later publish is accepted only if no newer pass has reserved since. A slow or
40
+ * failed older pass can never overwrite a newer one, and an incomplete pass
41
+ * simply never publishes, leaving consumers at `unavailable`.
42
+ */
43
+ export declare class GjcRuntimeSnapshotStore implements GjcRuntimeSnapshotProvider {
44
+ private state;
45
+ private epoch;
46
+ /**
47
+ * Begin a pass. Retires the current snapshot and returns the epoch token the
48
+ * caller must present to publish.
49
+ */
50
+ beginPass(): number;
51
+ /** Publish only if `epoch` is still the newest reserved pass. */
52
+ publish(snapshot: GjcRuntimeSnapshot, epoch?: number): void;
53
+ invalidate(): void;
54
+ current(): GjcRuntimeSnapshotState;
55
+ }
56
+ /**
57
+ * Findings for one bundle, but only when the snapshot is current AND describes
58
+ * the exact generation the consumer is rendering. Missing provider, mismatched
59
+ * generation, or unavailable state resolve to `unavailable` — never to a
60
+ * silently empty "clear" result.
61
+ */
62
+ export declare function findingsForBundle(provider: GjcRuntimeSnapshotProvider | undefined, identity: GjcBundleIdentity, expectedGeneration: number): {
63
+ status: "unavailable";
64
+ } | {
65
+ status: "current";
66
+ findings: GjcRuntimeFinding[];
67
+ };
@@ -1,4 +1,4 @@
1
- import type { GjcPluginLoadErrorCode, GjcPluginRegistryEntry } from "./types";
1
+ import type { GjcBundleIdentity, GjcPluginLoadErrorCode, GjcPluginRegistryEntry } from "./types";
2
2
  /**
3
3
  * Session-start validation: the registry is the collision authority. Capability
4
4
  * provider output is supplied as EVIDENCE only; plugin surfaces are never
@@ -16,6 +16,8 @@ export interface SessionCapabilityEvidence {
16
16
  appendixIds?: Iterable<string>;
17
17
  }
18
18
  export interface SessionQuarantine {
19
+ /** Scope-qualified canonical target this finding belongs to. */
20
+ identity: GjcBundleIdentity;
19
21
  plugin: string;
20
22
  surfaceId: string;
21
23
  code: GjcPluginLoadErrorCode;
@@ -218,3 +218,127 @@ export interface GjcPluginRegistry {
218
218
  * disabledSurfaceIds, and quarantine bookkeeping.
219
219
  */
220
220
  export type GjcPluginSurfaceExtensionId = string;
221
+ /** Canonical GJC bundle identity: kind is fixed, target is (scope, name). */
222
+ export declare const GJC_BUNDLE_KIND = "gjc-bundle";
223
+ export interface GjcBundleIdentity {
224
+ kind: typeof GJC_BUNDLE_KIND;
225
+ scope: GjcPluginScope;
226
+ name: string;
227
+ }
228
+ /** Source descriptor exposed to CLI/Settings: never carries raw locator secrets. */
229
+ export interface GjcBundleSafeSource {
230
+ kind: GjcPluginSourceKind;
231
+ /** Redacted display locator (host + path only; no userinfo/query/fragment). */
232
+ display: string;
233
+ /** Conservative safe git ref, omitted when the stored value is unsafe. */
234
+ ref?: string;
235
+ /** Hex-only revision identifier, omitted when the stored value is unsafe. */
236
+ sha?: string;
237
+ resolvedAt: string;
238
+ /** True when this source kind supports re-resolution during update. */
239
+ updatable: boolean;
240
+ /** Present only when updatable is false. */
241
+ unsupportedReason?: string;
242
+ }
243
+ export interface GjcBundleSurfaceSummary {
244
+ extensionId: string;
245
+ kind: "tool" | "hook" | "mcp" | "system-appendix" | "agent-appendix" | "subskill";
246
+ name: string;
247
+ /** Persisted user intent (registry disabledSurfaceIds). */
248
+ enabled: boolean;
249
+ /** Deterministic quarantine derived from persisted registry state only. */
250
+ quarantined: boolean;
251
+ quarantineCode?: GjcPluginLoadErrorCode;
252
+ }
253
+ /** Installed-bundle DTO shared by CLI and Settings. Contains no raw locators. */
254
+ export interface GjcBundleSummary {
255
+ identity: GjcBundleIdentity;
256
+ version: string;
257
+ description?: string;
258
+ enabled: boolean;
259
+ source: GjcBundleSafeSource;
260
+ installedAt: string;
261
+ updatedAt: string;
262
+ manifestHash: string;
263
+ /** Deterministic fingerprint of the exact installed target. */
264
+ targetFingerprint: string;
265
+ surfaces: GjcBundleSurfaceSummary[];
266
+ /** True when any deterministic quarantine blocks enablement. */
267
+ quarantined: boolean;
268
+ }
269
+ /**
270
+ * Host-derived token binding an update preview to the exact candidate, the
271
+ * exact installed baseline, and the deterministic decision context. Apply is a
272
+ * compare-and-swap against all three fingerprints.
273
+ */
274
+ export interface GjcReviewedUpdateToken {
275
+ identity: GjcBundleIdentity;
276
+ candidateFingerprint: string;
277
+ baselineFingerprint: string;
278
+ decisionContextFingerprint: string;
279
+ reviewedAt: string;
280
+ }
281
+ export type GjcLifecycleErrorCode = "already_installed_use_upgrade" | "not_installed" | "identity_mismatch" | "stale_candidate" | "stale_baseline" | "stale_decision_context" | "source_unsupported" | "source_unavailable" | "quarantined" | "surface_unknown" | "invalid_target";
282
+ export interface GjcLifecycleError {
283
+ code: GjcLifecycleErrorCode;
284
+ /** Sanitized operator-facing message; never contains raw locators or causes. */
285
+ message: string;
286
+ /** Safe scoped recovery hint (e.g. the exact command to run instead). */
287
+ recovery?: string;
288
+ }
289
+ export type GjcLifecycleResult<T> = {
290
+ ok: true;
291
+ value: T;
292
+ } | {
293
+ ok: false;
294
+ error: GjcLifecycleError;
295
+ };
296
+ export interface GjcUpdatePreview {
297
+ identity: GjcBundleIdentity;
298
+ current: GjcBundleSummary;
299
+ candidateVersion: string;
300
+ candidateManifestHash: string;
301
+ /** Surface IDs added, removed, or retained by this candidate. */
302
+ addedSurfaceIds: string[];
303
+ removedSurfaceIds: string[];
304
+ retainedSurfaceIds: string[];
305
+ changed: boolean;
306
+ token: GjcReviewedUpdateToken;
307
+ }
308
+ export type GjcUpdateApplyStatus = "updated" | "unchanged";
309
+ export interface GjcUpdateApplyResult {
310
+ status: GjcUpdateApplyStatus;
311
+ summary: GjcBundleSummary;
312
+ /** Number of filesystem remnants that could not be removed after a successful swap. */
313
+ remnantCount: number;
314
+ }
315
+ export interface GjcInstallResult {
316
+ status: "installed";
317
+ summary: GjcBundleSummary;
318
+ }
319
+ export interface GjcToggleResult {
320
+ summary: GjcBundleSummary;
321
+ /** False when the requested state already matched (no persisted mutation). */
322
+ mutated: boolean;
323
+ }
324
+ /**
325
+ * Scope-qualified runtime evidence emitted by producers. Producers never
326
+ * publish; the session coordinator accumulates one complete generation.
327
+ */
328
+ export interface GjcRuntimeFinding {
329
+ identity: GjcBundleIdentity;
330
+ surfaceId: string;
331
+ code: GjcPluginLoadErrorCode;
332
+ message: string;
333
+ }
334
+ export interface GjcRuntimeSnapshot {
335
+ /** Monotonic activation generation this snapshot describes. */
336
+ generation: number;
337
+ findings: GjcRuntimeFinding[];
338
+ }
339
+ export type GjcRuntimeSnapshotState = {
340
+ status: "unavailable";
341
+ } | {
342
+ status: "current";
343
+ snapshot: GjcRuntimeSnapshot;
344
+ };
@@ -87,6 +87,7 @@ export interface TmuxLaunchPlan {
87
87
  createdServerIdentity?: {
88
88
  pid: number;
89
89
  startTime: string;
90
+ pidProven?: boolean;
90
91
  };
91
92
  isPsmux: boolean;
92
93
  platform: NodeJS.Platform;
@@ -33,6 +33,13 @@ export declare const PLANNING_STUCK_MARKER = "PLANNING-STUCK";
33
33
  export declare const RALPLAN_DEFAULT_MAX_REVIEW_PASSES_PER_LANE = 1;
34
34
  /** Inclusive upper bound for `gjc.ralplan.maxReviewPassesPerLane` settings overrides. */
35
35
  export declare const RALPLAN_MAX_REVIEW_PASSES_PER_LANE_LIMIT = 10;
36
+ export type RalplanAutoHandoffTarget = "off" | "ultragoal" | "team";
37
+ export interface RalplanAutoHandoffResolution {
38
+ configuredTarget: RalplanAutoHandoffTarget;
39
+ effectiveTarget: RalplanAutoHandoffTarget;
40
+ degradationReason: string | null;
41
+ source: string;
42
+ }
36
43
  export type RalplanIterationCapDecision = {
37
44
  allowed: true;
38
45
  currentIterations: number;
@@ -128,6 +135,16 @@ export declare function resolveRalplanMaxIterations(cwd: string): Promise<{
128
135
  maxIterations: number;
129
136
  source: string;
130
137
  }>;
138
+ type RalplanAutoHandoffOptions = {
139
+ planningStuck?: boolean;
140
+ teamAvailabilityProbe?: () => {
141
+ available: true;
142
+ } | {
143
+ available: false;
144
+ reason: string;
145
+ };
146
+ };
147
+ export declare function resolveRalplanAutoHandoff(cwd: string, options?: RalplanAutoHandoffOptions): Promise<RalplanAutoHandoffResolution>;
131
148
  /** Resolve the per-lane review-pass budget with project-over-user precedence. */
132
149
  export declare function resolveRalplanMaxReviewPassesPerLane(cwd: string): Promise<{
133
150
  maxReviewPassesPerLane: number;
@@ -135,3 +152,4 @@ export declare function resolveRalplanMaxReviewPassesPerLane(cwd: string): Promi
135
152
  }>;
136
153
  export declare function isRalplanArtifactWriteInvocation(args: readonly string[]): boolean;
137
154
  export declare function runNativeRalplanCommand(args: string[], cwd?: string): Promise<RalplanCommandResult>;
155
+ export {};
@@ -2,7 +2,7 @@ import type { GjcTeamConfig, GjcTeamSnapshot, GjcTeamStartOptions, GjcTeamTask,
2
2
  /** Launch-specific option wiring kept separate from runtime dispatch. */
3
3
  export declare function withTeamLaunchTransport(options: GjcTeamStartOptions, mailboxDeliveryTransport: GjcTeamStartOptions["mailboxDeliveryTransport"]): GjcTeamStartOptions;
4
4
  /** @internal Exported for unit tests. */
5
- export declare function buildWorkerCommand(config: GjcTeamConfig, worker: GjcTeamWorker, platform?: NodeJS.Platform, promptOverride?: string): string;
5
+ export declare function buildWorkerCommand(config: GjcTeamConfig, worker: GjcTeamWorker, platform?: NodeJS.Platform, promptOverride?: string, env?: NodeJS.ProcessEnv): string;
6
6
  interface GjcTmuxBinary {
7
7
  command: string;
8
8
  isPsmux: boolean;
@@ -201,6 +201,13 @@ export interface GjcWorkerIntegrationAttemptOptions {
201
201
  signal?: AbortSignal;
202
202
  }
203
203
  export declare const GJC_TEAM_API_OPERATIONS: readonly ["send-message", "broadcast", "mailbox-list", "mailbox-mark-delivered", "mailbox-mark-notified", "notification-list", "notification-read", "notification-replay", "notification-mark-pane-attempt", "worker-startup-ack", "create-task", "read-task", "list-tasks", "update-task", "claim-task", "transition-task-status", "transition-task", "release-task-claim", "read-config", "read-manifest", "read-worker-status", "update-worker-status", "read-worker-heartbeat", "recover-stale-claims", "update-worker-heartbeat", "read-worker-memory-guard", "update-worker-memory-guard", "apply-worker-memory-guard", "write-worker-inbox", "write-worker-identity", "append-event", "read-events", "read-traces", "await-event", "write-shutdown-request", "read-shutdown-ack", "read-monitor-snapshot", "write-monitor-snapshot", "read-task-approval", "write-task-approval"];
204
+ export type GjcTeamApiOperation = (typeof GJC_TEAM_API_OPERATIONS)[number];
205
+ export declare class UnknownGjcTeamApiOperationError extends Error {
206
+ readonly code = "unknown_team_api_operation";
207
+ readonly operation: string;
208
+ readonly suggestions: readonly string[];
209
+ constructor(operation: string, suggestions: readonly string[]);
210
+ }
204
211
  export interface GjcTeamRuntimeTestSeams {
205
212
  nowMs?: () => number;
206
213
  continuationTmuxDispatch?: (command: string, args: readonly string[]) => {
@@ -225,6 +232,16 @@ export declare function resolveWorkerWorktreePath(input: {
225
232
  platform: NodeJS.Platform;
226
233
  isPsmux: boolean;
227
234
  }): string;
235
+ /**
236
+ * Check whether the current process can launch a team without changing tmux state.
237
+ * Unlike the launch path, this never adopts or tags an unmanaged tmux session.
238
+ */
239
+ export declare function probeGjcTeamAvailability(env?: NodeJS.ProcessEnv): {
240
+ available: true;
241
+ } | {
242
+ available: false;
243
+ reason: string;
244
+ };
228
245
  export declare function resolveGjcWorkerCommand(cwd?: string, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, argv?: string[], execPath?: string): string;
229
246
  export { buildWorkerCommand } from "./team-launch";
230
247
  export type GjcWorkerCheckpointClassification = {
@@ -257,6 +274,8 @@ export declare function requestGjcWorkerIntegrationAttempt(cwd?: string, env?: N
257
274
  export declare function buildTeamHudSummary(snapshot: GjcTeamSnapshot, latestEvent?: GjcTeamEvent, latestMessage?: GjcTeamMailboxMessage): Promise<WorkflowHudSummary>;
258
275
  export declare function monitorGjcTeam(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamSnapshot>;
259
276
  export declare function listGjcTeams(cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamSnapshot[]>;
277
+ /** Positive stale windows are clamped so a worker can publish strictly before expiry. */
278
+ export declare function parseHeartbeatStaleMs(env: NodeJS.ProcessEnv): number;
260
279
  export declare function shutdownGjcTeam(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamSnapshot>;
261
280
  export declare function listGjcTeamTasks(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamTask[]>;
262
281
  export declare function readGjcTeamTask(teamName: string, taskId: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamTask>;
@@ -278,6 +297,12 @@ export declare const readGjcWorkerStatus: (teamName: string, worker: string, cwd
278
297
  export declare function updateGjcWorkerStatus(teamName: string, worker: string, status: GjcWorkerStatusState, cwd?: string, env?: NodeJS.ProcessEnv, currentTaskId?: string, reason?: string): Promise<WorkerStatusFile>;
279
298
  export declare const readGjcWorkerHeartbeat: (teamName: string, worker: string, cwd?: string, env?: NodeJS.ProcessEnv) => Promise<WorkerHeartbeatFile | null>;
280
299
  export declare function updateGjcWorkerHeartbeat(teamName: string, worker: string, heartbeat: WorkerHeartbeatFile, cwd?: string, env?: NodeJS.ProcessEnv): Promise<WorkerHeartbeatFile>;
300
+ /**
301
+ * Refresh liveness without discarding metadata written by other heartbeat
302
+ * producers. The read/merge/write sequence shares the team mutation fence with
303
+ * CLI heartbeat updates, so a runtime tick cannot overwrite a newer turn count.
304
+ */
305
+ export declare function refreshGjcWorkerHeartbeat(teamName: string, worker: string, pid: number, cwd?: string, env?: NodeJS.ProcessEnv): Promise<WorkerHeartbeatFile>;
281
306
  export declare function writeGjcWorkerInbox(teamName: string, worker: string, content: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<{
282
307
  path: string;
283
308
  }>;
@@ -0,0 +1,43 @@
1
+ import { type WorkerHeartbeatFile } from "./team-runtime";
2
+ export interface GjcTeamWorkerIdentity {
3
+ teamName: string;
4
+ workerId: string;
5
+ }
6
+ /** Resolves the team identity injected into a worker pane by `gjc team` startup. */
7
+ export declare function resolveGjcTeamWorkerIdentity(env?: NodeJS.ProcessEnv): GjcTeamWorkerIdentity | undefined;
8
+ /** Refresh cadence derived from the leader's stale window; `0` disables publishing. */
9
+ export declare function resolveGjcTeamWorkerHeartbeatIntervalMs(env?: NodeJS.ProcessEnv): number;
10
+ /**
11
+ * Publish one runtime-owned heartbeat for the worker this process is running as.
12
+ * Returns `undefined` when the process is not a team worker.
13
+ *
14
+ * `turn_count` and process-incarnation metadata are merged under the same
15
+ * mutation fence used by CLI heartbeat updates.
16
+ */
17
+ export declare function writeGjcTeamWorkerRuntimeHeartbeat(cwd?: string, env?: NodeJS.ProcessEnv): Promise<WorkerHeartbeatFile | undefined>;
18
+ export interface GjcTeamWorkerHeartbeatReporterOptions {
19
+ write: () => Promise<void>;
20
+ intervalMs: number;
21
+ }
22
+ /**
23
+ * Publishes a worker heartbeat while a turn is in flight.
24
+ *
25
+ * Writes never overlap; a slow or failing write is logged and skipped rather
26
+ * than queued, because only the most recent record matters. The timer is
27
+ * unreferenced so it can never hold the process open.
28
+ */
29
+ export declare class GjcTeamWorkerHeartbeatReporter {
30
+ #private;
31
+ constructor(options: GjcTeamWorkerHeartbeatReporterOptions);
32
+ /** Reporter for the current process, or `undefined` when it is not a team worker. */
33
+ static forProcess(cwd: () => string, env?: NodeJS.ProcessEnv): GjcTeamWorkerHeartbeatReporter | undefined;
34
+ get isRunning(): boolean;
35
+ /** Publish immediately, then keep publishing until {@link stop} or {@link dispose}. */
36
+ start(): void;
37
+ /** Stop periodic publishing after one final record, so the idle stamp is fresh. */
38
+ stop(): void;
39
+ /** Await the write in flight, if any. */
40
+ flush(): Promise<void>;
41
+ /** Permanently stop publishing. Idempotent. */
42
+ dispose(): void;
43
+ }
@@ -31,6 +31,16 @@ export interface TmuxServerProof {
31
31
  startTime?: string;
32
32
  cgroup?: CgroupInfo;
33
33
  sessionNames?: string[];
34
+ /**
35
+ * Whether `pid` is kernel-proved evidence about the live tmux server.
36
+ *
37
+ * Only Linux can prove a server PID (`/proc` + cgroup classification), so
38
+ * probes on other platforms may report a placeholder PID with this flag set
39
+ * to `false`. Guards must not build a `#{pid}` predicate from an unproven
40
+ * PID: no live tmux server can ever satisfy it. Omitted means proven, which
41
+ * keeps every probe that reads a real `#{pid}` unchanged.
42
+ */
43
+ pidProven?: boolean;
34
44
  }
35
45
  export interface PlanRequest {
36
46
  schema_version: 1;
@@ -5,37 +5,6 @@ export { CRITIC_GATE_HARD_STOP_EVENT, CRITIC_GATE_OVERRIDE_EVENT, CRITIC_VERDICT
5
5
  export { captureUltragoalRecoverySnapshot, parseStrictTerminalTranscript, persistUltragoalRecoveryDecision, planUltragoalOwnerLossRecovery, type UltragoalOwnerLossReceipt, type UltragoalRecoveryBinding, type UltragoalRecoveryDecision, type UltragoalRecoverySnapshot, validateOwnerLossBinding, validateRawUltragoalEvidence, validateRecoveryAdmission, validateRecoveryPath, } from "./ultragoal-owner-loss-recovery";
6
6
  export type UltragoalGjcGoalMode = "aggregate" | "per-story";
7
7
  export type UltragoalGoalStatus = "pending" | "active" | "complete" | "failed" | "blocked" | "review_blocked" | "superseded";
8
- export type UltragoalPipelineMetadataSource = "original_plan_graph" | "legacy_brief_only" | "steering";
9
- export type UltragoalPipelineOverlapState = "none" | "open" | "joined_clean" | "blocked_disjoint_continue" | "quarantine_required" | "rebaseline_complete";
10
- export interface UltragoalPipelineTargets extends JsonObject {
11
- files: string[];
12
- surfaces: string[];
13
- }
14
- export interface UltragoalPipelineMetadata extends JsonObject {
15
- schemaVersion: 1;
16
- goalId: string;
17
- source: UltragoalPipelineMetadataSource;
18
- eligible: boolean;
19
- dependsOn: string[];
20
- independentOf: string[];
21
- targets: UltragoalPipelineTargets;
22
- metadataHash: string;
23
- overlap: UltragoalPipelineOverlapState;
24
- overlapId?: string;
25
- priorGoalId?: string;
26
- nextGoalId?: string;
27
- blockerFootprints?: UltragoalPipelineTargets[];
28
- invalidationReason?: string;
29
- invalidatedAt?: string;
30
- }
31
- export interface UltragoalGoalMetadataInput {
32
- schemaVersion: 1;
33
- goalId: string;
34
- source: UltragoalPipelineMetadataSource;
35
- dependsOn?: string[];
36
- independentOf?: string[];
37
- targets?: Partial<UltragoalPipelineTargets>;
38
- }
39
8
  export interface UltragoalValidationBatchMetadata extends JsonObject {
40
9
  schemaVersion: 1;
41
10
  batchId: string;
@@ -50,31 +19,6 @@ export interface UltragoalValidationBatchInput {
50
19
  memberIds: string[];
51
20
  finalGoalId: string;
52
21
  }
53
- export interface UltragoalPipelineOverlapHandles extends JsonObject {
54
- review: JsonObject;
55
- qa: JsonObject;
56
- implementation: JsonObject;
57
- }
58
- export interface UltragoalPipelineOverlapReceipt extends JsonObject {
59
- ok: true;
60
- event: string;
61
- overlap_id: string;
62
- prior_goal_id: string;
63
- next_goal_id?: string;
64
- goal_id?: string;
65
- status?: UltragoalPipelineOverlapState;
66
- next_goal_status?: UltragoalGoalStatus;
67
- goals_path: string;
68
- ledger_path: string;
69
- }
70
- export type UltragoalPipelineLedgerEventName = "pipeline_overlap_started" | "pipeline_overlap_joined" | "pipeline_overlap_blocked" | "pipeline_overlap_quarantined" | "pipeline_overlap_rebaselined";
71
- export interface UltragoalPipelineLedgerEvent extends UltragoalLedgerEvent {
72
- event: UltragoalPipelineLedgerEventName;
73
- schemaVersion: 1;
74
- overlapId: string;
75
- priorGoalId: string;
76
- nextGoalId: string;
77
- }
78
22
  export interface UltragoalGoal {
79
23
  id: string;
80
24
  title: string;
@@ -87,7 +31,6 @@ export interface UltragoalGoal {
87
31
  evidence?: string;
88
32
  steering?: Record<string, unknown>;
89
33
  completionVerification?: UltragoalCompletionVerification;
90
- pipelineMetadata?: UltragoalPipelineMetadata;
91
34
  validationBatch?: UltragoalValidationBatchMetadata;
92
35
  }
93
36
  export interface UltragoalPlan {
@@ -204,7 +147,6 @@ export interface UltragoalStatusSummary {
204
147
  nudgeRemaining?: number;
205
148
  nudgeGoalId?: string;
206
149
  nudgeTargetKind?: UltragoalNudgeTargetKind;
207
- pipelineOverlap?: JsonObject;
208
150
  }
209
151
  export interface UltragoalCommandResult {
210
152
  reviewBlockerGoalIds?: string[];
@@ -267,22 +209,6 @@ export declare function recordUltragoalNudgeIfBudgetRemaining(input: {
267
209
  export declare function writePlan(cwd: string, plan: UltragoalPlan, sessionId?: string | null): Promise<void>;
268
210
  export declare function nonEmptyString(value: unknown): string | null;
269
211
  export declare function stringArray(value: unknown): string[] | null;
270
- export declare function hashPipelineMetadata(metadata: Omit<UltragoalPipelineMetadata, "metadataHash">): string;
271
- export declare function validateValidationBatchPipelineExclusion(goal: UltragoalGoal): void;
272
- export declare function targetsAreDisjoint(left: UltragoalPipelineTargets, right: UltragoalPipelineTargets): boolean;
273
- export declare function targetsOverlap(left: UltragoalPipelineTargets, right: UltragoalPipelineTargets): boolean;
274
- export declare function requireNonEmptyPipelineTargets(value: unknown, fieldName: string): UltragoalPipelineTargets;
275
- export declare function collectPipelineBlockerFootprints(result: JsonObject, fieldName: string): UltragoalPipelineTargets[];
276
- export declare function pipelinePeer(plan: UltragoalPlan, metadata: UltragoalPipelineMetadata): UltragoalGoal | undefined;
277
- export declare function handleIdsFromValue(value: JsonObject | JsonObject[], fieldName: string): string[];
278
- export declare function resultHandleIds(value: JsonObject, fieldName: string): string[];
279
- export declare function requireCoveredHandles(expected: readonly string[], actual: readonly string[], fieldName: string): void;
280
- export declare function requireFreshPipelineMetadata(goal: UltragoalGoal): UltragoalPipelineMetadata;
281
- export declare function openPipelineOverlap(plan: UltragoalPlan): {
282
- prior: UltragoalGoal;
283
- next: UltragoalGoal;
284
- overlapId: string;
285
- } | null;
286
212
  export declare function readUltragoalPlan(cwd: string, sessionId?: string | null): Promise<UltragoalPlan | null>;
287
213
  export declare function getUltragoalStatus(cwd: string, sessionId?: string | null): Promise<UltragoalStatusSummary>;
288
214
  export declare function buildUltragoalHudSummary(summary: UltragoalStatusSummary, latestLedger?: UltragoalLedgerEvent): WorkflowHudSummary;
@@ -291,8 +217,6 @@ export declare function createUltragoalPlan(input: {
291
217
  brief: string;
292
218
  gjcGoalMode?: UltragoalGjcGoalMode;
293
219
  sessionId?: string | null;
294
- goalMetadata?: UltragoalGoalMetadataInput[];
295
- goalMetadataJson?: string;
296
220
  validationBatches?: UltragoalValidationBatchInput[];
297
221
  validationBatchJson?: string;
298
222
  }): Promise<UltragoalPlan>;
@@ -304,10 +228,6 @@ export interface UltragoalRunCompletionState {
304
228
  hasBlockers: boolean;
305
229
  needsFinalAggregateReceipt: boolean;
306
230
  }
307
- export declare function requireJsonObjectValue(value: unknown, fieldName: string): JsonObject;
308
- export declare function requireJsonObjectOrArrayValue(value: unknown, fieldName: string): JsonObject | JsonObject[];
309
- import { joinUltragoalPipelineOverlap, rebaselineUltragoalPipelineOverlap, startUltragoalPipelineOverlap } from "./ultragoal-pipeline";
310
- export { joinUltragoalPipelineOverlap, rebaselineUltragoalPipelineOverlap, startUltragoalPipelineOverlap };
311
231
  export declare function getUltragoalRunCompletionState(plan: UltragoalPlan, options?: {
312
232
  retryFailed?: boolean;
313
233
  }): UltragoalRunCompletionState;
@@ -343,6 +263,22 @@ export declare function startNextUltragoalGoal(input: {
343
263
  }>;
344
264
  export declare function qualityGateObject(value: unknown): JsonObject | null;
345
265
  export declare function nonEmptyStringArray(value: unknown): string[] | null;
266
+ export interface UltragoalQualityGateDiagnostic {
267
+ path: string;
268
+ code: string;
269
+ message: string;
270
+ }
271
+ /**
272
+ * Collects every quality-gate defect in one pass instead of throwing on the first.
273
+ * Authoring a valid gate is otherwise an edit/retry loop at the most expensive phase
274
+ * of a run (#3474). The aggregate error message keeps each individual message verbatim
275
+ * so existing callers and assertions that match on a single message still work, and
276
+ * `diagnostics` carries the machine-readable stable `path` + `code` pairs.
277
+ */
278
+ export declare class UltragoalQualityGateError extends Error {
279
+ readonly diagnostics: readonly UltragoalQualityGateDiagnostic[];
280
+ constructor(diagnostics: readonly UltragoalQualityGateDiagnostic[]);
281
+ }
346
282
  export declare function requireQualityGateObject(value: unknown, fieldName: string): JsonObject;
347
283
  export declare function requireObjectArray(value: unknown, fieldName: string): JsonObject[];
348
284
  export declare function requiredStringField(row: JsonObject, key: string, fieldName: string): string;
@@ -386,6 +322,21 @@ export declare function validateExecutorQaRedTeamEvidenceForReview(cwd: string,
386
322
  mode?: "review";
387
323
  changeSet?: UltragoalChangeSet;
388
324
  }): Promise<void>;
325
+ /**
326
+ * Read-only quality-gate validation (#3474). Applies exactly the same rules as
327
+ * `checkpoint --status complete` — including deferred-vs-boundary gate selection and
328
+ * artifact existence checks — but never touches `goals.json`, `ledger.jsonl`, or goal
329
+ * state, and reports every diagnostic in one run instead of the first failure.
330
+ */
331
+ export declare function validateUltragoalQualityGateReadOnly(input: {
332
+ cwd: string;
333
+ qualityGateJson: string;
334
+ goalId?: string;
335
+ sessionId?: string | null;
336
+ }): Promise<{
337
+ valid: boolean;
338
+ errors: readonly UltragoalQualityGateDiagnostic[];
339
+ }>;
389
340
  export declare function checkpointUltragoalGoal(input: {
390
341
  cwd: string;
391
342
  goalId: string;
@@ -1,5 +1,5 @@
1
1
  import { type Agent, type AgentSideConnection, type AuthenticateRequest, type AuthenticateResponse, type AvailableCommand, type ClientCapabilities, type CloseSessionRequest, type CloseSessionResponse, type DeleteSessionRequest, type DeleteSessionResponse, type ForkSessionRequest, type ForkSessionResponse, type InitializeRequest, type InitializeResponse, type ListSessionsRequest, type ListSessionsResponse, type LoadSessionRequest, type LoadSessionResponse, type NewSessionRequest, type NewSessionResponse, type PromptRequest, type PromptResponse, type ResumeSessionRequest, type ResumeSessionResponse, type SetSessionConfigOptionRequest, type SetSessionConfigOptionResponse, type SetSessionModeRequest, type SetSessionModeResponse } from "@agentclientprotocol/sdk";
2
- import { type AcpProviderRegistration, AcpSdkAdapter } from "../../sdk/acp";
2
+ import { type AcpProviderRegistration, type AcpReverseConnection, AcpSdkAdapter } from "../../sdk/acp";
3
3
  import type { AcpStartupOptions } from "./startup-options";
4
4
  export declare const ACP_BOOTSTRAP_RACE_GUARD_MS = 50;
5
5
  type JsonObject = Record<string, unknown>;
@@ -205,28 +205,11 @@ export declare function acpPromptPayload(blocks: PromptRequest["prompt"]): {
205
205
  export declare function acpRequestFailure(error: unknown): unknown;
206
206
  /** Registers a permission provider only when the ACP client requires prompts. */
207
207
  export declare function acpProviderRegistrations(capabilities: ClientCapabilities | undefined, env?: NodeJS.ProcessEnv): AcpProviderRegistration[];
208
+ export declare function createAcpReverseConnection(connection: AgentSideConnection, sessionId: string): AcpReverseConnection;
208
209
  /** Maps ACP permission handling to the session's canonical SDK policy. */
209
210
  export declare function applyAcpPermissionMode(adapter: Pick<AcpSdkAdapter, "control">, capabilities: ClientCapabilities | undefined, env?: NodeJS.ProcessEnv): Promise<void>;
210
211
  /** Applies CLI-provided ACP startup settings through SDK controls before session exposure. */
211
212
  export declare function applyAcpStartupOptions(adapter: Pick<AcpSdkAdapter, "setModel" | "control">, options: AcpStartupOptions | undefined): Promise<void>;
212
- /** ACP form elicitation uses the client-facing reverse surface without owning a session runtime. */
213
- export declare function createAcpExtensionUiContext(connection: AgentSideConnection, getSessionId: () => string, capabilities: ClientCapabilities | undefined): {
214
- select: (message: string, options: string[], dialog?: {
215
- signal?: AbortSignal;
216
- timeout?: number;
217
- onTimeout?: () => void;
218
- }) => Promise<string | undefined>;
219
- confirm: (message: string, detail?: string, dialog?: {
220
- signal?: AbortSignal;
221
- timeout?: number;
222
- onTimeout?: () => void;
223
- }) => Promise<boolean>;
224
- input: (message: string, placeholder?: string, dialog?: {
225
- signal?: AbortSignal;
226
- timeout?: number;
227
- onTimeout?: () => void;
228
- }) => Promise<string | undefined>;
229
- };
230
213
  /**
231
214
  * ACP is a pure SDK client. Session processes are created and resumed by the
232
215
  * broker, while all per-session operations use that session's authenticated SDK