@grundy40/contextslice 0.3.1 → 0.3.2

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
@@ -33,13 +33,15 @@ npx @grundy40/contextslice --version
33
33
  npx @grundy40/contextslice --help
34
34
  ```
35
35
 
36
- Or install globally if you prefer short commands (`ctxslice` and `ctxslice-mcp`):
36
+ Or install globally (`npm install -g @grundy40/contextslice`) if you prefer short commands (`contextslice`, `ctxslice`, and `ctxslice-mcp`):
37
37
 
38
38
  ```bash
39
39
  npm install -g @grundy40/contextslice
40
- ctxslice "retry queue" --budget 32768
40
+ contextslice "retry queue" --budget 32768
41
41
  ```
42
42
 
43
+ Prefer a visual browser UI? Try the **Live Demo** at [https://grundy40.github.io/ContextSlice/](https://grundy40.github.io/ContextSlice/).
44
+
43
45
  ---
44
46
 
45
47
  ## Connect 1-Tool MCP to AI Coding Agents
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * ctxslice-mcp.mjs — Global Multi-Language MCP Server v0.3.1
3
+ * ctxslice-mcp.mjs — Global Multi-Language MCP Server v0.3.2
4
4
  * Features: Embedded Base64 Tree-sitter WASM + Lazy Cache (~/.contextslice/parsers),
5
5
  * State-Machine Brace Matcher Fallback, True Call Graph (BFS), TF-IDF, subPath Sandbox, mtime Cache
6
6
  */
@@ -11,7 +11,7 @@ import readline from 'node:readline';
11
11
  import { createRequire } from 'node:module';
12
12
 
13
13
  if (process.argv.includes('--version') || process.argv.includes('-v')) {
14
- process.stdout.write('ctxslice-mcp v0.3.1\n');
14
+ process.stdout.write('ctxslice-mcp v0.3.2\n');
15
15
  process.exit(0);
16
16
  }
17
17
 
@@ -381,7 +381,7 @@ function expandQueryTerms(query) {
381
381
 
382
382
  const TOOL_DEF = {
383
383
  name: 'get_context_slice',
384
- description: 'PRIMARY code-reading tool (v0.3.1) with Tree-sitter WASM / State-Machine AST parsing, True Call Graph, TF-IDF & omitted summary.',
384
+ description: 'PRIMARY code-reading tool (v0.3.2) with Tree-sitter WASM / State-Machine AST parsing, True Call Graph, TF-IDF & omitted summary.',
385
385
  annotations: { readOnlyHint: true },
386
386
  inputSchema: {
387
387
  type: 'object',
@@ -1058,7 +1058,7 @@ async function sliceProject(query, projectPath, budget = 32768, autoExpand = tru
1058
1058
 
1059
1059
  const expandTag = autoExpandedNames.length > 0 ? ` autoExpanded="${autoExpandedNames.join(',')}"` : '';
1060
1060
  const subPathTag = subPath ? ` subPath="${subPath}"` : '';
1061
- return `<context_slice root="${root}" version="0.3.1"${subPathTag} budget="${budget}" used="${used}"${expandTag}>\n<skeletons>\n${finalSkelChunks.join('\n')}\n</skeletons>\n<focal>\n${fullChunks.join('\n\n')}\n</focal>${omittedTag}\n</context_slice>`;
1061
+ return `<context_slice root="${root}" version="0.3.2"${subPathTag} budget="${budget}" used="${used}"${expandTag}>\n<skeletons>\n${finalSkelChunks.join('\n')}\n</skeletons>\n<focal>\n${fullChunks.join('\n\n')}\n</focal>${omittedTag}\n</context_slice>`;
1062
1062
  } catch (err) {
1063
1063
  return `Error: ${err.message}`;
1064
1064
  }
@@ -1077,7 +1077,7 @@ rl.on('line', async (line) => {
1077
1077
  return send({
1078
1078
  protocolVersion: req.params?.protocolVersion || '2024-11-05',
1079
1079
  capabilities: { tools: {} },
1080
- serverInfo: { name: 'ctxslice-thin', version: '0.3.1' }
1080
+ serverInfo: { name: 'ctxslice-thin', version: '0.3.2' }
1081
1081
  });
1082
1082
  }
1083
1083
  if (req.method === 'ping') return send({});
package/bin/ctxslice.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * ctxslice.mjs — Zero-Config Multi-Language Local AST Context Pre-Compiler (v0.3.1)
3
+ * ctxslice.mjs — Zero-Config Multi-Language Local AST Context Pre-Compiler (v0.3.2)
4
4
  * Features: Multi-Language AST Extractors, State-Machine Brace Matcher, True Call Graph (BFS), TF-IDF, Directory Quota Cap
5
5
  */
6
6
  import fs from 'node:fs';
@@ -372,12 +372,12 @@ function expandQueryTerms(query) {
372
372
 
373
373
  const args = process.argv.slice(2);
374
374
  if (args.includes('--version') || args.includes('-v')) {
375
- process.stdout.write('ctxslice v0.3.1\n');
375
+ process.stdout.write('ctxslice v0.3.2\n');
376
376
  process.exit(0);
377
377
  }
378
378
  if (args.includes('--help') || args.includes('-h')) {
379
379
  process.stdout.write(
380
- 'ContextSlice CLI v0.3.1 — Zero-Config Multi-Language AST Slicer\n\n' +
380
+ 'ContextSlice CLI v0.3.2 — Zero-Config Multi-Language AST Slicer\n\n' +
381
381
  'Usage:\n ctxslice "<query>" [--root <dir>] [--budget <tokens>]\n\n' +
382
382
  'Options:\n --root <dir> Target repository path (default: current directory)\n' +
383
383
  ' --budget <num> Max token budget (default: 32768)\n' +
@@ -696,7 +696,7 @@ while (qHead < bfsQ.length) {
696
696
  }
697
697
 
698
698
  let remaining = budget;
699
- const out = ['<context_slice root="' + path.basename(targetRoot) + '" version="0.3.1" budget="' + budget + '">'];
699
+ const out = ['<context_slice root="' + path.basename(targetRoot) + '" version="0.3.2" budget="' + budget + '">'];
700
700
  const includedIds = new Set();
701
701
  const dirBudgetUsed = {};
702
702
  const maxDirBudget = budget * 0.65;
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@grundy40/contextslice",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Zero-dependency multi-language AST code slicer & 1-Tool MCP server for AI coding assistants (Claude Code, OpenCode, Pi Agent, Cursor).",
5
5
  "type": "module",
6
6
  "bin": {
7
+ "contextslice": "./bin/ctxslice.mjs",
7
8
  "ctxslice": "./bin/ctxslice.mjs",
8
9
  "ctxslice-mcp": "./bin/ctxslice-mcp.mjs"
9
10
  },