snipara-companion 3.2.2 → 3.2.4

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/README.md CHANGED
@@ -56,6 +56,51 @@ These commands are useful without hosted Snipara:
56
56
  | `intelligence ledger-export` | Structured redacted ledger JSON for replay and review |
57
57
  | `stuck-guard`, `memory-guard`, `pre-tool`, `post-tool` | Fail-soft local guards and hook helpers |
58
58
 
59
+ ### Local Worker Registry
60
+
61
+ Use `workers local` when you want Companion to route bounded work to a local
62
+ OpenAI-compatible runtime such as LM Studio. The registry is project state under
63
+ `.snipara/workers/`; commit intentional profile changes like any other
64
+ workflow artifact. Keep API keys, tokens, passwords, and private credentialed
65
+ URLs out of worker profiles. Use environment variables for credentials.
66
+
67
+ Probe the local runtime first:
68
+
69
+ ```bash
70
+ npx -y snipara-companion workers local probe \
71
+ --base-url http://127.0.0.1:1234 \
72
+ --model openai/gpt-oss-20b \
73
+ --role documentation \
74
+ --capability docs_write \
75
+ --write-scope packages/cli/README.md
76
+ ```
77
+
78
+ Declare the worker only after the probe matches the intended model and scope:
79
+
80
+ ```bash
81
+ npx -y snipara-companion workers local add \
82
+ --id local-openai-gpt-oss-20b \
83
+ --base-url http://127.0.0.1:1234 \
84
+ --model openai/gpt-oss-20b \
85
+ --role documentation \
86
+ --capability docs_write \
87
+ --write-scope packages/cli/README.md
88
+ ```
89
+
90
+ Inspect declared workers before routing:
91
+
92
+ ```bash
93
+ npx -y snipara-companion workers local list
94
+ npx -y snipara-companion workers local status --json
95
+ ```
96
+
97
+ Remove stale local profiles when a model, endpoint, or write scope is no longer
98
+ valid:
99
+
100
+ ```bash
101
+ npx -y snipara-companion workers local remove local-openai-gpt-oss-20b
102
+ ```
103
+
59
104
  ## Agent Continuity
60
105
 
61
106
  After the first impact check, keep the work resumable:
@@ -71,6 +116,7 @@ npx -y snipara-companion workflow producer-triage
71
116
  npx -y snipara-companion workflow decisions
72
117
  npx -y snipara-companion workflow decide decision-abc123 --choose accept_all --reviewer alice
73
118
  npx -y snipara-companion workflow timeline
119
+ npx -y snipara-companion workflow timeline --export md
74
120
  npx -y snipara-companion workflow session --json
75
121
  npx -y snipara-companion workflow producer-report
76
122
  npx -y snipara-companion workflow producer-review --latest --outcome useful --reviewer alice
@@ -84,8 +130,14 @@ verification hints.
84
130
  `workflow timeline` reads the append-only activity log at
85
131
  `.snipara/activity/timeline.jsonl`. `workflow session` derives
86
132
  `.snipara/activity/session.json` for fast local resume and Orchestrator dogfood;
87
- Session Snapshot V0 is observational and keeps `hardRoutingAllowed=false` until
88
- explicit routing policy and receipts exist.
133
+ Session Snapshot V0 includes latest activity, risk reasons, touched files, a
134
+ next action, and advisory Intent Detection V0. Intent Detection V0 reports the
135
+ inferred intent, confidence, reason-code signals, local evidence counts, and a
136
+ suggested workflow mode hint for the human or agent to consider. It is
137
+ observational and keeps `hardRoutingAllowed=false` until explicit routing policy
138
+ and receipts exist.
139
+ `workflow timeline --export md` prints a compact redacted Markdown timeline for
140
+ handoff or publication.
89
141
 
90
142
  Workflow `phase-commit` and `final-commit` also emit Producer Loop artifacts
91
143
  under `.snipara/producer-loop/`. These are local review evidence backed by the
@@ -116,7 +168,9 @@ Other producers such as `outcome-capture preview --emit-decisions`,
116
168
  paths declared; they do not write canonical memory directly. `memory reviews`
117
169
  is the hosted-memory review connector: it reads review queue, cleanup, and
118
170
  duplicate candidate surfaces, summarizes the items for the LLM, and only writes
119
- local Decision Requests when `--emit-decisions` is passed.
171
+ local Decision Requests when `--emit-decisions` is passed. Its JSON output
172
+ includes `emittedCount`, `emittedRequestIds`, and an `emitted` summary so an
173
+ agent can continue without re-listing pending requests.
120
174
 
121
175
  ## Local First, Hosted When Useful
122
176
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { ProjectRealityCheckResult, ProjectIntelligenceEngineeringLeadPlanSummary } from '@snipara/project-intelligence-contracts';
2
+ import { ProjectIntentDetectionResult, ProjectRealityCheckResult, ProjectIntelligenceEngineeringLeadPlanSummary } from '@snipara/project-intelligence-contracts';
3
3
 
4
4
  declare function resolveQueryFromToolInput(toolInput?: string, tool?: string): string | null;
5
5
 
@@ -1563,6 +1563,16 @@ interface SessionSnapshot {
1563
1563
  handoffCount: number;
1564
1564
  latestHandoffAt?: string;
1565
1565
  };
1566
+ summary: {
1567
+ latestActivityAt?: string;
1568
+ latestActivityTitle?: string;
1569
+ latestActivityKind?: string;
1570
+ risk: "none" | "watch" | "risk";
1571
+ riskReasons: string[];
1572
+ touchedFiles: string[];
1573
+ recommendedNextAction: string;
1574
+ };
1575
+ intentDetection: ProjectIntentDetectionResult;
1566
1576
  routing: {
1567
1577
  hardRoutingAllowed: false;
1568
1578
  reason: string;
@@ -1600,6 +1610,7 @@ declare function writeSessionSnapshot(options?: {
1600
1610
  cwd?: string;
1601
1611
  limit?: number;
1602
1612
  }): SessionSnapshot;
1613
+ declare function readSessionSnapshot(cwd?: string): SessionSnapshot | null;
1603
1614
 
1604
1615
  type LocalCodeOverlayMode = "working_tree" | "local_commit";
1605
1616
  type LocalCodeOverlayKind = "none" | "local_commit" | "working_tree" | "mixed";
@@ -2017,6 +2028,7 @@ interface ProjectIntelligenceBrief {
2017
2028
  memoryHealth?: Record<string, unknown>;
2018
2029
  codeImpact?: Record<string, unknown>;
2019
2030
  codeImpactSourceSelection?: CodeGraphSourceSelection;
2031
+ localSessionSnapshot?: SessionSnapshot;
2020
2032
  verificationPlan?: VerificationPlan;
2021
2033
  judgmentCard?: ProjectIntelligenceJudgmentCard;
2022
2034
  errors: Array<{
@@ -3538,9 +3550,11 @@ interface LocalWorkerDeclaration {
3538
3550
  endpointType: "local";
3539
3551
  provider: string;
3540
3552
  baseUrl: string;
3553
+ command?: string;
3541
3554
  model?: string;
3542
3555
  preferModel?: string;
3543
3556
  capabilities: string[];
3557
+ reasoning: "low" | "medium" | "high";
3544
3558
  writeScope: string[];
3545
3559
  createdAt: string;
3546
3560
  updatedAt: string;
@@ -3572,14 +3586,41 @@ interface LocalWorkerAddOptions {
3572
3586
  preferModel?: string;
3573
3587
  capabilities?: string[];
3574
3588
  writeScope?: string[];
3589
+ contextWindow?: number;
3590
+ reasoning?: "low" | "medium" | "high";
3575
3591
  default?: boolean;
3576
3592
  json?: boolean;
3593
+ transport?: "openai_http" | "cli";
3594
+ command?: string;
3577
3595
  }
3578
3596
  interface LocalWorkerStatusOptions {
3579
3597
  json?: boolean;
3580
3598
  }
3599
+ interface LocalWorkerListOptions {
3600
+ json?: boolean;
3601
+ }
3602
+ interface LocalWorkerRemoveOptions {
3603
+ id: string;
3604
+ json?: boolean;
3605
+ }
3606
+ interface LocalWorkerProbeOptions {
3607
+ baseUrl?: string;
3608
+ provider?: string;
3609
+ model?: string;
3610
+ preferModel?: string;
3611
+ role?: string;
3612
+ workerId?: string;
3613
+ capabilities?: string[];
3614
+ writeScope?: string[];
3615
+ reasoning?: "low" | "medium" | "high";
3616
+ contextWindow?: number;
3617
+ json?: boolean;
3618
+ }
3581
3619
  declare function workersLocalAddCommand(options: LocalWorkerAddOptions): void;
3582
3620
  declare function workersLocalStatusCommand(options?: LocalWorkerStatusOptions): void;
3621
+ declare function workersLocalListCommand(options?: LocalWorkerListOptions): void;
3622
+ declare function workersLocalRemoveCommand(options: LocalWorkerRemoveOptions): void;
3623
+ declare function workersLocalProbePrintCommand(options: LocalWorkerProbeOptions): void;
3583
3624
  declare function addLocalWorker(options: LocalWorkerAddOptions): {
3584
3625
  worker: LocalWorkerDeclaration;
3585
3626
  config: LocalWorkersConfig;
@@ -4065,6 +4106,7 @@ interface AdaptiveRoutingCard {
4065
4106
  costEstimate: AdaptiveRoutingCostEstimate;
4066
4107
  humanApprovalRequired: boolean;
4067
4108
  fallback: "main_agent";
4109
+ rejectedReasons?: Record<string, string[]>;
4068
4110
  reasons: string[];
4069
4111
  warnings: string[];
4070
4112
  }
@@ -4096,6 +4138,7 @@ interface AdaptiveRoutingResolution {
4096
4138
  fallback?: string;
4097
4139
  reasons?: string[];
4098
4140
  warnings?: string[];
4141
+ rejectedReasons?: Record<string, string[]>;
4099
4142
  }
4100
4143
  interface AdaptiveWorkRoutingRecommendation {
4101
4144
  workProfile: AdaptiveWorkProfile;
@@ -4212,4 +4255,4 @@ declare function buildOrchestratorHandoff(options: OrchestratorHandoffOptions):
4212
4255
  declare function buildAdaptiveWorkRoutingRecommendation(options: AdaptiveWorkRoutingOptions): AdaptiveWorkRoutingRecommendation;
4213
4256
  declare function writeOrchestratorHandoff(options: OrchestratorHandoffOptions): WrittenOrchestratorHandoff;
4214
4257
 
4215
- 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, realityCheckCommand, referencesIngestCommand, referencesScanCommand, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveLocalWorkerRoutingDefaults, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, workersLocalAddCommand, workersLocalStatusCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff, writeProducerLoopArtifact, writeSessionSnapshot };
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 };