supipowers 0.7.2 → 0.7.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supipowers",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "OMP-native workflow extension inspired by supipowers.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,38 +1,77 @@
1
- # Context Mode Tool Routing Instructions
1
+ # context-modeMANDATORY routing rules
2
2
 
3
- When context-mode sandbox tools are available, prefer them over raw tool calls to keep your context window lean.
3
+ You have context-mode MCP tools available. These rules are NOT optional they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session.
4
4
 
5
- ## Tool Selection Hierarchy
5
+ ## BLOCKED commands — do NOT attempt these
6
6
 
7
- Use context-mode tools in this priority order:
7
+ ### curl / wget BLOCKED
8
+ Any Bash command containing `curl` or `wget` is intercepted and replaced with an error message. Do NOT retry.
9
+ Instead use:
10
+ - `ctx_fetch_and_index(url, source)` to fetch and index web pages
11
+ - `ctx_execute(language: "javascript", code: "const r = await fetch(...)")` to run HTTP calls in sandbox
8
12
 
9
- 1. **ctx_batch_execute**for multi-step operations. Runs multiple commands and searches in a single call.
10
- - Use when: you need to run 2+ commands, or combine a command with a search
11
- - Example: checking a build AND searching for a symbol
13
+ ### Inline HTTP BLOCKED
14
+ Any Bash command containing `fetch('http`, `requests.get(`, `requests.post(`, `http.get(`, or `http.request(` is intercepted and replaced with an error message. Do NOT retry with Bash.
15
+ Instead use:
16
+ - `ctx_execute(language, code)` to run HTTP calls in sandbox — only stdout enters context
12
17
 
13
- 2. **ctx_search** for querying previously indexed knowledge. No re-execution needed.
14
- - Use when: you've already indexed data and need to find something in it
15
- - Example: finding a function definition you indexed earlier
18
+ ### WebFetch / Fetch BLOCKED
19
+ WebFetch and Fetch calls are denied entirely.
20
+ Instead use:
21
+ - `ctx_fetch_and_index(url, source)` then `ctx_search(queries)` to query the indexed content
16
22
 
17
- 3. **ctx_execute / ctx_execute_file** for single commands or file processing.
18
- - Use when: running one command whose output would be large
19
- - Example: listing a directory, reading a large log file
23
+ ### GrepBLOCKED
24
+ Grep calls are intercepted and blocked. Do NOT retry with Grep.
25
+ Instead use:
26
+ - `ctx_search(queries: ["<pattern>"])` to search indexed content
27
+ - `ctx_batch_execute(commands, queries)` to run searches and return compressed results
28
+ - `ctx_execute(language: "shell", code: "grep ...")` to run searches in sandbox
20
29
 
21
- 4. **Raw Bash/Read/Grep**only when necessary.
22
- - Use when: editing files (Read before Edit), running build/test commands where real-time output matters, or when the output is known to be small
30
+ ### Find / Glob BLOCKED
31
+ Find/Glob calls are intercepted and blocked. Do NOT retry with Find/Glob.
32
+ Instead use:
33
+ - `ctx_execute(language: "shell", code: "find ...")` to run in sandbox
34
+ - `ctx_batch_execute(commands, queries)` for multiple searches
23
35
 
24
- ## Forbidden Patterns
36
+ ### Read (full-file, no limit) — BLOCKED
37
+ Reading an entire file without a `limit` parameter is blocked.
38
+ - If you need to **Edit** the file → re-call Read with `limit` parameter (e.g., `limit: 200`)
39
+ - If you need to **analyze or explore** → use `ctx_execute_file(path, language, code)` instead. Only your printed summary enters context.
25
40
 
26
- - Do NOT use Bash for `curl`/`wget`/HTTP requests — use `ctx_fetch_and_index` instead
27
- - Do NOT use Read for analyzing large files (>100 lines) — use `ctx_execute_file` to process and summarize
28
- - Do NOT use Bash for directory listings with >20 expected files — use `ctx_execute`
41
+ ## REDIRECTED tools — use sandbox equivalents
29
42
 
30
- ## Output Constraints
43
+ ### Bash (>20 lines output)
44
+ Bash is ONLY for: `git`, `mkdir`, `rm`, `mv`, `cd`, `ls`, `npm install`, `pip install`, and other short-output commands.
45
+ For everything else, use:
46
+ - `ctx_batch_execute(commands, queries)` — run multiple commands + search in ONE call
47
+ - `ctx_execute(language: "shell", code: "...")` — run in sandbox, only stdout enters context
31
48
 
32
- - Keep tool output responses under 500 words when possible
33
- - Write large artifacts (generated code, data dumps) to files rather than returning them inline
34
- - Prefer structured summaries over raw output
49
+ ### Read (for analysis)
50
+ If you are reading a file to **Edit** it Read with `limit` is correct (Edit needs content in context).
51
+ If you are reading to **analyze, explore, or summarize** → use `ctx_execute_file(path, language, code)` instead. Only your printed summary enters context. The raw file content stays in the sandbox.
35
52
 
36
- ## Sub-Agent Awareness
53
+ ## Tool selection hierarchy
37
54
 
38
- These routing instructions apply within sub-agent sessions. When you are a sub-agent dispatched by supipowers, follow the same tool preference hierarchy.
55
+ 1. **GATHER**: `ctx_batch_execute(commands, queries)` Primary tool. Runs all commands, auto-indexes output, returns search results. ONE call replaces 30+ individual calls.
56
+ 2. **FOLLOW-UP**: `ctx_search(queries: ["q1", "q2", ...])` — Query indexed content. Pass ALL questions as array in ONE call.
57
+ 3. **PROCESSING**: `ctx_execute(language, code)` | `ctx_execute_file(path, language, code)` — Sandbox execution. Only stdout enters context.
58
+ 4. **WEB**: `ctx_fetch_and_index(url, source)` then `ctx_search(queries)` — Fetch, chunk, index, query. Raw HTML never enters context.
59
+ 5. **INDEX**: `ctx_index(content, source)` — Store content in FTS5 knowledge base for later search.
60
+
61
+ ## Subagent routing
62
+
63
+ When spawning subagents (Agent/Task tool), the routing block is automatically injected into their prompt. Bash-type subagents are upgraded to general-purpose so they have access to MCP tools. You do NOT need to manually instruct subagents about context-mode.
64
+
65
+ ## Output constraints
66
+
67
+ - Keep responses under 500 words.
68
+ - Write artifacts (code, configs, PRDs) to FILES — never return them as inline text. Return only: file path + 1-line description.
69
+ - When indexing content, use descriptive source labels so others can `ctx_search(source: "label")` later.
70
+
71
+ ## ctx commands
72
+
73
+ | Command | Action |
74
+ |---------|--------|
75
+ | `ctx stats` | Call the `ctx_stats` MCP tool and display the full output verbatim |
76
+ | `ctx doctor` | Call the `ctx_doctor` MCP tool, run the returned shell command, display as checklist |
77
+ | `ctx upgrade` | Call the `ctx_upgrade` MCP tool, run the returned shell command, display as checklist |
@@ -94,7 +94,8 @@ export function registerContextModeHooks(pi: ExtensionAPI, config: SupipowersCon
94
94
 
95
95
  // Phase 1: routing instructions
96
96
  if (!config.contextMode.routingInstructions) return;
97
- if (!cachedStatus) cachedStatus = detectContextMode(pi.getActiveTools());
97
+ // Always re-detect: MCP tools may load after extension init
98
+ cachedStatus = detectContextMode(pi.getActiveTools());
98
99
  if (!cachedStatus.available) return;
99
100
 
100
101
  const skill = loadRoutingSkill();