@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.
- package/LICENSE +25 -0
- package/README.md +156 -0
- package/dist/agentDiscovery-Whwzc4dP.cjs +1637 -0
- package/dist/agentDiscovery-Whwzc4dP.cjs.map +1 -0
- package/dist/agentDiscovery-ZQlFkKvB.mjs +1529 -0
- package/dist/agentDiscovery-ZQlFkKvB.mjs.map +1 -0
- package/dist/apiContracts.cjs +162 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +157 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/atomicJson-D0346bt5.cjs +178 -0
- package/dist/atomicJson-D0346bt5.cjs.map +1 -0
- package/dist/atomicJson-D2t0CDh9.mjs +137 -0
- package/dist/atomicJson-D2t0CDh9.mjs.map +1 -0
- package/dist/capabilityCeiling-C-Y7H8oC.cjs +191 -0
- package/dist/capabilityCeiling-C-Y7H8oC.cjs.map +1 -0
- package/dist/capabilityCeiling-CF7kAS18.mjs +156 -0
- package/dist/capabilityCeiling-CF7kAS18.mjs.map +1 -0
- package/dist/capabilityCeiling.cjs +10 -0
- package/dist/capabilityCeiling.d.mts +46 -0
- package/dist/capabilityCeiling.d.mts.map +1 -0
- package/dist/capabilityCeiling.mjs +3 -0
- package/dist/delegation.cjs +49 -0
- package/dist/delegation.cjs.map +1 -0
- package/dist/delegation.d.mts +269 -0
- package/dist/delegation.d.mts.map +1 -0
- package/dist/delegation.mjs +34 -0
- package/dist/delegation.mjs.map +1 -0
- package/dist/delegationApi.cjs +92 -0
- package/dist/delegationApi.d.mts +2 -0
- package/dist/delegationApi.mjs +2 -0
- package/dist/env.cjs +62 -0
- package/dist/env.d.mts +2 -0
- package/dist/env.mjs +2 -0
- package/dist/environment-CaCW3SgT.cjs +320 -0
- package/dist/environment-CaCW3SgT.cjs.map +1 -0
- package/dist/environment-DrqhrxG_.mjs +75 -0
- package/dist/environment-DrqhrxG_.mjs.map +1 -0
- package/dist/environment-ma5oQ7uM.d.mts +63 -0
- package/dist/environment-ma5oQ7uM.d.mts.map +1 -0
- package/dist/extensions/server.cjs +6940 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +6932 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +2308 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/externalProcessIpc-C-15lJrB.mjs +584 -0
- package/dist/externalProcessIpc-C-15lJrB.mjs.map +1 -0
- package/dist/externalProcessIpc-ojE0pvw0.cjs +690 -0
- package/dist/externalProcessIpc-ojE0pvw0.cjs.map +1 -0
- package/dist/fablePlan.cjs +17 -0
- package/dist/fablePlan.d.mts +2 -0
- package/dist/fablePlan.mjs +2 -0
- package/dist/fablePlanApi-BsHhgVFV.mjs +118 -0
- package/dist/fablePlanApi-BsHhgVFV.mjs.map +1 -0
- package/dist/fablePlanApi-CZ3uUcMi.d.mts +97 -0
- package/dist/fablePlanApi-CZ3uUcMi.d.mts.map +1 -0
- package/dist/fablePlanApi-wBu9bRXU.cjs +207 -0
- package/dist/fablePlanApi-wBu9bRXU.cjs.map +1 -0
- package/dist/fablePlanApi.cjs +17 -0
- package/dist/fablePlanApi.d.mts +2 -0
- package/dist/fablePlanApi.mjs +2 -0
- package/dist/index.cjs +49 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +160 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +1 -0
- package/dist/runs/background/cliRunnerEntry.cjs +539 -0
- package/dist/runs/background/cliRunnerEntry.cjs.map +1 -0
- package/dist/runs/background/cliRunnerEntry.d.mts +1 -0
- package/dist/runs/background/cliRunnerEntry.mjs +537 -0
- package/dist/runs/background/cliRunnerEntry.mjs.map +1 -0
- package/dist/runtimeSubagentPolicy.cjs +5 -0
- package/dist/runtimeSubagentPolicy.d.mts +2 -0
- package/dist/runtimeSubagentPolicy.mjs +2 -0
- package/dist/runtimeSubagentTool.cjs +11 -0
- package/dist/runtimeSubagentTool.d.mts +2 -0
- package/dist/runtimeSubagentTool.mjs +2 -0
- package/dist/subagentPolicy-ALJam4GN.d.mts +33 -0
- package/dist/subagentPolicy-ALJam4GN.d.mts.map +1 -0
- package/dist/subagentPolicy-DQRyKDH-.cjs +39 -0
- package/dist/subagentPolicy-DQRyKDH-.cjs.map +1 -0
- package/dist/subagentPolicy-DxjsKeyj.mjs +22 -0
- package/dist/subagentPolicy-DxjsKeyj.mjs.map +1 -0
- package/dist/subagentPolicy.cjs +5 -0
- package/dist/subagentPolicy.d.mts +2 -0
- package/dist/subagentPolicy.mjs +2 -0
- package/dist/subagentTool-BTssGLw8.d.mts +103 -0
- package/dist/subagentTool-BTssGLw8.d.mts.map +1 -0
- package/dist/subagentTool-Ca2zQXKw.cjs +227 -0
- package/dist/subagentTool-Ca2zQXKw.cjs.map +1 -0
- package/dist/subagentTool-WOYrjxgT.mjs +186 -0
- package/dist/subagentTool-WOYrjxgT.mjs.map +1 -0
- package/dist/subagentTool.cjs +10 -0
- package/dist/subagentTool.d.mts +2 -0
- package/dist/subagentTool.mjs +2 -0
- package/dist/teamSnapshot-DgaANhBs.mjs +24 -0
- package/dist/teamSnapshot-DgaANhBs.mjs.map +1 -0
- package/dist/teamSnapshot-oKuGFdYc.cjs +35 -0
- package/dist/teamSnapshot-oKuGFdYc.cjs.map +1 -0
- package/dist/teamSnapshot.cjs +4 -0
- package/dist/teamSnapshot.d.mts +59 -0
- package/dist/teamSnapshot.d.mts.map +1 -0
- package/dist/teamSnapshot.mjs +2 -0
- package/package.json +201 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
require("@agimon-ai/po-core/childProcess");
|
|
2
|
+
//#region src/types/environment.ts
|
|
3
|
+
const SUBAGENT_RUN_ID_ENV = "PI_SUBAGENT_RUN_ID";
|
|
4
|
+
const SUBAGENT_CHILD_AGENT_ENV = "PI_SUBAGENT_CHILD_AGENT";
|
|
5
|
+
const SUBAGENT_CHILD_INDEX_ENV = "PI_SUBAGENT_CHILD_INDEX";
|
|
6
|
+
const SUBAGENT_FANOUT_CHILD_ENV = "PI_SUBAGENT_FANOUT_CHILD";
|
|
7
|
+
const SUBAGENT_PARENT_EVENT_SINK_ENV = "PI_SUBAGENT_PARENT_EVENT_SINK";
|
|
8
|
+
const SUBAGENT_PARENT_CONTROL_INBOX_ENV = "PI_SUBAGENT_PARENT_CONTROL_INBOX";
|
|
9
|
+
const SUBAGENT_PARENT_ROOT_RUN_ID_ENV = "PI_SUBAGENT_PARENT_ROOT_RUN_ID";
|
|
10
|
+
const SUBAGENT_PARENT_RUN_ID_ENV = "PI_SUBAGENT_PARENT_RUN_ID";
|
|
11
|
+
const SUBAGENT_PARENT_CHILD_INDEX_ENV = "PI_SUBAGENT_PARENT_CHILD_INDEX";
|
|
12
|
+
const SUBAGENT_PARENT_DEPTH_ENV = "PI_SUBAGENT_PARENT_DEPTH";
|
|
13
|
+
const SUBAGENT_PARENT_PATH_ENV = "PI_SUBAGENT_PARENT_PATH";
|
|
14
|
+
const SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV = "PI_SUBAGENT_PARENT_CAPABILITY_TOKEN";
|
|
15
|
+
/** Parent/workflow process ids a child Bash tool must never signal. */
|
|
16
|
+
const SUBAGENT_PROTECTED_PARENT_PIDS_ENV = "PI_SUBAGENT_PROTECTED_PARENT_PIDS";
|
|
17
|
+
/** Decode the parent-owned PID allowlist without trusting malformed environment state. */
|
|
18
|
+
function decodeProtectedParentProcessIds(encoded) {
|
|
19
|
+
if (!encoded) return [];
|
|
20
|
+
try {
|
|
21
|
+
const parsed = JSON.parse(encoded);
|
|
22
|
+
if (!Array.isArray(parsed)) return [];
|
|
23
|
+
return [...new Set(parsed.filter((value) => typeof value === "number" && Number.isSafeInteger(value) && value > 1))];
|
|
24
|
+
} catch {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const SUBAGENT_STEER_INBOX_ENV = "PI_SUBAGENT_STEER_INBOX";
|
|
29
|
+
const SUBAGENT_STEER_CAPABILITY_ENV = "PI_SUBAGENT_STEER_CAPABILITY";
|
|
30
|
+
const SUBAGENT_STEER_ACK_DIR_ENV = "PI_SUBAGENT_STEER_ACK_DIR";
|
|
31
|
+
/** The in-process SDK runtime. Not an external command; see `runtimeRegistry.ts`. */
|
|
32
|
+
const PI_RUNTIME_NAME = "pi";
|
|
33
|
+
/**
|
|
34
|
+
* Per-runtime binary override, e.g. `DOOM_TEAM_CLAUDE_BIN=/path/to/claude`.
|
|
35
|
+
*
|
|
36
|
+
* Uppercased and non-alphanumerics folded to `_` so a runtime name that is
|
|
37
|
+
* legal in config is always a legal environment variable name.
|
|
38
|
+
*/
|
|
39
|
+
function runtimeBinaryEnvVar(runtime) {
|
|
40
|
+
return `DOOM_TEAM_${runtime.toUpperCase().replace(/[^A-Z0-9]+/g, "_")}_BIN`;
|
|
41
|
+
}
|
|
42
|
+
const SUBAGENT_CAPABILITY_CEILING_ENV = "PI_SUBAGENT_CAPABILITY_CEILING_V1";
|
|
43
|
+
const REQUIRED_CHILD_TOOLS_ENV = "PI_SUBAGENT_REQUIRED_TOOLS";
|
|
44
|
+
const MCP_DIRECT_CHILD_TOOLS_ENV = "PI_SUBAGENT_MCP_DIRECT_TOOLS";
|
|
45
|
+
const CHILD_TOOL_DIAGNOSTIC_PATH_ENV = "PI_SUBAGENT_TOOL_DIAGNOSTIC_PATH";
|
|
46
|
+
const TOOL_BUDGET_ENV = "PI_SUBAGENT_TOOL_BUDGET";
|
|
47
|
+
const TOOL_BUDGET_ZERO_AUTH_ENV = "PI_SUBAGENT_TOOL_BUDGET_ZERO_AUTH";
|
|
48
|
+
const MAX_SPAWNS_PER_SESSION_ENV = "PI_SUBAGENT_MAX_SPAWNS_PER_SESSION";
|
|
49
|
+
const STRUCTURED_OUTPUT_SCHEMA_ENV = "PI_SUBAGENT_STRUCTURED_OUTPUT_SCHEMA";
|
|
50
|
+
const STRUCTURED_OUTPUT_CAPTURE_ENV = "PI_SUBAGENT_STRUCTURED_OUTPUT_CAPTURE";
|
|
51
|
+
const INHERIT_PROJECT_CONTEXT_ENV = "PI_SUBAGENT_INHERIT_PROJECT_CONTEXT";
|
|
52
|
+
const INHERIT_SKILLS_ENV = "PI_SUBAGENT_INHERIT_SKILLS";
|
|
53
|
+
/**
|
|
54
|
+
* Unprefixed on purpose: this one belongs to the Pi host, not to us. The child's
|
|
55
|
+
* Pi runtime reads it directly, so the name is fixed by that contract and must
|
|
56
|
+
* not be brought under the `PI_SUBAGENT_` namespace.
|
|
57
|
+
*/
|
|
58
|
+
const MCP_DIRECT_TOOLS_ENV = "MCP_DIRECT_TOOLS";
|
|
59
|
+
/** Overrides where worktrees are created, for hosts whose tmpdir is unsuitable. */
|
|
60
|
+
const WORKTREE_BASE_DIR_ENV = "PI_SUBAGENTS_WORKTREE_DIR";
|
|
61
|
+
const EXTRA_AGENT_DIRS_ENV = "PI_SUBAGENT_EXTRA_AGENT_DIRS";
|
|
62
|
+
const EXTRA_SKILL_DIRS_ENV = "PI_SUBAGENT_EXTRA_SKILL_DIRS";
|
|
63
|
+
const PI_SUBAGENT_PI_BINARY_ENV = "PI_SUBAGENT_PI_BINARY";
|
|
64
|
+
const PI_CODING_AGENT_PACKAGE_ROOT_ENV = "PI_SUBAGENTS_PI_CODING_AGENT_PACKAGE_ROOT";
|
|
65
|
+
const SUBAGENT_INTERCOM_SESSION_NAME_ENV = "PI_SUBAGENT_INTERCOM_SESSION_NAME";
|
|
66
|
+
const PI_INTERCOM_STABLE_ID_ENV = "PI_INTERCOM_STABLE_ID";
|
|
67
|
+
const PI_INTERCOM_SESSION_ID_ENV = "PI_INTERCOM_SESSION_ID";
|
|
68
|
+
/** Resolved child-safe Po extensions inherited by SDK-backed agents. */
|
|
69
|
+
const PO_CHILD_EXTENSIONS_ENV = "PO_CHILD_EXTENSIONS";
|
|
70
|
+
/** Resolved Po domain skill directories inherited by SDK-backed agents. */
|
|
71
|
+
const PO_SKILL_DIRS_ENV = "PO_SKILL_DIRS";
|
|
72
|
+
//#endregion
|
|
73
|
+
Object.defineProperty(exports, "CHILD_TOOL_DIAGNOSTIC_PATH_ENV", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function() {
|
|
76
|
+
return CHILD_TOOL_DIAGNOSTIC_PATH_ENV;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(exports, "EXTRA_AGENT_DIRS_ENV", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function() {
|
|
82
|
+
return EXTRA_AGENT_DIRS_ENV;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "EXTRA_SKILL_DIRS_ENV", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function() {
|
|
88
|
+
return EXTRA_SKILL_DIRS_ENV;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(exports, "INHERIT_PROJECT_CONTEXT_ENV", {
|
|
92
|
+
enumerable: true,
|
|
93
|
+
get: function() {
|
|
94
|
+
return INHERIT_PROJECT_CONTEXT_ENV;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(exports, "INHERIT_SKILLS_ENV", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function() {
|
|
100
|
+
return INHERIT_SKILLS_ENV;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
Object.defineProperty(exports, "MAX_SPAWNS_PER_SESSION_ENV", {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
get: function() {
|
|
106
|
+
return MAX_SPAWNS_PER_SESSION_ENV;
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(exports, "MCP_DIRECT_CHILD_TOOLS_ENV", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function() {
|
|
112
|
+
return MCP_DIRECT_CHILD_TOOLS_ENV;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
Object.defineProperty(exports, "MCP_DIRECT_TOOLS_ENV", {
|
|
116
|
+
enumerable: true,
|
|
117
|
+
get: function() {
|
|
118
|
+
return MCP_DIRECT_TOOLS_ENV;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
Object.defineProperty(exports, "PI_CODING_AGENT_PACKAGE_ROOT_ENV", {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: function() {
|
|
124
|
+
return PI_CODING_AGENT_PACKAGE_ROOT_ENV;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
Object.defineProperty(exports, "PI_INTERCOM_SESSION_ID_ENV", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function() {
|
|
130
|
+
return PI_INTERCOM_SESSION_ID_ENV;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(exports, "PI_INTERCOM_STABLE_ID_ENV", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function() {
|
|
136
|
+
return PI_INTERCOM_STABLE_ID_ENV;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(exports, "PI_RUNTIME_NAME", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
get: function() {
|
|
142
|
+
return PI_RUNTIME_NAME;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
Object.defineProperty(exports, "PI_SUBAGENT_PI_BINARY_ENV", {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function() {
|
|
148
|
+
return PI_SUBAGENT_PI_BINARY_ENV;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
Object.defineProperty(exports, "PO_CHILD_EXTENSIONS_ENV", {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
get: function() {
|
|
154
|
+
return PO_CHILD_EXTENSIONS_ENV;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
Object.defineProperty(exports, "PO_SKILL_DIRS_ENV", {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function() {
|
|
160
|
+
return PO_SKILL_DIRS_ENV;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
Object.defineProperty(exports, "REQUIRED_CHILD_TOOLS_ENV", {
|
|
164
|
+
enumerable: true,
|
|
165
|
+
get: function() {
|
|
166
|
+
return REQUIRED_CHILD_TOOLS_ENV;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
Object.defineProperty(exports, "STRUCTURED_OUTPUT_CAPTURE_ENV", {
|
|
170
|
+
enumerable: true,
|
|
171
|
+
get: function() {
|
|
172
|
+
return STRUCTURED_OUTPUT_CAPTURE_ENV;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
Object.defineProperty(exports, "STRUCTURED_OUTPUT_SCHEMA_ENV", {
|
|
176
|
+
enumerable: true,
|
|
177
|
+
get: function() {
|
|
178
|
+
return STRUCTURED_OUTPUT_SCHEMA_ENV;
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
Object.defineProperty(exports, "SUBAGENT_CAPABILITY_CEILING_ENV", {
|
|
182
|
+
enumerable: true,
|
|
183
|
+
get: function() {
|
|
184
|
+
return SUBAGENT_CAPABILITY_CEILING_ENV;
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
Object.defineProperty(exports, "SUBAGENT_CHILD_AGENT_ENV", {
|
|
188
|
+
enumerable: true,
|
|
189
|
+
get: function() {
|
|
190
|
+
return SUBAGENT_CHILD_AGENT_ENV;
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
Object.defineProperty(exports, "SUBAGENT_CHILD_INDEX_ENV", {
|
|
194
|
+
enumerable: true,
|
|
195
|
+
get: function() {
|
|
196
|
+
return SUBAGENT_CHILD_INDEX_ENV;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
Object.defineProperty(exports, "SUBAGENT_FANOUT_CHILD_ENV", {
|
|
200
|
+
enumerable: true,
|
|
201
|
+
get: function() {
|
|
202
|
+
return SUBAGENT_FANOUT_CHILD_ENV;
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
Object.defineProperty(exports, "SUBAGENT_INTERCOM_SESSION_NAME_ENV", {
|
|
206
|
+
enumerable: true,
|
|
207
|
+
get: function() {
|
|
208
|
+
return SUBAGENT_INTERCOM_SESSION_NAME_ENV;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
Object.defineProperty(exports, "SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV", {
|
|
212
|
+
enumerable: true,
|
|
213
|
+
get: function() {
|
|
214
|
+
return SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV;
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
Object.defineProperty(exports, "SUBAGENT_PARENT_CHILD_INDEX_ENV", {
|
|
218
|
+
enumerable: true,
|
|
219
|
+
get: function() {
|
|
220
|
+
return SUBAGENT_PARENT_CHILD_INDEX_ENV;
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
Object.defineProperty(exports, "SUBAGENT_PARENT_CONTROL_INBOX_ENV", {
|
|
224
|
+
enumerable: true,
|
|
225
|
+
get: function() {
|
|
226
|
+
return SUBAGENT_PARENT_CONTROL_INBOX_ENV;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
Object.defineProperty(exports, "SUBAGENT_PARENT_DEPTH_ENV", {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
get: function() {
|
|
232
|
+
return SUBAGENT_PARENT_DEPTH_ENV;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
Object.defineProperty(exports, "SUBAGENT_PARENT_EVENT_SINK_ENV", {
|
|
236
|
+
enumerable: true,
|
|
237
|
+
get: function() {
|
|
238
|
+
return SUBAGENT_PARENT_EVENT_SINK_ENV;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
Object.defineProperty(exports, "SUBAGENT_PARENT_PATH_ENV", {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function() {
|
|
244
|
+
return SUBAGENT_PARENT_PATH_ENV;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
Object.defineProperty(exports, "SUBAGENT_PARENT_ROOT_RUN_ID_ENV", {
|
|
248
|
+
enumerable: true,
|
|
249
|
+
get: function() {
|
|
250
|
+
return SUBAGENT_PARENT_ROOT_RUN_ID_ENV;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
Object.defineProperty(exports, "SUBAGENT_PARENT_RUN_ID_ENV", {
|
|
254
|
+
enumerable: true,
|
|
255
|
+
get: function() {
|
|
256
|
+
return SUBAGENT_PARENT_RUN_ID_ENV;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
Object.defineProperty(exports, "SUBAGENT_PROTECTED_PARENT_PIDS_ENV", {
|
|
260
|
+
enumerable: true,
|
|
261
|
+
get: function() {
|
|
262
|
+
return SUBAGENT_PROTECTED_PARENT_PIDS_ENV;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
Object.defineProperty(exports, "SUBAGENT_RUN_ID_ENV", {
|
|
266
|
+
enumerable: true,
|
|
267
|
+
get: function() {
|
|
268
|
+
return SUBAGENT_RUN_ID_ENV;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
Object.defineProperty(exports, "SUBAGENT_STEER_ACK_DIR_ENV", {
|
|
272
|
+
enumerable: true,
|
|
273
|
+
get: function() {
|
|
274
|
+
return SUBAGENT_STEER_ACK_DIR_ENV;
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
Object.defineProperty(exports, "SUBAGENT_STEER_CAPABILITY_ENV", {
|
|
278
|
+
enumerable: true,
|
|
279
|
+
get: function() {
|
|
280
|
+
return SUBAGENT_STEER_CAPABILITY_ENV;
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
Object.defineProperty(exports, "SUBAGENT_STEER_INBOX_ENV", {
|
|
284
|
+
enumerable: true,
|
|
285
|
+
get: function() {
|
|
286
|
+
return SUBAGENT_STEER_INBOX_ENV;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
Object.defineProperty(exports, "TOOL_BUDGET_ENV", {
|
|
290
|
+
enumerable: true,
|
|
291
|
+
get: function() {
|
|
292
|
+
return TOOL_BUDGET_ENV;
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
Object.defineProperty(exports, "TOOL_BUDGET_ZERO_AUTH_ENV", {
|
|
296
|
+
enumerable: true,
|
|
297
|
+
get: function() {
|
|
298
|
+
return TOOL_BUDGET_ZERO_AUTH_ENV;
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
Object.defineProperty(exports, "WORKTREE_BASE_DIR_ENV", {
|
|
302
|
+
enumerable: true,
|
|
303
|
+
get: function() {
|
|
304
|
+
return WORKTREE_BASE_DIR_ENV;
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
Object.defineProperty(exports, "decodeProtectedParentProcessIds", {
|
|
308
|
+
enumerable: true,
|
|
309
|
+
get: function() {
|
|
310
|
+
return decodeProtectedParentProcessIds;
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
Object.defineProperty(exports, "runtimeBinaryEnvVar", {
|
|
314
|
+
enumerable: true,
|
|
315
|
+
get: function() {
|
|
316
|
+
return runtimeBinaryEnvVar;
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
//# sourceMappingURL=environment-CaCW3SgT.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-CaCW3SgT.cjs","names":[],"sources":["../src/types/environment.ts"],"sourcesContent":["/**\n * Cross-process environment variable names.\n *\n * DESIGN PATTERNS:\n * - Zero imports, so any process role can read these without pulling in runtime\n * - Names AND values are identical to the predecessor package on purpose\n *\n * WHY THE VALUES ARE UNCHANGED:\n * `PI_SUBAGENT_CHILD` and `PI_SUBAGENT_PARENT_SESSION` are how sibling\n * extensions decide whether they are running inside a subagent child. A child\n * reads whatever its spawning parent set, so during cutover a consumer that has\n * already moved to this package can still be spawned by a po-subagents\n * parent. Re-prefixing the values would make that child fail to recognise\n * itself. Filesystem roots are namespaced instead; those are what actually\n * needed isolating.\n *\n * AVOID:\n * - Re-prefixing these values; the isolation belongs in the temp roots\n * - Hardcoding any of these literals at a call site\n */\n\nexport {\n SUBAGENT_CHILD_ENV,\n SUBAGENT_PARENT_SESSION_ENV,\n SUBAGENT_ROOT_SESSION_ENV,\n} from '@agimon-ai/po-core/childProcess';\n\nexport const SUBAGENT_RUN_ID_ENV = 'PI_SUBAGENT_RUN_ID';\nexport const SUBAGENT_CHILD_AGENT_ENV = 'PI_SUBAGENT_CHILD_AGENT';\nexport const SUBAGENT_CHILD_INDEX_ENV = 'PI_SUBAGENT_CHILD_INDEX';\nexport const SUBAGENT_FANOUT_CHILD_ENV = 'PI_SUBAGENT_FANOUT_CHILD';\nexport const SUBAGENT_PARENT_EVENT_SINK_ENV = 'PI_SUBAGENT_PARENT_EVENT_SINK';\nexport const SUBAGENT_PARENT_CONTROL_INBOX_ENV = 'PI_SUBAGENT_PARENT_CONTROL_INBOX';\nexport const SUBAGENT_PARENT_ROOT_RUN_ID_ENV = 'PI_SUBAGENT_PARENT_ROOT_RUN_ID';\nexport const SUBAGENT_PARENT_RUN_ID_ENV = 'PI_SUBAGENT_PARENT_RUN_ID';\nexport const SUBAGENT_PARENT_CHILD_INDEX_ENV = 'PI_SUBAGENT_PARENT_CHILD_INDEX';\nexport const SUBAGENT_PARENT_DEPTH_ENV = 'PI_SUBAGENT_PARENT_DEPTH';\nexport const SUBAGENT_PARENT_PATH_ENV = 'PI_SUBAGENT_PARENT_PATH';\nexport const SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV = 'PI_SUBAGENT_PARENT_CAPABILITY_TOKEN';\n/** Parent/workflow process ids a child Bash tool must never signal. */\nexport const SUBAGENT_PROTECTED_PARENT_PIDS_ENV = 'PI_SUBAGENT_PROTECTED_PARENT_PIDS';\n\n/** Decode the parent-owned PID allowlist without trusting malformed environment state. */\nexport function decodeProtectedParentProcessIds(encoded: string | undefined): number[] {\n if (!encoded) return [];\n try {\n const parsed: unknown = JSON.parse(encoded);\n if (!Array.isArray(parsed)) return [];\n return [\n ...new Set(\n parsed.filter(\n (value): value is number => typeof value === 'number' && Number.isSafeInteger(value) && value > 1,\n ),\n ),\n ];\n } catch {\n return [];\n }\n}\nexport const SUBAGENT_STEER_INBOX_ENV = 'PI_SUBAGENT_STEER_INBOX';\nexport const SUBAGENT_STEER_CAPABILITY_ENV = 'PI_SUBAGENT_STEER_CAPABILITY';\nexport const SUBAGENT_STEER_ACK_DIR_ENV = 'PI_SUBAGENT_STEER_ACK_DIR';\n\n/** The in-process SDK runtime. Not an external command; see `runtimeRegistry.ts`. */\nexport const PI_RUNTIME_NAME = 'pi';\n\n/**\n * Per-runtime binary override, e.g. `DOOM_TEAM_CLAUDE_BIN=/path/to/claude`.\n *\n * Uppercased and non-alphanumerics folded to `_` so a runtime name that is\n * legal in config is always a legal environment variable name.\n */\nexport function runtimeBinaryEnvVar(runtime: string): string {\n return `DOOM_TEAM_${runtime.toUpperCase().replace(/[^A-Z0-9]+/g, '_')}_BIN`;\n}\n\nexport const SUBAGENT_CAPABILITY_CEILING_ENV = 'PI_SUBAGENT_CAPABILITY_CEILING_V1';\nexport const REQUIRED_CHILD_TOOLS_ENV = 'PI_SUBAGENT_REQUIRED_TOOLS';\nexport const MCP_DIRECT_CHILD_TOOLS_ENV = 'PI_SUBAGENT_MCP_DIRECT_TOOLS';\nexport const CHILD_TOOL_DIAGNOSTIC_PATH_ENV = 'PI_SUBAGENT_TOOL_DIAGNOSTIC_PATH';\nexport const TOOL_BUDGET_ENV = 'PI_SUBAGENT_TOOL_BUDGET';\nexport const TOOL_BUDGET_ZERO_AUTH_ENV = 'PI_SUBAGENT_TOOL_BUDGET_ZERO_AUTH';\nexport const MAX_SPAWNS_PER_SESSION_ENV = 'PI_SUBAGENT_MAX_SPAWNS_PER_SESSION';\nexport const STRUCTURED_OUTPUT_SCHEMA_ENV = 'PI_SUBAGENT_STRUCTURED_OUTPUT_SCHEMA';\nexport const STRUCTURED_OUTPUT_CAPTURE_ENV = 'PI_SUBAGENT_STRUCTURED_OUTPUT_CAPTURE';\nexport const INHERIT_PROJECT_CONTEXT_ENV = 'PI_SUBAGENT_INHERIT_PROJECT_CONTEXT';\nexport const INHERIT_SKILLS_ENV = 'PI_SUBAGENT_INHERIT_SKILLS';\n/**\n * Unprefixed on purpose: this one belongs to the Pi host, not to us. The child's\n * Pi runtime reads it directly, so the name is fixed by that contract and must\n * not be brought under the `PI_SUBAGENT_` namespace.\n */\nexport const MCP_DIRECT_TOOLS_ENV = 'MCP_DIRECT_TOOLS';\n/** Overrides where worktrees are created, for hosts whose tmpdir is unsuitable. */\nexport const WORKTREE_BASE_DIR_ENV = 'PI_SUBAGENTS_WORKTREE_DIR';\nexport const EXTRA_AGENT_DIRS_ENV = 'PI_SUBAGENT_EXTRA_AGENT_DIRS';\nexport const EXTRA_SKILL_DIRS_ENV = 'PI_SUBAGENT_EXTRA_SKILL_DIRS';\nexport const PI_SUBAGENT_PI_BINARY_ENV = 'PI_SUBAGENT_PI_BINARY';\nexport const PI_CODING_AGENT_PACKAGE_ROOT_ENV = 'PI_SUBAGENTS_PI_CODING_AGENT_PACKAGE_ROOT';\nexport const SUBAGENT_INTERCOM_SESSION_NAME_ENV = 'PI_SUBAGENT_INTERCOM_SESSION_NAME';\nexport const PI_INTERCOM_STABLE_ID_ENV = 'PI_INTERCOM_STABLE_ID';\nexport const PI_INTERCOM_SESSION_ID_ENV = 'PI_INTERCOM_SESSION_ID';\n\n/** Resolved child-safe Po extensions inherited by SDK-backed agents. */\nexport const PO_CHILD_EXTENSIONS_ENV = 'PO_CHILD_EXTENSIONS';\n/** Resolved Po domain skill directories inherited by SDK-backed agents. */\nexport const PO_SKILL_DIRS_ENV = 'PO_SKILL_DIRS';\n"],"mappings":";;AA2BA,MAAa,sBAAsB;AACnC,MAAa,2BAA2B;AACxC,MAAa,2BAA2B;AACxC,MAAa,4BAA4B;AACzC,MAAa,iCAAiC;AAC9C,MAAa,oCAAoC;AACjD,MAAa,kCAAkC;AAC/C,MAAa,6BAA6B;AAC1C,MAAa,kCAAkC;AAC/C,MAAa,4BAA4B;AACzC,MAAa,2BAA2B;AACxC,MAAa,uCAAuC;;AAEpD,MAAa,qCAAqC;;AAGlD,SAAgB,gCAAgC,SAAuC;CACrF,IAAI,CAAC,SAAS,OAAO,CAAC;CACtB,IAAI;EACF,MAAM,SAAkB,KAAK,MAAM,OAAO;EAC1C,IAAI,CAAC,MAAM,QAAQ,MAAM,GAAG,OAAO,CAAC;EACpC,OAAO,CACL,GAAG,IAAI,IACL,OAAO,QACJ,UAA2B,OAAO,UAAU,YAAY,OAAO,cAAc,KAAK,KAAK,QAAQ,CAClG,CACF,CACF;CACF,QAAQ;EACN,OAAO,CAAC;CACV;AACF;AACA,MAAa,2BAA2B;AACxC,MAAa,gCAAgC;AAC7C,MAAa,6BAA6B;;AAG1C,MAAa,kBAAkB;;;;;;;AAQ/B,SAAgB,oBAAoB,SAAyB;CAC3D,OAAO,aAAa,QAAQ,YAAY,CAAC,CAAC,QAAQ,eAAe,GAAG,EAAE;AACxE;AAEA,MAAa,kCAAkC;AAC/C,MAAa,2BAA2B;AACxC,MAAa,6BAA6B;AAC1C,MAAa,iCAAiC;AAC9C,MAAa,kBAAkB;AAC/B,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;AAC1C,MAAa,+BAA+B;AAC5C,MAAa,gCAAgC;AAC7C,MAAa,8BAA8B;AAC3C,MAAa,qBAAqB;;;;;;AAMlC,MAAa,uBAAuB;;AAEpC,MAAa,wBAAwB;AACrC,MAAa,uBAAuB;AACpC,MAAa,uBAAuB;AACpC,MAAa,4BAA4B;AACzC,MAAa,mCAAmC;AAChD,MAAa,qCAAqC;AAClD,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;;AAG1C,MAAa,0BAA0B;;AAEvC,MAAa,oBAAoB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { SUBAGENT_CHILD_ENV, SUBAGENT_PARENT_SESSION_ENV, SUBAGENT_ROOT_SESSION_ENV } from "@agimon-ai/po-core/childProcess";
|
|
2
|
+
//#region src/types/environment.ts
|
|
3
|
+
const SUBAGENT_RUN_ID_ENV = "PI_SUBAGENT_RUN_ID";
|
|
4
|
+
const SUBAGENT_CHILD_AGENT_ENV = "PI_SUBAGENT_CHILD_AGENT";
|
|
5
|
+
const SUBAGENT_CHILD_INDEX_ENV = "PI_SUBAGENT_CHILD_INDEX";
|
|
6
|
+
const SUBAGENT_FANOUT_CHILD_ENV = "PI_SUBAGENT_FANOUT_CHILD";
|
|
7
|
+
const SUBAGENT_PARENT_EVENT_SINK_ENV = "PI_SUBAGENT_PARENT_EVENT_SINK";
|
|
8
|
+
const SUBAGENT_PARENT_CONTROL_INBOX_ENV = "PI_SUBAGENT_PARENT_CONTROL_INBOX";
|
|
9
|
+
const SUBAGENT_PARENT_ROOT_RUN_ID_ENV = "PI_SUBAGENT_PARENT_ROOT_RUN_ID";
|
|
10
|
+
const SUBAGENT_PARENT_RUN_ID_ENV = "PI_SUBAGENT_PARENT_RUN_ID";
|
|
11
|
+
const SUBAGENT_PARENT_CHILD_INDEX_ENV = "PI_SUBAGENT_PARENT_CHILD_INDEX";
|
|
12
|
+
const SUBAGENT_PARENT_DEPTH_ENV = "PI_SUBAGENT_PARENT_DEPTH";
|
|
13
|
+
const SUBAGENT_PARENT_PATH_ENV = "PI_SUBAGENT_PARENT_PATH";
|
|
14
|
+
const SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV = "PI_SUBAGENT_PARENT_CAPABILITY_TOKEN";
|
|
15
|
+
/** Parent/workflow process ids a child Bash tool must never signal. */
|
|
16
|
+
const SUBAGENT_PROTECTED_PARENT_PIDS_ENV = "PI_SUBAGENT_PROTECTED_PARENT_PIDS";
|
|
17
|
+
/** Decode the parent-owned PID allowlist without trusting malformed environment state. */
|
|
18
|
+
function decodeProtectedParentProcessIds(encoded) {
|
|
19
|
+
if (!encoded) return [];
|
|
20
|
+
try {
|
|
21
|
+
const parsed = JSON.parse(encoded);
|
|
22
|
+
if (!Array.isArray(parsed)) return [];
|
|
23
|
+
return [...new Set(parsed.filter((value) => typeof value === "number" && Number.isSafeInteger(value) && value > 1))];
|
|
24
|
+
} catch {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const SUBAGENT_STEER_INBOX_ENV = "PI_SUBAGENT_STEER_INBOX";
|
|
29
|
+
const SUBAGENT_STEER_CAPABILITY_ENV = "PI_SUBAGENT_STEER_CAPABILITY";
|
|
30
|
+
const SUBAGENT_STEER_ACK_DIR_ENV = "PI_SUBAGENT_STEER_ACK_DIR";
|
|
31
|
+
/** The in-process SDK runtime. Not an external command; see `runtimeRegistry.ts`. */
|
|
32
|
+
const PI_RUNTIME_NAME = "pi";
|
|
33
|
+
/**
|
|
34
|
+
* Per-runtime binary override, e.g. `DOOM_TEAM_CLAUDE_BIN=/path/to/claude`.
|
|
35
|
+
*
|
|
36
|
+
* Uppercased and non-alphanumerics folded to `_` so a runtime name that is
|
|
37
|
+
* legal in config is always a legal environment variable name.
|
|
38
|
+
*/
|
|
39
|
+
function runtimeBinaryEnvVar(runtime) {
|
|
40
|
+
return `DOOM_TEAM_${runtime.toUpperCase().replace(/[^A-Z0-9]+/g, "_")}_BIN`;
|
|
41
|
+
}
|
|
42
|
+
const SUBAGENT_CAPABILITY_CEILING_ENV = "PI_SUBAGENT_CAPABILITY_CEILING_V1";
|
|
43
|
+
const REQUIRED_CHILD_TOOLS_ENV = "PI_SUBAGENT_REQUIRED_TOOLS";
|
|
44
|
+
const MCP_DIRECT_CHILD_TOOLS_ENV = "PI_SUBAGENT_MCP_DIRECT_TOOLS";
|
|
45
|
+
const CHILD_TOOL_DIAGNOSTIC_PATH_ENV = "PI_SUBAGENT_TOOL_DIAGNOSTIC_PATH";
|
|
46
|
+
const TOOL_BUDGET_ENV = "PI_SUBAGENT_TOOL_BUDGET";
|
|
47
|
+
const TOOL_BUDGET_ZERO_AUTH_ENV = "PI_SUBAGENT_TOOL_BUDGET_ZERO_AUTH";
|
|
48
|
+
const MAX_SPAWNS_PER_SESSION_ENV = "PI_SUBAGENT_MAX_SPAWNS_PER_SESSION";
|
|
49
|
+
const STRUCTURED_OUTPUT_SCHEMA_ENV = "PI_SUBAGENT_STRUCTURED_OUTPUT_SCHEMA";
|
|
50
|
+
const STRUCTURED_OUTPUT_CAPTURE_ENV = "PI_SUBAGENT_STRUCTURED_OUTPUT_CAPTURE";
|
|
51
|
+
const INHERIT_PROJECT_CONTEXT_ENV = "PI_SUBAGENT_INHERIT_PROJECT_CONTEXT";
|
|
52
|
+
const INHERIT_SKILLS_ENV = "PI_SUBAGENT_INHERIT_SKILLS";
|
|
53
|
+
/**
|
|
54
|
+
* Unprefixed on purpose: this one belongs to the Pi host, not to us. The child's
|
|
55
|
+
* Pi runtime reads it directly, so the name is fixed by that contract and must
|
|
56
|
+
* not be brought under the `PI_SUBAGENT_` namespace.
|
|
57
|
+
*/
|
|
58
|
+
const MCP_DIRECT_TOOLS_ENV = "MCP_DIRECT_TOOLS";
|
|
59
|
+
/** Overrides where worktrees are created, for hosts whose tmpdir is unsuitable. */
|
|
60
|
+
const WORKTREE_BASE_DIR_ENV = "PI_SUBAGENTS_WORKTREE_DIR";
|
|
61
|
+
const EXTRA_AGENT_DIRS_ENV = "PI_SUBAGENT_EXTRA_AGENT_DIRS";
|
|
62
|
+
const EXTRA_SKILL_DIRS_ENV = "PI_SUBAGENT_EXTRA_SKILL_DIRS";
|
|
63
|
+
const PI_SUBAGENT_PI_BINARY_ENV = "PI_SUBAGENT_PI_BINARY";
|
|
64
|
+
const PI_CODING_AGENT_PACKAGE_ROOT_ENV = "PI_SUBAGENTS_PI_CODING_AGENT_PACKAGE_ROOT";
|
|
65
|
+
const SUBAGENT_INTERCOM_SESSION_NAME_ENV = "PI_SUBAGENT_INTERCOM_SESSION_NAME";
|
|
66
|
+
const PI_INTERCOM_STABLE_ID_ENV = "PI_INTERCOM_STABLE_ID";
|
|
67
|
+
const PI_INTERCOM_SESSION_ID_ENV = "PI_INTERCOM_SESSION_ID";
|
|
68
|
+
/** Resolved child-safe Po extensions inherited by SDK-backed agents. */
|
|
69
|
+
const PO_CHILD_EXTENSIONS_ENV = "PO_CHILD_EXTENSIONS";
|
|
70
|
+
/** Resolved Po domain skill directories inherited by SDK-backed agents. */
|
|
71
|
+
const PO_SKILL_DIRS_ENV = "PO_SKILL_DIRS";
|
|
72
|
+
//#endregion
|
|
73
|
+
export { SUBAGENT_PARENT_PATH_ENV as A, TOOL_BUDGET_ENV as B, SUBAGENT_FANOUT_CHILD_ENV as C, SUBAGENT_PARENT_CONTROL_INBOX_ENV as D, SUBAGENT_PARENT_CHILD_INDEX_ENV as E, SUBAGENT_ROOT_SESSION_ENV as F, WORKTREE_BASE_DIR_ENV as H, SUBAGENT_RUN_ID_ENV as I, SUBAGENT_STEER_ACK_DIR_ENV as L, SUBAGENT_PARENT_RUN_ID_ENV as M, SUBAGENT_PARENT_SESSION_ENV as N, SUBAGENT_PARENT_DEPTH_ENV as O, SUBAGENT_PROTECTED_PARENT_PIDS_ENV as P, SUBAGENT_STEER_CAPABILITY_ENV as R, SUBAGENT_CHILD_INDEX_ENV as S, SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV as T, decodeProtectedParentProcessIds as U, TOOL_BUDGET_ZERO_AUTH_ENV as V, runtimeBinaryEnvVar as W, STRUCTURED_OUTPUT_CAPTURE_ENV as _, INHERIT_SKILLS_ENV as a, SUBAGENT_CHILD_AGENT_ENV as b, MCP_DIRECT_TOOLS_ENV as c, PI_INTERCOM_STABLE_ID_ENV as d, PI_RUNTIME_NAME as f, REQUIRED_CHILD_TOOLS_ENV as g, PO_SKILL_DIRS_ENV as h, INHERIT_PROJECT_CONTEXT_ENV as i, SUBAGENT_PARENT_ROOT_RUN_ID_ENV as j, SUBAGENT_PARENT_EVENT_SINK_ENV as k, PI_CODING_AGENT_PACKAGE_ROOT_ENV as l, PO_CHILD_EXTENSIONS_ENV as m, EXTRA_AGENT_DIRS_ENV as n, MAX_SPAWNS_PER_SESSION_ENV as o, PI_SUBAGENT_PI_BINARY_ENV as p, EXTRA_SKILL_DIRS_ENV as r, MCP_DIRECT_CHILD_TOOLS_ENV as s, CHILD_TOOL_DIAGNOSTIC_PATH_ENV as t, PI_INTERCOM_SESSION_ID_ENV as u, STRUCTURED_OUTPUT_SCHEMA_ENV as v, SUBAGENT_INTERCOM_SESSION_NAME_ENV as w, SUBAGENT_CHILD_ENV as x, SUBAGENT_CAPABILITY_CEILING_ENV as y, SUBAGENT_STEER_INBOX_ENV as z };
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=environment-DrqhrxG_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-DrqhrxG_.mjs","names":[],"sources":["../src/types/environment.ts"],"sourcesContent":["/**\n * Cross-process environment variable names.\n *\n * DESIGN PATTERNS:\n * - Zero imports, so any process role can read these without pulling in runtime\n * - Names AND values are identical to the predecessor package on purpose\n *\n * WHY THE VALUES ARE UNCHANGED:\n * `PI_SUBAGENT_CHILD` and `PI_SUBAGENT_PARENT_SESSION` are how sibling\n * extensions decide whether they are running inside a subagent child. A child\n * reads whatever its spawning parent set, so during cutover a consumer that has\n * already moved to this package can still be spawned by a po-subagents\n * parent. Re-prefixing the values would make that child fail to recognise\n * itself. Filesystem roots are namespaced instead; those are what actually\n * needed isolating.\n *\n * AVOID:\n * - Re-prefixing these values; the isolation belongs in the temp roots\n * - Hardcoding any of these literals at a call site\n */\n\nexport {\n SUBAGENT_CHILD_ENV,\n SUBAGENT_PARENT_SESSION_ENV,\n SUBAGENT_ROOT_SESSION_ENV,\n} from '@agimon-ai/po-core/childProcess';\n\nexport const SUBAGENT_RUN_ID_ENV = 'PI_SUBAGENT_RUN_ID';\nexport const SUBAGENT_CHILD_AGENT_ENV = 'PI_SUBAGENT_CHILD_AGENT';\nexport const SUBAGENT_CHILD_INDEX_ENV = 'PI_SUBAGENT_CHILD_INDEX';\nexport const SUBAGENT_FANOUT_CHILD_ENV = 'PI_SUBAGENT_FANOUT_CHILD';\nexport const SUBAGENT_PARENT_EVENT_SINK_ENV = 'PI_SUBAGENT_PARENT_EVENT_SINK';\nexport const SUBAGENT_PARENT_CONTROL_INBOX_ENV = 'PI_SUBAGENT_PARENT_CONTROL_INBOX';\nexport const SUBAGENT_PARENT_ROOT_RUN_ID_ENV = 'PI_SUBAGENT_PARENT_ROOT_RUN_ID';\nexport const SUBAGENT_PARENT_RUN_ID_ENV = 'PI_SUBAGENT_PARENT_RUN_ID';\nexport const SUBAGENT_PARENT_CHILD_INDEX_ENV = 'PI_SUBAGENT_PARENT_CHILD_INDEX';\nexport const SUBAGENT_PARENT_DEPTH_ENV = 'PI_SUBAGENT_PARENT_DEPTH';\nexport const SUBAGENT_PARENT_PATH_ENV = 'PI_SUBAGENT_PARENT_PATH';\nexport const SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV = 'PI_SUBAGENT_PARENT_CAPABILITY_TOKEN';\n/** Parent/workflow process ids a child Bash tool must never signal. */\nexport const SUBAGENT_PROTECTED_PARENT_PIDS_ENV = 'PI_SUBAGENT_PROTECTED_PARENT_PIDS';\n\n/** Decode the parent-owned PID allowlist without trusting malformed environment state. */\nexport function decodeProtectedParentProcessIds(encoded: string | undefined): number[] {\n if (!encoded) return [];\n try {\n const parsed: unknown = JSON.parse(encoded);\n if (!Array.isArray(parsed)) return [];\n return [\n ...new Set(\n parsed.filter(\n (value): value is number => typeof value === 'number' && Number.isSafeInteger(value) && value > 1,\n ),\n ),\n ];\n } catch {\n return [];\n }\n}\nexport const SUBAGENT_STEER_INBOX_ENV = 'PI_SUBAGENT_STEER_INBOX';\nexport const SUBAGENT_STEER_CAPABILITY_ENV = 'PI_SUBAGENT_STEER_CAPABILITY';\nexport const SUBAGENT_STEER_ACK_DIR_ENV = 'PI_SUBAGENT_STEER_ACK_DIR';\n\n/** The in-process SDK runtime. Not an external command; see `runtimeRegistry.ts`. */\nexport const PI_RUNTIME_NAME = 'pi';\n\n/**\n * Per-runtime binary override, e.g. `DOOM_TEAM_CLAUDE_BIN=/path/to/claude`.\n *\n * Uppercased and non-alphanumerics folded to `_` so a runtime name that is\n * legal in config is always a legal environment variable name.\n */\nexport function runtimeBinaryEnvVar(runtime: string): string {\n return `DOOM_TEAM_${runtime.toUpperCase().replace(/[^A-Z0-9]+/g, '_')}_BIN`;\n}\n\nexport const SUBAGENT_CAPABILITY_CEILING_ENV = 'PI_SUBAGENT_CAPABILITY_CEILING_V1';\nexport const REQUIRED_CHILD_TOOLS_ENV = 'PI_SUBAGENT_REQUIRED_TOOLS';\nexport const MCP_DIRECT_CHILD_TOOLS_ENV = 'PI_SUBAGENT_MCP_DIRECT_TOOLS';\nexport const CHILD_TOOL_DIAGNOSTIC_PATH_ENV = 'PI_SUBAGENT_TOOL_DIAGNOSTIC_PATH';\nexport const TOOL_BUDGET_ENV = 'PI_SUBAGENT_TOOL_BUDGET';\nexport const TOOL_BUDGET_ZERO_AUTH_ENV = 'PI_SUBAGENT_TOOL_BUDGET_ZERO_AUTH';\nexport const MAX_SPAWNS_PER_SESSION_ENV = 'PI_SUBAGENT_MAX_SPAWNS_PER_SESSION';\nexport const STRUCTURED_OUTPUT_SCHEMA_ENV = 'PI_SUBAGENT_STRUCTURED_OUTPUT_SCHEMA';\nexport const STRUCTURED_OUTPUT_CAPTURE_ENV = 'PI_SUBAGENT_STRUCTURED_OUTPUT_CAPTURE';\nexport const INHERIT_PROJECT_CONTEXT_ENV = 'PI_SUBAGENT_INHERIT_PROJECT_CONTEXT';\nexport const INHERIT_SKILLS_ENV = 'PI_SUBAGENT_INHERIT_SKILLS';\n/**\n * Unprefixed on purpose: this one belongs to the Pi host, not to us. The child's\n * Pi runtime reads it directly, so the name is fixed by that contract and must\n * not be brought under the `PI_SUBAGENT_` namespace.\n */\nexport const MCP_DIRECT_TOOLS_ENV = 'MCP_DIRECT_TOOLS';\n/** Overrides where worktrees are created, for hosts whose tmpdir is unsuitable. */\nexport const WORKTREE_BASE_DIR_ENV = 'PI_SUBAGENTS_WORKTREE_DIR';\nexport const EXTRA_AGENT_DIRS_ENV = 'PI_SUBAGENT_EXTRA_AGENT_DIRS';\nexport const EXTRA_SKILL_DIRS_ENV = 'PI_SUBAGENT_EXTRA_SKILL_DIRS';\nexport const PI_SUBAGENT_PI_BINARY_ENV = 'PI_SUBAGENT_PI_BINARY';\nexport const PI_CODING_AGENT_PACKAGE_ROOT_ENV = 'PI_SUBAGENTS_PI_CODING_AGENT_PACKAGE_ROOT';\nexport const SUBAGENT_INTERCOM_SESSION_NAME_ENV = 'PI_SUBAGENT_INTERCOM_SESSION_NAME';\nexport const PI_INTERCOM_STABLE_ID_ENV = 'PI_INTERCOM_STABLE_ID';\nexport const PI_INTERCOM_SESSION_ID_ENV = 'PI_INTERCOM_SESSION_ID';\n\n/** Resolved child-safe Po extensions inherited by SDK-backed agents. */\nexport const PO_CHILD_EXTENSIONS_ENV = 'PO_CHILD_EXTENSIONS';\n/** Resolved Po domain skill directories inherited by SDK-backed agents. */\nexport const PO_SKILL_DIRS_ENV = 'PO_SKILL_DIRS';\n"],"mappings":";;AA2BA,MAAa,sBAAsB;AACnC,MAAa,2BAA2B;AACxC,MAAa,2BAA2B;AACxC,MAAa,4BAA4B;AACzC,MAAa,iCAAiC;AAC9C,MAAa,oCAAoC;AACjD,MAAa,kCAAkC;AAC/C,MAAa,6BAA6B;AAC1C,MAAa,kCAAkC;AAC/C,MAAa,4BAA4B;AACzC,MAAa,2BAA2B;AACxC,MAAa,uCAAuC;;AAEpD,MAAa,qCAAqC;;AAGlD,SAAgB,gCAAgC,SAAuC;CACrF,IAAI,CAAC,SAAS,OAAO,CAAC;CACtB,IAAI;EACF,MAAM,SAAkB,KAAK,MAAM,OAAO;EAC1C,IAAI,CAAC,MAAM,QAAQ,MAAM,GAAG,OAAO,CAAC;EACpC,OAAO,CACL,GAAG,IAAI,IACL,OAAO,QACJ,UAA2B,OAAO,UAAU,YAAY,OAAO,cAAc,KAAK,KAAK,QAAQ,CAClG,CACF,CACF;CACF,QAAQ;EACN,OAAO,CAAC;CACV;AACF;AACA,MAAa,2BAA2B;AACxC,MAAa,gCAAgC;AAC7C,MAAa,6BAA6B;;AAG1C,MAAa,kBAAkB;;;;;;;AAQ/B,SAAgB,oBAAoB,SAAyB;CAC3D,OAAO,aAAa,QAAQ,YAAY,CAAC,CAAC,QAAQ,eAAe,GAAG,EAAE;AACxE;AAEA,MAAa,kCAAkC;AAC/C,MAAa,2BAA2B;AACxC,MAAa,6BAA6B;AAC1C,MAAa,iCAAiC;AAC9C,MAAa,kBAAkB;AAC/B,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;AAC1C,MAAa,+BAA+B;AAC5C,MAAa,gCAAgC;AAC7C,MAAa,8BAA8B;AAC3C,MAAa,qBAAqB;;;;;;AAMlC,MAAa,uBAAuB;;AAEpC,MAAa,wBAAwB;AACrC,MAAa,uBAAuB;AACpC,MAAa,uBAAuB;AACpC,MAAa,4BAA4B;AACzC,MAAa,mCAAmC;AAChD,MAAa,qCAAqC;AAClD,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;;AAG1C,MAAa,0BAA0B;;AAEvC,MAAa,oBAAoB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { SUBAGENT_CHILD_ENV, SUBAGENT_PARENT_SESSION_ENV, SUBAGENT_ROOT_SESSION_ENV } from "@agimon-ai/po-core/childProcess";
|
|
2
|
+
//#region src/types/environment.d.ts
|
|
3
|
+
declare const SUBAGENT_RUN_ID_ENV = "PI_SUBAGENT_RUN_ID";
|
|
4
|
+
declare const SUBAGENT_CHILD_AGENT_ENV = "PI_SUBAGENT_CHILD_AGENT";
|
|
5
|
+
declare const SUBAGENT_CHILD_INDEX_ENV = "PI_SUBAGENT_CHILD_INDEX";
|
|
6
|
+
declare const SUBAGENT_FANOUT_CHILD_ENV = "PI_SUBAGENT_FANOUT_CHILD";
|
|
7
|
+
declare const SUBAGENT_PARENT_EVENT_SINK_ENV = "PI_SUBAGENT_PARENT_EVENT_SINK";
|
|
8
|
+
declare const SUBAGENT_PARENT_CONTROL_INBOX_ENV = "PI_SUBAGENT_PARENT_CONTROL_INBOX";
|
|
9
|
+
declare const SUBAGENT_PARENT_ROOT_RUN_ID_ENV = "PI_SUBAGENT_PARENT_ROOT_RUN_ID";
|
|
10
|
+
declare const SUBAGENT_PARENT_RUN_ID_ENV = "PI_SUBAGENT_PARENT_RUN_ID";
|
|
11
|
+
declare const SUBAGENT_PARENT_CHILD_INDEX_ENV = "PI_SUBAGENT_PARENT_CHILD_INDEX";
|
|
12
|
+
declare const SUBAGENT_PARENT_DEPTH_ENV = "PI_SUBAGENT_PARENT_DEPTH";
|
|
13
|
+
declare const SUBAGENT_PARENT_PATH_ENV = "PI_SUBAGENT_PARENT_PATH";
|
|
14
|
+
declare const SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV = "PI_SUBAGENT_PARENT_CAPABILITY_TOKEN";
|
|
15
|
+
/** Parent/workflow process ids a child Bash tool must never signal. */
|
|
16
|
+
declare const SUBAGENT_PROTECTED_PARENT_PIDS_ENV = "PI_SUBAGENT_PROTECTED_PARENT_PIDS";
|
|
17
|
+
/** Decode the parent-owned PID allowlist without trusting malformed environment state. */
|
|
18
|
+
declare function decodeProtectedParentProcessIds(encoded: string | undefined): number[];
|
|
19
|
+
declare const SUBAGENT_STEER_INBOX_ENV = "PI_SUBAGENT_STEER_INBOX";
|
|
20
|
+
declare const SUBAGENT_STEER_CAPABILITY_ENV = "PI_SUBAGENT_STEER_CAPABILITY";
|
|
21
|
+
declare const SUBAGENT_STEER_ACK_DIR_ENV = "PI_SUBAGENT_STEER_ACK_DIR";
|
|
22
|
+
/** The in-process SDK runtime. Not an external command; see `runtimeRegistry.ts`. */
|
|
23
|
+
declare const PI_RUNTIME_NAME = "pi";
|
|
24
|
+
/**
|
|
25
|
+
* Per-runtime binary override, e.g. `DOOM_TEAM_CLAUDE_BIN=/path/to/claude`.
|
|
26
|
+
*
|
|
27
|
+
* Uppercased and non-alphanumerics folded to `_` so a runtime name that is
|
|
28
|
+
* legal in config is always a legal environment variable name.
|
|
29
|
+
*/
|
|
30
|
+
declare function runtimeBinaryEnvVar(runtime: string): string;
|
|
31
|
+
declare const SUBAGENT_CAPABILITY_CEILING_ENV = "PI_SUBAGENT_CAPABILITY_CEILING_V1";
|
|
32
|
+
declare const REQUIRED_CHILD_TOOLS_ENV = "PI_SUBAGENT_REQUIRED_TOOLS";
|
|
33
|
+
declare const MCP_DIRECT_CHILD_TOOLS_ENV = "PI_SUBAGENT_MCP_DIRECT_TOOLS";
|
|
34
|
+
declare const CHILD_TOOL_DIAGNOSTIC_PATH_ENV = "PI_SUBAGENT_TOOL_DIAGNOSTIC_PATH";
|
|
35
|
+
declare const TOOL_BUDGET_ENV = "PI_SUBAGENT_TOOL_BUDGET";
|
|
36
|
+
declare const TOOL_BUDGET_ZERO_AUTH_ENV = "PI_SUBAGENT_TOOL_BUDGET_ZERO_AUTH";
|
|
37
|
+
declare const MAX_SPAWNS_PER_SESSION_ENV = "PI_SUBAGENT_MAX_SPAWNS_PER_SESSION";
|
|
38
|
+
declare const STRUCTURED_OUTPUT_SCHEMA_ENV = "PI_SUBAGENT_STRUCTURED_OUTPUT_SCHEMA";
|
|
39
|
+
declare const STRUCTURED_OUTPUT_CAPTURE_ENV = "PI_SUBAGENT_STRUCTURED_OUTPUT_CAPTURE";
|
|
40
|
+
declare const INHERIT_PROJECT_CONTEXT_ENV = "PI_SUBAGENT_INHERIT_PROJECT_CONTEXT";
|
|
41
|
+
declare const INHERIT_SKILLS_ENV = "PI_SUBAGENT_INHERIT_SKILLS";
|
|
42
|
+
/**
|
|
43
|
+
* Unprefixed on purpose: this one belongs to the Pi host, not to us. The child's
|
|
44
|
+
* Pi runtime reads it directly, so the name is fixed by that contract and must
|
|
45
|
+
* not be brought under the `PI_SUBAGENT_` namespace.
|
|
46
|
+
*/
|
|
47
|
+
declare const MCP_DIRECT_TOOLS_ENV = "MCP_DIRECT_TOOLS";
|
|
48
|
+
/** Overrides where worktrees are created, for hosts whose tmpdir is unsuitable. */
|
|
49
|
+
declare const WORKTREE_BASE_DIR_ENV = "PI_SUBAGENTS_WORKTREE_DIR";
|
|
50
|
+
declare const EXTRA_AGENT_DIRS_ENV = "PI_SUBAGENT_EXTRA_AGENT_DIRS";
|
|
51
|
+
declare const EXTRA_SKILL_DIRS_ENV = "PI_SUBAGENT_EXTRA_SKILL_DIRS";
|
|
52
|
+
declare const PI_SUBAGENT_PI_BINARY_ENV = "PI_SUBAGENT_PI_BINARY";
|
|
53
|
+
declare const PI_CODING_AGENT_PACKAGE_ROOT_ENV = "PI_SUBAGENTS_PI_CODING_AGENT_PACKAGE_ROOT";
|
|
54
|
+
declare const SUBAGENT_INTERCOM_SESSION_NAME_ENV = "PI_SUBAGENT_INTERCOM_SESSION_NAME";
|
|
55
|
+
declare const PI_INTERCOM_STABLE_ID_ENV = "PI_INTERCOM_STABLE_ID";
|
|
56
|
+
declare const PI_INTERCOM_SESSION_ID_ENV = "PI_INTERCOM_SESSION_ID";
|
|
57
|
+
/** Resolved child-safe Po extensions inherited by SDK-backed agents. */
|
|
58
|
+
declare const PO_CHILD_EXTENSIONS_ENV = "PO_CHILD_EXTENSIONS";
|
|
59
|
+
/** Resolved Po domain skill directories inherited by SDK-backed agents. */
|
|
60
|
+
declare const PO_SKILL_DIRS_ENV = "PO_SKILL_DIRS";
|
|
61
|
+
//#endregion
|
|
62
|
+
export { SUBAGENT_PARENT_PATH_ENV as A, TOOL_BUDGET_ENV as B, SUBAGENT_FANOUT_CHILD_ENV as C, SUBAGENT_PARENT_CONTROL_INBOX_ENV as D, SUBAGENT_PARENT_CHILD_INDEX_ENV as E, SUBAGENT_ROOT_SESSION_ENV as F, WORKTREE_BASE_DIR_ENV as H, SUBAGENT_RUN_ID_ENV as I, SUBAGENT_STEER_ACK_DIR_ENV as L, SUBAGENT_PARENT_RUN_ID_ENV as M, SUBAGENT_PARENT_SESSION_ENV as N, SUBAGENT_PARENT_DEPTH_ENV as O, SUBAGENT_PROTECTED_PARENT_PIDS_ENV as P, SUBAGENT_STEER_CAPABILITY_ENV as R, SUBAGENT_CHILD_INDEX_ENV as S, SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV as T, decodeProtectedParentProcessIds as U, TOOL_BUDGET_ZERO_AUTH_ENV as V, runtimeBinaryEnvVar as W, STRUCTURED_OUTPUT_CAPTURE_ENV as _, INHERIT_SKILLS_ENV as a, SUBAGENT_CHILD_AGENT_ENV as b, MCP_DIRECT_TOOLS_ENV as c, PI_INTERCOM_STABLE_ID_ENV as d, PI_RUNTIME_NAME as f, REQUIRED_CHILD_TOOLS_ENV as g, PO_SKILL_DIRS_ENV as h, INHERIT_PROJECT_CONTEXT_ENV as i, SUBAGENT_PARENT_ROOT_RUN_ID_ENV as j, SUBAGENT_PARENT_EVENT_SINK_ENV as k, PI_CODING_AGENT_PACKAGE_ROOT_ENV as l, PO_CHILD_EXTENSIONS_ENV as m, EXTRA_AGENT_DIRS_ENV as n, MAX_SPAWNS_PER_SESSION_ENV as o, PI_SUBAGENT_PI_BINARY_ENV as p, EXTRA_SKILL_DIRS_ENV as r, MCP_DIRECT_CHILD_TOOLS_ENV as s, CHILD_TOOL_DIAGNOSTIC_PATH_ENV as t, PI_INTERCOM_SESSION_ID_ENV as u, STRUCTURED_OUTPUT_SCHEMA_ENV as v, SUBAGENT_INTERCOM_SESSION_NAME_ENV as w, SUBAGENT_CHILD_ENV as x, SUBAGENT_CAPABILITY_CEILING_ENV as y, SUBAGENT_STEER_INBOX_ENV as z };
|
|
63
|
+
//# sourceMappingURL=environment-ma5oQ7uM.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-ma5oQ7uM.d.mts","names":[],"sources":["../src/types/environment.ts"],"mappings":";;cA2Ba;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;;cAEA;;iBAGG,gCAAgC;cAgBnC;cACA;cACA;;cAGA;;;;;;;iBAQG,oBAAoB;cAIvB;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;;;;;;cAMA;;cAEA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;;cAGA;;cAEA"}
|