repowisestage 0.0.60 → 0.0.62

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.
@@ -1481,7 +1481,7 @@ import { promises as fs } from "fs";
1481
1481
  import { createGunzip } from "zlib";
1482
1482
  import { spawn as spawn4 } from "child_process";
1483
1483
  import { pipeline } from "stream/promises";
1484
- import { createHash as createHash2 } from "crypto";
1484
+ import { createHash as createHash3 } from "crypto";
1485
1485
  import { join as join15, dirname as dirname5 } from "path";
1486
1486
  function getNativeLspDir() {
1487
1487
  return join15(getLspInstallDir(), "native");
@@ -1721,7 +1721,7 @@ async function downloadFile(url, dest) {
1721
1721
  await pipeline(res.body, sink);
1722
1722
  }
1723
1723
  async function sha256File(path) {
1724
- const hash = createHash2("sha256");
1724
+ const hash = createHash3("sha256");
1725
1725
  const data = await fs.readFile(path);
1726
1726
  hash.update(data);
1727
1727
  return hash.digest("hex");
@@ -3028,6 +3028,7 @@ import lockfile4 from "proper-lockfile";
3028
3028
  // ../../packages/shared/dist/lib/ai-tools.js
3029
3029
  import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2, readdir, stat, unlink as unlink2 } from "fs/promises";
3030
3030
  import { join as join3, dirname } from "path";
3031
+ import { createHash } from "crypto";
3031
3032
 
3032
3033
  // ../../packages/shared/dist/lib/project-overview-injection.js
3033
3034
  var START_MARKER = "<!-- repowise:agent-instructions:start -->";
@@ -3046,7 +3047,7 @@ Treat RepoWise as your default starting point for every task that touches this c
3046
3047
  2. **Use the three-tier hierarchy in this order:**
3047
3048
  - **Tier 1 \u2014 RepoWise MCP** for surgical structural queries: symbol resolution, callers, references, call graphs, refactor impact, dependency graphs, type info (\`find_symbol\`, \`get_impact\`, \`lsp_definition\`, etc. \u2014 the server is named "RepoWise MCP for <repo>", so hosts that prefix tool names expose them accordingly). Each tool's description tells you when to use it.
3048
3049
  - **Tier 2 \u2014 Context files in \`repowise-context/\`** for narrative context: how a domain is designed, what patterns exist, what conventions to follow. Use the *Context File Routing Map* below to pick which files to read.
3049
- - **Tier 3 \u2014 Native code search** (\`read_file\` / \`grep\` / \`glob\` on raw source) ONLY when tiers 1-2 don't cover the question, or for ephemeral state (recent commits, in-flight branches).
3050
+ - **Tier 3 \u2014 Native code search** (\`read_file\` / \`grep\` / \`glob\` on raw source) ONLY when tiers 1-2 don't cover the question, or for ephemeral state (recent commits, in-flight branches). An enforcement hook may DENY a Tier-3 search until you have used Tier 1 or Tier 2 this turn \u2014 that is expected, not an error: consult RepoWise first, then retry the same search and it will proceed.
3050
3051
 
3051
3052
  3. **Batch tool calls in parallel.** For maximum efficiency, whenever you need multiple independent operations to gather context, invoke all relevant tools SIMULTANEOUSLY rather than sequentially. Examples:
3052
3053
  - Reading 3 context files \u2192 3 \`read_file\` calls in parallel.
@@ -3072,7 +3073,7 @@ Treat RepoWise as your default starting point for every task that touches this c
3072
3073
 
3073
3074
  That's it \u2014 one short line, no longer preamble. The host's tool-call UI already shows RepoWise MCP calls visibly; this tag adds the same surface for context-file reads. If you didn't use RepoWise on this turn, omit the tag \u2014 never fake it.
3074
3075
 
3075
- 8. **Surface MCP gaps explicitly.** If RepoWise MCP is unavailable (no \`.mcp.json\` configured, listener not running), tell the user \u2014 don't silently fall back to \`grep\`.
3076
+ 8. **MCP unavailable vs. a RepoWise miss \u2014 handle them differently.** If RepoWise MCP is entirely unavailable (no \`.mcp.json\` configured, listener not running), tell the user. But if RepoWise IS available and simply does not cover a specific question, just continue with Tier 3 \u2014 do NOT announce that "RepoWise doesn't have it." That fallback is normal and expected; the system records it on its own to improve coverage.
3076
3077
  ${END_MARKER}`;
3077
3078
  function injectAgentInstructions(content) {
3078
3079
  const lineEnding = content.includes("\r\n") ? "\r\n" : "\n";
@@ -3520,7 +3521,8 @@ async function removeClaudeHooksFromRepo(repoRoot) {
3520
3521
  }
3521
3522
 
3522
3523
  // ../../packages/shared/dist/lib/ai-tools.js
3523
- var AI_TOOLS_REFERENCE_REV = 2;
3524
+ var AI_TOOLS_REFERENCE_REV = 3;
3525
+ var AGENT_INSTRUCTIONS_HASH = createHash("sha256").update(AI_AGENT_USAGE_INSTRUCTIONS).digest("hex").slice(0, 12);
3524
3526
  var AI_TOOL_CONFIG = {
3525
3527
  cursor: {
3526
3528
  label: "Cursor",
@@ -4683,13 +4685,13 @@ function comparePrerelease(a, b) {
4683
4685
  }
4684
4686
 
4685
4687
  // ../listener/dist/lib/binary-integrity.js
4686
- import { createHash } from "crypto";
4688
+ import { createHash as createHash2 } from "crypto";
4687
4689
  import { lstat, open as open3, readdir as readdir2 } from "fs/promises";
4688
4690
  import { constants as fsConstants } from "fs";
4689
4691
  import { join as join12, resolve as pathResolve } from "path";
4690
4692
  async function verifyBinary(check) {
4691
4693
  const fh = await open3(check.path, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);
4692
- const hash = createHash("sha256");
4694
+ const hash = createHash2("sha256");
4693
4695
  try {
4694
4696
  const stream = fh.createReadStream();
4695
4697
  for await (const chunk of stream) {
@@ -6078,7 +6080,7 @@ init_config_dir();
6078
6080
  import { createServer } from "http";
6079
6081
  import { mkdir as mkdir14, writeFile as writeFile14 } from "fs/promises";
6080
6082
  import { dirname as dirname13, join as join21 } from "path";
6081
- import { createHash as createHash3, randomUUID as randomUUID2 } from "crypto";
6083
+ import { createHash as createHash4, randomUUID as randomUUID2 } from "crypto";
6082
6084
 
6083
6085
  // ../listener/dist/mcp/sanitize.js
6084
6086
  var MCP_RESPONSE_BYTE_CAP = 200 * 1024;
@@ -7547,7 +7549,7 @@ function redactArgs(body) {
7547
7549
  return out;
7548
7550
  }
7549
7551
  function redactString(s) {
7550
- const hash = createHash3("sha256").update(s).digest("hex").slice(0, 16);
7552
+ const hash = createHash4("sha256").update(s).digest("hex").slice(0, 16);
7551
7553
  return `<redacted:${s.length.toString()}:${hash}>`;
7552
7554
  }
7553
7555
  var TOOL_TIMEOUT_MS_LSP = 3e4;
@@ -9799,7 +9801,7 @@ async function runDownloaderCycle(input, fetchImpl = fetch) {
9799
9801
  // ../listener/dist/typed-resolution/committed-checkout.js
9800
9802
  init_config_dir();
9801
9803
  import { execFile as execFileCb3 } from "child_process";
9802
- import { createHash as createHash4 } from "crypto";
9804
+ import { createHash as createHash5 } from "crypto";
9803
9805
  import { mkdir as mkdir15, readdir as readdir5, rm, stat as stat6 } from "fs/promises";
9804
9806
  import { join as join39 } from "path";
9805
9807
  import { promisify as promisify6 } from "util";
@@ -9851,7 +9853,7 @@ async function prepareCommittedTree(repoRoot, commitSha, options = {}) {
9851
9853
  return null;
9852
9854
  }
9853
9855
  const base = options.worktreeBase ?? worktreeBaseDir();
9854
- const dirName = createHash4("sha256").update(`${repoRoot}\0${commitSha}`).digest("hex").slice(0, 16) + "-" + commitSha.slice(0, 12);
9856
+ const dirName = createHash5("sha256").update(`${repoRoot}\0${commitSha}`).digest("hex").slice(0, 16) + "-" + commitSha.slice(0, 12);
9855
9857
  const worktreePath = join39(base, dirName);
9856
9858
  try {
9857
9859
  await mkdir15(base, { recursive: true });
@@ -10219,6 +10221,7 @@ async function updateToolConfigsForRepo(localPath, config2, state, repoId) {
10219
10221
  return;
10220
10222
  const hash = JSON.stringify({
10221
10223
  rev: AI_TOOLS_REFERENCE_REV,
10224
+ block: AGENT_INSTRUCTIONS_HASH,
10222
10225
  tools,
10223
10226
  files: contextFiles.map((f) => f.fileName)
10224
10227
  });
@@ -11371,7 +11374,7 @@ import chalk8 from "chalk";
11371
11374
  import ora from "ora";
11372
11375
 
11373
11376
  // src/lib/auth.ts
11374
- import { createHash as createHash5, randomBytes as randomBytes3 } from "crypto";
11377
+ import { createHash as createHash6, randomBytes as randomBytes3 } from "crypto";
11375
11378
  import { readFile as readFile15, writeFile as writeFile17, mkdir as mkdir18, chmod as chmod4, unlink as unlink11 } from "fs/promises";
11376
11379
  import http from "http";
11377
11380
  import { join as join43 } from "path";
@@ -11398,7 +11401,7 @@ function generateCodeVerifier() {
11398
11401
  return randomBytes3(32).toString("base64url");
11399
11402
  }
11400
11403
  function generateCodeChallenge(verifier) {
11401
- return createHash5("sha256").update(verifier).digest("base64url");
11404
+ return createHash6("sha256").update(verifier).digest("base64url");
11402
11405
  }
11403
11406
  function generateState() {
11404
11407
  return randomBytes3(32).toString("hex");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repowisestage",
3
- "version": "0.0.60",
3
+ "version": "0.0.62",
4
4
  "type": "module",
5
5
  "description": "AI-optimized codebase context generator",
6
6
  "bin": {