@codexhost/cli-linux-arm64 0.18.0 → 0.20.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 (67) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +83 -5
  4. package/app/console-web.js +1172 -687
  5. package/app/desktop-controller.mjs +314 -15
  6. package/app/host-runtime.mjs +13158 -2853
  7. package/app/plugins/antigravity/plugin.mjs +8861 -3944
  8. package/app/plugins/claude-code/plugin.mjs +164 -14
  9. package/app/plugins/codebuddy/plugin.mjs +193 -25
  10. package/app/plugins/codex-usage/plugin.mjs +85 -5
  11. package/app/plugins/copilot/plugin.mjs +85 -5
  12. package/app/plugins/cursor-cli/plugin.mjs +160 -15
  13. package/app/plugins/deepseek-harness/manifest.json +2 -2
  14. package/app/plugins/deepseek-harness/plugin.mjs +112 -10
  15. package/app/plugins/devin/plugin.mjs +84 -5
  16. package/app/plugins/grok/plugin.mjs +418 -272
  17. package/app/plugins/hermes/plugin.mjs +163 -17
  18. package/app/plugins/kimi-code/plugin.mjs +85 -5
  19. package/app/plugins/kiro-cli/plugin.mjs +313 -21
  20. package/app/plugins/omp/plugin.mjs +1018 -819
  21. package/app/plugins/opencode/plugin.mjs +85 -5
  22. package/app/plugins/pi/plugin.mjs +828 -663
  23. package/app/plugins/qoder/plugin.mjs +109 -10
  24. package/app/plugins/qoder-cn/plugin.mjs +109 -10
  25. package/app/plugins/qwen-code/plugin.mjs +194 -97
  26. package/app/plugins/workbuddy/plugin.mjs +197 -28
  27. package/app/plugins/zcode/plugin.mjs +158 -8
  28. package/app/renderer-extension.js +2065 -1004
  29. package/app/web/assets/index-D6-hvggd.css +1 -0
  30. package/app/web/assets/index-D85gPBbQ.js +201 -0
  31. package/app/web/assets/langs/{graphql-B8vkg11W.js → graphql-ChAeyPkT.js} +1 -1
  32. package/app/web/assets/langs/{http-DmoDEjMt.js → http-BvreBIbD.js} +1 -1
  33. package/app/web/assets/langs/{php-DJ5ovfAM.js → php-D8omCIuJ.js} +1 -1
  34. package/app/web/assets/langs/{rst-U5-R5x3p.js → rst-Do7RLLCS.js} +1 -1
  35. package/app/web/assets/langs/{ruby-VKVsnS0H.js → ruby-rH_O_vse.js} +1 -1
  36. package/app/web/assets/langs/{svelte-C20lOv9V.js → svelte-xZy73wAj.js} +1 -1
  37. package/app/web/assets/langs/{vue-z6Y-lzP-.js → vue-C4DW8agZ.js} +1 -1
  38. package/app/web/assets/{vendor-dSL872WO.js → vendor-C9g2bw8s.js} +3 -3
  39. package/app/web/codexhost-settings.js +1178 -689
  40. package/app/web/index.html +4 -3
  41. package/app/web/plugins/deepseek-ai__dsh-api-gateway/client.js +2 -2
  42. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
  43. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
  44. package/app/web/plugins/deepseek-ai__dsh-client-connection/client.js +1 -1
  45. package/app/web/plugins/deepseek-ai__dsh-client-file-upload/client.js +1 -1
  46. package/app/web/plugins/deepseek-ai__dsh-client-locale/client.js +3 -3
  47. package/app/web/plugins/deepseek-ai__dsh-client-ui-attachment/client.js +1 -1
  48. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +134 -8
  49. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +65 -63
  50. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +95 -93
  51. package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
  52. package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
  53. package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +1 -1
  54. package/app/web/plugins/deepseek-ai__dsh-client-ui-session/client.js +1 -1
  55. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
  56. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.excel.js +1 -1
  57. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
  58. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
  59. package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +1 -1
  60. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +11 -11
  61. package/app/web-modules/server.mjs +2468 -1575
  62. package/bin/codexhost +0 -0
  63. package/libexec/codexhost-shim +0 -0
  64. package/libexec/codexhost-updater +0 -0
  65. package/package.json +1 -1
  66. package/app/web/assets/index-C0aXz2jD.js +0 -199
  67. package/app/web/assets/index-C3lniEH1.css +0 -1
@@ -347,10 +347,6 @@ function createHarnessInstaller(environment, source) {
347
347
  };
348
348
  }
349
349
 
350
- // dist/kiro-adapter.js
351
- import { randomUUID } from "node:crypto";
352
- import path8 from "node:path";
353
-
354
350
  // ../../../node_modules/zod/v4/classic/external.js
355
351
  var external_exports = {};
356
352
  __export(external_exports, {
@@ -15002,13 +14998,25 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
15002
14998
  var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
15003
14999
  var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
15004
15000
  var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
15001
+ var usageOutputTimingSchema = external_exports.object({
15002
+ version: external_exports.literal(3).optional(),
15003
+ requestId: external_exports.string().min(1),
15004
+ turnId: external_exports.string().min(1).max(1024),
15005
+ outputTokens: nonNegativeSafeIntegerSchema,
15006
+ startedAtMs: nonNegativeSafeIntegerSchema,
15007
+ completedAtMs: nonNegativeSafeIntegerSchema
15008
+ }).strict().refine((value) => value.completedAtMs > value.startedAtMs);
15005
15009
  var usageMeasurementSchema = external_exports.object({
15010
+ version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
15006
15011
  value: finiteNonNegativeNumberSchema,
15007
15012
  turnId: external_exports.string().min(1).max(1024),
15008
15013
  at: nonNegativeSafeIntegerSchema
15009
15014
  }).strict();
15010
15015
  var usageMeasurementsSchema = external_exports.object({
15011
- outputTokensPerSecond: usageMeasurementSchema.optional(),
15016
+ // Unversioned intervals can omit hidden thinking time; do not restore them into averages.
15017
+ outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 3)).optional(),
15018
+ // Retain independent TTFT facts when dropping incompatible speed measurements.
15019
+ outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 3).optional().catch(void 0),
15012
15020
  timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
15013
15021
  }).strict();
15014
15022
  var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
@@ -15028,6 +15036,7 @@ var threadUsageSnapshotSchema = external_exports.object({
15028
15036
  cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
15029
15037
  outputTokens: nonNegativeSafeIntegerSchema.optional(),
15030
15038
  outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
15039
+ sessionOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
15031
15040
  apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
15032
15041
  reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
15033
15042
  totalTokens: nonNegativeSafeIntegerSchema.optional(),
@@ -15439,11 +15448,19 @@ var threadSteeringInspectResultSchema = external_exports.object({
15439
15448
  delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
15440
15449
  }).strict();
15441
15450
 
15451
+ // ../../shared-contracts/dist/thread-archive-confirm.js
15452
+ var threadArchiveConfirmParamsSchema = external_exports.object({ threadId: hostThreadIdSchema }).strict();
15453
+ var threadArchiveConfirmResultSchema = external_exports.object({ confirmed: external_exports.boolean() }).strict();
15454
+
15442
15455
  // ../../shared-contracts/dist/client-channel.js
15443
15456
  var CLIENT_CHANNEL_VERSION = 1;
15444
15457
  var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
15445
15458
  var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
15446
15459
  var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
15460
+ var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
15461
+ var clientThreadTreeSchema = external_exports.object({
15462
+ parents: external_exports.record(external_exports.string().min(1), external_exports.string().min(1))
15463
+ }).strict();
15447
15464
  var clientProjectlessWorkspaceSchema = external_exports.object({
15448
15465
  prompt: external_exports.string().max(16384).optional()
15449
15466
  }).strict();
@@ -15460,6 +15477,11 @@ var clientChannelCursorSchema = external_exports.object({
15460
15477
  sequence: external_exports.number().int().nonnegative()
15461
15478
  });
15462
15479
  var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
15480
+ external_exports.object({
15481
+ type: external_exports.literal("skills-changed"),
15482
+ cursor: clientChannelCursorSchema,
15483
+ cwd: external_exports.string().optional()
15484
+ }),
15463
15485
  external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
15464
15486
  external_exports.object({
15465
15487
  type: external_exports.literal("preferences-changed"),
@@ -15569,7 +15591,12 @@ var clientThreadSnapshotSchema = external_exports.object({
15569
15591
  /** Current interruptible Host Turn, including command Turns omitted from client history. */
15570
15592
  activeTurnId: external_exports.string().min(1).nullable().optional(),
15571
15593
  /** Most recent explicit command in this Host process; not native conversation history. */
15572
- command: external_exports.object({ name: external_exports.string().min(1), turn: clientTurnSchema }).optional(),
15594
+ command: external_exports.object({
15595
+ name: external_exports.string().min(1),
15596
+ turn: clientTurnSchema,
15597
+ /** First ordinary Turn started after this command; its retained result is not a new event. */
15598
+ subsequentTurnId: external_exports.string().min(1).optional()
15599
+ }).optional(),
15573
15600
  thread: external_exports.object({
15574
15601
  id: external_exports.string().min(1),
15575
15602
  cwd: external_exports.string(),
@@ -15657,6 +15684,28 @@ var voiceTranscribeResultSchema = external_exports.discriminatedUnion("ok", [
15657
15684
  external_exports.object({ ok: external_exports.literal(false), error: external_exports.object({ code: voiceErrorCodeSchema }).strict() }).strict()
15658
15685
  ]);
15659
15686
 
15687
+ // ../../shared-contracts/dist/skills.js
15688
+ var skillsListParamsSchema = external_exports.object({
15689
+ threadId: hostThreadIdSchema.optional(),
15690
+ cwd: external_exports.string().min(1).optional()
15691
+ }).strict().refine((params) => !(params.threadId && params.cwd), {
15692
+ message: "Specify threadId or cwd, not both"
15693
+ });
15694
+ var librarySkillSchema = external_exports.object({
15695
+ name: external_exports.string().min(1).regex(/^[^\s[\]]+$/u),
15696
+ description: external_exports.string().optional(),
15697
+ path: external_exports.string().min(1),
15698
+ scope: external_exports.enum(["project", "global"]),
15699
+ source: external_exports.string().min(1)
15700
+ }).strict();
15701
+ var skillsListResultSchema = external_exports.object({
15702
+ revision: external_exports.number().int().nonnegative(),
15703
+ complete: external_exports.boolean(),
15704
+ skills: external_exports.array(librarySkillSchema),
15705
+ warnings: external_exports.array(external_exports.string()).optional()
15706
+ }).strict();
15707
+ var skillsChangedParamsSchema = external_exports.object({ cwd: external_exports.string().min(1).optional() }).strict();
15708
+
15660
15709
  // ../../shared-contracts/dist/web-access-tokens.js
15661
15710
  var webNetworkAccessUrlSchema = external_exports.object({
15662
15711
  /**
@@ -15755,15 +15804,14 @@ var webAccessStateSchema = external_exports.object({
15755
15804
  quotaUntil: external_exports.string().optional()
15756
15805
  }).strict().optional()
15757
15806
  }).strict();
15758
- var webLocalAccessRequiredDetailsSchema = external_exports.object({ url: external_exports.string() }).strict();
15759
15807
 
15760
15808
  // ../../shared-contracts/dist/delegation-read.js
15761
15809
  var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
15762
15810
  var delegationReadParamsSchema = external_exports.strictObject({
15763
15811
  threadId: external_exports.string().min(1).max(1024),
15764
15812
  view: external_exports.enum(["result", "messages"]),
15765
- cursor: external_exports.string().min(1).max(8192).optional(),
15766
- limit: external_exports.number().int().min(1).max(100).optional()
15813
+ from: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),
15814
+ to: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional()
15767
15815
  });
15768
15816
 
15769
15817
  // ../../shared-contracts/dist/credential-imports.js
@@ -16716,6 +16764,17 @@ var updateStatusResultSchema = external_exports.strictObject({
16716
16764
  status: updateStatusSchema.nullable()
16717
16765
  });
16718
16766
 
16767
+ // ../../shared-contracts/dist/thread-watch-notice.js
16768
+ var THREAD_WATCH_NOTICE_OUTCOMES = [
16769
+ "completed",
16770
+ "failed",
16771
+ "interrupted",
16772
+ "timedOut",
16773
+ "unreadable",
16774
+ "notFound"
16775
+ ];
16776
+ var ENTRY_PATTERN = new RegExp(String.raw`^- \[([^\]\n]+)\]\(thread://([^\s()<>"?#/]+)\): ` + `(${THREAD_WATCH_NOTICE_OUTCOMES.join("|")})(?:. (.+))?$`, "u");
16777
+
16719
16778
  // ../../shared-contracts/dist/remote-runtime.js
16720
16779
  var remoteUpdatePhaseSchema = external_exports.enum([
16721
16780
  "idle",
@@ -16763,6 +16822,14 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
16763
16822
  archived: external_exports.boolean()
16764
16823
  }),
16765
16824
  external_exports.strictObject({ kind: external_exports.literal("read"), ...thread }),
16825
+ external_exports.strictObject({
16826
+ kind: external_exports.literal("configure"),
16827
+ ...thread,
16828
+ epoch: identity,
16829
+ modelId: identity.optional(),
16830
+ thinkingOptionId: identity.optional(),
16831
+ permissionModeId: identity.optional()
16832
+ }).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting"),
16766
16833
  external_exports.strictObject({
16767
16834
  kind: external_exports.literal("prompt"),
16768
16835
  ...thread,
@@ -16835,6 +16902,13 @@ var remoteConnectionsReplySchema = external_exports.union([
16835
16902
  external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
16836
16903
  ]);
16837
16904
 
16905
+ // ../../shared-contracts/dist/thread-title.js
16906
+ var threadTitleInputSchema = external_exports.strictObject({
16907
+ prompt: external_exports.string().trim().min(1).max(2e3),
16908
+ cwd: external_exports.string().max(4096).nullable()
16909
+ });
16910
+ var threadTitleResultSchema = external_exports.string().trim().min(1).max(60).nullable();
16911
+
16838
16912
  // ../../shared-contracts/dist/web-ui-extensions.js
16839
16913
  var webUiExtensionIdSchema = external_exports.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u);
16840
16914
  var localizedTextSchema2 = external_exports.union([
@@ -16878,6 +16952,47 @@ var webUiExtensionRemoveSchema = external_exports.object({ id: webUiExtensionIdS
16878
16952
  // ../../shared-contracts/dist/index.js
16879
16953
  var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
16880
16954
 
16955
+ // dist/subagents.js
16956
+ function kiroChildSnapshot(parentId, item, childId) {
16957
+ const child = item.subagents.find((child2) => child2.nativeSubagentId === childId);
16958
+ if (!child)
16959
+ throw new Error("Kiro task does not belong to this parent");
16960
+ return {
16961
+ turns: [
16962
+ {
16963
+ nativeTurnRef: nativeTurnRefSchema.parse({
16964
+ harnessId: "kiro-cli",
16965
+ nativeSessionId: parentId,
16966
+ nativeTurnKey: childId,
16967
+ formatVersion: 1
16968
+ }),
16969
+ input: item.prompt ? [{ type: "text", text: item.prompt }] : [],
16970
+ items: child.resultSummary ? [
16971
+ {
16972
+ item: {
16973
+ type: "agentMessage",
16974
+ itemId: hostItemIdSchema.parse(`kiro-task-result-${childId}`),
16975
+ text: child.resultSummary
16976
+ },
16977
+ outcome: { status: "succeeded" }
16978
+ }
16979
+ ] : [],
16980
+ outcome: child.status === "pending" || child.status === "running" ? {
16981
+ status: "unknown",
16982
+ reason: "Kiro ACP exposes task summaries, not the child's internal step stream"
16983
+ } : child.status === "interrupted" ? { status: "cancelled" } : child.status === "failed" ? {
16984
+ status: "failed",
16985
+ error: {
16986
+ code: "nativeFailure",
16987
+ message: child.resultSummary || "Kiro task failed",
16988
+ retryable: false
16989
+ }
16990
+ } : { status: "succeeded" }
16991
+ }
16992
+ ]
16993
+ };
16994
+ }
16995
+
16881
16996
  // ../../harness-adapter/dist/approval.js
16882
16997
  function invalidRequest(message) {
16883
16998
  return { code: "invalidRequest", message, retryable: false };
@@ -17024,6 +17139,7 @@ var usageFields = /* @__PURE__ */ new Set([
17024
17139
  "totalCredits",
17025
17140
  "contextUsagePercent",
17026
17141
  "outputTokensPerSecond",
17142
+ "sessionOutputTokensPerSecond",
17027
17143
  "apiOutputTokensPerSecond",
17028
17144
  "costSource",
17029
17145
  "unpricedModels"
@@ -17046,6 +17162,7 @@ function parseHostUsage(value) {
17046
17162
  for (const field2 of [
17047
17163
  "totalCredits",
17048
17164
  "contextUsagePercent",
17165
+ "sessionOutputTokensPerSecond",
17049
17166
  "apiOutputTokensPerSecond"
17050
17167
  ]) {
17051
17168
  const candidate = value[field2];
@@ -17200,14 +17317,12 @@ var COMMON_EXCLUDED_LIVE_COMMANDS = /* @__PURE__ */ new Set([
17200
17317
  "reload-plugins"
17201
17318
  ]);
17202
17319
  var COMMON_EXCLUDED_LIVE_COMMAND_PREFIXES = ["__", "hooks-"];
17203
- function isExcludedLiveCommand(name, kind, extra = {}) {
17320
+ function isExcludedLiveCommand(name, extra = {}) {
17204
17321
  const normalized = name.trim().replace(/^\//u, "");
17205
17322
  if (new Set(extra.names ?? []).has(normalized))
17206
17323
  return true;
17207
17324
  if (extra.prefixes?.some((prefix) => normalized.startsWith(prefix)))
17208
17325
  return true;
17209
- if (kind === "skill")
17210
- return false;
17211
17326
  return COMMON_EXCLUDED_LIVE_COMMANDS.has(normalized) || COMMON_EXCLUDED_LIVE_COMMAND_PREFIXES.some((prefix) => normalized.startsWith(prefix));
17212
17327
  }
17213
17328
  function liveHarnessCommandPrompt(catalog, idPrefix, commandId, argumentText) {
@@ -17229,7 +17344,7 @@ function mergeLiveHarnessCommands(builtIns, idPrefix, live, exclusions = {}) {
17229
17344
  const name = command.name.trim().replace(/^\//u, "");
17230
17345
  if (!name || /\s/u.test(name))
17231
17346
  continue;
17232
- if (isExcludedLiveCommand(name, command.kind, exclusions))
17347
+ if (isExcludedLiveCommand(name, exclusions))
17233
17348
  continue;
17234
17349
  const invocation = `/${name}`;
17235
17350
  const id = `${idPrefix}${name.replace(/[^A-Za-z0-9._:-]/gu, "-")}`.slice(0, 128);
@@ -17241,8 +17356,7 @@ function mergeLiveHarnessCommands(builtIns, idPrefix, live, exclusions = {}) {
17241
17356
  invocation,
17242
17357
  label: name.slice(0, 128),
17243
17358
  ...description ? { description } : {},
17244
- argumentMode: "text",
17245
- kind: command.kind
17359
+ argumentMode: "text"
17246
17360
  });
17247
17361
  if (!parsed.success)
17248
17362
  continue;
@@ -17253,6 +17367,64 @@ function mergeLiveHarnessCommands(builtIns, idPrefix, live, exclusions = {}) {
17253
17367
  return harnessCommandCatalogSchema.parse({ commands: [...builtIns.commands, ...dynamic] });
17254
17368
  }
17255
17369
 
17370
+ // ../../harness-adapter/dist/subagent-configuration.js
17371
+ function subagentConfiguration(value) {
17372
+ if (typeof value !== "object" || value === null || Array.isArray(value))
17373
+ return {};
17374
+ const row = value;
17375
+ const text = (value2) => typeof value2 === "string" && value2.trim() ? value2 : void 0;
17376
+ const model2 = row.model === "inherit" ? void 0 : text(row.model);
17377
+ const reasoningEffort = text(row.reasoningEffort) ?? text(row.reasoning_effort) ?? text(row.thinking);
17378
+ return { ...model2 ? { model: model2 } : {}, ...reasoningEffort ? { reasoningEffort } : {} };
17379
+ }
17380
+ function inheritSubagentConfiguration(child, parent) {
17381
+ const native = subagentConfiguration(child);
17382
+ const model2 = native.model ?? parent.model;
17383
+ const reasoningEffort = native.reasoningEffort ?? parent.reasoningEffort;
17384
+ const next = { ...child };
17385
+ delete next.model;
17386
+ delete next.reasoningEffort;
17387
+ return { ...next, ...model2 ? { model: model2 } : {}, ...reasoningEffort ? { reasoningEffort } : {} };
17388
+ }
17389
+ function configureSubagentEvent(event, parent) {
17390
+ const children = (states) => states.map((child) => inheritSubagentConfiguration(child, parent));
17391
+ if (event.type === "item.started" && event.item.type === "subagentDelegation")
17392
+ return { ...event, item: { ...event.item, subagents: children(event.item.subagents) } };
17393
+ if (event.type === "item.updated" && event.update.type === "subagents.replace")
17394
+ return { ...event, update: { ...event.update, subagents: children(event.update.subagents) } };
17395
+ if (event.type === "item.completed" && event.snapshot.item.type === "subagentDelegation")
17396
+ return {
17397
+ ...event,
17398
+ snapshot: {
17399
+ ...event.snapshot,
17400
+ item: {
17401
+ ...event.snapshot.item,
17402
+ subagents: children(event.snapshot.item.subagents)
17403
+ }
17404
+ }
17405
+ };
17406
+ return event;
17407
+ }
17408
+ function configureSubagentSnapshot(snapshot, parent) {
17409
+ return {
17410
+ ...snapshot,
17411
+ turns: snapshot.turns.map((turn) => ({
17412
+ ...turn,
17413
+ items: turn.items.map((entry) => entry.item.type === "subagentDelegation" ? {
17414
+ ...entry,
17415
+ item: {
17416
+ ...entry.item,
17417
+ subagents: entry.item.subagents.map((child) => inheritSubagentConfiguration(child, parent))
17418
+ }
17419
+ } : entry)
17420
+ }))
17421
+ };
17422
+ }
17423
+
17424
+ // dist/kiro-adapter.js
17425
+ import { randomUUID } from "node:crypto";
17426
+ import path8 from "node:path";
17427
+
17256
17428
  // dist/acp-transport.js
17257
17429
  import { spawn, spawnSync } from "node:child_process";
17258
17430
  import { Readable, Writable } from "node:stream";
@@ -21446,10 +21618,9 @@ function parseKiroAvailableCommands(value) {
21446
21618
  });
21447
21619
  }
21448
21620
  function kiroLiveCommands(native) {
21449
- return native.map((command) => ({
21621
+ return native.filter((command) => command.type !== "skill").map((command) => ({
21450
21622
  name: command.name,
21451
- description: command.description,
21452
- kind: command.type === "skill" ? "skill" : "command"
21623
+ description: command.description
21453
21624
  }));
21454
21625
  }
21455
21626
 
@@ -23067,9 +23238,12 @@ function projectKiroToolCall(itemId, toolCall) {
23067
23238
  const input = isRecord8(toolCall.rawInput) ? toolCall.rawInput : {};
23068
23239
  const subagentState = {
23069
23240
  subagentId: subtaskId,
23241
+ nativeSubagentId: subtaskId,
23070
23242
  description: typeof input.prompt === "string" ? input.prompt : "Subagent task",
23243
+ ...subagentConfiguration(input),
23244
+ ...subagentConfiguration(kiroMeta),
23071
23245
  background: false,
23072
- status: toolCall.status === "completed" ? "completed" : toolCall.status === "failed" ? "failed" : "running",
23246
+ status: toolCall.status === "pending" ? "pending" : toolCall.status === "completed" ? "completed" : toolCall.status === "failed" ? "failed" : "running",
23073
23247
  ...typeof input.name === "string" ? { role: input.name } : {},
23074
23248
  ...typeof toolCall.rawOutput === "string" ? { resultSummary: toolCall.rawOutput } : {}
23075
23249
  };
@@ -23077,6 +23251,7 @@ function projectKiroToolCall(itemId, toolCall) {
23077
23251
  type: "subagentDelegation",
23078
23252
  itemId: hostItemId,
23079
23253
  operation: "spawn",
23254
+ ...typeof input.prompt === "string" ? { prompt: input.prompt } : {},
23080
23255
  subagents: [subagentState]
23081
23256
  };
23082
23257
  return subagentItem;
@@ -23200,6 +23375,15 @@ var KiroTurnOutput = class {
23200
23375
  this.emit({ kind: "event", event: { type: "item.started", turnId: this.turnId, item } });
23201
23376
  }
23202
23377
  #complete(item, outcome) {
23378
+ if (item.type === "subagentDelegation") {
23379
+ item = {
23380
+ ...item,
23381
+ subagents: item.subagents.map((child) => ({
23382
+ ...child,
23383
+ status: outcome.status === "cancelled" ? "interrupted" : outcome.status === "failed" ? "failed" : child.status
23384
+ }))
23385
+ };
23386
+ }
23203
23387
  this.emit({
23204
23388
  kind: "event",
23205
23389
  event: {
@@ -23208,6 +23392,26 @@ var KiroTurnOutput = class {
23208
23392
  snapshot: { item, outcome }
23209
23393
  }
23210
23394
  });
23395
+ if (item.type === "subagentDelegation") {
23396
+ for (const child of item.subagents)
23397
+ if (child.nativeSubagentId) {
23398
+ this.emit({
23399
+ kind: "event",
23400
+ event: {
23401
+ type: "subagent.state.changed",
23402
+ nativeSubagentId: child.nativeSubagentId,
23403
+ status: child.status
23404
+ }
23405
+ });
23406
+ this.emit({
23407
+ kind: "event",
23408
+ event: {
23409
+ type: "subagent.transcript.changed",
23410
+ nativeSubagentId: child.nativeSubagentId
23411
+ }
23412
+ });
23413
+ }
23414
+ }
23211
23415
  }
23212
23416
  #completeMessage(outcome, phase) {
23213
23417
  this.#appendText(this.#text.finish());
@@ -23303,6 +23507,17 @@ var KiroTurnOutput = class {
23303
23507
  const tool = { ...previous, event: merged, item, done };
23304
23508
  this.#tools.set(event.callId, tool);
23305
23509
  if (!done) {
23510
+ if (previous?.item.type === "subagentDelegation" && item.type === "subagentDelegation" && JSON.stringify(previous.item.subagents) !== JSON.stringify(item.subagents)) {
23511
+ this.emit({
23512
+ kind: "event",
23513
+ event: {
23514
+ type: "item.updated",
23515
+ turnId: this.turnId,
23516
+ itemId: item.itemId,
23517
+ update: { type: "subagents.replace", subagents: item.subagents }
23518
+ }
23519
+ });
23520
+ }
23306
23521
  this.#fileOutput(tool, event.content);
23307
23522
  return;
23308
23523
  }
@@ -23998,7 +24213,7 @@ var KIRO_SESSION_CAPABILITIES = {
23998
24213
  },
23999
24214
  subagents: {
24000
24215
  observe: true,
24001
- readTranscript: false
24216
+ readTranscript: true
24002
24217
  },
24003
24218
  autonomousTurns: {
24004
24219
  observe: false
@@ -24006,6 +24221,42 @@ var KIRO_SESSION_CAPABILITIES = {
24006
24221
  };
24007
24222
  var KiroAdapter = class {
24008
24223
  harnessId = harnessIdSchema.parse("kiro-cli");
24224
+ subagents = {
24225
+ readSnapshot: async ({ parent, nativeSubagentId }) => {
24226
+ try {
24227
+ if (parent.harnessId !== this.harnessId)
24228
+ throw new Error("Invalid Kiro parent");
24229
+ for (const session of this.#sessions) {
24230
+ if (session.initialState.nativeRef?.nativeSessionId !== parent.nativeSessionId)
24231
+ continue;
24232
+ const live = session.subagentSnapshot(nativeSubagentId);
24233
+ if (live)
24234
+ return { ok: true, value: live };
24235
+ }
24236
+ const locate = this.#deps.locateSession ?? locateKiroNativeSession;
24237
+ const location = await locate({ environment: this.#options.environment }, parent.nativeSessionId);
24238
+ if (!location)
24239
+ throw new Error("Kiro parent history was not found");
24240
+ const snapshot = await (this.#deps.readSnapshot ?? readKiroSnapshot)(location);
24241
+ const item = snapshot.turns.flatMap((turn) => turn.items).map(({ item: item2 }) => item2).find((item2) => item2.type === "subagentDelegation" && item2.subagents.some((child) => child.nativeSubagentId === nativeSubagentId));
24242
+ if (!item || item.type !== "subagentDelegation")
24243
+ throw new Error("Kiro task was not found in this parent");
24244
+ return {
24245
+ ok: true,
24246
+ value: kiroChildSnapshot(parent.nativeSessionId, item, nativeSubagentId)
24247
+ };
24248
+ } catch (error51) {
24249
+ return {
24250
+ ok: false,
24251
+ error: {
24252
+ code: "sessionNotFound",
24253
+ message: error51 instanceof Error ? error51.message : "Kiro task could not be read",
24254
+ retryable: false
24255
+ }
24256
+ };
24257
+ }
24258
+ }
24259
+ };
24009
24260
  commandCatalog = KIRO_COMMAND_CATALOG;
24010
24261
  liveCommandCatalog = true;
24011
24262
  sessionImport;
@@ -24472,7 +24723,45 @@ var KiroSession = class {
24472
24723
  });
24473
24724
  return this.#usageRefresh;
24474
24725
  }
24726
+ #subagentItems = /* @__PURE__ */ new Map();
24727
+ subagentSnapshot(id) {
24728
+ const item = this.#subagentItems.get(id);
24729
+ return item ? kiroChildSnapshot(this.#sessionId, item, id) : void 0;
24730
+ }
24731
+ #subagentEvent(event) {
24732
+ const configured = configureSubagentEvent(event, this.#subagentConfiguration());
24733
+ const item = configured.type === "item.started" ? configured.item : configured.type === "item.completed" ? configured.snapshot.item : void 0;
24734
+ if (configured.type === "item.updated" && configured.update.type === "subagents.replace") {
24735
+ for (const previous of this.#subagentItems.values()) {
24736
+ if (previous.itemId !== configured.itemId)
24737
+ continue;
24738
+ const next = { ...previous, subagents: structuredClone(configured.update.subagents) };
24739
+ for (const child of next.subagents)
24740
+ if (child.nativeSubagentId)
24741
+ this.#subagentItems.set(child.nativeSubagentId, next);
24742
+ break;
24743
+ }
24744
+ }
24745
+ if (item?.type === "subagentDelegation") {
24746
+ for (const child of item.subagents)
24747
+ if (child.nativeSubagentId)
24748
+ this.#subagentItems.set(child.nativeSubagentId, structuredClone(item));
24749
+ }
24750
+ return configured;
24751
+ }
24752
+ #subagentConfiguration() {
24753
+ const state = this.#state();
24754
+ const model2 = state.effectiveModel ? state.effectiveModel.id : void 0;
24755
+ return {
24756
+ ...model2 ? { model: model2 } : {},
24757
+ ...state.effectiveThinkingOptionId ? { reasoningEffort: state.effectiveThinkingOptionId } : {}
24758
+ };
24759
+ }
24475
24760
  async readSnapshot() {
24761
+ const result = await this.#readSnapshot();
24762
+ return result.ok ? { ok: true, value: configureSubagentSnapshot(result.value, this.#subagentConfiguration()) } : result;
24763
+ }
24764
+ async #readSnapshot() {
24476
24765
  if (this.#activeTurnId !== null || this.#configBusy) {
24477
24766
  return {
24478
24767
  ok: false,
@@ -24567,7 +24856,10 @@ var KiroSession = class {
24567
24856
  event: { type: "turn.started", turnId }
24568
24857
  });
24569
24858
  const userText2 = command.input.map((i) => i.text).join("\n");
24570
- const output = new KiroTurnOutput(turnId, this.#cwd, (event) => this.#channel.emit(event));
24859
+ const output = new KiroTurnOutput(turnId, this.#cwd, (output2) => this.#channel.emit(output2.kind === "event" ? {
24860
+ ...output2,
24861
+ event: this.#subagentEvent(output2.event)
24862
+ } : output2));
24571
24863
  let assignedUserMessageId;
24572
24864
  const stopped = new Promise((_resolve, reject) => {
24573
24865
  this.#stopTurn = () => reject(this.#faultError ?? new Error("Session closed"));