@syntesseraai/opencode-feature-factory 0.2.39 → 0.2.41
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.
|
@@ -13,4 +13,13 @@ export declare function sanitizeOutput(output: string): string;
|
|
|
13
13
|
* Adds a header indicating truncation if the output was longer than the limit.
|
|
14
14
|
*/
|
|
15
15
|
export declare function truncateOutput(output: string, maxLines?: number): string;
|
|
16
|
+
type PromptBody = {
|
|
17
|
+
parts: Array<{
|
|
18
|
+
type: 'text';
|
|
19
|
+
text: string;
|
|
20
|
+
}>;
|
|
21
|
+
agent?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function buildQualityGatePromptBody(message: string, agent?: string): PromptBody;
|
|
16
24
|
export declare const StopQualityGateHooksPlugin: Plugin;
|
|
25
|
+
export {};
|
|
@@ -87,6 +87,20 @@ export function truncateOutput(output, maxLines = 20) {
|
|
|
87
87
|
const omittedCount = lines.length - maxLines;
|
|
88
88
|
return `... (${omittedCount} lines omitted)\n${truncatedLines.join('\n')}`;
|
|
89
89
|
}
|
|
90
|
+
export function buildQualityGatePromptBody(message, agent) {
|
|
91
|
+
const body = {
|
|
92
|
+
parts: [
|
|
93
|
+
{
|
|
94
|
+
type: 'text',
|
|
95
|
+
text: message,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
if (agent) {
|
|
100
|
+
body.agent = agent;
|
|
101
|
+
}
|
|
102
|
+
return body;
|
|
103
|
+
}
|
|
90
104
|
const sessions = new Map();
|
|
91
105
|
let cleanupIntervalId = null;
|
|
92
106
|
/**
|
|
@@ -299,14 +313,7 @@ If the failure details are missing or truncated, run "ff-ci.sh" to get the full
|
|
|
299
313
|
: `❌ Quality gate failed\n\nThe CI checks did not pass. Please review the output below and fix the issues:\n\n\`\`\`\n${sanitizedOutput}\n\`\`\`${instructions}`;
|
|
300
314
|
await client.session.prompt({
|
|
301
315
|
path: { id: sessionId },
|
|
302
|
-
body:
|
|
303
|
-
parts: [
|
|
304
|
-
{
|
|
305
|
-
type: 'text',
|
|
306
|
-
text: message,
|
|
307
|
-
},
|
|
308
|
-
],
|
|
309
|
-
},
|
|
316
|
+
body: buildQualityGatePromptBody(message, state.lastAgent),
|
|
310
317
|
});
|
|
311
318
|
await log(client, 'debug', timedOut ? 'quality-gate.timeout-reported' : 'quality-gate.failed', { sessionId });
|
|
312
319
|
}
|
|
@@ -350,6 +357,14 @@ If the failure details are missing or truncated, run "ff-ci.sh" to get the full
|
|
|
350
357
|
sessions.delete(sessionId);
|
|
351
358
|
await log(client, 'debug', 'session.deleted', { sessionId });
|
|
352
359
|
}
|
|
360
|
+
if (event.type === 'message.part.updated') {
|
|
361
|
+
const partSessionId = sessionId ?? event.properties?.part?.sessionID;
|
|
362
|
+
if (partSessionId) {
|
|
363
|
+
const state = getSessionState(partSessionId);
|
|
364
|
+
// Always use "building" as the agent for write operations
|
|
365
|
+
state.lastAgent = 'building';
|
|
366
|
+
}
|
|
367
|
+
}
|
|
353
368
|
if (event.type === 'session.idle' && sessionId) {
|
|
354
369
|
const state = getSessionState(sessionId);
|
|
355
370
|
if (state.parentID) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@syntesseraai/opencode-feature-factory",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.41",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "OpenCode plugin for Feature Factory agents - provides sub-agents and skills for validation, review, security, and architecture assessment",
|
|
7
7
|
"license": "MIT",
|