pi-subagents 0.82.1 → 0.83.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/bundle/agents.js +4 -4
  3. package/bundle/background-work.js +1 -1
  4. package/bundle/child-tool-plan.js +3 -3
  5. package/bundle/{chunk-FXUXCX2K.js → chunk-4BW55BTL.js} +6 -6
  6. package/bundle/{chunk-PBK2I7WY.js → chunk-527E3D2J.js} +6 -6
  7. package/bundle/{chunk-46XKCPJR.js → chunk-5ESXK62X.js} +7 -1073
  8. package/bundle/{chunk-UTT254JE.js → chunk-6B4ITO2W.js} +8 -4
  9. package/bundle/{chunk-CIZQXJ5Q.js → chunk-7F5SK2U3.js} +39 -6
  10. package/bundle/{chunk-OYF6AFDY.js → chunk-BKFWQ642.js} +2 -2
  11. package/bundle/{chunk-ZIV4J4HG.js → chunk-CDI3GMNV.js} +47 -30
  12. package/bundle/{chunk-3JCDWF4V.js → chunk-CGXWSNPA.js} +12 -18
  13. package/bundle/{chunk-JYUKW2SY.js → chunk-CNLDYEH4.js} +12 -12
  14. package/bundle/{chunk-4SDU2BZX.js → chunk-CSSZRTKY.js} +2 -2
  15. package/bundle/{chunk-VSUSLDNW.js → chunk-CZTMUBUI.js} +10 -8
  16. package/bundle/{chunk-IVAE5Z6Q.js → chunk-HJJAVHFB.js} +28 -24
  17. package/bundle/{chunk-GJECHSAR.js → chunk-HLE22FSH.js} +2 -2
  18. package/bundle/{chunk-4Y2ROR7L.js → chunk-HXVKGS33.js} +5 -5
  19. package/bundle/{chunk-5LFLVSTM.js → chunk-JEZOSEWG.js} +2 -0
  20. package/bundle/{chunk-YKEWIB4M.js → chunk-JHZ6DZ5M.js} +1 -1
  21. package/bundle/{chunk-QE4AGIMG.js → chunk-LDMXJIA6.js} +457 -657
  22. package/bundle/{chunk-43SCHIMD.js → chunk-MBDOYZ2V.js} +1 -1
  23. package/bundle/{chunk-XSWOTIA3.js → chunk-MHX22USZ.js} +1 -1
  24. package/bundle/{chunk-6XJB7PIX.js → chunk-OOFW75PV.js} +4 -4
  25. package/bundle/{chunk-RMQFMMAT.js → chunk-P2NCCTZP.js} +231 -10
  26. package/bundle/{chunk-UCPP4GNU.js → chunk-RZJN63GU.js} +12 -5
  27. package/bundle/{chunk-G4GZD3OJ.js → chunk-TJQJ3MEA.js} +10 -10
  28. package/bundle/{chunk-5TYMSZX3.js → chunk-VTMNBPCQ.js} +2 -2
  29. package/bundle/{chunk-52UBALJL.js → chunk-WG2OTTAK.js} +2 -2
  30. package/bundle/{chunk-N2BN7BF5.js → chunk-XA3DY6UG.js} +7 -5
  31. package/bundle/{chunk-PDZWJCHD.js → chunk-XXKG3P2W.js} +9 -6
  32. package/bundle/{chunk-PLCCBLPY.js → chunk-Y3I6H6DV.js} +2 -2
  33. package/bundle/control-channel.js +3 -3
  34. package/bundle/index.js +1 -1
  35. package/bundle/intercom-bridge.js +3 -3
  36. package/bundle/preflight.js +9 -9
  37. package/bundle/project-panes.js +4 -4
  38. package/bundle/shared-types.js +1 -1
  39. package/docs/configuration.md +1 -1
  40. package/docs/extension-api.md +19 -4
  41. package/docs/observability.md +1 -0
  42. package/docs/tool-reference.md +1 -1
  43. package/package.json +1 -1
  44. package/skills/pi-subagents/SKILL.md +6 -6
  45. package/src/agents/agent-management.js +8 -14
  46. package/src/agents/agent-serializer.js +1 -2
  47. package/src/agents/agents.js +19 -3
  48. package/src/api/background-work.d.ts +9 -6
  49. package/src/api/background-work.js +14 -7
  50. package/src/extension/index.js +4 -1
  51. package/src/extension/public-execution.d.ts +2 -2
  52. package/src/extension/public-execution.js +3 -3
  53. package/src/extension/reply-workflow-script.js +4 -5
  54. package/src/extension/rpc.js +3 -1
  55. package/src/extension/subagent-options.js +17 -4
  56. package/src/runs/background/async-execution.js +4 -1
  57. package/src/runs/background/async-job-tracker.js +2 -1
  58. package/src/runs/background/auto-drain.js +2 -3
  59. package/src/runs/background/fleet-view.js +1 -1
  60. package/src/runs/background/run-child-session.js +22 -6
  61. package/src/runs/background/subagent-wait.d.ts +2 -1
  62. package/src/runs/background/subagent-wait.js +5 -2
  63. package/src/runs/foreground/execution.js +22 -6
  64. package/src/runs/foreground/subagent-executor.js +2 -5
  65. package/src/runs/shared/child-launch.js +5 -2
  66. package/src/runs/shared/child-session.d.ts +6 -0
  67. package/src/runs/shared/child-session.js +20 -4
  68. package/src/runs/shared/herdr-machine.d.ts +2 -0
  69. package/src/runs/shared/herdr-machine.js +2 -0
  70. package/src/runs/shared/herdr-placed-run.js +11 -4
  71. package/src/runs/shared/subagent-prompt-runtime.js +11 -17
  72. package/src/shared/disabled-features.d.ts +3 -1
  73. package/src/shared/disabled-features.js +11 -3
  74. package/src/shared/types.d.ts +3 -1
  75. package/src/shared/types.js +2 -0
  76. package/src/workflows/scripted-workflow.js +9 -1070
  77. package/workflow-script-worker.cjs +1067 -0
@@ -10,10 +10,10 @@ import {
10
10
  setInlineWorkflowCoverage,
11
11
  setMainThinkingLevelSource,
12
12
  widgetRenderKey
13
- } from "./chunk-4Y2ROR7L.js";
13
+ } from "./chunk-HXVKGS33.js";
14
14
  import {
15
15
  package_default
16
- } from "./chunk-UTT254JE.js";
16
+ } from "./chunk-6B4ITO2W.js";
17
17
  import {
18
18
  EXTERNAL_JOB_BRIDGE_REQUEST_DIR,
19
19
  REVIVAL_ORIGIN_FILE,
@@ -61,7 +61,7 @@ import {
61
61
  snapshotProviderDiagnostics,
62
62
  workflowResumeClaimState,
63
63
  workflowResumeRefusal
64
- } from "./chunk-ZIV4J4HG.js";
64
+ } from "./chunk-CDI3GMNV.js";
65
65
  import {
66
66
  CONTACT_SUPERVISOR_TOOL_NAME,
67
67
  NATIVE_SUPERVISOR_TOOL_NAME,
@@ -89,14 +89,14 @@ import {
89
89
  resolveWaitToolConfig,
90
90
  setDeclarationPinning,
91
91
  topLevelSupervisorTool
92
- } from "./chunk-VSUSLDNW.js";
92
+ } from "./chunk-CZTMUBUI.js";
93
93
  import {
94
94
  deliverAsyncRunStop,
95
95
  ownerConfirmedDead,
96
96
  readSessionMessagesTail,
97
97
  resolveSubagentRunId,
98
98
  restoreForegroundRunHistory
99
- } from "./chunk-FXUXCX2K.js";
99
+ } from "./chunk-4BW55BTL.js";
100
100
  import {
101
101
  ASYNC_STATUS_SNAPSHOT_KIND,
102
102
  ASYNC_STATUS_SNAPSHOT_VERSION,
@@ -118,7 +118,7 @@ import {
118
118
  resolveAsyncStatusChild,
119
119
  stopStoppableAsyncStatusChildren,
120
120
  withCachedUiContext
121
- } from "./chunk-6XJB7PIX.js";
121
+ } from "./chunk-OOFW75PV.js";
122
122
  import "./chunk-NF7IEKBH.js";
123
123
  import {
124
124
  disabledFeatureUseError,
@@ -129,7 +129,7 @@ import {
129
129
  resolveDisabledFeatureSurface,
130
130
  resolveMaxActiveAsyncRunsPerSession,
131
131
  resolveScheduledStoreRoot
132
- } from "./chunk-UCPP4GNU.js";
132
+ } from "./chunk-RZJN63GU.js";
133
133
  import {
134
134
  ACTIVE_RUN_INDEX_DIR,
135
135
  MissionNotFoundError,
@@ -178,41 +178,41 @@ import {
178
178
  withWorkflowChildRunModel,
179
179
  writeAsyncResultFile,
180
180
  writeResultIndexForData
181
- } from "./chunk-46XKCPJR.js";
182
- import "./chunk-OYF6AFDY.js";
181
+ } from "./chunk-5ESXK62X.js";
182
+ import "./chunk-BKFWQ642.js";
183
183
  import {
184
184
  shouldUseNativeFsWatch
185
185
  } from "./chunk-NIXWDZZV.js";
186
186
  import {
187
187
  validateIntercomBridgeConfig
188
- } from "./chunk-XSWOTIA3.js";
188
+ } from "./chunk-MHX22USZ.js";
189
189
  import "./chunk-7F6RKT6W.js";
190
- import "./chunk-4SDU2BZX.js";
190
+ import "./chunk-CSSZRTKY.js";
191
191
  import "./chunk-CTPAE36Y.js";
192
192
  import {
193
193
  listHerdrProjectPaneRoots,
194
194
  restoreHerdrProjectPaneSnapshots
195
- } from "./chunk-52UBALJL.js";
195
+ } from "./chunk-WG2OTTAK.js";
196
196
  import "./chunk-7J4ZXMY7.js";
197
197
  import {
198
198
  cleanupAllArtifactDirs,
199
199
  cleanupOldArtifacts,
200
200
  getArtifactPaths,
201
201
  getArtifactsDir
202
- } from "./chunk-5TYMSZX3.js";
202
+ } from "./chunk-VTMNBPCQ.js";
203
203
  import {
204
204
  listBackgroundWorkProviders
205
- } from "./chunk-N2BN7BF5.js";
205
+ } from "./chunk-XA3DY6UG.js";
206
206
  import "./chunk-YYREO77V.js";
207
207
  import "./chunk-UKG4V45O.js";
208
208
  import {
209
209
  registerRuntimeAgentEventListener
210
- } from "./chunk-43SCHIMD.js";
210
+ } from "./chunk-MBDOYZ2V.js";
211
211
  import {
212
212
  clearRuntimeAgentsForPi,
213
213
  listRuntimeAgentConfigs,
214
214
  mergeRuntimeAgents
215
- } from "./chunk-YKEWIB4M.js";
215
+ } from "./chunk-JHZ6DZ5M.js";
216
216
  import {
217
217
  DEFAULT_FILE_SYSTEM_RETRY_DELAYS_MS,
218
218
  EXTRA_AGENT_DIRS_ENV,
@@ -252,7 +252,7 @@ import {
252
252
  waitForFileSystemRetry,
253
253
  withSettingsFileLease,
254
254
  writeAtomicJson
255
- } from "./chunk-CIZQXJ5Q.js";
255
+ } from "./chunk-7F5SK2U3.js";
256
256
  import {
257
257
  DEFAULT_ARTIFACT_CONFIG,
258
258
  DIRS,
@@ -269,13 +269,14 @@ import {
269
269
  SUBAGENT_CHILD_STATUS_EVENT,
270
270
  SUBAGENT_CONTROL_EVENT,
271
271
  SUBAGENT_CONTROL_INTERCOM_EVENT,
272
+ SUBAGENT_JOBS_CHANGED_EVENT,
272
273
  SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
273
274
  SUBAGENT_PROCESS_TERMINAL_EVENT,
274
275
  SUBAGENT_STEERING_NOTICE_EVENT,
275
276
  WIDGET_ANIMATION_INTERVAL_MS,
276
277
  WIDGET_KEY,
277
278
  resolveMaxSubagentSpawnsPerSession
278
- } from "./chunk-5LFLVSTM.js";
279
+ } from "./chunk-JEZOSEWG.js";
279
280
  import {
280
281
  safeTerminalText,
281
282
  sanitizeDisplayText,
@@ -475,6 +476,7 @@ function createAsyncJobTracker(pi, state, asyncDirRoot, options = {}) {
475
476
  };
476
477
  const rerenderWidget = (ctx, jobs = Array.from(state.asyncJobs.values())) => {
477
478
  options.onJobsChanged?.();
479
+ pi.events.emit(SUBAGENT_JOBS_CHANGED_EVENT, { version: 1 });
478
480
  if (state.widgetsSuspended) return;
479
481
  renderWidget(ctx, options.widgetEnabled === false ? [] : jobs, options.widgetCollapsed, options.widgetLayout);
480
482
  ctx.ui.requestRender?.();
@@ -5180,7 +5182,7 @@ function registerSlashCommands(pi, state, options = {}) {
5180
5182
  }
5181
5183
  fleetOpen = true;
5182
5184
  try {
5183
- const { openSubagentFleet } = await import("./chunk-G4GZD3OJ.js");
5185
+ const { openSubagentFleet } = await import("./chunk-TJQJ3MEA.js");
5184
5186
  await openSubagentFleet(ctx, state, { asyncDirRoot: DIRS.async, inspectorPlugins: () => getInspectorPlugins(pi), resultsDir: DIRS.results, fleetKeybindings: options.fleetKeybindings });
5185
5187
  } finally {
5186
5188
  fleetOpen = false;
@@ -7410,8 +7412,10 @@ function pingData(ctx, options) {
7410
7412
  request: SUBAGENT_RPC_REQUEST_EVENT,
7411
7413
  replyPrefix: SUBAGENT_RPC_REPLY_EVENT_PREFIX,
7412
7414
  asyncComplete: SUBAGENT_ASYNC_COMPLETE_EVENT,
7415
+ asyncStarted: SUBAGENT_ASYNC_STARTED_EVENT,
7413
7416
  childStatus: SUBAGENT_CHILD_STATUS_EVENT,
7414
- processTerminal: SUBAGENT_PROCESS_TERMINAL_EVENT
7417
+ processTerminal: SUBAGENT_PROCESS_TERMINAL_EVENT,
7418
+ jobsChanged: SUBAGENT_JOBS_CHANGED_EVENT
7415
7419
  },
7416
7420
  session: sessionData(ctx)
7417
7421
  };
@@ -8567,7 +8571,7 @@ function registerSubagentExtension(pi) {
8567
8571
  const ctx = withLastUiContext((current) => current);
8568
8572
  if (!ctx) return;
8569
8573
  try {
8570
- const { openSubagentFleet } = await import("./chunk-G4GZD3OJ.js");
8574
+ const { openSubagentFleet } = await import("./chunk-TJQJ3MEA.js");
8571
8575
  await openSubagentFleet(ctx, state, { initialKey: itemKey, asyncDirRoot: DIRS.async, resultsDir: DIRS.results, fleetKeybindings: config.fleetKeybindings, inspectorPlugins: () => getInspectorPlugins(pi) });
8572
8576
  } catch (error) {
8573
8577
  if (isStaleExtensionContextError(error)) {
@@ -8763,7 +8767,7 @@ function registerSubagentExtension(pi) {
8763
8767
  let executor;
8764
8768
  let executorPromise;
8765
8769
  let executorModulePromise;
8766
- const loadExecutorModule = () => executorModulePromise ??= import("./chunk-QE4AGIMG.js");
8770
+ const loadExecutorModule = () => executorModulePromise ??= import("./chunk-LDMXJIA6.js");
8767
8771
  const getExecutor = () => {
8768
8772
  executorPromise ??= loadExecutorModule().then(({ createSubagentExecutor }) => {
8769
8773
  executor = createSubagentExecutor(executorDeps);
@@ -8777,7 +8781,7 @@ function registerSubagentExtension(pi) {
8777
8781
  modulePreloadTimer = setTimeout(() => {
8778
8782
  loadExecutorModule().catch(() => {
8779
8783
  });
8780
- if (fleetViewEnabled) import("./chunk-G4GZD3OJ.js").catch(() => {
8784
+ if (fleetViewEnabled) import("./chunk-TJQJ3MEA.js").catch(() => {
8781
8785
  });
8782
8786
  }, MODULE_PRELOAD_DELAY_MS);
8783
8787
  modulePreloadTimer.unref?.();
@@ -8800,7 +8804,7 @@ function registerSubagentExtension(pi) {
8800
8804
  );
8801
8805
  });
8802
8806
  const markedMessageTypes = /* @__PURE__ */ new Set([...SUBAGENT_MESSAGE_TYPES, "subagent-compaction-resume", SLASH_RESULT_TYPE, SLASH_TEXT_RESULT_TYPE, ADMIN_MESSAGE_TYPE]);
8803
- pi.on("context", (event) => {
8807
+ pi.on("context_with_system", (event) => {
8804
8808
  const messages = [];
8805
8809
  for (const message2 of event.messages) {
8806
8810
  if (message2.role !== "custom" || !markedMessageTypes.has(message2.customType)) {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  appendAgentRefinementOverlay
3
- } from "./chunk-PLCCBLPY.js";
3
+ } from "./chunk-Y3I6H6DV.js";
4
4
  import {
5
5
  buildAgentMemoryInjection,
6
6
  buildSkillInjection
7
- } from "./chunk-CIZQXJ5Q.js";
7
+ } from "./chunk-7F5SK2U3.js";
8
8
 
9
9
  // src/runs/shared/effective-system-prompt.ts
10
10
  function appendSection(prompt, section) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildWorkflowChatProgressRows
3
- } from "./chunk-FXUXCX2K.js";
3
+ } from "./chunk-4BW55BTL.js";
4
4
  import {
5
5
  aggregateStepStatus,
6
6
  contextModeBadge,
@@ -25,13 +25,13 @@ import {
25
25
  projectWorkflowChecklist,
26
26
  withCachedUiContext,
27
27
  workflowGraphStageNodes
28
- } from "./chunk-6XJB7PIX.js";
28
+ } from "./chunk-OOFW75PV.js";
29
29
  import {
30
30
  flatToLogicalStepIndex,
31
31
  formatWorkflowJsonPreview,
32
32
  hostStepReportName,
33
33
  hostStepVerdictLabel
34
- } from "./chunk-46XKCPJR.js";
34
+ } from "./chunk-5ESXK62X.js";
35
35
  import {
36
36
  snapshotExternalRuns
37
37
  } from "./chunk-UKG4V45O.js";
@@ -49,12 +49,12 @@ import {
49
49
  getSingleResultOutput,
50
50
  shortenPath,
51
51
  unresolvedChildWatchdogBlockers
52
- } from "./chunk-CIZQXJ5Q.js";
52
+ } from "./chunk-7F5SK2U3.js";
53
53
  import {
54
54
  MAX_WIDGET_JOBS,
55
55
  WIDGET_ANIMATION_INTERVAL_MS,
56
56
  WIDGET_KEY
57
- } from "./chunk-5LFLVSTM.js";
57
+ } from "./chunk-JEZOSEWG.js";
58
58
  import {
59
59
  previewDisplayText,
60
60
  sanitizeDisplayText,
@@ -15,6 +15,7 @@ var SUBAGENT_CONTROL_EVENT = "subagent:control-event";
15
15
  var SUBAGENT_CONTROL_INTERCOM_EVENT = "subagent:control-intercom";
16
16
  var SUBAGENT_STEERING_NOTICE_EVENT = "subagent:steering-notice";
17
17
  var SUBAGENT_CHILD_STATUS_EVENT = "subagent:child-status";
18
+ var SUBAGENT_JOBS_CHANGED_EVENT = "subagent:jobs-changed";
18
19
  var SUBAGENT_RESULT_INTERCOM_EVENT = "subagent:result-intercom";
19
20
  var SUBAGENT_RESULT_INTERCOM_DELIVERY_EVENT = "subagent:result-intercom-delivery";
20
21
  var FLEET_KEYBINDING_ACTIONS = [
@@ -223,6 +224,7 @@ export {
223
224
  SUBAGENT_CONTROL_INTERCOM_EVENT,
224
225
  SUBAGENT_STEERING_NOTICE_EVENT,
225
226
  SUBAGENT_CHILD_STATUS_EVENT,
227
+ SUBAGENT_JOBS_CHANGED_EVENT,
226
228
  SUBAGENT_RESULT_INTERCOM_EVENT,
227
229
  SUBAGENT_RESULT_INTERCOM_DELIVERY_EVENT,
228
230
  FLEET_KEYBINDING_ACTIONS,
@@ -8,7 +8,7 @@ import {
8
8
  validateCodeOwnedProfileRunner,
9
9
  validatePermissionRules,
10
10
  validateToolBudgetConfig
11
- } from "./chunk-CIZQXJ5Q.js";
11
+ } from "./chunk-7F5SK2U3.js";
12
12
 
13
13
  // src/agents/runtime-agent-registry.ts
14
14
  var RUNTIME_AGENT_REGISTRY_KEY = "pi-subagents.runtime-agents.v1";