snipara-companion 1.4.0 → 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
@@ -1,70 +1,31 @@
1
1
  # snipara-companion
2
2
 
3
- **Workflow continuity for AI coding agents. Start work, commit phases, resume anywhere.**
3
+ **Local helper CLI for Snipara agent workflows.**
4
4
 
5
- `snipara-companion` is the local workflow layer for agentic coding work. It gives
6
- AI coding agents Git-style continuity commands: status, briefs, timelines, phase
7
- commits, handoffs, resume, diagnostics, hooks, folder onboarding, and optional
8
- Hosted Snipara context calls.
5
+ `snipara-companion` adds Git-style continuity commands for agent work: status,
6
+ briefs, timelines, phase commits, handoffs, resume, diagnostics, hooks, folder
7
+ onboarding, and command-line access around Snipara Hosted MCP. It complements
8
+ the hosted context and memory surface; it is not the primary runtime for agents.
9
9
 
10
- Use it as the local runtime for the open Snipara stack:
10
+ In this repository, the source currently lives in `packages/cli`, and the installed executable is `snipara-companion`.
11
11
 
12
- - [`snipara-companion`](https://github.com/Snipara/snipara-companion) keeps agent work resumable.
13
- - [`snipara-memory`](https://github.com/Snipara/snipara-memory) provides durable local project memory primitives.
14
- - [`snipara-evals`](https://github.com/Snipara/snipara-evals) measures project-intelligence quality for AI coding agents.
15
-
16
- Hosted Snipara adds managed context, reviewed memory, team sync, code graph
17
- impact, source authority, dashboards, and production operations.
12
+ This package complements `snipara-mcp`. It does not replace it.
18
13
 
19
14
  ```mermaid
20
15
  flowchart LR
21
16
  Project["Local project"] --> Companion["snipara-companion"]
22
- Companion --> Local["status, timeline, handoff, resume"]
23
- Companion --> Memory["optional local/project memory"]
24
- Companion --> Hosted["optional Hosted Snipara MCP / API"]
25
- Hosted --> Intelligence["project intelligence, code graph, reviewed memory"]
17
+ Companion --> Diagnostics["status, brief, timeline, phase commits, handoff"]
18
+ Companion --> Hosted["Snipara Hosted MCP / API"]
19
+ Hosted --> Agents["Codex, Claude Code, Cursor, ChatGPT"]
26
20
  ```
27
21
 
28
- ## Open Source Boundary
29
-
30
- `snipara-companion` is local-first. It should be useful on a repository even
31
- when the user has no Snipara account.
32
-
33
- | Mode | What works |
34
- | --- | --- |
35
- | Local only | `status`, `git summary`, `timeline`, workflow state, `phase-commit`, `final-commit`, local Team Sync handoffs, `code sync`, local code overlay |
36
- | Local + `snipara-memory` | local `recall`, `query`, `session-bootstrap`, and local memory in `brief` |
37
- | Snipara Cloud connected | all local features plus hosted memory, Project Intelligence context, What Changed, MCP context, code graph impact, symbol cards, dashboards, and operations |
38
-
39
- Cloud wins when connected: if the workspace has a valid Snipara API key and
40
- project binding, hosted commands use Cloud surfaces. Local fallbacks only run
41
- when Cloud is not configured.
42
-
43
- Open source in this repo:
44
-
45
- - local workflow files under `.snipara/`
46
- - status, git summary, timeline, handoff, resume, phase-commit, and final-commit commands
47
- - local hook/install helpers for supported AI coding clients
48
- - diagnostic and verification-plan facades
49
- - optional `snipara-memory` local fallback for memory recall/session context
50
- - optional calls to Hosted Snipara when project auth is configured
51
-
52
- Hosted Snipara:
53
-
54
- - managed MCP context and chunk retrieval
55
- - reviewed project memory and authority scoring
56
- - team sync and dashboard workflows
57
- - code graph impact chains, symbol cards, and verification plans
58
- - production reliability, tenancy, analytics, and operations
59
-
60
22
  ## When To Use It
61
23
 
62
24
  | If you need... | Install... |
63
25
  | --------------------------------------------------------- | ------------------------ |
64
- | Hosted MCP setup and project-scoped context | `create-snipara` |
26
+ | MCP tools, OAuth login, project-scoped context and memory | `snipara-mcp` |
27
+ | One-command Hosted MCP + companion setup | `create-snipara` |
65
28
  | Git-style local continuity, workflow modes, and hooks | `snipara-companion` |
66
- | Local durable project memory primitives | `snipara-memory` |
67
- | Project-intelligence evals for agent traces | `snipara-evals` |
68
29
  | Production gates, drift checks, and htask orchestration | `snipara-orchestrator` |
69
30
  | OpenClaw-specific automation hooks | `snipara-openclaw-hooks` |
70
31
 
@@ -98,19 +59,27 @@ yarn global add snipara-companion
98
59
  snipara-companion
99
60
  ```
100
61
 
101
- ## Development
62
+ ## New In 1.4.2
102
63
 
103
- ```bash
104
- pnpm install
105
- pnpm build
106
- pnpm type-check
107
- pnpm test
108
- pnpm pack:smoke
109
- ```
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
+
75
+ ## New In 1.4.1
110
76
 
111
- This standalone repository is mirrored from the Snipara monorepo package source
112
- while the public repo is being bootstrapped. The npm package is
113
- `snipara-companion`.
77
+ - Makes local code overlay Git hooks background by default so `git commit` and
78
+ `git push` return quickly while Snipara refreshes local overlay state and
79
+ push-time promotion asynchronously.
80
+ - Adds `snipara-companion code hooks install --synchronous` for teams that
81
+ intentionally want foreground hook work, plus a configurable background
82
+ reindex delay for pre-push promotion.
114
83
 
115
84
  ## New In 1.3.7
116
85
 
@@ -159,7 +128,6 @@ session with `snipara-companion`:
159
128
 
160
129
  ```bash
161
130
  snipara-companion status
162
- snipara-companion git summary
163
131
  snipara-companion brief --task "ship auth hardening" --changed-files src/auth.ts
164
132
  snipara-companion timeline
165
133
  snipara-companion workflow phase-commit build --summary "tests green"
@@ -170,8 +138,6 @@ snipara-companion workflow resume --include-session-context
170
138
 
171
139
  - `status` is the Git-style local work status: workflow phase, latest phase
172
140
  commit, git dirtiness, Team Sync handoffs, local risks, and next action.
173
- - `git summary` is a local-only Git companion view: branch, HEAD, upstream
174
- ahead/behind, dirty files, recent commits, and suggested next commands.
175
141
  - `brief` is the short alias for `intelligence brief`.
176
142
  - `timeline` is the Git-style log for workflow starts, phase starts, phase
177
143
  commits, final commits, and Team Sync handoffs.
@@ -196,11 +162,9 @@ The mental model is intentionally close to Git:
196
162
  API only for the final Team Sync handoff. The CLI sends a compact summary with a
197
163
  longer timeout, retries once with a shorter summary on transient hosted failures,
198
164
  and then records a local fallback handoff in `.snipara/team-sync/session.json`
199
- if the hosted call still times out. Without Cloud config, `final-commit` closes
200
- the local workflow and writes the local handoff directly. A hosted final-commit
201
- timeout does not modify Git state. Custom final-commit categories are namespaced
202
- under `final-commit` before the hosted call so they stay on the handoff-only
203
- path.
165
+ if the hosted call still times out. A hosted final-commit timeout does not modify
166
+ Git state. Custom final-commit categories are namespaced under `final-commit`
167
+ before the hosted call so they stay on the handoff-only path.
204
168
 
205
169
  ## Verification Plans
206
170
 
@@ -691,7 +655,6 @@ Semantics:
691
655
  - `snipara-companion workflow run --mode orchestrate` = explicit hosted orchestrator flow for deeper multi-step exploration; use the Python `snipara-orchestrator` package for production gates and htasks
692
656
  - `snipara-companion workflow run` = suggests Snipara Sandbox when the query calls for validation, execution, data transforms, or heavier FULL/orchestrated work
693
657
  - `snipara-companion status` = top-level agentic work status across local workflow state, git dirtiness, and Team Sync carryover
694
- - `snipara-companion git summary` = local-only Git companion summary with branch, HEAD, upstream ahead/behind, dirty files, recent commits, and handoff-oriented next commands
695
658
  - `snipara-companion brief` = short alias for `snipara-companion intelligence brief`
696
659
  - `snipara-companion timeline` = local timeline of workflow starts, phase starts, phase commits, final commits, and Team Sync handoffs
697
660
  - `snipara-companion handoff` = top-level agent-ready Markdown/JSON handoff artifact plus the same local/hosted Team Sync handoff persistence
@@ -700,15 +663,15 @@ Semantics:
700
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
701
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
702
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
703
- - `snipara-companion workflow phase-commit` = updates local workflow state and advances the next phase; when Cloud is connected it also calls hosted `snipara_end_of_task_commit`
704
- - `snipara-companion workflow resume` = reloads local workflow state plus hosted durable/session memory when Cloud is connected, or local `snipara-memory` session context when available; runtime-bound phases also print a Snipara Sandbox reattach or rehydrate plan; rerun `workflow phase-start` before editing again
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
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
705
668
  - `snipara-companion workflow resume` does not snapshot or exactly restore a live Snipara Sandbox process; exact process restore remains a roadmap item
706
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
707
670
  - `snipara-companion team-sync handoff` = keeps the local handoff record and publishes the hosted handoff capsule when project auth is available
708
671
  - `snipara-companion team-sync what-changed` = prints the local state summary and the hosted What Changed For Me response when configured
709
672
  - `snipara-companion team-sync sweep` = archives stale local work items after an inactivity threshold; default is 14 days and `--dry-run` previews the cleanup
710
673
  - `snipara-companion team-sync resume` = reloads local carryover plus the hosted latest handoff and checkpoint-aware resume guidance when available
711
- - `snipara-companion final-commit` / `workflow final-commit` = closes the managed workflow locally; when Cloud is connected it also persists the final hosted handoff, otherwise it writes a local Team Sync handoff
674
+ - `snipara-companion final-commit` / `workflow final-commit` = final hosted commit for the managed workflow
712
675
  - `snipara-companion code symbol-card` = direct paid Context `snipara_code_symbol_card` for an important symbol before editing, with an agent guidance summary before raw JSON
713
676
  - `snipara-companion code impact` = direct paid Context `snipara_code_impact` for changed files, a file, or a symbol before risky changes, with risk/actions/gaps summarized before raw JSON
714
677
  - `snipara-companion doctor` = local readiness check for Snipara auth, deterministic hosted tool catalog access, Snipara Sandbox, Snipara Sandbox MCP wiring, provider keys, and Docker
@@ -725,10 +688,9 @@ Semantics:
725
688
  - `snipara-companion memory compact` = hosted compaction preview only; it always calls `snipara_memory_compact` with `dry_run=true` and never mutates memory
726
689
  - `snipara-companion reindex` = trigger or poll hosted `snipara_reindex`; use after uploads when immediate chunk availability matters
727
690
  - `snipara-companion code *` = direct access to the code graph tools without routing through `snipara_context_query`
728
- - `snipara-companion recall` = Cloud durable memory lookup when connected; otherwise local `snipara-memory` recall when installed
729
- - `snipara-companion query` = Cloud MCP context query when connected; otherwise local `snipara-memory` recall-style query when installed
730
- - `snipara-companion session-bootstrap` = Cloud durable/session memory when connected; otherwise local `snipara-memory` session bundle when installed
731
- - `snipara-companion task-commit` = hosted durable task/phase/workflow outcomes when connected; without Cloud, use local `team-sync handoff` or `final-commit` for OSS continuity
691
+ - `snipara-companion recall` = direct durable memory lookup for decisions, learnings, preferences, and carryover
692
+ - `snipara-companion session-bootstrap` = durable memory first, optional weak session carryover second
693
+ - `snipara-companion task-commit` = durable task/phase/workflow outcomes only, not a mechanical mirror of every Git commit
732
694
  - `snipara-companion memory-guard check` = forced memory/context recall before retries, commits, or finalization when a command failed or a publishable package surface is touched
733
695
  - `snipara-companion memory-guard check --intent "<action>" --destructive --strict` = contradiction check before irreversible actions; blocks until the user explicitly confirms when memory/context disagrees or the action is destructive
734
696
  - `snipara-companion memory-guard remember --guard-tag pre-commit --text "..."` = create a project/team memory in a guard category such as `pre-commit`, `commit`, `failure`, `pre-final`, or `workflow-policy`
@@ -785,6 +747,8 @@ Companion separates two concepts:
785
747
  - `git commit` is a version-control checkpoint.
786
748
  - `snipara-companion task-commit`, `workflow phase-commit`, and `final-commit` call hosted
787
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.
788
752
 
789
753
  Do not call `snipara_end_of_task_commit` mechanically for every Git commit. For risky commits,
790
754
  package releases, or retries after failures, run Memory Guard first so the agent sees relevant
@@ -895,7 +859,8 @@ or `unchanged` counts until a real sync runs.
895
859
  For release-hardening and local packaging checks:
896
860
 
897
861
  ```bash
898
- pnpm pack:smoke
862
+ pnpm --filter snipara-companion pack:smoke
863
+ pnpm --filter create-snipara pack:smoke
899
864
  ```
900
865
 
901
866
  To test a packed tarball manually, use `npm exec --package`:
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>>;
@@ -1077,50 +1236,6 @@ declare function detectReleaseSurfacesFromFiles(root: string, files: string[]):
1077
1236
  declare function getStagedFiles(root: string): string[];
1078
1237
  declare function runMemoryGuardCheck(options?: MemoryGuardCheckOptions): Promise<MemoryGuardCheckResult>;
1079
1238
 
1080
- interface GitCompanionSummaryOptions {
1081
- cwd?: string;
1082
- recentLimit?: number;
1083
- }
1084
- interface GitCompanionSummary {
1085
- version: "snipara.git_companion.v1";
1086
- generatedAt: string;
1087
- repository?: {
1088
- root: string;
1089
- branch?: string;
1090
- head?: string;
1091
- upstream?: string;
1092
- ahead?: number;
1093
- behind?: number;
1094
- };
1095
- status: {
1096
- clean: boolean;
1097
- total: number;
1098
- staged: string[];
1099
- unstaged: string[];
1100
- untracked: string[];
1101
- conflicted: string[];
1102
- lines: string[];
1103
- };
1104
- recentCommits: Array<{
1105
- sha: string;
1106
- shortSha: string;
1107
- author: string;
1108
- date: string;
1109
- subject: string;
1110
- }>;
1111
- hosted: {
1112
- status: "not_required";
1113
- note: string;
1114
- };
1115
- suggestedCommands: string[];
1116
- error?: string;
1117
- }
1118
- declare function buildGitCompanionSummary(options?: GitCompanionSummaryOptions): GitCompanionSummary;
1119
- declare function gitSummaryCommand(options: {
1120
- recent?: number;
1121
- json?: boolean;
1122
- }): Promise<void>;
1123
-
1124
1239
  interface ProjectIntelligenceBriefOptions {
1125
1240
  task?: string;
1126
1241
  branch?: string;
@@ -1135,7 +1250,6 @@ interface ProjectIntelligenceBriefOptions {
1135
1250
  interface ProjectIntelligenceBrief {
1136
1251
  version: "project-intelligence-brief-v1";
1137
1252
  generatedAt: string;
1138
- provider: "hosted" | "local";
1139
1253
  branch?: string;
1140
1254
  task?: string;
1141
1255
  changedFiles: string[];
@@ -1143,8 +1257,6 @@ interface ProjectIntelligenceBrief {
1143
1257
  resumeContext?: Record<string, unknown>;
1144
1258
  memoryHealth?: Record<string, unknown>;
1145
1259
  codeImpact?: Record<string, unknown>;
1146
- localMemory?: RecallResult;
1147
- hosted?: Record<string, unknown>;
1148
1260
  errors: Array<{
1149
1261
  surface: string;
1150
1262
  message: string;
@@ -1327,6 +1439,7 @@ interface CodeStatusCommandOptions {
1327
1439
  interface CodeSyncCommandOptions extends CodeStatusCommandOptions {
1328
1440
  commit?: string;
1329
1441
  workingTree?: boolean;
1442
+ onlyIfHead?: string;
1330
1443
  }
1331
1444
  interface CodeUploadCommandOptions extends CodeStatusCommandOptions {
1332
1445
  cached?: boolean;
@@ -1349,6 +1462,8 @@ interface CodeHooksInstallCommandOptions {
1349
1462
  dir?: string;
1350
1463
  maxFiles?: number;
1351
1464
  requestReindex?: boolean;
1465
+ reindexDelaySeconds?: number;
1466
+ synchronous?: boolean;
1352
1467
  dryRun?: boolean;
1353
1468
  json?: boolean;
1354
1469
  }
@@ -2007,6 +2122,100 @@ declare function getTeamSyncStatePath(rootDir?: string): string;
2007
2122
  declare function buildAgenticHandoffMarkdown(artifact: AgenticHandoffArtifact): string;
2008
2123
  declare function teamSyncSweepCommand(options: TeamSyncCommandOptions): Promise<void>;
2009
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
+
2010
2219
  interface JournalCheckpointPayload {
2011
2220
  action: string;
2012
2221
  summary: string;
@@ -2194,4 +2403,4 @@ interface WrittenOrchestratorHandoff {
2194
2403
  declare function buildOrchestratorHandoff(options: OrchestratorHandoffOptions): OrchestratorHandoffArtifact;
2195
2404
  declare function writeOrchestratorHandoff(options: OrchestratorHandoffOptions): WrittenOrchestratorHandoff;
2196
2405
 
2197
- 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, buildGitCompanionSummary, 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, gitSummaryCommand, 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 };