snipara-companion 1.4.1 → 1.4.2

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
@@ -59,6 +59,19 @@ yarn global add snipara-companion
59
59
  snipara-companion
60
60
  ```
61
61
 
62
+ ## New In 1.4.2
63
+
64
+ - Adds `snipara-companion collaboration start|watch|claim|guard|release|status`
65
+ for safe parallel coding presence, auto-claims, advisory/exclusive resource
66
+ claims, hosted guard checks, and conflict alarms across humans and agents.
67
+ - Adds `snipara-companion collaboration hooks install` plus guard profiles for
68
+ blocking pre-commit, pre-push, pre-deploy, schema/migration, and package
69
+ release checks.
70
+ - Adds `snipara-companion collaboration ide-status` for editor extensions and
71
+ local companion UIs that need compact live collaboration state.
72
+ - Hardens local code impact so stale or incomplete local overlay caches report
73
+ missing target files instead of silently returning an empty impact set.
74
+
62
75
  ## New In 1.4.1
63
76
 
64
77
  - Makes local code overlay Git hooks background by default so `git commit` and
@@ -650,7 +663,7 @@ Semantics:
650
663
  - `snipara-companion workflow scaffold --preset project-intelligence-continuity-layer` = creates a four-phase managed plan for memory authority, code impact, continuity summaries, and release/docs surfaces
651
664
  - `snipara-companion workflow phase-start` = marks the current phase and prints the required Snipara context gate plus code-impact / symbol-card gates; runtime-marked phases also get a stable Snipara Sandbox session binding
652
665
  - `snipara-companion workflow runtime-checkpoint` = captures a resume-ready Snipara Sandbox checkpoint for one phase using local workflow state plus a hosted automation event when configured
653
- - `snipara-companion workflow phase-commit` = calls hosted `snipara_end_of_task_commit` for that phase, updates local state, and advances the next phase
666
+ - `snipara-companion workflow phase-commit` = calls hosted `snipara_end_of_task_commit` for that phase, updates local state, and advances the next phase; if the hosted commit times out or hits a transient network failure, local workflow state still advances with an explicit local fallback record
654
667
  - `snipara-companion workflow resume` = reloads local workflow state plus hosted durable/session memory after compaction or resume, then appends the latest hosted Team Sync handoff/checkpoint context when available; runtime-bound phases also print a Snipara Sandbox reattach or rehydrate plan; rerun `workflow phase-start` before editing again
655
668
  - `snipara-companion workflow resume` does not snapshot or exactly restore a live Snipara Sandbox process; exact process restore remains a roadmap item
656
669
  - `snipara-companion team-sync start-work` = keeps the local session file and fetches the hosted Start Work Brief when the workspace has project auth
@@ -734,6 +747,8 @@ Companion separates two concepts:
734
747
  - `git commit` is a version-control checkpoint.
735
748
  - `snipara-companion task-commit`, `workflow phase-commit`, and `final-commit` call hosted
736
749
  `snipara_end_of_task_commit` to persist meaningful task, phase, or workflow outcomes.
750
+ `workflow phase-commit` and `final-commit` keep local workflow state moving on transient
751
+ hosted commit timeouts and surface that local fallback explicitly in the result.
737
752
 
738
753
  Do not call `snipara_end_of_task_commit` mechanically for every Git commit. For risky commits,
739
754
  package releases, or retries after failures, run Memory Guard first so the agent sees relevant
package/dist/index.d.ts CHANGED
@@ -716,6 +716,113 @@ interface TeamSyncResumeResponse {
716
716
  recommendedActions: string[];
717
717
  caveats: string[];
718
718
  }
719
+ type CollaborationActorType = "HUMAN" | "AGENT" | "SYSTEM";
720
+ type CollaborationResourceKind = "FILE" | "ROUTE" | "SYMBOL" | "SCHEMA" | "PACKAGE" | "DEPLOY" | "SURFACE" | "CUSTOM";
721
+ type CollaborationLeaseMode = "WATCH" | "ADVISORY" | "REQUIRES_ACK" | "EXCLUSIVE" | "HARD_BLOCK";
722
+ type CollaborationLeaseStatus = "ACTIVE" | "RELEASED" | "EXPIRED" | "OVERRIDDEN";
723
+ type CollaborationConflictSeverity = "INFO" | "WATCH" | "WARNING" | "CRITICAL";
724
+ type CollaborationGuardDecision = "CLEAR" | "WATCH" | "REVIEW_REQUIRED" | "REQUIRES_ACK" | "BLOCKED";
725
+ interface CollaborationResource {
726
+ kind: CollaborationResourceKind;
727
+ id: string;
728
+ label?: string;
729
+ sourcePath?: string;
730
+ }
731
+ interface CollaborationActorPayload {
732
+ actorId?: string;
733
+ actorType?: CollaborationActorType;
734
+ actorLabel?: string;
735
+ sessionId?: string;
736
+ }
737
+ interface CollaborationSessionSummary {
738
+ id: string;
739
+ actorId: string;
740
+ actorType: CollaborationActorType;
741
+ actorLabel?: string | null;
742
+ sessionId?: string | null;
743
+ swarmId?: string | null;
744
+ client?: string | null;
745
+ repository?: string | null;
746
+ branch?: string | null;
747
+ worktree?: string | null;
748
+ task?: string | null;
749
+ status: string;
750
+ dirtyFiles?: string[];
751
+ startedAt?: string;
752
+ lastHeartbeatAt?: string;
753
+ heartbeatTtlSeconds?: number | null;
754
+ [key: string]: unknown;
755
+ }
756
+ interface CollaborationLeaseSummary {
757
+ id: string;
758
+ workSessionId?: string | null;
759
+ swarmId?: string | null;
760
+ resourceKind: CollaborationResourceKind;
761
+ resourceId: string;
762
+ resourceLabel?: string | null;
763
+ mode: CollaborationLeaseMode;
764
+ status: CollaborationLeaseStatus;
765
+ claimedByActorId: string;
766
+ claimedByActorType: CollaborationActorType;
767
+ claimedByLabel?: string | null;
768
+ reason?: string | null;
769
+ claimedAt?: string;
770
+ heartbeatAt?: string;
771
+ expiresAt?: string | null;
772
+ [key: string]: unknown;
773
+ }
774
+ interface CollaborationConflict {
775
+ code: string;
776
+ decision: CollaborationGuardDecision;
777
+ severity: CollaborationConflictSeverity;
778
+ resource: CollaborationResource;
779
+ conflictingActor: {
780
+ actorId: string;
781
+ actorType: CollaborationActorType;
782
+ actorLabel?: string | null;
783
+ sessionId?: string | null;
784
+ };
785
+ reason: string;
786
+ recommendedAction: string;
787
+ leaseId?: string | null;
788
+ workSessionId?: string | null;
789
+ }
790
+ interface CollaborationGuardEvaluation {
791
+ decision: CollaborationGuardDecision;
792
+ severity: CollaborationConflictSeverity;
793
+ evaluatedAt: string;
794
+ resources: CollaborationResource[];
795
+ conflicts: CollaborationConflict[];
796
+ recommendedActions: string[];
797
+ }
798
+ interface CollaborationStateResponse {
799
+ project: TeamSyncProjectSummary;
800
+ sessions: CollaborationSessionSummary[];
801
+ leases: CollaborationLeaseSummary[];
802
+ events?: Array<Record<string, unknown>>;
803
+ sessionSnapshots: unknown[];
804
+ leaseSnapshots: unknown[];
805
+ }
806
+ interface CollaborationSessionResponse {
807
+ project: TeamSyncProjectSummary;
808
+ session: CollaborationSessionSummary;
809
+ resources: CollaborationResource[];
810
+ }
811
+ interface CollaborationLeaseResponse {
812
+ project: TeamSyncProjectSummary;
813
+ resources: CollaborationResource[];
814
+ leases: CollaborationLeaseSummary[];
815
+ }
816
+ interface CollaborationLeaseUpdateResponse {
817
+ project: TeamSyncProjectSummary;
818
+ lease: CollaborationLeaseSummary;
819
+ }
820
+ interface CollaborationGuardResponse {
821
+ project: TeamSyncProjectSummary;
822
+ resources: CollaborationResource[];
823
+ evaluation: CollaborationGuardEvaluation;
824
+ guardEvent: Record<string, unknown> | null;
825
+ }
719
826
  interface ApiKeyProjectSummary {
720
827
  id: string;
721
828
  name: string;
@@ -736,6 +843,7 @@ declare class RLMClient {
736
843
  private resolveProjectIdentifier;
737
844
  private dashboardApiUrl;
738
845
  private fetchWithApiKeyRetry;
846
+ private dashboardProjectRequest;
739
847
  /**
740
848
  * Make an MCP JSON-RPC request
741
849
  */
@@ -922,6 +1030,57 @@ declare class RLMClient {
922
1030
  task?: string;
923
1031
  recentFiles?: string[];
924
1032
  }): Promise<TeamSyncResumeResponse>;
1033
+ getCollaborationState(): Promise<CollaborationStateResponse>;
1034
+ startCollaborationSession(args: CollaborationActorPayload & {
1035
+ workSessionId?: string;
1036
+ swarmId?: string;
1037
+ client?: string;
1038
+ repository?: string;
1039
+ branch?: string;
1040
+ worktree?: string;
1041
+ task?: string;
1042
+ heartbeatTtlSeconds?: number;
1043
+ files?: string[];
1044
+ dirtyFiles?: string[];
1045
+ resources?: CollaborationResource[];
1046
+ metadata?: Record<string, unknown>;
1047
+ }): Promise<CollaborationSessionResponse>;
1048
+ updateCollaborationSession(workSessionId: string, args: CollaborationActorPayload & {
1049
+ status?: "ACTIVE" | "STALE" | "COMPLETED" | "ABANDONED";
1050
+ swarmId?: string;
1051
+ client?: string;
1052
+ repository?: string;
1053
+ branch?: string;
1054
+ worktree?: string;
1055
+ task?: string;
1056
+ heartbeatTtlSeconds?: number;
1057
+ files?: string[];
1058
+ dirtyFiles?: string[];
1059
+ resources?: CollaborationResource[];
1060
+ metadata?: Record<string, unknown>;
1061
+ }): Promise<CollaborationSessionResponse>;
1062
+ createCollaborationLeases(args: CollaborationActorPayload & {
1063
+ workSessionId?: string;
1064
+ swarmId?: string;
1065
+ mode?: CollaborationLeaseMode;
1066
+ reason?: string;
1067
+ ttlSeconds?: number;
1068
+ files?: string[];
1069
+ resources?: CollaborationResource[];
1070
+ metadata?: Record<string, unknown>;
1071
+ }): Promise<CollaborationLeaseResponse>;
1072
+ updateCollaborationLease(leaseId: string, args: {
1073
+ action?: "heartbeat" | "release" | "override";
1074
+ reason?: string;
1075
+ }): Promise<CollaborationLeaseUpdateResponse>;
1076
+ evaluateCollaborationGuard(args: CollaborationActorPayload & {
1077
+ workSessionId?: string;
1078
+ action?: string;
1079
+ files?: string[];
1080
+ resources?: CollaborationResource[];
1081
+ persist?: boolean;
1082
+ metadata?: Record<string, unknown>;
1083
+ }): Promise<CollaborationGuardResponse>;
925
1084
  plan(query: string, maxTokens?: number): Promise<Record<string, unknown>>;
926
1085
  uploadDocument(path: string, content: string, options?: UploadDocumentOptions): Promise<Record<string, unknown>>;
927
1086
  listBusinessCollections(options?: ListBusinessCollectionsOptions): Promise<Record<string, unknown>>;
@@ -1963,6 +2122,100 @@ declare function getTeamSyncStatePath(rootDir?: string): string;
1963
2122
  declare function buildAgenticHandoffMarkdown(artifact: AgenticHandoffArtifact): string;
1964
2123
  declare function teamSyncSweepCommand(options: TeamSyncCommandOptions): Promise<void>;
1965
2124
 
2125
+ declare const COLLABORATION_STATE_RELATIVE_PATH: string;
2126
+ interface CollaborationCommandOptions {
2127
+ summary?: string;
2128
+ files?: string[];
2129
+ resources?: string[];
2130
+ actor?: string;
2131
+ actorId?: string;
2132
+ actorType?: string;
2133
+ sessionId?: string;
2134
+ workSessionId?: string;
2135
+ swarmId?: string;
2136
+ client?: string;
2137
+ repository?: string;
2138
+ branch?: string;
2139
+ worktree?: string;
2140
+ action?: string;
2141
+ profile?: string;
2142
+ mode?: string;
2143
+ reason?: string;
2144
+ ttlSeconds?: string;
2145
+ heartbeatTtlSeconds?: string;
2146
+ intervalSeconds?: string;
2147
+ maxFiles?: string;
2148
+ leaseId?: string;
2149
+ all?: boolean;
2150
+ once?: boolean;
2151
+ autoClaim?: boolean;
2152
+ releaseStale?: boolean;
2153
+ persist?: boolean;
2154
+ enforce?: boolean;
2155
+ dir?: string;
2156
+ json?: boolean;
2157
+ }
2158
+ interface CollaborationHooksInstallOptions {
2159
+ dir?: string;
2160
+ dryRun?: boolean;
2161
+ json?: boolean;
2162
+ }
2163
+ interface CollaborationLocalLeaseRecord {
2164
+ id: string;
2165
+ mode: CollaborationLeaseMode;
2166
+ status: CollaborationLeaseStatus;
2167
+ resources: CollaborationResource[];
2168
+ reason?: string;
2169
+ claimedAt?: string;
2170
+ expiresAt?: string | null;
2171
+ }
2172
+ interface CollaborationLocalState {
2173
+ schemaVersion: "snipara.collaboration.v1";
2174
+ updatedAt: string;
2175
+ workSessionId?: string;
2176
+ sessionId?: string;
2177
+ actorId?: string;
2178
+ actorType?: CollaborationActorType;
2179
+ actorLabel?: string;
2180
+ client?: string;
2181
+ repository?: string;
2182
+ branch?: string;
2183
+ worktree?: string;
2184
+ task?: string;
2185
+ files: string[];
2186
+ resources: CollaborationResource[];
2187
+ leases: CollaborationLocalLeaseRecord[];
2188
+ lastGuard?: {
2189
+ decision: CollaborationGuardDecision;
2190
+ severity: string;
2191
+ checkedAt: string;
2192
+ action: string;
2193
+ resources: CollaborationResource[];
2194
+ conflictCount: number;
2195
+ };
2196
+ }
2197
+ interface ResolvedCollaborationContext {
2198
+ rootDir: string;
2199
+ config: RLMConfig;
2200
+ actor: Required<Pick<CollaborationActorPayload, "actorId" | "actorType" | "actorLabel">> & {
2201
+ sessionId?: string;
2202
+ };
2203
+ client: string;
2204
+ branch?: string;
2205
+ repository?: string;
2206
+ worktree?: string;
2207
+ }
2208
+ declare function createEmptyCollaborationState(now?: Date): CollaborationLocalState;
2209
+ declare function getCollaborationStatePath(rootDir?: string): string;
2210
+ declare function loadCollaborationState(rootDir?: string): CollaborationLocalState;
2211
+ declare function saveCollaborationState(state: CollaborationLocalState, rootDir?: string): void;
2212
+ declare function buildCollaborationActor(options: Pick<CollaborationCommandOptions, "actor" | "actorId" | "actorType" | "sessionId" | "client">, config: RLMConfig): ResolvedCollaborationContext["actor"];
2213
+ declare function normalizeCollaborationFiles(files: string[] | undefined): string[];
2214
+ declare function parseCollaborationResources(values: string[] | undefined): CollaborationResource[];
2215
+ declare function deriveLocalCollaborationResourcesFromFiles(files: string[] | undefined, rootDir?: string, maxFiles?: number): CollaborationResource[];
2216
+ declare function buildCollaborationHooksInstallPlan(options?: CollaborationHooksInstallOptions): Record<string, unknown>;
2217
+ declare function collaborationIdeStatusCommand(options: CollaborationCommandOptions): Promise<void>;
2218
+
1966
2219
  interface JournalCheckpointPayload {
1967
2220
  action: string;
1968
2221
  summary: string;
@@ -2150,4 +2403,4 @@ interface WrittenOrchestratorHandoff {
2150
2403
  declare function buildOrchestratorHandoff(options: OrchestratorHandoffOptions): OrchestratorHandoffArtifact;
2151
2404
  declare function writeOrchestratorHandoff(options: OrchestratorHandoffOptions): WrittenOrchestratorHandoff;
2152
2405
 
2153
- export { AUTOMATION_MANIFEST_RELATIVE_PATH, AutomationInstallConflictError, AutomationUnsupportedHookBundleError, ORCHESTRATOR_HANDOFF_RELATIVE_PATH, TEAM_SYNC_STATE_RELATIVE_PATH, WORKFLOW_PLANS_RELATIVE_DIR, WORKFLOW_STATE_RELATIVE_PATH, archiveInactiveTeamSyncWork, autoArchiveTeamSyncState, buildAgenticHandoffMarkdown, buildAgenticTimeline, buildAgenticWorkStatus, buildAutomationInstallPlan, buildCanonicalEvent, buildCodeHooksInstallPlan, buildCodePromotionResult, buildCodeStatusResult, buildCodeSyncResult, buildHostedCodeOverlayUploadPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalShortestPathResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildProjectIntelligenceBrief, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, collectSyncDocuments, collectSyncDocumentsInput, createClient, createEmptyTeamSyncState, createLocalQueryCache, detectReleaseSurfacesFromFiles, detectRuntimeEnvironment, extractCommandFromToolInput, extractFilesFromToolInput, formatOrchestratorRecommendationReason, formatStuckGuardDecision, getAutomationManifestPath, getAutomationStatus, getConfigPath, getLocalCodeOverlayCachePath, getLocalCodePromotionStatePath, getOrchestratorRecommendation, getPlanStepDisplayTitle, getStagedFiles, getStuckGuardInjection, getTeamSyncStatePath, ingestReferences, installAutomationBundle, listProjectsForApiKey, loadAutomationManifest, loadConfig, loadTeamSyncState, memoryAuditCommand, memoryCleanCandidatesCommand, memoryCompactCommand, memoryHealthCommand, normalizeGuardTag, normalizeWorkflowPlanInput, projectIntelligenceBriefCommand, readLocalCodeOverlayCache, readLocalCodePromotionState, referencesIngestCommand, referencesScanCommand, resolveQueryFromToolInput, runMemoryGuardCheck, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, verifyCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeOrchestratorHandoff };
2406
+ export { AUTOMATION_MANIFEST_RELATIVE_PATH, AutomationInstallConflictError, AutomationUnsupportedHookBundleError, COLLABORATION_STATE_RELATIVE_PATH, ORCHESTRATOR_HANDOFF_RELATIVE_PATH, TEAM_SYNC_STATE_RELATIVE_PATH, WORKFLOW_PLANS_RELATIVE_DIR, WORKFLOW_STATE_RELATIVE_PATH, archiveInactiveTeamSyncWork, autoArchiveTeamSyncState, buildAgenticHandoffMarkdown, buildAgenticTimeline, buildAgenticWorkStatus, buildAutomationInstallPlan, buildCanonicalEvent, buildCodeHooksInstallPlan, buildCodePromotionResult, buildCodeStatusResult, buildCodeSyncResult, buildCollaborationActor, buildCollaborationHooksInstallPlan, buildHostedCodeOverlayUploadPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalShortestPathResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildProjectIntelligenceBrief, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, collaborationIdeStatusCommand, collectSyncDocuments, collectSyncDocumentsInput, createClient, createEmptyCollaborationState, createEmptyTeamSyncState, createLocalQueryCache, deriveLocalCollaborationResourcesFromFiles, detectReleaseSurfacesFromFiles, detectRuntimeEnvironment, extractCommandFromToolInput, extractFilesFromToolInput, formatOrchestratorRecommendationReason, formatStuckGuardDecision, getAutomationManifestPath, getAutomationStatus, getCollaborationStatePath, getConfigPath, getLocalCodeOverlayCachePath, getLocalCodePromotionStatePath, getOrchestratorRecommendation, getPlanStepDisplayTitle, getStagedFiles, getStuckGuardInjection, getTeamSyncStatePath, ingestReferences, installAutomationBundle, listProjectsForApiKey, loadAutomationManifest, loadCollaborationState, loadConfig, loadTeamSyncState, memoryAuditCommand, memoryCleanCandidatesCommand, memoryCompactCommand, memoryHealthCommand, normalizeCollaborationFiles, normalizeGuardTag, normalizeWorkflowPlanInput, parseCollaborationResources, projectIntelligenceBriefCommand, readLocalCodeOverlayCache, readLocalCodePromotionState, referencesIngestCommand, referencesScanCommand, resolveQueryFromToolInput, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, verifyCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeOrchestratorHandoff };