@agimon-ai/po-team 0.0.0-alpha.0

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.
Files changed (110) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +156 -0
  3. package/dist/agentDiscovery-Whwzc4dP.cjs +1637 -0
  4. package/dist/agentDiscovery-Whwzc4dP.cjs.map +1 -0
  5. package/dist/agentDiscovery-ZQlFkKvB.mjs +1529 -0
  6. package/dist/agentDiscovery-ZQlFkKvB.mjs.map +1 -0
  7. package/dist/apiContracts.cjs +162 -0
  8. package/dist/apiContracts.cjs.map +1 -0
  9. package/dist/apiContracts.d.mts +53 -0
  10. package/dist/apiContracts.d.mts.map +1 -0
  11. package/dist/apiContracts.mjs +157 -0
  12. package/dist/apiContracts.mjs.map +1 -0
  13. package/dist/atomicJson-D0346bt5.cjs +178 -0
  14. package/dist/atomicJson-D0346bt5.cjs.map +1 -0
  15. package/dist/atomicJson-D2t0CDh9.mjs +137 -0
  16. package/dist/atomicJson-D2t0CDh9.mjs.map +1 -0
  17. package/dist/capabilityCeiling-C-Y7H8oC.cjs +191 -0
  18. package/dist/capabilityCeiling-C-Y7H8oC.cjs.map +1 -0
  19. package/dist/capabilityCeiling-CF7kAS18.mjs +156 -0
  20. package/dist/capabilityCeiling-CF7kAS18.mjs.map +1 -0
  21. package/dist/capabilityCeiling.cjs +10 -0
  22. package/dist/capabilityCeiling.d.mts +46 -0
  23. package/dist/capabilityCeiling.d.mts.map +1 -0
  24. package/dist/capabilityCeiling.mjs +3 -0
  25. package/dist/delegation.cjs +49 -0
  26. package/dist/delegation.cjs.map +1 -0
  27. package/dist/delegation.d.mts +269 -0
  28. package/dist/delegation.d.mts.map +1 -0
  29. package/dist/delegation.mjs +34 -0
  30. package/dist/delegation.mjs.map +1 -0
  31. package/dist/delegationApi.cjs +92 -0
  32. package/dist/delegationApi.d.mts +2 -0
  33. package/dist/delegationApi.mjs +2 -0
  34. package/dist/env.cjs +62 -0
  35. package/dist/env.d.mts +2 -0
  36. package/dist/env.mjs +2 -0
  37. package/dist/environment-CaCW3SgT.cjs +320 -0
  38. package/dist/environment-CaCW3SgT.cjs.map +1 -0
  39. package/dist/environment-DrqhrxG_.mjs +75 -0
  40. package/dist/environment-DrqhrxG_.mjs.map +1 -0
  41. package/dist/environment-ma5oQ7uM.d.mts +63 -0
  42. package/dist/environment-ma5oQ7uM.d.mts.map +1 -0
  43. package/dist/extensions/server.cjs +6940 -0
  44. package/dist/extensions/server.cjs.map +1 -0
  45. package/dist/extensions/server.d.mts +5 -0
  46. package/dist/extensions/server.d.mts.map +1 -0
  47. package/dist/extensions/server.mjs +6932 -0
  48. package/dist/extensions/server.mjs.map +1 -0
  49. package/dist/extensions/web.mjs +2308 -0
  50. package/dist/extensions/web.mjs.map +1 -0
  51. package/dist/externalProcessIpc-C-15lJrB.mjs +584 -0
  52. package/dist/externalProcessIpc-C-15lJrB.mjs.map +1 -0
  53. package/dist/externalProcessIpc-ojE0pvw0.cjs +690 -0
  54. package/dist/externalProcessIpc-ojE0pvw0.cjs.map +1 -0
  55. package/dist/fablePlan.cjs +17 -0
  56. package/dist/fablePlan.d.mts +2 -0
  57. package/dist/fablePlan.mjs +2 -0
  58. package/dist/fablePlanApi-BsHhgVFV.mjs +118 -0
  59. package/dist/fablePlanApi-BsHhgVFV.mjs.map +1 -0
  60. package/dist/fablePlanApi-CZ3uUcMi.d.mts +97 -0
  61. package/dist/fablePlanApi-CZ3uUcMi.d.mts.map +1 -0
  62. package/dist/fablePlanApi-wBu9bRXU.cjs +207 -0
  63. package/dist/fablePlanApi-wBu9bRXU.cjs.map +1 -0
  64. package/dist/fablePlanApi.cjs +17 -0
  65. package/dist/fablePlanApi.d.mts +2 -0
  66. package/dist/fablePlanApi.mjs +2 -0
  67. package/dist/index.cjs +49 -0
  68. package/dist/index.cjs.map +1 -0
  69. package/dist/index.d.mts +160 -0
  70. package/dist/index.d.mts.map +1 -0
  71. package/dist/index.mjs +45 -0
  72. package/dist/index.mjs.map +1 -0
  73. package/dist/runs/background/cliRunnerEntry.cjs +539 -0
  74. package/dist/runs/background/cliRunnerEntry.cjs.map +1 -0
  75. package/dist/runs/background/cliRunnerEntry.d.mts +1 -0
  76. package/dist/runs/background/cliRunnerEntry.mjs +537 -0
  77. package/dist/runs/background/cliRunnerEntry.mjs.map +1 -0
  78. package/dist/runtimeSubagentPolicy.cjs +5 -0
  79. package/dist/runtimeSubagentPolicy.d.mts +2 -0
  80. package/dist/runtimeSubagentPolicy.mjs +2 -0
  81. package/dist/runtimeSubagentTool.cjs +11 -0
  82. package/dist/runtimeSubagentTool.d.mts +2 -0
  83. package/dist/runtimeSubagentTool.mjs +2 -0
  84. package/dist/subagentPolicy-ALJam4GN.d.mts +33 -0
  85. package/dist/subagentPolicy-ALJam4GN.d.mts.map +1 -0
  86. package/dist/subagentPolicy-DQRyKDH-.cjs +39 -0
  87. package/dist/subagentPolicy-DQRyKDH-.cjs.map +1 -0
  88. package/dist/subagentPolicy-DxjsKeyj.mjs +22 -0
  89. package/dist/subagentPolicy-DxjsKeyj.mjs.map +1 -0
  90. package/dist/subagentPolicy.cjs +5 -0
  91. package/dist/subagentPolicy.d.mts +2 -0
  92. package/dist/subagentPolicy.mjs +2 -0
  93. package/dist/subagentTool-BTssGLw8.d.mts +103 -0
  94. package/dist/subagentTool-BTssGLw8.d.mts.map +1 -0
  95. package/dist/subagentTool-Ca2zQXKw.cjs +227 -0
  96. package/dist/subagentTool-Ca2zQXKw.cjs.map +1 -0
  97. package/dist/subagentTool-WOYrjxgT.mjs +186 -0
  98. package/dist/subagentTool-WOYrjxgT.mjs.map +1 -0
  99. package/dist/subagentTool.cjs +10 -0
  100. package/dist/subagentTool.d.mts +2 -0
  101. package/dist/subagentTool.mjs +2 -0
  102. package/dist/teamSnapshot-DgaANhBs.mjs +24 -0
  103. package/dist/teamSnapshot-DgaANhBs.mjs.map +1 -0
  104. package/dist/teamSnapshot-oKuGFdYc.cjs +35 -0
  105. package/dist/teamSnapshot-oKuGFdYc.cjs.map +1 -0
  106. package/dist/teamSnapshot.cjs +4 -0
  107. package/dist/teamSnapshot.d.mts +59 -0
  108. package/dist/teamSnapshot.d.mts.map +1 -0
  109. package/dist/teamSnapshot.mjs +2 -0
  110. package/package.json +201 -0
package/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vuong Ngo
4
+
5
+ Portions of this software are derived from pi-subagents
6
+ (https://github.com/nicobailon/pi-subagents), Copyright (c) 2026 Nico Bailon,
7
+ distributed under the MIT License.
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # @agimon-ai/po-team
2
+
3
+ Discover agents, run them in the background, exchange messages, and enforce model and tool policy.
4
+
5
+ Part of the [Po distribution](https://www.npmjs.com/package/@agimon-ai/po).
6
+
7
+ Team does not own Task's graph. When both packages are loaded, Team fulfills Task delegation
8
+ requests while Task remains the source of truth for task status and dependencies.
9
+
10
+ > **Alpha:** run, policy, and intercom contracts may change between releases.
11
+
12
+ ## Requirements
13
+
14
+ - Node.js 24 or newer
15
+ - `@earendil-works/pi-agent-core`, `@earendil-works/pi-ai`,
16
+ `@earendil-works/pi-coding-agent` 1.0.2
17
+
18
+ ## Install
19
+
20
+ Define a layer and select it in `.po/modes.yaml`. Add Task separately for graph-backed delegation:
21
+
22
+ ```yaml
23
+ layers:
24
+ coordination:
25
+ packages:
26
+ - '@agimon-ai/po-task'
27
+ - name: '@agimon-ai/po-team'
28
+ config:
29
+ models:
30
+ - model: provider/model-id
31
+ thinking: high
32
+ excludeTools: [ask_user_question]
33
+
34
+ majorMode:
35
+ development:
36
+ description: Development with tasks and delegated agents.
37
+ layers: [coordination]
38
+ ```
39
+
40
+ Team-only sessions can launch and manage agents directly; they simply have no Task-owned graph to
41
+ update.
42
+
43
+ ## Commands and tools
44
+
45
+ Slash commands include:
46
+
47
+ ```text
48
+ /run
49
+ /parallel
50
+ /subagents-doctor
51
+ /subagents-steer <run-id> <message>
52
+ /subagents-stop
53
+ /subagents-list
54
+ /subagents-fleet
55
+ ```
56
+
57
+ Use `/run` for one agent and `/parallel` for several. `/subagents-doctor` reports diagnostics,
58
+ `/subagents-steer` sends guidance to a running agent, and `/subagents-stop` requests a stop.
59
+ `/subagents-list` shows available agents, and `/subagents-fleet` shows current runs.
60
+
61
+ The `subagent` tool exposes `agents`, `run`, `status`, `steer`, `stop`, `suspended`, and `restore`.
62
+ The `intercom` tool exposes `members`, `send`, `ask`, `pending`, and `reply`.
63
+
64
+ `ask` is asynchronous in every direction (child to main, main to child, child to sibling). It
65
+ returns at once with a `requestId`. The answer arrives later as an intercom message that wakes the
66
+ asker. A child with an open ask stays alive after its turn ends. If no reply lands within 180
67
+ seconds, the asker gets one notice and a turn to decide: keep working, ask again, or finish. The ask
68
+ stays open, so a late reply still lands while the asker is alive. If the target finishes without
69
+ replying, the asker is told right away.
70
+
71
+ ## Run lifecycle
72
+
73
+ Runs are asynchronous. The parent receives a run identifier and later completion or failure rather
74
+ than an inline child transcript. A shutdown requests suspension and writes restorable state. A later
75
+ session can list suspended work and explicitly restore it. Reopening does not automatically restart
76
+ children, and Team does not promise that every run continues after its parent exits.
77
+
78
+ ## Agent identity
79
+
80
+ Every spawned agent is given a generated identity of the form `{name}-{role}-{number}`, for example
81
+ `alan-reviewer-3`. The role comes from the agent name with its package prefix dropped, and the number
82
+ counts every agent in the session, so no two agents share an identity. An agent defined inline, with
83
+ no agent file on disk, is shown as `bea-developer-2 (inline)`.
84
+
85
+ The identity is the intercom member id, not a label beside one, so a peer can address exactly what it
86
+ is shown:
87
+
88
+ ```text
89
+ intercom({ action: "send", to: "alan-reviewer-3", message: "..." })
90
+ subagent({ action: "status", id: "alan-reviewer-3" })
91
+ ```
92
+
93
+ Run ids keep working everywhere, and they win when a name and an id collide. A restored run keeps the
94
+ identity its peers already know rather than being renamed. Identities are unique within one root
95
+ session and are not reused when a run ends.
96
+ The root session scopes run results, transcripts, control inboxes, membership, intercom, and
97
+ suspended records. State is stored in private, per-user temporary directories with per-session
98
+ subdirectories. Suspended records are recoverable only while those temporary files remain. Launch
99
+ contracts can contain full prompts and are written with private permissions, then removed after
100
+ handoff. Intercom messages expire after 24 hours; liveness checks remove stale membership and run
101
+ state.
102
+
103
+ ## Model and tool policy
104
+
105
+ Package configuration belongs on the Team package entry. When several selected entries contribute
106
+ configuration, later entries replace the `models` list and `excludeTools` values are combined in
107
+ layer order.
108
+
109
+ Agent configuration, explicit launch options, Team policy, and provider availability determine the
110
+ final model and tools. A child cannot exceed the capability ceiling supplied by its parent or
111
+ provider policy. Allowed MCP and stdio tools can execute commands, so treat agent definitions and
112
+ the inherited environment as trusted configuration.
113
+
114
+ ## Task delegation bridge
115
+
116
+ With Task installed:
117
+
118
+ 1. Task selects a pending, unblocked task and sends a delegation request.
119
+ 2. Team resolves the named agent, context, model, skills, and capability policy.
120
+ 3. Team owns the background run, messaging, steering, and suspension.
121
+ 4. Task records the terminal result on its own task.
122
+
123
+ This is a named Cordis service relationship, not shared persistence. Team provides
124
+ `doom/delegation`, `doom/background-work`, `doom/subagent-policy`, and `doom/fable-plan` for the
125
+ active session. Consumers disconnect and reconnect automatically when that provider changes.
126
+
127
+ ## Public API
128
+
129
+ ```ts
130
+ import { resolveSubagentLaunchContract } from '@agimon-ai/po-team';
131
+ ```
132
+
133
+ Focused subpaths include `/api/capability-ceiling`, `/api/delegation`, `/api/team-snapshot`,
134
+ and `/env`. Live cross-extension collaboration contracts come from
135
+ `@agimon-ai/po-core`.
136
+
137
+ ## Development
138
+
139
+ Run from this package directory in the workspace:
140
+
141
+ ```bash
142
+ pnpm build
143
+ pnpm typecheck
144
+ pnpm test
145
+ pnpm lint
146
+ ```
147
+
148
+ Maintained by [Agimon](https://agimon.ai/about).
149
+
150
+ ## License
151
+
152
+ MIT
153
+
154
+ ## Source and lifecycle
155
+
156
+ The routed files own contribution registration. Team's collaboration service replaces session fibers explicitly, uses the injected session only when its session manager matches, and otherwise mounts in the standalone plugin context. Losing that injected session disposes its collaboration fiber.