@delete101020/aidlc 4.0.21 → 4.0.23
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/bundle.js +166 -42
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -19765,6 +19765,8 @@ var require_WorkspaceSchema = __commonJS({
|
|
|
19765
19765
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
19766
19766
|
exports2.WorkspaceValidationError = exports2.WorkspaceSchema = void 0;
|
|
19767
19767
|
exports2.normalizeStep = normalizeStep4;
|
|
19768
|
+
exports2.stepSkillAlternatives = stepSkillAlternatives;
|
|
19769
|
+
exports2.resolveStepSkills = resolveStepSkills;
|
|
19768
19770
|
exports2.producesEntries = producesEntries;
|
|
19769
19771
|
exports2.stepAgentId = stepAgentId3;
|
|
19770
19772
|
exports2.stepDagId = stepDagId;
|
|
@@ -19891,6 +19893,18 @@ var require_WorkspaceSchema = __commonJS({
|
|
|
19891
19893
|
* string); the normalizer coerces it into a single-entry array.
|
|
19892
19894
|
*/
|
|
19893
19895
|
skills: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
19896
|
+
/**
|
|
19897
|
+
* Turns `skills` from "all of these" into "one of these": the person
|
|
19898
|
+
* picks which skill runs before launching the step, and this one is
|
|
19899
|
+
* preselected — and is what the unattended runner uses when nobody
|
|
19900
|
+
* picked. For interchangeable implementations of one step (two review
|
|
19901
|
+
* skills that differ only in the tool they drive), where loading both
|
|
19902
|
+
* would have the model run both procedures, or blend them.
|
|
19903
|
+
*
|
|
19904
|
+
* Must be one of `skills`. Omitted = every listed skill is available at
|
|
19905
|
+
* once, as before.
|
|
19906
|
+
*/
|
|
19907
|
+
default_skill: zod_1.z.string().min(1).optional(),
|
|
19894
19908
|
/** Artifact paths required from upstream. Gate-checked before work AND on Mark step done. */
|
|
19895
19909
|
requires: zod_1.z.array(zod_1.z.string().min(1)).default([]),
|
|
19896
19910
|
/**
|
|
@@ -19938,6 +19952,9 @@ var require_WorkspaceSchema = __commonJS({
|
|
|
19938
19952
|
/** Open a PR after pushing (only valid when push=true). */
|
|
19939
19953
|
open_pr: zod_1.z.boolean().default(true)
|
|
19940
19954
|
}).optional()
|
|
19955
|
+
}).refine((s) => !s.default_skill || (s.skills ?? []).includes(s.default_skill), {
|
|
19956
|
+
message: "`default_skill` must be one of the step's `skills`.",
|
|
19957
|
+
path: ["default_skill"]
|
|
19941
19958
|
}).refine((s) => !s.auto_review || !!s.auto_review_runner, {
|
|
19942
19959
|
message: "Step with `auto_review: true` must set `auto_review_runner` (path to a JS/TS validator module).",
|
|
19943
19960
|
path: ["auto_review_runner"]
|
|
@@ -20042,6 +20059,7 @@ var require_WorkspaceSchema = __commonJS({
|
|
|
20042
20059
|
name: typeof obj.name === "string" ? obj.name : void 0,
|
|
20043
20060
|
...typeof obj.description === "string" && obj.description.trim() ? { description: obj.description.trim() } : {},
|
|
20044
20061
|
skills,
|
|
20062
|
+
...typeof obj.default_skill === "string" && skills?.includes(obj.default_skill) ? { default_skill: obj.default_skill } : {},
|
|
20045
20063
|
enabled: typeof obj.enabled === "boolean" ? obj.enabled : true,
|
|
20046
20064
|
optional: obj.optional === true,
|
|
20047
20065
|
produces,
|
|
@@ -20056,6 +20074,19 @@ var require_WorkspaceSchema = __commonJS({
|
|
|
20056
20074
|
...git && { git }
|
|
20057
20075
|
};
|
|
20058
20076
|
}
|
|
20077
|
+
function stepSkillAlternatives(norm) {
|
|
20078
|
+
if (!norm.default_skill || !norm.skills?.includes(norm.default_skill)) {
|
|
20079
|
+
return void 0;
|
|
20080
|
+
}
|
|
20081
|
+
return { options: norm.skills, defaultSkill: norm.default_skill };
|
|
20082
|
+
}
|
|
20083
|
+
function resolveStepSkills(norm, agentSkills, chosen) {
|
|
20084
|
+
const alt = stepSkillAlternatives(norm);
|
|
20085
|
+
if (alt) {
|
|
20086
|
+
return [chosen && alt.options.includes(chosen) ? chosen : alt.defaultSkill];
|
|
20087
|
+
}
|
|
20088
|
+
return norm.skills && norm.skills.length > 0 ? [...norm.skills] : [...agentSkills];
|
|
20089
|
+
}
|
|
20059
20090
|
function producesEntries(norm) {
|
|
20060
20091
|
const optional = new Set(norm.produces_optional);
|
|
20061
20092
|
return norm.produces.map((p) => optional.has(p) ? { path: p, optional: true } : p);
|
|
@@ -20406,6 +20437,9 @@ var require_PipelineAssembler = __commonJS({
|
|
|
20406
20437
|
if (norm.skills && norm.skills.length > 0) {
|
|
20407
20438
|
step.skills = norm.skills;
|
|
20408
20439
|
}
|
|
20440
|
+
if (norm.default_skill) {
|
|
20441
|
+
step.default_skill = norm.default_skill;
|
|
20442
|
+
}
|
|
20409
20443
|
if (auto_review_runner) {
|
|
20410
20444
|
step.auto_review_runner = auto_review_runner;
|
|
20411
20445
|
}
|
|
@@ -20734,6 +20768,9 @@ ${raw.slice(0, 200)}`);
|
|
|
20734
20768
|
if (norm.skills && norm.skills.length > 0) {
|
|
20735
20769
|
step.skills = norm.skills;
|
|
20736
20770
|
}
|
|
20771
|
+
if (norm.default_skill) {
|
|
20772
|
+
step.default_skill = norm.default_skill;
|
|
20773
|
+
}
|
|
20737
20774
|
if (norm.auto_review_runner) {
|
|
20738
20775
|
step.auto_review_runner = norm.auto_review_runner;
|
|
20739
20776
|
}
|
|
@@ -20839,7 +20876,7 @@ var require_runProgress = __commonJS({
|
|
|
20839
20876
|
exports2.isActiveStatus = isActiveStatus;
|
|
20840
20877
|
exports2.isStepOptional = isStepOptional;
|
|
20841
20878
|
exports2.deriveRunProgress = deriveRunProgress;
|
|
20842
|
-
exports2.isRunComplete =
|
|
20879
|
+
exports2.isRunComplete = isRunComplete2;
|
|
20843
20880
|
exports2.weighStepProgress = weighStepProgress2;
|
|
20844
20881
|
var WorkspaceSchema_1 = require_WorkspaceSchema();
|
|
20845
20882
|
var ACTIVE = /* @__PURE__ */ new Set([
|
|
@@ -20892,20 +20929,59 @@ var require_runProgress = __commonJS({
|
|
|
20892
20929
|
}
|
|
20893
20930
|
});
|
|
20894
20931
|
const stuck = blocking.length > 0 && actionable.length === 0;
|
|
20895
|
-
const
|
|
20932
|
+
const complete = state.status === "completed" || pipeline != null && state.steps.length > 0 && isRunComplete2(state, pipeline);
|
|
20933
|
+
const status = complete ? "done" : stuck ? "failed" : "in_progress";
|
|
20896
20934
|
return { actionable, rejected, blocking, stuck, status };
|
|
20897
20935
|
}
|
|
20898
|
-
function
|
|
20936
|
+
function isRunComplete2(state, pipeline) {
|
|
20937
|
+
const excused = usesDag(pipeline) ? deadEndPeersOfApproved(state, pipeline) : /* @__PURE__ */ new Set();
|
|
20899
20938
|
return state.steps.every((s, i) => {
|
|
20900
20939
|
if (s.status === "approved") {
|
|
20901
20940
|
return true;
|
|
20902
20941
|
}
|
|
20942
|
+
if (excused.has(i)) {
|
|
20943
|
+
return true;
|
|
20944
|
+
}
|
|
20903
20945
|
if (!isStepOptional(pipeline, i)) {
|
|
20904
20946
|
return false;
|
|
20905
20947
|
}
|
|
20906
20948
|
return s.status === "rejected" || s.status === "pending";
|
|
20907
20949
|
});
|
|
20908
20950
|
}
|
|
20951
|
+
function deadEndPeersOfApproved(state, pipeline) {
|
|
20952
|
+
const normalized = state.steps.map((s, i) => (0, WorkspaceSchema_1.normalizeStep)(pipeline.steps[i] ?? { agent: s.agent }));
|
|
20953
|
+
const ids = normalized.map((n) => n.name ?? n.agent);
|
|
20954
|
+
const { ranks } = weighStepProgress2(normalized.map((n, i) => ({
|
|
20955
|
+
id: ids[i],
|
|
20956
|
+
dependsOn: n.depends_on,
|
|
20957
|
+
done: state.steps[i].status === "approved"
|
|
20958
|
+
})));
|
|
20959
|
+
const dependedOn = /* @__PURE__ */ new Set();
|
|
20960
|
+
for (const n of normalized) {
|
|
20961
|
+
for (const d of n.depends_on) {
|
|
20962
|
+
dependedOn.add(d);
|
|
20963
|
+
}
|
|
20964
|
+
}
|
|
20965
|
+
const approvedRanks = /* @__PURE__ */ new Set();
|
|
20966
|
+
state.steps.forEach((s, i) => {
|
|
20967
|
+
if (s.status === "approved") {
|
|
20968
|
+
approvedRanks.add(ranks[i]);
|
|
20969
|
+
}
|
|
20970
|
+
});
|
|
20971
|
+
const excused = /* @__PURE__ */ new Set();
|
|
20972
|
+
state.steps.forEach((s, i) => {
|
|
20973
|
+
if (s.status === "approved") {
|
|
20974
|
+
return;
|
|
20975
|
+
}
|
|
20976
|
+
if (dependedOn.has(ids[i])) {
|
|
20977
|
+
return;
|
|
20978
|
+
}
|
|
20979
|
+
if (approvedRanks.has(ranks[i])) {
|
|
20980
|
+
excused.add(i);
|
|
20981
|
+
}
|
|
20982
|
+
});
|
|
20983
|
+
return excused;
|
|
20984
|
+
}
|
|
20909
20985
|
function weighStepProgress2(steps) {
|
|
20910
20986
|
const n = steps.length;
|
|
20911
20987
|
if (n === 0) {
|
|
@@ -21137,6 +21213,7 @@ var require_PipelineRunner = __commonJS({
|
|
|
21137
21213
|
exports2.approveStep = approveStep3;
|
|
21138
21214
|
exports2.rejectStep = rejectStep3;
|
|
21139
21215
|
exports2.rerunStep = rerunStep3;
|
|
21216
|
+
exports2.chooseStepSkill = chooseStepSkill;
|
|
21140
21217
|
exports2.requestStepUpdate = requestStepUpdate2;
|
|
21141
21218
|
exports2.dirtyUpstreamOf = dirtyUpstreamOf2;
|
|
21142
21219
|
exports2.canRerunApprovedStep = canRerunApprovedStep;
|
|
@@ -21421,7 +21498,8 @@ var require_PipelineRunner = __commonJS({
|
|
|
21421
21498
|
at: verdict.at,
|
|
21422
21499
|
revision: nextStep.revision,
|
|
21423
21500
|
reason: verdict.reason,
|
|
21424
|
-
sentBackToIdx: idx
|
|
21501
|
+
sentBackToIdx: idx,
|
|
21502
|
+
...nextStep.skill ? { skill: nextStep.skill } : {}
|
|
21425
21503
|
});
|
|
21426
21504
|
next.status = "running";
|
|
21427
21505
|
settleOptionalRejection(next, idx, pipeline);
|
|
@@ -21498,7 +21576,8 @@ var require_PipelineRunner = __commonJS({
|
|
|
21498
21576
|
at: now,
|
|
21499
21577
|
revision: next2.steps[idx].revision,
|
|
21500
21578
|
reason,
|
|
21501
|
-
sentBackToIdx: targetIdx
|
|
21579
|
+
sentBackToIdx: targetIdx,
|
|
21580
|
+
...next2.steps[idx].skill ? { skill: next2.steps[idx].skill } : {}
|
|
21502
21581
|
});
|
|
21503
21582
|
const usesDag = pipeline ? pipeline.steps.map(WorkspaceSchema_1.normalizeStep).some((s) => s.depends_on.length > 0) : false;
|
|
21504
21583
|
const targetIdxN = targetIdx;
|
|
@@ -21561,7 +21640,8 @@ var require_PipelineRunner = __commonJS({
|
|
|
21561
21640
|
at: now,
|
|
21562
21641
|
revision: step.revision,
|
|
21563
21642
|
reason,
|
|
21564
|
-
sentBackToIdx: idx
|
|
21643
|
+
sentBackToIdx: idx,
|
|
21644
|
+
...step.skill ? { skill: step.skill } : {}
|
|
21565
21645
|
})
|
|
21566
21646
|
};
|
|
21567
21647
|
next.status = "running";
|
|
@@ -21602,6 +21682,24 @@ var require_PipelineRunner = __commonJS({
|
|
|
21602
21682
|
next.status = "running";
|
|
21603
21683
|
return next;
|
|
21604
21684
|
}
|
|
21685
|
+
function chooseStepSkill(args) {
|
|
21686
|
+
const { state, pipeline, stepIdx, skill } = args;
|
|
21687
|
+
if (!Number.isInteger(stepIdx) || stepIdx < 0 || stepIdx >= state.steps.length) {
|
|
21688
|
+
throw new PipelineRunError3(`Invalid stepIdx ${stepIdx}`);
|
|
21689
|
+
}
|
|
21690
|
+
const target = state.steps[stepIdx];
|
|
21691
|
+
const cfg = pipeline.steps[target.stepIdx];
|
|
21692
|
+
const alt = cfg ? (0, WorkspaceSchema_1.stepSkillAlternatives)((0, WorkspaceSchema_1.normalizeStep)(cfg)) : void 0;
|
|
21693
|
+
if (!alt) {
|
|
21694
|
+
throw new PipelineRunError3(`Step "${target.agent}" has no alternative skills to choose from.`);
|
|
21695
|
+
}
|
|
21696
|
+
if (!alt.options.includes(skill)) {
|
|
21697
|
+
throw new PipelineRunError3(`Skill "${skill}" is not one of step "${target.agent}"'s alternatives (${alt.options.join(", ")}).`);
|
|
21698
|
+
}
|
|
21699
|
+
const next = clone(state);
|
|
21700
|
+
next.steps[stepIdx] = { ...target, skill };
|
|
21701
|
+
return next;
|
|
21702
|
+
}
|
|
21605
21703
|
function requestStepUpdate2(args) {
|
|
21606
21704
|
const { state, pipeline, stepIdx, feedback } = args;
|
|
21607
21705
|
if (!Number.isInteger(stepIdx) || stepIdx < 0 || stepIdx >= state.steps.length) {
|
|
@@ -21818,7 +21916,8 @@ var require_PipelineRunner = __commonJS({
|
|
|
21818
21916
|
history: pushHistory(approved.history, {
|
|
21819
21917
|
kind: "approve",
|
|
21820
21918
|
at: finishedAt,
|
|
21821
|
-
revision: approved.revision
|
|
21919
|
+
revision: approved.revision,
|
|
21920
|
+
...approved.skill ? { skill: approved.skill } : {}
|
|
21822
21921
|
})
|
|
21823
21922
|
};
|
|
21824
21923
|
const normalized = pipeline.steps.map(WorkspaceSchema_1.normalizeStep);
|
|
@@ -29446,6 +29545,10 @@ var require_renameRefs = __commonJS({
|
|
|
29446
29545
|
obj.skill = newId;
|
|
29447
29546
|
moved = true;
|
|
29448
29547
|
}
|
|
29548
|
+
if (obj.default_skill === oldId) {
|
|
29549
|
+
obj.default_skill = newId;
|
|
29550
|
+
moved = true;
|
|
29551
|
+
}
|
|
29449
29552
|
return moved;
|
|
29450
29553
|
}
|
|
29451
29554
|
function declaredSkills(obj) {
|
|
@@ -30668,6 +30771,7 @@ var require_execEngine = __commonJS({
|
|
|
30668
30771
|
var budget_1 = require_budget();
|
|
30669
30772
|
var pricing_1 = require_pricing();
|
|
30670
30773
|
var models_1 = require_models();
|
|
30774
|
+
var WorkspaceSchema_1 = require_WorkspaceSchema();
|
|
30671
30775
|
var artifactLanguage_1 = require_artifactLanguage();
|
|
30672
30776
|
var strictMode_1 = require_strictMode();
|
|
30673
30777
|
var promptComposer_1 = require_promptComposer();
|
|
@@ -30809,13 +30913,13 @@ var require_execEngine = __commonJS({
|
|
|
30809
30913
|
}
|
|
30810
30914
|
}
|
|
30811
30915
|
}
|
|
30812
|
-
function
|
|
30813
|
-
return
|
|
30916
|
+
function loadSkills(ws, skillIds) {
|
|
30917
|
+
return skillIds.map((id) => ws.skills.load(id)).join("\n\n---\n\n");
|
|
30814
30918
|
}
|
|
30815
|
-
function buildStepPrompt(ws, agent, runner, root, epicId) {
|
|
30919
|
+
function buildStepPrompt(ws, agent, skillIds, runner, root, epicId) {
|
|
30816
30920
|
const harness = (0, types_1.harnessCapabilities)(runner);
|
|
30817
30921
|
return (0, promptComposer_1.composeAgentPrompt)({
|
|
30818
|
-
skills:
|
|
30922
|
+
skills: loadSkills(ws, skillIds),
|
|
30819
30923
|
persona: ws.personas.load(agent.id),
|
|
30820
30924
|
instructions: harness.projectInstructions ? null : (0, projectInstructions_1.findProjectInstructions)(root, harness.instructionFile),
|
|
30821
30925
|
harness,
|
|
@@ -30846,6 +30950,11 @@ var require_execEngine = __commonJS({
|
|
|
30846
30950
|
hooks.onStepFailed?.({ stepIdx, agent: agentId, message: `Agent "${agentId}" not found in workspace.yaml.` });
|
|
30847
30951
|
return false;
|
|
30848
30952
|
}
|
|
30953
|
+
const stepCfg = pipeline.steps[stepIdx];
|
|
30954
|
+
const norm = stepCfg ? (0, WorkspaceSchema_1.normalizeStep)(stepCfg) : void 0;
|
|
30955
|
+
const alternatives = norm ? (0, WorkspaceSchema_1.stepSkillAlternatives)(norm) : void 0;
|
|
30956
|
+
const chosen = opts.skill && alternatives?.options.includes(opts.skill) ? opts.skill : stepRec.skill;
|
|
30957
|
+
const skillIds = norm ? (0, WorkspaceSchema_1.resolveStepSkills)(norm, agent.skills, chosen) : [...agent.skills];
|
|
30849
30958
|
let runner;
|
|
30850
30959
|
let prompt2;
|
|
30851
30960
|
try {
|
|
@@ -30855,7 +30964,7 @@ var require_execEngine = __commonJS({
|
|
|
30855
30964
|
return false;
|
|
30856
30965
|
}
|
|
30857
30966
|
try {
|
|
30858
|
-
prompt2 = buildStepPrompt(ws, agent, runner, root, state.runId);
|
|
30967
|
+
prompt2 = buildStepPrompt(ws, agent, skillIds, runner, root, state.runId);
|
|
30859
30968
|
} catch (err) {
|
|
30860
30969
|
hooks.onStepFailed?.({ stepIdx, agent: agentId, message: `Failed to load skills for agent "${agentId}": ${errMsg(err)}` });
|
|
30861
30970
|
return false;
|
|
@@ -30866,7 +30975,7 @@ var require_execEngine = __commonJS({
|
|
|
30866
30975
|
const userMessage = opts.message ?? (contextStr || `Execute step: ${agentId}`);
|
|
30867
30976
|
if (opts.dryRun) {
|
|
30868
30977
|
hooks.onDryRunPreview?.({
|
|
30869
|
-
skills:
|
|
30978
|
+
skills: skillIds.join(", "),
|
|
30870
30979
|
skillText,
|
|
30871
30980
|
userMessage,
|
|
30872
30981
|
env,
|
|
@@ -30878,7 +30987,7 @@ var require_execEngine = __commonJS({
|
|
|
30878
30987
|
stepIdx,
|
|
30879
30988
|
agent: agentId,
|
|
30880
30989
|
revision: stepRec.revision,
|
|
30881
|
-
skills:
|
|
30990
|
+
skills: skillIds,
|
|
30882
30991
|
model: agent.model,
|
|
30883
30992
|
context: userMessage,
|
|
30884
30993
|
dirtyUpstream: (0, PipelineRunner_1.dirtyUpstreamOf)({ state, pipeline, stepIdx }).map((d) => ({ stepIdx: d.stepIdx, step: d.step, byStep: d.dirty.byStep }))
|
|
@@ -30907,6 +31016,9 @@ var require_execEngine = __commonJS({
|
|
|
30907
31016
|
const rec = freshState.steps[stepIdx];
|
|
30908
31017
|
rec.runner = agent.runner;
|
|
30909
31018
|
rec.model = resolvedModel;
|
|
31019
|
+
if (alternatives) {
|
|
31020
|
+
rec.skill = skillIds[0];
|
|
31021
|
+
}
|
|
30910
31022
|
rec.usage = result.usage;
|
|
30911
31023
|
if (typeof result.costUsd === "number") {
|
|
30912
31024
|
rec.costUsd = result.costUsd;
|
|
@@ -31150,13 +31262,13 @@ var require_runReport = __commonJS({
|
|
|
31150
31262
|
return history.map((h) => {
|
|
31151
31263
|
switch (h.kind) {
|
|
31152
31264
|
case "reject":
|
|
31153
|
-
return ` - \u2718 rejected (rev ${h.revision})${h.reason ? `: ${h.reason}` : ""}`;
|
|
31265
|
+
return ` - \u2718 rejected (rev ${h.revision}${h.skill ? `, ${h.skill}` : ""})${h.reason ? `: ${h.reason}` : ""}`;
|
|
31154
31266
|
case "rerun":
|
|
31155
31267
|
return ` - \u21BA rerun \u2192 rev ${h.revision}${h.feedback ? ` (feedback: ${h.feedback})` : ""}`;
|
|
31156
31268
|
case "auto_review":
|
|
31157
31269
|
return ` - \u{1F916} auto-review ${h.decision} (rev ${h.revision}): ${h.reason}`;
|
|
31158
31270
|
case "approve":
|
|
31159
|
-
return ` - \u2714 approved (rev ${h.revision})`;
|
|
31271
|
+
return ` - \u2714 approved (rev ${h.revision}${h.skill ? `, ${h.skill}` : ""})`;
|
|
31160
31272
|
case "undo":
|
|
31161
31273
|
return ` - \u21B6 mark-done undone (rev ${h.revision}, was ${h.from})`;
|
|
31162
31274
|
default:
|
|
@@ -32639,7 +32751,7 @@ var require_commandModel = __commonJS({
|
|
|
32639
32751
|
function shortcutCommandId(phaseId) {
|
|
32640
32752
|
return phaseId;
|
|
32641
32753
|
}
|
|
32642
|
-
function resolveComposition(config, pipelineId, phaseId) {
|
|
32754
|
+
function resolveComposition(config, pipelineId, phaseId, chosenSkill) {
|
|
32643
32755
|
const pipeline = config.pipelines.find((p) => p.id === pipelineId);
|
|
32644
32756
|
if (!pipeline) {
|
|
32645
32757
|
return { found: false, phaseId, pipelineId };
|
|
@@ -32649,11 +32761,8 @@ var require_commandModel = __commonJS({
|
|
|
32649
32761
|
return { found: false, phaseId, pipelineId };
|
|
32650
32762
|
}
|
|
32651
32763
|
const step = (0, WorkspaceSchema_1.normalizeStep)(stepCfg);
|
|
32652
|
-
|
|
32653
|
-
|
|
32654
|
-
const agent = config.agents.find((a) => a.id === step.agent);
|
|
32655
|
-
skills = agent?.skills ?? [];
|
|
32656
|
-
}
|
|
32764
|
+
const agent = config.agents.find((a) => a.id === step.agent);
|
|
32765
|
+
const skills = (0, WorkspaceSchema_1.resolveStepSkills)(step, agent?.skills ?? [], chosenSkill);
|
|
32657
32766
|
return {
|
|
32658
32767
|
found: true,
|
|
32659
32768
|
phaseId,
|
|
@@ -32747,6 +32856,9 @@ The first token is the **epic id**; an optional second token is the **phase**.
|
|
|
32747
32856
|
2. In that pipeline's \`steps\`, find the step whose \`name\` (or \`agent\` when
|
|
32748
32857
|
unnamed) === the chosen phase. That step's \`agent\` + \`skills\` are the
|
|
32749
32858
|
wiring. If the step omits \`skills\`, use the referenced agent's \`skills:\`.
|
|
32859
|
+
If the step sets \`default_skill\`, its \`skills\` are alternatives: load
|
|
32860
|
+
**only one** \u2014 the step's \`skill\` in \`.aidlc/runs/<epic>.json\` when it
|
|
32861
|
+
is one of them, else \`default_skill\`. Never load the others.
|
|
32750
32862
|
3. Load the persona from \`.claude/agents/<agent>.md\` (fall back to
|
|
32751
32863
|
\`~/.claude/agents/<agent>.md\`), and each skill from
|
|
32752
32864
|
\`.claude/skills/<skill>.md\` (fall back to \`~/.claude/skills/<skill>.md\`).
|
|
@@ -33325,13 +33437,13 @@ var require_dist = __commonJS({
|
|
|
33325
33437
|
"../core/dist/index.js"(exports2) {
|
|
33326
33438
|
"use strict";
|
|
33327
33439
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
33328
|
-
exports2.
|
|
33329
|
-
exports2.
|
|
33330
|
-
exports2.
|
|
33331
|
-
exports2.
|
|
33332
|
-
exports2.
|
|
33333
|
-
exports2.
|
|
33334
|
-
exports2.AIDLC_CORE_VERSION = exports2.AIDLC_CLI_GUIDE_TEXT = exports2.AIDLC_KNOWLEDGE = exports2.clearResolveCommandCache = exports2.resolveCommand = void 0;
|
|
33440
|
+
exports2.openIncidentEpic = exports2.SignalParseError = exports2.isSignal = exports2.parseSignal = exports2.SignalSchema = exports2.EpicStepEditError = exports2.resolveStepRef = exports2.describeGateEffect = exports2.commitEpicStepEdit = exports2.planSetEpicStepGates = exports2.planRemoveEpicStep = exports2.planAddEpicStep = exports2.EpicWorkflowSwitchError = exports2.canSwitchEpicWorkflow = exports2.epicWorkflowLock = exports2.applyEpicWorkflowSwitch = exports2.stageEpicWorkflowSwitch = exports2.planEpicWorkflowSwitch = exports2.EpicDescriptionError = exports2.setEpicDescription = exports2.lockedEpicDirError = exports2.EpicScaffoldError = exports2.epicsRoot = exports2.mapStepStatusToEpic = exports2.mirrorRunStateToEpic = exports2.scaffoldEpic = exports2.resolveArtifactCommitConfig = exports2.commitApprovedArtifacts = exports2.PipelineAdaptError = exports2.applyAdaptation = exports2.parseAdaptationVerdict = exports2.buildAdaptationPrompt = exports2.buildPhaseCatalog = exports2.slugEpicId = exports2.parseClassificationVerdict = exports2.buildClassificationPrompt = exports2.heuristicClassify = exports2.PipelineAssembleError = exports2.recipePipelineId = exports2.assemblePipeline = exports2.collectWorkspaceRefIssues = exports2.resolveStepSkills = exports2.stepSkillAlternatives = exports2.stepDagId = exports2.stepAgentId = exports2.producesEntries = exports2.normalizeStep = exports2.WorkspaceValidationError = exports2.validateWorkspace = exports2.WorkspaceSchema = void 0;
|
|
33441
|
+
exports2.skillReferences = exports2.agentReferences = exports2.renameSkillRefs = exports2.renameAgentRefs = exports2.dropRecipesForPipeline = exports2.dropRecipeStep = exports2.recipesDrawingFrom = exports2.WORKSPACE_DIR = exports2.WORKSPACE_FILENAME = exports2.WorkspaceParseError = exports2.WorkspaceNotFoundError = exports2.WorkspaceLoader = exports2.renderPlanMarkdown = exports2.generatePlan = exports2.collectContext = exports2.followUpHookFailures = exports2.pendingFollowUpDone = exports2.applyFollowUpHookRun = exports2.trackFollowUpChildren = exports2.writeFollowUpHookLedger = exports2.readFollowUpHookLedger = exports2.followUpHookLedgerPath = exports2.runFollowUpHook = exports2.fillFollowUpHookCommand = exports2.resolveFollowUpHooks = exports2.epicPipelineId = exports2.FOLLOW_UP_HOOK_TIMEOUT_MS = exports2.FOLLOW_UP_HOOKS_LEDGER = exports2.stepProducesFollowUps = exports2.collectFollowUpHookIssues = exports2.FOLLOW_UP_HOOK_PLACEHOLDERS = exports2.FOLLOW_UP_HOOK_KEYS = exports2.FOLLOW_UP_INTENT = exports2.FOLLOW_UPS_FILE = exports2.openManifestFollowUp = exports2.followUpChildId = exports2.followUpsOf = exports2.readEpicFollowUps = exports2.parseFollowUps = exports2.FollowUpsParseError = exports2.FollowUpManifestSchema = exports2.FollowUpItemSchema = exports2.SIGNAL_FILE = exports2.FOLLOW_UP_ARTIFACT = exports2.readEpicSignal = exports2.existingEpicIds = exports2.followUpIdFor = exports2.followUpEpicId = exports2.renderIntentMarkdown = exports2.openFollowUpEpic = void 0;
|
|
33442
|
+
exports2.normalizeTag = exports2.epicMatchesTags = exports2.applyTagEdit = exports2.MAX_TAG_LENGTH = exports2.EPIC_TAGS_KEY = exports2.strictModeSection = exports2.resolveEpicStrictMode = exports2.epicStrictMode = exports2.commandBodyPredatesStrictMode = exports2.STRICT_MODE_KEY = exports2.STRICT_MODE_HEADING = exports2.writeUserEpicIdPrefix = exports2.userConfigPath = exports2.readUserConfig = exports2.readGitUserName = exports2.ensureUserConfigIgnored = exports2.USER_CONFIG_RELPATH = exports2.USER_CONFIG_IGNORE_LINE = exports2.suggestEpicId = exports2.resolveEpicIdPrefixChain = exports2.resolveEpicIdPrefix = exports2.epicIdDateStamp = exports2.deriveEpicIdPrefix = exports2.EPIC_ID_PREFIX_PATTERN = exports2.EPIC_ID_PREFIX_KEY = exports2.resolveArtifactLanguage = exports2.commandBodyPredatesArtifactLanguage = exports2.artifactLanguageSection = exports2.ARTIFACT_LANGUAGE_HEADING = exports2.stripPersonaDirectives = exports2.composeAgentPrompt = exports2.PROJECT_INSTRUCTION_FILES = exports2.findProjectInstructions = exports2.stripPersonaMetadata = exports2.PersonaLoader = exports2.SkillNotFoundError = exports2.SkillLoader = exports2.EnvVarMissingError = exports2.EnvResolver = exports2.epicPipelineReport = exports2.planEpicPipelineExtraction = exports2.epicOwningPipeline = exports2.unstageEpicPipeline = exports2.stageEpicPipeline = exports2.writeEpicPipelines = exports2.splitEpicPipelines = exports2.mergeEpicPipelines = exports2.epicPipelinePath = exports2.EPIC_PIPELINE_FILENAME = exports2.unusedAfterStepRemoval = void 0;
|
|
33443
|
+
exports2.isRunComplete = exports2.deriveRunProgress = exports2.PipelineRunError = exports2.retryAutoReview = exports2.submitAutoReviewVerdict = exports2.dirtyUpstreamOf = exports2.rerunApprovedStep = exports2.canRerunApprovedStep = exports2.chooseStepSkill = exports2.requestStepUpdate = exports2.rerunStep = exports2.rejectStep = exports2.approveStep = exports2.undoStepDone = exports2.canUndoStepDone = exports2.markStepDone = exports2.canStartStep = exports2.startRun = exports2.activateBackendFromWorkspace = exports2.activateRunStateBackend = exports2.resolveRunStateBackend = exports2.GitRunStateStore = exports2.RUN_ID_PATTERN = exports2.FileRunStateStore = exports2.RunStateStore = exports2.harnessCapabilities = exports2.NO_HARNESS_CAPABILITIES = exports2.RunnerValidationError = exports2.validateRunnerExport = exports2.CustomRunnerLoader = exports2.buildClaudeSpawnEnv = exports2.hasClaudeLogin = exports2.isInsideClaudeCodeSession = exports2.createJsonSink = exports2.createLineSink = exports2.isCodexMcpConfigured = exports2.codexConfigPath = exports2.readProjectMcpServer = exports2.mcpRegistrarFor = exports2.codexMcpRegistrar = exports2.claudeMcpRegistrar = exports2.CodexRunner = exports2.DefaultRunner = exports2.RunnerRegistry = exports2.targetPath = exports2.scopePaths = exports2.discoverAssets = exports2.commandBodyIsStale = exports2.readEpicTags = exports2.normalizeTags = void 0;
|
|
33444
|
+
exports2.resolveProviderModel = exports2.isClaudeTierAlias = exports2.CLAUDE_TIER_ALIASES = exports2.FAST_MODEL = exports2.CODING_MODEL = exports2.PLANNING_MODEL = exports2.isBuiltinPreset = exports2.BUILTIN_PRESET_IDS = exports2.writeBuiltinAutoReviewValidators = exports2.resolvePrimaryStack = exports2.getSdlcArtifactTemplates = exports2.getBuiltinArtifactTemplates = exports2.phaseArtifactFileName = exports2.sdlcClaudeCommand = exports2.builtinClaudeCommand = exports2.loadAllBuiltinPresets = exports2.loadBuiltinPreset = exports2.planRecipeMigration = exports2.getBuiltinRecipeSummaries = exports2.getAllBuiltinPipelineSummaries = exports2.getSdlcBuiltinPipelineSummary = exports2.getBuiltinPipelineSummary = exports2.getBuiltinWorkflowByPipelineId = exports2.getBuiltinWorkflow = exports2.workflowSlug = exports2.builtinTemplatesRoot = exports2.pipelineCommandId = exports2.PHASES = exports2.BUILTIN_WORKFLOWS = exports2.withBackfilledStepNames = exports2.describeDrift = exports2.reconcileRunSteps = exports2.RUN_STATE_SCHEMA_VERSION = exports2.migrateRunState = exports2.stepIdentity = exports2.resolvePath = exports2.AutoReviewerError = exports2.runAutoReview = exports2.renderRunReport = exports2.verifyRun = exports2.runExecLoop = exports2.estimateCostUsd = exports2.providerAliases = exports2.ratesFromConfig = exports2.mergeRates = exports2.BUILTIN_RATES = exports2.checkBudget = exports2.weighStepProgress = exports2.isActiveStatus = exports2.isStepOptional = void 0;
|
|
33445
|
+
exports2.isDefaultClaudeConfigDir = exports2.claudeConfigDir = exports2.resolveClaudeConfigDir = exports2.defaultClaudeConfigDir = exports2.getClaudeConfigDirOverride = exports2.setClaudeConfigDir = exports2.resolveDeclaredPath = exports2.expandHome = exports2.ProfileLoadError = exports2.UnknownStandardError = exports2.builtinProfiles = exports2.loadActiveProfile = exports2.loadProfile = exports2.listProfileManifests = exports2.resolveStandard = exports2.workspaceStandard = exports2.isBuiltinProfileId = exports2.ProfileSchema = exports2.TRACE_RULES = exports2.PROFILES_DIR = exports2.DEFAULT_PROFILE_ID = exports2.BUILTIN_PROFILE_IDS = exports2.setEpicMemoryHook = exports2.isEpicMemoryHookEnabled = exports2.installAnnotationTools = exports2.relativeEpicRoot = exports2.provisionDeclaredWorkflows = exports2.provisionWorkflowFiles = exports2.writeWorkflowArtifactTemplates = exports2.writeWorkflowCommands = exports2.provisionShortcutDocs = exports2.writeTwoLayerCommands = exports2.shortcutCommandDoc = exports2.backboneCommandDoc = exports2.unprovisionedPhases = exports2.nextEligiblePhase = exports2.resolveComposition = exports2.shortcutCommandId = exports2.getCanonicalPhase = exports2.isCanonicalPhase = exports2.BACKBONE_COMMAND_ID = exports2.CANONICAL_PHASE_IDS = exports2.CANONICAL_PHASES = exports2.renderTemplate = exports2.DEFAULT_GLOBAL_WORKFLOW_IDS = exports2.detectGlobalBuiltinSource = exports2.uninstallWorkflowGlobalsByIds = exports2.isWorkflowGloballyInstalled = exports2.installWorkflowGlobalsByIds = exports2.installGlobalDefaults = void 0;
|
|
33446
|
+
exports2.AIDLC_CORE_VERSION = exports2.AIDLC_CLI_GUIDE_TEXT = exports2.AIDLC_KNOWLEDGE = exports2.clearResolveCommandCache = exports2.resolveCommand = exports2.remapClaudePath = exports2.claudeConfigEnv = exports2.claudeJsonPath = void 0;
|
|
33335
33447
|
var WorkspaceSchema_1 = require_WorkspaceSchema();
|
|
33336
33448
|
Object.defineProperty(exports2, "WorkspaceSchema", { enumerable: true, get: function() {
|
|
33337
33449
|
return WorkspaceSchema_1.WorkspaceSchema;
|
|
@@ -33354,6 +33466,12 @@ var require_dist = __commonJS({
|
|
|
33354
33466
|
Object.defineProperty(exports2, "stepDagId", { enumerable: true, get: function() {
|
|
33355
33467
|
return WorkspaceSchema_1.stepDagId;
|
|
33356
33468
|
} });
|
|
33469
|
+
Object.defineProperty(exports2, "stepSkillAlternatives", { enumerable: true, get: function() {
|
|
33470
|
+
return WorkspaceSchema_1.stepSkillAlternatives;
|
|
33471
|
+
} });
|
|
33472
|
+
Object.defineProperty(exports2, "resolveStepSkills", { enumerable: true, get: function() {
|
|
33473
|
+
return WorkspaceSchema_1.resolveStepSkills;
|
|
33474
|
+
} });
|
|
33357
33475
|
Object.defineProperty(exports2, "collectWorkspaceRefIssues", { enumerable: true, get: function() {
|
|
33358
33476
|
return WorkspaceSchema_1.collectWorkspaceRefIssues;
|
|
33359
33477
|
} });
|
|
@@ -33943,6 +34061,9 @@ var require_dist = __commonJS({
|
|
|
33943
34061
|
Object.defineProperty(exports2, "requestStepUpdate", { enumerable: true, get: function() {
|
|
33944
34062
|
return PipelineRunner_1.requestStepUpdate;
|
|
33945
34063
|
} });
|
|
34064
|
+
Object.defineProperty(exports2, "chooseStepSkill", { enumerable: true, get: function() {
|
|
34065
|
+
return PipelineRunner_1.chooseStepSkill;
|
|
34066
|
+
} });
|
|
33946
34067
|
Object.defineProperty(exports2, "canRerunApprovedStep", { enumerable: true, get: function() {
|
|
33947
34068
|
return PipelineRunner_1.canRerunApprovedStep;
|
|
33948
34069
|
} });
|
|
@@ -42979,7 +43100,7 @@ var require_package = __commonJS({
|
|
|
42979
43100
|
"package.json"(exports2, module2) {
|
|
42980
43101
|
module2.exports = {
|
|
42981
43102
|
name: "@delete101020/aidlc",
|
|
42982
|
-
version: "4.0.
|
|
43103
|
+
version: "4.0.23",
|
|
42983
43104
|
description: "AIDLC Native CLI, a fork of AIDLC \u2014 drive Claude through the six-stage AI-Native SDLC Playbook: Plan \u2192 Design \u2192 Build \u2192 Test \u2192 Deploy \u2192 Maintain, with artifact gates, requirements traceability, an incident loop back to Plan, and Spec Kit support.",
|
|
42984
43105
|
license: "MIT",
|
|
42985
43106
|
repository: {
|
|
@@ -46648,6 +46769,13 @@ function requirePipeline(root, pipelineId) {
|
|
|
46648
46769
|
function requirePipelineForRun(root, state) {
|
|
46649
46770
|
return requirePipeline(root, state.pipelineId).pipeline;
|
|
46650
46771
|
}
|
|
46772
|
+
function findPipelineForRun(root, state) {
|
|
46773
|
+
try {
|
|
46774
|
+
return import_core7.WorkspaceLoader.load(root).config.pipelines.find((p) => p.id === state.pipelineId) ?? null;
|
|
46775
|
+
} catch {
|
|
46776
|
+
return null;
|
|
46777
|
+
}
|
|
46778
|
+
}
|
|
46651
46779
|
var AMBIGUOUS_STEP = -2;
|
|
46652
46780
|
function resolveStepIdx(state, step) {
|
|
46653
46781
|
const asInt = parseInt(step, 10);
|
|
@@ -47918,7 +48046,7 @@ function registerRun(program3) {
|
|
|
47918
48046
|
});
|
|
47919
48047
|
cmd.command("exec <runId>").description(
|
|
47920
48048
|
"Execute the current step by spawning the claude CLI, then auto-advance.\n Streams output live. Stops at human_review steps unless --auto-approve.\n Exit codes: 0 completed (or stopped at --until), 2 paused on a gate\n (awaiting review / rejected / budget), 1 error. --require-complete maps\n any non-completed outcome to 1 for CI gating."
|
|
47921
|
-
).option("--until <step>", "Stop after this step completes (index or agent id)").option("--auto-approve", "Also auto-approve human_review steps without pausing").option("--require-complete", "Exit 1 unless the run reaches completed (for CI gating)").option("--json", "Suppress decorative output; print a final JSON summary to stdout (claude stream goes to stderr)").option("--message <text>", "Override the user message sent to claude (default: context pairs)").option("--dry-run", "Print the assembled prompt without spawning claude").action(async (runId, opts, actionCmd) => {
|
|
48049
|
+
).option("--until <step>", "Stop after this step completes (index or agent id)").option("--auto-approve", "Also auto-approve human_review steps without pausing").option("--require-complete", "Exit 1 unless the run reaches completed (for CI gating)").option("--json", "Suppress decorative output; print a final JSON summary to stdout (claude stream goes to stderr)").option("--message <text>", "Override the user message sent to claude (default: context pairs)").option("--dry-run", "Print the assembled prompt without spawning claude").option("--skill <id>", "On steps that offer alternative skills (default_skill), run this one").action(async (runId, opts, actionCmd) => {
|
|
47922
48050
|
const root = resolveWorkspaceRoot(actionCmd);
|
|
47923
48051
|
if (opts.json) {
|
|
47924
48052
|
setQuiet(true);
|
|
@@ -48027,7 +48155,7 @@ async function execLoop(root, runId, opts) {
|
|
|
48027
48155
|
return (0, import_core13.runExecLoop)(
|
|
48028
48156
|
root,
|
|
48029
48157
|
runId,
|
|
48030
|
-
{ untilIdx, autoApprove: opts.autoApprove, message: opts.message, dryRun: opts.dryRun },
|
|
48158
|
+
{ untilIdx, autoApprove: opts.autoApprove, message: opts.message, dryRun: opts.dryRun, skill: opts.skill },
|
|
48031
48159
|
cliExecHooks(runId, claudeOut)
|
|
48032
48160
|
);
|
|
48033
48161
|
}
|
|
@@ -48253,11 +48381,7 @@ function registerStep(program3) {
|
|
|
48253
48381
|
state.status = "running";
|
|
48254
48382
|
}
|
|
48255
48383
|
}
|
|
48256
|
-
|
|
48257
|
-
state.status = "completed";
|
|
48258
|
-
} else {
|
|
48259
|
-
state.status = "running";
|
|
48260
|
-
}
|
|
48384
|
+
state.status = runIsComplete(root, state) ? "completed" : "running";
|
|
48261
48385
|
import_core14.RunStateStore.save(root, state);
|
|
48262
48386
|
mirrorEpicState(root, state);
|
|
48263
48387
|
const agent = state.steps[idx].agent;
|
|
@@ -48282,11 +48406,7 @@ function registerStep(program3) {
|
|
|
48282
48406
|
state.currentStepIdx = nextIdx;
|
|
48283
48407
|
}
|
|
48284
48408
|
}
|
|
48285
|
-
|
|
48286
|
-
state.status = "completed";
|
|
48287
|
-
} else {
|
|
48288
|
-
state.status = "running";
|
|
48289
|
-
}
|
|
48409
|
+
state.status = runIsComplete(root, state) ? "completed" : "running";
|
|
48290
48410
|
import_core14.RunStateStore.save(root, state);
|
|
48291
48411
|
mirrorEpicState(root, state);
|
|
48292
48412
|
const agent = state.steps[idx].agent;
|
|
@@ -48366,6 +48486,10 @@ function registerStep(program3) {
|
|
|
48366
48486
|
printRunSummary(state);
|
|
48367
48487
|
});
|
|
48368
48488
|
}
|
|
48489
|
+
function runIsComplete(root, state) {
|
|
48490
|
+
const pipeline = findPipelineForRun(root, state);
|
|
48491
|
+
return pipeline ? (0, import_core14.isRunComplete)(state, pipeline) : state.steps.every((s) => s.status === "approved");
|
|
48492
|
+
}
|
|
48369
48493
|
|
|
48370
48494
|
// src/commands/watch.ts
|
|
48371
48495
|
var path8 = __toESM(require("path"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delete101020/aidlc",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.23",
|
|
4
4
|
"description": "AIDLC Native CLI, a fork of AIDLC — drive Claude through the six-stage AI-Native SDLC Playbook: Plan → Design → Build → Test → Deploy → Maintain, with artifact gates, requirements traceability, an incident loop back to Plan, and Spec Kit support.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|