snipara-companion 2.3.0 → 3.0.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/README.md CHANGED
@@ -7,10 +7,11 @@
7
7
 
8
8
  **Ask your repo what breaks if you touch this.**
9
9
 
10
- No global install. No `init`. No account. Your code stays on your machine.
10
+ No global install. No account. Your code stays on your machine.
11
11
 
12
12
  ```bash
13
13
  npx -y snipara-companion impact src/auth/session.ts --source local
14
+ npx -y snipara-companion source init .
14
15
  ```
15
16
 
16
17
  Example output excerpt:
@@ -40,6 +41,7 @@ These commands are useful without hosted Snipara:
40
41
 
41
42
  | Command | What it gives you locally |
42
43
  | ------------------------------------------------------------ | ------------------------------------------------------------ |
44
+ | `source init` / `source sync` / `source status` | Local source snapshot, document preview, and code overlay |
43
45
  | `impact` / `code impact` | File-level blast-radius from the local code overlay |
44
46
  | `code callers` / `imports` / `neighbors` / `shortest-path` | Structural repo questions from local files |
45
47
  | `workflow start` / `phase-start` / `phase-commit` / `resume` | Agent continuity that survives compaction |
@@ -73,6 +75,7 @@ Snipara is the upgrade path for team and cross-project intelligence.
73
75
  | Need | Local companion | Hosted Snipara |
74
76
  | ----------------------------------------------- | ------------------------- | ----------------------------------- |
75
77
  | Inspect this repo before editing | Yes, no account | Optional hosted code graph |
78
+ | Activate docs and code without GitHub | Yes, `source init` | Provider sync after approval |
76
79
  | Keep code private on this machine | Yes | Use only when explicitly configured |
77
80
  | Preserve agent workflow state | Yes, `.snipara/` files | Syncs across machines and agents |
78
81
  | Store/retrieve long tool output | Yes, `context-pack` | Metadata and receipts can be shared |
@@ -85,6 +88,17 @@ graph, cross-machine presence, outcome learning, team coordination, or dashboard
85
88
  proof. Keep local mode when the question is simply: "what does this repo say
86
89
  will break if I touch this file?"
87
90
 
91
+ For folders without Git metadata or users who have not approved GitHub yet, run:
92
+
93
+ ```bash
94
+ npx -y snipara-companion source init .
95
+ npx -y snipara-companion source status --json
96
+ ```
97
+
98
+ This writes `.snipara/source/latest.json`, builds a local document sync preview,
99
+ and refreshes `.snipara/code-overlay/latest.json`. The hosted code graph remains
100
+ the canonical shared graph after provider sync.
101
+
88
102
  ## Install
89
103
 
90
104
  Use `npx` for one-off checks:
package/dist/index.d.ts CHANGED
@@ -2750,6 +2750,105 @@ declare function buildAgenticTimeline(options?: {
2750
2750
  cwd?: string;
2751
2751
  }): AgenticTimeline;
2752
2752
 
2753
+ type LocalSourceProvider = "local_folder";
2754
+ type LocalSourceFileKind = "DOC" | "BINARY" | "CODE" | "CONFIG" | "OTHER";
2755
+ type LocalSourceSkippedReason = "ignored" | "too_large" | "read_error";
2756
+ type LocalSourceReindexKind = "doc" | "code";
2757
+ type LocalSourceReindexMode = "incremental" | "full";
2758
+ interface LocalSourceFile {
2759
+ path: string;
2760
+ kind: LocalSourceFileKind;
2761
+ format: string | null;
2762
+ sizeBytes: number;
2763
+ modifiedAt: string;
2764
+ sha256: string;
2765
+ }
2766
+ interface LocalSourceSkippedFile {
2767
+ path: string;
2768
+ reason: LocalSourceSkippedReason;
2769
+ sizeBytes?: number;
2770
+ }
2771
+ interface LocalSourceSummary {
2772
+ totalFiles: number;
2773
+ totalBytes: number;
2774
+ byKind: Record<LocalSourceFileKind, number>;
2775
+ skipped: number;
2776
+ }
2777
+ interface LocalSourceSnapshot {
2778
+ version: "snipara.local_source_snapshot.v1";
2779
+ generatedAt: string;
2780
+ root: string;
2781
+ provider: LocalSourceProvider;
2782
+ revision: string;
2783
+ recursive: boolean;
2784
+ maxFiles: number;
2785
+ maxFileBytes: number;
2786
+ summary: LocalSourceSummary;
2787
+ files: LocalSourceFile[];
2788
+ skipped: {
2789
+ total: number;
2790
+ byReason: Record<LocalSourceSkippedReason, number>;
2791
+ samples: LocalSourceSkippedFile[];
2792
+ };
2793
+ warnings: string[];
2794
+ }
2795
+ interface LocalSourceSnapshotOptions {
2796
+ dir?: string;
2797
+ recursive?: boolean;
2798
+ maxFiles?: number;
2799
+ maxFileBytes?: number;
2800
+ }
2801
+ interface LocalSourceComparison {
2802
+ added: string[];
2803
+ modified: string[];
2804
+ deleted: string[];
2805
+ unchanged: number;
2806
+ }
2807
+ interface LocalSourceStatusResult {
2808
+ root: string;
2809
+ snapshotPath: string;
2810
+ previous: LocalSourceSnapshot | null;
2811
+ current: LocalSourceSnapshot;
2812
+ comparison: LocalSourceComparison;
2813
+ }
2814
+ interface LocalSourceSyncOptions extends LocalSourceSnapshotOptions {
2815
+ prefix?: string;
2816
+ mode?: OnboardFolderMode;
2817
+ deleteMissing?: boolean;
2818
+ apply?: boolean;
2819
+ reindex?: boolean;
2820
+ reindexKind?: LocalSourceReindexKind;
2821
+ reindexMode?: LocalSourceReindexMode;
2822
+ includeGraph?: boolean;
2823
+ json?: boolean;
2824
+ }
2825
+ interface LocalSourceSyncResult {
2826
+ root: string;
2827
+ snapshotPath: string;
2828
+ snapshot: LocalSourceSnapshot;
2829
+ comparison: LocalSourceComparison;
2830
+ documents: {
2831
+ onboarding: Pick<OnboardFolderManifest, "source" | "classification" | "summary" | "warnings">;
2832
+ dryRun: OnboardFolderManifest["dryRun"];
2833
+ };
2834
+ codeOverlay: {
2835
+ cachePath: string;
2836
+ summary: LocalCodeOverlaySummary;
2837
+ };
2838
+ apply: null | {
2839
+ sync: Record<string, unknown>;
2840
+ reindex?: Record<string, unknown>;
2841
+ };
2842
+ warnings: string[];
2843
+ }
2844
+ declare function getLocalSourceSnapshotPath(cwd?: string): string;
2845
+ declare function buildLocalSourceSnapshot(options?: LocalSourceSnapshotOptions): LocalSourceSnapshot;
2846
+ declare function writeLocalSourceSnapshot(snapshot: LocalSourceSnapshot): string;
2847
+ declare function readLocalSourceSnapshot(cwd?: string): LocalSourceSnapshot | null;
2848
+ declare function compareLocalSourceSnapshots(previous: LocalSourceSnapshot | null, current: LocalSourceSnapshot): LocalSourceComparison;
2849
+ declare function buildLocalSourceStatus(options?: LocalSourceSnapshotOptions): LocalSourceStatusResult;
2850
+ declare function buildLocalSourceSyncResult(options?: LocalSourceSyncOptions): Promise<LocalSourceSyncResult>;
2851
+
2753
2852
  declare const MANIFEST_VERSION = "snipara.references.v1";
2754
2853
  type ReferenceStatus = "allowed" | "pending" | "denied" | "unsupported";
2755
2854
  interface ReferenceOccurrence {
@@ -3365,6 +3464,7 @@ interface AdaptiveWorkProfile {
3365
3464
  contextBudget: string;
3366
3465
  reasoningDepth: string;
3367
3466
  evidenceRequirements?: string[];
3467
+ preferredProfileStrengths?: string[];
3368
3468
  notes?: string[];
3369
3469
  }
3370
3470
  interface AdaptiveModelRequirements {
@@ -3377,6 +3477,7 @@ interface AdaptiveModelRequirements {
3377
3477
  capabilities: string[];
3378
3478
  forbiddenCapabilities: string[];
3379
3479
  writeScope: string[];
3480
+ structuredOutputRequired?: boolean;
3380
3481
  preferredEndpointTypes?: string[];
3381
3482
  allowedEndpointTypes?: string[];
3382
3483
  catalogLimit?: number;
@@ -3394,13 +3495,13 @@ interface AdaptiveRoutingCard {
3394
3495
  requirements: AdaptiveModelRequirements;
3395
3496
  recommendedWorkerClass: string;
3396
3497
  costEstimate: AdaptiveRoutingCostEstimate;
3397
- humanApprovalRequired: true;
3498
+ humanApprovalRequired: boolean;
3398
3499
  fallback: "main_agent";
3399
3500
  reasons: string[];
3400
3501
  warnings: string[];
3401
3502
  }
3402
3503
  interface AdaptiveRoutingGatewayStatus {
3403
- source: "hosted_mcp";
3504
+ source: "hosted_mcp" | "local_orchestrator";
3404
3505
  success: boolean;
3405
3506
  resolutionStatus?: string;
3406
3507
  candidateCount: number;
@@ -3409,14 +3510,32 @@ interface AdaptiveRoutingGatewayStatus {
3409
3510
  }
3410
3511
  interface AdaptiveRoutingRuntimeCatalog {
3411
3512
  version?: string;
3513
+ source?: string;
3514
+ provider?: string;
3515
+ baseUrl?: string;
3516
+ models?: string[];
3517
+ apiPaths?: Record<string, unknown>;
3518
+ workerEndpoints?: Record<string, Record<string, unknown>>;
3519
+ workerProfiles?: Record<string, Record<string, unknown>>;
3412
3520
  candidates: Array<Record<string, unknown>>;
3413
3521
  }
3522
+ interface AdaptiveRoutingResolution {
3523
+ status?: string;
3524
+ selected?: Record<string, unknown>;
3525
+ policyDecision?: Record<string, unknown>;
3526
+ evaluatedCount?: number;
3527
+ rejectedCount?: number;
3528
+ fallback?: string;
3529
+ reasons?: string[];
3530
+ warnings?: string[];
3531
+ }
3414
3532
  interface AdaptiveWorkRoutingRecommendation {
3415
3533
  workProfile: AdaptiveWorkProfile;
3416
3534
  requirements: AdaptiveModelRequirements;
3417
3535
  routingCard: AdaptiveRoutingCard;
3418
3536
  gateway?: AdaptiveRoutingGatewayStatus;
3419
3537
  runtimeCatalog?: AdaptiveRoutingRuntimeCatalog;
3538
+ resolution?: AdaptiveRoutingResolution;
3420
3539
  }
3421
3540
  interface AdaptiveWorkRoutingOptions {
3422
3541
  query: string;
@@ -3426,6 +3545,8 @@ interface AdaptiveWorkRoutingOptions {
3426
3545
  allowedEndpointTypes?: string[];
3427
3546
  workerRole?: string;
3428
3547
  plannerRetainsReasoning?: boolean;
3548
+ preferredProfileStrengths?: string[];
3549
+ structuredOutputRequired?: boolean;
3429
3550
  catalogLimit?: number;
3430
3551
  dailyBudgetCents?: number;
3431
3552
  monthlyBudgetCents?: number;
@@ -3458,6 +3579,7 @@ interface OrchestratorHandoffArtifact {
3458
3579
  routingCard?: AdaptiveRoutingCard;
3459
3580
  gateway?: AdaptiveRoutingGatewayStatus;
3460
3581
  runtimeCatalog?: AdaptiveRoutingRuntimeCatalog;
3582
+ resolution?: AdaptiveRoutingResolution;
3461
3583
  };
3462
3584
  task: {
3463
3585
  title: string;
@@ -3521,4 +3643,4 @@ declare function buildOrchestratorHandoff(options: OrchestratorHandoffOptions):
3521
3643
  declare function buildAdaptiveWorkRoutingRecommendation(options: AdaptiveWorkRoutingOptions): AdaptiveWorkRoutingRecommendation;
3522
3644
  declare function writeOrchestratorHandoff(options: OrchestratorHandoffOptions): WrittenOrchestratorHandoff;
3523
3645
 
3524
- export { AUTOMATION_MANIFEST_RELATIVE_PATH, AutomationInstallConflictError, AutomationUnsupportedHookBundleError, COLLABORATION_STATE_RELATIVE_PATH, ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES, ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES, ENGINEERING_LEAD_POSTURES, ENGINEERING_LEAD_ROUTING_MODES, ENGINEERING_LEAD_STATUSES, ENGINEERING_LEAD_SUPERVISION_STATUSES, ENGINEERING_LEAD_WORKER_ROLES, ENGINEERING_LEAD_WORK_PACKAGE_STATUSES, ORCHESTRATOR_HANDOFF_RELATIVE_PATH, TEAM_SYNC_STATE_RELATIVE_PATH, WORKFLOW_PLANS_RELATIVE_DIR, WORKFLOW_STATE_RELATIVE_PATH, agentReadinessAuditCommand, archiveInactiveTeamSyncWork, attachLocalContextPackReceipts, autoArchiveTeamSyncState, buildAdaptiveWorkRoutingRecommendation, buildAgentReadinessAuditReport, buildAgenticHandoffMarkdown, buildAgenticTimeline, buildAgenticWorkStatus, buildAutomationInstallPlan, buildCanonicalEvent, buildCodeHooksInstallPlan, buildCodePromotionResult, buildCodeStatusResult, buildCodeSyncResult, buildCollaborationActor, buildCollaborationGuardActionCards, buildCollaborationHooksInstallPlan, buildCompanionEngineeringLeadPlanReport, buildContextPackStats, buildEvalCaseArtifact, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalShortestPathResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapQuality, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, 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, getOrchestratorRecommendation, getPlanStepDisplayTitle, getStagedFiles, getStuckGuardInjection, getTeamSyncStatePath, ingestReferences, installAutomationBundle, leadPlanCommand, listProjectsForApiKey, loadAutomationManifest, loadCollaborationState, loadConfig, loadTeamSyncState, memoryAuditCommand, memoryCleanCandidatesCommand, memoryCompactCommand, memoryHealthCommand, memoryLocalCommand, normalizeCollaborationFiles, normalizeGuardTag, normalizeWorkflowPlanInput, packContext, parseCollaborationResources, projectIntelligenceBriefCommand, projectIntelligenceRunCommand, readLocalCodeOverlayCache, readLocalCodePromotionState, referencesIngestCommand, referencesScanCommand, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeOrchestratorHandoff };
3646
+ export { AUTOMATION_MANIFEST_RELATIVE_PATH, AutomationInstallConflictError, AutomationUnsupportedHookBundleError, COLLABORATION_STATE_RELATIVE_PATH, ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES, ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES, ENGINEERING_LEAD_POSTURES, ENGINEERING_LEAD_ROUTING_MODES, ENGINEERING_LEAD_STATUSES, ENGINEERING_LEAD_SUPERVISION_STATUSES, ENGINEERING_LEAD_WORKER_ROLES, ENGINEERING_LEAD_WORK_PACKAGE_STATUSES, ORCHESTRATOR_HANDOFF_RELATIVE_PATH, TEAM_SYNC_STATE_RELATIVE_PATH, WORKFLOW_PLANS_RELATIVE_DIR, WORKFLOW_STATE_RELATIVE_PATH, agentReadinessAuditCommand, archiveInactiveTeamSyncWork, attachLocalContextPackReceipts, autoArchiveTeamSyncState, buildAdaptiveWorkRoutingRecommendation, buildAgentReadinessAuditReport, buildAgenticHandoffMarkdown, buildAgenticTimeline, buildAgenticWorkStatus, buildAutomationInstallPlan, buildCanonicalEvent, buildCodeHooksInstallPlan, buildCodePromotionResult, buildCodeStatusResult, buildCodeSyncResult, buildCollaborationActor, buildCollaborationGuardActionCards, buildCollaborationHooksInstallPlan, buildCompanionEngineeringLeadPlanReport, buildContextPackStats, buildEvalCaseArtifact, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalShortestPathResult, buildLocalSourceSnapshot, buildLocalSourceStatus, buildLocalSourceSyncResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapQuality, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, 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, normalizeCollaborationFiles, normalizeGuardTag, normalizeWorkflowPlanInput, packContext, parseCollaborationResources, projectIntelligenceBriefCommand, projectIntelligenceRunCommand, readLocalCodeOverlayCache, readLocalCodePromotionState, readLocalSourceSnapshot, referencesIngestCommand, referencesScanCommand, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff };