supipowers 0.7.2 → 0.7.4
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,38 +1,77 @@
|
|
|
1
|
-
#
|
|
1
|
+
# context-mode — MANDATORY routing rules
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
##
|
|
5
|
+
## BLOCKED commands — do NOT attempt these
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
### Grep — BLOCKED
|
|
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
|
-
|
|
22
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
##
|
|
53
|
+
## Tool selection hierarchy
|
|
37
54
|
|
|
38
|
-
|
|
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 |
|
|
@@ -92,10 +92,9 @@ export function registerContextModeHooks(pi: ExtensionAPI, config: SupipowersCon
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
// Phase 1: routing instructions
|
|
96
|
-
|
|
97
|
-
if (!
|
|
98
|
-
if (!cachedStatus.available) return;
|
|
95
|
+
// Phase 1: routing instructions — always inject when enforceRouting is on,
|
|
96
|
+
// regardless of MCP tool detection (tools may load after this hook fires)
|
|
97
|
+
if (!config.contextMode.routingInstructions && !config.contextMode.enforceRouting) return;
|
|
99
98
|
|
|
100
99
|
const skill = loadRoutingSkill();
|
|
101
100
|
if (!skill) return;
|