@kushalkhemka/opensec-pi-subagents 0.19.2 → 0.19.3

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/CONTRIBUTING.md CHANGED
@@ -1,4 +1,4 @@
1
- # Contributing to @tintinweb/pi-subagents
1
+ # Contributing to @kushalkhemka/opensec-pi-subagents
2
2
 
3
3
  This guide exists to save both sides time.
4
4
 
@@ -68,5 +68,5 @@ Other guidelines:
68
68
 
69
69
  ## Questions?
70
70
 
71
- Open an [issue](https://github.com/tintinweb/pi-subagents/issues) — questions and
71
+ Open an [issue](https://github.com/opensec-git/opensec-pi-subagents/issues) — questions and
72
72
  discussion are welcome.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # opensec-pi-subagents
1
+ # @kushalkhemka/opensec-pi-subagents
2
2
 
3
- Fork of [@tintinweb/pi-subagents](https://github.com/tintinweb/pi-subagents) 0.19.0, with the default `Explore` agent changed to inherit the parent's model and current thinking level. This fork also passes the parent's current thinking level to new agents that do not set their own. Original project and documentation links below belong to the upstream author; this package is maintained separately.
3
+ Fork of [@tintinweb/pi-subagents](https://github.com/tintinweb/pi-subagents) 0.19.0, with the default `Explore` agent changed to inherit the parent's model and current thinking level. This fork also passes the parent's current thinking level to new agents that do not set their own. Upstream attribution, media and historical issue links belong to the original author. This fork is maintained separately; use its bundled documentation and fork support links below.
4
4
 
5
5
  A [pi](https://pi.dev) extension that brings **Claude Code-style autonomous sub-agents and workflow orchestration** to pi. Spawn specialized agents that run in isolated sessions — each with its own tools, system prompt, model, and thinking level. Run them in the background (the default) or block on them, steer them mid-run, resume completed sessions, and define your own custom agent types. When the orchestration shouldn't be improvised, hand a deterministic JavaScript script to the `SubagentWorkflow` tool — `agent()`, `parallel()`, `pipeline()` — and scripts written for Claude Code's `Workflow` tool run here unchanged.
6
6
 
@@ -22,7 +22,7 @@ https://github.com/user-attachments/assets/8685261b-9338-4fea-8dfe-1c590d5df543
22
22
  - **Custom agent types** — define agents in `.pi/agents/<name>.md` or `.agents/agents/<name>.md` (project) or globally, with YAML frontmatter: custom system prompts, model selection, thinking levels, tool restrictions, and Claude Code-compatible colored name badges
23
23
  - **Nested subagents** — opt-in, default-off delegation: a custom agent that sets `allowed_subagents` gets its own ownership-scoped `Agent`, `get_subagent_result`, and `steer_subagent` tools, depth-capped from the main session (default 2). It can control only its own children, they are stopped when it finishes, and their transcripts and token spend roll up to it. The allowlist is a privilege boundary — a child runs with its own tools, so pick it as carefully as `tools:` itself
24
24
  - **Agent mentions** — subagents are first-class: type `@explore also check the RPC path` at the prompt and it goes to that agent instead of the main model, without a word of it entering the chat. One syntax covers the whole lifecycle — message it while it runs, resume it once it has finished, reopen its session from disk long after that, or start it if it never ran. Mentioning an agent that isn't running spawns it through an off-screen clone of the conversation, so it gets Claude Code's context-written prompt and a real `Agent` tool call without a word of it reaching the chat; `direct` mode starts it here from your text instead, with no model call at all. The orchestrator can `name` an agent so you address it as `@auth-audit`, and handles work in `steer_subagent`/`get_subagent_result` too. `@` completes live agents, resumable ones, and startable types alongside pi's file completion; `@main` forces text back to the main model. Toggle via `/agents → Settings → Agent mentions`
25
- - **Scripted workflows** — a `SubagentWorkflow` tool that runs a deterministic JavaScript script orchestrating many subagents: `agent()`, `parallel()`, `pipeline()`, `phase()`, `log()` and `args`, with a pure-literal `meta` block declaring the phases. `pipeline()` has no barrier between stages, so one item can be in a later stage while another is still in the first — unlike `parallel()`, which idles every fast agent until the slowest finishes. Runs in the background with a live card, inspectable via `/agents → Workflows` or by selecting the run in FleetView. `agent()` also takes `gate: "npm test"` to verify a child by running a command (inside its worktree, when isolated) rather than asking another model, and `resume: "<label>"` to continue a child instead of re-paying its context. Scripts run in a `node:vm` sandbox on a worker thread where `Date.now()`, `Math.random()` and `eval` throw. On by default, but it stands down for company: if another extension already provides a `Workflow` or `SubagentWorkflow` tool, this one warns and disables itself for the session rather than offering the model two orchestrators. Pin it either way with `"workflowsEnabled"` in `subagents.json` or `/agents → Settings → Workflows`. A script written for Claude Code's `Workflow` tool runs here unchanged: same globals, `schema` returns a validated object exactly as it does there, `budget` is present and always reports no token target (pi has no such directive) so its `budget.total`-guarded patterns still take the branch they were written for, and nested `workflow()` composes saved workflows one level deep. **[Full guide](https://github.com/tintinweb/pi-subagents/blob/master/docs/workflows.md)**
25
+ - **Scripted workflows** — a `SubagentWorkflow` tool that runs a deterministic JavaScript script orchestrating many subagents: `agent()`, `parallel()`, `pipeline()`, `phase()`, `log()` and `args`, with a pure-literal `meta` block declaring the phases. `pipeline()` has no barrier between stages, so one item can be in a later stage while another is still in the first — unlike `parallel()`, which idles every fast agent until the slowest finishes. Runs in the background with a live card, inspectable via `/agents → Workflows` or by selecting the run in FleetView. `agent()` also takes `gate: "npm test"` to verify a child by running a command (inside its worktree, when isolated) rather than asking another model, and `resume: "<label>"` to continue a child instead of re-paying its context. Scripts run in a `node:vm` sandbox on a worker thread where `Date.now()`, `Math.random()` and `eval` throw. On by default, but it stands down for company: if another extension already provides a `Workflow` or `SubagentWorkflow` tool, this one warns and disables itself for the session rather than offering the model two orchestrators. Pin it either way with `"workflowsEnabled"` in `subagents.json` or `/agents → Settings → Workflows`. A script written for Claude Code's `Workflow` tool runs here unchanged: same globals, `schema` returns a validated object exactly as it does there, `budget` is present and always reports no token target (pi has no such directive) so its `budget.total`-guarded patterns still take the branch they were written for, and nested `workflow()` composes saved workflows one level deep. **[Full guide](docs/workflows.md)**
26
26
  - **Mid-run steering** — inject messages into running agents to redirect their work without restarting
27
27
  - **Session resume** — pick up where an agent left off, preserving full conversation context. Resumes detached by default and notifies you on completion, just like a fresh spawn; pass `run_in_background: false` to block and get the result inline
28
28
  - **Graceful turn limits** — agents get a "wrap up" warning before hard abort, producing clean partial results instead of cut-off output
@@ -35,14 +35,22 @@ https://github.com/user-attachments/assets/8685261b-9338-4fea-8dfe-1c590d5df543
35
35
  - **Tool denylist** — block specific tools via `disallowed_tools` frontmatter
36
36
  - **Styled completion notifications** — background agent results render as themed, compact notification boxes (icon, stats, result preview) instead of raw XML. Expandable to show full output. Group completions render each agent individually
37
37
  - **Event bus** — lifecycle events (`subagents:created`, `started`, `completed`, `failed`, `steered`, `compacted`) emitted via `pi.events`, enabling other extensions to react to sub-agent activity
38
- - **Cross-extension RPC** — other pi extensions can spawn, stop, and join subagents via the `pi.events` event bus (`subagents:rpc:ping`, `subagents:rpc:spawn`, `subagents:rpc:stop`, `subagents:rpc:consume`). Standardized reply envelopes with protocol versioning. Emits `subagents:ready` on session start. **[Full reference](https://github.com/tintinweb/pi-subagents/blob/master/docs/rpc.md)**
38
+ - **Cross-extension RPC** — other pi extensions can spawn, stop, and join subagents via the `pi.events` event bus (`subagents:rpc:ping`, `subagents:rpc:spawn`, `subagents:rpc:stop`, `subagents:rpc:consume`). Standardized reply envelopes with protocol versioning. Emits `subagents:ready` on session start. **[Full reference](docs/rpc.md)**
39
39
  - **Schedule subagents** — pass `schedule` to the `Agent` tool to fire on cron / interval / one-shot. Session-scoped jobs with PID-locked persistence; results land via the same `subagent-notification` followUp path as manual background completions; manage via `/agents → Scheduled jobs`
40
40
  - **Model scope enforcement** — opt-in validation that subagent model choices stay within your pi `enabledModels` allowlist (sourced from `/scoped-models`, with both global and project-local pi settings honored). Caller-supplied out-of-scope → hard error to orchestrator; frontmatter-pinned out-of-scope → warning + runs anyway (frontmatter authoritative). Toggle via `/agents → Settings → Scope models`
41
41
 
42
42
  ## Install
43
43
 
44
+ This is the private npm package `@kushalkhemka/opensec-pi-subagents`. Use an npm account granted access; npm authentication is separate from provider login or an OpenSec member token.
45
+
46
+ ```bash
47
+ npm login --registry=https://registry.npmjs.org
48
+ ```
49
+
50
+ Install only one copy of this extension. Remove an older npm or GitHub installation before switching package sources. The scoped name changes installation only; provider IDs, commands, environment variables and existing configuration paths are unchanged.
51
+
44
52
  ```bash
45
- pi install npm:opensec-pi-subagents
53
+ pi install npm:@kushalkhemka/opensec-pi-subagents
46
54
  ```
47
55
 
48
56
  Or load directly for development:
@@ -461,7 +469,7 @@ return await pipeline(
461
469
 
462
470
  Concurrency is capped at `max(1, min(16, cpus - 2))` — the run's own limit, independent of the session's `maxConcurrent` pool, which its agents do not enter. There are 1000 agents per run and 4096 items per `parallel`/`pipeline` call.
463
471
 
464
- **Full guide:** [`docs/workflows.md`](https://github.com/tintinweb/pi-subagents/blob/master/docs/workflows.md) — how the model writes the script for you, how to edit and re-run it, how to save one as a reusable named workflow, plus the complete `agent()` option reference, recipes and troubleshooting.
472
+ **Full guide:** [`docs/workflows.md`](docs/workflows.md) — how the model writes the script for you, how to edit and re-run it, how to save one as a reusable named workflow, plus the complete `agent()` option reference, recipes and troubleshooting.
465
473
 
466
474
  ### `get_subagent_result`
467
475
 
@@ -755,7 +763,7 @@ Other pi extensions can spawn and stop subagents programmatically via the `pi.ev
755
763
 
756
764
  All RPC replies use a standardized envelope: `{ success: true, data?: T }` on success, `{ success: false, error: string }` on failure.
757
765
 
758
- **Full reference:** [`docs/rpc.md`](https://github.com/tintinweb/pi-subagents/blob/master/docs/rpc.md) — the complete spawn-option surface (including the fields that are silently stripped), every error string, the completion-notification race, the `Symbol.for("pi-subagents:manager")` registry, and what protocol version `2` does and does not promise. [`tintinweb/pi-tasks`](https://github.com/tintinweb/pi-tasks) is the reference implementation.
766
+ **Full reference:** [`docs/rpc.md`](docs/rpc.md) — the complete spawn-option surface (including the fields that are silently stripped), every error string, the completion-notification race, the `Symbol.for("pi-subagents:manager")` registry, and what protocol version `2` does and does not promise. [`tintinweb/pi-tasks`](https://github.com/tintinweb/pi-tasks) is the reference implementation.
759
767
 
760
768
  ### Discovery
761
769
 
package/SECURITY.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Security Policy
2
2
 
3
- This document explains the security model behind `@tintinweb/pi-subagents` and
3
+ This document explains the security model behind `@kushalkhemka/opensec-pi-subagents` and
4
4
  where the boundaries are.
5
5
 
6
6
  `pi-subagents` is a [pi](https://pi.dev) extension. It spawns and orchestrates
@@ -30,9 +30,9 @@ coding agent and its sub-agents trivially, and this cannot be protected against.
30
30
  ## Reporting a Vulnerability
31
31
 
32
32
  If you believe you found a security vulnerability in `pi-subagents`, please
33
- report it privately by opening a draft advisory through
34
- [GitHub Security Advisories](https://github.com/tintinweb/pi-subagents/security/advisories/new)
35
- for this repository.
33
+ contact the maintainer of `@kushalkhemka/opensec-pi-subagents` privately through
34
+ your existing OpenSec support channel. Do not send fork-specific reports to
35
+ the upstream project or include sensitive details in public issues.
36
36
 
37
37
  Please include:
38
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kushalkhemka/opensec-pi-subagents",
3
- "version": "0.19.2",
3
+ "version": "0.19.3",
4
4
  "description": "Fork of @tintinweb/pi-subagents with parent model/thinking inheritance and cached agent discovery.",
5
5
  "author": "tintinweb",
6
6
  "contributors": [