@agimon-ai/po-team 0.0.0-alpha.3 → 0.0.0-alpha.4

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 (97) hide show
  1. package/README.md +1 -1
  2. package/dist/{capabilityCeiling-CF7kAS18.mjs → capabilityCeiling-BaHT9v9S.mjs} +3 -3
  3. package/dist/capabilityCeiling-BaHT9v9S.mjs.map +1 -0
  4. package/dist/{capabilityCeiling-C-Y7H8oC.cjs → capabilityCeiling-CO3ZjYmY.cjs} +3 -3
  5. package/dist/capabilityCeiling-CO3ZjYmY.cjs.map +1 -0
  6. package/dist/capabilityCeiling.cjs +2 -2
  7. package/dist/capabilityCeiling.d.mts +2 -2
  8. package/dist/capabilityCeiling.mjs +2 -2
  9. package/dist/delegation.cjs +1 -1
  10. package/dist/delegation.cjs.map +1 -1
  11. package/dist/delegation.d.mts +1 -1
  12. package/dist/delegation.mjs +1 -1
  13. package/dist/delegation.mjs.map +1 -1
  14. package/dist/delegationApi.cjs +30 -30
  15. package/dist/delegationApi.d.mts +2 -2
  16. package/dist/delegationApi.mjs +1 -1
  17. package/dist/env.cjs +1 -1
  18. package/dist/env.d.mts +1 -1
  19. package/dist/env.mjs +1 -1
  20. package/dist/{environment-DrqhrxG_.mjs → environment-BtvJI2S-.mjs} +3 -3
  21. package/dist/environment-BtvJI2S-.mjs.map +1 -0
  22. package/dist/{environment-ma5oQ7uM.d.mts → environment-Bz1OlWIT.d.mts} +2 -2
  23. package/dist/{environment-ma5oQ7uM.d.mts.map → environment-Bz1OlWIT.d.mts.map} +1 -1
  24. package/dist/{environment-CaCW3SgT.cjs → environment-Cqs7vHJL.cjs} +3 -3
  25. package/dist/environment-Cqs7vHJL.cjs.map +1 -0
  26. package/dist/extensions/native.mjs +1 -1
  27. package/dist/extensions/native.mjs.map +1 -1
  28. package/dist/extensions/server.cjs +106 -106
  29. package/dist/extensions/server.cjs.map +1 -1
  30. package/dist/extensions/server.d.mts +1 -1
  31. package/dist/extensions/server.mjs +115 -115
  32. package/dist/extensions/server.mjs.map +1 -1
  33. package/dist/extensions/web.mjs +84 -84
  34. package/dist/extensions/web.mjs.map +1 -1
  35. package/dist/{externalProcessIpc-ojE0pvw0.cjs → externalProcessIpc-BCKfpc4q.cjs} +6 -6
  36. package/dist/externalProcessIpc-BCKfpc4q.cjs.map +1 -0
  37. package/dist/{externalProcessIpc-C-15lJrB.mjs → externalProcessIpc-C-nVArB0.mjs} +6 -6
  38. package/dist/externalProcessIpc-C-nVArB0.mjs.map +1 -0
  39. package/dist/fablePlan.cjs +3 -3
  40. package/dist/fablePlan.d.mts +2 -2
  41. package/dist/fablePlan.mjs +1 -1
  42. package/dist/{fablePlanApi-CZ3uUcMi.d.mts → fablePlanApi-BTNKjLni.d.mts} +6 -6
  43. package/dist/{fablePlanApi-CZ3uUcMi.d.mts.map → fablePlanApi-BTNKjLni.d.mts.map} +1 -1
  44. package/dist/{fablePlanApi-wBu9bRXU.cjs → fablePlanApi-BhI4jnDP.cjs} +12 -12
  45. package/dist/fablePlanApi-BhI4jnDP.cjs.map +1 -0
  46. package/dist/{fablePlanApi-BsHhgVFV.mjs → fablePlanApi-DuMg43Hu.mjs} +5 -5
  47. package/dist/fablePlanApi-DuMg43Hu.mjs.map +1 -0
  48. package/dist/fablePlanApi.cjs +3 -3
  49. package/dist/fablePlanApi.d.mts +2 -2
  50. package/dist/fablePlanApi.mjs +1 -1
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.cjs.map +1 -1
  53. package/dist/index.d.mts +1 -1
  54. package/dist/index.mjs +1 -1
  55. package/dist/index.mjs.map +1 -1
  56. package/dist/runs/background/cliRunnerEntry.cjs +11 -11
  57. package/dist/runs/background/cliRunnerEntry.cjs.map +1 -1
  58. package/dist/runs/background/cliRunnerEntry.mjs +12 -12
  59. package/dist/runs/background/cliRunnerEntry.mjs.map +1 -1
  60. package/dist/runtimeSubagentPolicy.cjs +3 -3
  61. package/dist/runtimeSubagentPolicy.d.mts +2 -2
  62. package/dist/runtimeSubagentPolicy.mjs +1 -1
  63. package/dist/runtimeSubagentTool.cjs +1 -1
  64. package/dist/runtimeSubagentTool.d.mts +1 -1
  65. package/dist/runtimeSubagentTool.mjs +1 -1
  66. package/dist/{subagentPolicy-ALJam4GN.d.mts → subagentPolicy-BE-OZoa-.d.mts} +6 -6
  67. package/dist/subagentPolicy-BE-OZoa-.d.mts.map +1 -0
  68. package/dist/{subagentPolicy-DQRyKDH-.cjs → subagentPolicy-DIpaKHO8.cjs} +8 -8
  69. package/dist/subagentPolicy-DIpaKHO8.cjs.map +1 -0
  70. package/dist/{subagentPolicy-DxjsKeyj.mjs → subagentPolicy-LfcXuqO5.mjs} +5 -5
  71. package/dist/subagentPolicy-LfcXuqO5.mjs.map +1 -0
  72. package/dist/subagentPolicy.cjs +3 -3
  73. package/dist/subagentPolicy.d.mts +2 -2
  74. package/dist/subagentPolicy.mjs +1 -1
  75. package/dist/{subagentTool-WOYrjxgT.mjs → subagentTool-BlaPt3Bp.mjs} +2 -2
  76. package/dist/subagentTool-BlaPt3Bp.mjs.map +1 -0
  77. package/dist/{subagentTool-BTssGLw8.d.mts → subagentTool-D0xqIiYS.d.mts} +2 -2
  78. package/dist/{subagentTool-BTssGLw8.d.mts.map → subagentTool-D0xqIiYS.d.mts.map} +1 -1
  79. package/dist/{subagentTool-Ca2zQXKw.cjs → subagentTool-DxcWc1PE.cjs} +2 -2
  80. package/dist/subagentTool-DxcWc1PE.cjs.map +1 -0
  81. package/dist/subagentTool.cjs +1 -1
  82. package/dist/subagentTool.d.mts +1 -1
  83. package/dist/subagentTool.mjs +1 -1
  84. package/package.json +17 -17
  85. package/dist/capabilityCeiling-C-Y7H8oC.cjs.map +0 -1
  86. package/dist/capabilityCeiling-CF7kAS18.mjs.map +0 -1
  87. package/dist/environment-CaCW3SgT.cjs.map +0 -1
  88. package/dist/environment-DrqhrxG_.mjs.map +0 -1
  89. package/dist/externalProcessIpc-C-15lJrB.mjs.map +0 -1
  90. package/dist/externalProcessIpc-ojE0pvw0.cjs.map +0 -1
  91. package/dist/fablePlanApi-BsHhgVFV.mjs.map +0 -1
  92. package/dist/fablePlanApi-wBu9bRXU.cjs.map +0 -1
  93. package/dist/subagentPolicy-ALJam4GN.d.mts.map +0 -1
  94. package/dist/subagentPolicy-DQRyKDH-.cjs.map +0 -1
  95. package/dist/subagentPolicy-DxjsKeyj.mjs.map +0 -1
  96. package/dist/subagentTool-Ca2zQXKw.cjs.map +0 -1
  97. package/dist/subagentTool-WOYrjxgT.mjs.map +0 -1
package/README.md CHANGED
@@ -121,7 +121,7 @@ With Task installed:
121
121
  4. Task records the terminal result on its own task.
122
122
 
123
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
124
+ `po/delegation`, `po/background-work`, `po/subagent-policy`, and `po/fable-plan` for the
125
125
  active session. Consumers disconnect and reconnect automatically when that provider changes.
126
126
 
127
127
  ## Public API
@@ -1,10 +1,10 @@
1
- import "./environment-DrqhrxG_.mjs";
1
+ import "./environment-BtvJI2S-.mjs";
2
2
  import { Buffer } from "node:buffer";
3
3
  //#region src/schemas/team/capabilityCeiling.ts
4
4
  /**
5
5
  * Capability-ceiling values, intersection, and the child-process codec.
6
6
  *
7
- * Live extension contributions enter through Team's `doom/subagent-policy`
7
+ * Live extension contributions enter through Team's `po/subagent-policy`
8
8
  * Cordis service. Only the resolved ceiling crosses a process boundary, through
9
9
  * the versioned environment value encoded here.
10
10
  */
@@ -153,4 +153,4 @@ function decodeSubagentCapabilityCeiling(value) {
153
153
  //#endregion
154
154
  export { intersectSubagentCapabilityCeilings as a, encodeSubagentCapabilityCeiling as i, SubagentCapabilityPolicyStore as n, parseSubagentCapabilityCeiling as o, decodeSubagentCapabilityCeiling as r, SUBAGENT_CAPABILITY_CEILING_VERSION as t };
155
155
 
156
- //# sourceMappingURL=capabilityCeiling-CF7kAS18.mjs.map
156
+ //# sourceMappingURL=capabilityCeiling-BaHT9v9S.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilityCeiling-BaHT9v9S.mjs","names":[],"sources":["../src/schemas/team/capabilityCeiling.ts"],"sourcesContent":["/**\n * Capability-ceiling values, intersection, and the child-process codec.\n *\n * Live extension contributions enter through Team's `po/subagent-policy`\n * Cordis service. Only the resolved ceiling crosses a process boundary, through\n * the versioned environment value encoded here.\n */\n\nimport { Buffer } from 'node:buffer';\n\nimport type { SubagentPolicy } from '../../schemas/subagentPolicy';\nimport { SUBAGENT_CAPABILITY_CEILING_ENV } from '../../types/environment';\n\nexport const SUBAGENT_CAPABILITY_CEILING_VERSION = 2 as const;\nexport { SUBAGENT_CAPABILITY_CEILING_ENV };\n\nconst MAX_TEXT_BYTES = 256;\nconst MAX_TOOL_NAME_BYTES = 128;\nconst MAX_ALLOWED_TOOLS = 256;\nconst MAX_ALLOWED_EXTERNAL_PROFILES = 32;\nconst MAX_EXTERNAL_PROFILE_NAME_BYTES = 128;\nconst EXTERNAL_PROFILE_PATTERN = /^[A-Za-z0-9][A-Za-z0-9/_.:-]+$/u;\nconst TOOL_NAME_PATTERN = /^[A-Za-z0-9_.:-]+$/u;\nconst LAST_C0_CONTROL_CODE = 0x1f;\nconst DELETE_CODE = 0x7f;\n\n/**\n * Ceiling text crosses a process boundary and is rendered in the TUI, so control\n * characters are rejected. Scanning code points avoids a control-character\n * regex, which lints as a hazard even when the escapes are explicit.\n */\nfunction hasControlCharacter(value: string): boolean {\n for (const character of value) {\n const code = character.codePointAt(0);\n if (code !== undefined && (code <= LAST_C0_CONTROL_CODE || code === DELETE_CODE)) return true;\n }\n return false;\n}\n\nexport type SubagentCapabilityCeiling = {\n allowedTools?: readonly string[];\n requiredTools?: readonly string[];\n allowMcpTools?: boolean;\n allowedExternalProfiles?: readonly string[];\n denyExtensions?: boolean;\n};\n\nexport interface ResolvedSubagentCapabilityCeiling {\n version: typeof SUBAGENT_CAPABILITY_CEILING_VERSION;\n allowedTools?: string[];\n requiredTools?: string[];\n allowMcpTools?: boolean;\n allowedExternalProfiles: string[];\n denyExtensions: boolean;\n sources: string[];\n}\n\nexport interface SubagentCapabilityAudit {\n ceiling: ResolvedSubagentCapabilityCeiling;\n requestedTools?: string[];\n effectiveTools: string[];\n removedTools: string[];\n internalTools: string[];\n extensionsDenied: boolean;\n removedExtensionCount: number;\n requestedMcpToolCount: number;\n effectiveMcpTools: string[];\n}\n\ninterface TypedPolicyRegistration {\n generation: string;\n ceiling: ResolvedSubagentCapabilityCeiling;\n}\n\nexport class SubagentCapabilityPolicyStore {\n private readonly policies = new Map<string, TypedPolicyRegistration>();\n\n register(policy: SubagentPolicy, generation: string): void {\n const ceiling = normalizeCeiling({\n ...(policy.allowedTools ? { allowedTools: policy.allowedTools } : {}),\n ...(policy.requiredTools ? { requiredTools: policy.requiredTools } : {}),\n ...(policy.allowMcpTools === true ? { allowMcpTools: true } : {}),\n ...(policy.allowedExternalProfiles ? { allowedExternalProfiles: policy.allowedExternalProfiles } : {}),\n denyExtensions: policy.denyExtensions === true,\n });\n ceiling.sources = [policy.owner];\n this.policies.set(policy.owner, { generation, ceiling });\n }\n\n update(policy: SubagentPolicy, generation: string): void {\n if (this.policies.get(policy.owner)?.generation !== generation) return;\n this.register(policy, generation);\n }\n\n remove(owner: string, generation: string): void {\n if (this.policies.get(owner)?.generation === generation) this.policies.delete(owner);\n }\n\n clear(): void {\n this.policies.clear();\n }\n\n resolve(inherited?: ResolvedSubagentCapabilityCeiling): ResolvedSubagentCapabilityCeiling | undefined {\n return intersectSubagentCapabilityCeilings(inherited, ...[...this.policies.values()].map(({ ceiling }) => ceiling));\n }\n}\n\nfunction validateText(value: unknown, field: string): string {\n if (\n typeof value !== 'string' ||\n !value.trim() ||\n hasControlCharacter(value) ||\n Buffer.byteLength(value.trim(), 'utf8') > MAX_TEXT_BYTES\n ) {\n throw new Error(\n `Invalid capability ceiling ${field}; expected a non-empty string without control characters (max ${MAX_TEXT_BYTES} UTF-8 bytes).`,\n );\n }\n return value.trim();\n}\n\nfunction normalizeCeiling(ceiling: SubagentCapabilityCeiling): ResolvedSubagentCapabilityCeiling {\n if (!ceiling || typeof ceiling !== 'object' || Array.isArray(ceiling)) {\n throw new Error('Invalid capability ceiling; expected an object.');\n }\n const hasAllowedTools = Object.hasOwn(ceiling, 'allowedTools');\n const hasRequiredTools = Object.hasOwn(ceiling, 'requiredTools');\n const hasAllowMcpTools = Object.hasOwn(ceiling, 'allowMcpTools');\n const hasAllowedExternalProfiles = Object.hasOwn(ceiling, 'allowedExternalProfiles');\n const hasDenyExtensions = Object.hasOwn(ceiling, 'denyExtensions');\n if (!hasAllowedTools && !hasRequiredTools && !hasAllowMcpTools && !hasAllowedExternalProfiles && !hasDenyExtensions) {\n throw new Error(\n 'Invalid capability ceiling; expected allowedTools, requiredTools, allowMcpTools, allowedExternalProfiles, or denyExtensions.',\n );\n }\n if (hasAllowMcpTools && typeof ceiling.allowMcpTools !== 'boolean') {\n throw new Error('Invalid capability ceiling allowMcpTools; expected a boolean.');\n }\n if (hasDenyExtensions && typeof ceiling.denyExtensions !== 'boolean') {\n throw new Error('Invalid capability ceiling denyExtensions; expected a boolean.');\n }\n const normalizeTools = (value: readonly string[] | undefined, field: 'allowedTools' | 'requiredTools') => {\n if (!Array.isArray(value)) throw new Error(`Invalid capability ceiling ${field}; expected an array.`);\n if (value.length > MAX_ALLOWED_TOOLS) {\n throw new Error(`Invalid capability ceiling ${field}; expected at most ${MAX_ALLOWED_TOOLS} names.`);\n }\n return [\n ...new Set(\n value.map((tool) => {\n const name = validateText(tool, `${field} entry`);\n if (!TOOL_NAME_PATTERN.test(name)) {\n throw new Error(`Invalid capability ceiling ${field} entry '${name}'.`);\n }\n if (Buffer.byteLength(name, 'utf8') > MAX_TOOL_NAME_BYTES) {\n throw new Error(\n `Invalid capability ceiling ${field} entry '${name}'; max ${MAX_TOOL_NAME_BYTES} UTF-8 bytes.`,\n );\n }\n return name;\n }),\n ),\n ].sort((left, right) => left.localeCompare(right));\n };\n const allowedTools = hasAllowedTools ? normalizeTools(ceiling.allowedTools, 'allowedTools') : undefined;\n const requiredTools = hasRequiredTools ? normalizeTools(ceiling.requiredTools, 'requiredTools') : undefined;\n let allowedExternalProfiles: string[] = [];\n if (Object.hasOwn(ceiling, 'allowedExternalProfiles')) {\n if (!Array.isArray(ceiling.allowedExternalProfiles)) {\n throw new Error('Invalid capability ceiling allowedExternalProfiles; expected an array.');\n }\n if (ceiling.allowedExternalProfiles.length > MAX_ALLOWED_EXTERNAL_PROFILES) {\n throw new Error(\n `Invalid capability ceiling allowedExternalProfiles; expected at most ${MAX_ALLOWED_EXTERNAL_PROFILES} names.`,\n );\n }\n allowedExternalProfiles = [\n ...new Set(\n ceiling.allowedExternalProfiles.map((profile) => {\n const name = validateText(profile, 'allowedExternalProfiles entry');\n if (\n !EXTERNAL_PROFILE_PATTERN.test(name) ||\n Buffer.byteLength(name, 'utf8') > MAX_EXTERNAL_PROFILE_NAME_BYTES\n ) {\n throw new Error(`Invalid capability ceiling allowedExternalProfiles entry '${name}'.`);\n }\n return name;\n }),\n ),\n ].sort((left, right) => left.localeCompare(right));\n }\n return {\n version: SUBAGENT_CAPABILITY_CEILING_VERSION,\n ...(allowedTools ? { allowedTools } : {}),\n ...(requiredTools?.length ? { requiredTools } : {}),\n ...(ceiling.allowMcpTools === true ? { allowMcpTools: true } : {}),\n allowedExternalProfiles,\n denyExtensions: ceiling.denyExtensions === true,\n sources: [],\n };\n}\n\nexport function parseSubagentCapabilityCeiling(\n value: unknown,\n field = 'capability ceiling',\n): ResolvedSubagentCapabilityCeiling {\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\n throw new Error(`Invalid ${field}; expected an object.`);\n }\n const record = value as Record<string, unknown>;\n if (record.version !== SUBAGENT_CAPABILITY_CEILING_VERSION) throw new Error(`Invalid ${field} version.`);\n const normalized = normalizeCeiling(record as SubagentCapabilityCeiling);\n const sources = record.sources;\n if (!Array.isArray(sources) || sources.some((source) => typeof source !== 'string')) {\n throw new Error(`Invalid ${field} sources; expected an array of strings.`);\n }\n normalized.sources = [...new Set(sources.map((source) => validateText(source, `${field} source`)))].sort();\n return normalized;\n}\n\nexport function intersectSubagentCapabilityCeilings(\n ...ceilings: Array<ResolvedSubagentCapabilityCeiling | undefined>\n): ResolvedSubagentCapabilityCeiling | undefined {\n const active = ceilings.filter((ceiling): ceiling is ResolvedSubagentCapabilityCeiling => ceiling !== undefined);\n if (active.length === 0) return undefined;\n const definedLists = active\n .filter((ceiling) => ceiling.allowedTools !== undefined)\n .map((ceiling) => new Set(ceiling.allowedTools));\n let allowedTools: string[] | undefined;\n if (definedLists.length > 0) {\n allowedTools = [...definedLists[0]!].filter((tool) => definedLists.every((list) => list.has(tool))).sort();\n }\n const requiredTools = [...new Set(active.flatMap((ceiling) => ceiling.requiredTools ?? []))]\n .filter((tool) => !allowedTools || allowedTools.includes(tool))\n .sort((left, right) => left.localeCompare(right));\n const profileSets = active.map((ceiling) => new Set(ceiling.allowedExternalProfiles));\n const allowedExternalProfiles = [...profileSets[0]!]\n .filter((profile) => profileSets.every((profiles) => profiles.has(profile)))\n .sort((left, right) => left.localeCompare(right));\n return {\n version: SUBAGENT_CAPABILITY_CEILING_VERSION,\n ...(allowedTools ? { allowedTools } : {}),\n ...(requiredTools.length ? { requiredTools } : {}),\n ...(active.every((ceiling) => ceiling.allowMcpTools === true) ? { allowMcpTools: true } : {}),\n allowedExternalProfiles,\n denyExtensions: active.some((ceiling) => ceiling.denyExtensions),\n sources: [...new Set(active.flatMap((ceiling) => ceiling.sources))].sort(),\n };\n}\n\nexport function encodeSubagentCapabilityCeiling(\n ceiling: ResolvedSubagentCapabilityCeiling | undefined,\n): string | undefined {\n if (!ceiling) return undefined;\n return Buffer.from(JSON.stringify(ceiling), 'utf8').toString('base64url');\n}\n\nexport function decodeSubagentCapabilityCeiling(\n value: string | undefined,\n): ResolvedSubagentCapabilityCeiling | undefined {\n if (value === undefined || value === '') return undefined;\n let parsed: unknown;\n try {\n parsed = JSON.parse(Buffer.from(value, 'base64url').toString('utf8'));\n } catch (error) {\n throw new Error(`Invalid inherited capability ceiling: ${error instanceof Error ? error.message : String(error)}`);\n }\n if (\n !parsed ||\n typeof parsed !== 'object' ||\n Array.isArray(parsed) ||\n (parsed as { version?: unknown }).version !== SUBAGENT_CAPABILITY_CEILING_VERSION\n ) {\n throw new Error('Invalid inherited capability ceiling version.');\n }\n return parseSubagentCapabilityCeiling(parsed, 'inherited capability ceiling');\n}\n"],"mappings":";;;;;;;;;;AAaA,MAAa,sCAAsC;AAGnD,MAAM,iBAAiB;AACvB,MAAM,sBAAsB;AAC5B,MAAM,oBAAoB;AAC1B,MAAM,gCAAgC;AACtC,MAAM,kCAAkC;AACxC,MAAM,2BAA2B;AACjC,MAAM,oBAAoB;AAC1B,MAAM,uBAAuB;AAC7B,MAAM,cAAc;;;;;;AAOpB,SAAS,oBAAoB,OAAwB;CACnD,KAAK,MAAM,aAAa,OAAO;EAC7B,MAAM,OAAO,UAAU,YAAY,CAAC;EACpC,IAAI,SAAS,KAAA,MAAc,QAAQ,wBAAwB,SAAS,cAAc,OAAO;CAC3F;CACA,OAAO;AACT;AAqCA,IAAa,gCAAb,MAA2C;CACzC,2BAA4B,IAAI,IAAqC;CAErE,SAAS,QAAwB,YAA0B;EACzD,MAAM,UAAU,iBAAiB;GAC/B,GAAI,OAAO,eAAe,EAAE,cAAc,OAAO,aAAa,IAAI,CAAC;GACnE,GAAI,OAAO,gBAAgB,EAAE,eAAe,OAAO,cAAc,IAAI,CAAC;GACtE,GAAI,OAAO,kBAAkB,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;GAC/D,GAAI,OAAO,0BAA0B,EAAE,yBAAyB,OAAO,wBAAwB,IAAI,CAAC;GACpG,gBAAgB,OAAO,mBAAmB;EAC5C,CAAC;EACD,QAAQ,UAAU,CAAC,OAAO,KAAK;EAC/B,KAAK,SAAS,IAAI,OAAO,OAAO;GAAE;GAAY;EAAQ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AAW,CAAC,CAAC,SAAS,MAAM,CAAC;CACtE,SAAS,OAAO;EACd,MAAM,IAAI,MAAM,yCAAyC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;CACnH;CACA,IACE,CAAC,UACD,OAAO,WAAW,YAClB,MAAM,QAAQ,MAAM,KACnB,OAAiC,YAAA,GAElC,MAAM,IAAI,MAAM,+CAA+C;CAEjE,OAAO,+BAA+B,QAAQ,8BAA8B;AAC9E"}
@@ -1,10 +1,10 @@
1
- require("./environment-CaCW3SgT.cjs");
1
+ require("./environment-Cqs7vHJL.cjs");
2
2
  let node_buffer = require("node:buffer");
3
3
  //#region src/schemas/team/capabilityCeiling.ts
4
4
  /**
5
5
  * Capability-ceiling values, intersection, and the child-process codec.
6
6
  *
7
- * Live extension contributions enter through Team's `doom/subagent-policy`
7
+ * Live extension contributions enter through Team's `po/subagent-policy`
8
8
  * Cordis service. Only the resolved ceiling crosses a process boundary, through
9
9
  * the versioned environment value encoded here.
10
10
  */
@@ -188,4 +188,4 @@ Object.defineProperty(exports, "parseSubagentCapabilityCeiling", {
188
188
  }
189
189
  });
190
190
 
191
- //# sourceMappingURL=capabilityCeiling-C-Y7H8oC.cjs.map
191
+ //# sourceMappingURL=capabilityCeiling-CO3ZjYmY.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilityCeiling-CO3ZjYmY.cjs","names":["Buffer"],"sources":["../src/schemas/team/capabilityCeiling.ts"],"sourcesContent":["/**\n * Capability-ceiling values, intersection, and the child-process codec.\n *\n * Live extension contributions enter through Team's `po/subagent-policy`\n * Cordis service. Only the resolved ceiling crosses a process boundary, through\n * the versioned environment value encoded here.\n */\n\nimport { Buffer } from 'node:buffer';\n\nimport type { SubagentPolicy } from '../../schemas/subagentPolicy';\nimport { SUBAGENT_CAPABILITY_CEILING_ENV } from '../../types/environment';\n\nexport const SUBAGENT_CAPABILITY_CEILING_VERSION = 2 as const;\nexport { SUBAGENT_CAPABILITY_CEILING_ENV };\n\nconst MAX_TEXT_BYTES = 256;\nconst MAX_TOOL_NAME_BYTES = 128;\nconst MAX_ALLOWED_TOOLS = 256;\nconst MAX_ALLOWED_EXTERNAL_PROFILES = 32;\nconst MAX_EXTERNAL_PROFILE_NAME_BYTES = 128;\nconst EXTERNAL_PROFILE_PATTERN = /^[A-Za-z0-9][A-Za-z0-9/_.:-]+$/u;\nconst TOOL_NAME_PATTERN = /^[A-Za-z0-9_.:-]+$/u;\nconst LAST_C0_CONTROL_CODE = 0x1f;\nconst DELETE_CODE = 0x7f;\n\n/**\n * Ceiling text crosses a process boundary and is rendered in the TUI, so control\n * characters are rejected. Scanning code points avoids a control-character\n * regex, which lints as a hazard even when the escapes are explicit.\n */\nfunction hasControlCharacter(value: string): boolean {\n for (const character of value) {\n const code = character.codePointAt(0);\n if (code !== undefined && (code <= LAST_C0_CONTROL_CODE || code === DELETE_CODE)) return true;\n }\n return false;\n}\n\nexport type SubagentCapabilityCeiling = {\n allowedTools?: readonly string[];\n requiredTools?: readonly string[];\n allowMcpTools?: boolean;\n allowedExternalProfiles?: readonly string[];\n denyExtensions?: boolean;\n};\n\nexport interface ResolvedSubagentCapabilityCeiling {\n version: typeof SUBAGENT_CAPABILITY_CEILING_VERSION;\n allowedTools?: string[];\n requiredTools?: string[];\n allowMcpTools?: boolean;\n allowedExternalProfiles: string[];\n denyExtensions: boolean;\n sources: string[];\n}\n\nexport interface SubagentCapabilityAudit {\n ceiling: ResolvedSubagentCapabilityCeiling;\n requestedTools?: string[];\n effectiveTools: string[];\n removedTools: string[];\n internalTools: string[];\n extensionsDenied: boolean;\n removedExtensionCount: number;\n requestedMcpToolCount: number;\n effectiveMcpTools: string[];\n}\n\ninterface TypedPolicyRegistration {\n generation: string;\n ceiling: ResolvedSubagentCapabilityCeiling;\n}\n\nexport class SubagentCapabilityPolicyStore {\n private readonly policies = new Map<string, TypedPolicyRegistration>();\n\n register(policy: SubagentPolicy, generation: string): void {\n const ceiling = normalizeCeiling({\n ...(policy.allowedTools ? { allowedTools: policy.allowedTools } : {}),\n ...(policy.requiredTools ? { requiredTools: policy.requiredTools } : {}),\n ...(policy.allowMcpTools === true ? { allowMcpTools: true } : {}),\n ...(policy.allowedExternalProfiles ? { allowedExternalProfiles: policy.allowedExternalProfiles } : {}),\n denyExtensions: policy.denyExtensions === true,\n });\n ceiling.sources = [policy.owner];\n this.policies.set(policy.owner, { generation, ceiling });\n }\n\n update(policy: SubagentPolicy, generation: string): void {\n if (this.policies.get(policy.owner)?.generation !== generation) return;\n this.register(policy, generation);\n }\n\n remove(owner: string, generation: string): void {\n if (this.policies.get(owner)?.generation === generation) this.policies.delete(owner);\n }\n\n clear(): void {\n this.policies.clear();\n }\n\n resolve(inherited?: ResolvedSubagentCapabilityCeiling): ResolvedSubagentCapabilityCeiling | undefined {\n return intersectSubagentCapabilityCeilings(inherited, ...[...this.policies.values()].map(({ ceiling }) => ceiling));\n }\n}\n\nfunction validateText(value: unknown, field: string): string {\n if (\n typeof value !== 'string' ||\n !value.trim() ||\n hasControlCharacter(value) ||\n Buffer.byteLength(value.trim(), 'utf8') > MAX_TEXT_BYTES\n ) {\n throw new Error(\n `Invalid capability ceiling ${field}; expected a non-empty string without control characters (max ${MAX_TEXT_BYTES} UTF-8 bytes).`,\n );\n }\n return value.trim();\n}\n\nfunction normalizeCeiling(ceiling: SubagentCapabilityCeiling): ResolvedSubagentCapabilityCeiling {\n if (!ceiling || typeof ceiling !== 'object' || Array.isArray(ceiling)) {\n throw new Error('Invalid capability ceiling; expected an object.');\n }\n const hasAllowedTools = Object.hasOwn(ceiling, 'allowedTools');\n const hasRequiredTools = Object.hasOwn(ceiling, 'requiredTools');\n const hasAllowMcpTools = Object.hasOwn(ceiling, 'allowMcpTools');\n const hasAllowedExternalProfiles = Object.hasOwn(ceiling, 'allowedExternalProfiles');\n const hasDenyExtensions = Object.hasOwn(ceiling, 'denyExtensions');\n if (!hasAllowedTools && !hasRequiredTools && !hasAllowMcpTools && !hasAllowedExternalProfiles && !hasDenyExtensions) {\n throw new Error(\n 'Invalid capability ceiling; expected allowedTools, requiredTools, allowMcpTools, allowedExternalProfiles, or denyExtensions.',\n );\n }\n if (hasAllowMcpTools && typeof ceiling.allowMcpTools !== 'boolean') {\n throw new Error('Invalid capability ceiling allowMcpTools; expected a boolean.');\n }\n if (hasDenyExtensions && typeof ceiling.denyExtensions !== 'boolean') {\n throw new Error('Invalid capability ceiling denyExtensions; expected a boolean.');\n }\n const normalizeTools = (value: readonly string[] | undefined, field: 'allowedTools' | 'requiredTools') => {\n if (!Array.isArray(value)) throw new Error(`Invalid capability ceiling ${field}; expected an array.`);\n if (value.length > MAX_ALLOWED_TOOLS) {\n throw new Error(`Invalid capability ceiling ${field}; expected at most ${MAX_ALLOWED_TOOLS} names.`);\n }\n return [\n ...new Set(\n value.map((tool) => {\n const name = validateText(tool, `${field} entry`);\n if (!TOOL_NAME_PATTERN.test(name)) {\n throw new Error(`Invalid capability ceiling ${field} entry '${name}'.`);\n }\n if (Buffer.byteLength(name, 'utf8') > MAX_TOOL_NAME_BYTES) {\n throw new Error(\n `Invalid capability ceiling ${field} entry '${name}'; max ${MAX_TOOL_NAME_BYTES} UTF-8 bytes.`,\n );\n }\n return name;\n }),\n ),\n ].sort((left, right) => left.localeCompare(right));\n };\n const allowedTools = hasAllowedTools ? normalizeTools(ceiling.allowedTools, 'allowedTools') : undefined;\n const requiredTools = hasRequiredTools ? normalizeTools(ceiling.requiredTools, 'requiredTools') : undefined;\n let allowedExternalProfiles: string[] = [];\n if (Object.hasOwn(ceiling, 'allowedExternalProfiles')) {\n if (!Array.isArray(ceiling.allowedExternalProfiles)) {\n throw new Error('Invalid capability ceiling allowedExternalProfiles; expected an array.');\n }\n if (ceiling.allowedExternalProfiles.length > MAX_ALLOWED_EXTERNAL_PROFILES) {\n throw new Error(\n `Invalid capability ceiling allowedExternalProfiles; expected at most ${MAX_ALLOWED_EXTERNAL_PROFILES} names.`,\n );\n }\n allowedExternalProfiles = [\n ...new Set(\n ceiling.allowedExternalProfiles.map((profile) => {\n const name = validateText(profile, 'allowedExternalProfiles entry');\n if (\n !EXTERNAL_PROFILE_PATTERN.test(name) ||\n Buffer.byteLength(name, 'utf8') > MAX_EXTERNAL_PROFILE_NAME_BYTES\n ) {\n throw new Error(`Invalid capability ceiling allowedExternalProfiles entry '${name}'.`);\n }\n return name;\n }),\n ),\n ].sort((left, right) => left.localeCompare(right));\n }\n return {\n version: SUBAGENT_CAPABILITY_CEILING_VERSION,\n ...(allowedTools ? { allowedTools } : {}),\n ...(requiredTools?.length ? { requiredTools } : {}),\n ...(ceiling.allowMcpTools === true ? { allowMcpTools: true } : {}),\n allowedExternalProfiles,\n denyExtensions: ceiling.denyExtensions === true,\n sources: [],\n };\n}\n\nexport function parseSubagentCapabilityCeiling(\n value: unknown,\n field = 'capability ceiling',\n): ResolvedSubagentCapabilityCeiling {\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\n throw new Error(`Invalid ${field}; expected an object.`);\n }\n const record = value as Record<string, unknown>;\n if (record.version !== SUBAGENT_CAPABILITY_CEILING_VERSION) throw new Error(`Invalid ${field} version.`);\n const normalized = normalizeCeiling(record as SubagentCapabilityCeiling);\n const sources = record.sources;\n if (!Array.isArray(sources) || sources.some((source) => typeof source !== 'string')) {\n throw new Error(`Invalid ${field} sources; expected an array of strings.`);\n }\n normalized.sources = [...new Set(sources.map((source) => validateText(source, `${field} source`)))].sort();\n return normalized;\n}\n\nexport function intersectSubagentCapabilityCeilings(\n ...ceilings: Array<ResolvedSubagentCapabilityCeiling | undefined>\n): ResolvedSubagentCapabilityCeiling | undefined {\n const active = ceilings.filter((ceiling): ceiling is ResolvedSubagentCapabilityCeiling => ceiling !== undefined);\n if (active.length === 0) return undefined;\n const definedLists = active\n .filter((ceiling) => ceiling.allowedTools !== undefined)\n .map((ceiling) => new Set(ceiling.allowedTools));\n let allowedTools: string[] | undefined;\n if (definedLists.length > 0) {\n allowedTools = [...definedLists[0]!].filter((tool) => definedLists.every((list) => list.has(tool))).sort();\n }\n const requiredTools = [...new Set(active.flatMap((ceiling) => ceiling.requiredTools ?? []))]\n .filter((tool) => !allowedTools || allowedTools.includes(tool))\n .sort((left, right) => left.localeCompare(right));\n const profileSets = active.map((ceiling) => new Set(ceiling.allowedExternalProfiles));\n const allowedExternalProfiles = [...profileSets[0]!]\n .filter((profile) => profileSets.every((profiles) => profiles.has(profile)))\n .sort((left, right) => left.localeCompare(right));\n return {\n version: SUBAGENT_CAPABILITY_CEILING_VERSION,\n ...(allowedTools ? { allowedTools } : {}),\n ...(requiredTools.length ? { requiredTools } : {}),\n ...(active.every((ceiling) => ceiling.allowMcpTools === true) ? { allowMcpTools: true } : {}),\n allowedExternalProfiles,\n denyExtensions: active.some((ceiling) => ceiling.denyExtensions),\n sources: [...new Set(active.flatMap((ceiling) => ceiling.sources))].sort(),\n };\n}\n\nexport function encodeSubagentCapabilityCeiling(\n ceiling: ResolvedSubagentCapabilityCeiling | undefined,\n): string | undefined {\n if (!ceiling) return undefined;\n return Buffer.from(JSON.stringify(ceiling), 'utf8').toString('base64url');\n}\n\nexport function decodeSubagentCapabilityCeiling(\n value: string | undefined,\n): ResolvedSubagentCapabilityCeiling | undefined {\n if (value === undefined || value === '') return undefined;\n let parsed: unknown;\n try {\n parsed = JSON.parse(Buffer.from(value, 'base64url').toString('utf8'));\n } catch (error) {\n throw new Error(`Invalid inherited capability ceiling: ${error instanceof Error ? error.message : String(error)}`);\n }\n if (\n !parsed ||\n typeof parsed !== 'object' ||\n Array.isArray(parsed) ||\n (parsed as { version?: unknown }).version !== SUBAGENT_CAPABILITY_CEILING_VERSION\n ) {\n throw new Error('Invalid inherited capability ceiling version.');\n }\n return parseSubagentCapabilityCeiling(parsed, 'inherited capability ceiling');\n}\n"],"mappings":";;;;;;;;;;AAaA,MAAa,sCAAsC;AAGnD,MAAM,iBAAiB;AACvB,MAAM,sBAAsB;AAC5B,MAAM,oBAAoB;AAC1B,MAAM,gCAAgC;AACtC,MAAM,kCAAkC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Y,EAAG,CAAC,CACjD,QAAQ,YAAY,YAAY,OAAO,aAAa,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,CAC3E,MAAM,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;CAClD,OAAO;EACL,SAAA;EACA,GAAI,eAAe,EAAE,aAAa,IAAI,CAAC;EACvC,GAAI,cAAc,SAAS,EAAE,cAAc,IAAI,CAAC;EAChD,GAAI,OAAO,OAAO,YAAY,QAAQ,kBAAkB,IAAI,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;EAC3F;EACA,gBAAgB,OAAO,MAAM,YAAY,QAAQ,cAAc;EAC/D,SAAS,CAAC,GAAG,IAAI,IAAI,OAAO,SAAS,YAAY,QAAQ,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK;CAC3E;AACF;AAEA,SAAgB,gCACd,SACoB;CACpB,IAAI,CAAC,SAAS,OAAO,KAAA;CACrB,OAAOA,YAAAA,OAAO,KAAK,KAAK,UAAU,OAAO,GAAG,MAAM,CAAC,CAAC,SAAS,WAAW;AAC1E;AAEA,SAAgB,gCACd,OAC+C;CAC/C,IAAI,UAAU,KAAA,KAAa,UAAU,IAAI,OAAO,KAAA;CAChD,IAAI;CACJ,IAAI;EACF,SAAS,KAAK,MAAMA,YAAAA,OAAO,KAAK,OAAO,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC;CACtE,SAAS,OAAO;EACd,MAAM,IAAI,MAAM,yCAAyC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;CACnH;CACA,IACE,CAAC,UACD,OAAO,WAAW,YAClB,MAAM,QAAQ,MAAM,KACnB,OAAiC,YAAA,GAElC,MAAM,IAAI,MAAM,+CAA+C;CAEjE,OAAO,+BAA+B,QAAQ,8BAA8B;AAC9E"}
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_environment = require("./environment-CaCW3SgT.cjs");
3
- const require_capabilityCeiling = require("./capabilityCeiling-C-Y7H8oC.cjs");
2
+ const require_environment = require("./environment-Cqs7vHJL.cjs");
3
+ const require_capabilityCeiling = require("./capabilityCeiling-CO3ZjYmY.cjs");
4
4
  exports.SUBAGENT_CAPABILITY_CEILING_ENV = require_environment.SUBAGENT_CAPABILITY_CEILING_ENV;
5
5
  exports.SUBAGENT_CAPABILITY_CEILING_VERSION = require_capabilityCeiling.SUBAGENT_CAPABILITY_CEILING_VERSION;
6
6
  exports.SubagentCapabilityPolicyStore = require_capabilityCeiling.SubagentCapabilityPolicyStore;
@@ -1,5 +1,5 @@
1
- import { r as SubagentPolicy } from "./subagentPolicy-ALJam4GN.mjs";
2
- import { y as SUBAGENT_CAPABILITY_CEILING_ENV } from "./environment-ma5oQ7uM.mjs";
1
+ import { r as SubagentPolicy } from "./subagentPolicy-BE-OZoa-.mjs";
2
+ import { y as SUBAGENT_CAPABILITY_CEILING_ENV } from "./environment-Bz1OlWIT.mjs";
3
3
  //#region src/schemas/team/capabilityCeiling.d.ts
4
4
  export declare const SUBAGENT_CAPABILITY_CEILING_VERSION: 2;
5
5
  export type SubagentCapabilityCeiling = {
@@ -1,3 +1,3 @@
1
- import { y as SUBAGENT_CAPABILITY_CEILING_ENV } from "./environment-DrqhrxG_.mjs";
2
- import { a as intersectSubagentCapabilityCeilings, i as encodeSubagentCapabilityCeiling, n as SubagentCapabilityPolicyStore, o as parseSubagentCapabilityCeiling, r as decodeSubagentCapabilityCeiling, t as SUBAGENT_CAPABILITY_CEILING_VERSION } from "./capabilityCeiling-CF7kAS18.mjs";
1
+ import { y as SUBAGENT_CAPABILITY_CEILING_ENV } from "./environment-BtvJI2S-.mjs";
2
+ import { a as intersectSubagentCapabilityCeilings, i as encodeSubagentCapabilityCeiling, n as SubagentCapabilityPolicyStore, o as parseSubagentCapabilityCeiling, r as decodeSubagentCapabilityCeiling, t as SUBAGENT_CAPABILITY_CEILING_VERSION } from "./capabilityCeiling-BaHT9v9S.mjs";
3
3
  export { SUBAGENT_CAPABILITY_CEILING_ENV, SUBAGENT_CAPABILITY_CEILING_VERSION, SubagentCapabilityPolicyStore, decodeSubagentCapabilityCeiling, encodeSubagentCapabilityCeiling, intersectSubagentCapabilityCeilings, parseSubagentCapabilityCeiling };
@@ -13,7 +13,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
13
13
  *
14
14
  * PROTOCOL COMPATIBILITY (do not change):
15
15
  * The event names and version numbers below are shared with po-subagents
16
- * and with doom-task and agiflow-pi-extension, which speak this protocol today.
16
+ * and with po-task and agiflow-pi-extension, which speak this protocol today.
17
17
  * The event names deliberately keep their `prompt-template:` prefix: that is the
18
18
  * established transport, and renaming it would silently stop delivery. Pinned by
19
19
  * contract tests.
@@ -1 +1 @@
1
- {"version":3,"file":"delegation.cjs","names":[],"sources":["../src/schemas/team/delegation.ts"],"sourcesContent":["/**\n * Subagent delegation - a cross-extension event protocol.\n *\n * Delegation lets another extension ask this runtime to run a subagent without\n * depending on its internals: the requester emits a request event and receives\n * started/update/response events back over the host event bus.\n *\n * Two generations coexist. V1 correlates purely by `requestId`. V2 adds\n * `ownerRunId` and `nodeId` so one owner can fan out to many nodes and have each\n * reply routed back, and it carries a typed `result` request.\n *\n * PROTOCOL COMPATIBILITY (do not change):\n * The event names and version numbers below are shared with po-subagents\n * and with doom-task and agiflow-pi-extension, which speak this protocol today.\n * The event names deliberately keep their `prompt-template:` prefix: that is the\n * established transport, and renaming it would silently stop delivery. Pinned by\n * contract tests.\n *\n * AVOID:\n * - Adding a required field to an existing version; add a version instead\n */\n\nexport const SUBAGENT_DELEGATION_PROTOCOL_VERSION = 1 as const;\nexport const SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION = 2 as const;\n\n// This is the established extension-to-extension transport. The public API\n// intentionally reuses it instead of adding a second event protocol.\nexport const SUBAGENT_DELEGATION_REQUEST_EVENT = 'prompt-template:subagent:request';\nexport const SUBAGENT_DELEGATION_STARTED_EVENT = 'prompt-template:subagent:started';\nexport const SUBAGENT_DELEGATION_UPDATE_EVENT = 'prompt-template:subagent:update';\nexport const SUBAGENT_DELEGATION_RESPONSE_EVENT = 'prompt-template:subagent:response';\nexport const SUBAGENT_DELEGATION_CANCEL_EVENT = 'prompt-template:subagent:cancel';\n\nexport interface SubagentDelegationTurnBudget {\n maxTurns: number;\n graceTurns?: number;\n}\n\nexport interface SubagentDelegationToolBudget {\n soft?: number;\n hard: number;\n block?: string[] | '*';\n}\n\nexport interface SubagentDelegationAgentContract {\n version: 1;\n}\n\nexport type SubagentDelegationJsonSchemaObject = Record<string, unknown>;\n\nexport interface SubagentDelegationExecutionResult {\n status: 'completed' | 'failed' | 'paused' | 'stopped' | 'detached';\n success: boolean;\n exitCode: number;\n error?: string;\n interrupted?: boolean;\n timedOut?: boolean;\n stopped?: boolean;\n detached?: boolean;\n}\n\nexport interface SubagentDelegationReviewResult {\n status: 'not-requested' | 'review-required' | 'reviewed' | 'blockers';\n findings?: Array<{ severity: 'blocker' | 'non-blocking'; file?: string; issue: string; rationale: string }>;\n}\n\nexport interface SubagentDelegationEffectsResult {\n fileMutation?: {\n status: 'not-requested' | 'not-applicable' | 'observed' | 'missing';\n expected: boolean;\n attempted: boolean;\n message?: string;\n };\n}\n\nexport type SubagentDelegationAcceptanceEvidence =\n | 'changed-files'\n | 'tests-added'\n | 'commands-run'\n | 'validation-output'\n | 'residual-risks'\n | 'no-staged-files'\n | 'diff-summary'\n | 'review-findings'\n | 'manual-notes';\n\nexport interface SubagentDelegationAcceptanceCriterion {\n id: string;\n must: string;\n evidence?: SubagentDelegationAcceptanceEvidence[];\n severity?: 'required' | 'recommended';\n}\n\nexport interface SubagentDelegationAcceptanceVerifyCommand {\n id: string;\n command: string;\n timeoutMs?: number;\n cwd?: string;\n env?: Record<string, string>;\n allowFailure?: boolean;\n}\n\nexport interface SubagentDelegationAcceptanceReview {\n agent?: string;\n focus?: string;\n required?: boolean;\n}\n\ninterface SubagentDelegationAcceptanceFields {\n criteria?: Array<string | SubagentDelegationAcceptanceCriterion>;\n evidence?: SubagentDelegationAcceptanceEvidence[];\n verify?: SubagentDelegationAcceptanceVerifyCommand[];\n review?: SubagentDelegationAcceptanceReview | false;\n stopRules?: string[];\n}\n\nexport type SubagentDelegationAcceptanceConfig = SubagentDelegationAcceptanceFields &\n ({ level: 'none'; reason: string } | { level?: 'auto' | 'attested' | 'checked' | 'verified'; reason?: string });\n\nexport type SubagentDelegationAcceptance =\n | 'auto'\n | 'attested'\n | 'checked'\n | 'verified'\n | false\n | SubagentDelegationAcceptanceConfig;\n\nexport interface SubagentDelegationRequest {\n version: typeof SUBAGENT_DELEGATION_PROTOCOL_VERSION;\n requestId: string;\n agent: string;\n task: string;\n context: 'fresh' | 'fork';\n cwd: string;\n model?: string;\n timeoutMs?: number;\n turnBudget?: SubagentDelegationTurnBudget;\n toolBudget?: SubagentDelegationToolBudget;\n skill?: string | string[] | boolean;\n output?: string | boolean;\n outputMode?: 'inline' | 'file-only';\n outputSchema?: SubagentDelegationJsonSchemaObject;\n agentContract?: SubagentDelegationAgentContract;\n acceptance?: SubagentDelegationAcceptance;\n artifacts?: boolean;\n /** Foreground remains the compatibility default. */\n runMode?: 'foreground' | 'detached';\n /** Optional task identity shown to active root-session teammates. */\n teamTask?: { id: string; subject: string };\n}\n\nexport interface SubagentDelegationStarted {\n version: typeof SUBAGENT_DELEGATION_PROTOCOL_VERSION;\n requestId: string;\n runId?: string;\n}\n\nexport interface SubagentDelegationUpdate extends SubagentDelegationStarted {\n runId?: string;\n currentTool?: string;\n currentToolArgs?: string;\n recentOutput?: string;\n recentOutputLines?: string[];\n recentTools?: Array<{ tool: string; args: string }>;\n model?: string;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n}\n\nexport type SubagentDelegationStatus =\n | 'completed'\n | 'failed'\n | 'timed_out'\n | 'cancelled'\n | 'interrupted'\n | 'turn_budget_exhausted'\n | 'tool_budget_exhausted'\n | 'structured_output_failed'\n | 'acceptance_failed'\n | 'invalid_request'\n | 'unavailable_context';\n\nexport type SubagentDelegationAcceptanceStatus =\n | 'pending'\n | 'not-required'\n | 'claimed'\n | 'attested'\n | 'checked'\n | 'verified'\n | 'review-required'\n | 'reviewed'\n | 'accepted'\n | 'rejected';\n\nexport interface SubagentDelegationAcceptanceResult {\n status: SubagentDelegationAcceptanceStatus;\n evidenceStatus: Exclude<SubagentDelegationAcceptanceStatus, 'review-required' | 'reviewed' | 'accepted'>;\n explicit: boolean;\n}\n\nexport interface SubagentDelegationResponse extends SubagentDelegationStarted {\n status: SubagentDelegationStatus;\n error?: string;\n runId?: string;\n childIndex?: number;\n agent?: string;\n model?: string;\n exitCode?: number;\n execution?: SubagentDelegationExecutionResult;\n output?: string;\n outputPath?: string;\n sessionFile?: string;\n acceptance?: SubagentDelegationAcceptanceResult;\n review?: SubagentDelegationReviewResult;\n effects?: SubagentDelegationEffectsResult;\n turns?: number;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n warnings?: string[];\n}\n\nexport interface SubagentDelegationCancel extends SubagentDelegationStarted {}\n\nexport type SubagentDelegationV2Thinking = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';\n\nexport type SubagentDelegationV2ResultRequest =\n | { kind: 'text' }\n | { kind: 'structured'; schema: SubagentDelegationJsonSchemaObject };\n\nexport interface SubagentDelegationV2Request {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId: string;\n nodeId: string;\n agent: string;\n task: string;\n context: 'fresh' | 'fork';\n cwd: string;\n model?: string;\n thinking?: SubagentDelegationV2Thinking;\n timeoutMs?: number;\n turnBudget?: SubagentDelegationTurnBudget;\n toolBudget?: SubagentDelegationToolBudget;\n skill?: string | string[] | boolean;\n artifacts?: boolean;\n result: SubagentDelegationV2ResultRequest;\n}\n\nexport interface SubagentDelegationV2Started {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId: string;\n nodeId: string;\n}\n\nexport interface SubagentDelegationV2Update extends SubagentDelegationV2Started {\n runId?: string;\n currentTool?: string;\n currentToolArgs?: string;\n recentOutput?: string;\n recentOutputLines?: string[];\n recentTools?: Array<{ tool: string; args: string }>;\n model?: string;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n}\n\nexport type SubagentDelegationV2Status = SubagentDelegationStatus | 'duplicate_node';\n\nexport type SubagentDelegationV2Value = { kind: 'text'; text: string } | { kind: 'structured'; value: unknown };\n\nexport interface SubagentDelegationV2Usage {\n input: number;\n output: number;\n cacheRead: number;\n cacheWrite: number;\n cost: number;\n turns: number;\n toolCalls: number;\n durationMs: number;\n}\n\nexport interface SubagentDelegationV2TerminalResponse extends SubagentDelegationV2Started {\n status: Exclude<SubagentDelegationV2Status, 'invalid_request'>;\n error?: string;\n runId?: string;\n agent?: string;\n model?: string;\n thinking?: string;\n exitCode?: number;\n launchContractDigest?: string;\n result?: SubagentDelegationV2Value;\n usage?: SubagentDelegationV2Usage;\n}\n\n/** A malformed V2 request can only be correlated by the valid identity fields it supplied. */\nexport interface SubagentDelegationV2InvalidResponse {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId?: string;\n nodeId?: string;\n status: 'invalid_request';\n error?: string;\n}\n\nexport type SubagentDelegationV2Response = SubagentDelegationV2TerminalResponse | SubagentDelegationV2InvalidResponse;\n\nexport interface SubagentDelegationV2Cancel extends SubagentDelegationV2Started {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,uCAAuC;AACpD,MAAa,0CAA0C;AAIvD,MAAa,oCAAoC;AACjD,MAAa,oCAAoC;AACjD,MAAa,mCAAmC;AAChD,MAAa,qCAAqC;AAClD,MAAa,mCAAmC"}
1
+ {"version":3,"file":"delegation.cjs","names":[],"sources":["../src/schemas/team/delegation.ts"],"sourcesContent":["/**\n * Subagent delegation - a cross-extension event protocol.\n *\n * Delegation lets another extension ask this runtime to run a subagent without\n * depending on its internals: the requester emits a request event and receives\n * started/update/response events back over the host event bus.\n *\n * Two generations coexist. V1 correlates purely by `requestId`. V2 adds\n * `ownerRunId` and `nodeId` so one owner can fan out to many nodes and have each\n * reply routed back, and it carries a typed `result` request.\n *\n * PROTOCOL COMPATIBILITY (do not change):\n * The event names and version numbers below are shared with po-subagents\n * and with po-task and agiflow-pi-extension, which speak this protocol today.\n * The event names deliberately keep their `prompt-template:` prefix: that is the\n * established transport, and renaming it would silently stop delivery. Pinned by\n * contract tests.\n *\n * AVOID:\n * - Adding a required field to an existing version; add a version instead\n */\n\nexport const SUBAGENT_DELEGATION_PROTOCOL_VERSION = 1 as const;\nexport const SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION = 2 as const;\n\n// This is the established extension-to-extension transport. The public API\n// intentionally reuses it instead of adding a second event protocol.\nexport const SUBAGENT_DELEGATION_REQUEST_EVENT = 'prompt-template:subagent:request';\nexport const SUBAGENT_DELEGATION_STARTED_EVENT = 'prompt-template:subagent:started';\nexport const SUBAGENT_DELEGATION_UPDATE_EVENT = 'prompt-template:subagent:update';\nexport const SUBAGENT_DELEGATION_RESPONSE_EVENT = 'prompt-template:subagent:response';\nexport const SUBAGENT_DELEGATION_CANCEL_EVENT = 'prompt-template:subagent:cancel';\n\nexport interface SubagentDelegationTurnBudget {\n maxTurns: number;\n graceTurns?: number;\n}\n\nexport interface SubagentDelegationToolBudget {\n soft?: number;\n hard: number;\n block?: string[] | '*';\n}\n\nexport interface SubagentDelegationAgentContract {\n version: 1;\n}\n\nexport type SubagentDelegationJsonSchemaObject = Record<string, unknown>;\n\nexport interface SubagentDelegationExecutionResult {\n status: 'completed' | 'failed' | 'paused' | 'stopped' | 'detached';\n success: boolean;\n exitCode: number;\n error?: string;\n interrupted?: boolean;\n timedOut?: boolean;\n stopped?: boolean;\n detached?: boolean;\n}\n\nexport interface SubagentDelegationReviewResult {\n status: 'not-requested' | 'review-required' | 'reviewed' | 'blockers';\n findings?: Array<{ severity: 'blocker' | 'non-blocking'; file?: string; issue: string; rationale: string }>;\n}\n\nexport interface SubagentDelegationEffectsResult {\n fileMutation?: {\n status: 'not-requested' | 'not-applicable' | 'observed' | 'missing';\n expected: boolean;\n attempted: boolean;\n message?: string;\n };\n}\n\nexport type SubagentDelegationAcceptanceEvidence =\n | 'changed-files'\n | 'tests-added'\n | 'commands-run'\n | 'validation-output'\n | 'residual-risks'\n | 'no-staged-files'\n | 'diff-summary'\n | 'review-findings'\n | 'manual-notes';\n\nexport interface SubagentDelegationAcceptanceCriterion {\n id: string;\n must: string;\n evidence?: SubagentDelegationAcceptanceEvidence[];\n severity?: 'required' | 'recommended';\n}\n\nexport interface SubagentDelegationAcceptanceVerifyCommand {\n id: string;\n command: string;\n timeoutMs?: number;\n cwd?: string;\n env?: Record<string, string>;\n allowFailure?: boolean;\n}\n\nexport interface SubagentDelegationAcceptanceReview {\n agent?: string;\n focus?: string;\n required?: boolean;\n}\n\ninterface SubagentDelegationAcceptanceFields {\n criteria?: Array<string | SubagentDelegationAcceptanceCriterion>;\n evidence?: SubagentDelegationAcceptanceEvidence[];\n verify?: SubagentDelegationAcceptanceVerifyCommand[];\n review?: SubagentDelegationAcceptanceReview | false;\n stopRules?: string[];\n}\n\nexport type SubagentDelegationAcceptanceConfig = SubagentDelegationAcceptanceFields &\n ({ level: 'none'; reason: string } | { level?: 'auto' | 'attested' | 'checked' | 'verified'; reason?: string });\n\nexport type SubagentDelegationAcceptance =\n | 'auto'\n | 'attested'\n | 'checked'\n | 'verified'\n | false\n | SubagentDelegationAcceptanceConfig;\n\nexport interface SubagentDelegationRequest {\n version: typeof SUBAGENT_DELEGATION_PROTOCOL_VERSION;\n requestId: string;\n agent: string;\n task: string;\n context: 'fresh' | 'fork';\n cwd: string;\n model?: string;\n timeoutMs?: number;\n turnBudget?: SubagentDelegationTurnBudget;\n toolBudget?: SubagentDelegationToolBudget;\n skill?: string | string[] | boolean;\n output?: string | boolean;\n outputMode?: 'inline' | 'file-only';\n outputSchema?: SubagentDelegationJsonSchemaObject;\n agentContract?: SubagentDelegationAgentContract;\n acceptance?: SubagentDelegationAcceptance;\n artifacts?: boolean;\n /** Foreground remains the compatibility default. */\n runMode?: 'foreground' | 'detached';\n /** Optional task identity shown to active root-session teammates. */\n teamTask?: { id: string; subject: string };\n}\n\nexport interface SubagentDelegationStarted {\n version: typeof SUBAGENT_DELEGATION_PROTOCOL_VERSION;\n requestId: string;\n runId?: string;\n}\n\nexport interface SubagentDelegationUpdate extends SubagentDelegationStarted {\n runId?: string;\n currentTool?: string;\n currentToolArgs?: string;\n recentOutput?: string;\n recentOutputLines?: string[];\n recentTools?: Array<{ tool: string; args: string }>;\n model?: string;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n}\n\nexport type SubagentDelegationStatus =\n | 'completed'\n | 'failed'\n | 'timed_out'\n | 'cancelled'\n | 'interrupted'\n | 'turn_budget_exhausted'\n | 'tool_budget_exhausted'\n | 'structured_output_failed'\n | 'acceptance_failed'\n | 'invalid_request'\n | 'unavailable_context';\n\nexport type SubagentDelegationAcceptanceStatus =\n | 'pending'\n | 'not-required'\n | 'claimed'\n | 'attested'\n | 'checked'\n | 'verified'\n | 'review-required'\n | 'reviewed'\n | 'accepted'\n | 'rejected';\n\nexport interface SubagentDelegationAcceptanceResult {\n status: SubagentDelegationAcceptanceStatus;\n evidenceStatus: Exclude<SubagentDelegationAcceptanceStatus, 'review-required' | 'reviewed' | 'accepted'>;\n explicit: boolean;\n}\n\nexport interface SubagentDelegationResponse extends SubagentDelegationStarted {\n status: SubagentDelegationStatus;\n error?: string;\n runId?: string;\n childIndex?: number;\n agent?: string;\n model?: string;\n exitCode?: number;\n execution?: SubagentDelegationExecutionResult;\n output?: string;\n outputPath?: string;\n sessionFile?: string;\n acceptance?: SubagentDelegationAcceptanceResult;\n review?: SubagentDelegationReviewResult;\n effects?: SubagentDelegationEffectsResult;\n turns?: number;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n warnings?: string[];\n}\n\nexport interface SubagentDelegationCancel extends SubagentDelegationStarted {}\n\nexport type SubagentDelegationV2Thinking = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';\n\nexport type SubagentDelegationV2ResultRequest =\n | { kind: 'text' }\n | { kind: 'structured'; schema: SubagentDelegationJsonSchemaObject };\n\nexport interface SubagentDelegationV2Request {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId: string;\n nodeId: string;\n agent: string;\n task: string;\n context: 'fresh' | 'fork';\n cwd: string;\n model?: string;\n thinking?: SubagentDelegationV2Thinking;\n timeoutMs?: number;\n turnBudget?: SubagentDelegationTurnBudget;\n toolBudget?: SubagentDelegationToolBudget;\n skill?: string | string[] | boolean;\n artifacts?: boolean;\n result: SubagentDelegationV2ResultRequest;\n}\n\nexport interface SubagentDelegationV2Started {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId: string;\n nodeId: string;\n}\n\nexport interface SubagentDelegationV2Update extends SubagentDelegationV2Started {\n runId?: string;\n currentTool?: string;\n currentToolArgs?: string;\n recentOutput?: string;\n recentOutputLines?: string[];\n recentTools?: Array<{ tool: string; args: string }>;\n model?: string;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n}\n\nexport type SubagentDelegationV2Status = SubagentDelegationStatus | 'duplicate_node';\n\nexport type SubagentDelegationV2Value = { kind: 'text'; text: string } | { kind: 'structured'; value: unknown };\n\nexport interface SubagentDelegationV2Usage {\n input: number;\n output: number;\n cacheRead: number;\n cacheWrite: number;\n cost: number;\n turns: number;\n toolCalls: number;\n durationMs: number;\n}\n\nexport interface SubagentDelegationV2TerminalResponse extends SubagentDelegationV2Started {\n status: Exclude<SubagentDelegationV2Status, 'invalid_request'>;\n error?: string;\n runId?: string;\n agent?: string;\n model?: string;\n thinking?: string;\n exitCode?: number;\n launchContractDigest?: string;\n result?: SubagentDelegationV2Value;\n usage?: SubagentDelegationV2Usage;\n}\n\n/** A malformed V2 request can only be correlated by the valid identity fields it supplied. */\nexport interface SubagentDelegationV2InvalidResponse {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId?: string;\n nodeId?: string;\n status: 'invalid_request';\n error?: string;\n}\n\nexport type SubagentDelegationV2Response = SubagentDelegationV2TerminalResponse | SubagentDelegationV2InvalidResponse;\n\nexport interface SubagentDelegationV2Cancel extends SubagentDelegationV2Started {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,uCAAuC;AACpD,MAAa,0CAA0C;AAIvD,MAAa,oCAAoC;AACjD,MAAa,oCAAoC;AACjD,MAAa,mCAAmC;AAChD,MAAa,qCAAqC;AAClD,MAAa,mCAAmC"}
@@ -13,7 +13,7 @@ export * from "@agimon-ai/po-core/delegation";
13
13
  *
14
14
  * PROTOCOL COMPATIBILITY (do not change):
15
15
  * The event names and version numbers below are shared with po-subagents
16
- * and with doom-task and agiflow-pi-extension, which speak this protocol today.
16
+ * and with po-task and agiflow-pi-extension, which speak this protocol today.
17
17
  * The event names deliberately keep their `prompt-template:` prefix: that is the
18
18
  * established transport, and renaming it would silently stop delivery. Pinned by
19
19
  * contract tests.
@@ -13,7 +13,7 @@ export * from "@agimon-ai/po-core/delegation";
13
13
  *
14
14
  * PROTOCOL COMPATIBILITY (do not change):
15
15
  * The event names and version numbers below are shared with po-subagents
16
- * and with doom-task and agiflow-pi-extension, which speak this protocol today.
16
+ * and with po-task and agiflow-pi-extension, which speak this protocol today.
17
17
  * The event names deliberately keep their `prompt-template:` prefix: that is the
18
18
  * established transport, and renaming it would silently stop delivery. Pinned by
19
19
  * contract tests.
@@ -1 +1 @@
1
- {"version":3,"file":"delegation.mjs","names":[],"sources":["../src/schemas/team/delegation.ts"],"sourcesContent":["/**\n * Subagent delegation - a cross-extension event protocol.\n *\n * Delegation lets another extension ask this runtime to run a subagent without\n * depending on its internals: the requester emits a request event and receives\n * started/update/response events back over the host event bus.\n *\n * Two generations coexist. V1 correlates purely by `requestId`. V2 adds\n * `ownerRunId` and `nodeId` so one owner can fan out to many nodes and have each\n * reply routed back, and it carries a typed `result` request.\n *\n * PROTOCOL COMPATIBILITY (do not change):\n * The event names and version numbers below are shared with po-subagents\n * and with doom-task and agiflow-pi-extension, which speak this protocol today.\n * The event names deliberately keep their `prompt-template:` prefix: that is the\n * established transport, and renaming it would silently stop delivery. Pinned by\n * contract tests.\n *\n * AVOID:\n * - Adding a required field to an existing version; add a version instead\n */\n\nexport const SUBAGENT_DELEGATION_PROTOCOL_VERSION = 1 as const;\nexport const SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION = 2 as const;\n\n// This is the established extension-to-extension transport. The public API\n// intentionally reuses it instead of adding a second event protocol.\nexport const SUBAGENT_DELEGATION_REQUEST_EVENT = 'prompt-template:subagent:request';\nexport const SUBAGENT_DELEGATION_STARTED_EVENT = 'prompt-template:subagent:started';\nexport const SUBAGENT_DELEGATION_UPDATE_EVENT = 'prompt-template:subagent:update';\nexport const SUBAGENT_DELEGATION_RESPONSE_EVENT = 'prompt-template:subagent:response';\nexport const SUBAGENT_DELEGATION_CANCEL_EVENT = 'prompt-template:subagent:cancel';\n\nexport interface SubagentDelegationTurnBudget {\n maxTurns: number;\n graceTurns?: number;\n}\n\nexport interface SubagentDelegationToolBudget {\n soft?: number;\n hard: number;\n block?: string[] | '*';\n}\n\nexport interface SubagentDelegationAgentContract {\n version: 1;\n}\n\nexport type SubagentDelegationJsonSchemaObject = Record<string, unknown>;\n\nexport interface SubagentDelegationExecutionResult {\n status: 'completed' | 'failed' | 'paused' | 'stopped' | 'detached';\n success: boolean;\n exitCode: number;\n error?: string;\n interrupted?: boolean;\n timedOut?: boolean;\n stopped?: boolean;\n detached?: boolean;\n}\n\nexport interface SubagentDelegationReviewResult {\n status: 'not-requested' | 'review-required' | 'reviewed' | 'blockers';\n findings?: Array<{ severity: 'blocker' | 'non-blocking'; file?: string; issue: string; rationale: string }>;\n}\n\nexport interface SubagentDelegationEffectsResult {\n fileMutation?: {\n status: 'not-requested' | 'not-applicable' | 'observed' | 'missing';\n expected: boolean;\n attempted: boolean;\n message?: string;\n };\n}\n\nexport type SubagentDelegationAcceptanceEvidence =\n | 'changed-files'\n | 'tests-added'\n | 'commands-run'\n | 'validation-output'\n | 'residual-risks'\n | 'no-staged-files'\n | 'diff-summary'\n | 'review-findings'\n | 'manual-notes';\n\nexport interface SubagentDelegationAcceptanceCriterion {\n id: string;\n must: string;\n evidence?: SubagentDelegationAcceptanceEvidence[];\n severity?: 'required' | 'recommended';\n}\n\nexport interface SubagentDelegationAcceptanceVerifyCommand {\n id: string;\n command: string;\n timeoutMs?: number;\n cwd?: string;\n env?: Record<string, string>;\n allowFailure?: boolean;\n}\n\nexport interface SubagentDelegationAcceptanceReview {\n agent?: string;\n focus?: string;\n required?: boolean;\n}\n\ninterface SubagentDelegationAcceptanceFields {\n criteria?: Array<string | SubagentDelegationAcceptanceCriterion>;\n evidence?: SubagentDelegationAcceptanceEvidence[];\n verify?: SubagentDelegationAcceptanceVerifyCommand[];\n review?: SubagentDelegationAcceptanceReview | false;\n stopRules?: string[];\n}\n\nexport type SubagentDelegationAcceptanceConfig = SubagentDelegationAcceptanceFields &\n ({ level: 'none'; reason: string } | { level?: 'auto' | 'attested' | 'checked' | 'verified'; reason?: string });\n\nexport type SubagentDelegationAcceptance =\n | 'auto'\n | 'attested'\n | 'checked'\n | 'verified'\n | false\n | SubagentDelegationAcceptanceConfig;\n\nexport interface SubagentDelegationRequest {\n version: typeof SUBAGENT_DELEGATION_PROTOCOL_VERSION;\n requestId: string;\n agent: string;\n task: string;\n context: 'fresh' | 'fork';\n cwd: string;\n model?: string;\n timeoutMs?: number;\n turnBudget?: SubagentDelegationTurnBudget;\n toolBudget?: SubagentDelegationToolBudget;\n skill?: string | string[] | boolean;\n output?: string | boolean;\n outputMode?: 'inline' | 'file-only';\n outputSchema?: SubagentDelegationJsonSchemaObject;\n agentContract?: SubagentDelegationAgentContract;\n acceptance?: SubagentDelegationAcceptance;\n artifacts?: boolean;\n /** Foreground remains the compatibility default. */\n runMode?: 'foreground' | 'detached';\n /** Optional task identity shown to active root-session teammates. */\n teamTask?: { id: string; subject: string };\n}\n\nexport interface SubagentDelegationStarted {\n version: typeof SUBAGENT_DELEGATION_PROTOCOL_VERSION;\n requestId: string;\n runId?: string;\n}\n\nexport interface SubagentDelegationUpdate extends SubagentDelegationStarted {\n runId?: string;\n currentTool?: string;\n currentToolArgs?: string;\n recentOutput?: string;\n recentOutputLines?: string[];\n recentTools?: Array<{ tool: string; args: string }>;\n model?: string;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n}\n\nexport type SubagentDelegationStatus =\n | 'completed'\n | 'failed'\n | 'timed_out'\n | 'cancelled'\n | 'interrupted'\n | 'turn_budget_exhausted'\n | 'tool_budget_exhausted'\n | 'structured_output_failed'\n | 'acceptance_failed'\n | 'invalid_request'\n | 'unavailable_context';\n\nexport type SubagentDelegationAcceptanceStatus =\n | 'pending'\n | 'not-required'\n | 'claimed'\n | 'attested'\n | 'checked'\n | 'verified'\n | 'review-required'\n | 'reviewed'\n | 'accepted'\n | 'rejected';\n\nexport interface SubagentDelegationAcceptanceResult {\n status: SubagentDelegationAcceptanceStatus;\n evidenceStatus: Exclude<SubagentDelegationAcceptanceStatus, 'review-required' | 'reviewed' | 'accepted'>;\n explicit: boolean;\n}\n\nexport interface SubagentDelegationResponse extends SubagentDelegationStarted {\n status: SubagentDelegationStatus;\n error?: string;\n runId?: string;\n childIndex?: number;\n agent?: string;\n model?: string;\n exitCode?: number;\n execution?: SubagentDelegationExecutionResult;\n output?: string;\n outputPath?: string;\n sessionFile?: string;\n acceptance?: SubagentDelegationAcceptanceResult;\n review?: SubagentDelegationReviewResult;\n effects?: SubagentDelegationEffectsResult;\n turns?: number;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n warnings?: string[];\n}\n\nexport interface SubagentDelegationCancel extends SubagentDelegationStarted {}\n\nexport type SubagentDelegationV2Thinking = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';\n\nexport type SubagentDelegationV2ResultRequest =\n | { kind: 'text' }\n | { kind: 'structured'; schema: SubagentDelegationJsonSchemaObject };\n\nexport interface SubagentDelegationV2Request {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId: string;\n nodeId: string;\n agent: string;\n task: string;\n context: 'fresh' | 'fork';\n cwd: string;\n model?: string;\n thinking?: SubagentDelegationV2Thinking;\n timeoutMs?: number;\n turnBudget?: SubagentDelegationTurnBudget;\n toolBudget?: SubagentDelegationToolBudget;\n skill?: string | string[] | boolean;\n artifacts?: boolean;\n result: SubagentDelegationV2ResultRequest;\n}\n\nexport interface SubagentDelegationV2Started {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId: string;\n nodeId: string;\n}\n\nexport interface SubagentDelegationV2Update extends SubagentDelegationV2Started {\n runId?: string;\n currentTool?: string;\n currentToolArgs?: string;\n recentOutput?: string;\n recentOutputLines?: string[];\n recentTools?: Array<{ tool: string; args: string }>;\n model?: string;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n}\n\nexport type SubagentDelegationV2Status = SubagentDelegationStatus | 'duplicate_node';\n\nexport type SubagentDelegationV2Value = { kind: 'text'; text: string } | { kind: 'structured'; value: unknown };\n\nexport interface SubagentDelegationV2Usage {\n input: number;\n output: number;\n cacheRead: number;\n cacheWrite: number;\n cost: number;\n turns: number;\n toolCalls: number;\n durationMs: number;\n}\n\nexport interface SubagentDelegationV2TerminalResponse extends SubagentDelegationV2Started {\n status: Exclude<SubagentDelegationV2Status, 'invalid_request'>;\n error?: string;\n runId?: string;\n agent?: string;\n model?: string;\n thinking?: string;\n exitCode?: number;\n launchContractDigest?: string;\n result?: SubagentDelegationV2Value;\n usage?: SubagentDelegationV2Usage;\n}\n\n/** A malformed V2 request can only be correlated by the valid identity fields it supplied. */\nexport interface SubagentDelegationV2InvalidResponse {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId?: string;\n nodeId?: string;\n status: 'invalid_request';\n error?: string;\n}\n\nexport type SubagentDelegationV2Response = SubagentDelegationV2TerminalResponse | SubagentDelegationV2InvalidResponse;\n\nexport interface SubagentDelegationV2Cancel extends SubagentDelegationV2Started {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,uCAAuC;AACpD,MAAa,0CAA0C;AAIvD,MAAa,oCAAoC;AACjD,MAAa,oCAAoC;AACjD,MAAa,mCAAmC;AAChD,MAAa,qCAAqC;AAClD,MAAa,mCAAmC"}
1
+ {"version":3,"file":"delegation.mjs","names":[],"sources":["../src/schemas/team/delegation.ts"],"sourcesContent":["/**\n * Subagent delegation - a cross-extension event protocol.\n *\n * Delegation lets another extension ask this runtime to run a subagent without\n * depending on its internals: the requester emits a request event and receives\n * started/update/response events back over the host event bus.\n *\n * Two generations coexist. V1 correlates purely by `requestId`. V2 adds\n * `ownerRunId` and `nodeId` so one owner can fan out to many nodes and have each\n * reply routed back, and it carries a typed `result` request.\n *\n * PROTOCOL COMPATIBILITY (do not change):\n * The event names and version numbers below are shared with po-subagents\n * and with po-task and agiflow-pi-extension, which speak this protocol today.\n * The event names deliberately keep their `prompt-template:` prefix: that is the\n * established transport, and renaming it would silently stop delivery. Pinned by\n * contract tests.\n *\n * AVOID:\n * - Adding a required field to an existing version; add a version instead\n */\n\nexport const SUBAGENT_DELEGATION_PROTOCOL_VERSION = 1 as const;\nexport const SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION = 2 as const;\n\n// This is the established extension-to-extension transport. The public API\n// intentionally reuses it instead of adding a second event protocol.\nexport const SUBAGENT_DELEGATION_REQUEST_EVENT = 'prompt-template:subagent:request';\nexport const SUBAGENT_DELEGATION_STARTED_EVENT = 'prompt-template:subagent:started';\nexport const SUBAGENT_DELEGATION_UPDATE_EVENT = 'prompt-template:subagent:update';\nexport const SUBAGENT_DELEGATION_RESPONSE_EVENT = 'prompt-template:subagent:response';\nexport const SUBAGENT_DELEGATION_CANCEL_EVENT = 'prompt-template:subagent:cancel';\n\nexport interface SubagentDelegationTurnBudget {\n maxTurns: number;\n graceTurns?: number;\n}\n\nexport interface SubagentDelegationToolBudget {\n soft?: number;\n hard: number;\n block?: string[] | '*';\n}\n\nexport interface SubagentDelegationAgentContract {\n version: 1;\n}\n\nexport type SubagentDelegationJsonSchemaObject = Record<string, unknown>;\n\nexport interface SubagentDelegationExecutionResult {\n status: 'completed' | 'failed' | 'paused' | 'stopped' | 'detached';\n success: boolean;\n exitCode: number;\n error?: string;\n interrupted?: boolean;\n timedOut?: boolean;\n stopped?: boolean;\n detached?: boolean;\n}\n\nexport interface SubagentDelegationReviewResult {\n status: 'not-requested' | 'review-required' | 'reviewed' | 'blockers';\n findings?: Array<{ severity: 'blocker' | 'non-blocking'; file?: string; issue: string; rationale: string }>;\n}\n\nexport interface SubagentDelegationEffectsResult {\n fileMutation?: {\n status: 'not-requested' | 'not-applicable' | 'observed' | 'missing';\n expected: boolean;\n attempted: boolean;\n message?: string;\n };\n}\n\nexport type SubagentDelegationAcceptanceEvidence =\n | 'changed-files'\n | 'tests-added'\n | 'commands-run'\n | 'validation-output'\n | 'residual-risks'\n | 'no-staged-files'\n | 'diff-summary'\n | 'review-findings'\n | 'manual-notes';\n\nexport interface SubagentDelegationAcceptanceCriterion {\n id: string;\n must: string;\n evidence?: SubagentDelegationAcceptanceEvidence[];\n severity?: 'required' | 'recommended';\n}\n\nexport interface SubagentDelegationAcceptanceVerifyCommand {\n id: string;\n command: string;\n timeoutMs?: number;\n cwd?: string;\n env?: Record<string, string>;\n allowFailure?: boolean;\n}\n\nexport interface SubagentDelegationAcceptanceReview {\n agent?: string;\n focus?: string;\n required?: boolean;\n}\n\ninterface SubagentDelegationAcceptanceFields {\n criteria?: Array<string | SubagentDelegationAcceptanceCriterion>;\n evidence?: SubagentDelegationAcceptanceEvidence[];\n verify?: SubagentDelegationAcceptanceVerifyCommand[];\n review?: SubagentDelegationAcceptanceReview | false;\n stopRules?: string[];\n}\n\nexport type SubagentDelegationAcceptanceConfig = SubagentDelegationAcceptanceFields &\n ({ level: 'none'; reason: string } | { level?: 'auto' | 'attested' | 'checked' | 'verified'; reason?: string });\n\nexport type SubagentDelegationAcceptance =\n | 'auto'\n | 'attested'\n | 'checked'\n | 'verified'\n | false\n | SubagentDelegationAcceptanceConfig;\n\nexport interface SubagentDelegationRequest {\n version: typeof SUBAGENT_DELEGATION_PROTOCOL_VERSION;\n requestId: string;\n agent: string;\n task: string;\n context: 'fresh' | 'fork';\n cwd: string;\n model?: string;\n timeoutMs?: number;\n turnBudget?: SubagentDelegationTurnBudget;\n toolBudget?: SubagentDelegationToolBudget;\n skill?: string | string[] | boolean;\n output?: string | boolean;\n outputMode?: 'inline' | 'file-only';\n outputSchema?: SubagentDelegationJsonSchemaObject;\n agentContract?: SubagentDelegationAgentContract;\n acceptance?: SubagentDelegationAcceptance;\n artifacts?: boolean;\n /** Foreground remains the compatibility default. */\n runMode?: 'foreground' | 'detached';\n /** Optional task identity shown to active root-session teammates. */\n teamTask?: { id: string; subject: string };\n}\n\nexport interface SubagentDelegationStarted {\n version: typeof SUBAGENT_DELEGATION_PROTOCOL_VERSION;\n requestId: string;\n runId?: string;\n}\n\nexport interface SubagentDelegationUpdate extends SubagentDelegationStarted {\n runId?: string;\n currentTool?: string;\n currentToolArgs?: string;\n recentOutput?: string;\n recentOutputLines?: string[];\n recentTools?: Array<{ tool: string; args: string }>;\n model?: string;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n}\n\nexport type SubagentDelegationStatus =\n | 'completed'\n | 'failed'\n | 'timed_out'\n | 'cancelled'\n | 'interrupted'\n | 'turn_budget_exhausted'\n | 'tool_budget_exhausted'\n | 'structured_output_failed'\n | 'acceptance_failed'\n | 'invalid_request'\n | 'unavailable_context';\n\nexport type SubagentDelegationAcceptanceStatus =\n | 'pending'\n | 'not-required'\n | 'claimed'\n | 'attested'\n | 'checked'\n | 'verified'\n | 'review-required'\n | 'reviewed'\n | 'accepted'\n | 'rejected';\n\nexport interface SubagentDelegationAcceptanceResult {\n status: SubagentDelegationAcceptanceStatus;\n evidenceStatus: Exclude<SubagentDelegationAcceptanceStatus, 'review-required' | 'reviewed' | 'accepted'>;\n explicit: boolean;\n}\n\nexport interface SubagentDelegationResponse extends SubagentDelegationStarted {\n status: SubagentDelegationStatus;\n error?: string;\n runId?: string;\n childIndex?: number;\n agent?: string;\n model?: string;\n exitCode?: number;\n execution?: SubagentDelegationExecutionResult;\n output?: string;\n outputPath?: string;\n sessionFile?: string;\n acceptance?: SubagentDelegationAcceptanceResult;\n review?: SubagentDelegationReviewResult;\n effects?: SubagentDelegationEffectsResult;\n turns?: number;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n warnings?: string[];\n}\n\nexport interface SubagentDelegationCancel extends SubagentDelegationStarted {}\n\nexport type SubagentDelegationV2Thinking = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';\n\nexport type SubagentDelegationV2ResultRequest =\n | { kind: 'text' }\n | { kind: 'structured'; schema: SubagentDelegationJsonSchemaObject };\n\nexport interface SubagentDelegationV2Request {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId: string;\n nodeId: string;\n agent: string;\n task: string;\n context: 'fresh' | 'fork';\n cwd: string;\n model?: string;\n thinking?: SubagentDelegationV2Thinking;\n timeoutMs?: number;\n turnBudget?: SubagentDelegationTurnBudget;\n toolBudget?: SubagentDelegationToolBudget;\n skill?: string | string[] | boolean;\n artifacts?: boolean;\n result: SubagentDelegationV2ResultRequest;\n}\n\nexport interface SubagentDelegationV2Started {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId: string;\n nodeId: string;\n}\n\nexport interface SubagentDelegationV2Update extends SubagentDelegationV2Started {\n runId?: string;\n currentTool?: string;\n currentToolArgs?: string;\n recentOutput?: string;\n recentOutputLines?: string[];\n recentTools?: Array<{ tool: string; args: string }>;\n model?: string;\n toolCount?: number;\n durationMs?: number;\n tokens?: number;\n}\n\nexport type SubagentDelegationV2Status = SubagentDelegationStatus | 'duplicate_node';\n\nexport type SubagentDelegationV2Value = { kind: 'text'; text: string } | { kind: 'structured'; value: unknown };\n\nexport interface SubagentDelegationV2Usage {\n input: number;\n output: number;\n cacheRead: number;\n cacheWrite: number;\n cost: number;\n turns: number;\n toolCalls: number;\n durationMs: number;\n}\n\nexport interface SubagentDelegationV2TerminalResponse extends SubagentDelegationV2Started {\n status: Exclude<SubagentDelegationV2Status, 'invalid_request'>;\n error?: string;\n runId?: string;\n agent?: string;\n model?: string;\n thinking?: string;\n exitCode?: number;\n launchContractDigest?: string;\n result?: SubagentDelegationV2Value;\n usage?: SubagentDelegationV2Usage;\n}\n\n/** A malformed V2 request can only be correlated by the valid identity fields it supplied. */\nexport interface SubagentDelegationV2InvalidResponse {\n version: typeof SUBAGENT_DELEGATION_V2_PROTOCOL_VERSION;\n requestId: string;\n ownerRunId?: string;\n nodeId?: string;\n status: 'invalid_request';\n error?: string;\n}\n\nexport type SubagentDelegationV2Response = SubagentDelegationV2TerminalResponse | SubagentDelegationV2InvalidResponse;\n\nexport interface SubagentDelegationV2Cancel extends SubagentDelegationV2Started {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,uCAAuC;AACpD,MAAa,0CAA0C;AAIvD,MAAa,oCAAoC;AACjD,MAAa,oCAAoC;AACjD,MAAa,mCAAmC;AAChD,MAAa,qCAAqC;AAClD,MAAa,mCAAmC"}
@@ -1,92 +1,92 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _agimon_ai_po_core_delegation = require("@agimon-ai/po-core/delegation");
3
- Object.defineProperty(exports, "DOOM_DELEGATION_ACCEPTED_EVENT", {
3
+ Object.defineProperty(exports, "DelegationAcceptedSchema", {
4
4
  enumerable: true,
5
5
  get: function() {
6
- return _agimon_ai_po_core_delegation.DOOM_DELEGATION_ACCEPTED_EVENT;
6
+ return _agimon_ai_po_core_delegation.DelegationAcceptedSchema;
7
7
  }
8
8
  });
9
- Object.defineProperty(exports, "DOOM_DELEGATION_CANCELLED_EVENT", {
9
+ Object.defineProperty(exports, "DelegationCancelSchema", {
10
10
  enumerable: true,
11
11
  get: function() {
12
- return _agimon_ai_po_core_delegation.DOOM_DELEGATION_CANCELLED_EVENT;
12
+ return _agimon_ai_po_core_delegation.DelegationCancelSchema;
13
13
  }
14
14
  });
15
- Object.defineProperty(exports, "DOOM_DELEGATION_FINISHED_EVENT", {
15
+ Object.defineProperty(exports, "DelegationRequestSchema", {
16
16
  enumerable: true,
17
17
  get: function() {
18
- return _agimon_ai_po_core_delegation.DOOM_DELEGATION_FINISHED_EVENT;
18
+ return _agimon_ai_po_core_delegation.DelegationRequestSchema;
19
19
  }
20
20
  });
21
- Object.defineProperty(exports, "DOOM_DELEGATION_REQUESTED_EVENT", {
21
+ Object.defineProperty(exports, "DelegationResultSchema", {
22
22
  enumerable: true,
23
23
  get: function() {
24
- return _agimon_ai_po_core_delegation.DOOM_DELEGATION_REQUESTED_EVENT;
24
+ return _agimon_ai_po_core_delegation.DelegationResultSchema;
25
25
  }
26
26
  });
27
- Object.defineProperty(exports, "DOOM_DELEGATION_SERVICE", {
27
+ Object.defineProperty(exports, "DelegationStartedSchema", {
28
28
  enumerable: true,
29
29
  get: function() {
30
- return _agimon_ai_po_core_delegation.DOOM_DELEGATION_SERVICE;
30
+ return _agimon_ai_po_core_delegation.DelegationStartedSchema;
31
31
  }
32
32
  });
33
- Object.defineProperty(exports, "DOOM_DELEGATION_STARTED_EVENT", {
33
+ Object.defineProperty(exports, "DelegationStatusSchema", {
34
34
  enumerable: true,
35
35
  get: function() {
36
- return _agimon_ai_po_core_delegation.DOOM_DELEGATION_STARTED_EVENT;
36
+ return _agimon_ai_po_core_delegation.DelegationStatusSchema;
37
37
  }
38
38
  });
39
- Object.defineProperty(exports, "DOOM_DELEGATION_UPDATED_EVENT", {
39
+ Object.defineProperty(exports, "DelegationUpdateSchema", {
40
40
  enumerable: true,
41
41
  get: function() {
42
- return _agimon_ai_po_core_delegation.DOOM_DELEGATION_UPDATED_EVENT;
42
+ return _agimon_ai_po_core_delegation.DelegationUpdateSchema;
43
43
  }
44
44
  });
45
- Object.defineProperty(exports, "DelegationAcceptedSchema", {
45
+ Object.defineProperty(exports, "PO_DELEGATION_ACCEPTED_EVENT", {
46
46
  enumerable: true,
47
47
  get: function() {
48
- return _agimon_ai_po_core_delegation.DelegationAcceptedSchema;
48
+ return _agimon_ai_po_core_delegation.PO_DELEGATION_ACCEPTED_EVENT;
49
49
  }
50
50
  });
51
- Object.defineProperty(exports, "DelegationCancelSchema", {
51
+ Object.defineProperty(exports, "PO_DELEGATION_CANCELLED_EVENT", {
52
52
  enumerable: true,
53
53
  get: function() {
54
- return _agimon_ai_po_core_delegation.DelegationCancelSchema;
54
+ return _agimon_ai_po_core_delegation.PO_DELEGATION_CANCELLED_EVENT;
55
55
  }
56
56
  });
57
- Object.defineProperty(exports, "DelegationRequestSchema", {
57
+ Object.defineProperty(exports, "PO_DELEGATION_FINISHED_EVENT", {
58
58
  enumerable: true,
59
59
  get: function() {
60
- return _agimon_ai_po_core_delegation.DelegationRequestSchema;
60
+ return _agimon_ai_po_core_delegation.PO_DELEGATION_FINISHED_EVENT;
61
61
  }
62
62
  });
63
- Object.defineProperty(exports, "DelegationResultSchema", {
63
+ Object.defineProperty(exports, "PO_DELEGATION_REQUESTED_EVENT", {
64
64
  enumerable: true,
65
65
  get: function() {
66
- return _agimon_ai_po_core_delegation.DelegationResultSchema;
66
+ return _agimon_ai_po_core_delegation.PO_DELEGATION_REQUESTED_EVENT;
67
67
  }
68
68
  });
69
- Object.defineProperty(exports, "DelegationStartedSchema", {
69
+ Object.defineProperty(exports, "PO_DELEGATION_SERVICE", {
70
70
  enumerable: true,
71
71
  get: function() {
72
- return _agimon_ai_po_core_delegation.DelegationStartedSchema;
72
+ return _agimon_ai_po_core_delegation.PO_DELEGATION_SERVICE;
73
73
  }
74
74
  });
75
- Object.defineProperty(exports, "DelegationStatusSchema", {
75
+ Object.defineProperty(exports, "PO_DELEGATION_STARTED_EVENT", {
76
76
  enumerable: true,
77
77
  get: function() {
78
- return _agimon_ai_po_core_delegation.DelegationStatusSchema;
78
+ return _agimon_ai_po_core_delegation.PO_DELEGATION_STARTED_EVENT;
79
79
  }
80
80
  });
81
- Object.defineProperty(exports, "DelegationUpdateSchema", {
81
+ Object.defineProperty(exports, "PO_DELEGATION_UPDATED_EVENT", {
82
82
  enumerable: true,
83
83
  get: function() {
84
- return _agimon_ai_po_core_delegation.DelegationUpdateSchema;
84
+ return _agimon_ai_po_core_delegation.PO_DELEGATION_UPDATED_EVENT;
85
85
  }
86
86
  });
87
- Object.defineProperty(exports, "readDoomDelegationService", {
87
+ Object.defineProperty(exports, "readPoDelegationService", {
88
88
  enumerable: true,
89
89
  get: function() {
90
- return _agimon_ai_po_core_delegation.readDoomDelegationService;
90
+ return _agimon_ai_po_core_delegation.readPoDelegationService;
91
91
  }
92
92
  });
@@ -1,2 +1,2 @@
1
- import { DOOM_DELEGATION_ACCEPTED_EVENT, DOOM_DELEGATION_CANCELLED_EVENT, DOOM_DELEGATION_FINISHED_EVENT, DOOM_DELEGATION_REQUESTED_EVENT, DOOM_DELEGATION_SERVICE, DOOM_DELEGATION_STARTED_EVENT, DOOM_DELEGATION_UPDATED_EVENT, DelegationAccepted, DelegationAcceptedSchema, DelegationCancel, DelegationCancelSchema, DelegationRequest, DelegationRequestSchema, DelegationResult, DelegationResultSchema, DelegationStarted, DelegationStartedSchema, DelegationStatus, DelegationStatusSchema, DelegationUpdate, DelegationUpdateSchema, DoomDelegationService, readDoomDelegationService } from "@agimon-ai/po-core/delegation";
2
- export { DOOM_DELEGATION_ACCEPTED_EVENT, DOOM_DELEGATION_CANCELLED_EVENT, DOOM_DELEGATION_FINISHED_EVENT, DOOM_DELEGATION_REQUESTED_EVENT, DOOM_DELEGATION_SERVICE, DOOM_DELEGATION_STARTED_EVENT, DOOM_DELEGATION_UPDATED_EVENT, type DelegationAccepted, DelegationAcceptedSchema, type DelegationCancel, DelegationCancelSchema, type DelegationRequest, DelegationRequestSchema, type DelegationResult, DelegationResultSchema, type DelegationStarted, DelegationStartedSchema, type DelegationStatus, DelegationStatusSchema, type DelegationUpdate, DelegationUpdateSchema, type DoomDelegationService, readDoomDelegationService };
1
+ import { DelegationAccepted, DelegationAcceptedSchema, DelegationCancel, DelegationCancelSchema, DelegationRequest, DelegationRequestSchema, DelegationResult, DelegationResultSchema, DelegationStarted, DelegationStartedSchema, DelegationStatus, DelegationStatusSchema, DelegationUpdate, DelegationUpdateSchema, PO_DELEGATION_ACCEPTED_EVENT, PO_DELEGATION_CANCELLED_EVENT, PO_DELEGATION_FINISHED_EVENT, PO_DELEGATION_REQUESTED_EVENT, PO_DELEGATION_SERVICE, PO_DELEGATION_STARTED_EVENT, PO_DELEGATION_UPDATED_EVENT, PoDelegationService, readPoDelegationService } from "@agimon-ai/po-core/delegation";
2
+ export { type DelegationAccepted, DelegationAcceptedSchema, type DelegationCancel, DelegationCancelSchema, type DelegationRequest, DelegationRequestSchema, type DelegationResult, DelegationResultSchema, type DelegationStarted, DelegationStartedSchema, type DelegationStatus, DelegationStatusSchema, type DelegationUpdate, DelegationUpdateSchema, PO_DELEGATION_ACCEPTED_EVENT, PO_DELEGATION_CANCELLED_EVENT, PO_DELEGATION_FINISHED_EVENT, PO_DELEGATION_REQUESTED_EVENT, PO_DELEGATION_SERVICE, PO_DELEGATION_STARTED_EVENT, PO_DELEGATION_UPDATED_EVENT, type PoDelegationService, readPoDelegationService };
@@ -1 +1 @@
1
- export { DOOM_DELEGATION_ACCEPTED_EVENT, DOOM_DELEGATION_CANCELLED_EVENT, DOOM_DELEGATION_FINISHED_EVENT, DOOM_DELEGATION_REQUESTED_EVENT, DOOM_DELEGATION_SERVICE, DOOM_DELEGATION_STARTED_EVENT, DOOM_DELEGATION_UPDATED_EVENT, DelegationAcceptedSchema, DelegationCancelSchema, DelegationRequestSchema, DelegationResultSchema, DelegationStartedSchema, DelegationStatusSchema, DelegationUpdateSchema, readDoomDelegationService } from "@agimon-ai/po-core/delegation";
1
+ export { DelegationAcceptedSchema, DelegationCancelSchema, DelegationRequestSchema, DelegationResultSchema, DelegationStartedSchema, DelegationStatusSchema, DelegationUpdateSchema, PO_DELEGATION_ACCEPTED_EVENT, PO_DELEGATION_CANCELLED_EVENT, PO_DELEGATION_FINISHED_EVENT, PO_DELEGATION_REQUESTED_EVENT, PO_DELEGATION_SERVICE, PO_DELEGATION_STARTED_EVENT, PO_DELEGATION_UPDATED_EVENT, readPoDelegationService } from "@agimon-ai/po-core/delegation";
package/dist/env.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_environment = require("./environment-CaCW3SgT.cjs");
2
+ const require_environment = require("./environment-Cqs7vHJL.cjs");
3
3
  let _agimon_ai_po_core_childProcess = require("@agimon-ai/po-core/childProcess");
4
4
  exports.CHILD_TOOL_DIAGNOSTIC_PATH_ENV = require_environment.CHILD_TOOL_DIAGNOSTIC_PATH_ENV;
5
5
  exports.EXTRA_AGENT_DIRS_ENV = require_environment.EXTRA_AGENT_DIRS_ENV;
package/dist/env.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as SUBAGENT_PARENT_PATH_ENV, B as TOOL_BUDGET_ENV, C as SUBAGENT_FANOUT_CHILD_ENV, D as SUBAGENT_PARENT_CONTROL_INBOX_ENV, E as SUBAGENT_PARENT_CHILD_INDEX_ENV, F as SUBAGENT_ROOT_SESSION_ENV, H as WORKTREE_BASE_DIR_ENV, I as SUBAGENT_RUN_ID_ENV, L as SUBAGENT_STEER_ACK_DIR_ENV, M as SUBAGENT_PARENT_RUN_ID_ENV, N as SUBAGENT_PARENT_SESSION_ENV, O as SUBAGENT_PARENT_DEPTH_ENV, P as SUBAGENT_PROTECTED_PARENT_PIDS_ENV, R as SUBAGENT_STEER_CAPABILITY_ENV, S as SUBAGENT_CHILD_INDEX_ENV, T as SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV, U as decodeProtectedParentProcessIds, V as TOOL_BUDGET_ZERO_AUTH_ENV, W as runtimeBinaryEnvVar, _ as STRUCTURED_OUTPUT_CAPTURE_ENV, a as INHERIT_SKILLS_ENV, b as SUBAGENT_CHILD_AGENT_ENV, c as MCP_DIRECT_TOOLS_ENV, d as PI_INTERCOM_STABLE_ID_ENV, f as PI_RUNTIME_NAME, g as REQUIRED_CHILD_TOOLS_ENV, h as PO_SKILL_DIRS_ENV, i as INHERIT_PROJECT_CONTEXT_ENV, j as SUBAGENT_PARENT_ROOT_RUN_ID_ENV, k as SUBAGENT_PARENT_EVENT_SINK_ENV, l as PI_CODING_AGENT_PACKAGE_ROOT_ENV, m as PO_CHILD_EXTENSIONS_ENV, n as EXTRA_AGENT_DIRS_ENV, o as MAX_SPAWNS_PER_SESSION_ENV, p as PI_SUBAGENT_PI_BINARY_ENV, r as EXTRA_SKILL_DIRS_ENV, s as MCP_DIRECT_CHILD_TOOLS_ENV, t as CHILD_TOOL_DIAGNOSTIC_PATH_ENV, u as PI_INTERCOM_SESSION_ID_ENV, v as STRUCTURED_OUTPUT_SCHEMA_ENV, w as SUBAGENT_INTERCOM_SESSION_NAME_ENV, x as SUBAGENT_CHILD_ENV, y as SUBAGENT_CAPABILITY_CEILING_ENV, z as SUBAGENT_STEER_INBOX_ENV } from "./environment-ma5oQ7uM.mjs";
1
+ import { A as SUBAGENT_PARENT_PATH_ENV, B as TOOL_BUDGET_ENV, C as SUBAGENT_FANOUT_CHILD_ENV, D as SUBAGENT_PARENT_CONTROL_INBOX_ENV, E as SUBAGENT_PARENT_CHILD_INDEX_ENV, F as SUBAGENT_ROOT_SESSION_ENV, H as WORKTREE_BASE_DIR_ENV, I as SUBAGENT_RUN_ID_ENV, L as SUBAGENT_STEER_ACK_DIR_ENV, M as SUBAGENT_PARENT_RUN_ID_ENV, N as SUBAGENT_PARENT_SESSION_ENV, O as SUBAGENT_PARENT_DEPTH_ENV, P as SUBAGENT_PROTECTED_PARENT_PIDS_ENV, R as SUBAGENT_STEER_CAPABILITY_ENV, S as SUBAGENT_CHILD_INDEX_ENV, T as SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV, U as decodeProtectedParentProcessIds, V as TOOL_BUDGET_ZERO_AUTH_ENV, W as runtimeBinaryEnvVar, _ as STRUCTURED_OUTPUT_CAPTURE_ENV, a as INHERIT_SKILLS_ENV, b as SUBAGENT_CHILD_AGENT_ENV, c as MCP_DIRECT_TOOLS_ENV, d as PI_INTERCOM_STABLE_ID_ENV, f as PI_RUNTIME_NAME, g as REQUIRED_CHILD_TOOLS_ENV, h as PO_SKILL_DIRS_ENV, i as INHERIT_PROJECT_CONTEXT_ENV, j as SUBAGENT_PARENT_ROOT_RUN_ID_ENV, k as SUBAGENT_PARENT_EVENT_SINK_ENV, l as PI_CODING_AGENT_PACKAGE_ROOT_ENV, m as PO_CHILD_EXTENSIONS_ENV, n as EXTRA_AGENT_DIRS_ENV, o as MAX_SPAWNS_PER_SESSION_ENV, p as PI_SUBAGENT_PI_BINARY_ENV, r as EXTRA_SKILL_DIRS_ENV, s as MCP_DIRECT_CHILD_TOOLS_ENV, t as CHILD_TOOL_DIAGNOSTIC_PATH_ENV, u as PI_INTERCOM_SESSION_ID_ENV, v as STRUCTURED_OUTPUT_SCHEMA_ENV, w as SUBAGENT_INTERCOM_SESSION_NAME_ENV, x as SUBAGENT_CHILD_ENV, y as SUBAGENT_CAPABILITY_CEILING_ENV, z as SUBAGENT_STEER_INBOX_ENV } from "./environment-Bz1OlWIT.mjs";
2
2
  export { CHILD_TOOL_DIAGNOSTIC_PATH_ENV, EXTRA_AGENT_DIRS_ENV, EXTRA_SKILL_DIRS_ENV, INHERIT_PROJECT_CONTEXT_ENV, INHERIT_SKILLS_ENV, MAX_SPAWNS_PER_SESSION_ENV, MCP_DIRECT_CHILD_TOOLS_ENV, MCP_DIRECT_TOOLS_ENV, PI_CODING_AGENT_PACKAGE_ROOT_ENV, PI_INTERCOM_SESSION_ID_ENV, PI_INTERCOM_STABLE_ID_ENV, PI_RUNTIME_NAME, PI_SUBAGENT_PI_BINARY_ENV, PO_CHILD_EXTENSIONS_ENV, PO_SKILL_DIRS_ENV, REQUIRED_CHILD_TOOLS_ENV, STRUCTURED_OUTPUT_CAPTURE_ENV, STRUCTURED_OUTPUT_SCHEMA_ENV, SUBAGENT_CAPABILITY_CEILING_ENV, SUBAGENT_CHILD_AGENT_ENV, SUBAGENT_CHILD_ENV, SUBAGENT_CHILD_INDEX_ENV, SUBAGENT_FANOUT_CHILD_ENV, SUBAGENT_INTERCOM_SESSION_NAME_ENV, SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV, SUBAGENT_PARENT_CHILD_INDEX_ENV, SUBAGENT_PARENT_CONTROL_INBOX_ENV, SUBAGENT_PARENT_DEPTH_ENV, SUBAGENT_PARENT_EVENT_SINK_ENV, SUBAGENT_PARENT_PATH_ENV, SUBAGENT_PARENT_ROOT_RUN_ID_ENV, SUBAGENT_PARENT_RUN_ID_ENV, SUBAGENT_PARENT_SESSION_ENV, SUBAGENT_PROTECTED_PARENT_PIDS_ENV, SUBAGENT_ROOT_SESSION_ENV, SUBAGENT_RUN_ID_ENV, SUBAGENT_STEER_ACK_DIR_ENV, SUBAGENT_STEER_CAPABILITY_ENV, SUBAGENT_STEER_INBOX_ENV, TOOL_BUDGET_ENV, TOOL_BUDGET_ZERO_AUTH_ENV, WORKTREE_BASE_DIR_ENV, decodeProtectedParentProcessIds, runtimeBinaryEnvVar };
package/dist/env.mjs CHANGED
@@ -1 +1 @@
1
- export { t as CHILD_TOOL_DIAGNOSTIC_PATH_ENV, n as EXTRA_AGENT_DIRS_ENV, r as EXTRA_SKILL_DIRS_ENV, i as INHERIT_PROJECT_CONTEXT_ENV, a as INHERIT_SKILLS_ENV, o as MAX_SPAWNS_PER_SESSION_ENV, s as MCP_DIRECT_CHILD_TOOLS_ENV, c as MCP_DIRECT_TOOLS_ENV, l as PI_CODING_AGENT_PACKAGE_ROOT_ENV, u as PI_INTERCOM_SESSION_ID_ENV, d as PI_INTERCOM_STABLE_ID_ENV, f as PI_RUNTIME_NAME, p as PI_SUBAGENT_PI_BINARY_ENV, m as PO_CHILD_EXTENSIONS_ENV, h as PO_SKILL_DIRS_ENV, g as REQUIRED_CHILD_TOOLS_ENV, _ as STRUCTURED_OUTPUT_CAPTURE_ENV, v as STRUCTURED_OUTPUT_SCHEMA_ENV, y as SUBAGENT_CAPABILITY_CEILING_ENV, b as SUBAGENT_CHILD_AGENT_ENV, x as SUBAGENT_CHILD_ENV, S as SUBAGENT_CHILD_INDEX_ENV, C as SUBAGENT_FANOUT_CHILD_ENV, w as SUBAGENT_INTERCOM_SESSION_NAME_ENV, T as SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV, E as SUBAGENT_PARENT_CHILD_INDEX_ENV, D as SUBAGENT_PARENT_CONTROL_INBOX_ENV, O as SUBAGENT_PARENT_DEPTH_ENV, k as SUBAGENT_PARENT_EVENT_SINK_ENV, A as SUBAGENT_PARENT_PATH_ENV, j as SUBAGENT_PARENT_ROOT_RUN_ID_ENV, M as SUBAGENT_PARENT_RUN_ID_ENV, N as SUBAGENT_PARENT_SESSION_ENV, P as SUBAGENT_PROTECTED_PARENT_PIDS_ENV, F as SUBAGENT_ROOT_SESSION_ENV, I as SUBAGENT_RUN_ID_ENV, L as SUBAGENT_STEER_ACK_DIR_ENV, R as SUBAGENT_STEER_CAPABILITY_ENV, z as SUBAGENT_STEER_INBOX_ENV, B as TOOL_BUDGET_ENV, V as TOOL_BUDGET_ZERO_AUTH_ENV, H as WORKTREE_BASE_DIR_ENV, U as decodeProtectedParentProcessIds, W as runtimeBinaryEnvVar } from "./environment-DrqhrxG_.mjs";
1
+ export { t as CHILD_TOOL_DIAGNOSTIC_PATH_ENV, n as EXTRA_AGENT_DIRS_ENV, r as EXTRA_SKILL_DIRS_ENV, i as INHERIT_PROJECT_CONTEXT_ENV, a as INHERIT_SKILLS_ENV, o as MAX_SPAWNS_PER_SESSION_ENV, s as MCP_DIRECT_CHILD_TOOLS_ENV, c as MCP_DIRECT_TOOLS_ENV, l as PI_CODING_AGENT_PACKAGE_ROOT_ENV, u as PI_INTERCOM_SESSION_ID_ENV, d as PI_INTERCOM_STABLE_ID_ENV, f as PI_RUNTIME_NAME, p as PI_SUBAGENT_PI_BINARY_ENV, m as PO_CHILD_EXTENSIONS_ENV, h as PO_SKILL_DIRS_ENV, g as REQUIRED_CHILD_TOOLS_ENV, _ as STRUCTURED_OUTPUT_CAPTURE_ENV, v as STRUCTURED_OUTPUT_SCHEMA_ENV, y as SUBAGENT_CAPABILITY_CEILING_ENV, b as SUBAGENT_CHILD_AGENT_ENV, x as SUBAGENT_CHILD_ENV, S as SUBAGENT_CHILD_INDEX_ENV, C as SUBAGENT_FANOUT_CHILD_ENV, w as SUBAGENT_INTERCOM_SESSION_NAME_ENV, T as SUBAGENT_PARENT_CAPABILITY_TOKEN_ENV, E as SUBAGENT_PARENT_CHILD_INDEX_ENV, D as SUBAGENT_PARENT_CONTROL_INBOX_ENV, O as SUBAGENT_PARENT_DEPTH_ENV, k as SUBAGENT_PARENT_EVENT_SINK_ENV, A as SUBAGENT_PARENT_PATH_ENV, j as SUBAGENT_PARENT_ROOT_RUN_ID_ENV, M as SUBAGENT_PARENT_RUN_ID_ENV, N as SUBAGENT_PARENT_SESSION_ENV, P as SUBAGENT_PROTECTED_PARENT_PIDS_ENV, F as SUBAGENT_ROOT_SESSION_ENV, I as SUBAGENT_RUN_ID_ENV, L as SUBAGENT_STEER_ACK_DIR_ENV, R as SUBAGENT_STEER_CAPABILITY_ENV, z as SUBAGENT_STEER_INBOX_ENV, B as TOOL_BUDGET_ENV, V as TOOL_BUDGET_ZERO_AUTH_ENV, H as WORKTREE_BASE_DIR_ENV, U as decodeProtectedParentProcessIds, W as runtimeBinaryEnvVar } from "./environment-BtvJI2S-.mjs";
@@ -31,13 +31,13 @@ const SUBAGENT_STEER_ACK_DIR_ENV = "PI_SUBAGENT_STEER_ACK_DIR";
31
31
  /** The in-process SDK runtime. Not an external command; see `runtimeRegistry.ts`. */
32
32
  const PI_RUNTIME_NAME = "pi";
33
33
  /**
34
- * Per-runtime binary override, e.g. `DOOM_TEAM_CLAUDE_BIN=/path/to/claude`.
34
+ * Per-runtime binary override, e.g. `PO_TEAM_CLAUDE_BIN=/path/to/claude`.
35
35
  *
36
36
  * Uppercased and non-alphanumerics folded to `_` so a runtime name that is
37
37
  * legal in config is always a legal environment variable name.
38
38
  */
39
39
  function runtimeBinaryEnvVar(runtime) {
40
- return `DOOM_TEAM_${runtime.toUpperCase().replace(/[^A-Z0-9]+/g, "_")}_BIN`;
40
+ return `PO_TEAM_${runtime.toUpperCase().replace(/[^A-Z0-9]+/g, "_")}_BIN`;
41
41
  }
42
42
  const SUBAGENT_CAPABILITY_CEILING_ENV = "PI_SUBAGENT_CAPABILITY_CEILING_V1";
43
43
  const REQUIRED_CHILD_TOOLS_ENV = "PI_SUBAGENT_REQUIRED_TOOLS";
@@ -72,4 +72,4 @@ const PO_SKILL_DIRS_ENV = "PO_SKILL_DIRS";
72
72
  //#endregion
73
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
74
 
75
- //# sourceMappingURL=environment-DrqhrxG_.mjs.map
75
+ //# sourceMappingURL=environment-BtvJI2S-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-BtvJI2S-.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. `PO_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 `PO_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 = '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AA4B;AACzC,MAAa,6BAA6B;;AAG1C,MAAa,0BAA0B;;AAEvC,MAAa,oBAAoB"}
@@ -22,7 +22,7 @@ declare const SUBAGENT_STEER_ACK_DIR_ENV = "PI_SUBAGENT_STEER_ACK_DIR";
22
22
  /** The in-process SDK runtime. Not an external command; see `runtimeRegistry.ts`. */
23
23
  declare const PI_RUNTIME_NAME = "pi";
24
24
  /**
25
- * Per-runtime binary override, e.g. `DOOM_TEAM_CLAUDE_BIN=/path/to/claude`.
25
+ * Per-runtime binary override, e.g. `PO_TEAM_CLAUDE_BIN=/path/to/claude`.
26
26
  *
27
27
  * Uppercased and non-alphanumerics folded to `_` so a runtime name that is
28
28
  * legal in config is always a legal environment variable name.
@@ -60,4 +60,4 @@ declare const PO_CHILD_EXTENSIONS_ENV = "PO_CHILD_EXTENSIONS";
60
60
  declare const PO_SKILL_DIRS_ENV = "PO_SKILL_DIRS";
61
61
  //#endregion
62
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
63
+ //# sourceMappingURL=environment-Bz1OlWIT.d.mts.map
@@ -1 +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"}
1
+ {"version":3,"file":"environment-Bz1OlWIT.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"}
@@ -31,13 +31,13 @@ const SUBAGENT_STEER_ACK_DIR_ENV = "PI_SUBAGENT_STEER_ACK_DIR";
31
31
  /** The in-process SDK runtime. Not an external command; see `runtimeRegistry.ts`. */
32
32
  const PI_RUNTIME_NAME = "pi";
33
33
  /**
34
- * Per-runtime binary override, e.g. `DOOM_TEAM_CLAUDE_BIN=/path/to/claude`.
34
+ * Per-runtime binary override, e.g. `PO_TEAM_CLAUDE_BIN=/path/to/claude`.
35
35
  *
36
36
  * Uppercased and non-alphanumerics folded to `_` so a runtime name that is
37
37
  * legal in config is always a legal environment variable name.
38
38
  */
39
39
  function runtimeBinaryEnvVar(runtime) {
40
- return `DOOM_TEAM_${runtime.toUpperCase().replace(/[^A-Z0-9]+/g, "_")}_BIN`;
40
+ return `PO_TEAM_${runtime.toUpperCase().replace(/[^A-Z0-9]+/g, "_")}_BIN`;
41
41
  }
42
42
  const SUBAGENT_CAPABILITY_CEILING_ENV = "PI_SUBAGENT_CAPABILITY_CEILING_V1";
43
43
  const REQUIRED_CHILD_TOOLS_ENV = "PI_SUBAGENT_REQUIRED_TOOLS";
@@ -317,4 +317,4 @@ Object.defineProperty(exports, "runtimeBinaryEnvVar", {
317
317
  }
318
318
  });
319
319
 
320
- //# sourceMappingURL=environment-CaCW3SgT.cjs.map
320
+ //# sourceMappingURL=environment-Cqs7vHJL.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-Cqs7vHJL.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. `PO_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 `PO_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-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;AAChD,MAAa,qCAAqC;AAClD,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;;AAG1C,MAAa,0BAA0B;;AAEvC,MAAa,oBAAoB"}
@@ -689,7 +689,7 @@ const styles = StyleSheet.create((theme) => ({
689
689
  var agents_native_default = defineActivityGroup({
690
690
  keys: "a r",
691
691
  icon: () => createElement(UsersIcon),
692
- statusKey: "doom-team-agents",
692
+ statusKey: "po-team-agents",
693
693
  order: 10,
694
694
  transientTab: subagentsTab,
695
695
  activeSource: {