create-snipara 1.3.50 → 1.3.52

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
@@ -112,6 +112,8 @@ That distinction matters:
112
112
  - creates `AGENTS.md` and `CLAUDE.md` when missing, or appends a marked Snipara section when those files already exist
113
113
  - creates `.cursor/rules/snipara.mdc` and `.codex/config.toml` when those files do not already exist
114
114
  - validates Codex config against Hosted MCP plus `bearer_token_env_var = "SNIPARA_API_KEY"` and tells users to restart Codex after MCP config changes
115
+ - installs local code overlay Git hooks by default for Claude Code and Codex
116
+ companion setups, unless `--skip-hooks` is passed
115
117
  - runs a real hosted MCP `tools/list` check and warns if the server still advertises legacy `rlm_*` duplicate tools
116
118
  - generates Mistral Le Chat, Mistral Vibe, and LangChain `ChatMistralAI.bindTools` references without embedding secrets
117
119
  - writes client-specific companion packs such as `.snipara/companion/CODEX.md` or `.snipara/companion/GEMINI.md`
@@ -119,7 +121,7 @@ That distinction matters:
119
121
  - generates `.snipara/companion/README.md`
120
122
  - generates `.snipara/companion/commands.json`
121
123
  - generates `.snipara/companion/doctor.json`
122
- - optionally installs Claude Code hooks
124
+ - optionally installs Claude Code agent hooks and companion local code overlay Git hooks
123
125
  - supports `doctor`, `repair`, `upgrade`, and `print-config`
124
126
 
125
127
  ## Product Boundary
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.50",
16
+ version: "1.3.52",
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",
@@ -178,6 +178,9 @@ function getAutomationClientId(aiClient) {
178
178
  }
179
179
  return aiClient;
180
180
  }
181
+ function shouldInstallDefaultHooks(aiClient) {
182
+ return aiClient === "claude-code" || aiClient === "codex";
183
+ }
181
184
  function buildProgram() {
182
185
  const program = new Command();
183
186
  program.name("create-snipara").description("Scaffold hosted Snipara MCP config plus companion workflow helpers").version(VERSION);
@@ -370,6 +373,7 @@ async function runInit(options) {
370
373
  }
371
374
  await updateEnvFiles(answers);
372
375
  await createCompanionConfig(answers);
376
+ await installLocalCodeOverlayHooks(answers);
373
377
  await syncRemoteAutomationClient(answers, { enabled: !normalizedOptions.skipTest });
374
378
  await createCompanionPack(answers);
375
379
  const validationReport = await runValidation(answers, !normalizedOptions.skipTest);
@@ -418,6 +422,7 @@ async function runRepair(options) {
418
422
  await createAgentTemplates(answers);
419
423
  await updateEnvFiles(answers);
420
424
  await createCompanionConfig(answers);
425
+ await installLocalCodeOverlayHooks(answers);
421
426
  await createCompanionPack(answers);
422
427
  if (answers.installHooks && answers.aiClient === "claude-code") {
423
428
  await installClaudeCodeHooks(answers);
@@ -451,9 +456,13 @@ async function runUpgrade(options) {
451
456
  await createProjectBinding(upgradedAnswers);
452
457
  await createAgentTemplates(upgradedAnswers);
453
458
  await createCompanionConfig(upgradedAnswers);
454
- if (options.withHooks || answers.installHooks) {
459
+ if ((options.withHooks || answers.installHooks) && upgradedAnswers.aiClient === "claude-code") {
455
460
  await installClaudeCodeHooks({ ...answers, installHooks: true });
456
461
  }
462
+ await installLocalCodeOverlayHooks({
463
+ ...upgradedAnswers,
464
+ installHooks: Boolean(options.withHooks || answers.installHooks)
465
+ });
457
466
  await createCompanionPack(upgradedAnswers);
458
467
  const report = await runValidation(upgradedAnswers, true);
459
468
  writeDoctorReport(report);
@@ -647,7 +656,7 @@ async function gatherConfiguration(options) {
647
656
  type: showAdvancedPrompts ? "confirm" : null,
648
657
  name: "installHooks",
649
658
  message: "Generate local hooks when supported?",
650
- initial: detectedClient === "claude-code"
659
+ initial: shouldInstallDefaultHooks(requestedClient || detectedClient)
651
660
  },
652
661
  {
653
662
  type: (_, values) => detectedGitRepo && showAdvancedPrompts && !options.skipGithub && (values.profile || initialProfile) !== "runtime-only" ? "confirm" : null,
@@ -692,7 +701,7 @@ async function gatherConfiguration(options) {
692
701
  skipMcp: !!options.skipMcp,
693
702
  skipRuntime: !!options.skipRuntime,
694
703
  withOrchestrator: Boolean(options.withOrchestrator || response.installOrchestrator),
695
- skipHooks: !!options.skipHooks || !response.installHooks,
704
+ skipHooks: !!options.skipHooks || !(typeof response.installHooks === "boolean" ? response.installHooks : shouldInstallDefaultHooks(requestedClient || response.aiClient || detectedClient)),
696
705
  configureGitHub: Boolean(
697
706
  (response.configureGitHub || options.github || options.githubPath) && detectedGitRepo && !options.skipGithub
698
707
  ),
@@ -838,13 +847,13 @@ function buildAnswersFromProfile(input) {
838
847
  installCompanion: true,
839
848
  installMcp: false,
840
849
  installRuntime: false,
841
- installHooks: input.aiClient === "claude-code"
850
+ installHooks: shouldInstallDefaultHooks(input.aiClient)
842
851
  },
843
852
  "full-stack": {
844
853
  installCompanion: true,
845
854
  installMcp: false,
846
855
  installRuntime: true,
847
- installHooks: input.aiClient === "claude-code"
856
+ installHooks: shouldInstallDefaultHooks(input.aiClient)
848
857
  },
849
858
  "runtime-only": {
850
859
  installCompanion: false,
@@ -2061,6 +2070,41 @@ async function createCompanionConfig(answers) {
2061
2070
  ensureGitignoreEntry(".snipara/companion/config.json", "# Snipara local companion config");
2062
2071
  console.log(chalk.green(" \u2713 Configured local companion config"));
2063
2072
  }
2073
+ async function installLocalCodeOverlayHooks(answers) {
2074
+ if (!answers.installCompanion || !answers.installHooks || answers.profile === "runtime-only") {
2075
+ return;
2076
+ }
2077
+ if (!isGitRepo()) {
2078
+ console.log(
2079
+ chalk.dim(" Skipped local code overlay Git hooks: current directory is not a Git repo")
2080
+ );
2081
+ return;
2082
+ }
2083
+ const companionCommand = detectCompanionCommand();
2084
+ if (!companionCommand) {
2085
+ console.log(
2086
+ chalk.yellow(
2087
+ ` \u26A0 Could not install local code overlay Git hooks: ${COMPANION_COMMAND_NAME} ${MIN_COMPANION_VERSION}+ is not on PATH`
2088
+ )
2089
+ );
2090
+ return;
2091
+ }
2092
+ const spinner = ora("Installing local code overlay Git hooks").start();
2093
+ try {
2094
+ execSync(`${companionCommand} code hooks install --json`, {
2095
+ cwd: process.cwd(),
2096
+ encoding: "utf-8",
2097
+ stdio: ["ignore", "pipe", "pipe"],
2098
+ timeout: 3e4
2099
+ });
2100
+ spinner.succeed("Installed local code overlay Git hooks");
2101
+ } catch (error) {
2102
+ spinner.warn("Local code overlay Git hooks were not installed");
2103
+ const message = error instanceof Error && error.message ? error.message : "unknown companion hook error";
2104
+ console.log(chalk.dim(` Retry with: ${COMPANION_NPX_COMMAND} code hooks install`));
2105
+ console.log(chalk.dim(` ${message}`));
2106
+ }
2107
+ }
2064
2108
  async function syncRemoteAutomationClient(answers, options) {
2065
2109
  if (!options.enabled || answers.apiKeyType === "none" || !answers.apiKey || answers.apiKey.includes("YOUR_") || !answers.projectSlug) {
2066
2110
  return;
@@ -3404,7 +3448,7 @@ function loadExistingAnswers(options) {
3404
3448
  skipMcp: options.withMcp === true ? false : !detection.existingConfig.hasSniparaServer && effectiveProfile === "runtime-only",
3405
3449
  skipRuntime: options.withRuntime === true ? false : !detection.existingConfig.hasRuntimeServer && effectiveProfile !== "full-stack" && effectiveProfile !== "runtime-only",
3406
3450
  withOrchestrator: Boolean(options.withOrchestrator || detection.tooling.orchestratorCli),
3407
- skipHooks: options.withHooks ? false : detection.aiClient !== "claude-code"
3451
+ skipHooks: options.withHooks ? false : !shouldInstallDefaultHooks(detection.aiClient)
3408
3452
  });
3409
3453
  }
3410
3454
  function resolveMaintenanceProfile(detection, explicitProfile) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-snipara",
3
- "version": "1.3.50",
3
+ "version": "1.3.52",
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",