@ladbabynpm/picc-subagents 0.1.0 → 0.1.2

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 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
  [![npm downloads](https://img.shields.io/npm/dt/@ladbabynpm/picc-subagents.svg)](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
- `PI_SUBAGENT_MODEL` / `CLAUDE_CODE_SUBAGENT_MODEL` env-var model selection, removing `get_subagent_result` and `steer_subagent` tools.
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 # PI_SUBAGENT_MODEL / CLAUDE_CODE_SUBAGENT_MODEL overrides (fork)
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 (PI_SUBAGENT_MODEL / CLAUDE_CODE_SUBAGENT_MODEL)
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
- | `PI_SUBAGENT_MODEL` | 1 (highest) | Fork-specific. |
366
- | `CLAUDE_CODE_SUBAGENT_MODEL` | 2 | claude-code-compatible; ignored when `PI_SUBAGENT_MODEL` is set. |
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 PI_SUBAGENT_MODEL=haiku # always run subagents on haiku
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,69 +1,69 @@
1
- {
2
- "name": "@ladbabynpm/picc-subagents",
3
- "version": "0.1.0",
4
- "description": "Claude Code style Agent tool for pi agent. Fork of tintinweb/pi-subagents, better aligned with the harness of Claude Code.",
5
- "author": "ladbabynpm",
6
- "license": "MIT",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/ladbaby/picc-subagents.git"
10
- },
11
- "homepage": "https://github.com/ladbaby/picc-subagents#readme",
12
- "bugs": {
13
- "url": "https://github.com/ladbaby/picc-subagents/issues"
14
- },
15
- "keywords": [
16
- "pi-package",
17
- "pi",
18
- "pi-extension",
19
- "subagent",
20
- "agent",
21
- "autonomous"
22
- ],
23
- "files": [
24
- "src/",
25
- "package.json",
26
- "tsconfig.json",
27
- "README.md",
28
- "LICENSE",
29
- "CHANGELOG.md",
30
- "biome.json"
31
- ],
32
- "peerDependencies": {
33
- "@earendil-works/pi-ai": ">=0.80.0",
34
- "@earendil-works/pi-coding-agent": ">=0.80.0",
35
- "@earendil-works/pi-tui": ">=0.80.0"
36
- },
37
- "dependencies": {
38
- "@sinclair/typebox": "^0.34.49",
39
- "croner": "^10.0.1",
40
- "nanoid": "^5.0.0"
41
- },
42
- "publishConfig": {
43
- "access": "public"
44
- },
45
- "scripts": {
46
- "build": "tsc",
47
- "prepublishOnly": "npm run lint && npm run typecheck && npm run test && npm run build",
48
- "test": "vitest run",
49
- "test:watch": "vitest",
50
- "test:e2e": "vitest run e2e --reporter=verbose",
51
- "typecheck": "tsc --noEmit",
52
- "lint": "biome check src/ test/",
53
- "lint:fix": "biome check --fix src/ test/"
54
- },
55
- "devDependencies": {
56
- "@biomejs/biome": "^2.4.14",
57
- "@earendil-works/pi-ai": "^0.80.6",
58
- "@earendil-works/pi-coding-agent": "^0.80.6",
59
- "@earendil-works/pi-tui": "^0.80.6",
60
- "@types/node": "^25.5.0",
61
- "typescript": "^6.0.0",
62
- "vitest": "^4.0.18"
63
- },
64
- "pi": {
65
- "extensions": [
66
- "./src/index.ts"
67
- ]
68
- }
69
- }
1
+ {
2
+ "name": "@ladbabynpm/picc-subagents",
3
+ "version": "0.1.2",
4
+ "description": "Claude Code style Agent tool for pi agent. Fork of tintinweb/pi-subagents, better aligned with the harness of Claude Code.",
5
+ "author": "ladbabynpm",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/ladbaby/picc-subagents.git"
10
+ },
11
+ "homepage": "https://github.com/ladbaby/picc-subagents#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/ladbaby/picc-subagents/issues"
14
+ },
15
+ "keywords": [
16
+ "pi-package",
17
+ "pi",
18
+ "pi-extension",
19
+ "subagent",
20
+ "agent",
21
+ "autonomous"
22
+ ],
23
+ "files": [
24
+ "src/",
25
+ "package.json",
26
+ "tsconfig.json",
27
+ "README.md",
28
+ "LICENSE",
29
+ "CHANGELOG.md",
30
+ "biome.json"
31
+ ],
32
+ "peerDependencies": {
33
+ "@earendil-works/pi-ai": ">=0.80.0",
34
+ "@earendil-works/pi-coding-agent": ">=0.80.0",
35
+ "@earendil-works/pi-tui": ">=0.80.0",
36
+ "@sinclair/typebox": "*"
37
+ },
38
+ "dependencies": {
39
+ "croner": "^10.0.1",
40
+ "nanoid": "^5.0.0"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "scripts": {
46
+ "build": "tsc",
47
+ "prepublishOnly": "npm run lint && npm run typecheck && npm run test && npm run build",
48
+ "test": "vitest run",
49
+ "test:watch": "vitest",
50
+ "test:e2e": "vitest run e2e --reporter=verbose",
51
+ "typecheck": "tsc --noEmit",
52
+ "lint": "biome check src/ test/",
53
+ "lint:fix": "biome check --fix src/ test/"
54
+ },
55
+ "devDependencies": {
56
+ "@biomejs/biome": "^2.4.14",
57
+ "@earendil-works/pi-ai": "^0.80.6",
58
+ "@earendil-works/pi-coding-agent": "^0.80.6",
59
+ "@earendil-works/pi-tui": "^0.80.6",
60
+ "@types/node": "^25.5.0",
61
+ "typescript": "^6.0.0",
62
+ "vitest": "^4.0.18"
63
+ },
64
+ "pi": {
65
+ "extensions": [
66
+ "./src/index.ts"
67
+ ]
68
+ }
69
+ }
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: PI_SUBAGENT_MODEL (fork) takes precedence over
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
@@ -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: PI_SUBAGENT_MODEL (fork-specific) > CLAUDE_CODE_SUBAGENT_MODEL
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 PI_SUBAGENT_MODEL_ENV = "PI_SUBAGENT_MODEL";
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[PI_SUBAGENT_MODEL_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 (PI_SUBAGENT_MODEL or
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[PI_SUBAGENT_MODEL_ENV]?.trim()
50
+ return rawInput === process.env[PICC_SUBAGENTS_MODEL_ENV]?.trim()
51
51
  || rawInput === process.env[CLAUDE_CODE_SUBAGENT_MODEL_ENV]?.trim();
52
52
  }