@structured-vibe-coding/core 0.3.1 → 0.4.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.
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AGENT_TARGET_OPTIONS,
|
|
2
3
|
ALL_AGENT_TARGETS,
|
|
3
4
|
PROTOCOL_MD,
|
|
4
5
|
SDD_AGENT_ROLES,
|
|
5
6
|
installAgentIntegrations,
|
|
7
|
+
parseAgentTargets,
|
|
6
8
|
refreshActiveAgentContext,
|
|
7
9
|
renderThinAgent
|
|
8
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BP54LEAD.js";
|
|
9
11
|
export {
|
|
12
|
+
AGENT_TARGET_OPTIONS,
|
|
10
13
|
ALL_AGENT_TARGETS,
|
|
11
14
|
PROTOCOL_MD,
|
|
12
15
|
SDD_AGENT_ROLES,
|
|
13
16
|
installAgentIntegrations,
|
|
17
|
+
parseAgentTargets,
|
|
14
18
|
refreshActiveAgentContext,
|
|
15
19
|
renderThinAgent
|
|
16
20
|
};
|
|
@@ -518,7 +518,7 @@ async function createChange(input) {
|
|
|
518
518
|
await materializeStageArtifacts(projectRoot, config, id, workflow, meta, firstStage);
|
|
519
519
|
await setActiveChange(projectRoot, config, id);
|
|
520
520
|
try {
|
|
521
|
-
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-
|
|
521
|
+
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-2ONGBIGG.js");
|
|
522
522
|
await refreshActiveAgentContext2(projectRoot);
|
|
523
523
|
} catch {
|
|
524
524
|
}
|
|
@@ -738,7 +738,7 @@ async function advanceStage(projectRoot, config, changeId, opts) {
|
|
|
738
738
|
stage
|
|
739
739
|
);
|
|
740
740
|
try {
|
|
741
|
-
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-
|
|
741
|
+
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-2ONGBIGG.js");
|
|
742
742
|
await refreshActiveAgentContext2(projectRoot);
|
|
743
743
|
} catch {
|
|
744
744
|
}
|
|
@@ -961,6 +961,37 @@ async function buildAgentPrompt(ctx, config, projectRoot) {
|
|
|
961
961
|
|
|
962
962
|
// src/agents.ts
|
|
963
963
|
var ALL_AGENT_TARGETS = ["copilot", "claude-code", "intellij"];
|
|
964
|
+
var AGENT_TARGET_OPTIONS = [
|
|
965
|
+
{
|
|
966
|
+
id: "copilot",
|
|
967
|
+
label: "GitHub Copilot",
|
|
968
|
+
hint: ".github/agents/*.agent.md"
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
id: "claude-code",
|
|
972
|
+
label: "Claude Code",
|
|
973
|
+
hint: ".claude/agents/*.md"
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
id: "intellij",
|
|
977
|
+
label: "IntelliJ / JetBrains",
|
|
978
|
+
hint: ".idea/sdd-agent-notes.md"
|
|
979
|
+
}
|
|
980
|
+
];
|
|
981
|
+
function parseAgentTargets(raw) {
|
|
982
|
+
const parts = (Array.isArray(raw) ? raw : [raw]).flatMap((s) => String(s).split(",")).map((s) => s.trim().toLowerCase()).filter(Boolean);
|
|
983
|
+
const out = [];
|
|
984
|
+
for (const p of parts) {
|
|
985
|
+
const id = p === "claude" || p === "claude-code" || p === "claudecode" ? "claude-code" : p === "github-copilot" || p === "gh-copilot" || p === "copilot" ? "copilot" : p === "jetbrains" || p === "idea" || p === "intellij" ? "intellij" : p;
|
|
986
|
+
if (!ALL_AGENT_TARGETS.includes(id)) {
|
|
987
|
+
throw new Error(
|
|
988
|
+
`Unknown agent platform "${p}". Choose one of: ${ALL_AGENT_TARGETS.join(", ")}`
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
if (!out.includes(id)) out.push(id);
|
|
992
|
+
}
|
|
993
|
+
return out;
|
|
994
|
+
}
|
|
964
995
|
var SDD_AGENT_ROLES = [
|
|
965
996
|
{
|
|
966
997
|
id: "sdd",
|
|
@@ -1001,7 +1032,12 @@ var SDD_AGENT_ROLES = [
|
|
|
1001
1032
|
}
|
|
1002
1033
|
];
|
|
1003
1034
|
async function installAgentIntegrations(opts) {
|
|
1004
|
-
|
|
1035
|
+
if (!opts.targets?.length) {
|
|
1036
|
+
throw new Error(
|
|
1037
|
+
`Specify at least one agent platform: ${ALL_AGENT_TARGETS.join(", ")} (do not install all by default)`
|
|
1038
|
+
);
|
|
1039
|
+
}
|
|
1040
|
+
const targets = opts.targets;
|
|
1005
1041
|
const created = [];
|
|
1006
1042
|
const skipped = [];
|
|
1007
1043
|
const root = opts.projectRoot;
|
|
@@ -1257,6 +1293,8 @@ export {
|
|
|
1257
1293
|
changeDirName,
|
|
1258
1294
|
uniqueChangeDirName,
|
|
1259
1295
|
ALL_AGENT_TARGETS,
|
|
1296
|
+
AGENT_TARGET_OPTIONS,
|
|
1297
|
+
parseAgentTargets,
|
|
1260
1298
|
SDD_AGENT_ROLES,
|
|
1261
1299
|
installAgentIntegrations,
|
|
1262
1300
|
renderThinAgent,
|
package/dist/index.d.ts
CHANGED
|
@@ -1166,6 +1166,14 @@ declare function buildAgentPrompt(ctx: ChangeContext, config: Config, projectRoo
|
|
|
1166
1166
|
|
|
1167
1167
|
type AgentTarget = "copilot" | "claude-code" | "intellij";
|
|
1168
1168
|
declare const ALL_AGENT_TARGETS: AgentTarget[];
|
|
1169
|
+
/** Human-facing labels for interactive platform pick (CLI / IDE). */
|
|
1170
|
+
declare const AGENT_TARGET_OPTIONS: {
|
|
1171
|
+
id: AgentTarget;
|
|
1172
|
+
label: string;
|
|
1173
|
+
hint: string;
|
|
1174
|
+
}[];
|
|
1175
|
+
/** Parse `copilot`, `claude-code,copilot`, etc. Throws on unknown ids. */
|
|
1176
|
+
declare function parseAgentTargets(raw: string | string[]): AgentTarget[];
|
|
1169
1177
|
/** Roles emitted as thin agents (shared body generator — no skill files). */
|
|
1170
1178
|
type SddAgentRoleId = "sdd" | "sdd-planner" | "sdd-implementer" | "sdd-reviewer";
|
|
1171
1179
|
interface SddAgentRole {
|
|
@@ -1205,8 +1213,12 @@ interface InitOptions {
|
|
|
1205
1213
|
projectRoot: string;
|
|
1206
1214
|
force?: boolean;
|
|
1207
1215
|
pack?: "default" | "enterprise";
|
|
1208
|
-
/**
|
|
1209
|
-
|
|
1216
|
+
/**
|
|
1217
|
+
* Agent platforms to install. Opt-in only — never defaults to all platforms.
|
|
1218
|
+
* - omit / `false` — no agent files
|
|
1219
|
+
* - `AgentTarget[]` — install only those hosts
|
|
1220
|
+
*/
|
|
1221
|
+
agents?: false | AgentTarget[];
|
|
1210
1222
|
}
|
|
1211
1223
|
interface InitResult {
|
|
1212
1224
|
created: string[];
|
|
@@ -1264,4 +1276,4 @@ declare function listFiles(path: string): Promise<string[]>;
|
|
|
1264
1276
|
declare function copyDir(src: string, dest: string): Promise<void>;
|
|
1265
1277
|
declare function removePath(path: string): Promise<void>;
|
|
1266
1278
|
|
|
1267
|
-
export { ALL_AGENT_TARGETS, type AdvanceResult, type AgentTarget, type ArtifactDef, ArtifactDefSchema, type ChangeContext, type ChangeMeta, ChangeMetaSchema, type Complexity, type Config, ConfigSchema, type CreateChangeInput, type Gate, GateSchema, type InitOptions, type InitResult, 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, approveGate, archiveDir, buildAgentPrompt, buildContext, canLeaveStage, changeDirName, changeMetaPath, changePath, changesDir, clearActiveIf, completeChange, configPath, copyDir, createChange, defaultConfig, defaultMemoryDir, defaultTemplatesDir, defaultWorkflowsDir, defaultsRoot, domainsDir, ensureDir, firstActiveStageId, formatStatus, getActiveChangeId, getStage, inferComplexity, initProject, installAgentIntegrations, isInitialized, isStageSkipped, listChanges, listDirs, listFiles, listWorkflowNames, loadChangeMeta, loadConfig, loadWorkflow, memoryDir, nextStageId, nowIso, pathExists, previousStageId, projectPaths, readText, readYaml, recommendWorkflow, refreshActiveAgentContext, removePath, renderThinAgent, resolveChangeId, resolveStages, runLocalVerify, saveChangeMeta, saveConfig, sddRoot, setActiveChange, shouldAutoSkip, skipStage, slugify, switchWorkflow, templatesDir, todayIsoDate, uniqueChangeDirName, workflowsDir, writeText, writeYaml };
|
|
1279
|
+
export { AGENT_TARGET_OPTIONS, ALL_AGENT_TARGETS, type AdvanceResult, type AgentTarget, type ArtifactDef, ArtifactDefSchema, type ChangeContext, type ChangeMeta, ChangeMetaSchema, type Complexity, type Config, ConfigSchema, type CreateChangeInput, type Gate, GateSchema, type InitOptions, type InitResult, 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, approveGate, archiveDir, buildAgentPrompt, buildContext, canLeaveStage, changeDirName, changeMetaPath, changePath, changesDir, clearActiveIf, completeChange, configPath, copyDir, createChange, defaultConfig, defaultMemoryDir, defaultTemplatesDir, defaultWorkflowsDir, defaultsRoot, domainsDir, ensureDir, firstActiveStageId, formatStatus, getActiveChangeId, getStage, inferComplexity, initProject, installAgentIntegrations, isInitialized, isStageSkipped, listChanges, listDirs, listFiles, listWorkflowNames, loadChangeMeta, loadConfig, loadWorkflow, memoryDir, nextStageId, nowIso, parseAgentTargets, pathExists, previousStageId, projectPaths, readText, readYaml, recommendWorkflow, refreshActiveAgentContext, removePath, renderThinAgent, resolveChangeId, resolveStages, runLocalVerify, saveChangeMeta, saveConfig, sddRoot, setActiveChange, shouldAutoSkip, skipStage, slugify, switchWorkflow, templatesDir, todayIsoDate, uniqueChangeDirName, workflowsDir, writeText, writeYaml };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AGENT_TARGET_OPTIONS,
|
|
2
3
|
ALL_AGENT_TARGETS,
|
|
3
4
|
ArtifactDefSchema,
|
|
4
5
|
ChangeMetaSchema,
|
|
@@ -48,6 +49,7 @@ import {
|
|
|
48
49
|
memoryDir,
|
|
49
50
|
nextStageId,
|
|
50
51
|
nowIso,
|
|
52
|
+
parseAgentTargets,
|
|
51
53
|
pathExists,
|
|
52
54
|
previousStageId,
|
|
53
55
|
projectPaths,
|
|
@@ -73,7 +75,7 @@ import {
|
|
|
73
75
|
workflowsDir,
|
|
74
76
|
writeText,
|
|
75
77
|
writeYaml
|
|
76
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-BP54LEAD.js";
|
|
77
79
|
|
|
78
80
|
// src/init.ts
|
|
79
81
|
import { join as join2 } from "pathe";
|
|
@@ -192,11 +194,10 @@ sdd complete
|
|
|
192
194
|
created.push(sddReadme);
|
|
193
195
|
}
|
|
194
196
|
let agentsResult;
|
|
195
|
-
if (opts.agents
|
|
196
|
-
const targets = Array.isArray(opts.agents) && opts.agents.length ? opts.agents : void 0;
|
|
197
|
+
if (Array.isArray(opts.agents) && opts.agents.length > 0) {
|
|
197
198
|
const ag = await installAgentIntegrations({
|
|
198
199
|
projectRoot,
|
|
199
|
-
targets,
|
|
200
|
+
targets: opts.agents,
|
|
200
201
|
force
|
|
201
202
|
});
|
|
202
203
|
created.push(...ag.created);
|
|
@@ -336,6 +337,7 @@ ${output}`
|
|
|
336
337
|
};
|
|
337
338
|
}
|
|
338
339
|
export {
|
|
340
|
+
AGENT_TARGET_OPTIONS,
|
|
339
341
|
ALL_AGENT_TARGETS,
|
|
340
342
|
ArtifactDefSchema,
|
|
341
343
|
ChangeMetaSchema,
|
|
@@ -390,6 +392,7 @@ export {
|
|
|
390
392
|
memoryDir,
|
|
391
393
|
nextStageId,
|
|
392
394
|
nowIso,
|
|
395
|
+
parseAgentTargets,
|
|
393
396
|
pathExists,
|
|
394
397
|
previousStageId,
|
|
395
398
|
projectPaths,
|