snipara-companion 3.2.15 → 3.2.16
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/index.d.ts +8 -0
- package/dist/index.js +88 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3149,6 +3149,14 @@ interface AgenticWorkStatus {
|
|
|
3149
3149
|
count?: number;
|
|
3150
3150
|
note: string;
|
|
3151
3151
|
};
|
|
3152
|
+
operationalLoop: {
|
|
3153
|
+
status: "clear" | "attention" | "blocked";
|
|
3154
|
+
decisionRequestCount: number;
|
|
3155
|
+
receiptGapCount: number;
|
|
3156
|
+
nextActions: string[];
|
|
3157
|
+
receiptActions: string[];
|
|
3158
|
+
caveats: string[];
|
|
3159
|
+
};
|
|
3152
3160
|
suggestedNextAction: string;
|
|
3153
3161
|
}
|
|
3154
3162
|
interface AgenticTimelineEvent {
|
package/dist/index.js
CHANGED
|
@@ -23292,6 +23292,68 @@ function buildSuggestedAgenticNextAction(state, risks) {
|
|
|
23292
23292
|
}
|
|
23293
23293
|
return "Run snipara-companion workflow status to inspect the managed workflow.";
|
|
23294
23294
|
}
|
|
23295
|
+
function buildAgenticOperationalLoop(args) {
|
|
23296
|
+
const phase = args.state ? currentWorkflowPhase(args.state) : void 0;
|
|
23297
|
+
const nextActions = [];
|
|
23298
|
+
const receiptActions = [];
|
|
23299
|
+
const caveats = [
|
|
23300
|
+
"Operational Loop is local and advisory; it does not edit Project Policy, approve memory, or bypass verification."
|
|
23301
|
+
];
|
|
23302
|
+
let receiptGapCount = 0;
|
|
23303
|
+
if (args.pendingDecisionCount > 0) {
|
|
23304
|
+
nextActions.push(
|
|
23305
|
+
`Resolve ${args.pendingDecisionCount} local Decision Request${args.pendingDecisionCount === 1 ? "" : "s"} with snipara-companion workflow decisions and workflow decide.`
|
|
23306
|
+
);
|
|
23307
|
+
}
|
|
23308
|
+
if (args.teamSyncSummary.staleWorkCount > 0) {
|
|
23309
|
+
nextActions.push(
|
|
23310
|
+
"Review stale Team Sync work with snipara-companion team-sync sweep --dry-run before continuing."
|
|
23311
|
+
);
|
|
23312
|
+
}
|
|
23313
|
+
if (args.dirtyFileCount > 0) {
|
|
23314
|
+
nextActions.push("Review dirty git state and run the relevant checks before phase-commit.");
|
|
23315
|
+
}
|
|
23316
|
+
if (args.latestHandoff?.next) {
|
|
23317
|
+
nextActions.push(
|
|
23318
|
+
`Continue latest handoff next step: ${toPreview(args.latestHandoff.next, 160)}`
|
|
23319
|
+
);
|
|
23320
|
+
}
|
|
23321
|
+
if (phase?.status === "blocked") {
|
|
23322
|
+
nextActions.push(`Unblock current phase '${phase.id}' before new implementation work.`);
|
|
23323
|
+
} else if (phase) {
|
|
23324
|
+
nextActions.push(
|
|
23325
|
+
`Continue phase '${phase.id}' and close it with snipara-companion workflow phase-commit ${phase.id}.`
|
|
23326
|
+
);
|
|
23327
|
+
} else if (!args.state) {
|
|
23328
|
+
nextActions.push("Start a managed workflow before multi-step implementation work.");
|
|
23329
|
+
}
|
|
23330
|
+
if (args.state && args.state.status !== "completed") {
|
|
23331
|
+
receiptGapCount += 1;
|
|
23332
|
+
receiptActions.push(
|
|
23333
|
+
"Before closing the phase, capture why/outcome evidence with snipara-companion outcome-capture preview --emit-outcome-receipt."
|
|
23334
|
+
);
|
|
23335
|
+
}
|
|
23336
|
+
if (args.latestHandoff && args.latestHandoff.attention !== "note") {
|
|
23337
|
+
receiptGapCount += 1;
|
|
23338
|
+
receiptActions.push(
|
|
23339
|
+
"Treat the latest Team Sync handoff as needing proof/review evidence before final-commit."
|
|
23340
|
+
);
|
|
23341
|
+
}
|
|
23342
|
+
if (args.pendingDecisionCount > 0) {
|
|
23343
|
+
receiptActions.push(
|
|
23344
|
+
"Decision Request resolution records the human choice; follow-up policy edits remain explicit."
|
|
23345
|
+
);
|
|
23346
|
+
}
|
|
23347
|
+
const status = phase?.status === "blocked" ? "blocked" : args.risks.length > 0 || args.pendingDecisionCount > 0 || receiptGapCount > 0 ? "attention" : "clear";
|
|
23348
|
+
return {
|
|
23349
|
+
status,
|
|
23350
|
+
decisionRequestCount: args.pendingDecisionCount,
|
|
23351
|
+
receiptGapCount,
|
|
23352
|
+
nextActions: uniqueStrings16(nextActions).slice(0, 6),
|
|
23353
|
+
receiptActions: uniqueStrings16(receiptActions).slice(0, 4),
|
|
23354
|
+
caveats
|
|
23355
|
+
};
|
|
23356
|
+
}
|
|
23295
23357
|
function buildAgenticWorkStatus(cwd = process.cwd()) {
|
|
23296
23358
|
const state = readWorkflowState2(cwd);
|
|
23297
23359
|
const git = readLocalGitState(cwd);
|
|
@@ -23302,6 +23364,7 @@ function buildAgenticWorkStatus(cwd = process.cwd()) {
|
|
|
23302
23364
|
const currentPhase = state ? currentWorkflowPhase(state) : void 0;
|
|
23303
23365
|
const lastPhaseCommit = lastCompletedWorkflowPhase(state);
|
|
23304
23366
|
const dirtyFileCount = git.statusLines?.length ?? 0;
|
|
23367
|
+
const pendingDecisionCount = decisionPendingCount(cwd);
|
|
23305
23368
|
const risks = buildAgenticStatusRisks({
|
|
23306
23369
|
state,
|
|
23307
23370
|
dirtyFileCount,
|
|
@@ -23358,8 +23421,17 @@ function buildAgenticWorkStatus(cwd = process.cwd()) {
|
|
|
23358
23421
|
},
|
|
23359
23422
|
risks,
|
|
23360
23423
|
openDecisions: {
|
|
23424
|
+
count: pendingDecisionCount,
|
|
23361
23425
|
note: "Run snipara-companion brief for hosted decisions and memory authority signals."
|
|
23362
23426
|
},
|
|
23427
|
+
operationalLoop: buildAgenticOperationalLoop({
|
|
23428
|
+
state,
|
|
23429
|
+
dirtyFileCount,
|
|
23430
|
+
risks,
|
|
23431
|
+
pendingDecisionCount,
|
|
23432
|
+
teamSyncSummary,
|
|
23433
|
+
latestHandoff
|
|
23434
|
+
}),
|
|
23363
23435
|
suggestedNextAction: buildSuggestedAgenticNextAction(state, risks)
|
|
23364
23436
|
};
|
|
23365
23437
|
}
|
|
@@ -23418,8 +23490,24 @@ function printAgenticWorkStatus(status) {
|
|
|
23418
23490
|
}
|
|
23419
23491
|
console.log("");
|
|
23420
23492
|
console.log(import_chalk6.default.bold("Open Decisions"));
|
|
23493
|
+
if (typeof status.openDecisions.count === "number") {
|
|
23494
|
+
console.log(`Local pending Decision Requests: ${status.openDecisions.count}`);
|
|
23495
|
+
}
|
|
23421
23496
|
console.log(status.openDecisions.note);
|
|
23422
23497
|
console.log("");
|
|
23498
|
+
console.log(import_chalk6.default.bold("Operational Loop"));
|
|
23499
|
+
console.log(`Status: ${status.operationalLoop.status}`);
|
|
23500
|
+
console.log(`Receipt gaps: ${status.operationalLoop.receiptGapCount}`);
|
|
23501
|
+
for (const action of status.operationalLoop.nextActions) {
|
|
23502
|
+
console.log(`- ${action}`);
|
|
23503
|
+
}
|
|
23504
|
+
for (const action of status.operationalLoop.receiptActions) {
|
|
23505
|
+
console.log(`- ${action}`);
|
|
23506
|
+
}
|
|
23507
|
+
for (const caveat of status.operationalLoop.caveats) {
|
|
23508
|
+
console.log(`- ${caveat}`);
|
|
23509
|
+
}
|
|
23510
|
+
console.log("");
|
|
23423
23511
|
printKeyValue2("Next suggested action:", status.suggestedNextAction);
|
|
23424
23512
|
if (status.workflow) {
|
|
23425
23513
|
printKeyValue2("Resume:", status.workflow.resumeCommand);
|