@chorus-aidlc/chorus-openclaw-plugin 0.16.3 → 0.17.2
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/dist/commands.js +5 -11
- package/dist/commands.js.map +1 -1
- package/dist/daemon-client.d.ts.map +1 -1
- package/dist/daemon-client.js +7 -4
- package/dist/daemon-client.js.map +1 -1
- package/dist/daemon-rest-client.d.ts +4 -1
- package/dist/daemon-rest-client.d.ts.map +1 -1
- package/dist/daemon-rest-client.js +31 -7
- package/dist/daemon-rest-client.js.map +1 -1
- package/package.json +1 -1
- package/skills/brainstorm/SKILL.md +1 -1
- package/skills/chorus/SKILL.md +2 -2
- package/skills/chorus-cli/SKILL.md +67 -0
- package/skills/code-reviewer/SKILL.md +1 -1
- package/skills/develop/SKILL.md +3 -3
- package/skills/docs/SKILL.md +1 -1
- package/skills/idea/SKILL.md +2 -2
- package/skills/openspec-aware/SKILL.md +90 -45
- package/skills/orchestrate/SKILL.md +1 -1
- package/skills/proposal/SKILL.md +2 -2
- package/skills/proposal-reviewer/SKILL.md +1 -1
- package/skills/quick-dev/SKILL.md +1 -1
- package/skills/review/SKILL.md +1 -1
- package/skills/task-reviewer/SKILL.md +1 -1
- package/skills/yolo/SKILL.md +5 -5
- package/src/commands.ts +21 -21
- package/src/daemon-client.ts +8 -4
- package/src/daemon-rest-client.ts +37 -9
package/dist/commands.js
CHANGED
|
@@ -14,6 +14,7 @@ const PLUGIN_SKILLS = [
|
|
|
14
14
|
{ name: "review", description: "Approve/reject proposals, verify tasks, project governance" },
|
|
15
15
|
{ name: "yolo", description: "Full-auto AI-DLC pipeline — from prompt to done" },
|
|
16
16
|
{ name: "openspec-aware", description: "Opt-in OpenSpec authoring for PM workflows when the openspec CLI is present" },
|
|
17
|
+
{ name: "chorus-cli", description: "Install, configure agents (chorus agents add|remove|list), env vars, and chorus mcp operations" },
|
|
17
18
|
];
|
|
18
19
|
// ===== Formatting helpers =====
|
|
19
20
|
// OpenClaw invokes a skill via a BARE slash command of its SKILL.md `name`
|
|
@@ -34,21 +35,14 @@ function formatSkillsList() {
|
|
|
34
35
|
"Invoke a skill with its slash command, e.g. /develop or /idea.",
|
|
35
36
|
].join("\n");
|
|
36
37
|
}
|
|
37
|
-
// Sum a count across every project bucket in a tracker Record.
|
|
38
|
-
function countTracker(tracker, key) {
|
|
39
|
-
if (!tracker)
|
|
40
|
-
return 0;
|
|
41
|
-
return Object.values(tracker).reduce((total, project) => {
|
|
42
|
-
const items = key === "ideas" ? project.ideas : project.tasks;
|
|
43
|
-
return total + (items?.length ?? 0);
|
|
44
|
-
}, 0);
|
|
45
|
-
}
|
|
46
38
|
function formatStatus(checkin, connectionStatus) {
|
|
47
|
-
const
|
|
39
|
+
const projects = Object.values(checkin?.activeProjects ?? {});
|
|
40
|
+
const activeIdeaTotal = projects.reduce((total, p) => total + (p.activeIdeaCount ?? 0), 0);
|
|
48
41
|
const lines = [
|
|
49
42
|
`Connection: ${connectionStatus}`,
|
|
50
43
|
`Agent: ${checkin?.agent?.name ?? "unknown"}`,
|
|
51
|
-
`
|
|
44
|
+
`Active projects: ${projects.length} (${activeIdeaTotal} active idea(s))`,
|
|
45
|
+
...projects.map((p) => ` - ${p.name ?? "(unnamed)"}: ${p.activeIdeaCount ?? 0}`),
|
|
52
46
|
`Notifications: ${checkin?.notifications?.unread ?? 0} unread`,
|
|
53
47
|
`Skills: ${PLUGIN_SKILLS.map((s) => s.name).join(", ")}`,
|
|
54
48
|
];
|
package/dist/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AA8DA,4BAA4B;AAC5B,EAAE;AACF,uDAAuD;AACvD,6EAA6E;AAC7E,0EAA0E;AAC1E,gDAAgD;AAEhD,MAAM,aAAa,GAAG;I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AcG;IACG,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAoK9C;;;;OAIG;IACH,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAsBlC,OAAO,CAAC,sBAAsB;IAW9B,8DAA8D;IAC9D,OAAO,CAAC,qBAAqB;YAIf,WAAW;YAqBX,cAAc;YAQd,MAAM;IAiBpB,OAAO,CAAC,SAAS;CAIlB;AAMD,kCAAkC;AAClC,wBAAgB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAWpD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE;IACnC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GAAG,MAAM,GAAG,IAAI,CAEhB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAEpF"}
|
package/dist/daemon-client.js
CHANGED
|
@@ -275,7 +275,7 @@ export class OpenClawDaemonClient {
|
|
|
275
275
|
this.emitExecutionSnapshot();
|
|
276
276
|
}
|
|
277
277
|
let advancedToRunning = false;
|
|
278
|
-
await this.advanceTurn(reportSessionId, "running", entity);
|
|
278
|
+
const runningTurnUuid = await this.advanceTurn(reportSessionId, "running", entity);
|
|
279
279
|
advancedToRunning = true;
|
|
280
280
|
const runId = this.nextRunId(contextKey);
|
|
281
281
|
this.logger.info(`[Chorus] Waking agent via embedded run (sessionKey=${sessionKey}, sessionId=${reportSessionId}, ` +
|
|
@@ -333,7 +333,7 @@ export class OpenClawDaemonClient {
|
|
|
333
333
|
// clean, aborted, or crashed). Guarded on advancedToRunning so a never-started wake
|
|
334
334
|
// never attempts an illegal pending→ended transition.
|
|
335
335
|
if (advancedToRunning) {
|
|
336
|
-
await this.advanceTurn(reportSessionId, "ended", entity);
|
|
336
|
+
await this.advanceTurn(reportSessionId, "ended", entity, runningTurnUuid);
|
|
337
337
|
}
|
|
338
338
|
// Interrupt-vs-crash reporting (entity-keyed — only for a reportable resource).
|
|
339
339
|
if (entity) {
|
|
@@ -393,17 +393,20 @@ export class OpenClawDaemonClient {
|
|
|
393
393
|
emitExecutionSnapshot() {
|
|
394
394
|
void this.restClient.executionState({ executions: this.buildExecutionSnapshot() });
|
|
395
395
|
}
|
|
396
|
-
async advanceTurn(sessionId, status, entity) {
|
|
396
|
+
async advanceTurn(sessionId, status, entity, turnUuid = null) {
|
|
397
397
|
try {
|
|
398
|
-
await this.restClient.turnAdvance({
|
|
398
|
+
const outcome = await this.restClient.turnAdvance({
|
|
399
399
|
sessionId,
|
|
400
|
+
...(turnUuid ? { turnUuid } : {}),
|
|
400
401
|
status,
|
|
401
402
|
entityType: entity?.entityType ?? null,
|
|
402
403
|
entityUuid: entity?.entityUuid ?? null,
|
|
403
404
|
});
|
|
405
|
+
return typeof outcome.data?.turnUuid === "string" ? outcome.data.turnUuid : null;
|
|
404
406
|
}
|
|
405
407
|
catch (err) {
|
|
406
408
|
this.logger.warn(`[Chorus] advanceTurn failed for session ${sessionId} → ${status}: ${err}`);
|
|
409
|
+
return null;
|
|
407
410
|
}
|
|
408
411
|
}
|
|
409
412
|
async postTranscript(sessionId, messages) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-client.js","sourceRoot":"","sources":["../src/daemon-client.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gFAAgF;AAChF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,IAAI,UAAU,EAAE,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,GAGxB;IACC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;IACvC,IACE,OAAO,UAAU,KAAK,QAAQ;QAC9B,OAAO,UAAU,KAAK,QAAQ;QAC9B,UAAU,CAAC,MAAM,GAAG,CAAC;QACrB,sBAAsB,CAAC,GAAG,CAAC,UAAU,CAAC,EACtC,CAAC;QACD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IACpC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,GAG/B;IACC,OAAO,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC;AACtD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAAmB,EAAE,cAAsB;IAC1E,OAAO,GAAG,cAAc,WAAW,WAAW,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -74,13 +74,16 @@ export interface CreateDaemonRestClientOptions {
|
|
|
74
74
|
export interface DaemonRestClient {
|
|
75
75
|
turnAdvance(p: {
|
|
76
76
|
sessionId: string;
|
|
77
|
+
turnUuid?: string | null;
|
|
77
78
|
status: "running" | "ended" | "interrupted";
|
|
78
79
|
entityType?: string | null;
|
|
79
80
|
entityUuid?: string | null;
|
|
80
81
|
interruptedReason?: "user" | "crash" | "shutdown" | null;
|
|
81
82
|
transcriptRelayError?: string | null;
|
|
82
83
|
usage?: TokenUsage | null;
|
|
83
|
-
}): Promise<DaemonRestResult
|
|
84
|
+
}): Promise<DaemonRestResult<{
|
|
85
|
+
turnUuid: string;
|
|
86
|
+
}>>;
|
|
84
87
|
transcript(p: {
|
|
85
88
|
sessionId: string;
|
|
86
89
|
messages: DaemonTranscriptMessage[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-rest-client.d.ts","sourceRoot":"","sources":["../src/daemon-rest-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"daemon-rest-client.d.ts","sourceRoot":"","sources":["../src/daemon-rest-client.ts"],"names":[],"mappings":"AAgDA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAID,iFAAiF;AACjF,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,iFAAiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAG5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,MA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,EAAE,uBAAuB,EAAE,CAAC;KACrC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC9B,cAAc,CAAC,CAAC,EAAE;QAAE,UAAU,EAAE,kBAAkB,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnF,eAAe,CAAC,CAAC,EAAE;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;KAC1B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC9B,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC;QAAE,KAAK,EAAE,iBAAiB,EAAE,CAAA;KAAE,CAAC,CAAC,CAAC;CAC/E;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,6BAA6B,GAAG,gBAAgB,CAqN5F"}
|
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
// The two files are kept in lock-step by the spec's "single source of truth for
|
|
15
15
|
// the payload shapes" requirement; a drift would be caught by T5 (live e2e).
|
|
16
16
|
//
|
|
17
|
-
// The
|
|
18
|
-
// cli/daemon-rest-client.mjs
|
|
17
|
+
// The operations and payload fields this client supports (kept aligned with
|
|
18
|
+
// cli/daemon-rest-client.mjs and accepted by src/app/api/daemon/*/route.ts):
|
|
19
19
|
// turnAdvance → POST /api/daemon/turn-advance
|
|
20
|
-
// { connectionUuid, sessionId, status,
|
|
20
|
+
// { connectionUuid, sessionId, status, turnUuid?,
|
|
21
|
+
// entityType?, entityUuid?, interruptedReason?,
|
|
22
|
+
// transcriptRelayError?, usage? }
|
|
21
23
|
// transcript → POST /api/daemon/transcript
|
|
22
24
|
// { sessionId, messages: [{ role, text }] }
|
|
23
25
|
// executionState → POST /api/daemon/execution-state
|
|
@@ -27,6 +29,8 @@
|
|
|
27
29
|
// startedAt|null }] }
|
|
28
30
|
// reportInterrupt → POST /api/daemon/report-interrupt
|
|
29
31
|
// { connectionUuid, entityType, entityUuid, reason }
|
|
32
|
+
// heartbeat → POST /api/daemon/connection-heartbeat
|
|
33
|
+
// { connectionUuid, connectedAt }
|
|
30
34
|
// readPendingTurns → GET /api/daemon/pending-turns?connectionUuid=…
|
|
31
35
|
// → { turns: [{ turnUuid, sessionId, directIdeaUuid, trigger,
|
|
32
36
|
// promptText }] }
|
|
@@ -62,7 +66,7 @@ export function createDaemonRestClient(opts) {
|
|
|
62
66
|
* IDENTICAL across all four POST endpoints; only the `op` label and the path
|
|
63
67
|
* differ. Never throws — returns a structured {@link DaemonRestResult}.
|
|
64
68
|
*/
|
|
65
|
-
async function post(op, path, body, successLog, context = "") {
|
|
69
|
+
async function post(op, path, body, successLog, context = "", readData = false) {
|
|
66
70
|
let response;
|
|
67
71
|
try {
|
|
68
72
|
response = await fetchImpl(`${url}${path}`, {
|
|
@@ -83,9 +87,19 @@ export function createDaemonRestClient(opts) {
|
|
|
83
87
|
logger.warn(`[Chorus] ${error}`);
|
|
84
88
|
return { ok: false, status: response.status, error };
|
|
85
89
|
}
|
|
90
|
+
let data;
|
|
91
|
+
if (readData) {
|
|
92
|
+
try {
|
|
93
|
+
const parsed = (await response.json());
|
|
94
|
+
data = parsed && typeof parsed === "object" ? parsed.data : undefined;
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
logger.warn(`[Chorus] ${op} response correlation unavailable: ${err}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
86
100
|
if (successLog)
|
|
87
101
|
logger.info(`[Chorus] ${successLog}`);
|
|
88
|
-
return { ok: true, status: response.status };
|
|
102
|
+
return { ok: true, status: response.status, ...(data !== undefined ? { data } : {}) };
|
|
89
103
|
}
|
|
90
104
|
return {
|
|
91
105
|
/**
|
|
@@ -96,7 +110,7 @@ export function createDaemonRestClient(opts) {
|
|
|
96
110
|
* normalized `usage` (daemon-token-usage) — byte-for-byte the CLI client's shape.
|
|
97
111
|
* Requires the connectionUuid.
|
|
98
112
|
*/
|
|
99
|
-
async turnAdvance({ sessionId, status, entityType, entityUuid, interruptedReason, transcriptRelayError, usage }) {
|
|
113
|
+
async turnAdvance({ sessionId, turnUuid, status, entityType, entityUuid, interruptedReason, transcriptRelayError, usage }) {
|
|
100
114
|
const connectionUuid = getConnectionUuid();
|
|
101
115
|
if (!connectionUuid) {
|
|
102
116
|
const error = `cannot advance turn for session ${sessionId} → ${status} — no connection uuid yet`;
|
|
@@ -110,6 +124,7 @@ export function createDaemonRestClient(opts) {
|
|
|
110
124
|
connectionUuid,
|
|
111
125
|
sessionId,
|
|
112
126
|
status,
|
|
127
|
+
...(turnUuid ? { turnUuid } : {}),
|
|
113
128
|
// Only sent when BOTH are present, so the server never gets a partial linkage.
|
|
114
129
|
...(entityType && entityUuid ? { entityType, entityUuid } : {}),
|
|
115
130
|
// Only meaningful alongside status=interrupted; never sent otherwise.
|
|
@@ -119,7 +134,16 @@ export function createDaemonRestClient(opts) {
|
|
|
119
134
|
// The whole normalized TokenUsage object, nested under `usage`, only on a terminal edge.
|
|
120
135
|
...(usage && isTerminal ? { usage } : {}),
|
|
121
136
|
};
|
|
122
|
-
|
|
137
|
+
const result = await post("turn-advance", "/api/daemon/turn-advance", body, `advanced turn for session ${sessionId} → ${status}`, "", status === "running");
|
|
138
|
+
const resolvedTurnUuid = typeof result.data?.turn?.uuid === "string" ? result.data.turn.uuid : null;
|
|
139
|
+
if (status !== "running") {
|
|
140
|
+
const { data: _rawData, ...baseResult } = result;
|
|
141
|
+
return baseResult;
|
|
142
|
+
}
|
|
143
|
+
const { data: _rawData, ...baseResult } = result;
|
|
144
|
+
return resolvedTurnUuid
|
|
145
|
+
? { ...baseResult, data: { turnUuid: resolvedTurnUuid } }
|
|
146
|
+
: baseResult;
|
|
123
147
|
},
|
|
124
148
|
/**
|
|
125
149
|
* POST /api/daemon/transcript — append finalized user/assistant text to the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-rest-client.js","sourceRoot":"","sources":["../src/daemon-rest-client.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,iFAAiF;AACjF,uDAAuD;AACvD,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,kEAAkE;AAClE,gFAAgF;AAChF,iFAAiF;AACjF,iFAAiF;AACjF,mFAAmF;AACnF,kFAAkF;AAClF,iFAAiF;AACjF,gFAAgF;AAChF,6EAA6E;AAC7E,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"daemon-rest-client.js","sourceRoot":"","sources":["../src/daemon-rest-client.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,iFAAiF;AACjF,uDAAuD;AACvD,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,kEAAkE;AAClE,gFAAgF;AAChF,iFAAiF;AACjF,iFAAiF;AACjF,mFAAmF;AACnF,kFAAkF;AAClF,iFAAiF;AACjF,gFAAgF;AAChF,6EAA6E;AAC7E,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,qDAAqD;AACrD,uEAAuE;AACvE,uEAAuE;AACvE,yDAAyD;AACzD,mDAAmD;AACnD,iEAAiE;AACjE,wDAAwD;AACxD,gFAAgF;AAChF,2EAA2E;AAC3E,qFAAqF;AACrF,4EAA4E;AAC5E,yDAAyD;AACzD,0EAA0E;AAC1E,6DAA6D;AAC7D,uDAAuD;AACvD,uEAAuE;AACvE,mFAAmF;AACnF,qDAAqD;AACrD,EAAE;AACF,kDAAkD;AAClD,qFAAqF;AACrF,uFAAuF;AACvF,yDAAyD;AACzD,gFAAgF;AAChF,mFAAmF;AACnF,qFAAqF;AACrF,6CAA6C;AAC7C,qFAAqF;AACrF,yDAAyD;AAQzD,MAAM,WAAW,GAAqB,EAAE,IAAI,KAAI,CAAC,EAAE,IAAI,KAAI,CAAC,EAAE,KAAK,KAAI,CAAC,EAAE,CAAC;AAuG3E;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAmC;IACxE,MAAM,GAAG,GAAG,IAAI,CAAC,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E,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAA4B,EAAE,EAAE,CAAC;QAC9F,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/skills/chorus/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: Chorus AI Agent collaboration platform — overview, common tools,
|
|
|
4
4
|
license: AGPL-3.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: chorus
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.17.2"
|
|
8
8
|
category: project-management
|
|
9
9
|
mcp_server: chorus
|
|
10
10
|
---
|
|
@@ -130,7 +130,7 @@ Projects can be organized into **Project Groups** — a single-level grouping th
|
|
|
130
130
|
|
|
131
131
|
### Reports
|
|
132
132
|
|
|
133
|
-
A **report** is a short idea-completion summary persisted as a `type="report"` Document at end-of-Idea, authored via `chorus_create_report` (gated on `document:write`). The `content`
|
|
133
|
+
A **report** is a short idea-completion summary persisted as a `type="report"` Document at end-of-Idea, authored via `chorus_create_report` (gated on `document:write`). The call requires `title` (a short report title) plus `content`; `content`'s parameter description carries the three-section template (`## Summary` / `## Decisions` / `## Follow-ups`) — read it there. `/yolo` writes one mandatorily; `/develop` offers it advisorily on last-task verify.
|
|
134
134
|
|
|
135
135
|
### References
|
|
136
136
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chorus-cli
|
|
3
|
+
description: How to install, configure, and use the `chorus` CLI — install it, manage agents with `chorus agents` (add/remove/list), the connection environment variables, and MCP operations via `chorus mcp`. A concise shared reference for any flow that drives Chorus from the shell.
|
|
4
|
+
license: AGPL-3.0
|
|
5
|
+
metadata:
|
|
6
|
+
author: chorus
|
|
7
|
+
version: "0.17.2"
|
|
8
|
+
category: project-management
|
|
9
|
+
mcp_server: chorus
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# chorus-cli — using the `chorus` CLI
|
|
13
|
+
|
|
14
|
+
`chorus` (published as `@chorus-aidlc/chorus`) is the one command that configures this
|
|
15
|
+
machine's coding agents for Chorus and talks to the Chorus MCP endpoint from the shell.
|
|
16
|
+
This is a concise reference — run `chorus --help` and `chorus <command> --help` for the
|
|
17
|
+
full flag surface.
|
|
18
|
+
|
|
19
|
+
## 1. Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -g @chorus-aidlc/chorus # unpinned — always installs the latest
|
|
23
|
+
chorus --version # must be >= 0.17.0 (provides `chorus agents` + `chorus mcp`)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 2. Configure agents — `chorus agents`
|
|
27
|
+
|
|
28
|
+
Agent configuration lives in `~/.chorus/daemon.json`; `chorus agents` is the CRUD group:
|
|
29
|
+
|
|
30
|
+
- `chorus agents` (or `chorus agents list`) — list configured agents (name, UUID, backend).
|
|
31
|
+
The API key is never printed; the agent named by `CHORUS_AGENT_PROFILE` is marked.
|
|
32
|
+
- `chorus agents add [--agents <ids>] [--all] [--url <u>] [--api-key <cho_…>] [--yes] [--dsh-profile <name>]`
|
|
33
|
+
— detect installed coding agents, install each one's Chorus plugin, and seed credentials
|
|
34
|
+
(this is the former `chorus init`). Idempotent; safe to re-run. `--help` lists every flag.
|
|
35
|
+
- `chorus agents remove <name|uuid>` — remove a configured agent from `~/.chorus/daemon.json`
|
|
36
|
+
(matched by UUID or name; an ambiguous name → use the UUID).
|
|
37
|
+
|
|
38
|
+
- `chorus agents run --name <name|uuid> [--type <type>] [--] [agent args…]` — launch a
|
|
39
|
+
configured agent's binary in the FOREGROUND with its Chorus connection injected into the
|
|
40
|
+
child only (`CHORUS_URL` / `CHORUS_API_KEY` / `CHORUS_AGENT_PROFILE`; nothing is exported to
|
|
41
|
+
the parent shell, and the key is never printed). Agent selection: single agent by default; else `--name`, else `CHORUS_AGENT_PROFILE`; ambiguous/none →
|
|
42
|
+
error. Backend defaults to the agent's stored `agentType`, overridable with `--type`.
|
|
43
|
+
Everything after `--` is passed to the agent **verbatim** (never inspected). Type → binary:
|
|
44
|
+
`claude-code`/`claude`→`claude`, `codex`→`codex`, `kiro`→`kiro-cli`, `pi`→`pi`,
|
|
45
|
+
`opencode`→`opencode`, `openclaw`→`openclaw`, `dsh`→`dsh-jsonrpc-agent`. Agents added as
|
|
46
|
+
opencode/openclaw/dsh are stored as `offline` → pass `--type` explicitly to launch them.
|
|
47
|
+
|
|
48
|
+
## 3. Connection environment variables
|
|
49
|
+
|
|
50
|
+
- `CHORUS_URL` — the Chorus instance URL.
|
|
51
|
+
- `CHORUS_API_KEY` — an agent API key (`cho_…`).
|
|
52
|
+
- `CHORUS_AGENT_PROFILE` — optional name or UUID of the agent to act as. When set, `chorus mcp`
|
|
53
|
+
resolves that agent's key from `~/.chorus/daemon.json`, so you need not export
|
|
54
|
+
`CHORUS_API_KEY` for the CLI path. Daemon-woken sessions receive it automatically.
|
|
55
|
+
|
|
56
|
+
## 4. MCP operations — `chorus mcp`
|
|
57
|
+
|
|
58
|
+
Call any Chorus MCP tool from the shell — a byte-exact, token-free path for large content:
|
|
59
|
+
|
|
60
|
+
- `chorus mcp call <tool> ['<json>'] [--arg-file key=<file>] [--agent <name|uuid>]` — call a tool.
|
|
61
|
+
`--arg-file content=<file>` streams a file's raw bytes into the JSON `content` string (no
|
|
62
|
+
re-typing through the model). Identity resolves from `--agent` → `CHORUS_AGENT_PROFILE` →
|
|
63
|
+
`CHORUS_URL`+`CHORUS_API_KEY` → a single configured agent.
|
|
64
|
+
- `chorus mcp whoami` — print this agent's own UUID.
|
|
65
|
+
- `chorus mcp list` — list the tools this agent may call.
|
|
66
|
+
|
|
67
|
+
Requires `chorus >= 0.17.0` (the `chorus mcp` subcommand). See `chorus mcp --help`.
|
package/skills/develop/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: Chorus Development workflow — claim tasks, report work, manage se
|
|
|
4
4
|
license: AGPL-3.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: chorus
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.17.2"
|
|
8
8
|
category: project-management
|
|
9
9
|
mcp_server: chorus
|
|
10
10
|
---
|
|
@@ -146,7 +146,7 @@ Each task and proposal includes a `commentCount` field — use it to decide whic
|
|
|
146
146
|
chorus_get_documents({ projectUuid: "<project-uuid>" })
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
> **Document update flow (OpenSpec mode):** if the originating proposal `description` contains a line `OpenSpec change slug: <slug>`, the project's PRD / tech_design / spec Documents are **mirrors** of files under `openspec/changes/<slug>/`. To update such a Document (e.g. clarify an AC, fix a spec scenario before resubmitting), load the `openspec-aware` skill and follow §3.8: edit the local `.md` file first, then mirror
|
|
149
|
+
> **Document update flow (OpenSpec mode):** if the originating proposal `description` contains a line `OpenSpec change slug: <slug>`, the project's PRD / tech_design / spec Documents are **mirrors** of files under `openspec/changes/<slug>/`. To update such a Document (e.g. clarify an AC, fix a spec scenario before resubmitting), load the `openspec-aware` skill and follow §3.8: edit the local `.md` file first, then mirror it — prefer `chorus mcp call … --arg-file content=<file>`, falling back to the `chorus-api.sh` wrapper with `json_encode_file` when `chorus` is not on `PATH` — with `chorus_check_response` halting on error. (OpenClaw runs `openspec-aware`'s detection inline — there is no SessionStart hook; see `openspec-aware` §1.)
|
|
150
150
|
>
|
|
151
151
|
> **⛔ Do not** call `chorus_pm_update_document` directly from the MCP harness with a hand-typed `content` field in OpenSpec mode. The local file is the source of truth; agent-typed content drifts and burns tokens (`openspec-aware` §2 Rule 1).
|
|
152
152
|
>
|
|
@@ -279,7 +279,7 @@ Once Admin verifies (status: `done`), move to the next available task (back to S
|
|
|
279
279
|
|
|
280
280
|
### Step 11: Idea Completion Report (advisory)
|
|
281
281
|
|
|
282
|
-
If the task you just self-verified was the LAST one of its Idea (every Task across every approved Proposal is now `done`/`closed`) and you have `document:write`, offer to call `chorus_create_report`. On OpenClaw, ask the user as a plain-text prompt (e.g. "This was the last task of the idea. Want me to write a completion report? Reply yes/no.") — there is no `AskUserQuestion` primitive. The `content`
|
|
282
|
+
If the task you just self-verified was the LAST one of its Idea (every Task across every approved Proposal is now `done`/`closed`) and you have `document:write`, offer to call `chorus_create_report`. On OpenClaw, ask the user as a plain-text prompt (e.g. "This was the last task of the idea. Want me to write a completion report? Reply yes/no.") — there is no `AskUserQuestion` primitive. The call requires `title` (a short report title) plus `content`; `content`'s parameter description carries the three-section template (`## Summary` / `## Decisions` / `## Follow-ups`). Skip on decline.
|
|
283
283
|
|
|
284
284
|
---
|
|
285
285
|
|
package/skills/docs/SKILL.md
CHANGED
package/skills/idea/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: Chorus Idea workflow — claim ideas, run elaboration rounds, and p
|
|
|
4
4
|
license: AGPL-3.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: chorus
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.17.2"
|
|
8
8
|
category: project-management
|
|
9
9
|
mcp_server: chorus
|
|
10
10
|
---
|
|
@@ -41,7 +41,7 @@ All post-elaboration progress (planning, building, verifying, done) is **derived
|
|
|
41
41
|
| `chorus_edit_idea` | Edit an existing idea's title, description, and/or lineage parent. `parentUuid`: another same-project idea to reparent under, `null` to detach to top-level, omit to leave unchanged (cycle-checked + same-project). Single-parent **weak** lineage — a parent shows a read-only `+N derived` rollup but never blocks either idea's flow. Records an "edited" activity and signals presence. |
|
|
42
42
|
| `chorus_claim_idea` | Claim an open idea (open -> elaborating) |
|
|
43
43
|
| `chorus_release_idea` | Release a claimed idea (elaborating -> open) |
|
|
44
|
-
| `chorus_pm_assign_idea` | Assign an idea to an agent (must hold `idea:write`) or a user, on a human's behalf — the counterpart to `chorus_claim_idea` (self-claim). Silently takes over any existing assignee; an `open` idea moves to `elaborating`, any other status is preserved. Optional `instanceUuid` pins an **agent** assignment to a specific AgentInstance (agent-only)
|
|
44
|
+
| `chorus_pm_assign_idea` | Assign an idea to an agent (must hold `idea:write`) or a user, on a human's behalf — the counterpart to `chorus_claim_idea` (self-claim). Silently takes over any existing assignee; an `open` idea moves to `elaborating`, any other status is preserved. Optional `instanceUuid` pins an **agent** assignment to a specific AgentInstance (agent-only) — but a project-fixed cwd target configured for the owner takes precedence and supplies the instance automatically, overriding `instanceUuid`. Assigning a **new** owner wakes it best-effort (offline still persists the assignment); re-assigning the same owner may update its pin/cwd but is wake-deduplicated. Assigning to a user notifies them with no daemon wake. Requires `idea:admin`. |
|
|
45
45
|
| `chorus_move_idea` | Move an Idea to a different Project. Cascade-migrates the Idea **and its full lineage subtree** (all descendant Ideas; the moved root is detached from any parent left behind), all linked Proposals (any status), all materialized Documents and Tasks, and all related Activities atomically. Comments, TaskDependency, AcceptanceCriterion, AgentSession, SessionTaskCheckin, Notification history, and Task assignees are NOT modified. Returns `moved: { ideas, proposals, documents, tasks, activities }` counts. Requires `idea:write` only — no project-level checks. |
|
|
46
46
|
|
|
47
47
|
**Requirements Elaboration:**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: openspec-aware
|
|
3
|
-
description: Opt-in OpenSpec-mode authoring for Chorus PM workflows on OpenClaw. Runs inline three-check detection for the local `openspec` CLI, scaffolds `openspec/changes/<slug>/` on disk, and mirrors Markdown files into Chorus document drafts via
|
|
3
|
+
description: Opt-in OpenSpec-mode authoring for Chorus PM workflows on OpenClaw. Runs inline three-check detection for the local `openspec` CLI, scaffolds `openspec/changes/<slug>/` on disk, and mirrors Markdown files into Chorus document drafts via `chorus mcp call --arg-file` (bash `chorus-api.sh` wrapper as fallback). Required reading for the proposal, develop, and yolo skills whenever the user has the `openspec` CLI installed.
|
|
4
4
|
license: AGPL-3.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: chorus
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.17.2"
|
|
8
8
|
category: project-management
|
|
9
9
|
mcp_server: chorus
|
|
10
10
|
---
|
|
@@ -16,7 +16,7 @@ This skill is a **shared sub-procedure** invoked by the Chorus stage skills (pro
|
|
|
16
16
|
- Activates when **all three** signals hold (see §1): `CHORUS_OPENSPEC_MODE` is not `off`, an `openspec/` directory exists at the project root, and the `openspec` CLI is on `PATH`.
|
|
17
17
|
- Otherwise the calling skill falls back to its existing free-form behavior.
|
|
18
18
|
|
|
19
|
-
> **Tool namespace:** Chorus MCP tools are exposed under a `chorus__` prefix on OpenClaw (e.g. `chorus__chorus_pm_create_proposal`). Bare names are used in prose for readability — prepend `chorus__` when invoking the MCP tools directly. **Document-mirror calls do NOT go through the MCP harness at all** — they go through the `chorus-api.sh` wrapper (see §2 Rule 1), which
|
|
19
|
+
> **Tool namespace:** Chorus MCP tools are exposed under a `chorus__` prefix on OpenClaw (e.g. `chorus__chorus_pm_create_proposal`). Bare names are used in prose for readability — prepend `chorus__` when invoking the MCP tools directly. **Document-mirror calls do NOT go through the MCP harness at all** — they go through the `chorus` CLI (`chorus mcp call`, preferred) or the `chorus-api.sh` wrapper (fallback) (see §2 Rule 1), which talk to the Chorus MCP endpoint over HTTP using your API key, independent of the `chorus__` namespacing.
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
@@ -63,25 +63,28 @@ Run this detection inline whenever proposal / develop / yolo reference this skil
|
|
|
63
63
|
|
|
64
64
|
Both are enforced at review time. Both have caused incidents in past releases.
|
|
65
65
|
|
|
66
|
-
### Rule 1 —
|
|
66
|
+
### Rule 1 — Fill `content` from the file (CLI preferred, bash-wrapper fallback); never re-type document content from agent output
|
|
67
67
|
|
|
68
|
-
Document/draft mirror calls (`chorus_pm_add_document_draft`, `chorus_pm_update_document_draft`, `chorus_pm_update_document`) **MUST**
|
|
68
|
+
Document/draft mirror calls (`chorus_pm_add_document_draft`, `chorus_pm_update_document_draft`, `chorus_pm_update_document`) **MUST** fill the `content` field from the local file's bytes, never from a hand-typed body. Calling these tools directly from the agent's MCP harness with a hand-typed `content` field is a **protocol violation** for OpenSpec mode and will fail review. Use whichever transport is available, preferred first:
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
chorus-api.sh mcp-tool <tool_name> "$PAYLOAD"
|
|
72
|
-
|
|
70
|
+
- **Primary — the `chorus` CLI:** `chorus mcp call <tool_name> '<json-without-content>' --arg-file content=<file>`. `--arg-file content=<path>` reads the file's raw bytes and injects them as the JSON `content` string, byte-exact — the CLI's built-in replacement for `json_encode_file`, so no helper is needed. `chorus mcp call` reads the same `CHORUS_URL` / `CHORUS_API_KEY` from the environment (availability note below). See §3.6. **Requires chorus >= 0.17.0** (the `chorus mcp` subcommand was added then; an older CLI errors with "unknown command"); on any version or unknown-command failure, upgrade with `npm install -g @chorus-aidlc/chorus`.
|
|
71
|
+
- **Fallback — the `chorus-api.sh` wrapper, when `chorus` is not on `PATH`:** build `$PAYLOAD` with the `json_encode_file` helper and call `chorus-api.sh mcp-tool <tool_name> "$PAYLOAD"`. Defined in the §3.6 fallback block.
|
|
72
|
+
|
|
73
|
+
> **New to the `chorus` CLI?** See the **`chorus-cli`** skill for install, configuring agents (`chorus agents add|remove|list`), the connection env vars, and `chorus mcp` basics.
|
|
74
|
+
|
|
75
|
+
> **Acting identity — which agent the call acts as.** `chorus mcp call` resolves the agent from, in order: `CHORUS_AGENT_PROFILE` (a name or UUID) → `CHORUS_URL` + `CHORUS_API_KEY` in the environment → the single agent configured in `~/.chorus/daemon.json`. A daemon-woken session already has `CHORUS_AGENT_PROFILE` set. If a mirror call fails with `Multiple agents … specify --agent` (several agents configured and no profile/creds in the env), pass your own identity explicitly: `chorus mcp call <tool> … --agent <your-agentUuid>` — your UUID is in your `chorus_checkin` result, and `chorus agents` lists every configured name/UUID.
|
|
73
76
|
|
|
74
|
-
|
|
77
|
+
Reasons (they apply to both paths):
|
|
75
78
|
|
|
76
|
-
1. **Token cost.** Re-typing a multi-thousand-line markdown body through the LLM burns input + output tokens for every draft.
|
|
77
|
-
2. **Byte-equality.** `jq -Rs '.'` is a byte-faithful encoder: backslashes, quotes, newlines, code-fence content, zero-width chars all survive. LLM re-emission has a non-zero failure rate on long markdown — table alignment drifts, fence escapes get "fixed", long URLs wrap. The byte-equality guarantee (modulo trailing `\n`) holds **only** on
|
|
78
|
-
3. **Single source of truth.** With
|
|
79
|
+
1. **Token cost.** Re-typing a multi-thousand-line markdown body through the LLM burns input + output tokens for every draft. Both the CLI's `--arg-file` and the fallback's `json_encode_file` stream the file's bytes into the JSON string — content never enters LLM context. A typical 3-doc proposal mirror costs roughly zero content-tokens this way; via direct MCP with a re-typed body it routinely costs 20k+.
|
|
80
|
+
2. **Byte-equality.** A file-fill path (CLI `--arg-file`, or the fallback's `jq -Rs '.'`) is a byte-faithful encoder: backslashes, quotes, newlines, code-fence content, zero-width chars all survive. LLM re-emission has a non-zero failure rate on long markdown — table alignment drifts, fence escapes get "fixed", long URLs wrap. The byte-equality guarantee (modulo trailing `\n`) holds **only** on a file-fill path, never on LLM re-emission.
|
|
81
|
+
3. **Single source of truth.** With a file-fill mirror, the local `openspec/changes/<slug>/*.md` is authoritative and Chorus is a mirror. With agent re-typing, authority splits between local file and whatever the LLM happened to output — a future diff cannot tell which one is correct.
|
|
79
82
|
|
|
80
|
-
> **`chorus-api.sh` availability on OpenClaw.**
|
|
81
|
-
> - call
|
|
83
|
+
> **`chorus` / `chorus-api.sh` availability on OpenClaw.** The document-mirror transport is either the `chorus` CLI (preferred) or the `chorus-api.sh` wrapper (fallback). The wrapper must be reachable as `chorus-api.sh` on `PATH` (the Chorus standalone skill bundle ships it; if you installed via that bundle it is already on `PATH`). If neither `chorus` nor `chorus-api.sh` is on `PATH` in your OpenClaw environment, do one of:
|
|
84
|
+
> - call the wrapper by its absolute path (e.g. `"$HOME/.chorus/bin/chorus-api.sh" mcp-tool ...`), or
|
|
82
85
|
> - reproduce its single behavior inline — POST a JSON-RPC `tools/call` for `<tool_name>` with arguments `$PAYLOAD` to `"$CHORUS_URL/api/mcp"` with header `Authorization: Bearer $CHORUS_API_KEY` using `curl`, capturing the raw body for the §6 halt-on-error check.
|
|
83
86
|
>
|
|
84
|
-
>
|
|
87
|
+
> Both `chorus mcp call` and the wrapper read `CHORUS_URL` and `CHORUS_API_KEY` from the environment (same values as your plugin config `chorusUrl` / `apiKey`). Export them before the first call if they are not already set. What you must NOT do is re-type the document body through the model — the file-fill rule stands regardless of which transport you use.
|
|
85
88
|
|
|
86
89
|
### Rule 2 — Halt on error via `chorus_check_response`
|
|
87
90
|
|
|
@@ -196,25 +199,12 @@ Optional:
|
|
|
196
199
|
openspec validate "$SLUG"
|
|
197
200
|
```
|
|
198
201
|
|
|
199
|
-
### 3.4
|
|
202
|
+
### 3.4 Filling the `content` field byte-exact
|
|
200
203
|
|
|
201
|
-
|
|
204
|
+
The document `content` must be inserted **byte-for-byte** from the local file — never re-typed by the LLM. Two mechanisms, preferred first:
|
|
202
205
|
|
|
203
|
-
|
|
204
|
-
json_encode_file()
|
|
205
|
-
local _path="$1"
|
|
206
|
-
if command -v jq >/dev/null 2>&1; then
|
|
207
|
-
jq -Rs '.' < "$_path"
|
|
208
|
-
else
|
|
209
|
-
local _content
|
|
210
|
-
_content=$(cat "$_path")
|
|
211
|
-
_content=${_content//\\/\\\\}
|
|
212
|
-
_content=${_content//\"/\\\"}
|
|
213
|
-
_content=${_content//$'\n'/\\n}
|
|
214
|
-
printf '"%s"' "$_content"
|
|
215
|
-
fi
|
|
216
|
-
}
|
|
217
|
-
```
|
|
206
|
+
- **Primary — `chorus mcp call … --arg-file content=<path>`** (§3.6). The CLI reads the file's raw bytes and injects them as the JSON `content` string. This is the byte-faithful replacement for `json_encode_file`, so on the CLI path **no helper is needed** — pass the base JSON without a `content` field and let `--arg-file` fill it.
|
|
207
|
+
- **Fallback — `json_encode_file`** (defined in the §3.6 fallback block, used only when `chorus` is not on `PATH`). With `jq` available it streams the file through `jq -Rs '.'`; the pure-shell branch matches `chorus-api.sh`'s own escaping when `jq` is missing.
|
|
218
208
|
|
|
219
209
|
Round-trip: the Chorus backend appends a single `\n` to draft content on write, so server `content` is **byte-equal modulo a trailing newline**. Reviewers diffing local file vs server should ignore that one byte.
|
|
220
210
|
|
|
@@ -233,13 +223,46 @@ OpenSpec change slug: <slug>
|
|
|
233
223
|
|
|
234
224
|
This line is machine-grep-able by future runs of this skill and by the §3.9 archive trigger.
|
|
235
225
|
|
|
236
|
-
### 3.6 Mirror each document draft
|
|
226
|
+
### 3.6 Mirror each document draft (CLI primary, wrapper fallback)
|
|
227
|
+
|
|
228
|
+
> **Rule 1 reminder:** `content` comes from the file's bytes, never a hand-typed body. The agent must not retype the document body.
|
|
229
|
+
|
|
230
|
+
Ensure `CHORUS_URL` and `CHORUS_API_KEY` are exported (Rule 1 note) — both the CLI and the wrapper read them. Define the halt-on-error helper from §6 once at the top. **Primary path — the `chorus` CLI:** pass the base JSON *without* a `content` field and let `--arg-file content=<file>` fill it byte-exact. One call per file:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# PRD draft — --arg-file fills content byte-exact from the file; no json_encode_file needed.
|
|
234
|
+
RESULT=$(chorus mcp call chorus_pm_add_document_draft \
|
|
235
|
+
"{\"proposalUuid\":\"$PROPOSAL_UUID\",\"type\":\"prd\",\"title\":\"PRD: $HUMAN_TITLE\"}" \
|
|
236
|
+
--arg-file content="openspec/changes/$SLUG/proposal.md")
|
|
237
|
+
RC=$?
|
|
238
|
+
chorus_check_response "chorus_pm_add_document_draft (prd)" "$RC" "$RESULT"
|
|
239
|
+
PRD_DRAFT_UUID=$(printf '%s' "$RESULT" | grep -o '"draftUuid"[[:space:]]*:[[:space:]]*"[^"]*"' | head -1 | sed 's/.*"\([^"]*\)"$/\1/')
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Repeat with `type: "tech_design"` for `design.md`, and one call per capability with `type: "spec"` for each `specs/<capability>/spec.md`. Do **not** mirror `tasks.md` — Chorus task drafts (created via the `chorus_pm_add_task_draft` MCP tool, no wrapper needed) are the source of truth for tasks.
|
|
243
|
+
|
|
244
|
+
> Why parsing uses `printf '%s' "$RESULT" | grep` not `echo "$RESULT" | jq`: `echo` interprets backslash sequences inside the captured JSON, turning embedded `\n` into a real newline. `jq` then aborts with `Invalid string: control characters from U+0000 through U+001F must be escaped`. `printf '%s'` emits the captured bytes verbatim. Same pattern applies to all wrapper-result parsing in this skill.
|
|
237
245
|
|
|
238
|
-
|
|
246
|
+
#### Fallback — when the `chorus` CLI is not on `PATH`
|
|
239
247
|
|
|
240
|
-
|
|
248
|
+
If `command -v chorus` fails, mirror through the `chorus-api.sh` wrapper (or the absolute-path / inline-`curl` variants from the Rule 1 availability note). Define `json_encode_file` here (it is used **only** on this fallback path), then build `$PAYLOAD` with an embedded `content`. The `chorus_check_response` halt-on-error check applies exactly as on the primary path.
|
|
241
249
|
|
|
242
250
|
```bash
|
|
251
|
+
# Define once, fallback-only: byte-faithful file → JSON string.
|
|
252
|
+
json_encode_file() {
|
|
253
|
+
local _path="$1"
|
|
254
|
+
if command -v jq >/dev/null 2>&1; then
|
|
255
|
+
jq -Rs '.' < "$_path"
|
|
256
|
+
else
|
|
257
|
+
local _content
|
|
258
|
+
_content=$(cat "$_path")
|
|
259
|
+
_content=${_content//\\/\\\\}
|
|
260
|
+
_content=${_content//\"/\\\"}
|
|
261
|
+
_content=${_content//$'\n'/\\n}
|
|
262
|
+
printf '"%s"' "$_content"
|
|
263
|
+
fi
|
|
264
|
+
}
|
|
265
|
+
|
|
243
266
|
# PRD draft
|
|
244
267
|
CONTENT=$(json_encode_file "openspec/changes/$SLUG/proposal.md")
|
|
245
268
|
PAYLOAD=$(cat <<JSON
|
|
@@ -257,13 +280,19 @@ chorus_check_response "chorus_pm_add_document_draft (prd)" "$RC" "$RESULT"
|
|
|
257
280
|
PRD_DRAFT_UUID=$(printf '%s' "$RESULT" | grep -o '"draftUuid"[[:space:]]*:[[:space:]]*"[^"]*"' | head -1 | sed 's/.*"\([^"]*\)"$/\1/')
|
|
258
281
|
```
|
|
259
282
|
|
|
260
|
-
|
|
283
|
+
### 3.7 Editing a draft after the first mirror
|
|
261
284
|
|
|
262
|
-
|
|
285
|
+
Local file changes propagate via `chorus_pm_update_document_draft` — same primary/fallback split as §3.6, same halt check. Primary (CLI):
|
|
263
286
|
|
|
264
|
-
|
|
287
|
+
```bash
|
|
288
|
+
RESULT=$(chorus mcp call chorus_pm_update_document_draft \
|
|
289
|
+
"{\"proposalUuid\":\"$PROPOSAL_UUID\",\"draftUuid\":\"$PRD_DRAFT_UUID\"}" \
|
|
290
|
+
--arg-file content="openspec/changes/$SLUG/proposal.md")
|
|
291
|
+
RC=$?
|
|
292
|
+
chorus_check_response "chorus_pm_update_document_draft" "$RC" "$RESULT"
|
|
293
|
+
```
|
|
265
294
|
|
|
266
|
-
|
|
295
|
+
Fallback (no `chorus` on `PATH`) — `json_encode_file` from the §3.6 fallback block:
|
|
267
296
|
|
|
268
297
|
```bash
|
|
269
298
|
CONTENT=$(json_encode_file "openspec/changes/$SLUG/proposal.md")
|
|
@@ -282,7 +311,17 @@ chorus_check_response "chorus_pm_update_document_draft" "$RC" "$RESULT"
|
|
|
282
311
|
|
|
283
312
|
### 3.8 Editing a Document after proposal approval
|
|
284
313
|
|
|
285
|
-
Once the proposal is approved, drafts materialize into Documents with their own UUIDs. To keep `openspec/changes/$SLUG/` and the Chorus Document in sync, mirror file edits via `chorus_pm_update_document
|
|
314
|
+
Once the proposal is approved, drafts materialize into Documents with their own UUIDs. To keep `openspec/changes/$SLUG/` and the Chorus Document in sync, mirror file edits via `chorus_pm_update_document`. Primary (CLI):
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
RESULT=$(chorus mcp call chorus_pm_update_document \
|
|
318
|
+
"{\"documentUuid\":\"$SPEC_DOCUMENT_UUID\"}" \
|
|
319
|
+
--arg-file content="openspec/changes/$SLUG/specs/<capability>/spec.md")
|
|
320
|
+
RC=$?
|
|
321
|
+
chorus_check_response "chorus_pm_update_document" "$RC" "$RESULT"
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Fallback (no `chorus` on `PATH`) — `json_encode_file` from the §3.6 fallback block:
|
|
286
325
|
|
|
287
326
|
```bash
|
|
288
327
|
CONTENT=$(json_encode_file "openspec/changes/$SLUG/specs/<capability>/spec.md")
|
|
@@ -351,9 +390,9 @@ When the §1 detection puts the agent in fallback mode (`CHORUS_OPENSPEC_ACTIVE=
|
|
|
351
390
|
|
|
352
391
|
## §6. Failure visibility — the `chorus_check_response` helper
|
|
353
392
|
|
|
354
|
-
|
|
393
|
+
This helper guards **both** the primary CLI path and the fallback wrapper path. On the fallback path there is a known wrapper edge case: when the server returns HTTP 4xx (e.g. 401 from a bad `CHORUS_API_KEY`), `chorus-api.sh mcp-tool` captures the JSON-RPC error body internally, pipes it through a `.result.content[]?` jq filter that produces no output when `.result` is absent, and exits 0 with empty stdout. A bare `RC=$?` check would not halt on this — the most common runtime failure mode would be invisible. (If you reproduced the wrapper inline via `curl` per the Rule 1 note, the same three-signal check still applies to the raw HTTP body. `chorus mcp call` exits non-zero on tool/transport errors, so `RC` is reliable on the primary path — but run the same three-signal check on both, as defense in depth.)
|
|
355
394
|
|
|
356
|
-
Define this helper **once** at the top of the authoring session and use it after every
|
|
395
|
+
Define this helper **once** at the top of the authoring session and use it after every mirror call (CLI or wrapper):
|
|
357
396
|
|
|
358
397
|
```bash
|
|
359
398
|
chorus_check_response() {
|
|
@@ -393,9 +432,15 @@ chorus_check_response() {
|
|
|
393
432
|
- Skip capturing `$RESULT` into a variable; the helper needs the body.
|
|
394
433
|
- Use only `if [ "$RC" -ne 0 ]; then ...` — that misses the HTTP-error path.
|
|
395
434
|
|
|
396
|
-
**Minimal call site shape:**
|
|
435
|
+
**Minimal call site shape (both paths):**
|
|
397
436
|
|
|
398
437
|
```bash
|
|
438
|
+
# Primary — chorus CLI:
|
|
439
|
+
RESULT=$(chorus mcp call <tool_name> '<json-without-content>' --arg-file content=<file>)
|
|
440
|
+
RC=$?
|
|
441
|
+
chorus_check_response "<tool_name>" "$RC" "$RESULT"
|
|
442
|
+
|
|
443
|
+
# Fallback — chorus-api.sh wrapper (chorus not on PATH):
|
|
399
444
|
RESULT=$(chorus-api.sh mcp-tool <tool_name> "$PAYLOAD")
|
|
400
445
|
RC=$?
|
|
401
446
|
chorus_check_response "<tool_name>" "$RC" "$RESULT"
|
|
@@ -418,8 +463,8 @@ When invoked from a stage skill (proposal / develop / yolo):
|
|
|
418
463
|
c. Author `proposal.md`, `design.md`, `specs/<capability>/spec.md` (§3.2–§3.3). Mix `ADDED` / `MODIFIED` / `REMOVED` / `RENAMED` blocks as needed; remember `MODIFIED` overwrites the whole Requirement.
|
|
419
464
|
d. Optional: `openspec validate "$SLUG"`.
|
|
420
465
|
e. `chorus_pm_create_proposal` (direct MCP) with the `OpenSpec change slug: $SLUG` line in description (§3.5).
|
|
421
|
-
f. Export `CHORUS_URL` / `CHORUS_API_KEY
|
|
422
|
-
g. For each row in §5 with "yes" — mirror via `chorus
|
|
466
|
+
f. Export `CHORUS_URL` / `CHORUS_API_KEY` (both the CLI and the wrapper read them); define the `chorus_check_response` helper. Prefer `chorus mcp call … --arg-file content=<file>` for mirrors (§3.6) — no `json_encode_file` needed on that path; define `json_encode_file` and confirm `chorus-api.sh` is reachable (Rule 1 note) only when falling back to the wrapper because `chorus` is not on `PATH`.
|
|
467
|
+
g. For each row in §5 with "yes" — mirror via `chorus mcp call chorus_pm_add_document_draft … --arg-file content=<file>` (§3.6; fallback = `chorus-api.sh mcp-tool`). Record each `$DRAFT_UUID`.
|
|
423
468
|
h. On any failed `chorus_check_response` — halt, surface the error, do NOT proceed.
|
|
424
469
|
4. Edits before approval → §3.7. Edits after approval → §3.8.
|
|
425
470
|
5. Last task verified → detect the trigger yourself (no hook) → run §3.9 archive flow.
|
package/skills/proposal/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: Chorus Proposal workflow — create proposals with document and tas
|
|
|
4
4
|
license: AGPL-3.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: chorus
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.17.2"
|
|
8
8
|
category: project-management
|
|
9
9
|
mcp_server: chorus
|
|
10
10
|
---
|
|
@@ -97,7 +97,7 @@ Branch on the result:
|
|
|
97
97
|
|
|
98
98
|
- **OpenSpec active (all three checks pass)** → follow `openspec-aware` §3. Pick `$SLUG`, scaffold `openspec/changes/<slug>/`, author `proposal.md` / `design.md` / `specs/<capability>/spec.md` locally, then create the proposal container (Step 1 above) with the literal line `OpenSpec change slug: <slug>` in `description`, and mirror each local file into a document draft.
|
|
99
99
|
|
|
100
|
-
> **⛔ Mandatory in OpenSpec mode:** mirror calls
|
|
100
|
+
> **⛔ Mandatory in OpenSpec mode:** mirror calls fill `content` from the local file — prefer `chorus mcp call … --arg-file content=<file>`, falling back to the `chorus-api.sh` wrapper with `json_encode_file` when `chorus` is not on `PATH` — see `openspec-aware` §3.6. Do **not** call `chorus_pm_add_document_draft` directly from the MCP harness with a hand-typed `content` field. Re-typing thousands of lines through the LLM burns 20k+ content tokens per proposal and breaks byte-equality with the local source of truth (`openspec-aware` §2 Rule 1 explains the full reasoning). Skip Step 2 below when in OpenSpec mode — the file-fill flow in `openspec-aware` §3.6 replaces it for documents.
|
|
101
101
|
|
|
102
102
|
- **OpenSpec inactive (any check fails, or `CHORUS_OPENSPEC_MODE=off`)** → proceed with Step 2 unchanged. Author drafts inline as free-form Markdown via direct MCP `chorus_pm_add_document_draft`.
|
|
103
103
|
|
package/skills/review/SKILL.md
CHANGED
package/skills/yolo/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: Full-auto AI-DLC pipeline — from prompt to done. Automates the en
|
|
|
4
4
|
license: AGPL-3.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: chorus
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.17.2"
|
|
8
8
|
category: project-management
|
|
9
9
|
mcp_server: chorus
|
|
10
10
|
---
|
|
@@ -159,7 +159,7 @@ In /yolo mode, the agent generates elaboration questions and answers them itself
|
|
|
159
159
|
{ id: "b", label: "<option B>" }
|
|
160
160
|
]
|
|
161
161
|
}
|
|
162
|
-
// ... 5-8 questions covering functional,
|
|
162
|
+
// ... 5-8 questions covering functional, technical_context, scope aspects
|
|
163
163
|
]
|
|
164
164
|
})
|
|
165
165
|
```
|
|
@@ -213,8 +213,8 @@ In /yolo mode, the agent generates elaboration questions and answers them itself
|
|
|
213
213
|
**2a. OpenSpec mode (all three checks pass).** Follow `openspec-aware` §3 end-to-end:
|
|
214
214
|
- Pick `$SLUG`, run `openspec new change "$SLUG"` (§3.1–§3.2).
|
|
215
215
|
- Author `proposal.md`, `design.md`, and one `specs/<capability>/spec.md` per capability locally on disk (§3.3). ADDED Requirements only; per-spec fallback to free-form Markdown if MODIFIED/REMOVED is needed.
|
|
216
|
-
- Define
|
|
217
|
-
- Mirror each local file via `chorus-api.sh mcp-tool chorus_pm_add_document_draft "$PAYLOAD"`
|
|
216
|
+
- Define the `chorus_check_response` helper (§6); prefer `chorus mcp call … --arg-file content=<file>` for mirrors (§3.4/§3.6) — the bash-wrapper fallback's `json_encode_file` is only needed when `chorus` is not on `PATH`.
|
|
217
|
+
- Mirror each local file via `chorus mcp call chorus_pm_add_document_draft … --arg-file content=<file>` (§3.6; fallback = `chorus-api.sh mcp-tool chorus_pm_add_document_draft "$PAYLOAD"`) — one call per file, with the document type from `openspec-aware` §5.
|
|
218
218
|
|
|
219
219
|
> **⛔ Do not** invoke `chorus_pm_add_document_draft` / `chorus_pm_update_document_draft` / `chorus_pm_update_document` from the MCP harness with a hand-typed `content` field in this branch. Re-typing the markdown body wastes 20k+ tokens per proposal and breaks byte-equality with the local files. See `openspec-aware` §2 Rule 1.
|
|
220
220
|
|
|
@@ -485,7 +485,7 @@ After all waves complete, output a markdown summary:
|
|
|
485
485
|
|
|
486
486
|
### Phase 5b: Idea Completion Report (mandatory)
|
|
487
487
|
|
|
488
|
-
A successful `/yolo` run always finishes the Idea — call `chorus_create_report` once with `proposalUuid` set to the last verified proposal. The `content`
|
|
488
|
+
A successful `/yolo` run always finishes the Idea — call `chorus_create_report` once with `proposalUuid` set to the last verified proposal. The call requires `title` (a short report title) plus `content`; `content`'s parameter description carries the three-section template (`## Summary` / `## Decisions` / `## Follow-ups`); follow it. Surface the returned `documentUuid` in the Phase 5 summary. Skipping is a protocol violation.
|
|
489
489
|
|
|
490
490
|
> **Order:** write the completion report only **after** the Phase 4.5 code-review gateway returns PASS / PASS WITH NOTES — never while a code-review FAIL is outstanding.
|
|
491
491
|
|
package/src/commands.ts
CHANGED
|
@@ -2,13 +2,14 @@ import type { ChorusMcpClient } from "./mcp-client.js";
|
|
|
2
2
|
|
|
3
3
|
// ===== Response types from Chorus MCP tools =====
|
|
4
4
|
//
|
|
5
|
-
// These mirror the CURRENT (Chorus 0.
|
|
6
|
-
// - chorus_checkin → { checkinTime, agent,
|
|
5
|
+
// These mirror the CURRENT (Chorus 0.17.0+) tool output shapes:
|
|
6
|
+
// - chorus_checkin → { checkinTime, agent, activeProjects, guidance, notifications }
|
|
7
7
|
// - chorus_get_my_assignments → { ideaTracker, taskTracker }
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
8
|
+
// chorus_checkin returns a per-project `activeProjects` distribution (name +
|
|
9
|
+
// activeIdeaCount, NOT a per-idea list); the full per-idea `ideaTracker` lives
|
|
10
|
+
// only in chorus_get_my_assignments. Both trackers are Records keyed by project
|
|
11
|
+
// UUID. Every field is read defensively (optional chaining) so a missing/renamed
|
|
12
|
+
// field degrades to "0"/"none" rather than throwing.
|
|
12
13
|
|
|
13
14
|
interface IdeaTrackerEntry {
|
|
14
15
|
uuid: string;
|
|
@@ -36,6 +37,11 @@ interface TaskTrackerProject {
|
|
|
36
37
|
tasks?: TaskTrackerEntry[];
|
|
37
38
|
}
|
|
38
39
|
|
|
40
|
+
interface CheckinActiveProject {
|
|
41
|
+
name?: string;
|
|
42
|
+
activeIdeaCount?: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
39
45
|
interface CheckinResponse {
|
|
40
46
|
checkinTime?: string;
|
|
41
47
|
agent?: {
|
|
@@ -43,7 +49,7 @@ interface CheckinResponse {
|
|
|
43
49
|
name?: string;
|
|
44
50
|
persona?: string | null;
|
|
45
51
|
};
|
|
46
|
-
|
|
52
|
+
activeProjects?: Record<string, CheckinActiveProject>;
|
|
47
53
|
notifications?: {
|
|
48
54
|
unread?: number;
|
|
49
55
|
};
|
|
@@ -71,6 +77,7 @@ const PLUGIN_SKILLS = [
|
|
|
71
77
|
{ name: "review", description: "Approve/reject proposals, verify tasks, project governance" },
|
|
72
78
|
{ name: "yolo", description: "Full-auto AI-DLC pipeline — from prompt to done" },
|
|
73
79
|
{ name: "openspec-aware", description: "Opt-in OpenSpec authoring for PM workflows when the openspec CLI is present" },
|
|
80
|
+
{ name: "chorus-cli", description: "Install, configure agents (chorus agents add|remove|list), env vars, and chorus mcp operations" },
|
|
74
81
|
] as const;
|
|
75
82
|
|
|
76
83
|
// ===== Formatting helpers =====
|
|
@@ -97,24 +104,17 @@ function formatSkillsList(): string {
|
|
|
97
104
|
].join("\n");
|
|
98
105
|
}
|
|
99
106
|
|
|
100
|
-
// Sum a count across every project bucket in a tracker Record.
|
|
101
|
-
function countTracker<T>(
|
|
102
|
-
tracker: Record<string, { ideas?: T[]; tasks?: T[] }> | undefined,
|
|
103
|
-
key: "ideas" | "tasks"
|
|
104
|
-
): number {
|
|
105
|
-
if (!tracker) return 0;
|
|
106
|
-
return Object.values(tracker).reduce((total, project) => {
|
|
107
|
-
const items = key === "ideas" ? project.ideas : project.tasks;
|
|
108
|
-
return total + (items?.length ?? 0);
|
|
109
|
-
}, 0);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
107
|
function formatStatus(checkin: CheckinResponse, connectionStatus: string): string {
|
|
113
|
-
const
|
|
108
|
+
const projects = Object.values(checkin?.activeProjects ?? {});
|
|
109
|
+
const activeIdeaTotal = projects.reduce(
|
|
110
|
+
(total, p) => total + (p.activeIdeaCount ?? 0),
|
|
111
|
+
0
|
|
112
|
+
);
|
|
114
113
|
const lines: string[] = [
|
|
115
114
|
`Connection: ${connectionStatus}`,
|
|
116
115
|
`Agent: ${checkin?.agent?.name ?? "unknown"}`,
|
|
117
|
-
`
|
|
116
|
+
`Active projects: ${projects.length} (${activeIdeaTotal} active idea(s))`,
|
|
117
|
+
...projects.map((p) => ` - ${p.name ?? "(unnamed)"}: ${p.activeIdeaCount ?? 0}`),
|
|
118
118
|
`Notifications: ${checkin?.notifications?.unread ?? 0} unread`,
|
|
119
119
|
`Skills: ${PLUGIN_SKILLS.map((s) => s.name).join(", ")}`,
|
|
120
120
|
];
|
package/src/daemon-client.ts
CHANGED
|
@@ -402,7 +402,7 @@ export class OpenClawDaemonClient {
|
|
|
402
402
|
this.emitExecutionSnapshot();
|
|
403
403
|
}
|
|
404
404
|
let advancedToRunning = false;
|
|
405
|
-
await this.advanceTurn(reportSessionId, "running", entity);
|
|
405
|
+
const runningTurnUuid = await this.advanceTurn(reportSessionId, "running", entity);
|
|
406
406
|
advancedToRunning = true;
|
|
407
407
|
|
|
408
408
|
const runId = this.nextRunId(contextKey);
|
|
@@ -462,7 +462,7 @@ export class OpenClawDaemonClient {
|
|
|
462
462
|
// clean, aborted, or crashed). Guarded on advancedToRunning so a never-started wake
|
|
463
463
|
// never attempts an illegal pending→ended transition.
|
|
464
464
|
if (advancedToRunning) {
|
|
465
|
-
await this.advanceTurn(reportSessionId, "ended", entity);
|
|
465
|
+
await this.advanceTurn(reportSessionId, "ended", entity, runningTurnUuid);
|
|
466
466
|
}
|
|
467
467
|
|
|
468
468
|
// Interrupt-vs-crash reporting (entity-keyed — only for a reportable resource).
|
|
@@ -533,16 +533,20 @@ export class OpenClawDaemonClient {
|
|
|
533
533
|
sessionId: string,
|
|
534
534
|
status: "running" | "ended",
|
|
535
535
|
entity: { entityType: string; entityUuid: string } | null,
|
|
536
|
-
|
|
536
|
+
turnUuid: string | null = null,
|
|
537
|
+
): Promise<string | null> {
|
|
537
538
|
try {
|
|
538
|
-
await this.restClient.turnAdvance({
|
|
539
|
+
const outcome = await this.restClient.turnAdvance({
|
|
539
540
|
sessionId,
|
|
541
|
+
...(turnUuid ? { turnUuid } : {}),
|
|
540
542
|
status,
|
|
541
543
|
entityType: entity?.entityType ?? null,
|
|
542
544
|
entityUuid: entity?.entityUuid ?? null,
|
|
543
545
|
});
|
|
546
|
+
return typeof outcome.data?.turnUuid === "string" ? outcome.data.turnUuid : null;
|
|
544
547
|
} catch (err) {
|
|
545
548
|
this.logger.warn(`[Chorus] advanceTurn failed for session ${sessionId} → ${status}: ${err}`);
|
|
549
|
+
return null;
|
|
546
550
|
}
|
|
547
551
|
}
|
|
548
552
|
|
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
// The two files are kept in lock-step by the spec's "single source of truth for
|
|
15
15
|
// the payload shapes" requirement; a drift would be caught by T5 (live e2e).
|
|
16
16
|
//
|
|
17
|
-
// The
|
|
18
|
-
// cli/daemon-rest-client.mjs
|
|
17
|
+
// The operations and payload fields this client supports (kept aligned with
|
|
18
|
+
// cli/daemon-rest-client.mjs and accepted by src/app/api/daemon/*/route.ts):
|
|
19
19
|
// turnAdvance → POST /api/daemon/turn-advance
|
|
20
|
-
// { connectionUuid, sessionId, status,
|
|
20
|
+
// { connectionUuid, sessionId, status, turnUuid?,
|
|
21
|
+
// entityType?, entityUuid?, interruptedReason?,
|
|
22
|
+
// transcriptRelayError?, usage? }
|
|
21
23
|
// transcript → POST /api/daemon/transcript
|
|
22
24
|
// { sessionId, messages: [{ role, text }] }
|
|
23
25
|
// executionState → POST /api/daemon/execution-state
|
|
@@ -27,6 +29,8 @@
|
|
|
27
29
|
// startedAt|null }] }
|
|
28
30
|
// reportInterrupt → POST /api/daemon/report-interrupt
|
|
29
31
|
// { connectionUuid, entityType, entityUuid, reason }
|
|
32
|
+
// heartbeat → POST /api/daemon/connection-heartbeat
|
|
33
|
+
// { connectionUuid, connectedAt }
|
|
30
34
|
// readPendingTurns → GET /api/daemon/pending-turns?connectionUuid=…
|
|
31
35
|
// → { turns: [{ turnUuid, sessionId, directIdeaUuid, trigger,
|
|
32
36
|
// promptText }] }
|
|
@@ -129,6 +133,7 @@ export interface CreateDaemonRestClientOptions {
|
|
|
129
133
|
export interface DaemonRestClient {
|
|
130
134
|
turnAdvance(p: {
|
|
131
135
|
sessionId: string;
|
|
136
|
+
turnUuid?: string | null;
|
|
132
137
|
status: "running" | "ended" | "interrupted";
|
|
133
138
|
entityType?: string | null;
|
|
134
139
|
entityUuid?: string | null;
|
|
@@ -136,7 +141,7 @@ export interface DaemonRestClient {
|
|
|
136
141
|
transcriptRelayError?: string | null;
|
|
137
142
|
// Per-turn token usage (daemon-token-usage); sent only on a terminal edge.
|
|
138
143
|
usage?: TokenUsage | null;
|
|
139
|
-
}): Promise<DaemonRestResult
|
|
144
|
+
}): Promise<DaemonRestResult<{ turnUuid: string }>>;
|
|
140
145
|
transcript(p: {
|
|
141
146
|
sessionId: string;
|
|
142
147
|
messages: DaemonTranscriptMessage[];
|
|
@@ -172,13 +177,14 @@ export function createDaemonRestClient(opts: CreateDaemonRestClientOptions): Dae
|
|
|
172
177
|
* IDENTICAL across all four POST endpoints; only the `op` label and the path
|
|
173
178
|
* differ. Never throws — returns a structured {@link DaemonRestResult}.
|
|
174
179
|
*/
|
|
175
|
-
async function post(
|
|
180
|
+
async function post<TData = unknown>(
|
|
176
181
|
op: string,
|
|
177
182
|
path: string,
|
|
178
183
|
body: unknown,
|
|
179
184
|
successLog?: string,
|
|
180
185
|
context = "",
|
|
181
|
-
|
|
186
|
+
readData = false,
|
|
187
|
+
): Promise<DaemonRestResult<TData>> {
|
|
182
188
|
let response: Response;
|
|
183
189
|
try {
|
|
184
190
|
response = await fetchImpl(`${url}${path}`, {
|
|
@@ -198,8 +204,17 @@ export function createDaemonRestClient(opts: CreateDaemonRestClientOptions): Dae
|
|
|
198
204
|
logger.warn(`[Chorus] ${error}`);
|
|
199
205
|
return { ok: false, status: response.status, error };
|
|
200
206
|
}
|
|
207
|
+
let data: TData | undefined;
|
|
208
|
+
if (readData) {
|
|
209
|
+
try {
|
|
210
|
+
const parsed = (await response.json()) as { data?: TData } | null;
|
|
211
|
+
data = parsed && typeof parsed === "object" ? parsed.data : undefined;
|
|
212
|
+
} catch (err) {
|
|
213
|
+
logger.warn(`[Chorus] ${op} response correlation unavailable: ${err}`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
201
216
|
if (successLog) logger.info(`[Chorus] ${successLog}`);
|
|
202
|
-
return { ok: true, status: response.status };
|
|
217
|
+
return { ok: true, status: response.status, ...(data !== undefined ? { data } : {}) };
|
|
203
218
|
}
|
|
204
219
|
|
|
205
220
|
return {
|
|
@@ -211,7 +226,7 @@ export function createDaemonRestClient(opts: CreateDaemonRestClientOptions): Dae
|
|
|
211
226
|
* normalized `usage` (daemon-token-usage) — byte-for-byte the CLI client's shape.
|
|
212
227
|
* Requires the connectionUuid.
|
|
213
228
|
*/
|
|
214
|
-
async turnAdvance({ sessionId, status, entityType, entityUuid, interruptedReason, transcriptRelayError, usage }) {
|
|
229
|
+
async turnAdvance({ sessionId, turnUuid, status, entityType, entityUuid, interruptedReason, transcriptRelayError, usage }) {
|
|
215
230
|
const connectionUuid = getConnectionUuid();
|
|
216
231
|
if (!connectionUuid) {
|
|
217
232
|
const error = `cannot advance turn for session ${sessionId} → ${status} — no connection uuid yet`;
|
|
@@ -225,6 +240,7 @@ export function createDaemonRestClient(opts: CreateDaemonRestClientOptions): Dae
|
|
|
225
240
|
connectionUuid,
|
|
226
241
|
sessionId,
|
|
227
242
|
status,
|
|
243
|
+
...(turnUuid ? { turnUuid } : {}),
|
|
228
244
|
// Only sent when BOTH are present, so the server never gets a partial linkage.
|
|
229
245
|
...(entityType && entityUuid ? { entityType, entityUuid } : {}),
|
|
230
246
|
// Only meaningful alongside status=interrupted; never sent otherwise.
|
|
@@ -234,12 +250,24 @@ export function createDaemonRestClient(opts: CreateDaemonRestClientOptions): Dae
|
|
|
234
250
|
// The whole normalized TokenUsage object, nested under `usage`, only on a terminal edge.
|
|
235
251
|
...(usage && isTerminal ? { usage } : {}),
|
|
236
252
|
};
|
|
237
|
-
|
|
253
|
+
const result = await post<{ turn?: { uuid?: unknown } }>(
|
|
238
254
|
"turn-advance",
|
|
239
255
|
"/api/daemon/turn-advance",
|
|
240
256
|
body,
|
|
241
257
|
`advanced turn for session ${sessionId} → ${status}`,
|
|
258
|
+
"",
|
|
259
|
+
status === "running",
|
|
242
260
|
);
|
|
261
|
+
const resolvedTurnUuid =
|
|
262
|
+
typeof result.data?.turn?.uuid === "string" ? result.data.turn.uuid : null;
|
|
263
|
+
if (status !== "running") {
|
|
264
|
+
const { data: _rawData, ...baseResult } = result;
|
|
265
|
+
return baseResult;
|
|
266
|
+
}
|
|
267
|
+
const { data: _rawData, ...baseResult } = result;
|
|
268
|
+
return resolvedTurnUuid
|
|
269
|
+
? { ...baseResult, data: { turnUuid: resolvedTurnUuid } }
|
|
270
|
+
: baseResult;
|
|
243
271
|
},
|
|
244
272
|
|
|
245
273
|
/**
|