snipara-companion 3.2.4 → 3.2.5

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/dist/index.js CHANGED
@@ -12461,7 +12461,7 @@ function printDoctorReport(report, companionVersion, auth, toolCatalog) {
12461
12461
  "- This doctor confirms local auth and hosted reachability; it does not prove how a specific agent UI ranked or exposed tools."
12462
12462
  );
12463
12463
  console.log(
12464
- "- If an agent session shows only a subset of Snipara tools, call snipara_help(list_all=true) in that session before concluding a tool is unavailable."
12464
+ "- A lean Snipara tool set is expected in normal agent sessions. Use snipara_help(query=...) for routed guidance and snipara_help(list_all=true) to inspect specialist opt-in surfaces."
12465
12465
  );
12466
12466
  if (toolCatalog.available && toolCatalog.htaskToolCount) {
12467
12467
  console.log(
@@ -29794,6 +29794,11 @@ var HOSTED_GUARD_MAX_FILES = 450;
29794
29794
  var HOSTED_GUARD_MAX_RESOURCES = 850;
29795
29795
  var HOSTED_GUARD_MAX_SYMBOL_RESOURCES = 160;
29796
29796
  var HOOK_BLOCK_PREFIX2 = "snipara:collaboration-guard";
29797
+ var CHECKOUT_GIT_WRITE_RESOURCE = {
29798
+ kind: "SURFACE",
29799
+ id: "checkout-git-write",
29800
+ label: "Checkout git write access"
29801
+ };
29797
29802
  var CRITICAL_SURFACES = [
29798
29803
  {
29799
29804
  id: "auth",
@@ -30647,6 +30652,9 @@ function resolveRepoRoot3(cwd) {
30647
30652
  }
30648
30653
  function deriveGuardProfileResources(profile, files) {
30649
30654
  const resources = [];
30655
+ if (profile === "pre-commit" || profile === "pre-push") {
30656
+ resources.push(CHECKOUT_GIT_WRITE_RESOURCE);
30657
+ }
30650
30658
  if (profile === "pre-deploy") {
30651
30659
  resources.push(
30652
30660
  { kind: "DEPLOY", id: "production-deployment", label: "Production deployment" },
@@ -30861,11 +30869,12 @@ function buildCollaborationGitHookBlock(hookName) {
30861
30869
  const profile = hookName === "pre-push" ? "pre-push" : "pre-commit";
30862
30870
  return [
30863
30871
  collaborationHookBlockMarker(hookName, "start"),
30864
- "# Block unsafe parallel edits before code leaves the local worktree.",
30872
+ "# Atomically claim checkout git writes, then block unsafe parallel edits.",
30865
30873
  'if [ "${SNIPARA_COLLABORATION_GUARD:-1}" = "0" ]; then',
30866
30874
  ' echo "Snipara collaboration guard bypassed by SNIPARA_COLLABORATION_GUARD=0" >&2',
30867
30875
  "elif command -v snipara-companion >/dev/null 2>&1; then",
30868
- ` snipara-companion collaboration guard --profile ${profile} --action ${profile} --enforce --json >/dev/null`,
30876
+ ` snipara-companion collaboration claim --resource SURFACE:checkout-git-write --mode EXCLUSIVE --ttl-seconds 300 --reason "${profile} git write" --json >/dev/null`,
30877
+ ` snipara-companion collaboration guard --profile ${profile} --action ${profile} --resource SURFACE:checkout-git-write --enforce --json >/dev/null`,
30869
30878
  "else",
30870
30879
  ' echo "snipara-companion is required for the Snipara collaboration guard. Install it or set SNIPARA_COLLABORATION_GUARD=0 for an explicit emergency bypass." >&2',
30871
30880
  " exit 1",
@@ -137,11 +137,11 @@ For Codex, the primary integration remains Hosted MCP plus `AGENTS.md`.
137
137
  - `snipara-companion` is still skippable with `--profile hosted-only` or `--skip-companion`.
138
138
  - Use it when compaction-safe phase commits, Project Intelligence briefs, local doctor checks, or shared helper workflows are useful.
139
139
  - Use `workflow scaffold --preset project-intelligence-continuity-layer` for roadmap-sized Project Intelligence work that needs phase commits.
140
- - If an agent session exposes only a subset of Snipara tools, use `snipara_help(list_all=true)` in that session before concluding a tool is unavailable.
140
+ - Normal agent sessions intentionally expose a small Snipara tool set. Use `snipara_help(query=...)` for routed guidance and `snipara_help(list_all=true)` to inspect specialist tools before requesting an expanded surface.
141
141
 
142
142
  ## Configuring MCP Tool Surfaces
143
143
 
144
- The MCP server advertises different tool surfaces depending on the `SNIPARA_EXPOSED_SURFACES` environment variable. Hosted MCP defaults to inline tools plus a small companion maintenance set for index health, reindexing, and read-only memory hygiene. To expose all companion tools directly in the advertised manifest, set `SNIPARA_EXPOSED_SURFACES=inline,companion` on the MCP server. To expose swarm and htask coordination tools, use `SNIPARA_EXPOSED_SURFACES=inline,orchestrator`. Remaining non-default tools are discoverable via `snipara_help` and can be executed by direct JSON-RPC or clients/server configurations that expose those surfaces. Standard MCP agents only receive schemas for tools returned by `tools/list`.
144
+ The MCP server advertises different tool surfaces depending on the `SNIPARA_EXPOSED_SURFACES` environment variable. Hosted MCP defaults to the lean agent contract: context, search, read, stats, help, memory recall/capture, and end-of-task commit. Specialist inline, companion, and orchestrator tools stay discoverable via `snipara_help`, which now marks them as `routed_or_opt_in`; standard agents should usually stay on the simple verbs and let Snipara route internally. To expose companion tools directly in the advertised manifest, set `SNIPARA_EXPOSED_SURFACES=inline,companion` on the MCP server. To expose swarm and htask coordination tools, use `SNIPARA_EXPOSED_SURFACES=inline,orchestrator`. Standard MCP agents only receive schemas for tools returned by `tools/list`.
145
145
 
146
146
  ## Installation
147
147
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snipara-companion",
3
- "version": "3.2.4",
3
+ "version": "3.2.5",
4
4
  "description": "Local-first CLI that asks your repo what breaks before an AI coding agent edits it.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {