@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,239 @@
|
|
|
1
|
+
import type { CanonicalGjcWorkflowSkill } from "../skill-state/active-state";
|
|
2
|
+
import { CANONICAL_GJC_WORKFLOW_SKILLS } from "../skill-state/active-state";
|
|
3
|
+
|
|
4
|
+
export type CommandRefVisibility = "public" | "hidden" | "planned";
|
|
5
|
+
export type CommandRefIncludeWhen = "implemented-only" | "planned";
|
|
6
|
+
|
|
7
|
+
export interface CommandRefCommand {
|
|
8
|
+
tokens: string[];
|
|
9
|
+
rendered: string;
|
|
10
|
+
visibility: CommandRefVisibility;
|
|
11
|
+
includeWhen: CommandRefIncludeWhen;
|
|
12
|
+
note?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CommandRefExample {
|
|
16
|
+
label?: string;
|
|
17
|
+
bytes: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface CommandRefBridge {
|
|
21
|
+
from: string;
|
|
22
|
+
to: string;
|
|
23
|
+
rendered: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface CommandRefBlock {
|
|
27
|
+
skill: CanonicalGjcWorkflowSkill;
|
|
28
|
+
blockId: string;
|
|
29
|
+
sourcePath: string;
|
|
30
|
+
renderOrder: number;
|
|
31
|
+
markers: {
|
|
32
|
+
start: string;
|
|
33
|
+
end: string;
|
|
34
|
+
};
|
|
35
|
+
commands: CommandRefCommand[];
|
|
36
|
+
examples: CommandRefExample[];
|
|
37
|
+
aliasesAndBridges: CommandRefBridge[];
|
|
38
|
+
notes: string[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface RenderedCommandRefBlock {
|
|
42
|
+
skill: CanonicalGjcWorkflowSkill;
|
|
43
|
+
blockId: string;
|
|
44
|
+
markers: CommandRefBlock["markers"];
|
|
45
|
+
bytes: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const skillPath = (skill: CanonicalGjcWorkflowSkill): string =>
|
|
49
|
+
`packages/coding-agent/src/defaults/gjc/skills/${skill}/SKILL.md`;
|
|
50
|
+
|
|
51
|
+
const stateWrite = (skill: CanonicalGjcWorkflowSkill): CommandRefCommand => ({
|
|
52
|
+
tokens: ["gjc", "state", skill, "write", "--input", `'{"current_phase":"handoff"}'`, "--json"],
|
|
53
|
+
rendered: `gjc state ${skill} write --input '{"current_phase":"handoff"}' --json`,
|
|
54
|
+
visibility: "public",
|
|
55
|
+
includeWhen: "implemented-only",
|
|
56
|
+
note: "Marks the workflow ready for the skill-tool chain guard.",
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const stateHandoff = (
|
|
60
|
+
skill: CanonicalGjcWorkflowSkill,
|
|
61
|
+
targets: readonly CanonicalGjcWorkflowSkill[],
|
|
62
|
+
): CommandRefCommand => ({
|
|
63
|
+
tokens: ["gjc", "state", skill, "handoff", "--to", `<${targets.join("|")}>`, "--json"],
|
|
64
|
+
rendered: `gjc state ${skill} handoff --to <${targets.join("|")}> --json`,
|
|
65
|
+
visibility: "public",
|
|
66
|
+
includeWhen: "implemented-only",
|
|
67
|
+
note: "Bridge command run in-process by the skill tool after slash-skill dispatch.",
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const WORKFLOW_COMMAND_REF_BLOCKS: readonly CommandRefBlock[] = [
|
|
71
|
+
{
|
|
72
|
+
skill: "deep-interview",
|
|
73
|
+
blockId: "state",
|
|
74
|
+
sourcePath: skillPath("deep-interview"),
|
|
75
|
+
renderOrder: 10,
|
|
76
|
+
markers: {
|
|
77
|
+
start: "<!-- gjc:cmdref:start state -->",
|
|
78
|
+
end: "<!-- gjc:cmdref:end state -->",
|
|
79
|
+
},
|
|
80
|
+
commands: [
|
|
81
|
+
stateWrite("deep-interview"),
|
|
82
|
+
{
|
|
83
|
+
tokens: [
|
|
84
|
+
"gjc",
|
|
85
|
+
"deep-interview",
|
|
86
|
+
"--write",
|
|
87
|
+
"--stage",
|
|
88
|
+
"final",
|
|
89
|
+
"--slug",
|
|
90
|
+
"{slug}",
|
|
91
|
+
"--spec",
|
|
92
|
+
"<markdown-or-path>",
|
|
93
|
+
"--deliberate",
|
|
94
|
+
"--json",
|
|
95
|
+
],
|
|
96
|
+
rendered:
|
|
97
|
+
"gjc deep-interview --write --stage final --slug {slug} --spec <markdown-or-path> --deliberate --json",
|
|
98
|
+
visibility: "public",
|
|
99
|
+
includeWhen: "implemented-only",
|
|
100
|
+
note: "Sanctioned deliberate deep-interview to ralplan bridge.",
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
examples: [
|
|
104
|
+
{
|
|
105
|
+
label: "handoff state write",
|
|
106
|
+
bytes: '```\ngjc state deep-interview write --input \'{"current_phase":"handoff"}\' --json\n```',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
label: "deliberate bridge",
|
|
110
|
+
bytes: "```\ngjc \\\ndeep-interview --write --stage final --slug {slug} --spec <markdown-or-path> --deliberate --json\n```",
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
aliasesAndBridges: [
|
|
114
|
+
{
|
|
115
|
+
from: "deep-interview",
|
|
116
|
+
to: "ralplan",
|
|
117
|
+
rendered:
|
|
118
|
+
"gjc deep-interview --write --stage final --slug {slug} --spec <markdown-or-path> --deliberate --json",
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
notes: [
|
|
122
|
+
"Before invoking `/skill:ralplan`, `/skill:team`, or `/skill:ultragoal`, persist the final spec and mark deep-interview ready for handoff.",
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
skill: "ralplan",
|
|
127
|
+
blockId: "state",
|
|
128
|
+
sourcePath: skillPath("ralplan"),
|
|
129
|
+
renderOrder: 10,
|
|
130
|
+
markers: { start: "<!-- gjc:cmdref:start state -->", end: "<!-- gjc:cmdref:end state -->" },
|
|
131
|
+
commands: [stateWrite("ralplan"), stateHandoff("ralplan", ["team", "ultragoal"])],
|
|
132
|
+
examples: [
|
|
133
|
+
{
|
|
134
|
+
label: "handoff state write",
|
|
135
|
+
bytes: '```\ngjc state ralplan write --input \'{"current_phase":"handoff"}\' --json\n```',
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
aliasesAndBridges: [
|
|
139
|
+
{ from: "ralplan", to: "team|ultragoal", rendered: "gjc state ralplan handoff --to <team|ultragoal> --json" },
|
|
140
|
+
],
|
|
141
|
+
notes: [
|
|
142
|
+
"Before invoking `/skill:team` or `/skill:ultragoal`, mark ralplan ready for handoff so the skill tool's chain guard permits the transition.",
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
skill: "ultragoal",
|
|
147
|
+
blockId: "state",
|
|
148
|
+
sourcePath: skillPath("ultragoal"),
|
|
149
|
+
renderOrder: 10,
|
|
150
|
+
markers: { start: "<!-- gjc:cmdref:start state -->", end: "<!-- gjc:cmdref:end state -->" },
|
|
151
|
+
commands: [stateWrite("ultragoal"), stateHandoff("ultragoal", ["ralplan", "deep-interview"])],
|
|
152
|
+
examples: [
|
|
153
|
+
{
|
|
154
|
+
label: "handoff state write",
|
|
155
|
+
bytes: '```\ngjc state ultragoal write --input \'{"current_phase":"handoff"}\' --json\n```',
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
aliasesAndBridges: [
|
|
159
|
+
{
|
|
160
|
+
from: "ultragoal",
|
|
161
|
+
to: "ralplan|deep-interview",
|
|
162
|
+
rendered: "gjc state ultragoal handoff --to <ralplan|deep-interview> --json",
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
notes: [
|
|
166
|
+
"When the aggregate ultragoal is complete OR the user requests return to planning/clarification, mark ultragoal ready for handoff.",
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
skill: "team",
|
|
171
|
+
blockId: "state",
|
|
172
|
+
sourcePath: skillPath("team"),
|
|
173
|
+
renderOrder: 10,
|
|
174
|
+
markers: { start: "<!-- gjc:cmdref:start state -->", end: "<!-- gjc:cmdref:end state -->" },
|
|
175
|
+
commands: [stateWrite("team"), stateHandoff("team", ["ralplan", "deep-interview", "ultragoal"])],
|
|
176
|
+
examples: [
|
|
177
|
+
{
|
|
178
|
+
label: "handoff state write",
|
|
179
|
+
bytes: '```\ngjc state team write --input \'{"current_phase":"handoff"}\' --json\n```',
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
aliasesAndBridges: [
|
|
183
|
+
{
|
|
184
|
+
from: "team",
|
|
185
|
+
to: "ralplan|deep-interview|ultragoal",
|
|
186
|
+
rendered: "gjc state team handoff --to <ralplan|deep-interview|ultragoal> --json",
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
notes: [
|
|
190
|
+
"When the team task-set completes OR the user requests return to planning/persistence, mark team ready for handoff.",
|
|
191
|
+
],
|
|
192
|
+
},
|
|
193
|
+
] as const;
|
|
194
|
+
|
|
195
|
+
export function listCommandRefBlocks(skill?: CanonicalGjcWorkflowSkill): CommandRefBlock[] {
|
|
196
|
+
const blocks =
|
|
197
|
+
skill === undefined
|
|
198
|
+
? WORKFLOW_COMMAND_REF_BLOCKS
|
|
199
|
+
: WORKFLOW_COMMAND_REF_BLOCKS.filter(block => block.skill === skill);
|
|
200
|
+
return [...blocks].sort(
|
|
201
|
+
(a, b) => a.skill.localeCompare(b.skill) || a.renderOrder - b.renderOrder || a.blockId.localeCompare(b.blockId),
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export function renderCommandRefBlock(skill: CanonicalGjcWorkflowSkill, blockId = "state"): RenderedCommandRefBlock {
|
|
206
|
+
const block = WORKFLOW_COMMAND_REF_BLOCKS.find(item => item.skill === skill && item.blockId === blockId);
|
|
207
|
+
if (block === undefined) throw new Error(`Unknown command-reference block: ${skill}/${blockId}`);
|
|
208
|
+
|
|
209
|
+
const lines: string[] = [];
|
|
210
|
+
lines.push(block.markers.start);
|
|
211
|
+
lines.push(`### Generated command reference: ${block.blockId}`);
|
|
212
|
+
lines.push("");
|
|
213
|
+
for (const note of block.notes) lines.push(note);
|
|
214
|
+
lines.push("");
|
|
215
|
+
lines.push("Commands:");
|
|
216
|
+
for (const command of block.commands.filter(
|
|
217
|
+
item => item.visibility === "public" && item.includeWhen === "implemented-only",
|
|
218
|
+
)) {
|
|
219
|
+
lines.push(`- \`${command.rendered}\``);
|
|
220
|
+
if (command.note !== undefined) lines.push(` - ${command.note}`);
|
|
221
|
+
}
|
|
222
|
+
lines.push("");
|
|
223
|
+
lines.push("Examples:");
|
|
224
|
+
for (const example of block.examples) {
|
|
225
|
+
if (example.label !== undefined) lines.push(`- ${example.label}:`);
|
|
226
|
+
lines.push(example.bytes);
|
|
227
|
+
}
|
|
228
|
+
lines.push("");
|
|
229
|
+
lines.push("Aliases and bridges:");
|
|
230
|
+
for (const bridge of block.aliasesAndBridges) lines.push(`- ${bridge.from} -> ${bridge.to}: \`${bridge.rendered}\``);
|
|
231
|
+
lines.push(block.markers.end);
|
|
232
|
+
lines.push("");
|
|
233
|
+
|
|
234
|
+
return { skill, blockId: block.blockId, markers: block.markers, bytes: lines.join("\n") };
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export function isCanonicalGjcWorkflowSkill(value: string): value is CanonicalGjcWorkflowSkill {
|
|
238
|
+
return (CANONICAL_GJC_WORKFLOW_SKILLS as readonly string[]).includes(value);
|
|
239
|
+
}
|