@pi-ohm/subagents 0.6.4-dev.22319043817.1.ac398fc → 0.6.4-dev.22329800727.1.c214423
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 +67 -0
- package/dist/extension.d.ts +12 -6
- package/dist/extension.js +28 -28
- package/package.json +6 -5
- package/src/runtime/backend/prompts/finder.claude.txt +34 -0
- package/src/runtime/backend/prompts/finder.gemini.txt +34 -0
- package/src/runtime/backend/prompts/finder.general.txt +34 -0
- package/src/runtime/backend/prompts/finder.gpt.txt +34 -0
- package/src/runtime/backend/prompts/librarian.claude.txt +54 -0
- package/src/runtime/backend/prompts/librarian.gemini.txt +54 -0
- package/src/runtime/backend/prompts/librarian.general.txt +55 -0
- package/src/runtime/backend/prompts/librarian.gpt.txt +53 -0
- package/src/runtime/backend/prompts/oracle.claude.txt +51 -0
- package/src/runtime/backend/prompts/oracle.gemini.txt +50 -0
- package/src/runtime/backend/prompts/oracle.general.txt +50 -0
- package/src/runtime/backend/prompts/oracle.gpt.txt +50 -0
package/README.md
CHANGED
|
@@ -102,6 +102,63 @@ Per-subagent model override is supported via `ohm.json`:
|
|
|
102
102
|
- SDK backend validates against Pi model registry (built-ins + custom `models.json`)
|
|
103
103
|
- interactive-shell backend forwards the same `--model` pattern to nested `pi`
|
|
104
104
|
|
|
105
|
+
Subagent runtime profiles now support prompt/description/usage overrides, custom
|
|
106
|
+
subagent entries, and wildcard variants:
|
|
107
|
+
|
|
108
|
+
```jsonc
|
|
109
|
+
{
|
|
110
|
+
"subagents": {
|
|
111
|
+
"librarian": {
|
|
112
|
+
"model": "openai/gpt-5.3-codex:medium",
|
|
113
|
+
"prompt": "{file:./prompts/librarian.general.txt}",
|
|
114
|
+
"description": "Optional summary override",
|
|
115
|
+
"whenToUse": ["Optional guidance override"],
|
|
116
|
+
},
|
|
117
|
+
"my-custom-agent": {
|
|
118
|
+
"model": "openai/gpt-5.3-codex:medium",
|
|
119
|
+
"prompt": "{file:./prompts/my-custom-agent.general.txt}",
|
|
120
|
+
"description": "Custom delegated helper",
|
|
121
|
+
"whenToUse": ["Use for custom workflows"],
|
|
122
|
+
"permissions": {
|
|
123
|
+
"bash": "allow",
|
|
124
|
+
"edit": "deny",
|
|
125
|
+
},
|
|
126
|
+
"variants": {
|
|
127
|
+
"*gemini*": {
|
|
128
|
+
"model": "github-copilot/gemini-3.1-pro-preview:high",
|
|
129
|
+
"prompt": "{file:./prompts/my-custom-agent.gemini.txt}",
|
|
130
|
+
"permissions": {
|
|
131
|
+
"edit": "inherit",
|
|
132
|
+
"apply_patch": "deny",
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Variant matching rules:
|
|
142
|
+
|
|
143
|
+
- variant keys are wildcard matchers (for example `*gemini*`)
|
|
144
|
+
- match target is normalized model pattern + model token (provider is optional)
|
|
145
|
+
- first matching variant wins
|
|
146
|
+
- variant fields override base profile fields (`model`, `prompt`, `description`, `whenToUse`)
|
|
147
|
+
- permissions support `allow|deny|inherit` (inherit falls back to base profile map)
|
|
148
|
+
|
|
149
|
+
Prompt file references:
|
|
150
|
+
|
|
151
|
+
- prompt fields support `{file:...}` references
|
|
152
|
+
- relative paths resolve from task `cwd` first, then Pi config dir fallback
|
|
153
|
+
|
|
154
|
+
Built-in prompt management:
|
|
155
|
+
|
|
156
|
+
- catalog metadata (`packages/subagents/src/catalog.ts`) is now display/orchestration metadata for
|
|
157
|
+
main-agent exposure (name/description/when-to-use/invocation)
|
|
158
|
+
- execution prompt text is resolved separately
|
|
159
|
+
- built-in execution prompts are file-backed under `packages/subagents/src/runtime/backend/prompts/*`
|
|
160
|
+
- built-in variant selection uses wildcard model keys (`*gemini*`, `*gpt*`, `*claude*`)
|
|
161
|
+
|
|
105
162
|
## Dynamic prompt profile routing
|
|
106
163
|
|
|
107
164
|
SDK prompt profile selection is runtime-driven and deterministic:
|
|
@@ -259,6 +316,16 @@ H7-004 provider-add repro demo (config-only mapping + end-to-end validation):
|
|
|
259
316
|
yarn test:subagents --test-name-pattern "new provider mapping can be added via rules"
|
|
260
317
|
```
|
|
261
318
|
|
|
319
|
+
System prompt harness snapshots:
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
# verify full main-agent + subagent-sdk prompt/tool snapshots
|
|
323
|
+
yarn test:subagents:golden
|
|
324
|
+
|
|
325
|
+
# regenerate snapshot goldens from current code
|
|
326
|
+
yarn test:subagents:golden:update
|
|
327
|
+
```
|
|
328
|
+
|
|
262
329
|
### 3.2) Provider onboarding playbook (no core router edits)
|
|
263
330
|
|
|
264
331
|
1. Add a rule in `ohm.providers.json` under `subagents.promptProfiles.rules`:
|
package/dist/extension.d.ts
CHANGED
|
@@ -6,10 +6,13 @@ import { z } from "zod";
|
|
|
6
6
|
|
|
7
7
|
//#region src/catalog.d.ts
|
|
8
8
|
type OhmSubagentId = "librarian" | "oracle" | "finder" | "task" | "painter";
|
|
9
|
+
type OhmSubagentIdentifier = OhmSubagentId | (string & {});
|
|
9
10
|
interface OhmSubagentDefinition {
|
|
10
|
-
id:
|
|
11
|
+
id: OhmSubagentIdentifier;
|
|
11
12
|
name: string;
|
|
12
|
-
|
|
13
|
+
description?: string;
|
|
14
|
+
/** @deprecated use description */
|
|
15
|
+
summary?: string;
|
|
13
16
|
/**
|
|
14
17
|
* When true, this profile should be exposed as a directly invokable primary tool
|
|
15
18
|
* instead of requiring delegated Task-style invocation.
|
|
@@ -20,11 +23,14 @@ interface OhmSubagentDefinition {
|
|
|
20
23
|
* policy explicitly allows internal routing.
|
|
21
24
|
*/
|
|
22
25
|
internal?: boolean;
|
|
23
|
-
whenToUse: string[];
|
|
24
|
-
|
|
26
|
+
whenToUse: readonly string[];
|
|
27
|
+
whenNotToUse?: readonly string[];
|
|
28
|
+
usageGuidelines?: readonly string[];
|
|
29
|
+
examples?: readonly string[];
|
|
30
|
+
/** @deprecated execution prompt now resolves outside catalog */
|
|
31
|
+
scaffoldPrompt?: string;
|
|
25
32
|
requiresPackage?: string;
|
|
26
33
|
}
|
|
27
|
-
declare const OHM_SUBAGENT_CATALOG: readonly OhmSubagentDefinition[];
|
|
28
34
|
//#endregion
|
|
29
35
|
//#region src/runtime/live-ui.d.ts
|
|
30
36
|
type TaskLiveUiMode = "off" | "compact" | "verbose";
|
|
@@ -39,7 +45,7 @@ declare function buildSubagentsOverviewText(input: {
|
|
|
39
45
|
}): string;
|
|
40
46
|
declare function buildSubagentDetailText(input: {
|
|
41
47
|
readonly config: OhmRuntimeConfig;
|
|
42
|
-
readonly subagent:
|
|
48
|
+
readonly subagent: OhmSubagentDefinition;
|
|
43
49
|
}): string;
|
|
44
50
|
interface ResolveSubagentsLiveUiModeResult {
|
|
45
51
|
readonly ok: boolean;
|