snipara-companion 3.2.5 → 3.2.6
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 +4 -1
- package/dist/index.js +70 -24
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1440,6 +1440,7 @@ interface MemoryGuardCheckOptions {
|
|
|
1440
1440
|
confirmedByUser?: string;
|
|
1441
1441
|
strict?: boolean;
|
|
1442
1442
|
json?: boolean;
|
|
1443
|
+
verbose?: boolean;
|
|
1443
1444
|
limit?: number;
|
|
1444
1445
|
categories?: string[];
|
|
1445
1446
|
includeContext?: boolean;
|
|
@@ -3385,6 +3386,7 @@ declare function buildWorkflowPhaseCommitSummary(args: {
|
|
|
3385
3386
|
phase: Pick<ManagedWorkflowPhase, "id" | "title">;
|
|
3386
3387
|
summary: string;
|
|
3387
3388
|
}): string;
|
|
3389
|
+
declare function resolveAutoWorkflowMode(query: string): Exclude<WorkflowMode, "auto">;
|
|
3388
3390
|
/**
|
|
3389
3391
|
* Compute the impact gate for committed-but-unpushed workflow phases.
|
|
3390
3392
|
*
|
|
@@ -3869,6 +3871,7 @@ interface CollaborationCommandOptions {
|
|
|
3869
3871
|
ackReviewOnly?: boolean;
|
|
3870
3872
|
dir?: string;
|
|
3871
3873
|
json?: boolean;
|
|
3874
|
+
verbose?: boolean;
|
|
3872
3875
|
}
|
|
3873
3876
|
interface CollaborationHooksInstallOptions {
|
|
3874
3877
|
dir?: string;
|
|
@@ -4255,4 +4258,4 @@ declare function buildOrchestratorHandoff(options: OrchestratorHandoffOptions):
|
|
|
4255
4258
|
declare function buildAdaptiveWorkRoutingRecommendation(options: AdaptiveWorkRoutingOptions): AdaptiveWorkRoutingRecommendation;
|
|
4256
4259
|
declare function writeOrchestratorHandoff(options: OrchestratorHandoffOptions): WrittenOrchestratorHandoff;
|
|
4257
4260
|
|
|
4258
|
-
export { AUTOMATION_MANIFEST_RELATIVE_PATH, AutomationInstallConflictError, AutomationUnsupportedHookBundleError, CODING_INTELLIGENCE_LEDGER_VERSION, COLLABORATION_STATE_RELATIVE_PATH, ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES, ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES, ENGINEERING_LEAD_POSTURES, ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES, ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES, ENGINEERING_LEAD_ROUTING_MODES, ENGINEERING_LEAD_STATUSES, ENGINEERING_LEAD_SUPERVISION_STATUSES, ENGINEERING_LEAD_WORKER_ROLES, ENGINEERING_LEAD_WORK_PACKAGE_STATUSES, ORCHESTRATOR_HANDOFF_RELATIVE_PATH, PRODUCER_LOOP_ARTIFACT_VERSION, PRODUCER_LOOP_RELATIVE_DIR, PRODUCER_LOOP_REPORT_VERSION, TEAM_SYNC_STATE_RELATIVE_PATH, WHY_OUTCOME_CAPTURE_VERSION, WORKFLOW_PLANS_RELATIVE_DIR, WORKFLOW_STATE_RELATIVE_PATH, addLocalWorker, agentReadinessAuditCommand, appendActivityEvent, archiveInactiveTeamSyncWork, attachLocalContextPackReceipts, autoArchiveTeamSyncState, buildAdaptiveWorkRoutingRecommendation, buildAgentReadinessAuditReport, buildAgenticHandoffMarkdown, buildAgenticTimeline, buildAgenticWorkStatus, buildAutomationInstallPlan, buildCanonicalEvent, buildCodeHooksInstallPlan, buildCodePromotionResult, buildCodeStatusResult, buildCodeSyncResult, buildCodingIntelligenceLedger, buildCollaborationActor, buildCollaborationGuardActionCards, buildCollaborationHooksInstallPlan, buildCompanionEngineeringLeadPlanReport, buildContextPackStats, buildEvalCaseArtifact, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalProjectRealityCheck, buildLocalShortestPathResult, buildLocalSourceSnapshot, buildLocalSourceStatus, buildLocalSourceSyncResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildProducerLoopReport, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapQuality, buildSessionSnapshot, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWhyOutcomeCaptureReport, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, codingLedgerExportCommand, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, compareLocalSourceSnapshots, completeTeamSyncStateFromEvidence, completeTeamSyncWorkFromEvidence, contextPackCleanCommand, contextPackPackCommand, contextPackRetrieveCommand, contextPackStatsCommand, createClient, createEmptyCollaborationState, createEmptyTeamSyncState, createLocalQueryCache, deriveLocalCollaborationResourcesFromFiles, detectReleaseSurfacesFromFiles, detectRuntimeEnvironment, evalExportCommand, evalRunCommand, evaluateProjectPolicyGates, extractCommandFromToolInput, extractFilesFromToolInput, formatAgentReadinessAuditReport, formatCompanionEngineeringLeadPlanReport, formatOrchestratorRecommendationReason, formatPolicyGateDecision, formatProjectJudgmentCard, formatStuckGuardDecision, getAutomationManifestPath, getAutomationStatus, getCollaborationStatePath, getConfigPath, getContextPackStoragePaths, getLocalCodeOverlayCachePath, getLocalCodePromotionStatePath, getLocalSourceSnapshotPath, getOrchestratorRecommendation, getPlanStepDisplayTitle, getStagedFiles, getStuckGuardInjection, getTeamSyncStatePath, ingestReferences, installAutomationBundle, leadPlanCommand, listProjectsForApiKey, loadAutomationManifest, loadCollaborationState, loadConfig, loadTeamSyncState, memoryAuditCommand, memoryCleanCandidatesCommand, memoryCompactCommand, memoryHealthCommand, memoryLocalCommand, memoryReviewsCommand, normalizeCollaborationFiles, normalizeGuardTag, normalizeWorkflowPlanInput, outcomeCapturePreviewCommand, packContext, parseCollaborationResources, projectIntelligenceBriefCommand, projectIntelligenceRunCommand, readActivityTimeline, readLocalCodeOverlayCache, readLocalCodePromotionState, readLocalSourceSnapshot, readLocalWorkersConfig, readSessionSnapshot, realityCheckCommand, referencesIngestCommand, referencesScanCommand, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveLocalWorkerRoutingDefaults, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, workersLocalAddCommand, workersLocalListCommand, workersLocalProbePrintCommand, workersLocalRemoveCommand, workersLocalStatusCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff, writeProducerLoopArtifact, writeSessionSnapshot };
|
|
4261
|
+
export { AUTOMATION_MANIFEST_RELATIVE_PATH, AutomationInstallConflictError, AutomationUnsupportedHookBundleError, CODING_INTELLIGENCE_LEDGER_VERSION, COLLABORATION_STATE_RELATIVE_PATH, ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES, ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES, ENGINEERING_LEAD_POSTURES, ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES, ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES, ENGINEERING_LEAD_ROUTING_MODES, ENGINEERING_LEAD_STATUSES, ENGINEERING_LEAD_SUPERVISION_STATUSES, ENGINEERING_LEAD_WORKER_ROLES, ENGINEERING_LEAD_WORK_PACKAGE_STATUSES, ORCHESTRATOR_HANDOFF_RELATIVE_PATH, PRODUCER_LOOP_ARTIFACT_VERSION, PRODUCER_LOOP_RELATIVE_DIR, PRODUCER_LOOP_REPORT_VERSION, TEAM_SYNC_STATE_RELATIVE_PATH, WHY_OUTCOME_CAPTURE_VERSION, WORKFLOW_PLANS_RELATIVE_DIR, WORKFLOW_STATE_RELATIVE_PATH, addLocalWorker, agentReadinessAuditCommand, appendActivityEvent, archiveInactiveTeamSyncWork, attachLocalContextPackReceipts, autoArchiveTeamSyncState, buildAdaptiveWorkRoutingRecommendation, buildAgentReadinessAuditReport, buildAgenticHandoffMarkdown, buildAgenticTimeline, buildAgenticWorkStatus, buildAutomationInstallPlan, buildCanonicalEvent, buildCodeHooksInstallPlan, buildCodePromotionResult, buildCodeStatusResult, buildCodeSyncResult, buildCodingIntelligenceLedger, buildCollaborationActor, buildCollaborationGuardActionCards, buildCollaborationHooksInstallPlan, buildCompanionEngineeringLeadPlanReport, buildContextPackStats, buildEvalCaseArtifact, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalProjectRealityCheck, buildLocalShortestPathResult, buildLocalSourceSnapshot, buildLocalSourceStatus, buildLocalSourceSyncResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildProducerLoopReport, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapQuality, buildSessionSnapshot, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWhyOutcomeCaptureReport, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, codingLedgerExportCommand, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, compareLocalSourceSnapshots, completeTeamSyncStateFromEvidence, completeTeamSyncWorkFromEvidence, contextPackCleanCommand, contextPackPackCommand, contextPackRetrieveCommand, contextPackStatsCommand, createClient, createEmptyCollaborationState, createEmptyTeamSyncState, createLocalQueryCache, deriveLocalCollaborationResourcesFromFiles, detectReleaseSurfacesFromFiles, detectRuntimeEnvironment, evalExportCommand, evalRunCommand, evaluateProjectPolicyGates, extractCommandFromToolInput, extractFilesFromToolInput, formatAgentReadinessAuditReport, formatCompanionEngineeringLeadPlanReport, formatOrchestratorRecommendationReason, formatPolicyGateDecision, formatProjectJudgmentCard, formatStuckGuardDecision, getAutomationManifestPath, getAutomationStatus, getCollaborationStatePath, getConfigPath, getContextPackStoragePaths, getLocalCodeOverlayCachePath, getLocalCodePromotionStatePath, getLocalSourceSnapshotPath, getOrchestratorRecommendation, getPlanStepDisplayTitle, getStagedFiles, getStuckGuardInjection, getTeamSyncStatePath, ingestReferences, installAutomationBundle, leadPlanCommand, listProjectsForApiKey, loadAutomationManifest, loadCollaborationState, loadConfig, loadTeamSyncState, memoryAuditCommand, memoryCleanCandidatesCommand, memoryCompactCommand, memoryHealthCommand, memoryLocalCommand, memoryReviewsCommand, normalizeCollaborationFiles, normalizeGuardTag, normalizeWorkflowPlanInput, outcomeCapturePreviewCommand, packContext, parseCollaborationResources, projectIntelligenceBriefCommand, projectIntelligenceRunCommand, readActivityTimeline, readLocalCodeOverlayCache, readLocalCodePromotionState, readLocalSourceSnapshot, readLocalWorkersConfig, readSessionSnapshot, realityCheckCommand, referencesIngestCommand, referencesScanCommand, resolveAutoWorkflowMode, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveLocalWorkerRoutingDefaults, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, workersLocalAddCommand, workersLocalListCommand, workersLocalProbePrintCommand, workersLocalRemoveCommand, workersLocalStatusCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff, writeProducerLoopArtifact, writeSessionSnapshot };
|
package/dist/index.js
CHANGED
|
@@ -192,6 +192,7 @@ __export(index_exports, {
|
|
|
192
192
|
realityCheckCommand: () => realityCheckCommand,
|
|
193
193
|
referencesIngestCommand: () => referencesIngestCommand,
|
|
194
194
|
referencesScanCommand: () => referencesScanCommand,
|
|
195
|
+
resolveAutoWorkflowMode: () => resolveAutoWorkflowMode,
|
|
195
196
|
resolveContextPackRecord: () => resolveContextPackRecord,
|
|
196
197
|
resolveFullWorkflowTokenBudget: () => resolveFullWorkflowTokenBudget,
|
|
197
198
|
resolveLocalWorkerRoutingDefaults: () => resolveLocalWorkerRoutingDefaults,
|
|
@@ -8361,6 +8362,9 @@ function printMemoryGuardResult(result) {
|
|
|
8361
8362
|
}
|
|
8362
8363
|
}
|
|
8363
8364
|
}
|
|
8365
|
+
function shouldPrintCompactMemoryGuardSuccess(result, options) {
|
|
8366
|
+
return !options.verbose && result.triggered && !result.shouldBlock && !result.requiresConfirmation && result.contradictions.length === 0 && result.recentFailures.length === 0 && result.warnings.length === 0;
|
|
8367
|
+
}
|
|
8364
8368
|
async function runMemoryGuardCheck(options = {}) {
|
|
8365
8369
|
const cwd = process.env.SNIPARA_WORKSPACE_DIR || process.cwd();
|
|
8366
8370
|
const root = findWorkspaceRoot(cwd, true) || cwd;
|
|
@@ -8572,6 +8576,8 @@ async function memoryGuardCheckCommand(options) {
|
|
|
8572
8576
|
const result = await runMemoryGuardCheck(options);
|
|
8573
8577
|
if (options.json) {
|
|
8574
8578
|
console.log(JSON.stringify(result, null, 2));
|
|
8579
|
+
} else if (shouldPrintCompactMemoryGuardSuccess(result, options)) {
|
|
8580
|
+
console.log(`Snipara Memory Guard: checked (${result.trigger})`);
|
|
8575
8581
|
} else if (result.triggered || options.trigger === "manual") {
|
|
8576
8582
|
printMemoryGuardResult(result);
|
|
8577
8583
|
}
|
|
@@ -18868,11 +18874,30 @@ function shellQuote2(value) {
|
|
|
18868
18874
|
function phaseQuery(state, phase) {
|
|
18869
18875
|
return phase.query || `${state.goal}: ${phase.title}`;
|
|
18870
18876
|
}
|
|
18871
|
-
function
|
|
18872
|
-
|
|
18877
|
+
function resolveAutoWorkflowMode(query) {
|
|
18878
|
+
const normalized = query.toLowerCase();
|
|
18879
|
+
if (/\b(orchestrate|swarm|htask|handoff|multi-agent|multi agent|worker|proof gate|proof-gate|drift check|release gate|production gate)\b/.test(
|
|
18880
|
+
normalized
|
|
18881
|
+
)) {
|
|
18882
|
+
return "orchestrate";
|
|
18883
|
+
}
|
|
18884
|
+
if (/\b(deploy|deployment|release|merge|push|migration|schema|auth|billing|security|architecture|architectural|multi-phase|multiphase|phase commit|final commit|managed workflow|roadmap|plan)\b/.test(
|
|
18885
|
+
normalized
|
|
18886
|
+
)) {
|
|
18887
|
+
return "full";
|
|
18888
|
+
}
|
|
18889
|
+
if (/\b(status|show|list|read|lookup|recall|brief|summarize|summary|what changed|question|docs?|documentation)\b/.test(
|
|
18890
|
+
normalized
|
|
18891
|
+
) && !/\b(implement|change|fix|ship|code|refactor|test|write|create|build)\b/.test(normalized)) {
|
|
18892
|
+
return "lite";
|
|
18893
|
+
}
|
|
18894
|
+
return "standard";
|
|
18895
|
+
}
|
|
18896
|
+
function effectiveWorkflowMode(mode, query = "") {
|
|
18897
|
+
return mode === "auto" ? resolveAutoWorkflowMode(query) : mode;
|
|
18873
18898
|
}
|
|
18874
|
-
function shouldFollowWorkflowRecommendations(mode) {
|
|
18875
|
-
const effectiveMode = effectiveWorkflowMode(mode);
|
|
18899
|
+
function shouldFollowWorkflowRecommendations(mode, query = "") {
|
|
18900
|
+
const effectiveMode = effectiveWorkflowMode(mode, query);
|
|
18876
18901
|
return effectiveMode === "standard" || effectiveMode === "full";
|
|
18877
18902
|
}
|
|
18878
18903
|
function printManagedWorkflowState(state) {
|
|
@@ -18917,7 +18942,7 @@ function printManagedWorkflowDiscipline() {
|
|
|
18917
18942
|
"- LITE: small single-phase edits still start with Snipara recall/context and end with local verification."
|
|
18918
18943
|
);
|
|
18919
18944
|
console.log(
|
|
18920
|
-
"- STANDARD: normal coding work uses context plus recommended code-graph follow-up; --mode auto
|
|
18945
|
+
"- STANDARD: normal coding work uses context plus recommended code-graph follow-up; --mode auto deterministically selects lite/standard/full/orchestrate from task intent."
|
|
18921
18946
|
);
|
|
18922
18947
|
console.log(
|
|
18923
18948
|
"- FULL: use this managed workflow with phases/chunks for multi-file, risky, release/deploy, architectural, or compaction-prone coding work."
|
|
@@ -22043,7 +22068,8 @@ async function workflowRunCommand(options) {
|
|
|
22043
22068
|
routingOptions,
|
|
22044
22069
|
adaptiveRoutingWithCatalog
|
|
22045
22070
|
) ? enrichAdaptiveRoutingWithLocalOrchestrator(adaptiveRoutingWithCatalog, routingOptions) : adaptiveRoutingWithCatalog;
|
|
22046
|
-
const
|
|
22071
|
+
const effectiveMode = effectiveWorkflowMode(options.mode, options.query);
|
|
22072
|
+
const orchestratorRecommendation = getOrchestratorRecommendation(options.query, effectiveMode, {
|
|
22047
22073
|
policyAutoRoute: options.autoRouteOrchestrator,
|
|
22048
22074
|
policySource: options.orchestratorPolicySource,
|
|
22049
22075
|
adaptiveRoutingDryRun: Boolean(adaptiveRouting)
|
|
@@ -22055,13 +22081,13 @@ async function workflowRunCommand(options) {
|
|
|
22055
22081
|
query: options.query,
|
|
22056
22082
|
summary: options.query,
|
|
22057
22083
|
title: options.query,
|
|
22058
|
-
mode:
|
|
22084
|
+
mode: effectiveMode,
|
|
22059
22085
|
adaptiveRouting
|
|
22060
22086
|
}) : null;
|
|
22061
22087
|
if (!hostedConfigured) {
|
|
22062
22088
|
const payload2 = {
|
|
22063
22089
|
mode: options.mode,
|
|
22064
|
-
effective_mode:
|
|
22090
|
+
effective_mode: effectiveMode,
|
|
22065
22091
|
local_only: true,
|
|
22066
22092
|
local_policy_path: localAdaptiveRoutingPolicy ? ADAPTIVE_ROUTING_POLICY_RELATIVE_PATH2 : null,
|
|
22067
22093
|
orchestrator_recommendation: orchestratorRecommendation,
|
|
@@ -22091,7 +22117,7 @@ async function workflowRunCommand(options) {
|
|
|
22091
22117
|
if (!client) {
|
|
22092
22118
|
throw new Error("Hosted Snipara client unavailable after configuration check.");
|
|
22093
22119
|
}
|
|
22094
|
-
if (
|
|
22120
|
+
if (effectiveMode === "orchestrate") {
|
|
22095
22121
|
const result = await client.orchestrate(options.query, options.maxTokens);
|
|
22096
22122
|
if (options.json) {
|
|
22097
22123
|
printJson2({
|
|
@@ -22106,8 +22132,8 @@ async function workflowRunCommand(options) {
|
|
|
22106
22132
|
}
|
|
22107
22133
|
printOrchestrateResult(result);
|
|
22108
22134
|
if (options.runtimeHint !== false) {
|
|
22109
|
-
printRuntimeHint(options.query,
|
|
22110
|
-
printOrchestratorHandoffHint(options.query,
|
|
22135
|
+
printRuntimeHint(options.query, effectiveMode);
|
|
22136
|
+
printOrchestratorHandoffHint(options.query, effectiveMode, orchestratorRecommendation);
|
|
22111
22137
|
}
|
|
22112
22138
|
if (adaptiveRouting) {
|
|
22113
22139
|
printAdaptiveRoutingRecommendation(adaptiveRouting);
|
|
@@ -22117,8 +22143,7 @@ async function workflowRunCommand(options) {
|
|
|
22117
22143
|
}
|
|
22118
22144
|
return;
|
|
22119
22145
|
}
|
|
22120
|
-
const
|
|
22121
|
-
const shouldRequestSharedContext = shouldFollowWorkflowRecommendations(options.mode) && hasSharedContextIntent(options.query);
|
|
22146
|
+
const shouldRequestSharedContext = shouldFollowWorkflowRecommendations(options.mode, options.query) && hasSharedContextIntent(options.query);
|
|
22122
22147
|
const workflowBudget = effectiveMode === "full" ? resolveFullWorkflowTokenBudget({
|
|
22123
22148
|
maxTokens: options.maxTokens,
|
|
22124
22149
|
includeSessionContext: options.includeSessionContext,
|
|
@@ -22162,7 +22187,7 @@ async function workflowRunCommand(options) {
|
|
|
22162
22187
|
includeContent: true
|
|
22163
22188
|
});
|
|
22164
22189
|
}
|
|
22165
|
-
if (context.recommended_tool && shouldFollowWorkflowRecommendations(options.mode)) {
|
|
22190
|
+
if (context.recommended_tool && shouldFollowWorkflowRecommendations(options.mode, options.query)) {
|
|
22166
22191
|
payload.executed_recommended_tool = await runRecommendedTool(context);
|
|
22167
22192
|
}
|
|
22168
22193
|
if (effectiveMode === "full") {
|
|
@@ -22256,8 +22281,8 @@ async function workflowRunCommand(options) {
|
|
|
22256
22281
|
printManagedWorkflowStarted(payload.managed_workflow);
|
|
22257
22282
|
}
|
|
22258
22283
|
if (options.runtimeHint !== false) {
|
|
22259
|
-
printRuntimeHint(options.query,
|
|
22260
|
-
printOrchestratorHandoffHint(options.query,
|
|
22284
|
+
printRuntimeHint(options.query, effectiveMode);
|
|
22285
|
+
printOrchestratorHandoffHint(options.query, effectiveMode, orchestratorRecommendation);
|
|
22261
22286
|
}
|
|
22262
22287
|
if (adaptiveRouting) {
|
|
22263
22288
|
printAdaptiveRoutingRecommendation(adaptiveRouting);
|
|
@@ -30045,7 +30070,8 @@ async function collaborationStartCommand(options) {
|
|
|
30045
30070
|
state,
|
|
30046
30071
|
hosted
|
|
30047
30072
|
},
|
|
30048
|
-
options.json
|
|
30073
|
+
options.json,
|
|
30074
|
+
options.verbose
|
|
30049
30075
|
);
|
|
30050
30076
|
}
|
|
30051
30077
|
async function collaborationClaimCommand(options) {
|
|
@@ -30087,7 +30113,8 @@ async function collaborationClaimCommand(options) {
|
|
|
30087
30113
|
state,
|
|
30088
30114
|
hosted
|
|
30089
30115
|
},
|
|
30090
|
-
options.json
|
|
30116
|
+
options.json,
|
|
30117
|
+
options.verbose
|
|
30091
30118
|
);
|
|
30092
30119
|
}
|
|
30093
30120
|
async function collaborationGuardCommand(options) {
|
|
@@ -30145,7 +30172,8 @@ async function collaborationGuardCommand(options) {
|
|
|
30145
30172
|
failed: guardFailed
|
|
30146
30173
|
}
|
|
30147
30174
|
},
|
|
30148
|
-
options.json
|
|
30175
|
+
options.json,
|
|
30176
|
+
options.verbose
|
|
30149
30177
|
);
|
|
30150
30178
|
}
|
|
30151
30179
|
function buildCollaborationHooksInstallPlan(options = {}) {
|
|
@@ -30960,7 +30988,7 @@ function resolveReleaseLeaseIds(state, options) {
|
|
|
30960
30988
|
}
|
|
30961
30989
|
throw new Error("No collaboration lease id provided and no active local lease was found");
|
|
30962
30990
|
}
|
|
30963
|
-
function printCollaborationResult(payload, json) {
|
|
30991
|
+
function printCollaborationResult(payload, json, verbose) {
|
|
30964
30992
|
if (json) {
|
|
30965
30993
|
console.log(JSON.stringify(payload, null, 2));
|
|
30966
30994
|
return;
|
|
@@ -30968,6 +30996,10 @@ function printCollaborationResult(payload, json) {
|
|
|
30968
30996
|
const action = String(payload.action ?? "status");
|
|
30969
30997
|
const state = payload.state;
|
|
30970
30998
|
const hosted = payload.hosted;
|
|
30999
|
+
if (!verbose && action === "guard" && isQuietCollaborationGuardSuccess(payload, hosted)) {
|
|
31000
|
+
console.log("Collaboration guard: go");
|
|
31001
|
+
return;
|
|
31002
|
+
}
|
|
30971
31003
|
console.log(getCollaborationHeading(action));
|
|
30972
31004
|
console.log(`State: ${payload.statePath}`);
|
|
30973
31005
|
console.log(`Work session: ${state.workSessionId ?? "none"}`);
|
|
@@ -30995,6 +31027,17 @@ function printCollaborationResult(payload, json) {
|
|
|
30995
31027
|
printGuardActionCards(payload.actionCards);
|
|
30996
31028
|
}
|
|
30997
31029
|
}
|
|
31030
|
+
function isQuietCollaborationGuardSuccess(payload, hosted) {
|
|
31031
|
+
const guard = hosted?.status === "ok" ? hosted.data : void 0;
|
|
31032
|
+
if (!guard || guard.evaluation.decision !== "CLEAR") {
|
|
31033
|
+
return false;
|
|
31034
|
+
}
|
|
31035
|
+
if (guard.evaluation.conflicts.length > 0 || guard.evaluation.recommendedActions.length > 0) {
|
|
31036
|
+
return false;
|
|
31037
|
+
}
|
|
31038
|
+
const actionCards = payload.actionCards;
|
|
31039
|
+
return !actionCards || actionCards.length === 0;
|
|
31040
|
+
}
|
|
30998
31041
|
function printHostedCollaboration(action, data) {
|
|
30999
31042
|
if (!data) {
|
|
31000
31043
|
return;
|
|
@@ -32060,7 +32103,7 @@ program.command("memory-guard").description(
|
|
|
32060
32103
|
new import_commander.Command("check").description("Check whether memory/context guidance is required before continuing").option("--trigger <trigger>", "failure|pre-commit|commit|pre-final|manual", "manual").option("--file <file>", "Touched file").option("--files <files...>", "Touched files").option("--staged", "Use git staged files").option("--command <command>", "Command or action that failed").option("--intent <intent>", "Proposed user intent or action to check before mutating").option("--result <result>", "Command result preview").option("--exit-code <code>", "Command exit code").option("--status <status>", "Command status").option("--destructive", "Treat the proposed action as destructive or irreversible").option("--require-confirmation", "Require explicit user confirmation before continuing").option(
|
|
32061
32104
|
"--confirmed-by-user <confirmation>",
|
|
32062
32105
|
"Explicit user confirmation text that permits a strict destructive/contradictory override"
|
|
32063
|
-
).option("--strict", "Exit non-zero if guidance is required but unavailable").option("--category <categories...>", "Additional memory categories to recall").option("--no-context", "Skip source context query").option("--no-recent-failures", "Skip recent Companion event failure inspection").option("--json", "Print raw JSON").action(async (options) => {
|
|
32106
|
+
).option("--strict", "Exit non-zero if guidance is required but unavailable").option("--category <categories...>", "Additional memory categories to recall").option("--no-context", "Skip source context query").option("--no-recent-failures", "Skip recent Companion event failure inspection").option("--json", "Print raw JSON").option("--verbose", "Print full non-blocking guard details instead of one-line success").action(async (options) => {
|
|
32064
32107
|
await memoryGuardCheckCommand({
|
|
32065
32108
|
trigger: options.trigger,
|
|
32066
32109
|
files: [
|
|
@@ -32080,7 +32123,8 @@ program.command("memory-guard").description(
|
|
|
32080
32123
|
categories: options.category,
|
|
32081
32124
|
includeContext: options.context,
|
|
32082
32125
|
recentFailures: options.recentFailures,
|
|
32083
|
-
json: options.json
|
|
32126
|
+
json: options.json,
|
|
32127
|
+
verbose: options.verbose
|
|
32084
32128
|
});
|
|
32085
32129
|
})
|
|
32086
32130
|
).addCommand(
|
|
@@ -32988,7 +33032,7 @@ collaboration.command("guard").description("Check files or resources against act
|
|
|
32988
33032
|
).option("-a, --action <action>", "Guarded action label", "edit").option("--actor <actor>", "Developer or agent display name").option("--actor-id <actorId>", "Stable developer or agent id").option("--actor-type <actorType>", "HUMAN|AGENT|SYSTEM", "AGENT").option("--session-id <sessionId>", "Automation/session id").option("--work-session-id <workSessionId>", "Existing hosted work session id").option("--client <client>", "Client label", "snipara-companion").option("--repository <repository>", "Repository id").option("-b, --branch <branch>", "Current branch name").option("--worktree <worktree>", "Worktree path").option("--max-files <number>", "Maximum files for local code resource expansion", "2000").option("--no-persist", "Evaluate without storing a guard event").option("--enforce", "Exit non-zero for REVIEW_REQUIRED or REQUIRES_ACK, not only BLOCKED").option(
|
|
32989
33033
|
"--ack-review-only",
|
|
32990
33034
|
"Under --enforce, acknowledge review-only stale-state and decision-consistency warnings"
|
|
32991
|
-
).option("-d, --dir <directory>", "Repository directory (default: current)").option("--json", "Print raw JSON").action(async (options) => {
|
|
33035
|
+
).option("-d, --dir <directory>", "Repository directory (default: current)").option("--json", "Print raw JSON").option("--verbose", "Print the full guard report even when the guard passes").action(async (options) => {
|
|
32992
33036
|
await collaborationGuardCommand({
|
|
32993
33037
|
files: options.files,
|
|
32994
33038
|
resources: options.resource,
|
|
@@ -33008,7 +33052,8 @@ collaboration.command("guard").description("Check files or resources against act
|
|
|
33008
33052
|
enforce: Boolean(options.enforce),
|
|
33009
33053
|
ackReviewOnly: Boolean(options.ackReviewOnly),
|
|
33010
33054
|
dir: options.dir,
|
|
33011
|
-
json: options.json
|
|
33055
|
+
json: options.json,
|
|
33056
|
+
verbose: Boolean(options.verbose || process.argv.includes("--verbose"))
|
|
33012
33057
|
});
|
|
33013
33058
|
});
|
|
33014
33059
|
collaboration.command("hooks").description("Install blocking Git hooks that run the hosted collaboration guard").addCommand(
|
|
@@ -33766,6 +33811,7 @@ if (require.main === module) {
|
|
|
33766
33811
|
realityCheckCommand,
|
|
33767
33812
|
referencesIngestCommand,
|
|
33768
33813
|
referencesScanCommand,
|
|
33814
|
+
resolveAutoWorkflowMode,
|
|
33769
33815
|
resolveContextPackRecord,
|
|
33770
33816
|
resolveFullWorkflowTokenBudget,
|
|
33771
33817
|
resolveLocalWorkerRoutingDefaults,
|