create-snipara 1.3.38 → 1.3.39

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 +1 -1
  2. package/dist/index.js +77 -42
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -208,7 +208,7 @@ Writes `.snipara/companion/doctor.json` and validates:
208
208
  For Claude-specific support, run:
209
209
 
210
210
  ```bash
211
- npx create-snipara doctor --client claude
211
+ npx create-snipara doctor --client claude-code
212
212
  ```
213
213
 
214
214
  This separates "Snipara config was written" from "Claude actually loaded the MCP
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.38",
16
+ version: "1.3.39",
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",
@@ -88,6 +88,8 @@ var BASE_URL = "https://www.snipara.com";
88
88
  var API_URL = "https://api.snipara.com";
89
89
  var COMPANION_PACKAGE_NAME = "snipara-companion";
90
90
  var COMPANION_COMMAND_NAME = "snipara-companion";
91
+ var COMPANION_NPX_COMMAND = "npx -y snipara-companion@latest";
92
+ var MIN_COMPANION_VERSION = "1.1.37";
91
93
  var GITHUB_ANSWER_PACKS_LABEL = "GitHub PR Answer Packs";
92
94
  var MCP_PACKAGE_NAME = "snipara-mcp";
93
95
  var SANDBOX_PACKAGE_NAME = "snipara-sandbox[all]";
@@ -938,8 +940,40 @@ function isProvisionedApiKey(value) {
938
940
  function provisionedApiKeyValidationMessage() {
939
941
  return "New Snipara API keys should start with snp-";
940
942
  }
943
+ function normalizeSemver(value) {
944
+ const match = value?.match(/(\d+)\.(\d+)\.(\d+)/);
945
+ if (!match) {
946
+ return null;
947
+ }
948
+ return `${match[1]}.${match[2]}.${match[3]}`;
949
+ }
950
+ function getCompanionCommandVersion() {
951
+ if (!commandExists(COMPANION_COMMAND_NAME)) {
952
+ return null;
953
+ }
954
+ try {
955
+ return execSync(`${COMPANION_COMMAND_NAME} --version`, {
956
+ encoding: "utf-8",
957
+ stdio: ["ignore", "pipe", "ignore"],
958
+ timeout: 1e3
959
+ }).trim();
960
+ } catch {
961
+ return null;
962
+ }
963
+ }
964
+ function isSupportedCompanionVersion(version) {
965
+ const current = normalizeSemver(version);
966
+ return Boolean(current && compareSemver(current, MIN_COMPANION_VERSION) >= 0);
967
+ }
968
+ function getCompanionRequirementMessage() {
969
+ const version = getCompanionCommandVersion();
970
+ if (!version) {
971
+ return `${COMPANION_PACKAGE_NAME} not found on PATH`;
972
+ }
973
+ return `${COMPANION_PACKAGE_NAME} ${version} is older than required ${MIN_COMPANION_VERSION}`;
974
+ }
941
975
  function detectCompanionCommand() {
942
- if (commandExists(COMPANION_COMMAND_NAME)) {
976
+ if (isSupportedCompanionVersion(getCompanionCommandVersion())) {
943
977
  return COMPANION_COMMAND_NAME;
944
978
  }
945
979
  return null;
@@ -1033,11 +1067,11 @@ function detectNodePackageManagers() {
1033
1067
  }
1034
1068
  return managers;
1035
1069
  }
1036
- function getCompanionInstallCommand(packageManager, upgrade) {
1070
+ function getCompanionInstallCommand(packageManager, _upgrade) {
1037
1071
  if (packageManager === "pnpm") {
1038
- return `pnpm add -g ${upgrade ? "--latest " : ""}${COMPANION_PACKAGE_NAME}`;
1072
+ return `pnpm add -g ${COMPANION_PACKAGE_NAME}@latest`;
1039
1073
  }
1040
- return `npm install -g ${upgrade ? COMPANION_PACKAGE_NAME + "@latest" : COMPANION_PACKAGE_NAME}`;
1074
+ return `npm install -g ${COMPANION_PACKAGE_NAME}@latest`;
1041
1075
  }
1042
1076
  async function installNodeCompanion(upgrade) {
1043
1077
  console.log(chalk.bold(`
@@ -1046,7 +1080,7 @@ async function installNodeCompanion(upgrade) {
1046
1080
  const packageManagers = detectNodePackageManagers();
1047
1081
  if (packageManagers.length === 0) {
1048
1082
  console.log(chalk.yellow(" \u26A0\uFE0F npm/pnpm not found. Please install manually:\n"));
1049
- console.log(chalk.gray(` npm install -g ${COMPANION_PACKAGE_NAME}
1083
+ console.log(chalk.gray(` npm install -g ${COMPANION_PACKAGE_NAME}@latest
1050
1084
  `));
1051
1085
  return;
1052
1086
  }
@@ -1082,12 +1116,8 @@ async function installNodeCompanion(upgrade) {
1082
1116
  console.log(chalk.gray(` - ${failure}`));
1083
1117
  }
1084
1118
  console.log(chalk.yellow("\n Install manually with:"));
1085
- console.log(
1086
- chalk.gray(
1087
- ` npm install -g ${upgrade ? COMPANION_PACKAGE_NAME + "@latest" : COMPANION_PACKAGE_NAME}
1088
- `
1089
- )
1090
- );
1119
+ console.log(chalk.gray(` npm install -g ${COMPANION_PACKAGE_NAME}@latest
1120
+ `));
1091
1121
  }
1092
1122
  async function createMcpConfig(answers) {
1093
1123
  console.log(chalk.bold("\n\u2699\uFE0F Creating Configuration\n"));
@@ -1793,7 +1823,7 @@ function getClientGuidance(client) {
1793
1823
  if (client === "windsurf") {
1794
1824
  return [
1795
1825
  "Windsurf should use the hosted MCP surface plus generated Windsurf automation bundles when available.",
1796
- "Use snipara-companion automations install --client windsurf when you want dashboard-managed hook files in the local project."
1826
+ "Use npx -y snipara-companion@latest automations install --client windsurf when you want dashboard-managed hook files in the local project."
1797
1827
  ];
1798
1828
  }
1799
1829
  if (client === "codex") {
@@ -1843,19 +1873,19 @@ function getCompanionCommands(answers) {
1843
1873
  const businessOnboardingCommands = answers.installCompanion ? [
1844
1874
  {
1845
1875
  title: "Preview a business folder import",
1846
- command: `${COMPANION_COMMAND_NAME} onboard-folder ./client-export --source-provider local_folder --write-manifest ./snipara-onboard.json`,
1876
+ command: `${COMPANION_NPX_COMMAND} onboard-folder ./client-export --source-provider local_folder --write-manifest ./snipara-onboard.json`,
1847
1877
  purpose: "Classify a local or LLM-materialized business folder and review the Snipara sync manifest before upload."
1848
1878
  },
1849
1879
  {
1850
1880
  title: "Apply a business folder import",
1851
- command: `${COMPANION_COMMAND_NAME} onboard-folder ./client-export --source-provider local_folder --apply`,
1881
+ command: `${COMPANION_NPX_COMMAND} onboard-folder ./client-export --source-provider local_folder --apply`,
1852
1882
  purpose: "Upload approved business-context documents to hosted Snipara and trigger document reindexing."
1853
1883
  }
1854
1884
  ] : [
1855
1885
  {
1856
1886
  title: "Enable business folder onboarding",
1857
1887
  command: "npx create-snipara repair --with-companion",
1858
- purpose: `Install ${COMPANION_PACKAGE_NAME} so this project can run ${COMPANION_COMMAND_NAME} onboard-folder without using the dashboard.`
1888
+ purpose: `Install ${COMPANION_PACKAGE_NAME} so this project can run ${COMPANION_NPX_COMMAND} onboard-folder without using the dashboard.`
1859
1889
  }
1860
1890
  ];
1861
1891
  const githubAnswerPacksCommand = answers.githubRepo ? {
@@ -1870,7 +1900,7 @@ function getCompanionCommands(answers) {
1870
1900
  return [
1871
1901
  {
1872
1902
  title: "Bootstrap local companion",
1873
- command: `${COMPANION_COMMAND_NAME} init${clientFlag}${projectFlag}`,
1903
+ command: `${COMPANION_NPX_COMMAND} init${clientFlag}${projectFlag}`,
1874
1904
  purpose: "Re-run local companion setup if this workstation needs to refresh browser login or project selection."
1875
1905
  },
1876
1906
  {
@@ -1885,32 +1915,32 @@ function getCompanionCommands(answers) {
1885
1915
  },
1886
1916
  {
1887
1917
  title: "Run a focused hosted query",
1888
- command: `${COMPANION_COMMAND_NAME} query --query "how does auth middleware work?" --max-tokens 4000`,
1918
+ command: `${COMPANION_NPX_COMMAND} query --query "how does auth middleware work?" --max-tokens 4000`,
1889
1919
  purpose: "Pull ranked source context before editing, reviewing, or drafting."
1890
1920
  },
1891
1921
  {
1892
1922
  title: "Load linked standards only when needed",
1893
- command: `${COMPANION_COMMAND_NAME} shared-context --categories MANDATORY BEST_PRACTICES`,
1923
+ command: `${COMPANION_NPX_COMMAND} shared-context --categories MANDATORY BEST_PRACTICES`,
1894
1924
  purpose: "Fetch project-linked team or workspace guidance without treating it as memory."
1895
1925
  },
1896
1926
  {
1897
1927
  title: "Generate a hosted plan",
1898
- command: `${COMPANION_COMMAND_NAME} plan --query "Implement webhook retry hardening" --max-tokens 3000`,
1928
+ command: `${COMPANION_NPX_COMMAND} plan --query "Implement webhook retry hardening" --max-tokens 3000`,
1899
1929
  purpose: "Produce a structured execution plan against indexed project knowledge."
1900
1930
  },
1901
1931
  {
1902
1932
  title: "Start a managed workflow from the visible plan",
1903
- command: `${COMPANION_COMMAND_NAME} workflow start --goal "Implement webhook retry hardening" --plan-file ./plan.md`,
1933
+ command: `${COMPANION_NPX_COMMAND} workflow start --goal "Implement webhook retry hardening" --plan-file ./plan.md`,
1904
1934
  purpose: "Record the LLM-visible plan in .snipara/workflow/current.json so phase state survives compaction."
1905
1935
  },
1906
1936
  {
1907
1937
  title: "Start the current workflow phase",
1908
- command: `${COMPANION_COMMAND_NAME} workflow phase-start context`,
1938
+ command: `${COMPANION_NPX_COMMAND} workflow phase-start context`,
1909
1939
  purpose: "Mark a phase active and print the required Snipara context gate for the agent."
1910
1940
  },
1911
1941
  {
1912
1942
  title: "Analyze code impact before a risky change",
1913
- command: `${COMPANION_COMMAND_NAME} code impact --changed-files src/api/webhooks.ts tests/webhooks.test.ts --diff-summary "webhook retry hardening"`,
1943
+ command: `${COMPANION_NPX_COMMAND} code impact --changed-files src/api/webhooks.ts tests/webhooks.test.ts --diff-summary "webhook retry hardening"`,
1914
1944
  purpose: "Use paid Context code impact analysis to surface likely tests, docs, routes, config, and risks."
1915
1945
  },
1916
1946
  {
@@ -1921,48 +1951,48 @@ function getCompanionCommands(answers) {
1921
1951
  githubAnswerPacksCommand,
1922
1952
  {
1923
1953
  title: "Upload or refresh a doc",
1924
- command: `${COMPANION_COMMAND_NAME} upload --path docs/local-playbook.md --file ./docs/local-playbook.md`,
1954
+ command: `${COMPANION_NPX_COMMAND} upload --path docs/local-playbook.md --file ./docs/local-playbook.md`,
1925
1955
  purpose: "Push local notes or docs into hosted Snipara context."
1926
1956
  },
1927
1957
  ...businessOnboardingCommands,
1928
1958
  {
1929
1959
  title: "Inspect a specific chunk",
1930
- command: `${COMPANION_COMMAND_NAME} chunk get --chunk-id <chunk_id>`,
1960
+ command: `${COMPANION_NPX_COMMAND} chunk get --chunk-id <chunk_id>`,
1931
1961
  purpose: "Open an exact chunk returned by references-based search."
1932
1962
  },
1933
1963
  {
1934
1964
  title: "Bootstrap the session memory view",
1935
- command: `${COMPANION_COMMAND_NAME} session-bootstrap`,
1965
+ command: `${COMPANION_NPX_COMMAND} session-bootstrap`,
1936
1966
  purpose: "Load durable decisions, learnings, and optional short-lived carryover at session start."
1937
1967
  },
1938
1968
  {
1939
1969
  title: "Check Stuck Guard status",
1940
- command: `${COMPANION_COMMAND_NAME} stuck-guard status`,
1970
+ command: `${COMPANION_NPX_COMMAND} stuck-guard status`,
1941
1971
  purpose: "Inspect whether recent tool failures, empty searches, or risky workflow signals should trigger a Rescue Pack."
1942
1972
  },
1943
1973
  {
1944
1974
  title: "Simulate a Stuck Guard fixture",
1945
- command: `${COMPANION_COMMAND_NAME} stuck-guard simulate --fixture ./stuck-guard-fixture.json`,
1975
+ command: `${COMPANION_NPX_COMMAND} stuck-guard simulate --fixture ./stuck-guard-fixture.json`,
1946
1976
  purpose: "Replay canonical events against the hosted Stuck Guard decision API before enabling stricter modes."
1947
1977
  },
1948
1978
  {
1949
1979
  title: "Ask memory about past decisions",
1950
- command: `${COMPANION_COMMAND_NAME} recall --query "What did we decide about auth retries?" --type decision`,
1980
+ command: `${COMPANION_NPX_COMMAND} recall --query "What did we decide about auth retries?" --type decision`,
1951
1981
  purpose: "Query durable memory for past decisions, preferences, or validated learnings."
1952
1982
  },
1953
1983
  {
1954
1984
  title: "Commit durable task memory",
1955
- command: `${COMPANION_COMMAND_NAME} task-commit --summary "Hardened webhook retries and updated tests" --category engineering --outcome completed --files src/api/webhooks.ts tests/webhooks.test.ts`,
1985
+ command: `${COMPANION_NPX_COMMAND} task-commit --summary "Hardened webhook retries and updated tests" --category engineering --outcome completed --files src/api/webhooks.ts tests/webhooks.test.ts`,
1956
1986
  purpose: "Persist reusable outcomes back into hosted memory after the work is done."
1957
1987
  },
1958
1988
  {
1959
1989
  title: "Commit a managed workflow phase",
1960
- command: `${COMPANION_COMMAND_NAME} workflow phase-commit context --summary "Loaded context and mapped impacted files" --files src/api/webhooks.ts tests/webhooks.test.ts`,
1990
+ command: `${COMPANION_NPX_COMMAND} workflow phase-commit context --summary "Loaded context and mapped impacted files" --files src/api/webhooks.ts tests/webhooks.test.ts`,
1961
1991
  purpose: "Persist this phase through hosted memory and advance the local managed workflow state."
1962
1992
  },
1963
1993
  {
1964
1994
  title: "Commit the final managed workflow result",
1965
- command: `${COMPANION_COMMAND_NAME} final-commit --summary "Shipped webhook retry hardening and tests" --files src/api/webhooks.ts tests/webhooks.test.ts`,
1995
+ command: `${COMPANION_NPX_COMMAND} final-commit --summary "Shipped webhook retry hardening and tests" --files src/api/webhooks.ts tests/webhooks.test.ts`,
1966
1996
  purpose: "Persist the final workflow outcome and close the managed workflow after verification."
1967
1997
  }
1968
1998
  ];
@@ -2029,7 +2059,7 @@ function getClientConfigArtifacts(client) {
2029
2059
  }
2030
2060
  function getClientAutomationCommand(client) {
2031
2061
  const companionClient = getCompanionInitClientFlag(client).match(/--client\s+(\S+)/)?.[1];
2032
- return companionClient ? `${COMPANION_COMMAND_NAME} automations install --client ${companionClient}` : null;
2062
+ return companionClient ? `${COMPANION_NPX_COMMAND} automations install --client ${companionClient}` : null;
2033
2063
  }
2034
2064
  function buildClientPackMarkdown(answers, commands, guidance) {
2035
2065
  const clientName = getClientDisplayName(answers.aiClient);
@@ -2054,7 +2084,7 @@ ${getClientConfigArtifacts(answers.aiClient).map((item) => `- \`${item}\``).join
2054
2084
 
2055
2085
  ## Recommended Setup
2056
2086
 
2057
- ${bootstrapCommand ? `1. Bootstrap companion: \`${bootstrapCommand.command}\`` : "1. Bootstrap companion with `snipara-companion init`."}
2087
+ ${bootstrapCommand ? `1. Bootstrap companion: \`${bootstrapCommand.command}\`` : `1. Bootstrap companion with \`${COMPANION_NPX_COMMAND} init\`.`}
2058
2088
  2. Confirm the client can list or call the \`snipara_*\` MCP tools.
2059
2089
  3. Keep exact edits, tests, and dirty working-tree checks local; use Snipara for memory, source truth, and indexed code graph context.
2060
2090
  ${automationCommand ? `4. For generated local automations, run \`${automationCommand}\` when that client exposes usable automation files.` : "4. This client is treated as MCP-first; no local hook surface is assumed."}
@@ -2068,6 +2098,7 @@ ${guidance.map((line) => `- ${line}`).join("\n")}
2068
2098
  - Start substantial work with \`snipara_recall\` and \`snipara_context_query\`.
2069
2099
  - Use \`answer_pack\` facts, caveats, source maps, and verification checks before making claims.
2070
2100
  - Use \`snipara_code_symbol_card\` and \`snipara_code_impact\` for important symbols or risky multi-file changes when available.
2101
+ - Use the installed \`snipara-companion\` binary for low-latency hooks; use \`${COMPANION_NPX_COMMAND}\` for one-off terminal commands when freshness matters.
2071
2102
  - Use \`snipara-companion workflow start\`, \`phase-start\`, \`phase-commit\`, \`workflow resume\`, and \`final-commit\` for multi-phase work.
2072
2103
  - Persist only durable decisions, learnings, preferences, workflows, and troubleshooting outcomes. Never persist secrets.
2073
2104
  `;
@@ -2118,11 +2149,11 @@ Use this when Claude, ChatGPT, Codex, or another LLM client has already material
2118
2149
 
2119
2150
  ${answers.installCompanion ? `Preview first:
2120
2151
 
2121
- \`${COMPANION_COMMAND_NAME} onboard-folder ./client-export --source-provider local_folder --write-manifest ./snipara-onboard.json\`
2152
+ \`${COMPANION_NPX_COMMAND} onboard-folder ./client-export --source-provider local_folder --write-manifest ./snipara-onboard.json\`
2122
2153
 
2123
2154
  Apply only after reviewing the manifest:
2124
2155
 
2125
- \`${COMPANION_COMMAND_NAME} onboard-folder ./client-export --source-provider local_folder --apply\`` : `This setup did not install snipara-companion. Enable it before business folder imports:
2156
+ \`${COMPANION_NPX_COMMAND} onboard-folder ./client-export --source-provider local_folder --apply\`` : `This setup did not install snipara-companion. Enable it before business folder imports:
2126
2157
 
2127
2158
  \`npx create-snipara repair --with-companion\``}
2128
2159
 
@@ -2427,7 +2458,7 @@ async function runValidation(answers, includeHostedCheck, options = {}) {
2427
2458
  checks.push({
2428
2459
  name: "companion_cli",
2429
2460
  status: answers.installCompanion ? detection.tooling.companionCli ? "pass" : "fail" : "pass",
2430
- detail: answers.installCompanion && !detection.tooling.companionCli ? `${COMPANION_PACKAGE_NAME} not found on PATH` : "Companion CLI ready or not requested"
2461
+ detail: answers.installCompanion && !detection.tooling.companionCli ? getCompanionRequirementMessage() : "Companion CLI ready or not requested"
2431
2462
  });
2432
2463
  checks.push({
2433
2464
  name: "sandbox_cli",
@@ -2735,7 +2766,9 @@ function printSuccess(answers, report) {
2735
2766
  printNextStep(
2736
2767
  "For Claude Code, start a new session and confirm Snipara appears in Settings -> MCP or ToolSearch."
2737
2768
  );
2738
- printNextStep("If Snipara tools are missing, run: npx create-snipara doctor --client claude");
2769
+ printNextStep(
2770
+ "If Snipara tools are missing, run: npx create-snipara doctor --client claude-code"
2771
+ );
2739
2772
  }
2740
2773
  if (answers.aiClient === "claude-desktop") {
2741
2774
  printNextStep(
@@ -2753,15 +2786,17 @@ function printSuccess(answers, report) {
2753
2786
  printNextStep("Open .snipara/companion/README.md for local commands and repair flow.");
2754
2787
  printNextStep("Run create-snipara doctor anytime you want a fresh local validation report.");
2755
2788
  if (answers.installCompanion) {
2756
- printNextStep(`${COMPANION_COMMAND_NAME} is the companion command for local workflow helpers.`);
2757
2789
  printNextStep(
2758
- `Use ${COMPANION_COMMAND_NAME} query / plan / upload / task-commit for explicit local workflows.`
2790
+ `${COMPANION_COMMAND_NAME} ${MIN_COMPANION_VERSION}+ is installed for low-latency local hooks.`
2791
+ );
2792
+ printNextStep(
2793
+ `Use ${COMPANION_NPX_COMMAND} query / plan / upload / task-commit for explicit local workflows.`
2759
2794
  );
2760
2795
  printNextStep(
2761
- `For business folders, preview with: ${COMPANION_COMMAND_NAME} onboard-folder ./client-export --source-provider local_folder --write-manifest ./snipara-onboard.json`
2796
+ `For business folders, preview with: ${COMPANION_NPX_COMMAND} onboard-folder ./client-export --source-provider local_folder --write-manifest ./snipara-onboard.json`
2762
2797
  );
2763
2798
  printNextStep(
2764
- `Apply after review with: ${COMPANION_COMMAND_NAME} onboard-folder ./client-export --source-provider local_folder --apply`
2799
+ `Apply after review with: ${COMPANION_NPX_COMMAND} onboard-folder ./client-export --source-provider local_folder --apply`
2765
2800
  );
2766
2801
  } else if (answers.profile !== "runtime-only") {
2767
2802
  printNextStep(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-snipara",
3
- "version": "1.3.38",
3
+ "version": "1.3.39",
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",