create-snipara 1.3.51 → 1.3.53
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 +3 -1
- package/dist/index.js +56 -10
- package/package.json +1 -1
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.
|
|
16
|
+
version: "1.3.53",
|
|
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:
|
|
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
|
|
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
|
|
856
|
+
installHooks: shouldInstallDefaultHooks(input.aiClient)
|
|
848
857
|
},
|
|
849
858
|
"runtime-only": {
|
|
850
859
|
installCompanion: false,
|
|
@@ -1467,7 +1476,8 @@ Use Snipara Hosted MCP before answering project-specific questions.
|
|
|
1467
1476
|
- Start substantial work with \`snipara_recall\` and a targeted \`snipara_context_query\`.
|
|
1468
1477
|
- Use \`snipara_context_query\` for source truth and \`snipara_get_chunk\` for exact cited sections.
|
|
1469
1478
|
- When \`snipara_context_query\` returns \`answer_pack\`, use its facts, caveats, source map, and verification checklist before drafting claims.
|
|
1470
|
-
- Use \`snipara_code_callers\`, \`snipara_code_imports\`, \`snipara_code_neighbors\`, or \`snipara_code_shortest_path\` for structural code questions.
|
|
1479
|
+
- Use \`snipara_code_callers\`, \`snipara_code_imports\`, \`snipara_code_neighbors\`, or \`snipara_code_shortest_path\` for canonical structural code questions.
|
|
1480
|
+
- When local commits or a dirty working tree matter and \`snipara-companion\` is installed, use \`snipara-companion code callers/imports/neighbors/shortest-path/impact\`; it auto-selects hosted MCP or the local overlay and reports \`sourceSelection\`.
|
|
1471
1481
|
- On paid Context plans, use \`snipara_code_symbol_card\` before editing important symbols and \`snipara_code_impact\` before risky multi-file changes or PR reviews.
|
|
1472
1482
|
- Check every \`snipara_code_*\` response for indexed commit SHA, indexing time, included files, coverage, and freshness warnings.
|
|
1473
1483
|
- 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.
|
|
@@ -1497,7 +1507,8 @@ This workspace uses Snipara Hosted MCP for current project context, business/cli
|
|
|
1497
1507
|
- Use \`snipara_context_query\` for docs, business context, current client/project truth, and narrative source material.
|
|
1498
1508
|
- When \`snipara_context_query\` returns \`answer_pack\`, use its facts, caveats, source map, and verification checklist before drafting claims.
|
|
1499
1509
|
- Use \`snipara_get_chunk\` before relying on exact cited wording from reference-based results.
|
|
1500
|
-
- Use \`snipara_code_callers\`, \`snipara_code_imports\`, \`snipara_code_neighbors\`, or \`snipara_code_shortest_path\` for structural code questions.
|
|
1510
|
+
- Use \`snipara_code_callers\`, \`snipara_code_imports\`, \`snipara_code_neighbors\`, or \`snipara_code_shortest_path\` for canonical structural code questions.
|
|
1511
|
+
- When local commits or a dirty working tree matter and \`snipara-companion\` is installed, use \`snipara-companion code callers/imports/neighbors/shortest-path/impact\`; it auto-selects hosted MCP or the local overlay and reports \`sourceSelection\`.
|
|
1501
1512
|
- On paid Context plans, use \`snipara_code_symbol_card\` before editing important symbols and \`snipara_code_impact\` before risky multi-file changes or PR reviews.
|
|
1502
1513
|
- Check every \`snipara_code_*\` response for indexed commit SHA, indexing time, included files, coverage, and freshness warnings.
|
|
1503
1514
|
- Use \`snipara_plan\` or \`snipara_decompose\` only for complex work and only when available.
|
|
@@ -2061,6 +2072,41 @@ async function createCompanionConfig(answers) {
|
|
|
2061
2072
|
ensureGitignoreEntry(".snipara/companion/config.json", "# Snipara local companion config");
|
|
2062
2073
|
console.log(chalk.green(" \u2713 Configured local companion config"));
|
|
2063
2074
|
}
|
|
2075
|
+
async function installLocalCodeOverlayHooks(answers) {
|
|
2076
|
+
if (!answers.installCompanion || !answers.installHooks || answers.profile === "runtime-only") {
|
|
2077
|
+
return;
|
|
2078
|
+
}
|
|
2079
|
+
if (!isGitRepo()) {
|
|
2080
|
+
console.log(
|
|
2081
|
+
chalk.dim(" Skipped local code overlay Git hooks: current directory is not a Git repo")
|
|
2082
|
+
);
|
|
2083
|
+
return;
|
|
2084
|
+
}
|
|
2085
|
+
const companionCommand = detectCompanionCommand();
|
|
2086
|
+
if (!companionCommand) {
|
|
2087
|
+
console.log(
|
|
2088
|
+
chalk.yellow(
|
|
2089
|
+
` \u26A0 Could not install local code overlay Git hooks: ${COMPANION_COMMAND_NAME} ${MIN_COMPANION_VERSION}+ is not on PATH`
|
|
2090
|
+
)
|
|
2091
|
+
);
|
|
2092
|
+
return;
|
|
2093
|
+
}
|
|
2094
|
+
const spinner = ora("Installing local code overlay Git hooks").start();
|
|
2095
|
+
try {
|
|
2096
|
+
execSync(`${companionCommand} code hooks install --json`, {
|
|
2097
|
+
cwd: process.cwd(),
|
|
2098
|
+
encoding: "utf-8",
|
|
2099
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
2100
|
+
timeout: 3e4
|
|
2101
|
+
});
|
|
2102
|
+
spinner.succeed("Installed local code overlay Git hooks");
|
|
2103
|
+
} catch (error) {
|
|
2104
|
+
spinner.warn("Local code overlay Git hooks were not installed");
|
|
2105
|
+
const message = error instanceof Error && error.message ? error.message : "unknown companion hook error";
|
|
2106
|
+
console.log(chalk.dim(` Retry with: ${COMPANION_NPX_COMMAND} code hooks install`));
|
|
2107
|
+
console.log(chalk.dim(` ${message}`));
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2064
2110
|
async function syncRemoteAutomationClient(answers, options) {
|
|
2065
2111
|
if (!options.enabled || answers.apiKeyType === "none" || !answers.apiKey || answers.apiKey.includes("YOUR_") || !answers.projectSlug) {
|
|
2066
2112
|
return;
|
|
@@ -2430,7 +2476,7 @@ async function createCompanionPack(answers) {
|
|
|
2430
2476
|
fs.mkdirSync(packDir, { recursive: true });
|
|
2431
2477
|
const readme = `# Snipara Companion Pack
|
|
2432
2478
|
|
|
2433
|
-
This project uses Snipara as a hosted-first context
|
|
2479
|
+
This project uses Snipara as a hosted-first project intelligence layer with source-backed context, reviewed memory, and local companion workflow helpers.
|
|
2434
2480
|
|
|
2435
2481
|
## Install Profile
|
|
2436
2482
|
|
|
@@ -3404,7 +3450,7 @@ function loadExistingAnswers(options) {
|
|
|
3404
3450
|
skipMcp: options.withMcp === true ? false : !detection.existingConfig.hasSniparaServer && effectiveProfile === "runtime-only",
|
|
3405
3451
|
skipRuntime: options.withRuntime === true ? false : !detection.existingConfig.hasRuntimeServer && effectiveProfile !== "full-stack" && effectiveProfile !== "runtime-only",
|
|
3406
3452
|
withOrchestrator: Boolean(options.withOrchestrator || detection.tooling.orchestratorCli),
|
|
3407
|
-
skipHooks: options.withHooks ? false : detection.aiClient
|
|
3453
|
+
skipHooks: options.withHooks ? false : !shouldInstallDefaultHooks(detection.aiClient)
|
|
3408
3454
|
});
|
|
3409
3455
|
}
|
|
3410
3456
|
function resolveMaintenanceProfile(detection, explicitProfile) {
|
package/package.json
CHANGED