@ladbabynpm/picc-subagents 0.1.0 → 0.1.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/LICENSE +21 -0
- package/README.md +6 -6
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/subagent-env.ts +5 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ladbaby
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@ladbabynpm/picc-subagents)
|
|
4
4
|
|
|
5
5
|
Fork of [`@tintinweb/pi-subagents`](https://github.com/tintinweb/pi-subagents), adding
|
|
6
|
-
`
|
|
6
|
+
`PICC_SUBAGENTS_MODEL` / `CLAUDE_CODE_SUBAGENT_MODEL` env-var model selection, removing `get_subagent_result` and `steer_subagent` tools.
|
|
7
7
|
To switch back to upstream, run `pi install npm:@tintinweb/pi-subagents`.
|
|
8
8
|
|
|
9
9
|
Part of [picc](https://github.com/Ladbaby/picc), a pi agent setup mirroring Claude Code's harness.
|
|
@@ -348,13 +348,13 @@ src/
|
|
|
348
348
|
prompts.ts # Config-driven system prompt builder
|
|
349
349
|
context.ts # Parent conversation context for inherit_context
|
|
350
350
|
env.ts # Environment detection (git, platform)
|
|
351
|
-
subagent-env.ts #
|
|
351
|
+
subagent-env.ts # PICC_SUBAGENTS_MODEL / CLAUDE_CODE_SUBAGENT_MODEL overrides (fork)
|
|
352
352
|
ui/
|
|
353
353
|
agent-widget.ts # Persistent widget: spinners, activity, status icons, theming
|
|
354
354
|
conversation-viewer.ts # Live conversation overlay for viewing agent sessions
|
|
355
355
|
```
|
|
356
356
|
|
|
357
|
-
## Fork notes (
|
|
357
|
+
## Fork notes (PICC_SUBAGENTS_MODEL / CLAUDE_CODE_SUBAGENT_MODEL)
|
|
358
358
|
|
|
359
359
|
This fork adds support for picking the **default subagent model from an environment
|
|
360
360
|
variable**, mirroring claude-code's
|
|
@@ -362,8 +362,8 @@ variable**, mirroring claude-code's
|
|
|
362
362
|
|
|
363
363
|
| Variable | Precedence | Notes |
|
|
364
364
|
|---|---|---|
|
|
365
|
-
| `
|
|
366
|
-
| `CLAUDE_CODE_SUBAGENT_MODEL` | 2 | claude-code-compatible; ignored when `
|
|
365
|
+
| `PICC_SUBAGENTS_MODEL` | 1 (highest) | Fork-specific. |
|
|
366
|
+
| `CLAUDE_CODE_SUBAGENT_MODEL` | 2 | claude-code-compatible; ignored when `PICC_SUBAGENTS_MODEL` is set. |
|
|
367
367
|
| _unset_ | — | Falls back to existing precedence: caller `Agent({model})` > frontmatter `model:` > inherit parent. |
|
|
368
368
|
|
|
369
369
|
The chosen model **overrides everything** — frontmatter pins and `Agent` `model:` parameters —
|
|
@@ -374,6 +374,6 @@ rather than silently falling back; whitespace-only values are treated as unset.
|
|
|
374
374
|
`Agent` calls; cross-extension RPC callers pick up the same vars in their own process.
|
|
375
375
|
|
|
376
376
|
```bash
|
|
377
|
-
export
|
|
377
|
+
export PICC_SUBAGENTS_MODEL=haiku # always run subagents on haiku
|
|
378
378
|
export CLAUDE_CODE_SUBAGENT_MODEL=anthropic/claude-haiku-4-5 # claude-code-compatible
|
|
379
379
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ladbabynpm/picc-subagents",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Claude Code style Agent tool for pi agent. Fork of tintinweb/pi-subagents, better aligned with the harness of Claude Code.",
|
|
5
5
|
"author": "ladbabynpm",
|
|
6
6
|
"license": "MIT",
|
package/src/index.ts
CHANGED
|
@@ -1011,7 +1011,7 @@ Terse command-style prompts produce shallow, generic work.
|
|
|
1011
1011
|
|
|
1012
1012
|
// Resolve model from agent config first; tool-call params only fill gaps.
|
|
1013
1013
|
let model = ctx.model;
|
|
1014
|
-
// Env-var override:
|
|
1014
|
+
// Env-var override: PICC_SUBAGENTS_MODEL (fork) takes precedence over
|
|
1015
1015
|
// CLAUDE_CODE_SUBAGENT_MODEL (claude-code-compatible). When set, this is
|
|
1016
1016
|
// authoritative — it overrides frontmatter `model:` pins and caller
|
|
1017
1017
|
// `model:` params. Mirrors the `CLAUDE_CODE_SUBAGENT_MODEL` hook in
|
package/src/subagent-env.ts
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
* - `model:` parameters supplied to the `Agent` tool by the orchestrator
|
|
8
8
|
* - the parent thread's model (i.e. "inherit")
|
|
9
9
|
*
|
|
10
|
-
* Precedence:
|
|
10
|
+
* Precedence: PICC_SUBAGENTS_MODEL (fork-specific) > CLAUDE_CODE_SUBAGENT_MODEL
|
|
11
11
|
* (claude-code-compatible) > undefined (caller falls through to existing
|
|
12
12
|
* resolution in `agent-runner.ts` / `index.ts`).
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
export const
|
|
15
|
+
export const PICC_SUBAGENTS_MODEL_ENV = "PICC_SUBAGENTS_MODEL";
|
|
16
16
|
export const CLAUDE_CODE_SUBAGENT_MODEL_ENV = "CLAUDE_CODE_SUBAGENT_MODEL";
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -27,7 +27,7 @@ export const CLAUDE_CODE_SUBAGENT_MODEL_ENV = "CLAUDE_CODE_SUBAGENT_MODEL";
|
|
|
27
27
|
* @returns The env-var value, or `undefined` when neither is set.
|
|
28
28
|
*/
|
|
29
29
|
export function pickSubagentEnvModel(): string | undefined {
|
|
30
|
-
const pi = process.env[
|
|
30
|
+
const pi = process.env[PICC_SUBAGENTS_MODEL_ENV];
|
|
31
31
|
if (pi && pi.trim().length > 0) return pi.trim();
|
|
32
32
|
|
|
33
33
|
const claude = process.env[CLAUDE_CODE_SUBAGENT_MODEL_ENV];
|
|
@@ -37,7 +37,7 @@ export function pickSubagentEnvModel(): string | undefined {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Whether the resolved model came from an env var (
|
|
40
|
+
* Whether the resolved model came from an env var (PICC_SUBAGENTS_MODEL or
|
|
41
41
|
* CLAUDE_CODE_SUBAGENT_MODEL). Useful for display-labeling and for skipping
|
|
42
42
|
* scope-validation against the user's `enabledModels` allowlist, since the
|
|
43
43
|
* user explicitly asked for this model via environment.
|
|
@@ -47,6 +47,6 @@ export function pickSubagentEnvModel(): string | undefined {
|
|
|
47
47
|
*/
|
|
48
48
|
export function isEnvSourcedModel(rawInput: string | undefined): boolean {
|
|
49
49
|
if (!rawInput) return false;
|
|
50
|
-
return rawInput === process.env[
|
|
50
|
+
return rawInput === process.env[PICC_SUBAGENTS_MODEL_ENV]?.trim()
|
|
51
51
|
|| rawInput === process.env[CLAUDE_CODE_SUBAGENT_MODEL_ENV]?.trim();
|
|
52
52
|
}
|