snipara-companion 1.3.8 → 1.4.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Snipara
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,31 +1,70 @@
1
1
  # snipara-companion
2
2
 
3
- **Local helper CLI for Snipara agent workflows.**
3
+ **Workflow continuity for AI coding agents. Start work, commit phases, resume anywhere.**
4
4
 
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.
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.
9
9
 
10
- In this repository, the source currently lives in `packages/cli`, and the installed executable is `snipara-companion`.
10
+ Use it as the local runtime for the open Snipara stack:
11
11
 
12
- This package complements `snipara-mcp`. It does not replace it.
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.
13
18
 
14
19
  ```mermaid
15
20
  flowchart LR
16
21
  Project["Local project"] --> Companion["snipara-companion"]
17
- Companion --> Diagnostics["status, brief, timeline, phase commits, handoff"]
18
- Companion --> Hosted["Snipara Hosted MCP / API"]
19
- Hosted --> Agents["Codex, Claude Code, Cursor, ChatGPT"]
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"]
20
26
  ```
21
27
 
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
+
22
60
  ## When To Use It
23
61
 
24
62
  | If you need... | Install... |
25
63
  | --------------------------------------------------------- | ------------------------ |
26
- | MCP tools, OAuth login, project-scoped context and memory | `snipara-mcp` |
27
- | One-command Hosted MCP + companion setup | `create-snipara` |
64
+ | Hosted MCP setup and project-scoped context | `create-snipara` |
28
65
  | 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` |
29
68
  | Production gates, drift checks, and htask orchestration | `snipara-orchestrator` |
30
69
  | OpenClaw-specific automation hooks | `snipara-openclaw-hooks` |
31
70
 
@@ -59,6 +98,20 @@ yarn global add snipara-companion
59
98
  snipara-companion
60
99
  ```
61
100
 
101
+ ## Development
102
+
103
+ ```bash
104
+ pnpm install
105
+ pnpm build
106
+ pnpm type-check
107
+ pnpm test
108
+ pnpm pack:smoke
109
+ ```
110
+
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`.
114
+
62
115
  ## New In 1.3.7
63
116
 
64
117
  - Hardens `memory-guard check` with `--confirmed-by-user "<confirmation>"`
@@ -106,6 +159,7 @@ session with `snipara-companion`:
106
159
 
107
160
  ```bash
108
161
  snipara-companion status
162
+ snipara-companion git summary
109
163
  snipara-companion brief --task "ship auth hardening" --changed-files src/auth.ts
110
164
  snipara-companion timeline
111
165
  snipara-companion workflow phase-commit build --summary "tests green"
@@ -116,6 +170,8 @@ snipara-companion workflow resume --include-session-context
116
170
 
117
171
  - `status` is the Git-style local work status: workflow phase, latest phase
118
172
  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.
119
175
  - `brief` is the short alias for `intelligence brief`.
120
176
  - `timeline` is the Git-style log for workflow starts, phase starts, phase
121
177
  commits, final commits, and Team Sync handoffs.
@@ -140,9 +196,11 @@ The mental model is intentionally close to Git:
140
196
  API only for the final Team Sync handoff. The CLI sends a compact summary with a
141
197
  longer timeout, retries once with a shorter summary on transient hosted failures,
142
198
  and then records a local fallback handoff in `.snipara/team-sync/session.json`
143
- if the hosted call still times out. A hosted final-commit timeout does not modify
144
- Git state. Custom final-commit categories are namespaced under `final-commit`
145
- before the hosted call so they stay on the handoff-only path.
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.
146
204
 
147
205
  ## Verification Plans
148
206
 
@@ -633,6 +691,7 @@ Semantics:
633
691
  - `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
634
692
  - `snipara-companion workflow run` = suggests Snipara Sandbox when the query calls for validation, execution, data transforms, or heavier FULL/orchestrated work
635
693
  - `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
636
695
  - `snipara-companion brief` = short alias for `snipara-companion intelligence brief`
637
696
  - `snipara-companion timeline` = local timeline of workflow starts, phase starts, phase commits, final commits, and Team Sync handoffs
638
697
  - `snipara-companion handoff` = top-level agent-ready Markdown/JSON handoff artifact plus the same local/hosted Team Sync handoff persistence
@@ -641,15 +700,15 @@ Semantics:
641
700
  - `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
642
701
  - `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
643
702
  - `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
644
- - `snipara-companion workflow phase-commit` = calls hosted `snipara_end_of_task_commit` for that phase, updates local state, and advances the next phase
645
- - `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
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
646
705
  - `snipara-companion workflow resume` does not snapshot or exactly restore a live Snipara Sandbox process; exact process restore remains a roadmap item
647
706
  - `snipara-companion team-sync start-work` = keeps the local session file and fetches the hosted Start Work Brief when the workspace has project auth
648
707
  - `snipara-companion team-sync handoff` = keeps the local handoff record and publishes the hosted handoff capsule when project auth is available
649
708
  - `snipara-companion team-sync what-changed` = prints the local state summary and the hosted What Changed For Me response when configured
650
709
  - `snipara-companion team-sync sweep` = archives stale local work items after an inactivity threshold; default is 14 days and `--dry-run` previews the cleanup
651
710
  - `snipara-companion team-sync resume` = reloads local carryover plus the hosted latest handoff and checkpoint-aware resume guidance when available
652
- - `snipara-companion final-commit` / `workflow final-commit` = final hosted commit for the managed workflow
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
653
712
  - `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
654
713
  - `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
655
714
  - `snipara-companion doctor` = local readiness check for Snipara auth, deterministic hosted tool catalog access, Snipara Sandbox, Snipara Sandbox MCP wiring, provider keys, and Docker
@@ -666,9 +725,10 @@ Semantics:
666
725
  - `snipara-companion memory compact` = hosted compaction preview only; it always calls `snipara_memory_compact` with `dry_run=true` and never mutates memory
667
726
  - `snipara-companion reindex` = trigger or poll hosted `snipara_reindex`; use after uploads when immediate chunk availability matters
668
727
  - `snipara-companion code *` = direct access to the code graph tools without routing through `snipara_context_query`
669
- - `snipara-companion recall` = direct durable memory lookup for decisions, learnings, preferences, and carryover
670
- - `snipara-companion session-bootstrap` = durable memory first, optional weak session carryover second
671
- - `snipara-companion task-commit` = durable task/phase/workflow outcomes only, not a mechanical mirror of every Git commit
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
672
732
  - `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
673
733
  - `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
674
734
  - `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`
@@ -835,8 +895,7 @@ or `unchanged` counts until a real sync runs.
835
895
  For release-hardening and local packaging checks:
836
896
 
837
897
  ```bash
838
- pnpm --filter snipara-companion pack:smoke
839
- pnpm --filter create-snipara pack:smoke
898
+ pnpm pack:smoke
840
899
  ```
841
900
 
842
901
  To test a packed tarball manually, use `npm exec --package`:
package/dist/index.d.ts CHANGED
@@ -1077,6 +1077,50 @@ declare function detectReleaseSurfacesFromFiles(root: string, files: string[]):
1077
1077
  declare function getStagedFiles(root: string): string[];
1078
1078
  declare function runMemoryGuardCheck(options?: MemoryGuardCheckOptions): Promise<MemoryGuardCheckResult>;
1079
1079
 
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
+
1080
1124
  interface ProjectIntelligenceBriefOptions {
1081
1125
  task?: string;
1082
1126
  branch?: string;
@@ -1091,6 +1135,7 @@ interface ProjectIntelligenceBriefOptions {
1091
1135
  interface ProjectIntelligenceBrief {
1092
1136
  version: "project-intelligence-brief-v1";
1093
1137
  generatedAt: string;
1138
+ provider: "hosted" | "local";
1094
1139
  branch?: string;
1095
1140
  task?: string;
1096
1141
  changedFiles: string[];
@@ -1098,6 +1143,8 @@ interface ProjectIntelligenceBrief {
1098
1143
  resumeContext?: Record<string, unknown>;
1099
1144
  memoryHealth?: Record<string, unknown>;
1100
1145
  codeImpact?: Record<string, unknown>;
1146
+ localMemory?: RecallResult;
1147
+ hosted?: Record<string, unknown>;
1101
1148
  errors: Array<{
1102
1149
  surface: string;
1103
1150
  message: string;
@@ -2147,4 +2194,4 @@ interface WrittenOrchestratorHandoff {
2147
2194
  declare function buildOrchestratorHandoff(options: OrchestratorHandoffOptions): OrchestratorHandoffArtifact;
2148
2195
  declare function writeOrchestratorHandoff(options: OrchestratorHandoffOptions): WrittenOrchestratorHandoff;
2149
2196
 
2150
- 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 };
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 };