create-snipara 1.3.47 → 1.3.49

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 +14 -4
  2. package/dist/index.js +117 -16
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,7 +12,8 @@ npx create-snipara
12
12
 
13
13
  `create-snipara` is the simple onboarding package for the agent path. It
14
14
  creates or reuses auth, writes Hosted MCP config, and prepares the local project
15
- so an LLM client can use Snipara context and reviewed memory.
15
+ so an LLM client can use Snipara context and reviewed memory. Install once with
16
+ `create-snipara`; continue every session with `snipara-companion`.
16
17
 
17
18
  Use it for:
18
19
 
@@ -50,7 +51,8 @@ The product surfaces remain:
50
51
 
51
52
  The default CLI path wires the local companion around those surfaces:
52
53
 
53
- - `snipara-companion` for local workflow commands and managed phase commits
54
+ - `snipara-companion` for Git-style status, briefs, timelines, phase commits,
55
+ handoffs, resume, and local workflow commands
54
56
  - `snipara-sandbox` for optional local code execution
55
57
  - `snipara-orchestrator` only when explicitly requested with `--with-orchestrator`
56
58
  - local config, env files, hook scripts, and a project companion pack
@@ -101,7 +103,8 @@ That distinction matters:
101
103
  - writes Hosted MCP configuration
102
104
  - detects a GitHub remote and can open the Snipara GitHub App automation path
103
105
  - explains the GitHub PR Answer Packs path for AI-assisted pull request workflows
104
- - installs `snipara-companion` by default for local managed workflows
106
+ - installs `snipara-companion` by default for local status, briefs, timelines,
107
+ phase commits, handoffs, resume, and managed workflows
105
108
  - installs optional `snipara-sandbox`
106
109
  - installs optional `snipara-orchestrator` for proof gates, drift checks, and htask workflows when requested
107
110
  - configures `.mcp.json`
@@ -178,14 +181,21 @@ Existing root `AGENTS.md` and `CLAUDE.md` files are not replaced. The installer
178
181
  adds or refreshes a marked Snipara section so project-specific instructions stay
179
182
  intact.
180
183
 
181
- When `snipara-companion` is installed, the companion pack also includes the compaction-safe managed workflow. Keep the machine plan in JSON for stable phase ids; an optional Markdown file can remain the human-facing contract.
184
+ When `snipara-companion` is installed, the companion pack also includes the
185
+ compaction-safe managed workflow and Git-style agent work commands. Keep the
186
+ machine plan in JSON for stable phase ids; an optional Markdown file can remain
187
+ the human-facing contract.
182
188
 
183
189
  ```bash
190
+ snipara-companion status
191
+ snipara-companion brief --task "ship auth hardening" --changed-files src/auth.ts
184
192
  snipara-companion workflow start --goal "ship auth hardening" --plan-file ./plan.json
185
193
  snipara-companion workflow phase-start context
186
194
  snipara-companion workflow run --mode full --include-session-context --query "load auth context"
187
195
  snipara-companion code impact --changed-files src/auth.ts tests/auth.test.ts --diff-summary "auth hardening"
188
196
  snipara-companion workflow phase-commit context --summary "Loaded context and mapped impacted files" --files src/auth.ts
197
+ snipara-companion timeline
198
+ snipara-companion handoff --summary "auth context mapped" --next "implement auth hardening"
189
199
  snipara-companion workflow resume --include-session-context
190
200
  snipara-companion workflow phase-start implementation
191
201
  snipara-companion workflow run --mode full --include-session-context --query "implement auth hardening"
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import { homedir } from "os";
13
13
  // package.json
14
14
  var package_default = {
15
15
  name: "create-snipara",
16
- version: "1.3.47",
16
+ version: "1.3.49",
17
17
  description: "Onboard Snipara Hosted MCP Context + Memory with auth, companion workflows, and optional Snipara Sandbox",
18
18
  main: "dist/index.js",
19
19
  type: "module",
@@ -90,7 +90,7 @@ var API_URL = "https://api.snipara.com";
90
90
  var COMPANION_PACKAGE_NAME = "snipara-companion";
91
91
  var COMPANION_COMMAND_NAME = "snipara-companion";
92
92
  var COMPANION_NPX_COMMAND = "npx -y snipara-companion@latest";
93
- var MIN_COMPANION_VERSION = "1.1.37";
93
+ var MIN_COMPANION_VERSION = "1.3.0";
94
94
  var GITHUB_ANSWER_PACKS_LABEL = "GitHub PR Answer Packs";
95
95
  var MCP_PACKAGE_NAME = "snipara-mcp";
96
96
  var SANDBOX_PACKAGE_NAME = "snipara-sandbox[all]";
@@ -248,6 +248,58 @@ function normalizeInitOptions(options) {
248
248
  }
249
249
  return normalized;
250
250
  }
251
+ function normalizeMaintenanceOptions(options) {
252
+ const parsed = parseMaintenanceOptionsFromArgv(process.argv.slice(2));
253
+ const normalized = { ...parsed };
254
+ for (const [key, value] of Object.entries(options)) {
255
+ if (value !== void 0) {
256
+ normalized[key] = value;
257
+ }
258
+ }
259
+ return normalized;
260
+ }
261
+ function parseMaintenanceOptionsFromArgv(args) {
262
+ const parsed = {};
263
+ const valueFlags = {
264
+ "--api-key": "apiKey",
265
+ "--slug": "slug",
266
+ "--project-id": "projectId",
267
+ "--profile": "profile",
268
+ "--client": "client"
269
+ };
270
+ const booleanFlags = {
271
+ "--skip-npm-check": "skipNpmCheck",
272
+ "--with-hooks": "withHooks",
273
+ "--with-runtime": "withRuntime",
274
+ "--with-mcp": "withMcp",
275
+ "--with-companion": "withCompanion",
276
+ "--with-orchestrator": "withOrchestrator",
277
+ "--json": "json"
278
+ };
279
+ for (let index = 0; index < args.length; index += 1) {
280
+ const arg = args[index];
281
+ if (!arg.startsWith("-")) {
282
+ continue;
283
+ }
284
+ const [flag, inlineValue] = arg.split("=", 2);
285
+ const valueKey = valueFlags[flag];
286
+ if (valueKey) {
287
+ const value = inlineValue ?? args[index + 1];
288
+ if (value !== void 0 && !value.startsWith("-")) {
289
+ parsed[valueKey] = value;
290
+ if (inlineValue === void 0) {
291
+ index += 1;
292
+ }
293
+ }
294
+ continue;
295
+ }
296
+ const booleanKey = booleanFlags[flag];
297
+ if (booleanKey) {
298
+ parsed[booleanKey] = true;
299
+ }
300
+ }
301
+ return parsed;
302
+ }
251
303
  function parseInitOptionsFromArgv(args) {
252
304
  const parsed = {};
253
305
  const valueFlags = {
@@ -331,18 +383,19 @@ async function runInit(options) {
331
383
  }
332
384
  }
333
385
  async function runDoctor(options) {
334
- const requestedClient = normalizeClientOption(options.client);
335
- const existingAnswers = loadExistingAnswers(options);
386
+ const normalizedOptions = normalizeMaintenanceOptions(options);
387
+ const requestedClient = normalizeClientOption(normalizedOptions.client);
388
+ const existingAnswers = loadExistingAnswers(normalizedOptions);
336
389
  const answers = {
337
390
  ...existingAnswers,
338
391
  aiClient: requestedClient || existingAnswers.aiClient
339
392
  };
340
393
  const report = await runValidation(answers, true, {
341
394
  client: requestedClient || answers.aiClient,
342
- includeNpmFreshness: !options.skipNpmCheck
395
+ includeNpmFreshness: !normalizedOptions.skipNpmCheck
343
396
  });
344
397
  writeDoctorReport(report);
345
- if (options.json) {
398
+ if (normalizedOptions.json) {
346
399
  console.log(JSON.stringify({ detection: detectEnvironment(), validation: report }, null, 2));
347
400
  return;
348
401
  }
@@ -1723,7 +1776,7 @@ async function installClaudeCodeHooks(answers) {
1723
1776
  {
1724
1777
  event: "PreToolUse",
1725
1778
  entry: {
1726
- matcher: "Bash|Read|Grep|Glob|Edit|MultiEdit|Write",
1779
+ matcher: "Bash|Read|Grep|Glob|Edit|MultiEdit|Write|mcp__.*",
1727
1780
  hooks: [
1728
1781
  {
1729
1782
  type: "command",
@@ -1749,7 +1802,7 @@ async function installClaudeCodeHooks(answers) {
1749
1802
  {
1750
1803
  event: "PostToolUse",
1751
1804
  entry: {
1752
- matcher: "Bash|Read|Grep|Glob|Edit|MultiEdit|Write",
1805
+ matcher: "Bash|Read|Grep|Glob|Edit|MultiEdit|Write|mcp__.*",
1753
1806
  hooks: [
1754
1807
  {
1755
1808
  type: "command",
@@ -1814,7 +1867,17 @@ fi
1814
1867
 
1815
1868
  if [ -n "$SNIPARA_COMPANION_BIN" ]; then
1816
1869
  INPUT=$(cat || true)
1817
- "$SNIPARA_COMPANION_BIN" pre-tool "$INPUT" || true
1870
+ TOOL_NAME=$(printf '%s' "$INPUT" | jq -r '.tool_name // .tool // .name // "unknown"' 2>/dev/null || echo "unknown")
1871
+ TOOL_INPUT_JSON=$(printf '%s' "$INPUT" | jq -c '.tool_input // .input // .arguments // .args // .' 2>/dev/null || printf '%s' "$INPUT")
1872
+ CONTEXT=$("$SNIPARA_COMPANION_BIN" pre-tool "$TOOL_INPUT_JSON" --tool "$TOOL_NAME" --max-tokens "\${SNIPARA_HOOK_MAX_TOKENS:-1200}" 2>/dev/stderr || true)
1873
+ if [ -n "$CONTEXT" ]; then
1874
+ jq -n --arg content "$CONTEXT" '{
1875
+ hookSpecificOutput: {
1876
+ hookEventName: "PreToolUse",
1877
+ additionalContext: $content
1878
+ }
1879
+ }'
1880
+ fi
1818
1881
  fi
1819
1882
  `;
1820
1883
  }
@@ -1832,9 +1895,17 @@ fi
1832
1895
 
1833
1896
  if [ -n "$SNIPARA_COMPANION_BIN" ]; then
1834
1897
  if [ -f ".snipara/workflow/current.json" ]; then
1835
- "$SNIPARA_COMPANION_BIN" workflow resume --include-session-context || true
1898
+ CONTEXT=$("$SNIPARA_COMPANION_BIN" workflow resume --include-session-context 2>/dev/stderr || true)
1836
1899
  else
1837
- "$SNIPARA_COMPANION_BIN" session-bootstrap || true
1900
+ CONTEXT=$("$SNIPARA_COMPANION_BIN" session-bootstrap --include-session-context --max-context-tokens "\${SNIPARA_HOOK_MAX_TOKENS:-1200}" 2>/dev/stderr || true)
1901
+ fi
1902
+ if [ -n "$CONTEXT" ]; then
1903
+ jq -n --arg content "$CONTEXT" '{
1904
+ hookSpecificOutput: {
1905
+ hookEventName: "SessionStart",
1906
+ additionalContext: $content
1907
+ }
1908
+ }'
1838
1909
  fi
1839
1910
  fi
1840
1911
  `;
@@ -1853,7 +1924,23 @@ fi
1853
1924
 
1854
1925
  if [ -n "$SNIPARA_COMPANION_BIN" ]; then
1855
1926
  INPUT=$(cat || true)
1856
- "$SNIPARA_COMPANION_BIN" post-tool "$INPUT" || true
1927
+ TOOL_NAME=$(printf '%s' "$INPUT" | jq -r '.tool_name // .tool // .name // "unknown"' 2>/dev/null || echo "unknown")
1928
+ TOOL_INPUT_JSON=$(printf '%s' "$INPUT" | jq -c '.tool_input // .input // .arguments // .args // .' 2>/dev/null || printf '%s' "$INPUT")
1929
+ TOOL_OUTPUT_JSON=$(printf '%s' "$INPUT" | jq -c '.tool_response // .tool_output // .result // .response // {}' 2>/dev/null || echo "{}")
1930
+ STATUS=$(printf '%s' "$INPUT" | jq -r '.status // .tool_status // empty' 2>/dev/null || true)
1931
+ ARGS=(post-tool "$TOOL_INPUT_JSON" --tool "$TOOL_NAME" --result "$TOOL_OUTPUT_JSON")
1932
+ if [ -n "$STATUS" ]; then
1933
+ ARGS+=(--status "$STATUS")
1934
+ fi
1935
+ CONTEXT=$("$SNIPARA_COMPANION_BIN" "\${ARGS[@]}" 2>/dev/stderr || true)
1936
+ if [ -n "$CONTEXT" ]; then
1937
+ jq -n --arg content "$CONTEXT" '{
1938
+ hookSpecificOutput: {
1939
+ hookEventName: "PostToolUse",
1940
+ additionalContext: $content
1941
+ }
1942
+ }'
1943
+ fi
1857
1944
  fi
1858
1945
  `;
1859
1946
  }
@@ -1871,9 +1958,17 @@ fi
1871
1958
 
1872
1959
  if [ -n "$SNIPARA_COMPANION_BIN" ]; then
1873
1960
  if [ -f ".snipara/workflow/current.json" ]; then
1874
- "$SNIPARA_COMPANION_BIN" task-commit --summary "Claude Code compacted while a managed workflow state existed. Resume with snipara-companion workflow resume --include-session-context and continue from .snipara/workflow/current.json." --category workflow-compaction --outcome partial || true
1961
+ CONTEXT=$("$SNIPARA_COMPANION_BIN" task-commit --summary "Claude Code compacted while a managed workflow state existed. Resume with snipara-companion workflow resume --include-session-context and continue from .snipara/workflow/current.json." --category workflow-compaction --outcome partial 2>/dev/stderr || true)
1875
1962
  else
1876
- "$SNIPARA_COMPANION_BIN" task-commit --summary "Claude Code compacted local session context" --outcome partial || true
1963
+ CONTEXT=$("$SNIPARA_COMPANION_BIN" task-commit --summary "Claude Code compacted local session context" --category session-compaction --outcome partial 2>/dev/stderr || true)
1964
+ fi
1965
+ if [ -n "$CONTEXT" ]; then
1966
+ jq -n --arg content "$CONTEXT" '{
1967
+ hookSpecificOutput: {
1968
+ hookEventName: "PreCompact",
1969
+ additionalContext: $content
1970
+ }
1971
+ }'
1877
1972
  fi
1878
1973
  fi
1879
1974
  `;
@@ -2517,7 +2612,11 @@ function getClaudeClientChecks(answers, detection) {
2517
2612
  const projectHasSnipara = containsSniparaMcpReference(projectConfig);
2518
2613
  const projectSettingsHasSnipara = containsSniparaMcpReference(projectSettings);
2519
2614
  const codeSettingsHasSnipara = containsSniparaMcpReference(codeSettings);
2520
- const hasLegacyCodeSettingsMcp = projectSettingsHasSnipara || codeSettingsHasSnipara;
2615
+ const legacyCodeSettingsMcpLocations = [
2616
+ projectSettingsHasSnipara ? "project .claude/settings.json" : null,
2617
+ codeSettingsHasSnipara ? "global ~/.claude/settings.json" : null
2618
+ ].filter(Boolean);
2619
+ const hasLegacyCodeSettingsMcp = legacyCodeSettingsMcpLocations.length > 0;
2521
2620
  const desktopHasSnipara = containsSniparaMcpReference(desktopConfig);
2522
2621
  const projectHooksConfigured = containsClaudeHooksReference(projectSettings);
2523
2622
  checks.push({
@@ -2529,7 +2628,9 @@ function getClaudeClientChecks(answers, detection) {
2529
2628
  checks.push({
2530
2629
  name: "claude_code_settings",
2531
2630
  status: hasLegacyCodeSettingsMcp ? "warn" : "pass",
2532
- detail: hasLegacyCodeSettingsMcp ? "Legacy Claude settings contain an MCP server entry; Claude Code project MCP should live in .mcp.json or be managed by claude mcp add --scope project" : "Claude settings are not being used as the MCP destination; .claude/settings.json is hooks-only"
2631
+ detail: hasLegacyCodeSettingsMcp ? `Legacy Claude settings contain an MCP server entry (${legacyCodeSettingsMcpLocations.join(
2632
+ ", "
2633
+ )}); Claude Code project MCP should live in .mcp.json or be managed by claude mcp add --scope project` : "Claude settings are not being used as the MCP destination; .claude/settings.json is hooks-only"
2533
2634
  });
2534
2635
  checks.push({
2535
2636
  name: "claude_code_hooks",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-snipara",
3
- "version": "1.3.47",
3
+ "version": "1.3.49",
4
4
  "description": "Onboard Snipara Hosted MCP Context + Memory with auth, companion workflows, and optional Snipara Sandbox",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",