snipara-companion 3.2.20 → 3.2.22
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 +7 -1
- package/dist/index.js +32 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2889,6 +2889,12 @@ interface HostedGuardPayload {
|
|
|
2889
2889
|
}
|
|
2890
2890
|
declare function buildHostedGuardPayload(files: string[], resources: CollaborationResource[]): HostedGuardPayload;
|
|
2891
2891
|
declare function compactHostedGuardResources(resources: CollaborationResource[]): CollaborationResource[];
|
|
2892
|
+
declare function shouldFailCollaborationGuard(input: {
|
|
2893
|
+
hostedStatus: HostedAttempt$1<unknown>["status"];
|
|
2894
|
+
evaluation: CollaborationGuardEvaluation | undefined;
|
|
2895
|
+
enforce: boolean;
|
|
2896
|
+
ackReviewOnly: boolean;
|
|
2897
|
+
}): boolean;
|
|
2892
2898
|
|
|
2893
2899
|
type RuntimeEnvironment = Record<string, string | undefined>;
|
|
2894
2900
|
type ProviderKeySource = "environment" | "env-file";
|
|
@@ -4415,4 +4421,4 @@ declare function installAutomationBundle(args: {
|
|
|
4415
4421
|
}): Promise<AutomationInstallResult>;
|
|
4416
4422
|
declare function getAutomationStatus(projectDir?: string): AutomationStatusResult;
|
|
4417
4423
|
|
|
4418
|
-
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, POLICY_LEDGER_SYNC_REPORT_VERSION, 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, buildPolicyLedgerSyncReport, buildProducerLoopReport, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapBrief, buildSessionBootstrapQuality, buildSessionSnapshot, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWhyOutcomeCaptureReport, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, codingLedgerExportCommand, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectPolicyLedgerSyncArtifacts, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, compareLocalSourceSnapshots, completeTeamSyncStateFromEvidence, completeTeamSyncWorkFromEvidence, contextPackCleanCommand, contextPackPackCommand, contextPackRetrieveCommand, contextPackStatsCommand, controlledWorkerExecuteCommand, 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, workflowSyncPolicyLedgerCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff, writeProducerLoopArtifact, writeSessionSnapshot };
|
|
4424
|
+
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, POLICY_LEDGER_SYNC_REPORT_VERSION, 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, buildPolicyLedgerSyncReport, buildProducerLoopReport, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapBrief, buildSessionBootstrapQuality, buildSessionSnapshot, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWhyOutcomeCaptureReport, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, codingLedgerExportCommand, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectPolicyLedgerSyncArtifacts, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, compareLocalSourceSnapshots, completeTeamSyncStateFromEvidence, completeTeamSyncWorkFromEvidence, contextPackCleanCommand, contextPackPackCommand, contextPackRetrieveCommand, contextPackStatsCommand, controlledWorkerExecuteCommand, 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, shouldFailCollaborationGuard, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, workersLocalAddCommand, workersLocalListCommand, workersLocalProbePrintCommand, workersLocalRemoveCommand, workersLocalStatusCommand, workflowSyncPolicyLedgerCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff, writeProducerLoopArtifact, writeSessionSnapshot };
|
package/dist/index.js
CHANGED
|
@@ -208,6 +208,7 @@ __export(index_exports, {
|
|
|
208
208
|
saveConfig: () => saveConfig,
|
|
209
209
|
saveTeamSyncState: () => saveTeamSyncState,
|
|
210
210
|
scanReferences: () => scanReferences,
|
|
211
|
+
shouldFailCollaborationGuard: () => shouldFailCollaborationGuard,
|
|
211
212
|
shouldSuggestOrchestratorForWorkflow: () => shouldSuggestOrchestratorForWorkflow,
|
|
212
213
|
shouldSuggestRuntimeForWorkflow: () => shouldSuggestRuntimeForWorkflow,
|
|
213
214
|
summarizeLocalCodeOverlay: () => summarizeLocalCodeOverlay,
|
|
@@ -13088,7 +13089,9 @@ function printDoctorReport(report, companionVersion, auth, toolCatalog) {
|
|
|
13088
13089
|
} else {
|
|
13089
13090
|
console.log("- Existing project: npx create-snipara repair --with-runtime.");
|
|
13090
13091
|
console.log("- Fresh setup: npx create-snipara --profile full-stack --advanced.");
|
|
13091
|
-
console.log(
|
|
13092
|
+
console.log(
|
|
13093
|
+
'- Manual install: python -m pip install "snipara-sandbox[all]" (`[all]` is the pip extra, not a separate argument).'
|
|
13094
|
+
);
|
|
13092
13095
|
}
|
|
13093
13096
|
console.log("");
|
|
13094
13097
|
console.log(import_chalk4.default.bold("Snipara Orchestrator guidance"));
|
|
@@ -15236,7 +15239,12 @@ async function collaborationGuardCommand(options) {
|
|
|
15236
15239
|
ackReviewOnly: Boolean(options.ackReviewOnly),
|
|
15237
15240
|
reviewOnlyAcknowledged
|
|
15238
15241
|
});
|
|
15239
|
-
const guardFailed =
|
|
15242
|
+
const guardFailed = shouldFailCollaborationGuard({
|
|
15243
|
+
hostedStatus: hosted.status,
|
|
15244
|
+
evaluation,
|
|
15245
|
+
enforce: Boolean(options.enforce),
|
|
15246
|
+
ackReviewOnly: Boolean(options.ackReviewOnly)
|
|
15247
|
+
});
|
|
15240
15248
|
if (guardFailed) {
|
|
15241
15249
|
process.exitCode = 2;
|
|
15242
15250
|
}
|
|
@@ -15982,12 +15990,19 @@ function buildCollaborationGitHookBlock(hookName) {
|
|
|
15982
15990
|
"# Atomically claim checkout git writes, then block unsafe parallel edits.",
|
|
15983
15991
|
'if [ "${SNIPARA_COLLABORATION_GUARD:-1}" = "0" ]; then',
|
|
15984
15992
|
' echo "Snipara collaboration guard bypassed by SNIPARA_COLLABORATION_GUARD=0" >&2',
|
|
15985
|
-
"elif command -v snipara-companion >/dev/null 2>&1; then",
|
|
15986
|
-
` snipara-companion collaboration claim --resource SURFACE:checkout-git-write --mode EXCLUSIVE --ttl-seconds 300 --reason "${profile} git write" --json >/dev/null`,
|
|
15987
|
-
` snipara-companion collaboration guard --profile ${profile} --action ${profile} --resource SURFACE:checkout-git-write --enforce --json >/dev/null`,
|
|
15988
15993
|
"else",
|
|
15989
|
-
|
|
15990
|
-
"
|
|
15994
|
+
" snipara_companion_hook() {",
|
|
15995
|
+
' if [ -f "packages/cli/src/index.ts" ] && command -v pnpm >/dev/null 2>&1; then',
|
|
15996
|
+
' pnpm --filter snipara-companion exec tsx src/index.ts "$@"',
|
|
15997
|
+
" elif command -v snipara-companion >/dev/null 2>&1; then",
|
|
15998
|
+
' snipara-companion "$@"',
|
|
15999
|
+
" else",
|
|
16000
|
+
' echo "snipara-companion is required for the Snipara collaboration guard. Install it or set SNIPARA_COLLABORATION_GUARD=0 for an explicit emergency bypass." >&2',
|
|
16001
|
+
" return 127",
|
|
16002
|
+
" fi",
|
|
16003
|
+
" }",
|
|
16004
|
+
` snipara_companion_hook collaboration claim --resource SURFACE:checkout-git-write --mode EXCLUSIVE --ttl-seconds 300 --reason "${profile} git write" --json >/dev/null || true`,
|
|
16005
|
+
` snipara_companion_hook collaboration guard --profile ${profile} --action ${profile} --resource SURFACE:checkout-git-write --enforce --json >/dev/null`,
|
|
15991
16006
|
"fi",
|
|
15992
16007
|
collaborationHookBlockMarker(hookName, "end")
|
|
15993
16008
|
].join("\n");
|
|
@@ -16371,6 +16386,12 @@ function ensureFilesOrResources(files, resources, command) {
|
|
|
16371
16386
|
throw new Error(`collaboration ${command} requires --files, --resource, or dirty git files`);
|
|
16372
16387
|
}
|
|
16373
16388
|
}
|
|
16389
|
+
function shouldFailCollaborationGuard(input) {
|
|
16390
|
+
if (input.hostedStatus !== "ok") {
|
|
16391
|
+
return false;
|
|
16392
|
+
}
|
|
16393
|
+
return shouldFailGuard(input.evaluation, input.enforce, input.ackReviewOnly);
|
|
16394
|
+
}
|
|
16374
16395
|
function shouldFailGuard(evaluation, enforce, ackReviewOnly) {
|
|
16375
16396
|
if (!evaluation) {
|
|
16376
16397
|
return true;
|
|
@@ -23172,7 +23193,9 @@ function printRuntimeHint(query, mode) {
|
|
|
23172
23193
|
console.log("Need sandboxed execution or autonomous Sandbox jobs?");
|
|
23173
23194
|
console.log("Existing project: npx create-snipara repair --with-runtime");
|
|
23174
23195
|
console.log("Fresh setup: npx create-snipara --profile full-stack --advanced");
|
|
23175
|
-
console.log(
|
|
23196
|
+
console.log(
|
|
23197
|
+
'Manual install: python -m pip install "snipara-sandbox[all]" (`[all]` is the pip extra, not a separate argument).'
|
|
23198
|
+
);
|
|
23176
23199
|
}
|
|
23177
23200
|
function printLiteWorkflowRun(query, requestedMode) {
|
|
23178
23201
|
console.log(import_chalk6.default.bold("Workflow Lite"));
|
|
@@ -36568,6 +36591,7 @@ if (require.main === module) {
|
|
|
36568
36591
|
saveConfig,
|
|
36569
36592
|
saveTeamSyncState,
|
|
36570
36593
|
scanReferences,
|
|
36594
|
+
shouldFailCollaborationGuard,
|
|
36571
36595
|
shouldSuggestOrchestratorForWorkflow,
|
|
36572
36596
|
shouldSuggestRuntimeForWorkflow,
|
|
36573
36597
|
summarizeLocalCodeOverlay,
|