@gajae-code/coding-agent 0.2.5 → 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.
- package/CHANGELOG.md +28 -0
- package/dist/types/async/job-manager.d.ts +91 -2
- package/dist/types/cli/args.d.ts +1 -1
- package/dist/types/commands/deep-interview.d.ts +3 -0
- package/dist/types/commands/harness.d.ts +37 -0
- package/dist/types/config/keybindings.d.ts +5 -0
- package/dist/types/config/settings-schema.d.ts +10 -4
- package/dist/types/config/settings.d.ts +2 -0
- package/dist/types/debug/crash-diagnostics.d.ts +45 -0
- package/dist/types/debug/runtime-gauges.d.ts +6 -0
- package/dist/types/deep-interview/render-middleware.d.ts +6 -0
- package/dist/types/eval/py/executor.d.ts +2 -0
- package/dist/types/eval/py/kernel.d.ts +2 -0
- package/dist/types/exec/bash-executor.d.ts +10 -0
- package/dist/types/extensibility/custom-tools/types.d.ts +1 -0
- package/dist/types/extensibility/extensions/types.d.ts +6 -0
- package/dist/types/extensibility/shared-events.d.ts +1 -0
- package/dist/types/gjc-runtime/cli-write-receipt.d.ts +24 -0
- package/dist/types/gjc-runtime/deep-interview-runtime.d.ts +1 -0
- package/dist/types/gjc-runtime/state-graph.d.ts +4 -0
- package/dist/types/gjc-runtime/state-migrations.d.ts +33 -0
- package/dist/types/gjc-runtime/state-renderer.d.ts +65 -0
- package/dist/types/gjc-runtime/state-runtime.d.ts +2 -0
- package/dist/types/gjc-runtime/state-schema.d.ts +317 -0
- package/dist/types/gjc-runtime/state-validation.d.ts +6 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +147 -0
- package/dist/types/gjc-runtime/team-runtime.d.ts +81 -7
- package/dist/types/gjc-runtime/workflow-command-ref.d.ts +43 -0
- package/dist/types/gjc-runtime/workflow-manifest.d.ts +54 -0
- package/dist/types/harness-control-plane/classifier.d.ts +13 -0
- package/dist/types/harness-control-plane/control-endpoint.d.ts +31 -0
- package/dist/types/harness-control-plane/finalize.d.ts +47 -0
- package/dist/types/harness-control-plane/frame-mapper.d.ts +29 -0
- package/dist/types/harness-control-plane/operate.d.ts +35 -0
- package/dist/types/harness-control-plane/owner.d.ts +46 -0
- package/dist/types/harness-control-plane/preserve.d.ts +19 -0
- package/dist/types/harness-control-plane/receipts.d.ts +88 -0
- package/dist/types/harness-control-plane/rpc-adapter.d.ts +66 -0
- package/dist/types/harness-control-plane/seams.d.ts +21 -0
- package/dist/types/harness-control-plane/session-lease.d.ts +65 -0
- package/dist/types/harness-control-plane/state-machine.d.ts +19 -0
- package/dist/types/harness-control-plane/storage.d.ts +53 -0
- package/dist/types/harness-control-plane/types.d.ts +162 -0
- package/dist/types/hooks/skill-keywords.d.ts +2 -1
- package/dist/types/hooks/skill-state.d.ts +23 -29
- package/dist/types/internal-urls/agent-protocol.d.ts +2 -2
- package/dist/types/internal-urls/artifact-protocol.d.ts +2 -2
- package/dist/types/internal-urls/registry-helpers.d.ts +8 -7
- package/dist/types/internal-urls/types.d.ts +4 -0
- package/dist/types/lsp/index.d.ts +10 -10
- package/dist/types/modes/bridge/auth.d.ts +12 -0
- package/dist/types/modes/bridge/bridge-client-bridge.d.ts +9 -0
- package/dist/types/modes/bridge/bridge-mode.d.ts +44 -0
- package/dist/types/modes/bridge/bridge-ui-context.d.ts +88 -0
- package/dist/types/modes/bridge/event-stream.d.ts +8 -0
- package/dist/types/modes/components/custom-editor.d.ts +6 -0
- package/dist/types/modes/components/hook-selector.d.ts +1 -0
- package/dist/types/modes/components/jobs-overlay-model.d.ts +31 -0
- package/dist/types/modes/components/jobs-overlay.d.ts +30 -0
- package/dist/types/modes/components/status-line/types.d.ts +2 -0
- package/dist/types/modes/components/status-line.d.ts +2 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +8 -0
- package/dist/types/modes/index.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +2 -0
- package/dist/types/modes/jobs-observer.d.ts +57 -0
- package/dist/types/modes/rpc/host-tools.d.ts +1 -16
- package/dist/types/modes/rpc/host-uris.d.ts +1 -38
- package/dist/types/modes/shared/agent-wire/command-dispatch.d.ts +20 -0
- package/dist/types/modes/shared/agent-wire/command-validation.d.ts +2 -0
- package/dist/types/modes/shared/agent-wire/event-envelope.d.ts +24 -0
- package/dist/types/modes/shared/agent-wire/handshake.d.ts +46 -0
- package/dist/types/modes/shared/agent-wire/host-tool-bridge.d.ts +16 -0
- package/dist/types/modes/shared/agent-wire/host-uri-bridge.d.ts +17 -0
- package/dist/types/modes/shared/agent-wire/protocol.d.ts +44 -0
- package/dist/types/modes/shared/agent-wire/responses.d.ts +4 -0
- package/dist/types/modes/shared/agent-wire/scopes.d.ts +18 -0
- package/dist/types/modes/shared/agent-wire/ui-request-broker.d.ts +42 -0
- package/dist/types/modes/shared/agent-wire/ui-result.d.ts +27 -0
- package/dist/types/modes/types.d.ts +2 -0
- package/dist/types/sdk.d.ts +4 -0
- package/dist/types/session/agent-session.d.ts +19 -1
- package/dist/types/skill-state/active-state.d.ts +2 -0
- package/dist/types/skill-state/deep-interview-mutation-guard.d.ts +1 -1
- package/dist/types/skill-state/workflow-state-contract.d.ts +25 -2
- package/dist/types/skill-state/workflow-state-version.d.ts +3 -0
- package/dist/types/task/executor.d.ts +3 -0
- package/dist/types/task/id.d.ts +7 -0
- package/dist/types/task/index.d.ts +5 -0
- package/dist/types/task/receipt.d.ts +85 -0
- package/dist/types/task/spawn-gate.d.ts +38 -0
- package/dist/types/task/types.d.ts +198 -14
- package/dist/types/tools/cron.d.ts +6 -0
- package/dist/types/tools/index.d.ts +2 -0
- package/dist/types/tools/path-utils.d.ts +1 -0
- package/dist/types/tools/subagent.d.ts +26 -1
- package/package.json +7 -7
- package/scripts/build-binary.ts +7 -0
- package/src/async/job-manager.ts +334 -6
- package/src/cli/args.ts +9 -2
- package/src/cli/auth-broker-cli.ts +1 -0
- package/src/cli/config-cli.ts +10 -2
- package/src/cli.ts +2 -0
- package/src/commands/deep-interview.ts +1 -0
- package/src/commands/harness.ts +862 -0
- package/src/commands/launch.ts +2 -2
- package/src/commands/state.ts +2 -1
- package/src/commands/team.ts +54 -39
- package/src/config/keybindings.ts +6 -0
- package/src/config/settings-schema.ts +13 -3
- package/src/config/settings.ts +5 -0
- package/src/dap/client.ts +17 -3
- package/src/debug/crash-diagnostics.ts +223 -0
- package/src/debug/runtime-gauges.ts +20 -0
- package/src/deep-interview/render-middleware.ts +372 -0
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +1 -1
- package/src/defaults/gjc/skills/ralplan/SKILL.md +31 -2
- package/src/defaults/gjc/skills/team/SKILL.md +47 -21
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +106 -13
- package/src/eval/py/executor.ts +21 -1
- package/src/eval/py/kernel.ts +15 -0
- package/src/exec/bash-executor.ts +41 -0
- package/src/extensibility/custom-tools/types.ts +1 -0
- package/src/extensibility/extensions/types.ts +6 -0
- package/src/extensibility/shared-events.ts +1 -0
- package/src/gjc-runtime/cli-write-receipt.ts +31 -0
- package/src/gjc-runtime/deep-interview-runtime.ts +98 -42
- package/src/gjc-runtime/goal-mode-request.ts +11 -3
- package/src/gjc-runtime/ralplan-runtime.ts +235 -43
- package/src/gjc-runtime/state-graph.ts +86 -0
- package/src/gjc-runtime/state-migrations.ts +179 -0
- package/src/gjc-runtime/state-renderer.ts +345 -0
- package/src/gjc-runtime/state-runtime.ts +1155 -46
- package/src/gjc-runtime/state-schema.ts +192 -0
- package/src/gjc-runtime/state-validation.ts +49 -0
- package/src/gjc-runtime/state-writer.ts +749 -0
- package/src/gjc-runtime/team-runtime.ts +1255 -189
- package/src/gjc-runtime/ultragoal-runtime.ts +460 -43
- package/src/gjc-runtime/workflow-command-ref.ts +239 -0
- package/src/gjc-runtime/workflow-manifest.generated.json +1601 -0
- package/src/gjc-runtime/workflow-manifest.ts +427 -0
- package/src/harness-control-plane/classifier.ts +128 -0
- package/src/harness-control-plane/control-endpoint.ts +148 -0
- package/src/harness-control-plane/finalize.ts +222 -0
- package/src/harness-control-plane/frame-mapper.ts +286 -0
- package/src/harness-control-plane/operate.ts +225 -0
- package/src/harness-control-plane/owner.ts +600 -0
- package/src/harness-control-plane/preserve.ts +102 -0
- package/src/harness-control-plane/receipts.ts +216 -0
- package/src/harness-control-plane/rpc-adapter.ts +276 -0
- package/src/harness-control-plane/seams.ts +39 -0
- package/src/harness-control-plane/session-lease.ts +388 -0
- package/src/harness-control-plane/state-machine.ts +98 -0
- package/src/harness-control-plane/storage.ts +257 -0
- package/src/harness-control-plane/types.ts +214 -0
- package/src/hooks/skill-keywords.ts +4 -2
- package/src/hooks/skill-state.ts +197 -64
- package/src/internal-urls/agent-protocol.ts +68 -21
- package/src/internal-urls/artifact-protocol.ts +12 -17
- package/src/internal-urls/docs-index.generated.ts +3 -2
- package/src/internal-urls/registry-helpers.ts +19 -16
- package/src/internal-urls/types.ts +4 -0
- package/src/lsp/client.ts +18 -2
- package/src/main.ts +21 -5
- package/src/modes/bridge/auth.ts +41 -0
- package/src/modes/bridge/bridge-client-bridge.ts +47 -0
- package/src/modes/bridge/bridge-mode.ts +520 -0
- package/src/modes/bridge/bridge-ui-context.ts +200 -0
- package/src/modes/bridge/event-stream.ts +70 -0
- package/src/modes/components/assistant-message.ts +5 -1
- package/src/modes/components/custom-editor.ts +101 -0
- package/src/modes/components/hook-selector.ts +133 -20
- package/src/modes/components/jobs-overlay-model.ts +109 -0
- package/src/modes/components/jobs-overlay.ts +172 -0
- package/src/modes/components/status-line/presets.ts +7 -5
- package/src/modes/components/status-line/segments.ts +25 -0
- package/src/modes/components/status-line/types.ts +2 -0
- package/src/modes/components/status-line.ts +9 -1
- package/src/modes/controllers/event-controller.ts +71 -6
- package/src/modes/controllers/extension-ui-controller.ts +43 -1
- package/src/modes/controllers/input-controller.ts +105 -9
- package/src/modes/controllers/selector-controller.ts +31 -1
- package/src/modes/index.ts +1 -0
- package/src/modes/interactive-mode.ts +28 -0
- package/src/modes/jobs-observer.ts +204 -0
- package/src/modes/rpc/host-tools.ts +1 -186
- package/src/modes/rpc/host-uris.ts +1 -235
- package/src/modes/rpc/rpc-client.ts +25 -10
- package/src/modes/rpc/rpc-mode.ts +12 -381
- package/src/modes/shared/agent-wire/command-dispatch.ts +341 -0
- package/src/modes/shared/agent-wire/command-validation.ts +131 -0
- package/src/modes/shared/agent-wire/event-envelope.ts +108 -0
- package/src/modes/shared/agent-wire/handshake.ts +117 -0
- package/src/modes/shared/agent-wire/host-tool-bridge.ts +194 -0
- package/src/modes/shared/agent-wire/host-uri-bridge.ts +236 -0
- package/src/modes/shared/agent-wire/protocol.ts +96 -0
- package/src/modes/shared/agent-wire/responses.ts +17 -0
- package/src/modes/shared/agent-wire/scopes.ts +89 -0
- package/src/modes/shared/agent-wire/ui-request-broker.ts +150 -0
- package/src/modes/shared/agent-wire/ui-result.ts +48 -0
- package/src/modes/types.ts +2 -0
- package/src/prompts/agents/executor.md +13 -0
- package/src/prompts/tools/subagent.md +39 -4
- package/src/prompts/tools/task-summary.md +3 -9
- package/src/prompts/tools/task.md +5 -1
- package/src/sdk.ts +8 -0
- package/src/session/agent-session.ts +445 -71
- package/src/session/session-manager.ts +13 -1
- package/src/skill-state/active-state.ts +58 -65
- package/src/skill-state/deep-interview-mutation-guard.ts +114 -17
- package/src/skill-state/initial-phase.ts +2 -0
- package/src/skill-state/workflow-state-contract.ts +33 -4
- package/src/skill-state/workflow-state-version.ts +3 -0
- package/src/slash-commands/builtin-registry.ts +8 -0
- package/src/task/executor.ts +79 -13
- package/src/task/id.ts +33 -0
- package/src/task/index.ts +376 -74
- package/src/task/output-manager.ts +5 -4
- package/src/task/receipt.ts +297 -0
- package/src/task/render.ts +54 -134
- package/src/task/spawn-gate.ts +132 -0
- package/src/task/types.ts +104 -10
- package/src/tools/ask.ts +88 -27
- package/src/tools/ast-edit.ts +1 -0
- package/src/tools/ast-grep.ts +1 -0
- package/src/tools/bash.ts +1 -1
- package/src/tools/cron.ts +48 -0
- package/src/tools/find.ts +4 -1
- package/src/tools/index.ts +2 -0
- package/src/tools/path-utils.ts +3 -2
- package/src/tools/read.ts +1 -0
- package/src/tools/search.ts +1 -0
- package/src/tools/skill.ts +6 -1
- package/src/tools/subagent.ts +423 -79
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const WorkflowStateContentChecksumSchema: z.ZodObject<{
|
|
3
|
+
algorithm: z.ZodLiteral<"sha256">;
|
|
4
|
+
value: z.ZodString;
|
|
5
|
+
covered_path: z.ZodString;
|
|
6
|
+
computed_at: z.ZodString;
|
|
7
|
+
}, z.core.$loose>;
|
|
8
|
+
/** Lenient receipt schema for reads (mirrors WorkflowStateReceipt). */
|
|
9
|
+
export declare const WorkflowStateReceiptSchema: z.ZodObject<{
|
|
10
|
+
version: z.ZodNumber;
|
|
11
|
+
skill: z.ZodEnum<{
|
|
12
|
+
"deep-interview": "deep-interview";
|
|
13
|
+
ralplan: "ralplan";
|
|
14
|
+
team: "team";
|
|
15
|
+
ultragoal: "ultragoal";
|
|
16
|
+
}>;
|
|
17
|
+
owner: z.ZodEnum<{
|
|
18
|
+
"gjc-hook": "gjc-hook";
|
|
19
|
+
"gjc-runtime": "gjc-runtime";
|
|
20
|
+
"gjc-state-cli": "gjc-state-cli";
|
|
21
|
+
}>;
|
|
22
|
+
command: z.ZodString;
|
|
23
|
+
state_path: z.ZodString;
|
|
24
|
+
storage_path: z.ZodString;
|
|
25
|
+
mutated_at: z.ZodString;
|
|
26
|
+
fresh_until: z.ZodString;
|
|
27
|
+
status: z.ZodEnum<{
|
|
28
|
+
fresh: "fresh";
|
|
29
|
+
stale: "stale";
|
|
30
|
+
}>;
|
|
31
|
+
mutation_id: z.ZodString;
|
|
32
|
+
verb: z.ZodOptional<z.ZodString>;
|
|
33
|
+
from_phase: z.ZodOptional<z.ZodString>;
|
|
34
|
+
to_phase: z.ZodOptional<z.ZodString>;
|
|
35
|
+
forced: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
37
|
+
content_sha256: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
algorithm: z.ZodLiteral<"sha256">;
|
|
39
|
+
value: z.ZodString;
|
|
40
|
+
covered_path: z.ZodString;
|
|
41
|
+
computed_at: z.ZodString;
|
|
42
|
+
}, z.core.$loose>>;
|
|
43
|
+
}, z.core.$loose>;
|
|
44
|
+
/** Lenient envelope schema for reads. Every non-structural field optional. */
|
|
45
|
+
export declare const WorkflowStateEnvelopeSchema: z.ZodObject<{
|
|
46
|
+
skill: z.ZodOptional<z.ZodString>;
|
|
47
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
current_phase: z.ZodOptional<z.ZodString>;
|
|
49
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
updated_at: z.ZodOptional<z.ZodString>;
|
|
51
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
52
|
+
receipt: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
version: z.ZodNumber;
|
|
54
|
+
skill: z.ZodEnum<{
|
|
55
|
+
"deep-interview": "deep-interview";
|
|
56
|
+
ralplan: "ralplan";
|
|
57
|
+
team: "team";
|
|
58
|
+
ultragoal: "ultragoal";
|
|
59
|
+
}>;
|
|
60
|
+
owner: z.ZodEnum<{
|
|
61
|
+
"gjc-hook": "gjc-hook";
|
|
62
|
+
"gjc-runtime": "gjc-runtime";
|
|
63
|
+
"gjc-state-cli": "gjc-state-cli";
|
|
64
|
+
}>;
|
|
65
|
+
command: z.ZodString;
|
|
66
|
+
state_path: z.ZodString;
|
|
67
|
+
storage_path: z.ZodString;
|
|
68
|
+
mutated_at: z.ZodString;
|
|
69
|
+
fresh_until: z.ZodString;
|
|
70
|
+
status: z.ZodEnum<{
|
|
71
|
+
fresh: "fresh";
|
|
72
|
+
stale: "stale";
|
|
73
|
+
}>;
|
|
74
|
+
mutation_id: z.ZodString;
|
|
75
|
+
verb: z.ZodOptional<z.ZodString>;
|
|
76
|
+
from_phase: z.ZodOptional<z.ZodString>;
|
|
77
|
+
to_phase: z.ZodOptional<z.ZodString>;
|
|
78
|
+
forced: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
80
|
+
content_sha256: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
algorithm: z.ZodLiteral<"sha256">;
|
|
82
|
+
value: z.ZodString;
|
|
83
|
+
covered_path: z.ZodString;
|
|
84
|
+
computed_at: z.ZodString;
|
|
85
|
+
}, z.core.$loose>>;
|
|
86
|
+
}, z.core.$loose>>;
|
|
87
|
+
}, z.core.$loose>;
|
|
88
|
+
/**
|
|
89
|
+
* Strict receipt required on WRITE (post checksum-stamping). Anchored to the
|
|
90
|
+
* fields the sanctioned writer emits — `content_sha256` is REQUIRED here.
|
|
91
|
+
*/
|
|
92
|
+
export declare const RequiredWorkflowStateReceiptSchema: z.ZodObject<{
|
|
93
|
+
version: z.ZodNumber;
|
|
94
|
+
skill: z.ZodEnum<{
|
|
95
|
+
"deep-interview": "deep-interview";
|
|
96
|
+
ralplan: "ralplan";
|
|
97
|
+
team: "team";
|
|
98
|
+
ultragoal: "ultragoal";
|
|
99
|
+
}>;
|
|
100
|
+
owner: z.ZodEnum<{
|
|
101
|
+
"gjc-hook": "gjc-hook";
|
|
102
|
+
"gjc-runtime": "gjc-runtime";
|
|
103
|
+
"gjc-state-cli": "gjc-state-cli";
|
|
104
|
+
}>;
|
|
105
|
+
command: z.ZodString;
|
|
106
|
+
state_path: z.ZodString;
|
|
107
|
+
storage_path: z.ZodString;
|
|
108
|
+
mutated_at: z.ZodString;
|
|
109
|
+
fresh_until: z.ZodString;
|
|
110
|
+
status: z.ZodEnum<{
|
|
111
|
+
fresh: "fresh";
|
|
112
|
+
stale: "stale";
|
|
113
|
+
}>;
|
|
114
|
+
mutation_id: z.ZodString;
|
|
115
|
+
content_sha256: z.ZodObject<{
|
|
116
|
+
algorithm: z.ZodLiteral<"sha256">;
|
|
117
|
+
value: z.ZodString;
|
|
118
|
+
covered_path: z.ZodString;
|
|
119
|
+
computed_at: z.ZodString;
|
|
120
|
+
}, z.core.$loose>;
|
|
121
|
+
}, z.core.$loose>;
|
|
122
|
+
/**
|
|
123
|
+
* Write-side fail-closed gate: the serialized on-disk envelope must satisfy
|
|
124
|
+
* this after checksum stamping. Anchored to current sanctioned-writer output.
|
|
125
|
+
*/
|
|
126
|
+
export declare const RequiredOnWriteEnvelopeSchema: z.ZodObject<{
|
|
127
|
+
skill: z.ZodEnum<{
|
|
128
|
+
"deep-interview": "deep-interview";
|
|
129
|
+
ralplan: "ralplan";
|
|
130
|
+
team: "team";
|
|
131
|
+
ultragoal: "ultragoal";
|
|
132
|
+
}>;
|
|
133
|
+
version: z.ZodLiteral<2>;
|
|
134
|
+
updated_at: z.ZodString;
|
|
135
|
+
current_phase: z.ZodString;
|
|
136
|
+
active: z.ZodBoolean;
|
|
137
|
+
receipt: z.ZodObject<{
|
|
138
|
+
version: z.ZodNumber;
|
|
139
|
+
skill: z.ZodEnum<{
|
|
140
|
+
"deep-interview": "deep-interview";
|
|
141
|
+
ralplan: "ralplan";
|
|
142
|
+
team: "team";
|
|
143
|
+
ultragoal: "ultragoal";
|
|
144
|
+
}>;
|
|
145
|
+
owner: z.ZodEnum<{
|
|
146
|
+
"gjc-hook": "gjc-hook";
|
|
147
|
+
"gjc-runtime": "gjc-runtime";
|
|
148
|
+
"gjc-state-cli": "gjc-state-cli";
|
|
149
|
+
}>;
|
|
150
|
+
command: z.ZodString;
|
|
151
|
+
state_path: z.ZodString;
|
|
152
|
+
storage_path: z.ZodString;
|
|
153
|
+
mutated_at: z.ZodString;
|
|
154
|
+
fresh_until: z.ZodString;
|
|
155
|
+
status: z.ZodEnum<{
|
|
156
|
+
fresh: "fresh";
|
|
157
|
+
stale: "stale";
|
|
158
|
+
}>;
|
|
159
|
+
mutation_id: z.ZodString;
|
|
160
|
+
content_sha256: z.ZodObject<{
|
|
161
|
+
algorithm: z.ZodLiteral<"sha256">;
|
|
162
|
+
value: z.ZodString;
|
|
163
|
+
covered_path: z.ZodString;
|
|
164
|
+
computed_at: z.ZodString;
|
|
165
|
+
}, z.core.$loose>;
|
|
166
|
+
}, z.core.$loose>;
|
|
167
|
+
}, z.core.$loose>;
|
|
168
|
+
/** Per-skill mode state consumed by hooks / the mutation guard. */
|
|
169
|
+
export declare const ModeStateSchema: z.ZodObject<{
|
|
170
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
current_phase: z.ZodOptional<z.ZodString>;
|
|
172
|
+
skill: z.ZodOptional<z.ZodString>;
|
|
173
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
174
|
+
thread_id: z.ZodOptional<z.ZodString>;
|
|
175
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
176
|
+
updated_at: z.ZodOptional<z.ZodString>;
|
|
177
|
+
handoff_from: z.ZodOptional<z.ZodString>;
|
|
178
|
+
handoff_to: z.ZodOptional<z.ZodString>;
|
|
179
|
+
handoff_at: z.ZodOptional<z.ZodString>;
|
|
180
|
+
}, z.core.$loose>;
|
|
181
|
+
export declare const SkillActiveEntrySchema: z.ZodObject<{
|
|
182
|
+
skill: z.ZodString;
|
|
183
|
+
phase: z.ZodOptional<z.ZodString>;
|
|
184
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
activated_at: z.ZodOptional<z.ZodString>;
|
|
186
|
+
updated_at: z.ZodOptional<z.ZodString>;
|
|
187
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
188
|
+
thread_id: z.ZodOptional<z.ZodString>;
|
|
189
|
+
turn_id: z.ZodOptional<z.ZodString>;
|
|
190
|
+
stale: z.ZodOptional<z.ZodBoolean>;
|
|
191
|
+
handoff_from: z.ZodOptional<z.ZodString>;
|
|
192
|
+
handoff_to: z.ZodOptional<z.ZodString>;
|
|
193
|
+
handoff_at: z.ZodOptional<z.ZodString>;
|
|
194
|
+
receipt: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
version: z.ZodNumber;
|
|
196
|
+
skill: z.ZodEnum<{
|
|
197
|
+
"deep-interview": "deep-interview";
|
|
198
|
+
ralplan: "ralplan";
|
|
199
|
+
team: "team";
|
|
200
|
+
ultragoal: "ultragoal";
|
|
201
|
+
}>;
|
|
202
|
+
owner: z.ZodEnum<{
|
|
203
|
+
"gjc-hook": "gjc-hook";
|
|
204
|
+
"gjc-runtime": "gjc-runtime";
|
|
205
|
+
"gjc-state-cli": "gjc-state-cli";
|
|
206
|
+
}>;
|
|
207
|
+
command: z.ZodString;
|
|
208
|
+
state_path: z.ZodString;
|
|
209
|
+
storage_path: z.ZodString;
|
|
210
|
+
mutated_at: z.ZodString;
|
|
211
|
+
fresh_until: z.ZodString;
|
|
212
|
+
status: z.ZodEnum<{
|
|
213
|
+
fresh: "fresh";
|
|
214
|
+
stale: "stale";
|
|
215
|
+
}>;
|
|
216
|
+
mutation_id: z.ZodString;
|
|
217
|
+
verb: z.ZodOptional<z.ZodString>;
|
|
218
|
+
from_phase: z.ZodOptional<z.ZodString>;
|
|
219
|
+
to_phase: z.ZodOptional<z.ZodString>;
|
|
220
|
+
forced: z.ZodOptional<z.ZodBoolean>;
|
|
221
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
222
|
+
content_sha256: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
algorithm: z.ZodLiteral<"sha256">;
|
|
224
|
+
value: z.ZodString;
|
|
225
|
+
covered_path: z.ZodString;
|
|
226
|
+
computed_at: z.ZodString;
|
|
227
|
+
}, z.core.$loose>>;
|
|
228
|
+
}, z.core.$loose>>;
|
|
229
|
+
}, z.core.$loose>;
|
|
230
|
+
export declare const SkillActiveStateSchema: z.ZodObject<{
|
|
231
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
233
|
+
skill: z.ZodOptional<z.ZodString>;
|
|
234
|
+
keyword: z.ZodOptional<z.ZodString>;
|
|
235
|
+
phase: z.ZodOptional<z.ZodString>;
|
|
236
|
+
activated_at: z.ZodOptional<z.ZodString>;
|
|
237
|
+
updated_at: z.ZodOptional<z.ZodString>;
|
|
238
|
+
source: z.ZodOptional<z.ZodString>;
|
|
239
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
240
|
+
thread_id: z.ZodOptional<z.ZodString>;
|
|
241
|
+
turn_id: z.ZodOptional<z.ZodString>;
|
|
242
|
+
active_skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
243
|
+
skill: z.ZodString;
|
|
244
|
+
phase: z.ZodOptional<z.ZodString>;
|
|
245
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
246
|
+
activated_at: z.ZodOptional<z.ZodString>;
|
|
247
|
+
updated_at: z.ZodOptional<z.ZodString>;
|
|
248
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
249
|
+
thread_id: z.ZodOptional<z.ZodString>;
|
|
250
|
+
turn_id: z.ZodOptional<z.ZodString>;
|
|
251
|
+
stale: z.ZodOptional<z.ZodBoolean>;
|
|
252
|
+
handoff_from: z.ZodOptional<z.ZodString>;
|
|
253
|
+
handoff_to: z.ZodOptional<z.ZodString>;
|
|
254
|
+
handoff_at: z.ZodOptional<z.ZodString>;
|
|
255
|
+
receipt: z.ZodOptional<z.ZodObject<{
|
|
256
|
+
version: z.ZodNumber;
|
|
257
|
+
skill: z.ZodEnum<{
|
|
258
|
+
"deep-interview": "deep-interview";
|
|
259
|
+
ralplan: "ralplan";
|
|
260
|
+
team: "team";
|
|
261
|
+
ultragoal: "ultragoal";
|
|
262
|
+
}>;
|
|
263
|
+
owner: z.ZodEnum<{
|
|
264
|
+
"gjc-hook": "gjc-hook";
|
|
265
|
+
"gjc-runtime": "gjc-runtime";
|
|
266
|
+
"gjc-state-cli": "gjc-state-cli";
|
|
267
|
+
}>;
|
|
268
|
+
command: z.ZodString;
|
|
269
|
+
state_path: z.ZodString;
|
|
270
|
+
storage_path: z.ZodString;
|
|
271
|
+
mutated_at: z.ZodString;
|
|
272
|
+
fresh_until: z.ZodString;
|
|
273
|
+
status: z.ZodEnum<{
|
|
274
|
+
fresh: "fresh";
|
|
275
|
+
stale: "stale";
|
|
276
|
+
}>;
|
|
277
|
+
mutation_id: z.ZodString;
|
|
278
|
+
verb: z.ZodOptional<z.ZodString>;
|
|
279
|
+
from_phase: z.ZodOptional<z.ZodString>;
|
|
280
|
+
to_phase: z.ZodOptional<z.ZodString>;
|
|
281
|
+
forced: z.ZodOptional<z.ZodBoolean>;
|
|
282
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
283
|
+
content_sha256: z.ZodOptional<z.ZodObject<{
|
|
284
|
+
algorithm: z.ZodLiteral<"sha256">;
|
|
285
|
+
value: z.ZodString;
|
|
286
|
+
covered_path: z.ZodString;
|
|
287
|
+
computed_at: z.ZodString;
|
|
288
|
+
}, z.core.$loose>>;
|
|
289
|
+
}, z.core.$loose>>;
|
|
290
|
+
}, z.core.$loose>>>;
|
|
291
|
+
}, z.core.$loose>;
|
|
292
|
+
export type WorkflowStateEnvelope = z.infer<typeof WorkflowStateEnvelopeSchema>;
|
|
293
|
+
export type RequiredOnWriteEnvelope = z.infer<typeof RequiredOnWriteEnvelopeSchema>;
|
|
294
|
+
export type ModeStateParsed = z.infer<typeof ModeStateSchema>;
|
|
295
|
+
export type SkillActiveStateParsed = z.infer<typeof SkillActiveStateSchema>;
|
|
296
|
+
/**
|
|
297
|
+
* Validated read result.
|
|
298
|
+
* - `null` → file absent (ENOENT); callers treat as no state.
|
|
299
|
+
* - `{ok:true}` → parsed + schema-valid.
|
|
300
|
+
* - `{ok:false}` → present but unparseable or schema-invalid. Callers fail
|
|
301
|
+
* OPEN (normalize/log), never crash — preserving v2 reads.
|
|
302
|
+
*/
|
|
303
|
+
export type ReadGjcJsonResult<T> = {
|
|
304
|
+
ok: true;
|
|
305
|
+
value: T;
|
|
306
|
+
raw: unknown;
|
|
307
|
+
} | {
|
|
308
|
+
ok: false;
|
|
309
|
+
error: string;
|
|
310
|
+
raw: unknown;
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* Parse + schema-validate a `.gjc` JSON file at the read boundary.
|
|
314
|
+
* Returns `null` when the file is absent. Fail-open: an invalid file yields
|
|
315
|
+
* `{ ok: false }` with the raw value attached so the caller can normalize/log.
|
|
316
|
+
*/
|
|
317
|
+
export declare function readGjcJson<T>(filePath: string, schema: z.ZodType<T>): Promise<ReadGjcJsonResult<T> | null>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CanonicalGjcWorkflowSkill } from "../skill-state/active-state";
|
|
2
|
+
export interface StateValidationResult {
|
|
3
|
+
valid: boolean;
|
|
4
|
+
error?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function validateWorkflowStateEnvelope(skill: CanonicalGjcWorkflowSkill, state: unknown): StateValidationResult;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
|
+
import type { SkillActiveEntry } from "../skill-state/active-state";
|
|
3
|
+
import { type AuditEntry, type CanonicalGjcWorkflowSkill, type WorkflowStateMutationOwner } from "../skill-state/workflow-state-contract";
|
|
4
|
+
/**
|
|
5
|
+
* Sole sanctioned project `.gjc/**` writer module (gate G1).
|
|
6
|
+
*
|
|
7
|
+
* All native `.gjc/**` filesystem mutations must route through these primitives.
|
|
8
|
+
* The primitives validate project `.gjc/**` ownership, create parent directories,
|
|
9
|
+
* and emit workflow receipts or audit entries where applicable by the caller's
|
|
10
|
+
* supplied mutation context. No lockfiles are used; isolation is by atomic rename,
|
|
11
|
+
* append, O_EXCL creates, conditional deletes, per-entry active-state files,
|
|
12
|
+
* and derived active-state snapshots.
|
|
13
|
+
* Transaction journals are per mutation id under `.gjc/state/transactions/`;
|
|
14
|
+
* they are recovery evidence only, never global locks or waiters, so stale
|
|
15
|
+
* journals do not block unrelated state reads or writes.
|
|
16
|
+
*/
|
|
17
|
+
export type WriterCategory = "state" | "artifact" | "ledger" | "log" | "report" | "agents" | "prune" | "force" | "transaction";
|
|
18
|
+
export interface StateWriterReceiptContext {
|
|
19
|
+
cwd?: string;
|
|
20
|
+
skill: CanonicalGjcWorkflowSkill;
|
|
21
|
+
owner: WorkflowStateMutationOwner;
|
|
22
|
+
command: string;
|
|
23
|
+
sessionId?: string;
|
|
24
|
+
mutationId?: string;
|
|
25
|
+
nowIso?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface StateWriterAuditContext {
|
|
28
|
+
cwd?: string;
|
|
29
|
+
category: WriterCategory;
|
|
30
|
+
verb: string;
|
|
31
|
+
owner: WorkflowStateMutationOwner;
|
|
32
|
+
skill?: CanonicalGjcWorkflowSkill | string;
|
|
33
|
+
mutationId?: string;
|
|
34
|
+
fromPhase?: string;
|
|
35
|
+
toPhase?: string;
|
|
36
|
+
forced?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface WorkflowEnvelopeIntegrityMismatch {
|
|
39
|
+
path: string;
|
|
40
|
+
expected: string;
|
|
41
|
+
actual: string;
|
|
42
|
+
}
|
|
43
|
+
export interface WorkflowTransactionJournal {
|
|
44
|
+
version: 1;
|
|
45
|
+
mutation_id: string;
|
|
46
|
+
status: "pending" | "committed";
|
|
47
|
+
created_at: string;
|
|
48
|
+
updated_at: string;
|
|
49
|
+
caller?: CanonicalGjcWorkflowSkill;
|
|
50
|
+
callee?: CanonicalGjcWorkflowSkill;
|
|
51
|
+
paths: string[];
|
|
52
|
+
steps: string[];
|
|
53
|
+
}
|
|
54
|
+
export interface StateWriterOptions {
|
|
55
|
+
cwd?: string;
|
|
56
|
+
receipt?: StateWriterReceiptContext;
|
|
57
|
+
audit?: StateWriterAuditContext;
|
|
58
|
+
}
|
|
59
|
+
export interface DeleteIfOwnedOptions extends StateWriterOptions {
|
|
60
|
+
predicate?: (current: unknown) => boolean | Promise<boolean>;
|
|
61
|
+
}
|
|
62
|
+
export interface DeleteResult {
|
|
63
|
+
path: string;
|
|
64
|
+
deleted: boolean;
|
|
65
|
+
}
|
|
66
|
+
export interface ActiveSessionScope {
|
|
67
|
+
sessionId?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface ActiveEntryWriteResult {
|
|
70
|
+
entryPath: string;
|
|
71
|
+
snapshotPath: string;
|
|
72
|
+
}
|
|
73
|
+
export interface HardPruneSelectorContext {
|
|
74
|
+
path: string;
|
|
75
|
+
value: unknown;
|
|
76
|
+
}
|
|
77
|
+
export interface GenericHardPruneTarget {
|
|
78
|
+
path: string;
|
|
79
|
+
category: WriterCategory | string;
|
|
80
|
+
}
|
|
81
|
+
export interface GenericHardPruneSelectorContext {
|
|
82
|
+
path: string;
|
|
83
|
+
category: WriterCategory | string;
|
|
84
|
+
stat: Awaited<ReturnType<typeof fs.stat>>;
|
|
85
|
+
readJson: () => Promise<unknown>;
|
|
86
|
+
}
|
|
87
|
+
export type GenericHardPruneSelector = (context: GenericHardPruneSelectorContext) => boolean | Promise<boolean>;
|
|
88
|
+
export interface ForceOverwriteOptions extends StateWriterOptions {
|
|
89
|
+
raw?: boolean;
|
|
90
|
+
}
|
|
91
|
+
export type HardPruneSelector = (context: HardPruneSelectorContext) => boolean | Promise<boolean>;
|
|
92
|
+
export declare class AlreadyExistsError extends Error {
|
|
93
|
+
readonly path: string;
|
|
94
|
+
constructor(path: string);
|
|
95
|
+
}
|
|
96
|
+
export type StrictMutationReadResult = {
|
|
97
|
+
kind: "absent";
|
|
98
|
+
} | {
|
|
99
|
+
kind: "corrupt";
|
|
100
|
+
error: string;
|
|
101
|
+
} | {
|
|
102
|
+
kind: "valid";
|
|
103
|
+
value: Record<string, unknown>;
|
|
104
|
+
};
|
|
105
|
+
export declare function readExistingStateForMutation(filePath: string): Promise<StrictMutationReadResult>;
|
|
106
|
+
export declare function workflowEnvelopeContentSha256(value: unknown): string;
|
|
107
|
+
export declare function stampWorkflowEnvelopeChecksum<T>(value: T, filePath: string, computedAt?: string): T;
|
|
108
|
+
export declare function detectWorkflowEnvelopeIntegrityMismatch(filePath: string): Promise<WorkflowEnvelopeIntegrityMismatch | undefined>;
|
|
109
|
+
export declare function writeJsonAtomic(targetPath: string, value: unknown, options?: StateWriterOptions): Promise<string>;
|
|
110
|
+
export declare function writeWorkflowEnvelopeAtomic(targetPath: string, value: unknown, options?: StateWriterOptions): Promise<string>;
|
|
111
|
+
export declare function writeTextAtomic(targetPath: string, text: string, options?: StateWriterOptions): Promise<string>;
|
|
112
|
+
export declare function updateJsonAtomic<T = unknown>(targetPath: string, mutator: (current: T | undefined) => T | Promise<T>, options?: StateWriterOptions): Promise<string>;
|
|
113
|
+
export declare function appendJsonl(targetPath: string, entry: unknown, options?: StateWriterOptions): Promise<string>;
|
|
114
|
+
export declare function appendText(targetPath: string, text: string, options?: StateWriterOptions): Promise<string>;
|
|
115
|
+
export declare function createJsonNoClobber(targetPath: string, value: unknown, options?: StateWriterOptions): Promise<string>;
|
|
116
|
+
export declare function deleteIfOwned(targetPath: string, predicateOrOptions?: ((current: unknown) => boolean | Promise<boolean>) | DeleteIfOwnedOptions): Promise<DeleteResult>;
|
|
117
|
+
export declare function removeFileAudited(targetPath: string, options?: StateWriterOptions): Promise<DeleteResult>;
|
|
118
|
+
/**
|
|
119
|
+
* Active entry files under `.gjc/state/active/<skill>.json` and
|
|
120
|
+
* `.gjc/state/sessions/<id>/active/<skill>.json` are authoritative. The
|
|
121
|
+
* adjacent `skill-active-state.json` file is only a derived cache rebuilt from
|
|
122
|
+
* those entries, so concurrent snapshot rebuilds can race without losing any
|
|
123
|
+
* writer's per-skill state.
|
|
124
|
+
*/
|
|
125
|
+
export declare function writeActiveEntry(cwd: string, sessionScope: string | ActiveSessionScope | undefined, skill: string, entry: SkillActiveEntry, options?: StateWriterOptions): Promise<string>;
|
|
126
|
+
export declare function removeActiveEntry(cwd: string, sessionScope: string | ActiveSessionScope | undefined, skill: string, options?: StateWriterOptions): Promise<DeleteResult>;
|
|
127
|
+
export declare function readActiveEntries(cwd: string, sessionScope?: string | ActiveSessionScope): Promise<SkillActiveEntry[]>;
|
|
128
|
+
export declare function rebuildActiveSnapshot(cwd: string, sessionScope?: string | ActiveSessionScope, options?: StateWriterOptions): Promise<string>;
|
|
129
|
+
export declare function mergeActiveState(cwd: string, sessionScope: string | ActiveSessionScope | undefined, skill: string, entry: SkillActiveEntry, options?: StateWriterOptions): Promise<ActiveEntryWriteResult>;
|
|
130
|
+
export declare function writeArtifact(targetPath: string, content: string, options?: StateWriterOptions): Promise<string>;
|
|
131
|
+
export declare function writeReport(targetPath: string, content: string, options?: StateWriterOptions): Promise<string>;
|
|
132
|
+
export declare function writeLogJsonl(targetPath: string, entry: unknown, options?: StateWriterOptions): Promise<string>;
|
|
133
|
+
export declare function softDelete(targetPath: string, meta: Record<string, unknown>, options?: StateWriterOptions): Promise<string>;
|
|
134
|
+
export declare function hardPruneJson(targetPaths: readonly string[], selector: HardPruneSelector, options?: StateWriterOptions): Promise<string[]>;
|
|
135
|
+
export declare function hardPrune(targets: readonly GenericHardPruneTarget[], selector: GenericHardPruneSelector, options?: StateWriterOptions): Promise<string[]>;
|
|
136
|
+
export declare function forceOverwrite(targetPath: string, rawValue: unknown, options?: ForceOverwriteOptions): Promise<string>;
|
|
137
|
+
export declare function appendAuditEntry(cwd: string, entry: AuditEntry): Promise<string>;
|
|
138
|
+
export declare function readWorkflowTransactionJournal(cwd: string, mutationId: string): Promise<WorkflowTransactionJournal | undefined>;
|
|
139
|
+
export declare function beginWorkflowTransactionJournal(input: {
|
|
140
|
+
cwd: string;
|
|
141
|
+
mutationId: string;
|
|
142
|
+
caller?: CanonicalGjcWorkflowSkill;
|
|
143
|
+
callee?: CanonicalGjcWorkflowSkill;
|
|
144
|
+
paths: string[];
|
|
145
|
+
}): Promise<string>;
|
|
146
|
+
export declare function updateWorkflowTransactionJournal(cwd: string, mutationId: string, patch: Partial<WorkflowTransactionJournal>): Promise<string>;
|
|
147
|
+
export declare function completeWorkflowTransactionJournal(cwd: string, mutationId: string): Promise<void>;
|
|
@@ -2,6 +2,8 @@ import type { WorkflowHudSummary } from "../skill-state/active-state";
|
|
|
2
2
|
export type GjcTeamPhase = "starting" | "running" | "awaiting_integration" | "complete" | "failed" | "cancelled";
|
|
3
3
|
export type GjcTeamTaskStatus = "pending" | "blocked" | "in_progress" | "completed" | "failed";
|
|
4
4
|
export type GjcWorkerStatusState = "idle" | "working" | "blocked" | "done" | "failed" | "draining" | "unknown";
|
|
5
|
+
export type GjcTeamWorkerLifecycleState = "starting" | "ready" | "working" | "draining" | "stopped" | "failed" | "unknown";
|
|
6
|
+
export type GjcTeamShutdownMode = "graceful" | "force" | "abort";
|
|
5
7
|
export declare const GJC_TEAM_DEFAULT_WORKERS = 3;
|
|
6
8
|
export declare const GJC_TEAM_MAX_WORKERS = 20;
|
|
7
9
|
export type GjcTeamWorkerCli = "gjc";
|
|
@@ -33,6 +35,25 @@ export interface GjcTeamTaskClaim {
|
|
|
33
35
|
token: string;
|
|
34
36
|
leased_until: string;
|
|
35
37
|
}
|
|
38
|
+
export type GjcTeamTaskCompletionEvidenceKind = "command" | "inspection" | "artifact";
|
|
39
|
+
export type GjcTeamTaskCompletionEvidenceStatus = "passed" | "failed" | "not_run" | "verified" | "rejected";
|
|
40
|
+
export interface GjcTeamTaskCompletionEvidenceItem {
|
|
41
|
+
kind: GjcTeamTaskCompletionEvidenceKind;
|
|
42
|
+
status: GjcTeamTaskCompletionEvidenceStatus;
|
|
43
|
+
summary: string;
|
|
44
|
+
command?: string;
|
|
45
|
+
artifact?: string;
|
|
46
|
+
location?: string;
|
|
47
|
+
output?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface GjcTeamTaskCompletionEvidence {
|
|
50
|
+
summary: string;
|
|
51
|
+
items: GjcTeamTaskCompletionEvidenceItem[];
|
|
52
|
+
files?: string[];
|
|
53
|
+
notes?: string;
|
|
54
|
+
recorded_by: string;
|
|
55
|
+
recorded_at: string;
|
|
56
|
+
}
|
|
36
57
|
export interface GjcTeamTask {
|
|
37
58
|
id: string;
|
|
38
59
|
subject: string;
|
|
@@ -43,9 +64,13 @@ export interface GjcTeamTask {
|
|
|
43
64
|
assignee?: string;
|
|
44
65
|
owner?: string;
|
|
45
66
|
result?: string;
|
|
67
|
+
completion_evidence?: GjcTeamTaskCompletionEvidence;
|
|
46
68
|
error?: string;
|
|
47
69
|
blocked_by?: string[];
|
|
48
70
|
depends_on?: string[];
|
|
71
|
+
lane?: string;
|
|
72
|
+
required_role?: string;
|
|
73
|
+
allowed_roles?: string[];
|
|
49
74
|
version: number;
|
|
50
75
|
claim?: GjcTeamTaskClaim;
|
|
51
76
|
created_at: string;
|
|
@@ -102,6 +127,22 @@ export interface GjcTeamMonitorSnapshot {
|
|
|
102
127
|
integration_by_worker: Record<string, GjcTeamWorkerIntegrationState>;
|
|
103
128
|
updated_at: string;
|
|
104
129
|
}
|
|
130
|
+
export interface GjcTeamWorkerLifecycle {
|
|
131
|
+
worker: string;
|
|
132
|
+
lifecycle_state: GjcTeamWorkerLifecycleState;
|
|
133
|
+
worker_status_state: GjcWorkerStatusState;
|
|
134
|
+
pane_id?: string;
|
|
135
|
+
pid?: number;
|
|
136
|
+
started_at?: string;
|
|
137
|
+
updated_at: string;
|
|
138
|
+
stopped_at?: string;
|
|
139
|
+
stop_reason?: string;
|
|
140
|
+
shutdown_request_id?: string;
|
|
141
|
+
shutdown_requested_at?: string;
|
|
142
|
+
shutdown_acknowledged_at?: string;
|
|
143
|
+
shutdown_ack_status?: string;
|
|
144
|
+
shutdown_mode?: GjcTeamShutdownMode;
|
|
145
|
+
}
|
|
105
146
|
export type GjcTeamNotificationDeliveryState = "pending" | "sent" | "queued" | "deferred" | "failed" | "delivered" | "acknowledged";
|
|
106
147
|
export type GjcTeamPaneAttemptResult = "sent" | "queued" | "deferred" | "failed";
|
|
107
148
|
export interface GjcTeamNotification {
|
|
@@ -139,9 +180,13 @@ export interface GjcTeamSnapshot {
|
|
|
139
180
|
task_counts: Record<GjcTeamTaskStatus, number>;
|
|
140
181
|
workers: GjcTeamWorker[];
|
|
141
182
|
integration_by_worker?: Record<string, GjcTeamWorkerIntegrationState>;
|
|
183
|
+
worker_lifecycle_by_id: Record<string, GjcTeamWorkerLifecycle>;
|
|
142
184
|
notification_summary: GjcTeamNotificationSummary;
|
|
143
185
|
updated_at: string;
|
|
144
186
|
}
|
|
187
|
+
export interface GjcTeamSnapshotOptions {
|
|
188
|
+
reconcileNotifications?: boolean;
|
|
189
|
+
}
|
|
145
190
|
export interface GjcTeamStartOptions {
|
|
146
191
|
workerCount: number;
|
|
147
192
|
agentType: string;
|
|
@@ -159,6 +204,16 @@ export interface GjcTeamApiClaimResult {
|
|
|
159
204
|
claim_token?: string;
|
|
160
205
|
reason?: string;
|
|
161
206
|
}
|
|
207
|
+
export type GjcTeamLivenessRecoveryReason = "claim_expired" | "stale_heartbeat" | "missing_pane" | "worker_lifecycle_failed" | "worker_lifecycle_stopped";
|
|
208
|
+
export interface GjcTeamRecoveredClaim {
|
|
209
|
+
task_id: string;
|
|
210
|
+
worker: string;
|
|
211
|
+
reasons: GjcTeamLivenessRecoveryReason[];
|
|
212
|
+
}
|
|
213
|
+
export interface GjcTeamLivenessRecoveryResult {
|
|
214
|
+
recovered_claims: GjcTeamRecoveredClaim[];
|
|
215
|
+
stale_workers: Record<string, GjcTeamLivenessRecoveryReason[]>;
|
|
216
|
+
}
|
|
162
217
|
export interface GjcTeamMailboxMessage {
|
|
163
218
|
message_id: string;
|
|
164
219
|
from_worker: string;
|
|
@@ -181,6 +236,19 @@ export interface GjcTeamEvent {
|
|
|
181
236
|
message?: string;
|
|
182
237
|
data?: Record<string, unknown>;
|
|
183
238
|
}
|
|
239
|
+
export interface GjcTeamTraceEvent {
|
|
240
|
+
schema_version: 1;
|
|
241
|
+
trace_id: string;
|
|
242
|
+
span_id: string;
|
|
243
|
+
source_event_id: string;
|
|
244
|
+
event_type: string;
|
|
245
|
+
ts: string;
|
|
246
|
+
worker?: string;
|
|
247
|
+
task_id?: string;
|
|
248
|
+
message?: string;
|
|
249
|
+
evidence_refs?: string[];
|
|
250
|
+
data?: Record<string, unknown>;
|
|
251
|
+
}
|
|
184
252
|
interface WorkerStatusFile {
|
|
185
253
|
state: GjcWorkerStatusState;
|
|
186
254
|
current_task_id?: string;
|
|
@@ -202,8 +270,11 @@ export interface GjcWorkerIntegrationAttemptRequestResult {
|
|
|
202
270
|
head?: string | null;
|
|
203
271
|
status?: GjcWorkerCheckpointClassification["kind"];
|
|
204
272
|
}
|
|
205
|
-
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", "read-worker-heartbeat", "update-worker-heartbeat", "write-worker-inbox", "write-worker-identity", "append-event", "read-events", "await-event", "write-shutdown-request", "read-shutdown-ack", "read-monitor-snapshot", "write-monitor-snapshot", "read-task-approval", "write-task-approval"];
|
|
273
|
+
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", "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"];
|
|
206
274
|
export declare function resolveGjcTeamStateRoot(cwd?: string, env?: NodeJS.ProcessEnv): string;
|
|
275
|
+
export declare function persistGjcTeamModeStateSummary(snapshot: GjcTeamSnapshot, cwd?: string): Promise<void>;
|
|
276
|
+
export declare function recoverGjcTeamStaleClaims(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamLivenessRecoveryResult>;
|
|
277
|
+
type GjcTeamTaskMetadataInput = Partial<Pick<GjcTeamTask, "owner" | "lane" | "required_role" | "allowed_roles" | "depends_on" | "blocked_by">>;
|
|
207
278
|
export declare function resolveGjcTmuxCommand(env?: NodeJS.ProcessEnv): string;
|
|
208
279
|
export declare function resolveGjcWorkerCommand(cwd?: string, env?: NodeJS.ProcessEnv): string;
|
|
209
280
|
export type GjcWorkerCheckpointClassification = {
|
|
@@ -229,7 +300,8 @@ export declare function classifyGjcTeamCheckpointFiles(files: string[]): {
|
|
|
229
300
|
};
|
|
230
301
|
export declare function classifyWorkerCheckpointStatus(cwd: string): GjcWorkerCheckpointClassification;
|
|
231
302
|
export declare function startGjcTeam(options: GjcTeamStartOptions): Promise<GjcTeamSnapshot>;
|
|
232
|
-
export declare function readGjcTeamSnapshot(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamSnapshot>;
|
|
303
|
+
export declare function readGjcTeamSnapshot(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv, options?: GjcTeamSnapshotOptions): Promise<GjcTeamSnapshot>;
|
|
304
|
+
export declare function monitorGjcTeamSnapshot(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamSnapshot>;
|
|
233
305
|
export declare function requestGjcWorkerIntegrationAttempt(cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcWorkerIntegrationAttemptRequestResult>;
|
|
234
306
|
export declare function buildTeamHudSummary(snapshot: GjcTeamSnapshot, latestEvent?: GjcTeamEvent, latestMessage?: GjcTeamMailboxMessage): Promise<WorkflowHudSummary>;
|
|
235
307
|
export declare function monitorGjcTeam(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamSnapshot>;
|
|
@@ -237,11 +309,11 @@ export declare function listGjcTeams(cwd?: string, env?: NodeJS.ProcessEnv): Pro
|
|
|
237
309
|
export declare function shutdownGjcTeam(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamSnapshot>;
|
|
238
310
|
export declare function listGjcTeamTasks(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamTask[]>;
|
|
239
311
|
export declare function readGjcTeamTask(teamName: string, taskId: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamTask>;
|
|
240
|
-
export declare function createGjcTeamTask(teamName: string, subject: string, description: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamTask>;
|
|
241
|
-
export declare function updateGjcTeamTask(teamName: string, taskId: string, updates: Partial<Pick<GjcTeamTask, "subject" | "description" | "blocked_by" | "depends_on">>, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamTask>;
|
|
312
|
+
export declare function createGjcTeamTask(teamName: string, subject: string, description: string, cwd?: string, env?: NodeJS.ProcessEnv, taskOptions?: GjcTeamTaskMetadataInput): Promise<GjcTeamTask>;
|
|
313
|
+
export declare function updateGjcTeamTask(teamName: string, taskId: string, updates: Partial<Pick<GjcTeamTask, "subject" | "description" | "blocked_by" | "depends_on" | "lane" | "required_role" | "allowed_roles">>, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamTask>;
|
|
242
314
|
export declare function claimGjcTeamTask(teamName: string, workerId: string, cwd?: string, env?: NodeJS.ProcessEnv, taskId?: string): Promise<GjcTeamApiClaimResult>;
|
|
243
|
-
export declare function transitionGjcTeamTaskStatus(teamName: string, taskId: string, status: GjcTeamTaskStatus, cwd?: string, env?: NodeJS.ProcessEnv, claimToken?: string, workerId?: string,
|
|
244
|
-
export declare function transitionGjcTeamTask(teamName: string, taskId: string, status: GjcTeamTaskStatus | "complete", cwd?: string, env?: NodeJS.ProcessEnv, claimToken?: string): Promise<GjcTeamTask>;
|
|
315
|
+
export declare function transitionGjcTeamTaskStatus(teamName: string, taskId: string, status: GjcTeamTaskStatus, cwd?: string, env?: NodeJS.ProcessEnv, claimToken?: string, workerId?: string, completionEvidenceInput?: unknown): Promise<GjcTeamTask>;
|
|
316
|
+
export declare function transitionGjcTeamTask(teamName: string, taskId: string, status: GjcTeamTaskStatus | "complete", cwd?: string, env?: NodeJS.ProcessEnv, claimToken?: string, completionEvidenceInput?: unknown): Promise<GjcTeamTask>;
|
|
245
317
|
export declare function releaseGjcTeamTaskClaim(teamName: string, taskId: string, claimToken: string, workerId: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamTask>;
|
|
246
318
|
export declare function replayGjcTeamNotifications(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
247
319
|
notifications: GjcTeamNotification[];
|
|
@@ -252,6 +324,7 @@ export declare function broadcastGjcTeamMessage(teamName: string, fromWorker: st
|
|
|
252
324
|
export declare function listGjcTeamMailbox(teamName: string, worker: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamMailboxMessage[]>;
|
|
253
325
|
export declare function markGjcTeamMailboxMessage(teamName: string, worker: string, messageId: string, field: "delivered_at" | "notified_at", cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamMailboxMessage>;
|
|
254
326
|
export declare function readGjcWorkerStatus(teamName: string, worker: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<WorkerStatusFile>;
|
|
327
|
+
export declare function updateGjcWorkerStatus(teamName: string, worker: string, status: GjcWorkerStatusState, cwd?: string, env?: NodeJS.ProcessEnv, currentTaskId?: string, reason?: string): Promise<WorkerStatusFile>;
|
|
255
328
|
export declare function readGjcWorkerHeartbeat(teamName: string, worker: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<WorkerHeartbeatFile | null>;
|
|
256
329
|
export declare function updateGjcWorkerHeartbeat(teamName: string, worker: string, heartbeat: WorkerHeartbeatFile, cwd?: string, env?: NodeJS.ProcessEnv): Promise<WorkerHeartbeatFile>;
|
|
257
330
|
export declare function writeGjcWorkerInbox(teamName: string, worker: string, content: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
@@ -259,6 +332,7 @@ export declare function writeGjcWorkerInbox(teamName: string, worker: string, co
|
|
|
259
332
|
}>;
|
|
260
333
|
export declare function writeGjcWorkerIdentity(teamName: string, worker: GjcTeamWorker, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamWorker>;
|
|
261
334
|
export declare function readGjcTeamEvents(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamEvent[]>;
|
|
335
|
+
export declare function readGjcTeamTraces(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamTraceEvent[]>;
|
|
262
336
|
export declare function appendGjcTeamEvent(teamName: string, type: string, worker?: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamEvent>;
|
|
263
337
|
export declare function awaitGjcTeamEvent(teamName: string, _timeoutMs?: number, cwd?: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
264
338
|
status: "event" | "timeout";
|
|
@@ -268,7 +342,7 @@ export declare function writeGjcMonitorSnapshot(teamName: string, snapshot: unkn
|
|
|
268
342
|
export declare function readGjcMonitorSnapshot(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<unknown>;
|
|
269
343
|
export declare function writeGjcTaskApproval(teamName: string, taskId: string, approval: Record<string, unknown>, cwd?: string, env?: NodeJS.ProcessEnv): Promise<Record<string, unknown>>;
|
|
270
344
|
export declare function readGjcTaskApproval(teamName: string, taskId: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<Record<string, unknown> | null>;
|
|
271
|
-
export declare function writeGjcShutdownRequest(teamName: string, worker: string, requestedBy: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<Record<string, unknown>>;
|
|
345
|
+
export declare function writeGjcShutdownRequest(teamName: string, worker: string, requestedBy: string, cwd?: string, env?: NodeJS.ProcessEnv, requestId?: string, mode?: GjcTeamShutdownMode, requestedAt?: string): Promise<Record<string, unknown>>;
|
|
272
346
|
export declare function readGjcShutdownAck(teamName: string, worker: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<Record<string, unknown> | null>;
|
|
273
347
|
export declare function executeGjcTeamApiOperation(operation: string, input: Record<string, unknown>, cwd?: string, env?: NodeJS.ProcessEnv): Promise<unknown>;
|
|
274
348
|
export declare function parseTeamLaunchArgs(argv: string[]): GjcTeamStartOptions;
|