@nmzpy/pi-ember-stack 0.1.6 → 0.2.1
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 +12 -2
- package/plugins/devin-auth/extensions/index.ts +45 -7
- package/plugins/devin-auth/src/models.ts +42 -196
- package/plugins/index.ts +29 -6
- package/plugins/pi-compact-tools/index.ts +16 -191
- package/plugins/pi-compact-tools/renderer.ts +419 -0
- package/plugins/pi-custom-agents/index.ts +489 -343
- package/plugins/pi-custom-agents/subagent/agents/coder.md +1 -0
- package/plugins/pi-custom-agents/subagent/agents/scout.md +16 -37
- package/plugins/pi-custom-agents/subagent/extensions/index.ts +2 -2
- package/plugins/pi-custom-agents/subagent/extensions/runner.ts +31 -5
- package/plugins/pi-ember-fff/index.ts +717 -0
- package/plugins/pi-ember-fff/query.ts +87 -0
- package/plugins/pi-ember-fff/test/query.test.ts +66 -0
- package/plugins/pi-ember-fff/test/renderer.test.ts +376 -0
- package/plugins/pi-ember-tps/index.ts +122 -0
- package/plugins/pi-ember-ui/ember.json +96 -0
- package/plugins/pi-ember-ui/index.ts +618 -0
- package/plugins/pi-ember-ui/mode-colors.ts +168 -0
- package/tsconfig.json +2 -1
- package/plugins/pi-custom-agents/subagent/agents/architect.md +0 -56
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
model: devin/glm-5-2
|
|
2
3
|
name: coder
|
|
3
4
|
description: Implementation agent for writing, editing, testing, and verifying code. Spawn this for focused implementation tasks — bug fixes, feature additions, refactors, file edits. Full tool access.
|
|
4
5
|
tools: read, bash, edit, write, grep, find, ls
|
|
@@ -1,44 +1,23 @@
|
|
|
1
1
|
---
|
|
2
|
+
thinking: high
|
|
3
|
+
model: devin/glm-5-2
|
|
2
4
|
name: scout
|
|
3
|
-
description: Fast
|
|
4
|
-
tools: read, grep, find, ls
|
|
5
|
-
thinking: low
|
|
5
|
+
description: Fast agent specialized for exploring codebases. Use when you need to quickly find files by patterns, search code for keywords, or answer questions about the codebase.
|
|
6
|
+
tools: read, bash, grep, find, ls
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-
You are a
|
|
9
|
+
You are a file search specialist. You excel at thoroughly navigating and exploring codebases.
|
|
9
10
|
|
|
10
|
-
Your
|
|
11
|
+
Your strengths:
|
|
12
|
+
- Rapidly finding files using glob patterns
|
|
13
|
+
- Searching code and text with powerful regex patterns
|
|
14
|
+
- Reading and analyzing file contents
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
+
Guidelines:
|
|
17
|
+
- Use Glob for broad file pattern matching
|
|
18
|
+
- Use Grep for searching file contents with regex
|
|
19
|
+
- Use Read when you know the specific file path you need to read
|
|
20
|
+
- Use Bash for file operations like copying, moving, or listing directory contents
|
|
21
|
+
- Return file paths as absolute paths in your final response
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
1. grep/find to locate relevant code
|
|
19
|
-
2. Read key sections (not entire files)
|
|
20
|
-
3. Identify types, interfaces, key functions
|
|
21
|
-
4. Note dependencies between files
|
|
22
|
-
|
|
23
|
-
Output format:
|
|
24
|
-
|
|
25
|
-
## Evidence
|
|
26
|
-
List exact file/symbol anchors and relevant line ranges:
|
|
27
|
-
1. `path/to/file.ts` (lines 10-50) - Description of what's here
|
|
28
|
-
2. `path/to/other.ts` (lines 100-150) - Description
|
|
29
|
-
3. ...
|
|
30
|
-
|
|
31
|
-
## Key Code
|
|
32
|
-
Critical types, interfaces, or functions:
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
interface Example {
|
|
36
|
-
// actual code from the files
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Architecture
|
|
41
|
-
Brief explanation of how the pieces connect.
|
|
42
|
-
|
|
43
|
-
## Start Here
|
|
44
|
-
Which file to look at first and why.
|
|
23
|
+
Complete the user's search request efficiently and report your findings clearly.
|
|
@@ -149,11 +149,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
149
149
|
// Proactively steer agents toward sub-agent delegation when users mention it
|
|
150
150
|
pi.on("before_agent_start", async (event) => {
|
|
151
151
|
const prompt = event.prompt.toLowerCase();
|
|
152
|
-
if (/\b(delegate to|use a subagent|run in parallel|spawn an agent|scout|review this|chain|worker agent)\b/.test(prompt)) {
|
|
152
|
+
if (/\b(delegate to|use a subagent|run in parallel|spawn an agent|scout|explore|review this|chain|worker agent)\b/.test(prompt)) {
|
|
153
153
|
return {
|
|
154
154
|
systemPrompt:
|
|
155
155
|
event.systemPrompt +
|
|
156
|
-
"\n\nThe subagent tool is available for delegating tasks to specialized agents with isolated context. Use /subagent to list available agents. Bundled: scout (fast
|
|
156
|
+
"\n\nThe subagent tool is available for delegating tasks to specialized agents with isolated context. Use /subagent to list available agents. Bundled: scout (fast codebase exploration), coder (implementation), reviewer (code review), worker (general implementation), general-purpose (fallback). Modes: single, parallel (max 8), chain.",
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
});
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* separate `pi` process. This eliminates cold-start overhead and allows
|
|
6
6
|
* fine-grained control over token budget:
|
|
7
7
|
*
|
|
8
|
-
* -
|
|
9
|
-
*
|
|
8
|
+
* - The agent's system prompt is prepended with project context files
|
|
9
|
+
* (AGENTS.md from cwd and ancestors) so sub-agents share the same
|
|
10
|
+
* codebase conventions as the main agent.
|
|
11
|
+
* - No extensions, no skills, no prompt templates loaded.
|
|
10
12
|
* - Thinking disabled, compaction disabled, retry disabled.
|
|
11
13
|
* - In-memory session (no disk I/O).
|
|
12
14
|
* - Shared auth/model infrastructure (no re-connection).
|
|
@@ -20,12 +22,28 @@ import {
|
|
|
20
22
|
AuthStorage,
|
|
21
23
|
createAgentSession,
|
|
22
24
|
createExtensionRuntime,
|
|
25
|
+
getAgentDir,
|
|
26
|
+
loadProjectContextFiles,
|
|
23
27
|
ModelRegistry,
|
|
24
28
|
type ResourceLoader,
|
|
25
29
|
SessionManager,
|
|
26
30
|
SettingsManager,
|
|
27
31
|
} from "@earendil-works/pi-coding-agent";
|
|
28
32
|
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// Constants
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
|
|
37
|
+
const PARALLEL_TOOL_CALL_GUIDANCE = `
|
|
38
|
+
|
|
39
|
+
## Tool Call Efficiency
|
|
40
|
+
|
|
41
|
+
When multiple independent tool calls are needed (e.g. reading several files,
|
|
42
|
+
searching for different patterns), emit them all in a single response rather
|
|
43
|
+
than one at a time. The runtime executes independent tool calls in parallel,
|
|
44
|
+
so batching them saves round-trips and reduces latency.
|
|
45
|
+
`;
|
|
46
|
+
|
|
29
47
|
// ---------------------------------------------------------------------------
|
|
30
48
|
// Types
|
|
31
49
|
// ---------------------------------------------------------------------------
|
|
@@ -95,15 +113,23 @@ export async function runSubAgent(options: {
|
|
|
95
113
|
model: `${model.provider}/${model.id}`,
|
|
96
114
|
};
|
|
97
115
|
|
|
98
|
-
//
|
|
99
|
-
//
|
|
116
|
+
// Load project context files (AGENTS.md from cwd and ancestors) so the
|
|
117
|
+
// sub-agent has the same codebase conventions as the main agent.
|
|
118
|
+
const contextFiles = loadProjectContextFiles({ cwd, agentDir: getAgentDir() });
|
|
119
|
+
const contextPrefix = contextFiles.length > 0
|
|
120
|
+
? contextFiles.map((f) => f.content).join("\n\n---\n\n") + "\n\n---\n\n"
|
|
121
|
+
: "";
|
|
122
|
+
const fullSystemPrompt = contextPrefix + systemPrompt + PARALLEL_TOOL_CALL_GUIDANCE;
|
|
123
|
+
|
|
124
|
+
// Build a minimal resource loader. The sub-agent sees the agent's system
|
|
125
|
+
// prompt plus project context files (AGENTS.md) — no extensions, no skills.
|
|
100
126
|
const resourceLoader: ResourceLoader = {
|
|
101
127
|
getExtensions: () => ({ extensions: [], errors: [], runtime: createExtensionRuntime() }),
|
|
102
128
|
getSkills: () => ({ skills: [], diagnostics: [] }),
|
|
103
129
|
getPrompts: () => ({ prompts: [], diagnostics: [] }),
|
|
104
130
|
getThemes: () => ({ themes: [], diagnostics: [] }),
|
|
105
131
|
getAgentsFiles: () => ({ agentsFiles: [] }),
|
|
106
|
-
getSystemPrompt: () =>
|
|
132
|
+
getSystemPrompt: () => fullSystemPrompt,
|
|
107
133
|
getAppendSystemPrompt: () => [],
|
|
108
134
|
extendResources: () => {},
|
|
109
135
|
reload: async () => {},
|