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

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.
@@ -1744,7 +1744,7 @@ function readWorkflowPreferences(payload) {
1744
1744
  return preferences;
1745
1745
  }
1746
1746
  function resolvedModelSelection(taskInput, agentConfig, runtime, parentModel, availableModels, teamPackageModels, preferences) {
1747
- const parentModelId = isPiRuntime(runtime) && parentModel && availableModels !== void 0 ? `${parentModel.provider}/${parentModel.id}` : void 0;
1747
+ const parentModelId = isPiRuntime(runtime) && parentModel ? `${parentModel.provider}/${parentModel.id}` : void 0;
1748
1748
  const agentModels = [...agentConfig.modelSource?.scope === "package" ? [] : [agentConfig.model], ...agentConfig.fallbackModels ?? []];
1749
1749
  const candidates = (isPiRuntime(runtime) ? [
1750
1750
  taskInput.model,
@@ -4749,10 +4749,9 @@ function formatSpawnPlan(plan) {
4749
4749
  function scopeOf(value) {
4750
4750
  return value === "user" || value === "project" ? value : "both";
4751
4751
  }
4752
- function createHeadlessSubagentTool(runtime, execution) {
4753
- const scope = require_externalProcessIpc.createSessionScope(execution.sessionId);
4754
- const jobs = runtime.asyncJobTracker.forSession(execution.sessionId, scope);
4755
- const availableModels = execution.model ? [toModelInfo(execution.model)] : [];
4752
+ function createHeadlessSubagentTool(runtime, initialExecution) {
4753
+ const scope = require_externalProcessIpc.createSessionScope(initialExecution.sessionId);
4754
+ const jobs = runtime.asyncJobTracker.forSession(initialExecution.sessionId, scope);
4756
4755
  return {
4757
4756
  name: "subagent",
4758
4757
  label: "Subagent",
@@ -4761,9 +4760,10 @@ function createHeadlessSubagentTool(runtime, execution) {
4761
4760
  promptSnippet: "Discover, run, inspect, steer, stop, and restore persistent subagents",
4762
4761
  promptGuidelines: ["Runs are persistent background work. Do not resubmit a run that already returned an id.", "Use status or suspended before retrying a failed or interrupted operation."],
4763
4762
  executionMode: "serial",
4764
- async execute(_toolCallId, parameters, signal, onUpdate) {
4763
+ async execute(_toolCallId, parameters, signal, onUpdate, execution = initialExecution) {
4765
4764
  try {
4766
4765
  const params = validateParams(parameters);
4766
+ const availableModels = execution.getAvailableModels?.().map(toModelInfo) ?? (execution.model ? [toModelInfo(execution.model)] : []);
4767
4767
  if (params.action === require_subagentTool.SUBAGENT_ACTIONS.agents) {
4768
4768
  const scope = scopeOf(params.scope);
4769
4769
  const agents = runtime.discovery.discover(params.cwd ?? execution.cwd, scope).agents;
@@ -6335,7 +6335,12 @@ const root = (0, _agimon_ai_po_core_extensionFile.defineRoot)(({ context, host:
6335
6335
  if (serverHost.context.environment === void 0) throw new Error("Team headless facet requires an admitted session environment.");
6336
6336
  const directEvents = serverHost.context.directEvents;
6337
6337
  if (directEvents === void 0) throw new Error("Team headless facet requires host-owned direct events.");
6338
- const execution = host.context;
6338
+ const execution = {
6339
+ ...host.context,
6340
+ get model() {
6341
+ return host.context.model;
6342
+ }
6343
+ };
6339
6344
  const sessionPeers = /* @__PURE__ */ new Set();
6340
6345
  const stopPeerDiscovery = serverHost.context.sessionCommunication?.onPeerReady((id) => sessionPeers.add(id));
6341
6346
  const telemetry = (0, _agimon_ai_po_telemetry.createDoomTelemetry)({
@@ -6439,15 +6444,18 @@ const root = (0, _agimon_ai_po_core_extensionFile.defineRoot)(({ context, host:
6439
6444
  });
6440
6445
  const serverService = (ctx) => {
6441
6446
  ctx.plugin((providerContext) => {
6442
- const availableModels = execution.getAvailableModels?.().map(toModelInfo) ?? (execution.model ? [toModelInfo(execution.model)] : []);
6443
6447
  providerContext.plugin(teamCollaborationPlugin, {
6444
6448
  session: {
6445
6449
  sessionId: execution.sessionId,
6446
6450
  sessionScope: scope,
6447
6451
  cwd: execution.cwd,
6448
6452
  environment: serverHost.context.environment,
6449
- availableModels,
6450
- ...execution.model ? { parentModel: execution.model } : {},
6453
+ get availableModels() {
6454
+ return execution.getAvailableModels?.().map(toModelInfo) ?? (execution.model ? [toModelInfo(execution.model)] : []);
6455
+ },
6456
+ get parentModel() {
6457
+ return execution.model;
6458
+ },
6451
6459
  captureForkSource: () => execution.session.forkSource?.()
6452
6460
  },
6453
6461
  directRunTracker: runtime.asyncJobTracker,