@swarmcraftai/cli 0.8.1 → 0.9.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.
- package/CHANGELOG.md +9 -0
- package/README.md +8 -0
- package/dist/main.cjs +390 -25
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the SwarmCraft CLI are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.9.0
|
|
6
|
+
|
|
7
|
+
- Adds `--delivery direct` for one-shot execution on the current branch without branch/merge prerequisites. Checking, reviewing and commit policy remain independent.
|
|
8
|
+
- Stops hosted one-shot when Doing evidence is incomplete, including when checking/reviewing are disabled.
|
|
9
|
+
- Updates guidance template set 16 so agents honour the explicit direct-delivery run policy.
|
|
10
|
+
- Adds project guidance template set 15 with merge-request, merge-review and merge-respond skills for Codex, Copilot and Claude. Review records remain owner-controlled.
|
|
11
|
+
- Records developer, source branch and merge target during planning and prepares the working branch when implementation is authorised.
|
|
12
|
+
- Installs new skills through the existing project guidance upgrade path while preserving edited guidance and review history.
|
|
13
|
+
|
|
5
14
|
## 0.8.1
|
|
6
15
|
|
|
7
16
|
- Opens browser sign-in by default, with Google, GitHub, passkey, or password sign-in followed by CLI approval. Use `--no-browser` to open the link yourself or `--method password` for terminal password login; existing credential flags and environment variables remain supported.
|
package/README.md
CHANGED
|
@@ -203,3 +203,11 @@ then repeat without `--check` to apply. Repeat `--packet` for the selected scope
|
|
|
203
203
|
Numeric filename prefixes supply missing order; unresolved order blocks migration.
|
|
204
204
|
Declare reviewed `dependsOn` UUIDs explicitly afterward. The migration does not
|
|
205
205
|
assume legacy tasks are independent and does not rename files.
|
|
206
|
+
|
|
207
|
+
## Direct delivery for one-shot builds
|
|
208
|
+
|
|
209
|
+
Use `--delivery direct` to work in the supplied current branch without requiring a separate source branch, merge target or merge request. It does not create/switch branches, push, merge or deploy. The default is `--delivery branch`, which retains the normal delivery prerequisites. Delivery is independent from checking, reviewing and commit policy.
|
|
210
|
+
|
|
211
|
+
Weekly unattended builds use `--delivery direct --checking off --reviewing off`. Commit preparation before launch. The selected delivery policy is recorded in the run and passed to agents as `SWARMCRAFT_ONE_SHOT_DELIVERY`; resumes retain that policy. Update seeded skills before using the option in an existing target.
|
|
212
|
+
|
|
213
|
+
Doing implementation and its validation remain mandatory. An agent exiting successfully with unfinished Doing items stops the run before later tasks; skipping checking/reviewing never authorises a false Done transition. Inspect the first completed task's files and evidence before leaving a new weekly build unattended.
|
package/dist/main.cjs
CHANGED
|
@@ -1359,6 +1359,30 @@ ${body}
|
|
|
1359
1359
|
}
|
|
1360
1360
|
});
|
|
1361
1361
|
|
|
1362
|
+
// ../../packages/packet-workflow/dist/deliveryPolicy.js
|
|
1363
|
+
var require_deliveryPolicy = __commonJS({
|
|
1364
|
+
"../../packages/packet-workflow/dist/deliveryPolicy.js"(exports2) {
|
|
1365
|
+
"use strict";
|
|
1366
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1367
|
+
exports2.DoingIncompleteError = void 0;
|
|
1368
|
+
exports2.parseDeliveryMode = parseDeliveryMode3;
|
|
1369
|
+
exports2.requireDoingCompletion = requireDoingCompletion2;
|
|
1370
|
+
function parseDeliveryMode3(value = "branch") {
|
|
1371
|
+
if (value !== "branch" && value !== "direct")
|
|
1372
|
+
throw new Error("--delivery must be branch or direct.");
|
|
1373
|
+
return value;
|
|
1374
|
+
}
|
|
1375
|
+
var DoingIncompleteError2 = class extends Error {
|
|
1376
|
+
};
|
|
1377
|
+
exports2.DoingIncompleteError = DoingIncompleteError2;
|
|
1378
|
+
function requireDoingCompletion2(items) {
|
|
1379
|
+
if (items.length === 0 || items.some((item) => !item.completed)) {
|
|
1380
|
+
throw new DoingIncompleteError2("Doing is incomplete: complete and validate every Doing checklist item before advancing. The agent exiting successfully is not task completion.");
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
});
|
|
1385
|
+
|
|
1362
1386
|
// ../../packages/packet-workflow/dist/index.js
|
|
1363
1387
|
var require_dist = __commonJS({
|
|
1364
1388
|
"../../packages/packet-workflow/dist/index.js"(exports2) {
|
|
@@ -1380,6 +1404,7 @@ var require_dist = __commonJS({
|
|
|
1380
1404
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
1381
1405
|
};
|
|
1382
1406
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1407
|
+
exports2.DoingIncompleteError = exports2.requireDoingCompletion = exports2.parseDeliveryMode = void 0;
|
|
1383
1408
|
__exportStar(require_assistantActions(), exports2);
|
|
1384
1409
|
__exportStar(require_agentProviders(), exports2);
|
|
1385
1410
|
__exportStar(require_manifest(), exports2);
|
|
@@ -1388,6 +1413,16 @@ var require_dist = __commonJS({
|
|
|
1388
1413
|
__exportStar(require_workflowContract(), exports2);
|
|
1389
1414
|
__exportStar(require_localPacket(), exports2);
|
|
1390
1415
|
__exportStar(require_executionMetadata(), exports2);
|
|
1416
|
+
var deliveryPolicy_1 = require_deliveryPolicy();
|
|
1417
|
+
Object.defineProperty(exports2, "parseDeliveryMode", { enumerable: true, get: function() {
|
|
1418
|
+
return deliveryPolicy_1.parseDeliveryMode;
|
|
1419
|
+
} });
|
|
1420
|
+
Object.defineProperty(exports2, "requireDoingCompletion", { enumerable: true, get: function() {
|
|
1421
|
+
return deliveryPolicy_1.requireDoingCompletion;
|
|
1422
|
+
} });
|
|
1423
|
+
Object.defineProperty(exports2, "DoingIncompleteError", { enumerable: true, get: function() {
|
|
1424
|
+
return deliveryPolicy_1.DoingIncompleteError;
|
|
1425
|
+
} });
|
|
1391
1426
|
}
|
|
1392
1427
|
});
|
|
1393
1428
|
|
|
@@ -1399,6 +1434,300 @@ var require_projectSeedModels = __commonJS({
|
|
|
1399
1434
|
}
|
|
1400
1435
|
});
|
|
1401
1436
|
|
|
1437
|
+
// ../../packages/repo-seed/dist/templates/merge/contract.js
|
|
1438
|
+
var require_contract = __commonJS({
|
|
1439
|
+
"../../packages/repo-seed/dist/templates/merge/contract.js"(exports2) {
|
|
1440
|
+
"use strict";
|
|
1441
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1442
|
+
exports2.DELIVERY_CONTRACT = exports2.MERGE_CONTRACT = void 0;
|
|
1443
|
+
exports2.MERGE_CONTRACT = `# SwarmCraft Merge Workflow
|
|
1444
|
+
|
|
1445
|
+
## Scope and people
|
|
1446
|
+
|
|
1447
|
+
Use this workflow for integration of a completed initiative, explicitly agreed bounded phase range, one direct packet, or coordinated work across projects. Read repository instructions, the relevant plans/packets, and existing review records. Resolve paths against the customer repository. Never require a hosted board or a particular Git host.
|
|
1448
|
+
|
|
1449
|
+
Name one responsible developer and an accountable human reviewer; record specialist assessors and their remit when needed. Support is proportional to experience and risk. Respect agreed independent supervision; do not substitute self-review. If one human legitimately fills both roles, record that honestly. AI assesses evidence and recommends; only the human decides. Clarify unresolved ownership or authority rather than inventing it, and reuse existing explicit instructions.
|
|
1450
|
+
|
|
1451
|
+
## Delivery and readiness
|
|
1452
|
+
|
|
1453
|
+
Read the initiative's Delivery section or the direct packet's Delivery notes. Verify source branch, merge target, responsible developer, and actual checkout. Resolve missing legacy context with the owner before dependent execution; do not retrofit historical records in bulk. Use one branch per initiative by default, respecting repository conventions. Never submit from the target branch or silently move work between branches.
|
|
1454
|
+
|
|
1455
|
+
Packets own completion, checklists and evidence. Require completed submitted scope under its recorded execution policy and proportionate integration verification. Normal completion includes human task review; V4 one-shot may record explicitly skipped stages. Record which checks/reviews ran and which were skipped. A one-shot waiver is not merge approval. Do not rewrite historical packet approvals or reopen completed packets just to answer merge feedback. Incomplete required scope blocks readiness; an explicitly agreed bounded deliverable names remaining work.
|
|
1456
|
+
|
|
1457
|
+
Inspect source and target changes across affected clients, APIs, data/migrations, security, configuration and deployment boundaries. Existing task results alone do not prove integration. Separate introduced defects from baseline issues. Record commands, results, assessed revisions and unavailable checks honestly; keep secrets and raw sensitive logs out of records. Include practical setup/demo steps and accessible previews, identifying simulations and limitations.
|
|
1458
|
+
|
|
1459
|
+
## Records and rounds
|
|
1460
|
+
|
|
1461
|
+
Create .reviews/<submission-slug>/ only when needed. Prefer the plan slug; for direct work use a stable descriptive slug with packet path and UUID. Disambiguate project collisions and list all participating plans/packets. The developer owns submission.md and response.md; the reviewer owns decisions in review.md. Paths in these records are repository-relative from their directory, for example ../../docs/plans/example-plan.md. Do not seed empty records or treat them as generated files.
|
|
1462
|
+
|
|
1463
|
+
Append numbered rounds; retain all earlier submissions, findings and decisions. Each submission records full implementation commit A, current target baseline T, and merge base B. Capture A before committing submission records as S. A decision-record commit D references A and T, not itself. Report S, D and the merge commit from Git history after they exist. Never invent self-referencing hashes.
|
|
1464
|
+
|
|
1465
|
+
Use stable finding IDs such as R1-F1, severity, evidence/impact, required change versus suggestion, and requested action. Carried findings retain their original IDs. New rounds map every outstanding required finding to actual developer response and verification. Suggestions are optional scope. Developer states include planned, in progress, addressed, needs clarification and deferral proposed. Only the reviewer records resolved, deferred, withdrawn or outstanding. Creating a packet/plan is not a delivered fix. Required findings remain open until the human accepts resolution or explicitly defers/withdraws them; acceptance must not hide unresolved required work.
|
|
1466
|
+
|
|
1467
|
+
## Revision checks
|
|
1468
|
+
|
|
1469
|
+
Verify A, T and B exist and match the claimed history. Before assessment or merge, fetch the resolved remote refs when remote collaboration applies; use the freshly fetched target tip, not a stale local branch. Inspect divergence without resetting, rebasing, or silently merging. Target advancement requires a refreshed submission/baseline and renewed integration assessment before acceptance or merge.
|
|
1470
|
+
|
|
1471
|
+
Inspect EVERY intervening commit after A as well as the aggregate diff. Only commits changing this submission's .reviews/<submission-slug>/ records qualify for the record-only exception. Other review folders, packet records, application files and arbitrary docs do not qualify. Implementation changes later reverted still require resubmission. Verify accepted A remains an ancestor of the source tip, and compare current source/target again immediately before merging. Review-record edits must not falsify or overwrite earlier decisions.
|
|
1472
|
+
|
|
1473
|
+
## Authority and sharing
|
|
1474
|
+
|
|
1475
|
+
| Request | Permitted Git actions |
|
|
1476
|
+
| --- | --- |
|
|
1477
|
+
| Planning or assessment-only | No commit, push or merge |
|
|
1478
|
+
| Draft submission | Prepare records only; no commit or push |
|
|
1479
|
+
| Local-only submission | Commit this submission's records; no push |
|
|
1480
|
+
| Normal submission | Commit this submission's records and non-force push only the source branch to the resolved remote |
|
|
1481
|
+
| Explicit acceptance/rejection | Commit this submission's decision records; no implied push or merge |
|
|
1482
|
+
| Explicit accept and merge | Decision-record commit and local merge for the specified revisions |
|
|
1483
|
+
| Respond | Agreed remediation and evidence; commits only if authorised; no implied push or resubmission |
|
|
1484
|
+
| Respond and resubmit | Necessary scoped fix/response commits, next submission round and normal source-branch push |
|
|
1485
|
+
|
|
1486
|
+
Resolve the human reviewer and remote destination from repository/session context or unambiguous configured upstream/push remote. Ask only if still unresolved. Inspect all worktrees and staged paths; preserve unrelated work and use isolation when needed. Never stage arbitrary implementation to make submission look complete. Missing implementation commits are a readiness gap unless their scoped creation is separately authorised. Do not force-push, push all branches/tags, or push the target under submission authority.
|
|
1487
|
+
|
|
1488
|
+
Verify remote source tip after pushing. Authentication failure, rejection or divergence leaves the submission awaiting sharing. A copy-ready notification names reviewer, outcome, round, source/target, actual checks, focus and an accessible revision-pinned submission reference. A local-only submission is prepared locally, not ready for remote review. Do not invent host URLs or treat localhost previews as remote access. A decision committed in a reviewer\u2019s separate clone is local until shared. Report the decision commit and the agreed handoff mechanism; ask for a source-branch push only if needed and not already authorised, then verify the remote tip. Never claim an unshared decision is available to the developer. Sending messages, creating hosted requests, target pushes, deployment and branch deletion need their own explicit authority.
|
|
1489
|
+
|
|
1490
|
+
## Merge and recovery
|
|
1491
|
+
|
|
1492
|
+
Assessment reports findings without fixing implementation. Human acceptance is distinct from explicit merge authority, and old approval never transfers automatically to new revisions. On rejection retain branch/history and hand findings to merge-respond.
|
|
1493
|
+
|
|
1494
|
+
For an authorised merge use a clean target worktree; never displace or reset another developer's checkout. Verify local target equals accepted T and source matches the accepted history. Prefer a normal --no-ff merge preserving delivery commits unless owner policy specifies otherwise. If conflicts occur, preserve the original work, abort the attempted merge in the isolated clean target worktree, and return to the developer for resolution, verification and resubmission. Do not resolve implementation conflicts under old acceptance.
|
|
1495
|
+
|
|
1496
|
+
Run proportionate integration verification on the merged tree. Report merge commit, actual checks and remaining limitations. Failed checks mean an integrated failure, not a successful handoff; do not automatically revert or deploy. Review records do not change packet lanes or hosted board state and are not authenticated approval enforcement.
|
|
1497
|
+
`;
|
|
1498
|
+
exports2.DELIVERY_CONTRACT = `# Delivery Ownership And Branches
|
|
1499
|
+
|
|
1500
|
+
For an authorised one-shot with \`SWARMCRAFT_ONE_SHOT_DELIVERY=direct\`, work in the supplied current branch/worktree. Do not require a responsible developer, separate source branch, merge target or merge request as a precondition; do not create or switch branches. This explicit run policy overrides branch-delivery prerequisites only. Checking/reviewing and commit policies remain independent, Doing implementation and validation remain mandatory, and push/merge/deployment are not authorised. With delivery absent or \`branch\`, the normal delivery contract applies.
|
|
1501
|
+
|
|
1502
|
+
During planning, record one responsible developer, source branch and merge target in an initiative's Delivery section. Default source to the plan filename stem, adjusted for repository naming conventions. Direct packets use ### Delivery under ## Notes and a bounded branch derived from the task slug. Keep unresolved owner/target explicit; a proposed branch name is intent, not an existing branch. Do not add packet schema fields or mirror lifecycle state in plans.
|
|
1503
|
+
|
|
1504
|
+
Planning alone does not create or switch branches. Before authorised implementation or preparation commits, resolve delivery context, inspect Git status, current branch, other worktrees, the target baseline and any existing source branch. Do not implement on the target branch. Create the source from the resolved target or reuse it only when ownership and scope match. A same-name unrelated branch is a collision, not permission to adopt it. Never reset, force, silently rebase/cherry-pick, or carry unrelated staged/dirty work onto a new branch.
|
|
1505
|
+
|
|
1506
|
+
If another effort occupies this checkout, use a separate worktree. If the plan or packets exist only on a different branch or as uncommitted files, establish an explicit scoped transfer arrangement before dependent work; do not lose them or assume they exist in the new worktree. Ask only for genuinely unresolved context or authority. A branch operation does not authorise commits, push, merge or deployment beyond existing instructions.
|
|
1507
|
+
|
|
1508
|
+
All initiative phases/packets use the recorded source unless an explicit staged/parallel arrangement names branches, dependencies and integration order. Preserve packet paths/UUIDs. Pass the selected worktree to one-shot preview and execution; its clean-start rule still applies. Before resume, verify the recorded run workspace, branch and packet context. Never switch branches in a running/resumed run. A child do/check stage validates context but must not create branches, switch worktrees or launch a nested run. Missing legacy context is resolved before dependent execution, not inferred from a task's done status.
|
|
1509
|
+
|
|
1510
|
+
Interactive do validates this same context before editing. Merge-request consumes it and validates actual refs. A new remediation plan has its own branch and an explicitly authorised integration route back to the submission source. Use existing repository conventions without bulk migration of old plans or packets.
|
|
1511
|
+
`;
|
|
1512
|
+
}
|
|
1513
|
+
});
|
|
1514
|
+
|
|
1515
|
+
// ../../packages/repo-seed/dist/templates/merge/templates.js
|
|
1516
|
+
var require_templates = __commonJS({
|
|
1517
|
+
"../../packages/repo-seed/dist/templates/merge/templates.js"(exports2) {
|
|
1518
|
+
"use strict";
|
|
1519
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1520
|
+
exports2.MERGE_EXAMPLES = exports2.MESSAGE_TEMPLATE = exports2.RESPONSE_TEMPLATE = exports2.REVIEW_TEMPLATE = exports2.SUBMISSION_TEMPLATE = void 0;
|
|
1521
|
+
exports2.SUBMISSION_TEMPLATE = `# Merge submission: <slug>
|
|
1522
|
+
|
|
1523
|
+
Current round: 1
|
|
1524
|
+
|
|
1525
|
+
## Round 1
|
|
1526
|
+
|
|
1527
|
+
### Scope and revisions
|
|
1528
|
+
|
|
1529
|
+
- Developer: <human>
|
|
1530
|
+
- Reviewer: <human and agreed remit>
|
|
1531
|
+
- Specialist assessment: <person/remit or not required>
|
|
1532
|
+
- Submitted on: <date and timezone>
|
|
1533
|
+
- Plans/packets: <relative links and packet UUIDs>
|
|
1534
|
+
- Scope: <completed initiative/direct packet/agreed bounded deliverable>
|
|
1535
|
+
- Source branch: <branch>
|
|
1536
|
+
- Target branch: <branch>
|
|
1537
|
+
- Implementation commit: <full A before record commit>
|
|
1538
|
+
- Target baseline: <full T>
|
|
1539
|
+
- Merge base: <full B>
|
|
1540
|
+
- Completion policy: <normal or recorded one-shot policy; actual skipped stages>
|
|
1541
|
+
|
|
1542
|
+
### Outcome and verification
|
|
1543
|
+
|
|
1544
|
+
<Problem solved, resulting behaviour, affected boundaries, actual commands/results, integration against target, unavailable checks and linked evidence.>
|
|
1545
|
+
|
|
1546
|
+
### How to review
|
|
1547
|
+
|
|
1548
|
+
<Setup, commands, journeys and expected outcomes. Include accessible preview/prototype location and limitations only when relevant.>
|
|
1549
|
+
|
|
1550
|
+
### Risks and remaining scope
|
|
1551
|
+
|
|
1552
|
+
<Compatibility, migration, security, operations/recovery, agreed deferrals and remaining plan work. Submission does not authorise deployment.>
|
|
1553
|
+
|
|
1554
|
+
### Response to previous review
|
|
1555
|
+
|
|
1556
|
+
<First round: not applicable. Later rounds: link response.md and map every outstanding required finding by original ID to delivered changes/commits, verification and pending reviewer decisions. Do not declare reviewer resolution.>
|
|
1557
|
+
|
|
1558
|
+
<!-- Append subsequent rounds with their own revisions; preserve history. -->
|
|
1559
|
+
`;
|
|
1560
|
+
exports2.REVIEW_TEMPLATE = `# Merge review: <slug>
|
|
1561
|
+
|
|
1562
|
+
Current round: 1
|
|
1563
|
+
|
|
1564
|
+
## Round 1
|
|
1565
|
+
|
|
1566
|
+
- Submission: [Round 1](submission.md#round-1)
|
|
1567
|
+
- Accountable reviewer: <human>
|
|
1568
|
+
- Assessed by: <AI/human; specialist remit if applicable>
|
|
1569
|
+
- Assessment date: <date and timezone>
|
|
1570
|
+
- Implementation commit: <full A>
|
|
1571
|
+
- Target baseline: <full T>
|
|
1572
|
+
- Source tip inspected: <full revision including record-only commits>
|
|
1573
|
+
|
|
1574
|
+
### Findings
|
|
1575
|
+
|
|
1576
|
+
| ID | Severity | Required or suggestion | Evidence and impact | Requested action |
|
|
1577
|
+
| --- | --- | --- | --- | --- |
|
|
1578
|
+
| <R1-F1> | <severity> | <classification> | <path/behaviour> | <action> |
|
|
1579
|
+
|
|
1580
|
+
<Remove placeholder rows; say no findings only after assessment.>
|
|
1581
|
+
|
|
1582
|
+
### Previous findings
|
|
1583
|
+
|
|
1584
|
+
<For later rounds, preserve original IDs and link developer responses. Record assessment separately from actual human dispositions: pending, resolved, deferred, withdrawn or outstanding.>
|
|
1585
|
+
|
|
1586
|
+
### Verification and recommendation
|
|
1587
|
+
|
|
1588
|
+
<Commands/results, assessed boundaries, limitations, and recommendation. A recommendation is not the decision.>
|
|
1589
|
+
|
|
1590
|
+
### Human decision
|
|
1591
|
+
|
|
1592
|
+
- Decision: pending
|
|
1593
|
+
- Decided by: not yet recorded
|
|
1594
|
+
- Decided on: not yet recorded
|
|
1595
|
+
- Applies to implementation: not yet recorded
|
|
1596
|
+
- Applies to target baseline: not yet recorded
|
|
1597
|
+
- Rationale: not yet recorded
|
|
1598
|
+
- Acknowledged limitations: not yet recorded
|
|
1599
|
+
- Merge authority: not granted
|
|
1600
|
+
|
|
1601
|
+
<!-- Record only actual human decisions. Append later rounds without overwriting history. -->
|
|
1602
|
+
`;
|
|
1603
|
+
exports2.RESPONSE_TEMPLATE = `# Merge response: <slug>
|
|
1604
|
+
|
|
1605
|
+
## Response to round <N>
|
|
1606
|
+
|
|
1607
|
+
- Developer: <human>
|
|
1608
|
+
- Review: [Review](review.md#round-N)
|
|
1609
|
+
- Submission: [Submission](submission.md#round-N)
|
|
1610
|
+
- Reviewed implementation: <full A>
|
|
1611
|
+
- Source branch: <branch>
|
|
1612
|
+
- Agreed approach: <instruction/date or pending>
|
|
1613
|
+
|
|
1614
|
+
| Finding ID | Required or suggestion | Route | Developer state | Delivered work | Verification |
|
|
1615
|
+
| --- | --- | --- | --- | --- | --- |
|
|
1616
|
+
| <R1-F1> | <classification> | <direct fix/new packet/new plan> | <planned/in progress/addressed/needs clarification/deferral proposed> | <paths, full commits or explicitly uncommitted work, packet/plan links> | <actual commands/results> |
|
|
1617
|
+
|
|
1618
|
+
### Approach and outstanding decisions
|
|
1619
|
+
|
|
1620
|
+
<Reasons, dependencies, integration route for another branch, clarification/disagreement/deferral requests. Creating records is not delivering fixes; only the reviewer resolves findings.>
|
|
1621
|
+
|
|
1622
|
+
### Handoff
|
|
1623
|
+
|
|
1624
|
+
<Verified changes, limitations, remaining required work, commit status, readiness and next action. Do not push or resubmit unless requested. Preserve earlier rounds.>
|
|
1625
|
+
`;
|
|
1626
|
+
exports2.MESSAGE_TEMPLATE = `Merge review requested: <project/outcome> (round <N>)
|
|
1627
|
+
|
|
1628
|
+
<Reviewer>, <ready for review via the verified shared revision, or prepared locally and awaiting sharing>.
|
|
1629
|
+
|
|
1630
|
+
- Outcome: <one sentence>
|
|
1631
|
+
- Branch: <source> \u2192 <target>
|
|
1632
|
+
- Submission: <verified revision-pinned link or shared repository + record path + full record commit>
|
|
1633
|
+
- Verification: <actual checks and gaps, including skipped AI/human task stages>
|
|
1634
|
+
- Review focus: <important decisions and remaining required findings>
|
|
1635
|
+
- Previous feedback: <addressed findings for resubmission; omit on first round>
|
|
1636
|
+
|
|
1637
|
+
Use swarmcraft-merge-review to assess the submission and record your decision. Authorise merging explicitly when ready.
|
|
1638
|
+
|
|
1639
|
+
<!-- Return filled text in chat; never send automatically or invent remote access. -->
|
|
1640
|
+
`;
|
|
1641
|
+
exports2.MERGE_EXAMPLES = `# Merge Workflow Examples
|
|
1642
|
+
|
|
1643
|
+
These are illustrative walkthroughs, not actual approvals or verification evidence.
|
|
1644
|
+
|
|
1645
|
+
1. A developer finishes the approval-routing initiative on approval-routing-plan targeting main. The packets are done under their recorded policy and integration checks passed. A normal submit request captures A/T/B, writes round 1, commits S and pushes only the source. A draft would stop before commit; local-only would stop before push.
|
|
1646
|
+
2. The reviewer requests assessment only. AI records R1-F1 as a required missing permission check and recommends rejection. Decision stays pending, no commit and no implementation edit. The human then explicitly rejects round 1; that authorises only decision-record commit D.
|
|
1647
|
+
3. The developer requests a direct fix and resubmission. The agent fixes and tests the permission boundary, records evidence against R1-F1 and commits the authorised fix. It preserves the original completed packet. For a larger independent outcome it would create a new packet; architectural changes use a new plan and an agreed branch integration route. Neither record creation nor developer addressed resolves R1-F1.
|
|
1648
|
+
4. The developer resubmits round 2 with new A/T/B and links the response. The reviewer assesses the actual fix and explicitly resolves R1-F1. Acceptance-only records the human decision but does not merge. An explicit accept-and-merge instruction also permits the clean-target merge and its verification, not a target push or deployment.
|
|
1649
|
+
5. If main advances, refresh the submission and integration assessment before accepting or merging. If a source commit changes code and another reverts it, resubmit anyway. A conflict returns to the developer; a failed post-merge check is reported as an integrated failure.
|
|
1650
|
+
6. For one direct packet, use its UUID/path and Delivery notes without creating an initiative. For a bounded phase submission, name remaining phases. For coordinated projects, list every plan/packet and affected contract. One-shot skipped review is disclosed, never described as human approval. An agreed independent supervisor remains required even if one person could otherwise fill both roles.
|
|
1651
|
+
`;
|
|
1652
|
+
}
|
|
1653
|
+
});
|
|
1654
|
+
|
|
1655
|
+
// ../../packages/repo-seed/dist/templates/renderMerge.js
|
|
1656
|
+
var require_renderMerge = __commonJS({
|
|
1657
|
+
"../../packages/repo-seed/dist/templates/renderMerge.js"(exports2) {
|
|
1658
|
+
"use strict";
|
|
1659
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1660
|
+
exports2.MERGE_SKILLS = void 0;
|
|
1661
|
+
exports2.renderMergeSkill = renderMergeSkill;
|
|
1662
|
+
exports2.renderMergeSeedFiles = renderMergeSeedFiles;
|
|
1663
|
+
var packet_workflow_1 = require_dist();
|
|
1664
|
+
var contract_1 = require_contract();
|
|
1665
|
+
var templates_1 = require_templates();
|
|
1666
|
+
exports2.MERGE_SKILLS = ["merge-request", "merge-review", "merge-respond"];
|
|
1667
|
+
var descriptions = {
|
|
1668
|
+
"merge-request": "Prepare or resubmit a completed SwarmCraft initiative, bounded phase range or direct packet for human merge review, with repository records and verified source-branch sharing.",
|
|
1669
|
+
"merge-review": "Assess a SwarmCraft merge submission, record the human reviewer's decision, and perform an explicitly authorised merge. Separate from packet-level task review.",
|
|
1670
|
+
"merge-respond": "Address SwarmCraft merge-review findings through direct fixes, new packets or a new plan, preserving finding-level evidence for the reviewer. Resubmit only when requested."
|
|
1671
|
+
};
|
|
1672
|
+
var workflows = {
|
|
1673
|
+
"merge-request": `1. Read repository instructions, selected plan/packets, Delivery context and existing submission/review/response rounds. Establish developer, named reviewer, source, target and submission slug. Confirm the bounded scope is complete under its actual packet execution policy and inspect integration evidence. Do not silently commit unfinished work.
|
|
1674
|
+
2. Inspect worktrees, status, staging and remote configuration. Resolve missing/ambiguous reviewer or destination before submission. For remote sharing, fetch source/target refs, inspect divergence and use the current remote target baseline. Do not reset/rebase. Capture full implementation A, target T and merge base B before record commits.
|
|
1675
|
+
3. Adapt [submission template](assets/submission-template.md) into .reviews/<slug>/submission.md. Include outcome, affected boundaries, plan/packet links, actual commands/results, skipped stages, review/demo steps, relevant accessible previews and risks. Use repository-relative links from the record, not skill-install paths.
|
|
1676
|
+
4. For resubmission, append the next numbered round and trace every outstanding required finding by original ID through response.md to delivered changes and actual verification. Preserve prior rounds and human decisions. Label unresolved clarification/deferral requests honestly; never call them resolved or claim readiness with outstanding required work.
|
|
1677
|
+
5. For a normal submit request, commit only this submission's review records on the source branch, preserving unrelated staged work. Draft-only stops before commit; local-only stops before push. A normal submission authorises a non-force push of only that source branch to the resolved destination, not hosted request creation or target push. Verify the actual remote tip after pushing; failures leave sharing incomplete.
|
|
1678
|
+
6. Report A, record commit, target baseline, destination, actual sharing outcome and pending issues. Return filled copy-ready text from [reviewer message](assets/reviewer-message-template.md). Never send it automatically. A reviewer needs an accessible revision-pinned reference or shared repository/path/commit; never invent links.`,
|
|
1679
|
+
"merge-review": `1. Read selected submission round, existing decisions/responses, relevant plan/packets and repository instructions. Identify the accountable human reviewer and any agreed independent/specialist assessment. Verify full A/T/B, source ancestry and EVERY intervening commit under the narrow record-only exception. Refresh remote target when applicable. Changed source or target needs resubmission/reassessment before acceptance or merge.
|
|
1680
|
+
2. Assess the actual implementation and target-side changes against scope, acceptance criteria and integration evidence. Run proportionate checks or state why unavailable. Distinguish baseline issues from introduced defects. Do not silently fix implementation, change packet lanes or rewrite task approvals.
|
|
1681
|
+
3. Adapt [review template](assets/review-template.md) into .reviews/<slug>/review.md. Report stable finding IDs, severity, evidence/impact, required versus suggestion, requested action, verification and limitations. In later rounds inspect response.md and retain original finding IDs. Recommendations and pending dispositions remain separate from human decisions.
|
|
1682
|
+
4. Present review/demo steps and ask for the human decision only if it is not already explicitly given for these revisions. Record the real identity, date, rationale, A/T, acknowledged limitations and explicit dispositions of required findings. Acceptance must not silently waive them. Rejection retains the branch and routes to [merge respond](../swarmcraft-merge-respond/SKILL.md).
|
|
1683
|
+
5. Explicit acceptance/rejection permits committing only this submission's decision records. Assessment-only permits no commit. Acceptance alone never permits merge or push. Report the decision-record commit after it exists. If the developer uses another clone, report how to share that decision through an agreed mechanism; a source-branch push needs explicit authority and remote-tip verification. Do not claim the developer can fetch a local-only decision.
|
|
1684
|
+
6. Only with explicit merge authority for these revisions, recheck source/target, decisions and checks, then merge the reviewed source including review records into a clean target worktree. Prefer --no-ff unless owner policy differs. Preserve other worktrees. Abort a conflicting attempted merge in that clean worktree and return for developer resolution and resubmission; never resolve implementation under stale acceptance.
|
|
1685
|
+
7. Verify the merged tree with appropriate integration checks and report merge commit/results. A failure remains an integrated failure, not success; do not auto-revert. No implied target push, deployment or branch deletion.`,
|
|
1686
|
+
"merge-respond": `1. Read all outstanding required findings across rounds, submission/review/response records, Delivery context and repository instructions. Establish developer, reviewed revision, source branch and worktree status. Preserve stable finding IDs; if missing, request that the reviewer establish them rather than rewriting decisions.
|
|
1687
|
+
2. Recommend a route per finding or related group: direct fix for bounded work; [plan](../swarmcraft-plan/SKILL.md) direct mode for a new focused packet followed by normal do/check/review or an explicitly selected one-shot policy; initiative mode for material architecture or phased scope. Confirm only when the route is not already authorised. Suggestions are optional. New-plan creation does not imply execution or integration authority.
|
|
1688
|
+
3. Adapt [response template](assets/response-template.md) into .reviews/<slug>/response.md. Append round sections and map every outstanding required finding to route, developer state, delivered paths/commits or packet/plan links, and actual checks. Keep completed packet history intact and do not alter reviewer decisions.
|
|
1689
|
+
4. Execute authorised direct fixes and verification, or follow the selected packet/plan workflow. Preserve any required task-review handoff instead of forcing done. A new plan gets its own Delivery branch and an explicit authorised integration route back; work on another branch is not a delivered submission fix.
|
|
1690
|
+
5. Record commands/results and limitations. Commit only with existing scoped authority; include finding IDs in direct-fix commit messages and preserve repository task commit conventions. Identify uncommitted work honestly. Addressed is a developer claim; only the human reviewer resolves, defers or withdraws required findings.
|
|
1691
|
+
6. Stop at the agreed verified handoff or a concrete blocker. No default push, merge, deployment or resubmission. An explicit respond-and-resubmit request authorises necessary scoped fix/response commits and invoking [merge request](../swarmcraft-merge-request/SKILL.md) for the next round and normal source push. Label unresolved work honestly.`
|
|
1692
|
+
};
|
|
1693
|
+
function renderMergeSkill(action) {
|
|
1694
|
+
return `---
|
|
1695
|
+
name: swarmcraft-${action}
|
|
1696
|
+
description: ${JSON.stringify(descriptions[action])}
|
|
1697
|
+
---
|
|
1698
|
+
|
|
1699
|
+
# SwarmCraft ${action.split("-").map((word) => word[0].toUpperCase() + word.slice(1)).join(" ")}
|
|
1700
|
+
|
|
1701
|
+
Read [the merge workflow](references/merge-workflow.md) before acting and [delivery context](references/delivery.md) when resolving branches. Resolve these links from this installed skill; resolve customer records from the selected repository. [Examples](references/examples.md) illustrate rounds and authority when needed.
|
|
1702
|
+
|
|
1703
|
+
${workflows[action]}
|
|
1704
|
+
`;
|
|
1705
|
+
}
|
|
1706
|
+
function renderMergeSeedFiles(provider) {
|
|
1707
|
+
const root = (0, packet_workflow_1.getProviderSkillRoot)(provider);
|
|
1708
|
+
return exports2.MERGE_SKILLS.flatMap((action) => {
|
|
1709
|
+
const directory = `${root}/swarmcraft-${action}`;
|
|
1710
|
+
const resources = {
|
|
1711
|
+
"SKILL.md": renderMergeSkill(action),
|
|
1712
|
+
"references/merge-workflow.md": contract_1.MERGE_CONTRACT,
|
|
1713
|
+
"references/delivery.md": contract_1.DELIVERY_CONTRACT,
|
|
1714
|
+
"references/examples.md": templates_1.MERGE_EXAMPLES,
|
|
1715
|
+
...action === "merge-request" ? { "assets/submission-template.md": templates_1.SUBMISSION_TEMPLATE, "assets/reviewer-message-template.md": templates_1.MESSAGE_TEMPLATE } : action === "merge-review" ? { "assets/review-template.md": templates_1.REVIEW_TEMPLATE } : { "assets/response-template.md": templates_1.RESPONSE_TEMPLATE }
|
|
1716
|
+
};
|
|
1717
|
+
const files = Object.entries(resources).map(([name, contents]) => ({ relativePath: `${directory}/${name}`, contents }));
|
|
1718
|
+
if (provider === "copilot")
|
|
1719
|
+
files.push({ relativePath: `.github/prompts/${action}.prompt.md`, contents: `---
|
|
1720
|
+
description: ${JSON.stringify(descriptions[action])}
|
|
1721
|
+
---
|
|
1722
|
+
|
|
1723
|
+
Follow [swarmcraft-${action}](../skills/swarmcraft-${action}/SKILL.md) for the requested scope.
|
|
1724
|
+
` });
|
|
1725
|
+
return files;
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
});
|
|
1730
|
+
|
|
1402
1731
|
// ../../packages/repo-seed/dist/workspaceTracking.js
|
|
1403
1732
|
var require_workspaceTracking = __commonJS({
|
|
1404
1733
|
"../../packages/repo-seed/dist/workspaceTracking.js"(exports2) {
|
|
@@ -1505,6 +1834,12 @@ var require_renderAssistantActionSkills = __commonJS({
|
|
|
1505
1834
|
"Preserve packet identity and sync fields unless SwarmCraft tooling rewrites them."
|
|
1506
1835
|
]),
|
|
1507
1836
|
"",
|
|
1837
|
+
"## Delivery And Integration",
|
|
1838
|
+
"",
|
|
1839
|
+
"For an authorised one-shot with `SWARMCRAFT_ONE_SHOT_DELIVERY=direct`, work in the supplied current branch/worktree. Do not require a responsible developer, separate source branch, merge target or merge request as a precondition; do not create or switch branches. This explicit run policy overrides branch-delivery prerequisites only. Checking/reviewing and commit policies remain independent, Doing implementation and validation remain mandatory, and push/merge/deployment are not authorised. With delivery absent or `branch`, the normal delivery contract applies.",
|
|
1840
|
+
"",
|
|
1841
|
+
"Read the linked initiative Delivery section or packet Delivery notes. Before interactive do edits or preparation commits, read `../swarmcraft-plan/references/delivery.md` and verify developer, source branch, merge target and worktree. Resolve missing legacy context; never implement on the target or silently switch branches. One-shot child stages only validate their run context. Completed task review is distinct from integration review: use `swarmcraft-merge-request` only when submission is requested, `swarmcraft-merge-review` for the named human integration decision, and `swarmcraft-merge-respond` for its feedback. Do not change lanes or launch merge work merely because a task completes.",
|
|
1842
|
+
"",
|
|
1508
1843
|
"## One-Shot Execution Policy",
|
|
1509
1844
|
"",
|
|
1510
1845
|
"When a V4 packet contains `execution`, preserve that runner-owned policy. The CLI alone records skipped Checking/Reviewing stages and final completion for an authorised one-shot run. Do not tick skipped items or invent Human Review evidence. Always complete Doing and its implementation validation. An interactive agent without this explicit run policy follows the normal human-review completion rule. Child stages must never launch another plan implementation run.",
|
|
@@ -1632,10 +1967,16 @@ var require_renderAssistantActionSkills = __commonJS({
|
|
|
1632
1967
|
"Split a reusable design-system extension from consumer adoption when either is independently reviewable or introduces a public API, dependency, ownership, multi-consumer migration, compatibility, rollback, or review boundary. Name affected consumers and migration order."
|
|
1633
1968
|
]),
|
|
1634
1969
|
"",
|
|
1970
|
+
"## Delivery Context",
|
|
1971
|
+
"",
|
|
1972
|
+
"Read `references/delivery.md` for both Direct and Initiative modes. Record one responsible developer, source branch and merge target in the initiative Delivery section or `### Delivery` under direct-packet `## Notes`. Planning records intent without branch mutations. Defaults follow the plan filename stem or direct task slug and repository naming conventions. Keep unresolved identities/targets explicit; resolve them before dependent execution.",
|
|
1973
|
+
"",
|
|
1635
1974
|
"## Implement An Existing Plan Or Packet",
|
|
1636
1975
|
"",
|
|
1637
1976
|
"`action=implement plan=<path> [phase=<anchor>]` or `action=implement packet=<path>` executes an existing scope; Direct and Initiative remain the two planning modes. A request to plan alone never authorises execution. Inspect the accepted plan, packet prerequisites and current repository before launch. Materialize only the explicitly requested scope when needed; preserve already linked packet identities.",
|
|
1638
1977
|
"",
|
|
1978
|
+
"Before preparation commits or launch, follow `references/delivery.md`: inspect branch/worktrees/status, resolve ownership and target, and create or reuse the intended source only within implementation authority. Never implement on the target, adopt an unrelated same-name branch, or transfer unrelated work. Use a separate worktree when needed and explicitly arrange transfer of relevant plan/packet files. Pass that selected worktree as --workspace to preview and execution. A child stage validates context without branch switching or nested execution.",
|
|
1979
|
+
"",
|
|
1639
1980
|
"Read `swarmcraft one-shot --help` and confirm local --plan/--packet, --phase and --preview support before attempting execution. If the installed CLI lacks these capabilities, report the needed CLI upgrade; do not simulate a loop, invent commands or fall back to a hosted project-wide run. Use the repository's selected provider. External-provider local execution needs no SwarmCraft account; Managed AI remains hosted-only.",
|
|
1640
1981
|
"",
|
|
1641
1982
|
"New work needs V4 packets with recommendedOrder and explicit dependsOn UUID arrays. For legacy work, preview a scoped `swarmcraft upgrade --workspace . --ordered-packets --packet <path> --check`, then apply the authorised migration and resolve prerequisite declarations from the reviewed plan. Missing prerequisites are not independence. Never rename legacy packets merely to run them. Commit preparation changes before execution; local one-shot requires a clean starting worktree.",
|
|
@@ -1646,6 +1987,8 @@ var require_renderAssistantActionSkills = __commonJS({
|
|
|
1646
1987
|
"",
|
|
1647
1988
|
"After inspecting selection and prerequisites, invoke that same command without --preview within the owner's execution authorisation. Use --commit-policy done when task commits are requested. Quote paths as arguments for the target shell. Observe the manifest and process to terminal completion; a successful launch is not completed work. Do not recursively invoke this action from a child do/check stage. If a provider cannot run from the current agent environment, report its real error and an exact terminal command instead of changing providers or credentials.",
|
|
1648
1989
|
"",
|
|
1990
|
+
"Before resume, verify the run workspace, recorded branch and packet Delivery context; do not silently switch a running or resumed workflow. Missing context or a wrong branch blocks dependent execution until resolved.",
|
|
1991
|
+
"",
|
|
1649
1992
|
"Use `swarmcraft status --workspace . --run <id>` and `swarmcraft resume --workspace . --run <id>` for recovery. Scope and policy stay frozen. Inspect changed packets before explicit --accept-packet-changes and interrupted logs before --retry-interrupted; never add those flags automatically to hide uncertainty. Report completed, blocked, review-required and skipped work separately, including commits and actual validation evidence.",
|
|
1650
1993
|
"",
|
|
1651
1994
|
"## Mode Selection",
|
|
@@ -1759,6 +2102,7 @@ var require_renderAssistantActionSkills = __commonJS({
|
|
|
1759
2102
|
"# SwarmCraft Test",
|
|
1760
2103
|
"",
|
|
1761
2104
|
"Use this skill to improve testing evidence without adding a new workflow lane or silently switching into implementation work.",
|
|
2105
|
+
"Testing evidence can support `swarmcraft-merge-request`; it is not a human merge decision or authority to submit, push or merge.",
|
|
1762
2106
|
"",
|
|
1763
2107
|
"## Required Context",
|
|
1764
2108
|
"",
|
|
@@ -3141,6 +3485,7 @@ var require_renderProjectGuide = __commonJS({
|
|
|
3141
3485
|
"When copied from the VS Code extension, the exact command format follows the workspace's selected AI provider:",
|
|
3142
3486
|
"",
|
|
3143
3487
|
"- Copilot copies `/plan`, `/do`, `/check`, `/review`, and `/test` prompt commands for `.github/prompts`.",
|
|
3488
|
+
"- Project skills also include swarmcraft-merge-request, swarmcraft-merge-review and swarmcraft-merge-respond for repository-owned integration review. They are separate from packet lanes; task Done does not authorise a merge or deployment.",
|
|
3144
3489
|
"- Codex copies `$swarmcraft-plan`, `$swarmcraft-do`, `$swarmcraft-check`, `$swarmcraft-review`, and `$swarmcraft-test` skill invocations for `.agents/skills`.",
|
|
3145
3490
|
"- Copilot can invoke `/prototype`; Codex can invoke `$swarmcraft-prototype` when a collaborative decision prototype is useful.",
|
|
3146
3491
|
"",
|
|
@@ -3975,11 +4320,13 @@ var require_renderPlanning = __commonJS({
|
|
|
3975
4320
|
exports2.renderPlanningSeedFiles = renderPlanningSeedFiles;
|
|
3976
4321
|
exports2.renderPlanContract = renderPlanContract;
|
|
3977
4322
|
exports2.renderInitiativePlanTemplate = renderInitiativePlanTemplate;
|
|
4323
|
+
var contract_1 = require_contract();
|
|
3978
4324
|
var packet_workflow_1 = require_dist();
|
|
3979
4325
|
function renderPlanningSeedFiles(provider) {
|
|
3980
4326
|
const root = `${(0, packet_workflow_1.getProviderSkillRoot)(provider)}/swarmcraft-plan`;
|
|
3981
4327
|
return [
|
|
3982
4328
|
{ relativePath: `${root}/references/plan-contract.md`, contents: renderPlanContract() },
|
|
4329
|
+
{ relativePath: `${root}/references/delivery.md`, contents: contract_1.DELIVERY_CONTRACT },
|
|
3983
4330
|
{ relativePath: `${root}/assets/initiative-plan-template.md`, contents: renderInitiativePlanTemplate() }
|
|
3984
4331
|
];
|
|
3985
4332
|
}
|
|
@@ -4012,6 +4359,10 @@ Read repository instructions and only the discovery documents, code surfaces, ex
|
|
|
4012
4359
|
- Inspect the worktree before writing. Preserve unrelated changes and do not include them in a plan commit.
|
|
4013
4360
|
- Create or update the plan only when requested. Never silently rewrite an existing plan or board-linked packet.
|
|
4014
4361
|
|
|
4362
|
+
## Delivery
|
|
4363
|
+
|
|
4364
|
+
Read [delivery ownership and branches](delivery.md) before recording delivery intent or preparing execution. Include one responsible developer, source branch and merge target in the plan. Planning does not switch branches. Resolve missing legacy context before execution; preserve existing work and conventions.
|
|
4365
|
+
|
|
4015
4366
|
## Required Content
|
|
4016
4367
|
|
|
4017
4368
|
The plan contains an objective, locked decisions, current context, target shape when material, ordered outcome-oriented phases, dependencies, risks, success criteria, review points, assumptions, unresolved questions, and packet links. Each phase states a goal and durable outcome. It does not copy packet checklists or track lanes, ordering, checklist completion, approval state, or board status.
|
|
@@ -4063,6 +4414,12 @@ The planning skill's action=implement hands accepted plan or direct-packet scope
|
|
|
4063
4414
|
|
|
4064
4415
|
<One testable statement of the intended initiative outcome.>
|
|
4065
4416
|
|
|
4417
|
+
## Delivery
|
|
4418
|
+
|
|
4419
|
+
- Developer: <responsible human, or explicitly unresolved>
|
|
4420
|
+
- Source branch: <plan filename stem, respecting repository conventions>
|
|
4421
|
+
- Merge target: <target branch, or explicitly unresolved>
|
|
4422
|
+
|
|
4066
4423
|
## Locked Decisions
|
|
4067
4424
|
|
|
4068
4425
|
- <Decision already made and the boundary it establishes.>
|
|
@@ -4577,6 +4934,7 @@ var require_seedProjectContext = __commonJS({
|
|
|
4577
4934
|
exports2.buildStaticProjectSeedFiles = buildStaticProjectSeedFiles;
|
|
4578
4935
|
exports2.buildDynamicProjectSeedFiles = buildDynamicProjectSeedFiles;
|
|
4579
4936
|
exports2.buildProjectSeedFiles = buildProjectSeedFiles;
|
|
4937
|
+
var renderMerge_1 = require_renderMerge();
|
|
4580
4938
|
var workspaceTracking_1 = require_workspaceTracking();
|
|
4581
4939
|
var packet_workflow_1 = require_dist();
|
|
4582
4940
|
var renderAssistantActionSkills_1 = require_renderAssistantActionSkills();
|
|
@@ -4687,6 +5045,7 @@ var require_seedProjectContext = __commonJS({
|
|
|
4687
5045
|
...packet_workflow_1.SWARMCRAFT_ASSISTANT_ACTIONS.map((action) => ({ relativePath: action.claudeSkillPath, contents: (0, renderAssistantActionSkills_1.renderSwarmCraftActionSkillFile)(action.key) }))
|
|
4688
5046
|
] : provider === "copilot" ? copilotFiles : codexFiles,
|
|
4689
5047
|
...(0, renderPlanning_1.renderPlanningSeedFiles)(provider),
|
|
5048
|
+
...(0, renderMerge_1.renderMergeSeedFiles)(provider),
|
|
4690
5049
|
...(0, renderReports_1.renderReportSeedFiles)(provider),
|
|
4691
5050
|
...(0, renderPrototype_1.renderPrototypeSeedFiles)(provider),
|
|
4692
5051
|
...(0, renderDesign_1.renderDesignSeedFiles)(provider)
|
|
@@ -17156,7 +17515,7 @@ var require_seedProjectFiles = __commonJS({
|
|
|
17156
17515
|
var seedOperationProject_1 = require_seedOperationProject();
|
|
17157
17516
|
exports2.ROOT_AGENTS_FILE_PATH = "AGENTS.md";
|
|
17158
17517
|
exports2.PROJECT_SEED_STATE_PATH = ".swarmcraft/project.seed-state.json";
|
|
17159
|
-
exports2.PROJECT_TEMPLATE_SET_VERSION =
|
|
17518
|
+
exports2.PROJECT_TEMPLATE_SET_VERSION = 16;
|
|
17160
17519
|
async function seedProjectFiles2(project, provider, dependencies, options = {}) {
|
|
17161
17520
|
const desired = [
|
|
17162
17521
|
...classifyFiles((0, seedProjectContext_1.buildDynamicProjectSeedFiles)(project), "dynamic", provider),
|
|
@@ -68444,6 +68803,7 @@ __export(main_exports, {
|
|
|
68444
68803
|
runAuthLogin: () => runAuthLogin
|
|
68445
68804
|
});
|
|
68446
68805
|
module.exports = __toCommonJS(main_exports);
|
|
68806
|
+
var import_packet_workflow9 = __toESM(require_dist(), 1);
|
|
68447
68807
|
|
|
68448
68808
|
// src/browserAuth.ts
|
|
68449
68809
|
var import_node_crypto = require("node:crypto");
|
|
@@ -69001,6 +69361,8 @@ async function buildAgentEnvironment(options, stageEnv) {
|
|
|
69001
69361
|
env2.SWARMCRAFT_DRIVER_AUTO_COMMIT = "true";
|
|
69002
69362
|
env2.SWARMCRAFT_CLI_AUTO_COMMIT = "true";
|
|
69003
69363
|
}
|
|
69364
|
+
env2.SWARMCRAFT_ONE_SHOT_DELIVERY = (0, import_packet_workflow.parseDeliveryMode)(options.delivery);
|
|
69365
|
+
env2.SWARMCRAFT_ONE_SHOT_REVIEWING = options.reviewing ? "on" : "off";
|
|
69004
69366
|
env2.SWARMCRAFT_ONE_SHOT_CHECKING = options.checking ? "on" : "off";
|
|
69005
69367
|
if (!options.agentApiKeyEnvName) return env2;
|
|
69006
69368
|
const envFileValues = options.agentEnvFilePath ? await readEnvFile(options.agentEnvFilePath) : {};
|
|
@@ -69406,12 +69768,12 @@ Implementation complete. Checking: ${options.checking ? "completed" : "explicitl
|
|
|
69406
69768
|
// src/main.ts
|
|
69407
69769
|
var import_promises15 = require("node:fs/promises");
|
|
69408
69770
|
var import_node_path15 = __toESM(require("node:path"), 1);
|
|
69409
|
-
var
|
|
69771
|
+
var import_packet_workflow10 = __toESM(require_dist(), 1);
|
|
69410
69772
|
|
|
69411
69773
|
// package.json
|
|
69412
69774
|
var package_default = {
|
|
69413
69775
|
name: "@swarmcraftai/cli",
|
|
69414
|
-
version: "0.
|
|
69776
|
+
version: "0.9.0",
|
|
69415
69777
|
description: "Prepare repositories and run packet-based SwarmCraft agent workflows from the terminal.",
|
|
69416
69778
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
69417
69779
|
type: "module",
|
|
@@ -69609,9 +69971,10 @@ async function seedWorkspace(project, workspacePath, provider) {
|
|
|
69609
69971
|
}
|
|
69610
69972
|
|
|
69611
69973
|
// src/oneShot.ts
|
|
69974
|
+
var import_packet_workflow6 = __toESM(require_dist(), 1);
|
|
69612
69975
|
var import_promises7 = require("node:fs/promises");
|
|
69613
69976
|
var import_node_path7 = __toESM(require("node:path"), 1);
|
|
69614
|
-
var
|
|
69977
|
+
var import_packet_workflow7 = __toESM(require_dist(), 1);
|
|
69615
69978
|
|
|
69616
69979
|
// src/workflows/one-shot-board-sync.ts
|
|
69617
69980
|
var import_packet_workflow5 = __toESM(require_dist(), 1);
|
|
@@ -69800,10 +70163,10 @@ async function runOneShot(client, accessTokenProvider, options) {
|
|
|
69800
70163
|
});
|
|
69801
70164
|
} catch (failure2) {
|
|
69802
70165
|
if (!(failure2 instanceof ManagedAiCreditsExhaustedError)) {
|
|
69803
|
-
if (options.agentProvider === "claude") {
|
|
69804
|
-
taskOutcome.outcome = "blocked-agent-failure";
|
|
70166
|
+
if (options.agentProvider === "claude" || failure2 instanceof import_packet_workflow6.DoingIncompleteError) {
|
|
70167
|
+
taskOutcome.outcome = failure2 instanceof import_packet_workflow6.DoingIncompleteError ? "blocked-doing-incomplete" : "blocked-agent-failure";
|
|
69805
70168
|
taskOutcome.finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
69806
|
-
taskOutcome.elapsedMs = (0,
|
|
70169
|
+
taskOutcome.elapsedMs = (0, import_packet_workflow7.computeElapsedMs)(taskOutcome.startedAt, taskOutcome.finishedAt);
|
|
69807
70170
|
finalizeManifest(manifest);
|
|
69808
70171
|
await persistRunManifest(manifestPath, manifest);
|
|
69809
70172
|
}
|
|
@@ -69815,7 +70178,7 @@ async function runOneShot(client, accessTokenProvider, options) {
|
|
|
69815
70178
|
board = result.board;
|
|
69816
70179
|
taskOutcome.outcome = result.outcome;
|
|
69817
70180
|
taskOutcome.finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
69818
|
-
taskOutcome.elapsedMs = (0,
|
|
70181
|
+
taskOutcome.elapsedMs = (0, import_packet_workflow7.computeElapsedMs)(taskOutcome.startedAt, taskOutcome.finishedAt);
|
|
69819
70182
|
printProgress(`Task ${taskIndex + 1}/${selectedTasks.length} finished as ${result.outcome} in ${formatDuration(taskOutcome.elapsedMs)}.`);
|
|
69820
70183
|
if (result.outcome === "done" || result.outcome === "manual-review-required") {
|
|
69821
70184
|
completedTaskIds.add(selectedTask.id);
|
|
@@ -69858,7 +70221,7 @@ function hasRemainingUncompletedTasks(selectedTasks, startIndex, completedTaskId
|
|
|
69858
70221
|
function finalizeManifest(manifest) {
|
|
69859
70222
|
manifest.finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
69860
70223
|
manifest.status = resolveManifestStatus(manifest);
|
|
69861
|
-
manifest.durations = (0,
|
|
70224
|
+
manifest.durations = (0, import_packet_workflow7.summarizeWorkflowRunDurations)(manifest);
|
|
69862
70225
|
}
|
|
69863
70226
|
async function processTask(context) {
|
|
69864
70227
|
let currentBoard = context.board;
|
|
@@ -69868,7 +70231,7 @@ async function processTask(context) {
|
|
|
69868
70231
|
currentBoard = await moveBoardTask(context.client, await context.getAccessToken(), context.project.id, currentTask, "doing", context.options.delegation?.id ?? null);
|
|
69869
70232
|
currentTask = requireBoardTask(currentBoard, context.task.id);
|
|
69870
70233
|
}
|
|
69871
|
-
const packetPath = (0,
|
|
70234
|
+
const packetPath = (0, import_packet_workflow7.resolvePacketFilePath)(context.project, currentTask, currentTask.packetLink);
|
|
69872
70235
|
context.taskOutcome.packetPath = packetPath;
|
|
69873
70236
|
await refreshPacketMetadata(context.workspacePath, packetPath, currentTask);
|
|
69874
70237
|
printProgress(`Packet: ${packetPath}`);
|
|
@@ -69877,6 +70240,7 @@ async function processTask(context) {
|
|
|
69877
70240
|
currentBoard = doResult.board;
|
|
69878
70241
|
currentTask = doResult.task;
|
|
69879
70242
|
}
|
|
70243
|
+
(0, import_packet_workflow6.requireDoingCompletion)(currentTask.checklistItems.filter((item) => item.checklistStage === "doing"));
|
|
69880
70244
|
if (!context.options.checking) {
|
|
69881
70245
|
return moveAfterAcceptedChecking(context, currentBoard, currentTask, packetPath);
|
|
69882
70246
|
}
|
|
@@ -69901,7 +70265,7 @@ async function processTask(context) {
|
|
|
69901
70265
|
await refreshPacketMetadata(context.workspacePath, packetPath, currentTask);
|
|
69902
70266
|
continue;
|
|
69903
70267
|
}
|
|
69904
|
-
const accepted = currentTask.workflowState === "reviewing" || currentTask.workflowState === "done" || (0,
|
|
70268
|
+
const accepted = currentTask.workflowState === "reviewing" || currentTask.workflowState === "done" || (0, import_packet_workflow7.allChecklistItemsComplete)(currentTask, "checking");
|
|
69905
70269
|
if (accepted) {
|
|
69906
70270
|
return moveAfterAcceptedChecking(context, currentBoard, currentTask, packetPath);
|
|
69907
70271
|
}
|
|
@@ -69912,7 +70276,7 @@ async function runStageAndSync(context) {
|
|
|
69912
70276
|
if (context.options.maxAgentRequests !== null && context.getAgentRequests() >= context.options.maxAgentRequests) {
|
|
69913
70277
|
throw new Error(`Agent request budget exhausted before ${context.stage} for ${context.task.title}.`);
|
|
69914
70278
|
}
|
|
69915
|
-
const stageCommand = (0,
|
|
70279
|
+
const stageCommand = (0, import_packet_workflow7.buildPacketStageCommand)({
|
|
69916
70280
|
workflowState: context.stage === "do" ? "doing" : "checking",
|
|
69917
70281
|
relativePacketFilePath: context.packetPath,
|
|
69918
70282
|
agentProvider: context.options.agentProvider === "custom" ? "copilot" : context.options.agentProvider === "managed" ? "codex" : context.options.agentProvider
|
|
@@ -69976,7 +70340,7 @@ async function runStageAndSync(context) {
|
|
|
69976
70340
|
if (execution.exitCode !== 0) {
|
|
69977
70341
|
stageOutcome.result = "failed";
|
|
69978
70342
|
stageOutcome.finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
69979
|
-
stageOutcome.elapsedMs = (0,
|
|
70343
|
+
stageOutcome.elapsedMs = (0, import_packet_workflow7.computeElapsedMs)(stageOutcome.startedAt, stageOutcome.finishedAt);
|
|
69980
70344
|
await persistRunManifest(context.manifestPath, context.manifest);
|
|
69981
70345
|
printProgress(`${context.stage} stage failed in ${formatDuration(stageOutcome.elapsedMs)}.`);
|
|
69982
70346
|
const failureOutput = `${execution.stderr}
|
|
@@ -70001,7 +70365,7 @@ ${execution.stdout}`;
|
|
|
70001
70365
|
throw new Error(`Agent spend budget exceeded: $${knownSpendUsd.toFixed(4)} > $${context.options.maxAgentSpendUsd.toFixed(4)}.`);
|
|
70002
70366
|
}
|
|
70003
70367
|
stageOutcome.finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
70004
|
-
stageOutcome.elapsedMs = (0,
|
|
70368
|
+
stageOutcome.elapsedMs = (0, import_packet_workflow7.computeElapsedMs)(stageOutcome.startedAt, stageOutcome.finishedAt);
|
|
70005
70369
|
stageOutcome.laneAfter = syncResult.task.workflowState;
|
|
70006
70370
|
stageOutcome.syncedChanges = syncResult.syncedChanges;
|
|
70007
70371
|
await persistRunManifest(context.manifestPath, context.manifest);
|
|
@@ -70086,16 +70450,16 @@ function createRunId() {
|
|
|
70086
70450
|
function describeAgentPolicy(options) {
|
|
70087
70451
|
const policyProvider = options.agentProvider === "managed" ? "codex" : options.agentProvider;
|
|
70088
70452
|
return {
|
|
70089
|
-
sandboxMode: (0,
|
|
70453
|
+
sandboxMode: (0, import_packet_workflow7.resolveExternalAgentSandboxMode)({
|
|
70090
70454
|
agentMode: "externalCommand",
|
|
70091
70455
|
agentProvider: policyProvider,
|
|
70092
|
-
agentCommand: options.agentCommand ?? (0,
|
|
70456
|
+
agentCommand: options.agentCommand ?? (0, import_packet_workflow7.resolveExternalAgentProviderDefault)(policyProvider)?.command ?? null,
|
|
70093
70457
|
agentCommandSource: options.agentCommand ? "cli" : "provider-default"
|
|
70094
70458
|
}),
|
|
70095
|
-
approvalPosture: (0,
|
|
70459
|
+
approvalPosture: (0, import_packet_workflow7.resolveExternalAgentApprovalPosture)({
|
|
70096
70460
|
agentMode: "externalCommand",
|
|
70097
70461
|
agentProvider: policyProvider,
|
|
70098
|
-
agentCommand: options.agentCommand ?? (0,
|
|
70462
|
+
agentCommand: options.agentCommand ?? (0, import_packet_workflow7.resolveExternalAgentProviderDefault)(policyProvider)?.command ?? null,
|
|
70099
70463
|
agentCommandSource: options.agentCommand ? "cli" : "provider-default"
|
|
70100
70464
|
})
|
|
70101
70465
|
};
|
|
@@ -70929,7 +71293,7 @@ function parseRunId(rawValue) {
|
|
|
70929
71293
|
}
|
|
70930
71294
|
|
|
70931
71295
|
// src/commands/command-catalog.ts
|
|
70932
|
-
var
|
|
71296
|
+
var import_packet_workflow8 = __toESM(require_dist(), 1);
|
|
70933
71297
|
var COMMANDS = [
|
|
70934
71298
|
{ name: "upgrade", usage: "swarmcraft upgrade --workspace <path> [--check] [--include-completed] [--ordered-packets] [--packet <path>] [--json]", summary: "Upgrade existing project guidance and packets locally without an account; preserves the saved provider (upgrade protocol 1).", implemented: true },
|
|
70935
71299
|
{ name: "operate upgrade", usage: "swarmcraft operate upgrade --workspace <path> [--check] [--json]", summary: "Check or upgrade an existing Operate repository with local Git checkpoints and recovery (upgrade protocol 1).", implemented: true },
|
|
@@ -71009,7 +71373,7 @@ var COMMANDS = [
|
|
|
71009
71373
|
},
|
|
71010
71374
|
{
|
|
71011
71375
|
name: "one-shot",
|
|
71012
|
-
usage: `swarmcraft one-shot (--project <project-id> | --plan <path> | --packet <path>) [--phase <anchor>] [--preview] --workspace <path> --agent-provider ${
|
|
71376
|
+
usage: `swarmcraft one-shot (--project <project-id> | --plan <path> | --packet <path>) [--phase <anchor>] [--preview] --workspace <path> --agent-provider ${import_packet_workflow8.EXTERNAL_AGENT_PROVIDERS.join("|")}|managed [--agent-command <template>] [--delegation <id>] [--run-id <id>] [--delivery branch|direct] [--checking on|off] [--reviewing on|off] [--task <id>] [--task-limit <n|all>] [--max-checking-attempts <n>] [--done-policy stop|auto] [--commit-policy none|done] [--max-agent-requests <n>] [--allow-dirty]`,
|
|
71013
71377
|
summary: "Run the project board packet loop with your own AI or incrementally metered Managed AI.",
|
|
71014
71378
|
implemented: true
|
|
71015
71379
|
},
|
|
@@ -71062,7 +71426,7 @@ var COMMAND_INSTRUCTIONS = {
|
|
|
71062
71426
|
"projects list": { requirements: ["Signed-in session and network."], effects: ["Lists accessible projects. May refresh the local session; optional on-behalf-of access starts an audited delegation."], options: ["--delegation selects existing access; --on-behalf-of requires --delegation-reason."], result: "Prints project ID, state, progress and title; exit 0 on success, 1 on failure.", example: "swarmcraft projects list" },
|
|
71063
71427
|
"delegation start": { requirements: ["Signed-in authorised operator and network."], effects: ["Creates audited, temporary server-side access for the named user."], options: ["--user and --reason required; --support-ticket optional; --expires-in-minutes bounds 5\u2013600 (server default when omitted)."], result: "Prints delegation details; exit 0 on success, 1 on failure.", example: "swarmcraft delegation start --user <user> --reason <reason>" },
|
|
71064
71428
|
"delegation end": { requirements: ["Signed-in authorised operator and network."], effects: ["Revokes the specified server-side delegation; local repo files are untouched."], options: ["--delegation <id> required."], result: "Prints the ended delegation; exit 0 on success, 1 on failure.", example: "swarmcraft delegation end --delegation <id>" },
|
|
71065
|
-
"one-shot": { requirements: ["Hosted mode requires signed-in project access and network. Local --plan/--packet mode needs only Git and the external provider; Managed AI requires hosted mode and credits."], effects: ["Runs agents, changes repository files and board state, and writes run artifacts under .swarmcraft/runs/<run-id>. Managed AI is metered; external providers use their own access.", "This executes delivery, not a guidance upgrade. Commit policy can create local commits; review outputs."], options: ["--workspace and --agent-provider required; choose hosted --project or local --plan / repeatable --packet. Local --phase narrows a plan; --preview resolves selection without execution. Local mode rejects mixed hosted selectors. custom uses --agent-command or SWARMCRAFT_AGENT_COMMAND; managed rejects custom credentials/commands.", "Local defaults: --checking on; --reviewing on; --commit-policy none. Local mode does not accept --done-policy: reviewing on stops for human review; reviewing off permits completion after required stages. --task-limit and --max-checking-attempts are hosted-only.", "Hosted defaults: --checking off; --done-policy auto; --reviewing on only when done-policy is stop; --commit-policy none; --task-limit all; --max-checking-attempts 2.", "--max-agent-requests and --max-agent-spend-usd bound usage; --require-cost-telemetry requires cost evidence. --allow-dirty opts into existing changes.", "The resume command freezes local scope and policy. Its --accept-packet-changes explicitly reconciles owner edits; --retry-interrupted permits retry after inspecting an interrupted stage. Local outcomes exit 0 complete, 2 blocked/review-required, 1 execution error. --run-id selects artifacts; --task selects tasks; --agent-env-file and --agent-api-key-env-name configure external providers; --delegation selects authorised access."], result: "Prints run/task outcomes. Exit 0 means command completion, not that every task succeeded; inspect outcomes. Execution errors exit 1.", example: "swarmcraft one-shot --project <id> --workspace . --agent-provider claude --done-policy stop --max-agent-requests 3" },
|
|
71429
|
+
"one-shot": { requirements: ["Hosted mode requires signed-in project access and network. Local --plan/--packet mode needs only Git and the external provider; Managed AI requires hosted mode and credits."], effects: ["Runs agents, changes repository files and board state, and writes run artifacts under .swarmcraft/runs/<run-id>. Managed AI is metered; external providers use their own access.", "This executes delivery, not a guidance upgrade. Commit policy can create local commits; review outputs."], options: ["--workspace and --agent-provider required; choose hosted --project or local --plan / repeatable --packet. Local --phase narrows a plan; --preview resolves selection without execution. Local mode rejects mixed hosted selectors. custom uses --agent-command or SWARMCRAFT_AGENT_COMMAND; managed rejects custom credentials/commands.", "--delivery branch|direct defaults to branch. Direct runs on the current branch without source/target branch or merge prerequisites; checking and reviewing remain independent. Neither mode pushes or merges automatically.", "Local defaults: --checking on; --reviewing on; --commit-policy none. Local mode does not accept --done-policy: reviewing on stops for human review; reviewing off permits completion after required stages. --task-limit and --max-checking-attempts are hosted-only.", "Hosted defaults: --checking off; --done-policy auto; --reviewing on only when done-policy is stop; --commit-policy none; --task-limit all; --max-checking-attempts 2.", "--max-agent-requests and --max-agent-spend-usd bound usage; --require-cost-telemetry requires cost evidence. --allow-dirty opts into existing changes.", "The resume command freezes local scope and policy. Its --accept-packet-changes explicitly reconciles owner edits; --retry-interrupted permits retry after inspecting an interrupted stage. Local outcomes exit 0 complete, 2 blocked/review-required, 1 execution error. --run-id selects artifacts; --task selects tasks; --agent-env-file and --agent-api-key-env-name configure external providers; --delegation selects authorised access."], result: "Prints run/task outcomes. Exit 0 means command completion, not that every task succeeded; inspect outcomes. Execution errors exit 1.", example: "swarmcraft one-shot --project <id> --workspace . --agent-provider claude --done-policy stop --max-agent-requests 3" },
|
|
71066
71430
|
resume: { requirements: ["Existing run manifest and original provider prerequisites. Hosted runs also require signed-in project access and network."], effects: ["Continues the recorded execution, including agent writes and board updates. Uses the saved run policies."], options: ["--run and --workspace required; --max-agent-requests can extend the request limit. Hosted-only: --allow-dirty and --delegation. Local-only: --accept-packet-changes reconciles inspected owner edits; --retry-interrupted authorizes retry of an inspected interrupted stage. Selection and execution policies remain frozen."], result: "Prints resumed run outcomes; inspect task failures even when command exits 0. Errors exit 1.", example: "swarmcraft resume --run <id> --workspace ." },
|
|
71067
71431
|
status: { requirements: ["Existing local run manifest; no sign-in or API required."], effects: ["Reads the recorded run summary without continuing execution or writing files."], options: ["--run and --workspace required. Delegation is not used for this local read."], result: "Prints local run/task outcomes; exit 0 on success, 1 when unreadable.", example: "swarmcraft status --run <id> --workspace ." },
|
|
71068
71432
|
doctor: { requirements: ["No session required for local checks; an existing session enables an API reachability check."], effects: ["Checks Node, session, optional Git workspace and provider executable. May refresh session or use explicitly requested delegation; does not upgrade guidance."], options: ["--workspace and --agent-provider optional; custom skips provider executable lookup."], result: "Diagnostic text reports missing prerequisites; a completed diagnostic may exit 0 despite reported problems. Read the output.", example: "swarmcraft doctor --workspace . --agent-provider claude" },
|
|
@@ -72332,14 +72696,14 @@ async function runInit(parsed) {
|
|
|
72332
72696
|
printBootstrapSummary(summary);
|
|
72333
72697
|
}
|
|
72334
72698
|
async function runOneShotCommand(parsed) {
|
|
72335
|
-
rejectUnsupportedOptions(parsed, ["api-base-url", "workspace", "agent-provider", "agent-command", "agent-env-file", "agent-api-key-env-name", "project", "plan", "packet", "phase", "preview", "task", "task-limit", "delegation", "checking", "reviewing", "done-policy", "commit-policy", "max-checking-attempts", "max-agent-requests", "max-agent-spend-usd", "require-cost-telemetry", "allow-dirty", "run-id"]);
|
|
72699
|
+
rejectUnsupportedOptions(parsed, ["api-base-url", "workspace", "agent-provider", "agent-command", "agent-env-file", "agent-api-key-env-name", "project", "plan", "packet", "phase", "preview", "task", "task-limit", "delegation", "delivery", "checking", "reviewing", "done-policy", "commit-policy", "max-checking-attempts", "max-agent-requests", "max-agent-spend-usd", "require-cost-telemetry", "allow-dirty", "run-id"]);
|
|
72336
72700
|
if (getOption(parsed, "plan") || getOptions(parsed, "packet").length) {
|
|
72337
72701
|
for (const key of ["api-base-url", "project", "task", "delegation", "task-limit", "done-policy", "max-checking-attempts"]) if (getOption(parsed, key)) throw new Error(`Local selection cannot combine with --${key}.`);
|
|
72338
72702
|
const options2 = { ...parseOneShotOptions(parsed, true), delegation: null };
|
|
72339
72703
|
const selectors = { plan: getOption(parsed, "plan") ?? void 0, phases: getOptions(parsed, "phase"), packets: getOptions(parsed, "packet") };
|
|
72340
72704
|
if (hasFlag(parsed, "preview")) {
|
|
72341
72705
|
const selection = await selectLocalPackets(options2.workspacePath, selectors);
|
|
72342
|
-
console.log(JSON.stringify({ selection, checking: options2.checking, reviewing: options2.reviewing, commitPolicy: options2.commitPolicy, maxAgentRequests: options2.maxAgentRequests }, null, 2));
|
|
72706
|
+
console.log(JSON.stringify({ selection, delivery: options2.delivery, checking: options2.checking, reviewing: options2.reviewing, commitPolicy: options2.commitPolicy, maxAgentRequests: options2.maxAgentRequests }, null, 2));
|
|
72343
72707
|
return 0;
|
|
72344
72708
|
}
|
|
72345
72709
|
const result = await startLocalRun(options2, selectors);
|
|
@@ -72442,7 +72806,7 @@ async function runDoctor(parsed) {
|
|
|
72442
72806
|
}
|
|
72443
72807
|
const provider = getOption(parsed, "agent-provider");
|
|
72444
72808
|
if (provider && provider !== "custom") {
|
|
72445
|
-
const commandName = (0,
|
|
72809
|
+
const commandName = (0, import_packet_workflow10.parseExternalAgentProvider)(provider);
|
|
72446
72810
|
const result = await runProcess(process.platform === "win32" ? "where.exe" : "which", [commandName], process.cwd());
|
|
72447
72811
|
console.log(`${commandName}: ${result.exitCode === 0 ? result.stdout.trim() : "not found"}`);
|
|
72448
72812
|
}
|
|
@@ -72599,7 +72963,7 @@ function printRunSummary(manifest) {
|
|
|
72599
72963
|
}
|
|
72600
72964
|
function parseOneShotOptions(parsed, local = false) {
|
|
72601
72965
|
const providerValue = requireOption(parsed, "agent-provider");
|
|
72602
|
-
const agentProvider = providerValue === "managed" ? "managed" : (0,
|
|
72966
|
+
const agentProvider = providerValue === "managed" ? "managed" : (0, import_packet_workflow10.parseExternalAgentProvider)(providerValue);
|
|
72603
72967
|
if (agentProvider === "managed" && (getOption(parsed, "agent-command") || getOption(parsed, "agent-env-file") || getOption(parsed, "agent-api-key-env-name"))) {
|
|
72604
72968
|
throw new Error("Managed AI does not accept custom commands or provider credentials.");
|
|
72605
72969
|
}
|
|
@@ -72612,6 +72976,7 @@ function parseOneShotOptions(parsed, local = false) {
|
|
|
72612
72976
|
workspacePath: requireOption(parsed, "workspace"),
|
|
72613
72977
|
agentProvider,
|
|
72614
72978
|
agentCommand: getOption(parsed, "agent-command") ?? process.env.SWARMCRAFT_AGENT_COMMAND ?? null,
|
|
72979
|
+
delivery: (0, import_packet_workflow9.parseDeliveryMode)(getOption(parsed, "delivery")),
|
|
72615
72980
|
checking: parseOnOff(getOption(parsed, "checking") ?? (local ? "on" : "off"), "--checking"),
|
|
72616
72981
|
reviewing: explicitReviewing ? parseOnOff(explicitReviewing, "--reviewing") : local || donePolicy === "stop",
|
|
72617
72982
|
maxCheckingAttempts: parsePositiveInteger(getOption(parsed, "max-checking-attempts") ?? "2", "--max-checking-attempts"),
|
package/package.json
CHANGED