pi-open-agents 0.1.15 → 0.1.17

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
@@ -34,6 +34,38 @@ Existing `.agent.md` files work without changes (default `mode: all`).
34
34
 
35
35
  ---
36
36
 
37
+ ## Agents vs subagents (and why you need both)
38
+
39
+ People tend to lump "agents" and "subagents" together. They're not the same
40
+ thing, and the difference is the whole game.
41
+
42
+ An **agent** changes *your* session. Switch to one and the conversation you're
43
+ already having starts thinking with a different brain — different prompt,
44
+ different model, different tools, different rules. The thread keeps going;
45
+ what's running it changes. Planning wants a slow, deliberate mind. Coding wants
46
+ a fast one. Reviewing wants a skeptic. An agent is how you become the right one
47
+ for the moment.
48
+
49
+ A **subagent** never touches your session. It's a separate process you spin up
50
+ for one job — usually on a cheaper, faster model, with locked-down permissions
51
+ — that works in isolation and hands you back an answer. Your context stays
52
+ clean; your main model keeps its focus.
53
+
54
+ The payoff is using both. You sit in an **orchestrator** agent — the strong
55
+ model holding the plan — and delegate the grunt work to subagents: search these
56
+ five hundred files, run that test matrix, draft the boilerplate. One mind to
57
+ think, many hands to do. You get the big model's reasoning *and* the small
58
+ models' speed and economy, without one poisoning the other's context.
59
+
60
+ And the moment you delegate, control stops being optional. A subagent is a real
61
+ process with real tools — it can read your secrets, rewrite your files, run
62
+ shell. So you choose its model, set its thinking level, clip its permissions to
63
+ *read-only* or *git-only*, cap how deep it can recurse, decide who's even
64
+ allowed to spawn whom. That's not red tape. It's what turns *delegate and pray*
65
+ into *delegate and trust* — and it's exactly what this plugin gives you.
66
+
67
+ ---
68
+
37
69
  ## Why this exists
38
70
 
39
71
  Pi splits agent management across two separate plugins — one for primary agents,
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: explorer
3
+ mode: subagent
4
+ description: Dedicated investigation and reconnaissance agent for codebases, remote systems, REST APIs, and log sources. Returns structured, dense findings ready for direct use by the calling agent.
5
+ # tools: ['vscode', 'execute', 'read', 'agent', 'edit', 'search', 'web', 'todo']
6
+ ---
7
+
8
+ You are an investigation agent. You explore codebases, remote systems, REST APIs, and log sources, then return precise, structured findings.
9
+
10
+ ## Scope
11
+
12
+ | Domain | Examples |
13
+ |--------|----------|
14
+ | **Codebases** | Directory trees, file contents, dependency graphs, architecture, call chains |
15
+ | **Remote systems** | SSH commands, cluster inspections, process lists, service status |
16
+ | **REST APIs** | Endpoint discovery, request/response probing, auth flows, error patterns |
17
+ | **Log sources** | Log files, journalctl, container logs, structured JSON logs, error correlation |
18
+
19
+ ## Principles
20
+
21
+ 1. **Answer the question, nothing else.** The calling agent gave you a specific task — deliver exactly what was asked.
22
+ 2. **Be precise.** File paths, line numbers, exact values, command output. No vagueness.
23
+ 3. **Be dense.** Strip filler. Every line in your response should carry information the caller needs.
24
+ 4. **Show evidence.** Quote relevant code, paste relevant output. The caller should not need to re-verify.
25
+ 5. **Structure the answer.** Use headings, tables, bullet lists — make it scannable. Start with a one-line TL;DR when the answer is complex.
26
+
27
+ ## Investigation Method
28
+
29
+ Adapt to the target. Do not follow a rigid checklist.
30
+
31
+ For **codebases**: identify entry points, trace the relevant path, report what you found and where.
32
+ For **remote systems**: run targeted commands, report exact output, flag anything unexpected.
33
+ For **APIs**: probe endpoints, capture status codes and response shapes, document the contract.
34
+ For **logs**: filter to the relevant window/level, correlate events, report patterns and anomalies.
35
+
36
+ If the task is broad ("explore this repo"), give a high-level architecture overview. If the task is specific ("how does auth work in module X"), trace the exact flow end-to-end.
37
+
38
+ ## Output Contract
39
+
40
+ Your response is the only thing the calling agent sees. It must be:
41
+ - **Self-contained** — no "you should also check…"; if something is relevant, include it now
42
+ - **Actionable** — the caller can make decisions from your answer without further exploration
43
+ - **Compact** — no preamble, no summary-of-what-you-did; just the findings
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-open-agents",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Unified agent and subagent management for pi coding agent, with OpenCode-compatible agent definitions.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -30,7 +30,8 @@
30
30
  "src/",
31
31
  "README.md",
32
32
  "LICENSE",
33
- "ATTRIBUTION.md"
33
+ "ATTRIBUTION.md",
34
+ "agents/"
34
35
  ],
35
36
  "scripts": {
36
37
  "typecheck": "tsc --noEmit",
@@ -64,7 +64,8 @@ async function applyModel(agent: AgentDefinition, pi: ExtensionAPI, ctx: Extensi
64
64
  * Falls back to the session's current thinking level if agent doesn't specify one.
65
65
  */
66
66
  function applyThinking(agent: AgentDefinition, pi: ExtensionAPI): void {
67
- pi.setThinkingLevel(agent.thinking);
67
+ // Cast: pi-open-agents accepts "max" (aligned with CLI); pi-agent-core type lags behind
68
+ pi.setThinkingLevel(agent.thinking as any);
68
69
  }
69
70
 
70
71
  // ─── Tool Filtering ──────────────────────────────────────────────────────────
@@ -82,8 +82,8 @@ export class AgentManager {
82
82
  if (this.originalState.model) {
83
83
  await pi.setModel(this.originalState.model);
84
84
  }
85
- // Restore thinking level
86
- pi.setThinkingLevel(this.originalState.thinkingLevel);
85
+ // Restore thinking level (cast: pi-agent-core type lags behind on "max")
86
+ pi.setThinkingLevel(this.originalState.thinkingLevel as any);
87
87
  // Restore tools
88
88
  pi.setActiveTools(this.originalState.toolNames);
89
89
  } else {
package/src/types.ts CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  export type AgentMode = "primary" | "subagent" | "all";
12
12
 
13
- export type ThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
13
+ export type ThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
14
14
 
15
15
  export type SystemPromptMode = "append" | "replace" | "replace-all";
16
16
 
@@ -19,7 +19,7 @@ export type PermissionAction = "allow" | "deny" | "ask";
19
19
  export type AgentSource = "global" | "project";
20
20
 
21
21
  export const THINKING_LEVELS: readonly ThinkingLevel[] = [
22
- "off", "minimal", "low", "medium", "high", "xhigh",
22
+ "off", "minimal", "low", "medium", "high", "xhigh", "max",
23
23
  ] as const;
24
24
 
25
25
  export const SYSTEM_PROMPT_MODES: readonly SystemPromptMode[] = [