@karlorz/codexhost-cli-win32-x64 0.18.0-1 → 0.19.0-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.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +59 -2
- package/app/console-web.js +98 -8
- package/app/cpa-live-voice-hook.js +59 -2
- package/app/desktop-controller.mjs +290 -12
- package/app/host-runtime.mjs +12896 -2966
- package/app/plugins/antigravity/plugin.mjs +654 -216
- package/app/plugins/claude-code/plugin.mjs +138 -11
- package/app/plugins/codebuddy/plugin.mjs +152 -20
- package/app/plugins/codex-usage/plugin.mjs +59 -2
- package/app/plugins/copilot/plugin.mjs +59 -2
- package/app/plugins/cursor-cli/plugin.mjs +134 -12
- package/app/plugins/deepseek-harness/manifest.json +2 -2
- package/app/plugins/deepseek-harness/plugin.mjs +86 -7
- package/app/plugins/devin/plugin.mjs +59 -2
- package/app/plugins/grok/plugin.mjs +1093 -970
- package/app/plugins/hermes/plugin.mjs +138 -14
- package/app/plugins/kimi-code/plugin.mjs +59 -2
- package/app/plugins/kiro-cli/plugin.mjs +287 -18
- package/app/plugins/omp/plugin.mjs +789 -628
- package/app/plugins/opencode/plugin.mjs +59 -2
- package/app/plugins/pi/plugin.mjs +786 -660
- package/app/plugins/qoder/plugin.mjs +61 -6
- package/app/plugins/qoder-cn/plugin.mjs +61 -6
- package/app/plugins/qwen-code/plugin.mjs +168 -94
- package/app/plugins/workbuddy/plugin.mjs +152 -20
- package/app/plugins/zcode/plugin.mjs +132 -5
- package/app/renderer-extension.js +434 -39
- package/app/web/assets/{index-py6Ho-Dy.js → index-BCyiiDDL.js} +62 -62
- package/app/web/assets/index-BNQIOOHE.css +1 -0
- package/app/web/codexhost-settings.js +84 -4
- package/app/web/index.html +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
- package/app/web/plugins/deepseek-ai__dsh-client-file-upload/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-locale/client.js +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-attachment/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +129 -8
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +8 -6
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +95 -93
- package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.excel.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +16 -16
- package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +11 -11
- package/app/web-modules/server.mjs +2345 -1518
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
- 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, {
|
|
@@ -15862,6 +15858,10 @@ var CLIENT_CHANNEL_VERSION = 1;
|
|
|
15862
15858
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
15863
15859
|
var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
|
|
15864
15860
|
var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
|
|
15861
|
+
var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
|
|
15862
|
+
var clientThreadTreeSchema = external_exports.object({
|
|
15863
|
+
parents: external_exports.record(external_exports.string().min(1), external_exports.string().min(1))
|
|
15864
|
+
}).strict();
|
|
15865
15865
|
var clientProjectlessWorkspaceSchema = external_exports.object({
|
|
15866
15866
|
prompt: external_exports.string().max(16384).optional()
|
|
15867
15867
|
}).strict();
|
|
@@ -15878,6 +15878,11 @@ var clientChannelCursorSchema = external_exports.object({
|
|
|
15878
15878
|
sequence: external_exports.number().int().nonnegative()
|
|
15879
15879
|
});
|
|
15880
15880
|
var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
15881
|
+
external_exports.object({
|
|
15882
|
+
type: external_exports.literal("skills-changed"),
|
|
15883
|
+
cursor: clientChannelCursorSchema,
|
|
15884
|
+
cwd: external_exports.string().optional()
|
|
15885
|
+
}),
|
|
15881
15886
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15882
15887
|
external_exports.object({
|
|
15883
15888
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -16075,6 +16080,28 @@ var voiceTranscribeResultSchema = external_exports.discriminatedUnion("ok", [
|
|
|
16075
16080
|
external_exports.object({ ok: external_exports.literal(false), error: external_exports.object({ code: voiceErrorCodeSchema }).strict() }).strict()
|
|
16076
16081
|
]);
|
|
16077
16082
|
|
|
16083
|
+
// ../../shared-contracts/dist/skills.js
|
|
16084
|
+
var skillsListParamsSchema = external_exports.object({
|
|
16085
|
+
threadId: hostThreadIdSchema.optional(),
|
|
16086
|
+
cwd: external_exports.string().min(1).optional()
|
|
16087
|
+
}).strict().refine((params) => !(params.threadId && params.cwd), {
|
|
16088
|
+
message: "Specify threadId or cwd, not both"
|
|
16089
|
+
});
|
|
16090
|
+
var librarySkillSchema = external_exports.object({
|
|
16091
|
+
name: external_exports.string().min(1).regex(/^[^\s[\]]+$/u),
|
|
16092
|
+
description: external_exports.string().optional(),
|
|
16093
|
+
path: external_exports.string().min(1),
|
|
16094
|
+
scope: external_exports.enum(["project", "global"]),
|
|
16095
|
+
source: external_exports.string().min(1)
|
|
16096
|
+
}).strict();
|
|
16097
|
+
var skillsListResultSchema = external_exports.object({
|
|
16098
|
+
revision: external_exports.number().int().nonnegative(),
|
|
16099
|
+
complete: external_exports.boolean(),
|
|
16100
|
+
skills: external_exports.array(librarySkillSchema),
|
|
16101
|
+
warnings: external_exports.array(external_exports.string()).optional()
|
|
16102
|
+
}).strict();
|
|
16103
|
+
var skillsChangedParamsSchema = external_exports.object({ cwd: external_exports.string().min(1).optional() }).strict();
|
|
16104
|
+
|
|
16078
16105
|
// ../../shared-contracts/dist/web-access-tokens.js
|
|
16079
16106
|
var webNetworkAccessUrlSchema = external_exports.object({
|
|
16080
16107
|
/**
|
|
@@ -16180,8 +16207,8 @@ var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
|
16180
16207
|
var delegationReadParamsSchema = external_exports.strictObject({
|
|
16181
16208
|
threadId: external_exports.string().min(1).max(1024),
|
|
16182
16209
|
view: external_exports.enum(["result", "messages"]),
|
|
16183
|
-
|
|
16184
|
-
|
|
16210
|
+
from: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),
|
|
16211
|
+
to: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional()
|
|
16185
16212
|
});
|
|
16186
16213
|
|
|
16187
16214
|
// ../../shared-contracts/dist/credential-imports.js
|
|
@@ -17183,6 +17210,17 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
17183
17210
|
status: updateStatusSchema.nullable()
|
|
17184
17211
|
});
|
|
17185
17212
|
|
|
17213
|
+
// ../../shared-contracts/dist/thread-watch-notice.js
|
|
17214
|
+
var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
17215
|
+
"completed",
|
|
17216
|
+
"failed",
|
|
17217
|
+
"interrupted",
|
|
17218
|
+
"timedOut",
|
|
17219
|
+
"unreadable",
|
|
17220
|
+
"notFound"
|
|
17221
|
+
];
|
|
17222
|
+
var ENTRY_PATTERN = new RegExp(String.raw`^- \[([^\]\n]+)\]\(thread://([^\s()<>"?#/]+)\): ` + `(${THREAD_WATCH_NOTICE_OUTCOMES.join("|")})(?:. (.+))?$`, "u");
|
|
17223
|
+
|
|
17186
17224
|
// ../../shared-contracts/dist/remote-runtime.js
|
|
17187
17225
|
var remoteUpdatePhaseSchema = external_exports.enum([
|
|
17188
17226
|
"idle",
|
|
@@ -17230,6 +17268,14 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
|
17230
17268
|
archived: external_exports.boolean()
|
|
17231
17269
|
}),
|
|
17232
17270
|
external_exports.strictObject({ kind: external_exports.literal("read"), ...thread }),
|
|
17271
|
+
external_exports.strictObject({
|
|
17272
|
+
kind: external_exports.literal("configure"),
|
|
17273
|
+
...thread,
|
|
17274
|
+
epoch: identity,
|
|
17275
|
+
modelId: identity.optional(),
|
|
17276
|
+
thinkingOptionId: identity.optional(),
|
|
17277
|
+
permissionModeId: identity.optional()
|
|
17278
|
+
}).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting"),
|
|
17233
17279
|
external_exports.strictObject({
|
|
17234
17280
|
kind: external_exports.literal("prompt"),
|
|
17235
17281
|
...thread,
|
|
@@ -17302,6 +17348,13 @@ var remoteConnectionsReplySchema = external_exports.union([
|
|
|
17302
17348
|
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
17303
17349
|
]);
|
|
17304
17350
|
|
|
17351
|
+
// ../../shared-contracts/dist/thread-title.js
|
|
17352
|
+
var threadTitleInputSchema = external_exports.strictObject({
|
|
17353
|
+
prompt: external_exports.string().trim().min(1).max(2e3),
|
|
17354
|
+
cwd: external_exports.string().max(4096).nullable()
|
|
17355
|
+
});
|
|
17356
|
+
var threadTitleResultSchema = external_exports.string().trim().min(1).max(60).nullable();
|
|
17357
|
+
|
|
17305
17358
|
// ../../shared-contracts/dist/web-ui-extensions.js
|
|
17306
17359
|
var webUiExtensionIdSchema = external_exports.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u);
|
|
17307
17360
|
var localizedTextSchema2 = external_exports.union([
|
|
@@ -17376,6 +17429,47 @@ var threadActivityStopResultSchema = external_exports.strictObject({
|
|
|
17376
17429
|
// ../../shared-contracts/dist/index.js
|
|
17377
17430
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
17378
17431
|
|
|
17432
|
+
// dist/subagents.js
|
|
17433
|
+
function kiroChildSnapshot(parentId, item, childId) {
|
|
17434
|
+
const child = item.subagents.find((child2) => child2.nativeSubagentId === childId);
|
|
17435
|
+
if (!child)
|
|
17436
|
+
throw new Error("Kiro task does not belong to this parent");
|
|
17437
|
+
return {
|
|
17438
|
+
turns: [
|
|
17439
|
+
{
|
|
17440
|
+
nativeTurnRef: nativeTurnRefSchema.parse({
|
|
17441
|
+
harnessId: "kiro-cli",
|
|
17442
|
+
nativeSessionId: parentId,
|
|
17443
|
+
nativeTurnKey: childId,
|
|
17444
|
+
formatVersion: 1
|
|
17445
|
+
}),
|
|
17446
|
+
input: item.prompt ? [{ type: "text", text: item.prompt }] : [],
|
|
17447
|
+
items: child.resultSummary ? [
|
|
17448
|
+
{
|
|
17449
|
+
item: {
|
|
17450
|
+
type: "agentMessage",
|
|
17451
|
+
itemId: hostItemIdSchema.parse(`kiro-task-result-${childId}`),
|
|
17452
|
+
text: child.resultSummary
|
|
17453
|
+
},
|
|
17454
|
+
outcome: { status: "succeeded" }
|
|
17455
|
+
}
|
|
17456
|
+
] : [],
|
|
17457
|
+
outcome: child.status === "pending" || child.status === "running" ? {
|
|
17458
|
+
status: "unknown",
|
|
17459
|
+
reason: "Kiro ACP exposes task summaries, not the child's internal step stream"
|
|
17460
|
+
} : child.status === "interrupted" ? { status: "cancelled" } : child.status === "failed" ? {
|
|
17461
|
+
status: "failed",
|
|
17462
|
+
error: {
|
|
17463
|
+
code: "nativeFailure",
|
|
17464
|
+
message: child.resultSummary || "Kiro task failed",
|
|
17465
|
+
retryable: false
|
|
17466
|
+
}
|
|
17467
|
+
} : { status: "succeeded" }
|
|
17468
|
+
}
|
|
17469
|
+
]
|
|
17470
|
+
};
|
|
17471
|
+
}
|
|
17472
|
+
|
|
17379
17473
|
// ../../harness-adapter/dist/approval.js
|
|
17380
17474
|
function invalidRequest(message) {
|
|
17381
17475
|
return { code: "invalidRequest", message, retryable: false };
|
|
@@ -17701,14 +17795,12 @@ var COMMON_EXCLUDED_LIVE_COMMANDS = /* @__PURE__ */ new Set([
|
|
|
17701
17795
|
"reload-plugins"
|
|
17702
17796
|
]);
|
|
17703
17797
|
var COMMON_EXCLUDED_LIVE_COMMAND_PREFIXES = ["__", "hooks-"];
|
|
17704
|
-
function isExcludedLiveCommand(name,
|
|
17798
|
+
function isExcludedLiveCommand(name, extra = {}) {
|
|
17705
17799
|
const normalized = name.trim().replace(/^\//u, "");
|
|
17706
17800
|
if (new Set(extra.names ?? []).has(normalized))
|
|
17707
17801
|
return true;
|
|
17708
17802
|
if (extra.prefixes?.some((prefix) => normalized.startsWith(prefix)))
|
|
17709
17803
|
return true;
|
|
17710
|
-
if (kind === "skill")
|
|
17711
|
-
return false;
|
|
17712
17804
|
return COMMON_EXCLUDED_LIVE_COMMANDS.has(normalized) || COMMON_EXCLUDED_LIVE_COMMAND_PREFIXES.some((prefix) => normalized.startsWith(prefix));
|
|
17713
17805
|
}
|
|
17714
17806
|
function liveHarnessCommandPrompt(catalog, idPrefix, commandId, argumentText) {
|
|
@@ -17730,7 +17822,7 @@ function mergeLiveHarnessCommands(builtIns, idPrefix, live, exclusions = {}) {
|
|
|
17730
17822
|
const name = command.name.trim().replace(/^\//u, "");
|
|
17731
17823
|
if (!name || /\s/u.test(name))
|
|
17732
17824
|
continue;
|
|
17733
|
-
if (isExcludedLiveCommand(name,
|
|
17825
|
+
if (isExcludedLiveCommand(name, exclusions))
|
|
17734
17826
|
continue;
|
|
17735
17827
|
const invocation = `/${name}`;
|
|
17736
17828
|
const id = `${idPrefix}${name.replace(/[^A-Za-z0-9._:-]/gu, "-")}`.slice(0, 128);
|
|
@@ -17742,8 +17834,7 @@ function mergeLiveHarnessCommands(builtIns, idPrefix, live, exclusions = {}) {
|
|
|
17742
17834
|
invocation,
|
|
17743
17835
|
label: name.slice(0, 128),
|
|
17744
17836
|
...description ? { description } : {},
|
|
17745
|
-
argumentMode: "text"
|
|
17746
|
-
kind: command.kind
|
|
17837
|
+
argumentMode: "text"
|
|
17747
17838
|
});
|
|
17748
17839
|
if (!parsed.success)
|
|
17749
17840
|
continue;
|
|
@@ -17754,6 +17845,64 @@ function mergeLiveHarnessCommands(builtIns, idPrefix, live, exclusions = {}) {
|
|
|
17754
17845
|
return harnessCommandCatalogSchema.parse({ commands: [...builtIns.commands, ...dynamic] });
|
|
17755
17846
|
}
|
|
17756
17847
|
|
|
17848
|
+
// ../../harness-adapter/dist/subagent-configuration.js
|
|
17849
|
+
function subagentConfiguration(value) {
|
|
17850
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
17851
|
+
return {};
|
|
17852
|
+
const row = value;
|
|
17853
|
+
const text = (value2) => typeof value2 === "string" && value2.trim() ? value2 : void 0;
|
|
17854
|
+
const model2 = row.model === "inherit" ? void 0 : text(row.model);
|
|
17855
|
+
const reasoningEffort = text(row.reasoningEffort) ?? text(row.reasoning_effort) ?? text(row.thinking);
|
|
17856
|
+
return { ...model2 ? { model: model2 } : {}, ...reasoningEffort ? { reasoningEffort } : {} };
|
|
17857
|
+
}
|
|
17858
|
+
function inheritSubagentConfiguration(child, parent) {
|
|
17859
|
+
const native = subagentConfiguration(child);
|
|
17860
|
+
const model2 = native.model ?? parent.model;
|
|
17861
|
+
const reasoningEffort = native.reasoningEffort ?? parent.reasoningEffort;
|
|
17862
|
+
const next = { ...child };
|
|
17863
|
+
delete next.model;
|
|
17864
|
+
delete next.reasoningEffort;
|
|
17865
|
+
return { ...next, ...model2 ? { model: model2 } : {}, ...reasoningEffort ? { reasoningEffort } : {} };
|
|
17866
|
+
}
|
|
17867
|
+
function configureSubagentEvent(event, parent) {
|
|
17868
|
+
const children = (states) => states.map((child) => inheritSubagentConfiguration(child, parent));
|
|
17869
|
+
if (event.type === "item.started" && event.item.type === "subagentDelegation")
|
|
17870
|
+
return { ...event, item: { ...event.item, subagents: children(event.item.subagents) } };
|
|
17871
|
+
if (event.type === "item.updated" && event.update.type === "subagents.replace")
|
|
17872
|
+
return { ...event, update: { ...event.update, subagents: children(event.update.subagents) } };
|
|
17873
|
+
if (event.type === "item.completed" && event.snapshot.item.type === "subagentDelegation")
|
|
17874
|
+
return {
|
|
17875
|
+
...event,
|
|
17876
|
+
snapshot: {
|
|
17877
|
+
...event.snapshot,
|
|
17878
|
+
item: {
|
|
17879
|
+
...event.snapshot.item,
|
|
17880
|
+
subagents: children(event.snapshot.item.subagents)
|
|
17881
|
+
}
|
|
17882
|
+
}
|
|
17883
|
+
};
|
|
17884
|
+
return event;
|
|
17885
|
+
}
|
|
17886
|
+
function configureSubagentSnapshot(snapshot, parent) {
|
|
17887
|
+
return {
|
|
17888
|
+
...snapshot,
|
|
17889
|
+
turns: snapshot.turns.map((turn) => ({
|
|
17890
|
+
...turn,
|
|
17891
|
+
items: turn.items.map((entry) => entry.item.type === "subagentDelegation" ? {
|
|
17892
|
+
...entry,
|
|
17893
|
+
item: {
|
|
17894
|
+
...entry.item,
|
|
17895
|
+
subagents: entry.item.subagents.map((child) => inheritSubagentConfiguration(child, parent))
|
|
17896
|
+
}
|
|
17897
|
+
} : entry)
|
|
17898
|
+
}))
|
|
17899
|
+
};
|
|
17900
|
+
}
|
|
17901
|
+
|
|
17902
|
+
// dist/kiro-adapter.js
|
|
17903
|
+
import { randomUUID } from "node:crypto";
|
|
17904
|
+
import path8 from "node:path";
|
|
17905
|
+
|
|
17757
17906
|
// dist/acp-transport.js
|
|
17758
17907
|
import { spawn, spawnSync } from "node:child_process";
|
|
17759
17908
|
import { Readable, Writable } from "node:stream";
|
|
@@ -21947,10 +22096,9 @@ function parseKiroAvailableCommands(value) {
|
|
|
21947
22096
|
});
|
|
21948
22097
|
}
|
|
21949
22098
|
function kiroLiveCommands(native) {
|
|
21950
|
-
return native.map((command) => ({
|
|
22099
|
+
return native.filter((command) => command.type !== "skill").map((command) => ({
|
|
21951
22100
|
name: command.name,
|
|
21952
|
-
description: command.description
|
|
21953
|
-
kind: command.type === "skill" ? "skill" : "command"
|
|
22101
|
+
description: command.description
|
|
21954
22102
|
}));
|
|
21955
22103
|
}
|
|
21956
22104
|
|
|
@@ -23568,9 +23716,12 @@ function projectKiroToolCall(itemId, toolCall) {
|
|
|
23568
23716
|
const input = isRecord8(toolCall.rawInput) ? toolCall.rawInput : {};
|
|
23569
23717
|
const subagentState = {
|
|
23570
23718
|
subagentId: subtaskId,
|
|
23719
|
+
nativeSubagentId: subtaskId,
|
|
23571
23720
|
description: typeof input.prompt === "string" ? input.prompt : "Subagent task",
|
|
23721
|
+
...subagentConfiguration(input),
|
|
23722
|
+
...subagentConfiguration(kiroMeta),
|
|
23572
23723
|
background: false,
|
|
23573
|
-
status: toolCall.status === "completed" ? "completed" : toolCall.status === "failed" ? "failed" : "running",
|
|
23724
|
+
status: toolCall.status === "pending" ? "pending" : toolCall.status === "completed" ? "completed" : toolCall.status === "failed" ? "failed" : "running",
|
|
23574
23725
|
...typeof input.name === "string" ? { role: input.name } : {},
|
|
23575
23726
|
...typeof toolCall.rawOutput === "string" ? { resultSummary: toolCall.rawOutput } : {}
|
|
23576
23727
|
};
|
|
@@ -23578,6 +23729,7 @@ function projectKiroToolCall(itemId, toolCall) {
|
|
|
23578
23729
|
type: "subagentDelegation",
|
|
23579
23730
|
itemId: hostItemId,
|
|
23580
23731
|
operation: "spawn",
|
|
23732
|
+
...typeof input.prompt === "string" ? { prompt: input.prompt } : {},
|
|
23581
23733
|
subagents: [subagentState]
|
|
23582
23734
|
};
|
|
23583
23735
|
return subagentItem;
|
|
@@ -23701,6 +23853,15 @@ var KiroTurnOutput = class {
|
|
|
23701
23853
|
this.emit({ kind: "event", event: { type: "item.started", turnId: this.turnId, item } });
|
|
23702
23854
|
}
|
|
23703
23855
|
#complete(item, outcome) {
|
|
23856
|
+
if (item.type === "subagentDelegation") {
|
|
23857
|
+
item = {
|
|
23858
|
+
...item,
|
|
23859
|
+
subagents: item.subagents.map((child) => ({
|
|
23860
|
+
...child,
|
|
23861
|
+
status: outcome.status === "cancelled" ? "interrupted" : outcome.status === "failed" ? "failed" : child.status
|
|
23862
|
+
}))
|
|
23863
|
+
};
|
|
23864
|
+
}
|
|
23704
23865
|
this.emit({
|
|
23705
23866
|
kind: "event",
|
|
23706
23867
|
event: {
|
|
@@ -23709,6 +23870,26 @@ var KiroTurnOutput = class {
|
|
|
23709
23870
|
snapshot: { item, outcome }
|
|
23710
23871
|
}
|
|
23711
23872
|
});
|
|
23873
|
+
if (item.type === "subagentDelegation") {
|
|
23874
|
+
for (const child of item.subagents)
|
|
23875
|
+
if (child.nativeSubagentId) {
|
|
23876
|
+
this.emit({
|
|
23877
|
+
kind: "event",
|
|
23878
|
+
event: {
|
|
23879
|
+
type: "subagent.state.changed",
|
|
23880
|
+
nativeSubagentId: child.nativeSubagentId,
|
|
23881
|
+
status: child.status
|
|
23882
|
+
}
|
|
23883
|
+
});
|
|
23884
|
+
this.emit({
|
|
23885
|
+
kind: "event",
|
|
23886
|
+
event: {
|
|
23887
|
+
type: "subagent.transcript.changed",
|
|
23888
|
+
nativeSubagentId: child.nativeSubagentId
|
|
23889
|
+
}
|
|
23890
|
+
});
|
|
23891
|
+
}
|
|
23892
|
+
}
|
|
23712
23893
|
}
|
|
23713
23894
|
#completeMessage(outcome, phase) {
|
|
23714
23895
|
this.#appendText(this.#text.finish());
|
|
@@ -23804,6 +23985,17 @@ var KiroTurnOutput = class {
|
|
|
23804
23985
|
const tool = { ...previous, event: merged, item, done };
|
|
23805
23986
|
this.#tools.set(event.callId, tool);
|
|
23806
23987
|
if (!done) {
|
|
23988
|
+
if (previous?.item.type === "subagentDelegation" && item.type === "subagentDelegation" && JSON.stringify(previous.item.subagents) !== JSON.stringify(item.subagents)) {
|
|
23989
|
+
this.emit({
|
|
23990
|
+
kind: "event",
|
|
23991
|
+
event: {
|
|
23992
|
+
type: "item.updated",
|
|
23993
|
+
turnId: this.turnId,
|
|
23994
|
+
itemId: item.itemId,
|
|
23995
|
+
update: { type: "subagents.replace", subagents: item.subagents }
|
|
23996
|
+
}
|
|
23997
|
+
});
|
|
23998
|
+
}
|
|
23807
23999
|
this.#fileOutput(tool, event.content);
|
|
23808
24000
|
return;
|
|
23809
24001
|
}
|
|
@@ -24499,7 +24691,7 @@ var KIRO_SESSION_CAPABILITIES = {
|
|
|
24499
24691
|
},
|
|
24500
24692
|
subagents: {
|
|
24501
24693
|
observe: true,
|
|
24502
|
-
readTranscript:
|
|
24694
|
+
readTranscript: true
|
|
24503
24695
|
},
|
|
24504
24696
|
autonomousTurns: {
|
|
24505
24697
|
observe: false
|
|
@@ -24507,6 +24699,42 @@ var KIRO_SESSION_CAPABILITIES = {
|
|
|
24507
24699
|
};
|
|
24508
24700
|
var KiroAdapter = class {
|
|
24509
24701
|
harnessId = harnessIdSchema.parse("kiro-cli");
|
|
24702
|
+
subagents = {
|
|
24703
|
+
readSnapshot: async ({ parent, nativeSubagentId }) => {
|
|
24704
|
+
try {
|
|
24705
|
+
if (parent.harnessId !== this.harnessId)
|
|
24706
|
+
throw new Error("Invalid Kiro parent");
|
|
24707
|
+
for (const session of this.#sessions) {
|
|
24708
|
+
if (session.initialState.nativeRef?.nativeSessionId !== parent.nativeSessionId)
|
|
24709
|
+
continue;
|
|
24710
|
+
const live = session.subagentSnapshot(nativeSubagentId);
|
|
24711
|
+
if (live)
|
|
24712
|
+
return { ok: true, value: live };
|
|
24713
|
+
}
|
|
24714
|
+
const locate = this.#deps.locateSession ?? locateKiroNativeSession;
|
|
24715
|
+
const location = await locate({ environment: this.#options.environment }, parent.nativeSessionId);
|
|
24716
|
+
if (!location)
|
|
24717
|
+
throw new Error("Kiro parent history was not found");
|
|
24718
|
+
const snapshot = await (this.#deps.readSnapshot ?? readKiroSnapshot)(location);
|
|
24719
|
+
const item = snapshot.turns.flatMap((turn) => turn.items).map(({ item: item2 }) => item2).find((item2) => item2.type === "subagentDelegation" && item2.subagents.some((child) => child.nativeSubagentId === nativeSubagentId));
|
|
24720
|
+
if (!item || item.type !== "subagentDelegation")
|
|
24721
|
+
throw new Error("Kiro task was not found in this parent");
|
|
24722
|
+
return {
|
|
24723
|
+
ok: true,
|
|
24724
|
+
value: kiroChildSnapshot(parent.nativeSessionId, item, nativeSubagentId)
|
|
24725
|
+
};
|
|
24726
|
+
} catch (error51) {
|
|
24727
|
+
return {
|
|
24728
|
+
ok: false,
|
|
24729
|
+
error: {
|
|
24730
|
+
code: "sessionNotFound",
|
|
24731
|
+
message: error51 instanceof Error ? error51.message : "Kiro task could not be read",
|
|
24732
|
+
retryable: false
|
|
24733
|
+
}
|
|
24734
|
+
};
|
|
24735
|
+
}
|
|
24736
|
+
}
|
|
24737
|
+
};
|
|
24510
24738
|
commandCatalog = KIRO_COMMAND_CATALOG;
|
|
24511
24739
|
liveCommandCatalog = true;
|
|
24512
24740
|
sessionImport;
|
|
@@ -24983,7 +25211,45 @@ var KiroSession = class {
|
|
|
24983
25211
|
});
|
|
24984
25212
|
return this.#usageRefresh;
|
|
24985
25213
|
}
|
|
25214
|
+
#subagentItems = /* @__PURE__ */ new Map();
|
|
25215
|
+
subagentSnapshot(id) {
|
|
25216
|
+
const item = this.#subagentItems.get(id);
|
|
25217
|
+
return item ? kiroChildSnapshot(this.#sessionId, item, id) : void 0;
|
|
25218
|
+
}
|
|
25219
|
+
#subagentEvent(event) {
|
|
25220
|
+
const configured = configureSubagentEvent(event, this.#subagentConfiguration());
|
|
25221
|
+
const item = configured.type === "item.started" ? configured.item : configured.type === "item.completed" ? configured.snapshot.item : void 0;
|
|
25222
|
+
if (configured.type === "item.updated" && configured.update.type === "subagents.replace") {
|
|
25223
|
+
for (const previous of this.#subagentItems.values()) {
|
|
25224
|
+
if (previous.itemId !== configured.itemId)
|
|
25225
|
+
continue;
|
|
25226
|
+
const next = { ...previous, subagents: structuredClone(configured.update.subagents) };
|
|
25227
|
+
for (const child of next.subagents)
|
|
25228
|
+
if (child.nativeSubagentId)
|
|
25229
|
+
this.#subagentItems.set(child.nativeSubagentId, next);
|
|
25230
|
+
break;
|
|
25231
|
+
}
|
|
25232
|
+
}
|
|
25233
|
+
if (item?.type === "subagentDelegation") {
|
|
25234
|
+
for (const child of item.subagents)
|
|
25235
|
+
if (child.nativeSubagentId)
|
|
25236
|
+
this.#subagentItems.set(child.nativeSubagentId, structuredClone(item));
|
|
25237
|
+
}
|
|
25238
|
+
return configured;
|
|
25239
|
+
}
|
|
25240
|
+
#subagentConfiguration() {
|
|
25241
|
+
const state = this.#state();
|
|
25242
|
+
const model2 = state.effectiveModel ? state.effectiveModel.id : void 0;
|
|
25243
|
+
return {
|
|
25244
|
+
...model2 ? { model: model2 } : {},
|
|
25245
|
+
...state.effectiveThinkingOptionId ? { reasoningEffort: state.effectiveThinkingOptionId } : {}
|
|
25246
|
+
};
|
|
25247
|
+
}
|
|
24986
25248
|
async readSnapshot() {
|
|
25249
|
+
const result = await this.#readSnapshot();
|
|
25250
|
+
return result.ok ? { ok: true, value: configureSubagentSnapshot(result.value, this.#subagentConfiguration()) } : result;
|
|
25251
|
+
}
|
|
25252
|
+
async #readSnapshot() {
|
|
24987
25253
|
if (this.#activeTurnId !== null || this.#configBusy) {
|
|
24988
25254
|
return {
|
|
24989
25255
|
ok: false,
|
|
@@ -25078,7 +25344,10 @@ var KiroSession = class {
|
|
|
25078
25344
|
event: { type: "turn.started", turnId }
|
|
25079
25345
|
});
|
|
25080
25346
|
const userText2 = command.input.map((i) => i.text).join("\n");
|
|
25081
|
-
const output = new KiroTurnOutput(turnId, this.#cwd, (
|
|
25347
|
+
const output = new KiroTurnOutput(turnId, this.#cwd, (output2) => this.#channel.emit(output2.kind === "event" ? {
|
|
25348
|
+
...output2,
|
|
25349
|
+
event: this.#subagentEvent(output2.event)
|
|
25350
|
+
} : output2));
|
|
25082
25351
|
let assignedUserMessageId;
|
|
25083
25352
|
const stopped = new Promise((_resolve, reject) => {
|
|
25084
25353
|
this.#stopTurn = () => reject(this.#faultError ?? new Error("Session closed"));
|