@structured-vibe-coding/core 0.6.2 → 0.7.0
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.
|
@@ -6,17 +6,20 @@ import {
|
|
|
6
6
|
PROTOCOL_MD,
|
|
7
7
|
SDD_AGENT_ROLES,
|
|
8
8
|
agentHostPaths,
|
|
9
|
+
agentKickoffMessage,
|
|
9
10
|
getIntegration,
|
|
10
11
|
installAgentIntegration,
|
|
11
12
|
installAgentIntegrations,
|
|
12
13
|
integrationKeyFor,
|
|
14
|
+
loadInstalledAgent,
|
|
13
15
|
optionForTarget,
|
|
14
16
|
parseAgentTargets,
|
|
15
17
|
parseIntegration,
|
|
16
18
|
refreshActiveAgentContext,
|
|
17
19
|
removeOtherAgentHosts,
|
|
18
|
-
renderThinAgent
|
|
19
|
-
|
|
20
|
+
renderThinAgent,
|
|
21
|
+
writeAgentHandoff
|
|
22
|
+
} from "./chunk-4ZDPIYEB.js";
|
|
20
23
|
export {
|
|
21
24
|
AGENT_INTEGRATIONS,
|
|
22
25
|
AGENT_TARGET_OPTIONS,
|
|
@@ -25,14 +28,17 @@ export {
|
|
|
25
28
|
PROTOCOL_MD,
|
|
26
29
|
SDD_AGENT_ROLES,
|
|
27
30
|
agentHostPaths,
|
|
31
|
+
agentKickoffMessage,
|
|
28
32
|
getIntegration,
|
|
29
33
|
installAgentIntegration,
|
|
30
34
|
installAgentIntegrations,
|
|
31
35
|
integrationKeyFor,
|
|
36
|
+
loadInstalledAgent,
|
|
32
37
|
optionForTarget,
|
|
33
38
|
parseAgentTargets,
|
|
34
39
|
parseIntegration,
|
|
35
40
|
refreshActiveAgentContext,
|
|
36
41
|
removeOtherAgentHosts,
|
|
37
|
-
renderThinAgent
|
|
42
|
+
renderThinAgent,
|
|
43
|
+
writeAgentHandoff
|
|
38
44
|
};
|
|
@@ -896,6 +896,47 @@ Remind the human: \`sdd verify\` then \`sdd next\` / \`sdd complete\` as appropr
|
|
|
896
896
|
Do not claim the change is complete without local verification when the workflow requires it.
|
|
897
897
|
`;
|
|
898
898
|
}
|
|
899
|
+
async function loadInstalledAgent(projectRoot) {
|
|
900
|
+
const path = join4(sddRoot(projectRoot), "agents.json");
|
|
901
|
+
if (!await pathExists(path)) return null;
|
|
902
|
+
try {
|
|
903
|
+
const raw = JSON.parse(await readText(path));
|
|
904
|
+
const key = raw.ai ?? raw.integration ?? raw.installed?.[0];
|
|
905
|
+
if (!key || typeof key !== "string") return null;
|
|
906
|
+
const target = parseIntegration(key);
|
|
907
|
+
return { ai: integrationKeyFor(target), target, integration: getIntegration(target) };
|
|
908
|
+
} catch {
|
|
909
|
+
return null;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
async function writeAgentHandoff(projectRoot, config, changeId) {
|
|
913
|
+
const ctx = await buildContext(projectRoot, config, changeId);
|
|
914
|
+
const body = await buildAgentPrompt(ctx, config, projectRoot);
|
|
915
|
+
const outPath = join4(sddRoot(projectRoot), "handoff.md");
|
|
916
|
+
const header = `# SDD handoff (auto)
|
|
917
|
+
|
|
918
|
+
> Generated for the AI coding agent configured at init.
|
|
919
|
+
> Change: **${ctx.meta.title}** \xB7 \`${ctx.id}\` \xB7 stage **${ctx.meta.stage}**
|
|
920
|
+
|
|
921
|
+
Also read: \`.sdd/active-context.md\`, \`.sdd/protocol.md\`, \`memory/constitution.md\` if present.
|
|
922
|
+
|
|
923
|
+
---
|
|
924
|
+
|
|
925
|
+
`;
|
|
926
|
+
await writeText(outPath, header + body + "\n");
|
|
927
|
+
return outPath;
|
|
928
|
+
}
|
|
929
|
+
function agentKickoffMessage(opts) {
|
|
930
|
+
return [
|
|
931
|
+
`SDD: new change started.`,
|
|
932
|
+
`Title: ${opts.title}`,
|
|
933
|
+
`Change: ${opts.changeId}`,
|
|
934
|
+
`Stage: ${opts.stage}`,
|
|
935
|
+
`Read in order: .sdd/active-context.md, .sdd/handoff.md, .sdd/protocol.md, memory/constitution.md (if present).`,
|
|
936
|
+
`Fill/update current stage artifacts only under changes/${opts.changeId}/. Do not expand scope.`,
|
|
937
|
+
`When the stage is done, tell the human to run: sdd next`
|
|
938
|
+
].join(" ");
|
|
939
|
+
}
|
|
899
940
|
async function refreshActiveAgentContext(projectRoot) {
|
|
900
941
|
const markerDir = sddRoot(projectRoot);
|
|
901
942
|
if (!await pathExists(join4(markerDir, "config.yaml"))) {
|
|
@@ -1091,6 +1132,9 @@ export {
|
|
|
1091
1132
|
installAgentIntegration,
|
|
1092
1133
|
installAgentIntegrations,
|
|
1093
1134
|
renderThinAgent,
|
|
1135
|
+
loadInstalledAgent,
|
|
1136
|
+
writeAgentHandoff,
|
|
1137
|
+
agentKickoffMessage,
|
|
1094
1138
|
refreshActiveAgentContext,
|
|
1095
1139
|
PROTOCOL_MD
|
|
1096
1140
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1258,6 +1258,25 @@ declare function installAgentIntegration(opts: InstallAgentOptions): Promise<Ins
|
|
|
1258
1258
|
declare function installAgentIntegrations(opts: InstallAgentsOptions): Promise<InstallAgentsResult>;
|
|
1259
1259
|
/** Thin agent body shared across hosts (same text). */
|
|
1260
1260
|
declare function renderThinAgent(role: SddAgentRole): string;
|
|
1261
|
+
interface InstalledAgentSnapshot {
|
|
1262
|
+
/** Public key: copilot | claude | grok */
|
|
1263
|
+
ai: string;
|
|
1264
|
+
target: AgentTarget;
|
|
1265
|
+
integration: AgentIntegration;
|
|
1266
|
+
}
|
|
1267
|
+
/** Read which AI agent was configured at `sdd init` / last agents install. */
|
|
1268
|
+
declare function loadInstalledAgent(projectRoot: string): Promise<InstalledAgentSnapshot | null>;
|
|
1269
|
+
/**
|
|
1270
|
+
* Write `.sdd/handoff.md` for the active (or given) change — full agent brief.
|
|
1271
|
+
* Used by `sdd agent` and auto-launch after `sdd new`.
|
|
1272
|
+
*/
|
|
1273
|
+
declare function writeAgentHandoff(projectRoot: string, config: Config, changeId: string): Promise<string>;
|
|
1274
|
+
/** Short kickoff line to pass into agent CLIs (full brief is in handoff.md). */
|
|
1275
|
+
declare function agentKickoffMessage(opts: {
|
|
1276
|
+
title: string;
|
|
1277
|
+
stage: string;
|
|
1278
|
+
changeId: string;
|
|
1279
|
+
}): string;
|
|
1261
1280
|
/** Write .sdd/active-context.md for the current change. */
|
|
1262
1281
|
declare function refreshActiveAgentContext(projectRoot: string): Promise<string | null>;
|
|
1263
1282
|
/** Single playbook — only long agent-facing content we author once. */
|
|
@@ -1329,4 +1348,4 @@ declare function listFiles(path: string): Promise<string[]>;
|
|
|
1329
1348
|
declare function copyDir(src: string, dest: string): Promise<void>;
|
|
1330
1349
|
declare function removePath(path: string): Promise<void>;
|
|
1331
1350
|
|
|
1332
|
-
export { AGENT_INTEGRATIONS, AGENT_TARGET_OPTIONS, ALL_AGENT_TARGETS, type AdvanceResult, type AgentIntegration, type AgentTarget, type AgentTargetOption, type ArtifactDef, ArtifactDefSchema, type ChangeContext, type ChangeMeta, ChangeMetaSchema, type Complexity, type Config, ConfigSchema, type CreateChangeInput, DEFAULT_INIT_INTEGRATION, type Gate, GateSchema, type InitOptions, type InitResult, type InstallAgentOptions, type InstallAgentResult, type InstallAgentsOptions, type InstallAgentsResult, PROTOCOL_MD, SDD_AGENT_ROLES, SDD_DIR, type SddAgentRole, type SddAgentRoleId, type Stage, StageSchema, VerifyCommandSchema, type VerifyResult, type Workflow, WorkflowSchema, activePointerPath, activeStages, advanceStage, agentHostPaths, approveGate, archiveDir, buildAgentPrompt, buildContext, canLeaveStage, changeDirName, changeMetaPath, changePath, changesDir, clearActiveIf, completeChange, configPath, copyDir, createChange, defaultConfig, defaultMemoryDir, defaultTemplatesDir, defaultWorkflowsDir, defaultsRoot, domainsDir, ensureDir, firstActiveStageId, formatStatus, getActiveChangeId, getIntegration, getStage, inferComplexity, initProject, installAgentIntegration, installAgentIntegrations, integrationKeyFor, isInitialized, isStageSkipped, listChanges, listDirs, listFiles, listWorkflowNames, loadChangeMeta, loadConfig, loadWorkflow, memoryDir, nextStageId, nowIso, optionForTarget, parseAgentTargets, parseIntegration, pathExists, readText, readYaml, recommendWorkflow, refreshActiveAgentContext, removeOtherAgentHosts, removePath, renderThinAgent, resolveChangeId, resolveStages, runLocalVerify, saveChangeMeta, saveConfig, sddRoot, setActiveChange, shouldAutoSkip, skipStage, slugify, switchWorkflow, templatesDir, todayIsoDate, uniqueChangeDirName, workflowsDir, writeText, writeYaml };
|
|
1351
|
+
export { AGENT_INTEGRATIONS, AGENT_TARGET_OPTIONS, ALL_AGENT_TARGETS, type AdvanceResult, type AgentIntegration, type AgentTarget, type AgentTargetOption, type ArtifactDef, ArtifactDefSchema, type ChangeContext, type ChangeMeta, ChangeMetaSchema, type Complexity, type Config, ConfigSchema, type CreateChangeInput, DEFAULT_INIT_INTEGRATION, type Gate, GateSchema, type InitOptions, type InitResult, type InstallAgentOptions, type InstallAgentResult, type InstallAgentsOptions, type InstallAgentsResult, type InstalledAgentSnapshot, PROTOCOL_MD, SDD_AGENT_ROLES, SDD_DIR, type SddAgentRole, type SddAgentRoleId, type Stage, StageSchema, VerifyCommandSchema, type VerifyResult, type Workflow, WorkflowSchema, activePointerPath, activeStages, advanceStage, agentHostPaths, agentKickoffMessage, approveGate, archiveDir, buildAgentPrompt, buildContext, canLeaveStage, changeDirName, changeMetaPath, changePath, changesDir, clearActiveIf, completeChange, configPath, copyDir, createChange, defaultConfig, defaultMemoryDir, defaultTemplatesDir, defaultWorkflowsDir, defaultsRoot, domainsDir, ensureDir, firstActiveStageId, formatStatus, getActiveChangeId, getIntegration, getStage, inferComplexity, initProject, installAgentIntegration, installAgentIntegrations, integrationKeyFor, isInitialized, isStageSkipped, listChanges, listDirs, listFiles, listWorkflowNames, loadChangeMeta, loadConfig, loadInstalledAgent, loadWorkflow, memoryDir, nextStageId, nowIso, optionForTarget, parseAgentTargets, parseIntegration, pathExists, readText, readYaml, recommendWorkflow, refreshActiveAgentContext, removeOtherAgentHosts, removePath, renderThinAgent, resolveChangeId, resolveStages, runLocalVerify, saveChangeMeta, saveConfig, sddRoot, setActiveChange, shouldAutoSkip, skipStage, slugify, switchWorkflow, templatesDir, todayIsoDate, uniqueChangeDirName, workflowsDir, writeAgentHandoff, writeText, writeYaml };
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
activePointerPath,
|
|
17
17
|
activeStages,
|
|
18
18
|
agentHostPaths,
|
|
19
|
+
agentKickoffMessage,
|
|
19
20
|
archiveDir,
|
|
20
21
|
buildAgentPrompt,
|
|
21
22
|
buildContext,
|
|
@@ -46,6 +47,7 @@ import {
|
|
|
46
47
|
listWorkflowNames,
|
|
47
48
|
loadChangeMeta,
|
|
48
49
|
loadConfig,
|
|
50
|
+
loadInstalledAgent,
|
|
49
51
|
loadWorkflow,
|
|
50
52
|
memoryDir,
|
|
51
53
|
nextStageId,
|
|
@@ -73,9 +75,10 @@ import {
|
|
|
73
75
|
todayIsoDate,
|
|
74
76
|
uniqueChangeDirName,
|
|
75
77
|
workflowsDir,
|
|
78
|
+
writeAgentHandoff,
|
|
76
79
|
writeText,
|
|
77
80
|
writeYaml
|
|
78
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-4ZDPIYEB.js";
|
|
79
82
|
|
|
80
83
|
// src/change.ts
|
|
81
84
|
import { join as join2 } from "pathe";
|
|
@@ -187,7 +190,7 @@ async function createChange(input) {
|
|
|
187
190
|
await materializeStageArtifacts(projectRoot, config, id, workflow, meta, firstStage);
|
|
188
191
|
await setActiveChange(projectRoot, config, id);
|
|
189
192
|
try {
|
|
190
|
-
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-
|
|
193
|
+
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-TN7TOYF7.js");
|
|
191
194
|
await refreshActiveAgentContext2(projectRoot);
|
|
192
195
|
} catch {
|
|
193
196
|
}
|
|
@@ -283,7 +286,7 @@ async function advanceStage(projectRoot, config, changeId, opts) {
|
|
|
283
286
|
stage
|
|
284
287
|
);
|
|
285
288
|
try {
|
|
286
|
-
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-
|
|
289
|
+
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-TN7TOYF7.js");
|
|
287
290
|
await refreshActiveAgentContext2(projectRoot);
|
|
288
291
|
} catch {
|
|
289
292
|
}
|
|
@@ -711,6 +714,7 @@ export {
|
|
|
711
714
|
activeStages,
|
|
712
715
|
advanceStage,
|
|
713
716
|
agentHostPaths,
|
|
717
|
+
agentKickoffMessage,
|
|
714
718
|
approveGate,
|
|
715
719
|
archiveDir,
|
|
716
720
|
buildAgentPrompt,
|
|
@@ -750,6 +754,7 @@ export {
|
|
|
750
754
|
listWorkflowNames,
|
|
751
755
|
loadChangeMeta,
|
|
752
756
|
loadConfig,
|
|
757
|
+
loadInstalledAgent,
|
|
753
758
|
loadWorkflow,
|
|
754
759
|
memoryDir,
|
|
755
760
|
nextStageId,
|
|
@@ -780,6 +785,7 @@ export {
|
|
|
780
785
|
todayIsoDate,
|
|
781
786
|
uniqueChangeDirName,
|
|
782
787
|
workflowsDir,
|
|
788
|
+
writeAgentHandoff,
|
|
783
789
|
writeText,
|
|
784
790
|
writeYaml
|
|
785
791
|
};
|