create-snipara 1.3.9 → 1.3.11

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.
Files changed (3) hide show
  1. package/README.md +42 -20
  2. package/dist/index.js +66 -22
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -48,9 +48,9 @@ The product surfaces remain:
48
48
  - Hosted MCP for LLM agents, context, and reviewed memory
49
49
  - HTTP API / SDK for apps, integrators, backends, and pipelines
50
50
 
51
- The CLI can wire local helpers around those surfaces:
51
+ The default CLI path wires the local companion around those surfaces:
52
52
 
53
- - `snipara-companion` for local `rlm-hook` workflows when you want them
53
+ - `snipara-companion` for local `rlm-hook` workflows and managed phase commits
54
54
  - `rlm-runtime` for optional local code execution
55
55
  - local config, env files, hook scripts, and a project companion pack
56
56
  - `snipara-mcp` only for local stdio compatibility, development, or testing
@@ -61,12 +61,12 @@ The CLI now works around explicit install profiles:
61
61
 
62
62
  | Profile | What it installs | Best for |
63
63
  | ------------------ | ----------------------------------------- | --------------------------------------------------- |
64
- | `hosted-only` | Hosted MCP config only | Default: agents without local helper workflows |
65
- | `hosted-companion` | MCP + `snipara-companion` | Hook-heavy clients that want local helper workflows |
66
- | `full-stack` | MCP + `snipara-companion` + `rlm-runtime` | Hosted context plus local execution |
64
+ | `hosted-companion` | MCP + `snipara-companion` | Default: hosted context plus managed local workflow |
65
+ | `hosted-only` | Hosted MCP config only | Locked-down or minimal environments |
66
+ | `full-stack` | MCP + `snipara-companion` + `rlm-runtime` | Hosted context plus sandboxed local execution |
67
67
  | `runtime-only` | `rlm-runtime` only | Local execution without hosted API |
68
68
 
69
- Default profile: `hosted-only`
69
+ Default profile: `hosted-companion`
70
70
 
71
71
  ## Free Account Fit
72
72
 
@@ -99,10 +99,10 @@ That distinction matters:
99
99
  - opens the browser device-flow free Context + Memory account flow when needed
100
100
  - writes Hosted MCP configuration
101
101
  - detects a GitHub remote and can open the Snipara GitHub App automation path
102
- - installs `snipara-companion` when the selected profile needs local helper workflows
102
+ - installs `snipara-companion` by default for local managed workflows
103
103
  - installs optional `rlm-runtime`
104
104
  - configures `.mcp.json`
105
- - generates merge-ready AI agent templates in `.snipara/templates/`, including Pro+ symbol-card and code-impact guidance for paid Context plans
105
+ - generates merge-ready AI agent templates in `.snipara/templates/`, including Pro+ symbol-card, code-impact, and managed workflow guidance for paid Context plans
106
106
  - creates `AGENTS.md`, `CLAUDE.md`, `.cursor/rules/snipara.mdc`, and `.codex/config.toml` when those files do not already exist
107
107
  - updates `.env`, `.env.local`, and `.env.example`
108
108
  - generates `.snipara/companion/README.md`
@@ -134,9 +134,10 @@ The interactive flow now asks for:
134
134
  - API key path: project key, team key, free signup, or add key later
135
135
  - AI client
136
136
 
137
- By default, this stays on the recommended `hosted-only` setup. Add
138
- `--advanced` when you want profile selection, project id entry, hook prompts,
139
- GitHub automation prompts, or runtime provider prompts.
137
+ By default, this uses the recommended `hosted-companion` setup: hosted MCP plus
138
+ the local `rlm-hook` workflow helper. Add `--advanced` when you want profile
139
+ selection, project id entry, hook prompts, GitHub automation prompts, or runtime
140
+ provider prompts.
140
141
 
141
142
  The advanced flow asks for:
142
143
 
@@ -154,6 +155,17 @@ The generated agent templates cover:
154
155
  - Codex `.codex/config.toml` snippet
155
156
  - ChatGPT/OpenAI HTTP MCP snippet
156
157
 
158
+ When `snipara-companion` is installed, the companion pack also includes the compaction-safe managed workflow:
159
+
160
+ ```bash
161
+ rlm-hook workflow start --goal "ship auth hardening" --plan-file ./plan.md
162
+ rlm-hook workflow phase-start context
163
+ rlm-hook workflow run --mode full --include-session-context --query "load auth context"
164
+ rlm-hook code impact --changed-files src/auth.ts tests/auth.test.ts --diff-summary "auth hardening"
165
+ rlm-hook workflow phase-commit context --summary "Loaded context and mapped impacted files" --files src/auth.ts
166
+ rlm-hook final-commit --summary "Shipped auth hardening and tests" --files src/auth.ts tests/auth.test.ts
167
+ ```
168
+
157
169
  ## Main Commands
158
170
 
159
171
  ### Install or initialize
@@ -247,8 +259,8 @@ That keeps business truth review separate from agent onboarding.
247
259
 
248
260
  ```bash
249
261
  # Use an explicit install profile
250
- npx create-snipara --profile hosted-only
251
262
  npx create-snipara --profile hosted-companion
263
+ npx create-snipara --profile hosted-only
252
264
  npx create-snipara --profile full-stack
253
265
  npx create-snipara --advanced
254
266
 
@@ -271,6 +283,7 @@ npx create-snipara --skip-github
271
283
 
272
284
  # Force extra layers during maintenance
273
285
  npx create-snipara repair --with-hooks
286
+ npx create-snipara repair --with-runtime
274
287
  npx create-snipara upgrade --with-runtime
275
288
  ```
276
289
 
@@ -279,18 +292,19 @@ npx create-snipara upgrade --with-runtime
279
292
  The intended split is:
280
293
 
281
294
  - `create-snipara`: Context + Memory onboarding, auth, config, inspect, repair, and upgrade
282
- - `snipara-companion`: optional ongoing local runtime workflows through `rlm-hook`
295
+ - `snipara-companion`: default local workflow helper through `rlm-hook`; optional only for `hosted-only`
283
296
  - `snipara-mcp`: local stdio bridge, client-package development, compatibility, and testing
284
297
  - `rlm-runtime`: optional local execution engine
285
298
 
286
299
  ## Codex Setup
287
300
 
288
- For Codex, keep the setup minimal:
301
+ For Codex, keep Hosted MCP as the core path and let companion add workflow
302
+ ergonomics:
289
303
 
290
304
  - use Hosted MCP as the core Snipara surface
291
305
  - use `AGENTS.md` for project instructions
292
- - choose `hosted-only` if you do not need local helper workflows
293
- - add `snipara-companion` only if you explicitly want the local helper CLI
306
+ - use the default `hosted-companion` path when you want compaction-safe local phase commits
307
+ - choose `hosted-only` or `--skip-companion` only in locked-down environments
294
308
  - use local `snipara-mcp` only for stdio compatibility, development, or tests
295
309
 
296
310
  Codex does not require hook presets to use Snipara successfully.
@@ -352,13 +366,21 @@ Recommended explanation to users:
352
366
 
353
367
  ## Example Flows
354
368
 
355
- ### Default hosted setup
369
+ ### Default managed hosted setup
370
+
371
+ ```bash
372
+ npx create-snipara
373
+ ```
374
+
375
+ Best when the user wants Hosted MCP Context + Memory plus `rlm-hook` managed workflows.
376
+
377
+ ### Minimal hosted setup
356
378
 
357
379
  ```bash
358
380
  npx create-snipara --profile hosted-only
359
381
  ```
360
382
 
361
- Best when the user only wants Hosted MCP Context + Memory.
383
+ Best when the user only wants Hosted MCP Context + Memory and cannot install local helper tooling.
362
384
 
363
385
  ### Full local stack
364
386
 
@@ -366,7 +388,7 @@ Best when the user only wants Hosted MCP Context + Memory.
366
388
  npx create-snipara --profile full-stack --advanced
367
389
  ```
368
390
 
369
- Best when the user also wants `snipara-companion` and `rlm-runtime`.
391
+ Best when the user also wants sandboxed `rlm-runtime` execution.
370
392
 
371
393
  ### Connect the current repository
372
394
 
@@ -411,7 +433,7 @@ npx create-snipara print-config --json
411
433
  When testing a locally packed tarball, use `npm exec --package` instead of `npx`, for example:
412
434
 
413
435
  ```bash
414
- npm exec --package ./create-snipara-1.3.9.tgz create-snipara -- --help
436
+ npm exec --package ./create-snipara-1.3.11.tgz create-snipara -- --help
415
437
  ```
416
438
 
417
439
  This avoids `npx` resolution issues with unpublished tarballs.
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import fs from "fs";
9
9
  import path from "path";
10
10
  import { execSync, spawn } from "child_process";
11
11
  import { homedir } from "os";
12
- var VERSION = "1.3.9";
12
+ var VERSION = "1.3.11";
13
13
  var BASE_URL = "https://www.snipara.com";
14
14
  var API_URL = "https://api.snipara.com";
15
15
  var COMPANION_PACKAGE_NAME = "snipara-companion";
@@ -26,7 +26,7 @@ function getCompanionInitClientFlag(aiClient) {
26
26
  }
27
27
  function buildProgram() {
28
28
  const program = new Command();
29
- program.name("create-snipara").description("Scaffold hosted Snipara MCP config plus optional local helper workflows").version(VERSION);
29
+ program.name("create-snipara").description("Scaffold hosted Snipara MCP config plus companion workflow helpers").version(VERSION);
30
30
  program.command("init").description("Install and configure Snipara for this project").option("--api-key <key>", "Snipara project API key").option("--team-key <key>", "Snipara team API key").option("--slug <slug>", "Project slug").option("--project-id <id>", "Project ID").option("--advanced", "Show advanced profile, project id, hooks, GitHub, and runtime prompts").option(
31
31
  "--profile <profile>",
32
32
  "Install profile: hosted-only, hosted-companion, full-stack, runtime-only"
@@ -483,27 +483,27 @@ function resolveRequestedProfile(options) {
483
483
  if (options.profile && isInstallProfile(options.profile)) {
484
484
  return options.profile;
485
485
  }
486
- return "hosted-only";
486
+ return "hosted-companion";
487
487
  }
488
488
  function isInstallProfile(value) {
489
489
  return ["hosted-only", "hosted-companion", "full-stack", "runtime-only"].includes(value);
490
490
  }
491
491
  function installProfileChoices() {
492
492
  return [
493
- {
494
- title: "Hosted only",
495
- value: "hosted-only",
496
- description: "Default: hosted MCP config, no local companion or runtime"
497
- },
498
493
  {
499
494
  title: "Hosted + Companion",
500
495
  value: "hosted-companion",
501
- description: "Hosted MCP config plus optional local companion workflows"
496
+ description: "Default: hosted MCP config plus managed local workflow commands"
497
+ },
498
+ {
499
+ title: "Hosted only",
500
+ value: "hosted-only",
501
+ description: "Minimal setup: hosted MCP config, no local companion or runtime"
502
502
  },
503
503
  {
504
504
  title: "Hosted + Companion + Runtime",
505
505
  value: "full-stack",
506
- description: "Add local runtime execution as well"
506
+ description: "Add sandboxed local runtime execution as well"
507
507
  },
508
508
  {
509
509
  title: "Runtime only",
@@ -898,11 +898,15 @@ Agent task lifecycle:
898
898
  5. Use \`rlm_code_callers\`, \`rlm_code_imports\`, \`rlm_code_neighbors\`, or \`rlm_code_shortest_path\` for structural code questions.
899
899
  6. On paid Context plans, use \`rlm_code_symbol_card\` for agent-ready symbol context and \`rlm_code_impact\` before risky multi-file changes or PR reviews.
900
900
  7. Use \`rlm_plan\` or \`rlm_decompose\` only for complex work and only when the hosted server exposes them.
901
- 8. Use local file reads, \`rg\`, git commands, and test commands for exact edits, current working-tree state, and verification.
902
- 9. Use RLM Runtime only when sandboxed execution, repeatable validation, or isolated transformations materially help.
903
- 10. If a broad query is slow, retry once with a narrow keyword query before falling back to local search.
904
- 11. End substantial work with \`rlm_end_of_task_commit\` when available. Use \`rlm_remember_if_novel\` for one reusable memory while avoiding duplicates, and use \`rlm_remember\` for explicit direct memory writes.
905
- 12. Do not store secrets, tokens, passwords, private keys, raw logs, transient command output, or unreviewed guesses in memory.
901
+ 8. When the LLM has produced a visible multi-phase plan and \`snipara-companion\` is installed, run \`rlm-hook workflow start --goal "<goal>" --plan-file <plan_file>\`, then use \`workflow phase-start\`, \`workflow phase-commit\`, \`workflow resume\`, and \`final-commit\` so compaction cannot lose the next phase.
902
+ 9. Use local file reads, \`rg\`, git commands, and test commands for exact edits, current working-tree state, and verification.
903
+ 10. Treat every \`rlm_code_*\` response as indexed context: check its indexed commit SHA, indexing time, included file sample, coverage, freshness warnings, and sync guidance before relying on it.
904
+ 11. If \`git status --short\` is dirty, warn that Snipara's indexed code graph may not include local edits; use local reads/tests for exact edits and Snipara for architecture/code graph context.
905
+ 12. Use RLM Runtime only when sandboxed execution, repeatable validation, or isolated transformations materially help.
906
+ 13. If a broad query is slow, retry once with a narrow keyword query before falling back to local search.
907
+ 14. End each substantial phase with \`rlm_end_of_task_commit\` or \`rlm-hook workflow phase-commit\` when companion manages the plan. End the whole managed workflow with \`rlm-hook final-commit\`.
908
+ 15. Use \`rlm_remember_if_novel\` for one reusable memory while avoiding duplicates, and use \`rlm_remember\` for explicit direct memory writes.
909
+ 16. Do not store secrets, tokens, passwords, private keys, raw logs, transient command output, or unreviewed guesses in memory.
906
910
  `;
907
911
  }
908
912
  function buildClaudeMdTemplate(answers) {
@@ -920,8 +924,12 @@ Use Snipara Hosted MCP before answering project-specific questions.
920
924
  - When \`rlm_context_query\` returns \`answer_pack\`, use its facts, caveats, source map, and verification checklist before drafting claims.
921
925
  - Use \`rlm_code_callers\`, \`rlm_code_imports\`, \`rlm_code_neighbors\`, or \`rlm_code_shortest_path\` for structural code questions.
922
926
  - On paid Context plans, use \`rlm_code_symbol_card\` before editing important symbols and \`rlm_code_impact\` before risky multi-file changes or PR reviews.
927
+ - Check every \`rlm_code_*\` response for indexed commit SHA, indexing time, included files, coverage, and freshness warnings.
928
+ - Use local file reads, \`rg\`, \`git status --short\`, and tests for exact edits/current working tree; use Snipara for architecture and indexed code graph context.
929
+ - When the plan is visible and \`snipara-companion\` is installed, use \`rlm-hook workflow start\`, \`phase-start\`, \`phase-commit\`, \`workflow resume\`, and \`final-commit\` to keep phase state durable across compaction.
923
930
  - Use RLM Runtime only when sandboxed execution or repeatable validation materially helps.
924
- - End substantial work with \`rlm_end_of_task_commit\` when available; use \`rlm_remember_if_novel\` or \`rlm_remember\` only for narrow durable memories.
931
+ - End substantial work with \`rlm_end_of_task_commit\` when available; for managed workflows, end every phase with \`rlm-hook workflow phase-commit\` and the task with \`rlm-hook final-commit\`.
932
+ - Use \`rlm_remember_if_novel\` or \`rlm_remember\` only for narrow durable memories.
925
933
  - Do not store secrets, one-off command output, raw logs, or unreviewed guesses in memory.
926
934
  - Use the Snipara Claude Code plugin only when slash commands, skills, or hooks are helpful; Hosted MCP remains the normal agent path.
927
935
  `;
@@ -944,10 +952,12 @@ This workspace uses Snipara Hosted MCP for current project context, business/cli
944
952
  - Use \`rlm_get_chunk\` before relying on exact cited wording from reference-based results.
945
953
  - Use \`rlm_code_callers\`, \`rlm_code_imports\`, \`rlm_code_neighbors\`, or \`rlm_code_shortest_path\` for structural code questions.
946
954
  - On paid Context plans, use \`rlm_code_symbol_card\` before editing important symbols and \`rlm_code_impact\` before risky multi-file changes or PR reviews.
955
+ - Check every \`rlm_code_*\` response for indexed commit SHA, indexing time, included files, coverage, and freshness warnings.
947
956
  - Use \`rlm_plan\` or \`rlm_decompose\` only for complex work and only when available.
948
- - Use local file reads and tests for exact code edits and current working-tree state.
957
+ - Use local file reads, \`rg\`, \`git status --short\`, and tests for exact code edits and current working-tree state.
958
+ - When \`snipara-companion\` is installed and the LLM has a visible multi-phase plan, use \`rlm-hook workflow start\`, \`phase-start\`, \`phase-commit\`, \`workflow resume\`, and \`final-commit\` so the next phase survives compaction.
949
959
  - Use RLM Runtime only when sandboxed execution or repeatable validation materially helps.
950
- - End substantial work with \`rlm_end_of_task_commit\` when available; use \`rlm_remember_if_novel\` or \`rlm_remember\` only for narrow durable memories. Never store secrets.
960
+ - End substantial work with \`rlm_end_of_task_commit\` when available; for managed workflows, end every phase with \`rlm-hook workflow phase-commit\` and the task with \`rlm-hook final-commit\`. Use \`rlm_remember_if_novel\` or \`rlm_remember\` only for narrow durable memories. Never store secrets.
951
961
  `;
952
962
  }
953
963
  function buildCodexConfigTemplate(answers) {
@@ -1108,7 +1118,11 @@ export SNIPARA_PROJECT_SLUG="${answers.projectSlug}"
1108
1118
  ${answers.projectId ? `export SNIPARA_PROJECT_ID="${answers.projectId}"` : ""}
1109
1119
 
1110
1120
  if command -v rlm-hook >/dev/null 2>&1; then
1111
- rlm-hook session-bootstrap || true
1121
+ if [ -f ".snipara/workflow/current.json" ]; then
1122
+ rlm-hook workflow resume --include-session-context || true
1123
+ else
1124
+ rlm-hook session-bootstrap || true
1125
+ fi
1112
1126
  fi
1113
1127
  `;
1114
1128
  }
@@ -1132,7 +1146,11 @@ export SNIPARA_PROJECT_SLUG="${answers.projectSlug}"
1132
1146
  ${answers.projectId ? `export SNIPARA_PROJECT_ID="${answers.projectId}"` : ""}
1133
1147
 
1134
1148
  if command -v rlm-hook >/dev/null 2>&1; then
1135
- rlm-hook task-commit --summary "Claude Code compacted local session context" --outcome partial || true
1149
+ if [ -f ".snipara/workflow/current.json" ]; then
1150
+ rlm-hook task-commit --summary "Claude Code compacted while a managed workflow state existed. Resume with rlm-hook workflow resume --include-session-context and continue from .snipara/workflow/current.json." --category workflow-compaction --outcome partial || true
1151
+ else
1152
+ rlm-hook task-commit --summary "Claude Code compacted local session context" --outcome partial || true
1153
+ fi
1136
1154
  fi
1137
1155
  `;
1138
1156
  }
@@ -1281,6 +1299,21 @@ function getCompanionCommands(answers) {
1281
1299
  command: 'rlm-hook plan --query "Implement webhook retry hardening" --max-tokens 3000',
1282
1300
  purpose: "Produce a structured execution plan against indexed project knowledge."
1283
1301
  },
1302
+ {
1303
+ title: "Start a managed workflow from the visible plan",
1304
+ command: 'rlm-hook workflow start --goal "Implement webhook retry hardening" --plan-file ./plan.md',
1305
+ purpose: "Record the LLM-visible plan in .snipara/workflow/current.json so phase state survives compaction."
1306
+ },
1307
+ {
1308
+ title: "Start the current workflow phase",
1309
+ command: "rlm-hook workflow phase-start context",
1310
+ purpose: "Mark a phase active and print the required Snipara context gate for the agent."
1311
+ },
1312
+ {
1313
+ title: "Analyze code impact before a risky change",
1314
+ command: 'rlm-hook code impact --changed-files src/api/webhooks.ts tests/webhooks.test.ts --diff-summary "webhook retry hardening"',
1315
+ purpose: "Use paid Context code impact analysis to surface likely tests, docs, routes, config, and risks."
1316
+ },
1284
1317
  {
1285
1318
  title: "Upload or refresh a doc",
1286
1319
  command: "rlm-hook upload --path docs/local-playbook.md --file ./docs/local-playbook.md",
@@ -1306,6 +1339,16 @@ function getCompanionCommands(answers) {
1306
1339
  title: "Commit durable task memory",
1307
1340
  command: 'rlm-hook task-commit --summary "Hardened webhook retries and updated tests" --category engineering --outcome completed --files src/api/webhooks.ts tests/webhooks.test.ts',
1308
1341
  purpose: "Persist reusable outcomes back into hosted memory after the work is done."
1342
+ },
1343
+ {
1344
+ title: "Commit a managed workflow phase",
1345
+ command: 'rlm-hook workflow phase-commit context --summary "Loaded context and mapped impacted files" --files src/api/webhooks.ts tests/webhooks.test.ts',
1346
+ purpose: "Persist this phase through hosted memory and advance the local managed workflow state."
1347
+ },
1348
+ {
1349
+ title: "Commit the final managed workflow result",
1350
+ command: 'rlm-hook final-commit --summary "Shipped webhook retry hardening and tests" --files src/api/webhooks.ts tests/webhooks.test.ts',
1351
+ purpose: "Persist the final workflow outcome and close the managed workflow after verification."
1309
1352
  }
1310
1353
  ];
1311
1354
  }
@@ -1318,7 +1361,7 @@ async function createCompanionPack(answers) {
1318
1361
  fs.mkdirSync(packDir, { recursive: true });
1319
1362
  const readme = `# Snipara Companion Pack
1320
1363
 
1321
- This project uses Snipara as a hosted-first context and memory layer with an optional local companion CLI.
1364
+ This project uses Snipara as a hosted-first context and memory layer with local companion workflow helpers.
1322
1365
 
1323
1366
  ## Install Profile
1324
1367
 
@@ -1384,6 +1427,7 @@ ${item.purpose}`
1384
1427
 
1385
1428
  - Context first: use hosted queries, shared-context, and document loads for source truth.
1386
1429
  - Memory second: use session bootstrap and task commit for durable decisions, learnings, and preferences.
1430
+ - Managed workflow when a visible plan exists: \`workflow start\`, \`phase-start\`, \`phase-commit\`, \`workflow resume\`, and \`final-commit\` keep phase state durable across compaction.
1387
1431
  - Durable memory, policy, and orchestration stay hosted in Snipara.
1388
1432
  - The local companion is optional tooling for capture, bootstrap, upload, exploration, doctor, repair, and explicit task summaries.
1389
1433
  `;
@@ -1832,7 +1876,7 @@ function resolveMaintenanceProfile(detection, explicitProfile) {
1832
1876
  if (detection.existingConfig.hasSniparaServer) {
1833
1877
  return "hosted-only";
1834
1878
  }
1835
- return "hosted-only";
1879
+ return "hosted-companion";
1836
1880
  }
1837
1881
  function readApiKeyFromEnvFiles() {
1838
1882
  const candidates = [".env.local", ".env"];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-snipara",
3
- "version": "1.3.9",
4
- "description": "Onboard Snipara Hosted MCP Context + Memory with auth plus optional local helper and runtime workflows",
3
+ "version": "1.3.11",
4
+ "description": "Onboard Snipara Hosted MCP Context + Memory with auth, companion workflows, and optional runtime",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
7
7
  "bin": {