@ycodium-ai/agent-claude 0.2.2143 → 0.2.2169

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 (2) hide show
  1. package/dist/index.js +34 -13
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -73,7 +73,9 @@ var CLAUDE_CARD = {
73
73
  // SDK 的 `setPermissionMode` 会话中途就能改,所以这一位也是真的。
74
74
  nativeModeSwitch: true,
75
75
  contextCompaction: "native",
76
- turnSteering: true
76
+ turnSteering: true,
77
+ // 子代理、workflow 与其成员经 SDK 的 task_* 系统消息报成 task.*(claudeInstance.ts)。
78
+ reportsSpawnedAgents: true
77
79
  },
78
80
  credentialSources: [
79
81
  {
@@ -21690,6 +21692,11 @@ function compactBoundaryTokenUsageSnapshot(message, contextWindow, totalProcesse
21690
21692
  }
21691
21693
 
21692
21694
  // src/taskProgress.ts
21695
+ function claudeTaskRosterKind(input) {
21696
+ if (input.taskType === "local_workflow") return "workflow";
21697
+ if (input.subagentType !== void 0 && input.subagentType.trim().length > 0) return "subagent";
21698
+ return void 0;
21699
+ }
21693
21700
  var PENDING_TASK_MODEL_CAP = 64;
21694
21701
  function rememberPendingTaskModel(pending, parentToolUseId, model) {
21695
21702
  pending.set(parentToolUseId, model);
@@ -21851,7 +21858,8 @@ function taskLinkageFor(agents, taskId) {
21851
21858
  ...agent.effort ? { effort: agent.effort } : {},
21852
21859
  ...agent.toolUseId ? { toolUseId: agent.toolUseId } : {},
21853
21860
  ...agent.workflowName ? { workflowName: agent.workflowName } : {},
21854
- ...agent.runHandles ? { runHandles: agent.runHandles } : {}
21861
+ ...agent.runHandles ? { runHandles: agent.runHandles } : {},
21862
+ ...agent.rosterKind ? { rosterKind: agent.rosterKind } : {}
21855
21863
  };
21856
21864
  }
21857
21865
  var WORKFLOW_PHASE_CAP = 64;
@@ -24023,18 +24031,20 @@ function createClaudeAdapter(recipe, host, options) {
24023
24031
  ...sessionUrl === void 0 ? {} : { sessionUrl }
24024
24032
  };
24025
24033
  const existing = context.taskAgents.get(workflowTaskId);
24034
+ const taskType = existing?.taskType ?? "local_workflow";
24026
24035
  context.taskAgents.set(workflowTaskId, {
24027
24036
  taskId: workflowTaskId,
24028
24037
  toolUseId: existing?.toolUseId ?? tool.itemId,
24029
24038
  description: existing?.description,
24030
24039
  subagentType: existing?.subagentType,
24031
- taskType: existing?.taskType ?? "local_workflow",
24040
+ taskType,
24032
24041
  workflowName: existing?.workflowName,
24033
24042
  skipTranscript: existing?.skipTranscript ?? false,
24034
24043
  runHandles,
24035
24044
  owningAgentId: existing?.owningAgentId,
24036
24045
  model: existing?.model,
24037
- effort: existing?.effort
24046
+ effort: existing?.effort,
24047
+ rosterKind: claudeTaskRosterKind({ taskType, subagentType: existing?.subagentType })
24038
24048
  });
24039
24049
  }
24040
24050
  }
@@ -24172,7 +24182,8 @@ function createClaudeAdapter(recipe, host, options) {
24172
24182
  ...entry.phaseIndex !== void 0 ? { phaseIndex: entry.phaseIndex } : {},
24173
24183
  ...entry.phaseTitle ? { phaseTitle: entry.phaseTitle } : {},
24174
24184
  ...entry.attempt !== void 0 ? { attempt: entry.attempt } : {},
24175
- timelineBypass: true
24185
+ timelineBypass: true,
24186
+ rosterKind: "workflow_member"
24176
24187
  }
24177
24188
  });
24178
24189
  }
@@ -24330,6 +24341,10 @@ function createClaudeAdapter(recipe, host, options) {
24330
24341
  const model = bufferedModel ?? trimmedString(launchInput?.model) ?? trimmedString(context.session.model ?? void 0);
24331
24342
  const rawLaunchEffort = launchInput?.effort;
24332
24343
  const effort = trimmedString(rawLaunchEffort) ?? (typeof rawLaunchEffort === "number" && Number.isFinite(rawLaunchEffort) ? String(rawLaunchEffort) : context.currentEffort);
24344
+ const rosterKind = claudeTaskRosterKind({
24345
+ taskType: message.task_type,
24346
+ subagentType: message.subagent_type
24347
+ });
24333
24348
  context.taskAgents.set(message.task_id, {
24334
24349
  taskId: message.task_id,
24335
24350
  toolUseId: message.tool_use_id,
@@ -24341,7 +24356,8 @@ function createClaudeAdapter(recipe, host, options) {
24341
24356
  runHandles: context.taskAgents.get(message.task_id)?.runHandles,
24342
24357
  owningAgentId,
24343
24358
  model,
24344
- effort
24359
+ effort,
24360
+ rosterKind
24345
24361
  });
24346
24362
  context.liveTaskIds.add(message.task_id);
24347
24363
  offerRuntimeEvent(context, {
@@ -24357,7 +24373,8 @@ function createClaudeAdapter(recipe, host, options) {
24357
24373
  ...model ? { model } : {},
24358
24374
  ...effort ? { effort } : {},
24359
24375
  ...message.tool_use_id ? { toolUseId: message.tool_use_id } : {},
24360
- ...message.workflow_name ? { workflowName: message.workflow_name } : {}
24376
+ ...message.workflow_name ? { workflowName: message.workflow_name } : {},
24377
+ ...rosterKind ? { rosterKind } : {}
24361
24378
  }
24362
24379
  });
24363
24380
  return;
@@ -24681,8 +24698,8 @@ function createClaudeAdapter(recipe, host, options) {
24681
24698
  });
24682
24699
  };
24683
24700
  const stopSessionInternal = async (context, stopOptions) => {
24684
- if (context.stopping) {
24685
- if (context.stopWork) await context.stopWork;
24701
+ if (context.stopWork) {
24702
+ await context.stopWork;
24686
24703
  return;
24687
24704
  }
24688
24705
  if (context.stopped) return;
@@ -25627,9 +25644,7 @@ function createClaudeAdapter(recipe, host, options) {
25627
25644
  };
25628
25645
  const stopSession = async (threadId) => {
25629
25646
  const context = sessions.get(threadId);
25630
- if (!context) {
25631
- throw new Error(`Claude session not found: ${threadId}`);
25632
- }
25647
+ if (!context) return;
25633
25648
  await stopSessionInternal(context, { emitExitEvent: true });
25634
25649
  };
25635
25650
  return {
@@ -25645,9 +25660,15 @@ function createClaudeAdapter(recipe, host, options) {
25645
25660
  stopSession,
25646
25661
  events: runtimeEventQueue,
25647
25662
  dispose: async () => {
25648
- await Promise.allSettled(
25663
+ const results = await Promise.allSettled(
25649
25664
  [...sessions.values()].map((ctx) => stopSessionInternal(ctx, { emitExitEvent: false }))
25650
25665
  );
25666
+ const failures = results.flatMap(
25667
+ (result) => result.status === "rejected" ? [result.reason] : []
25668
+ );
25669
+ if (failures.length > 0) {
25670
+ throw new AggregateError(failures, "Failed to stop Claude runtime sessions.");
25671
+ }
25651
25672
  runtimeEventQueue.close();
25652
25673
  }
25653
25674
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-claude",
3
- "version": "0.2.2143",
3
+ "version": "0.2.2169",
4
4
  "description": "Claude executor: Claude Code CLI via @anthropic-ai/claude-agent-sdk.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -23,7 +23,7 @@
23
23
  "@types/node": "24.12.4",
24
24
  "esbuild": "0.28.1",
25
25
  "vite-plus": "0.2.2",
26
- "@ycodium-ai/plugin-api": "0.2.2143"
26
+ "@ycodium-ai/plugin-api": "0.2.2169"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",