@liberseek/boft-cli-win32-arm64 0.7.1 → 0.7.3

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.
@@ -15305,10 +15305,21 @@ var harnessCommandDescriptorSchema = external_exports.object({
15305
15305
  invocation: commandInvocationSchema,
15306
15306
  label: commandLabelSchema,
15307
15307
  description: commandDescriptionSchema.optional(),
15308
- argumentMode: external_exports.enum(["none", "text"])
15308
+ argumentMode: external_exports.enum(["none", "text"]),
15309
+ /**
15310
+ * Native distinction reported by the Harness. Omitted when the Harness does
15311
+ * not tell skills and commands apart; consumers treat that as "command".
15312
+ */
15313
+ kind: external_exports.enum(["command", "skill"]).optional()
15309
15314
  }).strict();
15310
15315
  var harnessCommandCatalogSchema = external_exports.object({
15311
- commands: external_exports.array(harnessCommandDescriptorSchema)
15316
+ commands: external_exports.array(harnessCommandDescriptorSchema),
15317
+ /**
15318
+ * `live` when the catalog includes what a native Session reports for its
15319
+ * workspace (custom commands, skills); `static` for Adapter built-ins only.
15320
+ * Omitted by Adapters; set by the Host on inspection results.
15321
+ */
15322
+ source: external_exports.enum(["live", "static"]).optional()
15312
15323
  }).strict().superRefine((catalog, context) => {
15313
15324
  const ids = /* @__PURE__ */ new Set();
15314
15325
  for (const [index, command] of catalog.commands.entries()) {
@@ -15322,7 +15333,11 @@ var harnessCommandCatalogSchema = external_exports.object({
15322
15333
  ids.add(command.id);
15323
15334
  }
15324
15335
  });
15325
- var harnessCommandsInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema }).strict();
15336
+ var harnessCommandsInspectParamsSchema = external_exports.object({
15337
+ harnessId: harnessIdSchema,
15338
+ /** Workspace of a draft without a Thread, for its live catalog when known. */
15339
+ cwd: external_exports.string().min(1).optional()
15340
+ }).strict();
15326
15341
  var threadCommandsInspectParamsSchema = external_exports.object({
15327
15342
  threadId: hostThreadIdSchema
15328
15343
  }).strict();
@@ -15667,6 +15682,124 @@ function parseHostUsage(value) {
15667
15682
  return { ...value };
15668
15683
  }
15669
15684
 
15685
+ // ../../harness-adapter/dist/live-command-catalog.js
15686
+ var COMMON_EXCLUDED_LIVE_COMMANDS = /* @__PURE__ */ new Set([
15687
+ // Session lifecycle
15688
+ "branch",
15689
+ "clear",
15690
+ "exit",
15691
+ "fork",
15692
+ "fresh",
15693
+ "new",
15694
+ "quit",
15695
+ "rename",
15696
+ "rename-chat",
15697
+ "reset",
15698
+ "resume",
15699
+ "rewind",
15700
+ "session",
15701
+ "sessions",
15702
+ // Desktop-owned configuration
15703
+ "autocompact",
15704
+ "color",
15705
+ "config",
15706
+ "effort",
15707
+ "fast",
15708
+ "keybindings",
15709
+ "model",
15710
+ "models",
15711
+ "output-style",
15712
+ "permissions",
15713
+ "settings",
15714
+ "statusline",
15715
+ "terminal-setup",
15716
+ "theme",
15717
+ "vim",
15718
+ // Trust and approval policy
15719
+ "always-approve",
15720
+ "auto-mode-setup",
15721
+ // Native login
15722
+ "login",
15723
+ "logout",
15724
+ // Work outliving the Turn
15725
+ "autopilot",
15726
+ "background",
15727
+ "bg",
15728
+ "goal",
15729
+ "jobs",
15730
+ "loop",
15731
+ "multitask",
15732
+ "queue",
15733
+ "remote-control",
15734
+ "schedule",
15735
+ "steer",
15736
+ // Native terminal UI
15737
+ "copy",
15738
+ "debug",
15739
+ "feedback",
15740
+ "heapdump",
15741
+ "share",
15742
+ "shell",
15743
+ // Plugin and MCP management
15744
+ "marketplace",
15745
+ "mcp",
15746
+ "plugins",
15747
+ "reload-plugins"
15748
+ ]);
15749
+ var COMMON_EXCLUDED_LIVE_COMMAND_PREFIXES = ["__", "hooks-"];
15750
+ function isExcludedLiveCommand(name, kind, extra = {}) {
15751
+ const normalized = name.trim().replace(/^\//u, "");
15752
+ if (new Set(extra.names ?? []).has(normalized))
15753
+ return true;
15754
+ if (extra.prefixes?.some((prefix) => normalized.startsWith(prefix)))
15755
+ return true;
15756
+ if (kind === "skill")
15757
+ return false;
15758
+ return COMMON_EXCLUDED_LIVE_COMMANDS.has(normalized) || COMMON_EXCLUDED_LIVE_COMMAND_PREFIXES.some((prefix) => normalized.startsWith(prefix));
15759
+ }
15760
+ function liveHarnessCommandPrompt(catalog, idPrefix, commandId, argumentText) {
15761
+ if (!commandId.startsWith(idPrefix))
15762
+ return null;
15763
+ const descriptor = catalog.commands.find(({ id }) => id === commandId);
15764
+ if (!descriptor)
15765
+ return null;
15766
+ const text = typeof argumentText === "string" ? argumentText.trim() : "";
15767
+ return text ? `${descriptor.invocation} ${text}` : descriptor.invocation;
15768
+ }
15769
+ function mergeLiveHarnessCommands(builtIns, idPrefix, live, exclusions = {}) {
15770
+ if (!live)
15771
+ return builtIns;
15772
+ const invocations = new Set(builtIns.commands.map(({ invocation }) => invocation));
15773
+ const ids = new Set(builtIns.commands.map(({ id }) => id));
15774
+ const dynamic = [];
15775
+ for (const command of live) {
15776
+ const name = command.name.trim().replace(/^\//u, "");
15777
+ if (!name || /\s/u.test(name))
15778
+ continue;
15779
+ if (isExcludedLiveCommand(name, command.kind, exclusions))
15780
+ continue;
15781
+ const invocation = `/${name}`;
15782
+ const id = `${idPrefix}${name.replace(/[^A-Za-z0-9._:-]/gu, "-")}`.slice(0, 128);
15783
+ if (invocations.has(invocation) || ids.has(id))
15784
+ continue;
15785
+ const description = command.description?.trim().slice(0, 512);
15786
+ const parsed = harnessCommandDescriptorSchema.safeParse({
15787
+ id,
15788
+ invocation,
15789
+ label: name.slice(0, 128),
15790
+ ...description ? { description } : {},
15791
+ argumentMode: "text",
15792
+ kind: command.kind
15793
+ });
15794
+ if (!parsed.success)
15795
+ continue;
15796
+ invocations.add(invocation);
15797
+ ids.add(id);
15798
+ dynamic.push(parsed.data);
15799
+ }
15800
+ return harnessCommandCatalogSchema.parse({ commands: [...builtIns.commands, ...dynamic] });
15801
+ }
15802
+
15670
15803
  // dist/acp-transport.js
15671
15804
  import { spawn, spawnSync } from "node:child_process";
15672
15805
  import { Readable, Writable } from "node:stream";
@@ -20060,6 +20193,38 @@ var ClientSideConnection = class {
20060
20193
  }
20061
20194
  };
20062
20195
 
20196
+ // dist/kiro-slash-commands.js
20197
+ var KIRO_LIVE_COMMAND_ID_PREFIX = "kiro.slash.";
20198
+ function isRecord3(value) {
20199
+ return typeof value === "object" && value !== null && !Array.isArray(value);
20200
+ }
20201
+ function parseKiroAvailableCommands(value) {
20202
+ if (!Array.isArray(value))
20203
+ return [];
20204
+ return value.flatMap((entry) => {
20205
+ if (!isRecord3(entry))
20206
+ return [];
20207
+ const name = typeof entry.name === "string" ? entry.name.trim().replace(/^\//u, "") : "";
20208
+ if (!name)
20209
+ return [];
20210
+ const kiro = isRecord3(entry._meta) && isRecord3(entry._meta.kiro) ? entry._meta.kiro : null;
20211
+ return [
20212
+ {
20213
+ name,
20214
+ description: typeof entry.description === "string" ? entry.description : "",
20215
+ type: typeof kiro?.type === "string" ? kiro.type : null
20216
+ }
20217
+ ];
20218
+ });
20219
+ }
20220
+ function kiroLiveCommands(native) {
20221
+ return native.map((command) => ({
20222
+ name: command.name,
20223
+ description: command.description,
20224
+ kind: command.type === "skill" ? "skill" : "command"
20225
+ }));
20226
+ }
20227
+
20063
20228
  // dist/command.js
20064
20229
  import path3 from "node:path";
20065
20230
  var KiroExecutableError = class extends Error {
@@ -20102,7 +20267,7 @@ var KIRO_DEFAULT_MODEL_CATALOG = {
20102
20267
  models: KIRO_DEFAULT_MODELS,
20103
20268
  thinkingOptions: []
20104
20269
  };
20105
- function isRecord3(value) {
20270
+ function isRecord4(value) {
20106
20271
  return typeof value === "object" && value !== null && !Array.isArray(value);
20107
20272
  }
20108
20273
  function nonBlank(value) {
@@ -20112,7 +20277,7 @@ function thinkingOptions(values) {
20112
20277
  const options = /* @__PURE__ */ new Map();
20113
20278
  for (const value of Array.isArray(values) ? values : []) {
20114
20279
  const option = typeof value === "string" ? { value, name: value.charAt(0).toUpperCase() + value.slice(1) } : value;
20115
- if (!isRecord3(option))
20280
+ if (!isRecord4(option))
20116
20281
  continue;
20117
20282
  const parsed = harnessThinkingOptionSchema.safeParse({
20118
20283
  id: option.value,
@@ -20124,8 +20289,8 @@ function thinkingOptions(values) {
20124
20289
  return [...options.values()];
20125
20290
  }
20126
20291
  function kiroThinkingState(configOptions) {
20127
- const option = Array.isArray(configOptions) ? configOptions.find((entry) => isRecord3(entry) && entry.id === "effortLevel") : void 0;
20128
- const availableThinkingOptions = kiroConfigValue(configOptions, "model") === "auto" || !isRecord3(option) ? [] : thinkingOptions(option.options);
20292
+ const option = Array.isArray(configOptions) ? configOptions.find((entry) => isRecord4(entry) && entry.id === "effortLevel") : void 0;
20293
+ const availableThinkingOptions = kiroConfigValue(configOptions, "model") === "auto" || !isRecord4(option) ? [] : thinkingOptions(option.options);
20129
20294
  const current = availableThinkingOptions.find(({ id }) => id === kiroConfigValue(configOptions, "effortLevel"));
20130
20295
  return {
20131
20296
  availableThinkingOptions,
@@ -20135,8 +20300,8 @@ function kiroThinkingState(configOptions) {
20135
20300
  function parseKiroModelCatalog(configOptions, fallback = KIRO_DEFAULT_MODEL_CATALOG) {
20136
20301
  if (!Array.isArray(configOptions))
20137
20302
  return fallback;
20138
- const modelConfig = configOptions.find((opt) => isRecord3(opt) && opt.id === "model");
20139
- if (!modelConfig || !isRecord3(modelConfig))
20303
+ const modelConfig = configOptions.find((opt) => isRecord4(opt) && opt.id === "model");
20304
+ if (!modelConfig || !isRecord4(modelConfig))
20140
20305
  return fallback;
20141
20306
  const rawOptions = modelConfig.options;
20142
20307
  if (!Array.isArray(rawOptions) || rawOptions.length === 0)
@@ -20147,7 +20312,7 @@ function parseKiroModelCatalog(configOptions, fallback = KIRO_DEFAULT_MODEL_CATA
20147
20312
  const currentThinking = kiroThinkingState(configOptions);
20148
20313
  let defaultEffort = currentThinking.effectiveThinkingOptionId;
20149
20314
  for (const option of rawOptions) {
20150
- if (!isRecord3(option))
20315
+ if (!isRecord4(option))
20151
20316
  continue;
20152
20317
  const value = option.value ?? option.id;
20153
20318
  const name = option.name ?? option.label ?? value;
@@ -20157,8 +20322,8 @@ function parseKiroModelCatalog(configOptions, fallback = KIRO_DEFAULT_MODEL_CATA
20157
20322
  if (!ref.success || seenRefs.has(ref.data.id))
20158
20323
  continue;
20159
20324
  seenRefs.add(ref.data.id);
20160
- const meta3 = isRecord3(option._meta) && isRecord3(option._meta.kiro) ? option._meta.kiro : void 0;
20161
- const currentEffortConfig = configOptions.some((entry) => isRecord3(entry) && entry.id === "effortLevel");
20325
+ const meta3 = isRecord4(option._meta) && isRecord4(option._meta.kiro) ? option._meta.kiro : void 0;
20326
+ const currentEffortConfig = configOptions.some((entry) => isRecord4(entry) && entry.id === "effortLevel");
20162
20327
  const supported = ref.data.id === "auto" ? [] : ref.data.id === modelConfig.currentValue && currentEffortConfig ? currentThinking.availableThinkingOptions ?? [] : meta3?.hasEffort === false ? [] : thinkingOptions(meta3?.effortLevels);
20163
20328
  for (const effort of supported)
20164
20329
  efforts.set(effort.id, effort);
@@ -20194,25 +20359,25 @@ function parseKiroModelCatalog(configOptions, fallback = KIRO_DEFAULT_MODEL_CATA
20194
20359
  function kiroConfigValue(configOptions, id) {
20195
20360
  if (!Array.isArray(configOptions))
20196
20361
  return void 0;
20197
- const option = configOptions.find((value) => isRecord3(value) && value.id === id);
20198
- return isRecord3(option) && nonBlank(option.currentValue) ? option.currentValue : void 0;
20362
+ const option = configOptions.find((value) => isRecord4(value) && value.id === id);
20363
+ return isRecord4(option) && nonBlank(option.currentValue) ? option.currentValue : void 0;
20199
20364
  }
20200
20365
  function confirmedKiroConfig(result, id, value) {
20201
- const options = isRecord3(result) ? result.configOptions : void 0;
20366
+ const options = isRecord4(result) ? result.configOptions : void 0;
20202
20367
  if (!Array.isArray(options) || kiroConfigValue(options, id) !== value) {
20203
20368
  throw new Error(`Kiro did not confirm ${id}=${value}`);
20204
20369
  }
20205
20370
  return options;
20206
20371
  }
20207
20372
  function parseKiroCliModels(result) {
20208
- const rows = isRecord3(result) ? result.models : result;
20373
+ const rows = isRecord4(result) ? result.models : result;
20209
20374
  if (!Array.isArray(rows))
20210
20375
  throw new Error("Kiro returned an invalid model catalog");
20211
20376
  const catalog = parseKiroModelCatalog([
20212
20377
  {
20213
20378
  id: "model",
20214
- options: rows.map((row) => isRecord3(row) ? { value: row.model_id, name: row.model_name, _meta: row._meta ?? { kiro: row } } : row),
20215
- ...isRecord3(result) ? { currentValue: result.default_model } : {}
20379
+ options: rows.map((row) => isRecord4(row) ? { value: row.model_id, name: row.model_name, _meta: row._meta ?? { kiro: row } } : row),
20380
+ ...isRecord4(result) ? { currentValue: result.default_model } : {}
20216
20381
  }
20217
20382
  ]);
20218
20383
  if (catalog.models.length === 0)
@@ -20231,7 +20396,7 @@ var KiroTransportError = class extends Error {
20231
20396
  this.name = "KiroTransportError";
20232
20397
  }
20233
20398
  };
20234
- function isRecord4(value) {
20399
+ function isRecord5(value) {
20235
20400
  return typeof value === "object" && value !== null && !Array.isArray(value);
20236
20401
  }
20237
20402
  function errorText(error51) {
@@ -20286,7 +20451,7 @@ function signalProcessTree(child, signal) {
20286
20451
  try {
20287
20452
  process.kill(-child.pid, signal);
20288
20453
  } catch (error51) {
20289
- if (!isRecord4(error51) || error51.code !== "ESRCH")
20454
+ if (!isRecord5(error51) || error51.code !== "ESRCH")
20290
20455
  throw error51;
20291
20456
  }
20292
20457
  }
@@ -20302,6 +20467,7 @@ var KiroAcpTransport = class {
20302
20467
  #initialize = null;
20303
20468
  #replay = null;
20304
20469
  #sessionId = null;
20470
+ #availableCommands = null;
20305
20471
  #stderrTail = "";
20306
20472
  #configUpdates = /* @__PURE__ */ new Set();
20307
20473
  constructor(options) {
@@ -20323,7 +20489,7 @@ var KiroAcpTransport = class {
20323
20489
  try {
20324
20490
  const initialize = await this.#ensureInitialized();
20325
20491
  const kiro = initialize.agentCapabilities?._meta?.kiro;
20326
- if (isRecord4(kiro) && Array.isArray(kiro.extensionMethods) && kiro.extensionMethods.includes("_kiro/config/template")) {
20492
+ if (isRecord5(kiro) && Array.isArray(kiro.extensionMethods) && kiro.extensionMethods.includes("_kiro/config/template")) {
20327
20493
  const connection = this.#connection;
20328
20494
  const method = initialize.authMethods?.[0];
20329
20495
  if (!connection || !method) {
@@ -20333,7 +20499,7 @@ var KiroAcpTransport = class {
20333
20499
  const deadline = Date.now() + this.#commandTimeoutMs;
20334
20500
  while (Date.now() < deadline) {
20335
20501
  const template = await withTimeout(connection.request("_kiro/config/template", {}), Math.max(1, deadline - Date.now()), "Kiro configuration discovery");
20336
- const catalog = parseKiroModelCatalog(isRecord4(template) ? template.configOptions : void 0);
20502
+ const catalog = parseKiroModelCatalog(isRecord5(template) ? template.configOptions : void 0);
20337
20503
  if (catalog.models.length > 0)
20338
20504
  return { ...initialize, catalog };
20339
20505
  await delay(Math.min(250, Math.max(0, deadline - Date.now())));
@@ -20510,7 +20676,7 @@ var KiroAcpTransport = class {
20510
20676
  }
20511
20677
  }
20512
20678
  }), this.#commandTimeoutMs, "Kiro Session fork");
20513
- if (!isRecord4(raw) || typeof raw.sessionId !== "string" || raw.sessionId.length === 0) {
20679
+ if (!isRecord5(raw) || typeof raw.sessionId !== "string" || raw.sessionId.length === 0) {
20514
20680
  throw new KiroTransportError("protocolError", "Kiro Fork returned no valid sessionId");
20515
20681
  }
20516
20682
  if (raw.sessionId === params.sourceSessionId) {
@@ -20526,7 +20692,7 @@ var KiroAcpTransport = class {
20526
20692
  cause: error51
20527
20693
  });
20528
20694
  }
20529
- const detail = isRecord4(error51.data) && typeof error51.data.details === "string" ? error51.data.details : error51.message;
20695
+ const detail = isRecord5(error51.data) && typeof error51.data.details === "string" ? error51.data.details : error51.message;
20530
20696
  if (/message.*not found/iu.test(detail)) {
20531
20697
  throw new KiroTransportError("checkpointNotFound", "Kiro no longer retains this fork position after compaction or rewind. Refresh history and fork from the latest retained position.", { cause: error51 });
20532
20698
  }
@@ -20643,12 +20809,23 @@ var KiroAcpTransport = class {
20643
20809
  this.#initialize = initialize;
20644
20810
  return initialize;
20645
20811
  }
20812
+ /** Latest ACP `available_commands_update` of the open Session, if any. */
20813
+ get availableCommands() {
20814
+ return this.#availableCommands;
20815
+ }
20646
20816
  #handleUpdate(params) {
20817
+ const commandsUpdate = params.update;
20818
+ if (commandsUpdate.sessionUpdate === "available_commands_update") {
20819
+ if (!this.#sessionId || params.sessionId === this.#sessionId) {
20820
+ this.#availableCommands = parseKiroAvailableCommands(commandsUpdate.availableCommands);
20821
+ }
20822
+ return;
20823
+ }
20647
20824
  for (const listener of this.#configUpdates)
20648
20825
  listener.update(params);
20649
20826
  const update = params.update;
20650
- const meta3 = isRecord4(update) && isRecord4(update._meta) ? update._meta : void 0;
20651
- const kiroMeta = meta3 && isRecord4(meta3.kiro) ? meta3.kiro : void 0;
20827
+ const meta3 = isRecord5(update) && isRecord5(update._meta) ? update._meta : void 0;
20828
+ const kiroMeta = meta3 && isRecord5(meta3.kiro) ? meta3.kiro : void 0;
20652
20829
  let event = null;
20653
20830
  if (update.sessionUpdate === "agent_message_chunk") {
20654
20831
  const isReplay = Boolean(kiroMeta?.replay);
@@ -20696,7 +20873,7 @@ var KiroAcpTransport = class {
20696
20873
  };
20697
20874
  } else if (update.sessionUpdate === "session_info_update") {
20698
20875
  if (kiroMeta?.kind === "summarization_completed") {
20699
- const summarization = isRecord4(kiroMeta.summarization) ? kiroMeta.summarization : void 0;
20876
+ const summarization = isRecord5(kiroMeta.summarization) ? kiroMeta.summarization : void 0;
20700
20877
  event = {
20701
20878
  type: "compaction.completed",
20702
20879
  outcome: summarization?.status === "success" ? "succeeded" : "failed",
@@ -20819,7 +20996,7 @@ var KIRO_COMMANDS = [
20819
20996
  var KIRO_COMMAND_CATALOG = harnessCommandCatalogSchema.parse({
20820
20997
  commands: KIRO_COMMANDS
20821
20998
  });
20822
- function isRecord5(value) {
20999
+ function isRecord6(value) {
20823
21000
  return typeof value === "object" && value !== null && !Array.isArray(value);
20824
21001
  }
20825
21002
  function cell(value) {
@@ -20850,11 +21027,11 @@ function formatKiroCommandResult(commandId, result) {
20850
21027
  return typeof value === "string" ? value.replace(/\bBearer\s+[A-Za-z0-9._~+/=-]+/giu, "Bearer [redacted]") : value;
20851
21028
  }, 2) ?? "null";
20852
21029
  const clean = JSON.parse(json2);
20853
- if (isRecord5(clean) && clean.success === false) {
21030
+ if (isRecord6(clean) && clean.success === false) {
20854
21031
  throw new Error("Kiro could not complete the requested query");
20855
21032
  }
20856
- const data = isRecord5(clean) && isRecord5(clean.data) ? clean.data : clean;
20857
- if (commandId === "kiro.usage" && isRecord5(data) && Array.isArray(data.usageBreakdowns)) {
21033
+ const data = isRecord6(clean) && isRecord6(clean.data) ? clean.data : clean;
21034
+ if (commandId === "kiro.usage" && isRecord6(data) && Array.isArray(data.usageBreakdowns)) {
20858
21035
  const sections = [
20859
21036
  "## Kiro Account Usage",
20860
21037
  table(["Account", "Value"], [
@@ -20863,7 +21040,7 @@ function formatKiroCommandResult(commandId, result) {
20863
21040
  ["Overages enabled", data.overagesEnabled]
20864
21041
  ]),
20865
21042
  "### Resources",
20866
- table(["Resource", "Used", "Limit", "Used (%)"], data.usageBreakdowns.filter(isRecord5).map((entry) => [
21043
+ table(["Resource", "Used", "Limit", "Used (%)"], data.usageBreakdowns.filter(isRecord6).map((entry) => [
20867
21044
  entry.displayName ?? entry.resourceType,
20868
21045
  entry.used,
20869
21046
  entry.hasLimit === false ? "No limit" : entry.limit,
@@ -20880,9 +21057,9 @@ function formatKiroCommandResult(commandId, result) {
20880
21057
  }
20881
21058
  return sections.join("\n\n");
20882
21059
  }
20883
- if (commandId === "kiro.context" && isRecord5(data) && isRecord5(data.breakdown)) {
21060
+ if (commandId === "kiro.context" && isRecord6(data) && isRecord6(data.breakdown)) {
20884
21061
  const breakdown = data.breakdown;
20885
- const percent = isRecord5(data.contextUsage) ? data.contextUsage.usagePercentage : data.usagePercentage;
21062
+ const percent = isRecord6(data.contextUsage) ? data.contextUsage.usagePercentage : data.usagePercentage;
20886
21063
  const sections = [
20887
21064
  "## Kiro Context Usage",
20888
21065
  ...typeof percent === "number" ? [`Context used: **${cell(percent)}%**`] : [],
@@ -20894,12 +21071,12 @@ function formatKiroCommandResult(commandId, result) {
20894
21071
  ["sessionFiles", "Session files"]
20895
21072
  ].flatMap(([key, label]) => {
20896
21073
  const entry = key ? breakdown[key] : void 0;
20897
- return isRecord5(entry) ? [[label, entry.tokens, entry.percent]] : [];
21074
+ return isRecord6(entry) ? [[label, entry.tokens, entry.percent]] : [];
20898
21075
  }))
20899
21076
  ];
20900
21077
  for (const key of ["contextFiles", "sessionFiles"]) {
20901
21078
  const entry = breakdown[key];
20902
- if (isRecord5(entry) && Array.isArray(entry.items) && entry.items.length > 0) {
21079
+ if (isRecord6(entry) && Array.isArray(entry.items) && entry.items.length > 0) {
20903
21080
  sections.push(`### ${key === "contextFiles" ? "Context Files" : "Session Files"}`, jsonBlock(JSON.stringify(entry.items, null, 2)));
20904
21081
  }
20905
21082
  }
@@ -21345,7 +21522,7 @@ function splitLines(text) {
21345
21522
  // dist/file-diff.js
21346
21523
  var DEFAULT_KIRO_FILE_CHANGE_TEXT_LIMIT = 4 * 1024 * 1024;
21347
21524
  var MAX_KIRO_FILE_CHANGES_PER_TOOL = 32;
21348
- function isRecord6(value) {
21525
+ function isRecord7(value) {
21349
21526
  return typeof value === "object" && value !== null && !Array.isArray(value);
21350
21527
  }
21351
21528
  function resolveFilePath(candidate) {
@@ -21418,7 +21595,7 @@ function projectKiroFileChanges(content, cwd, textLimit = DEFAULT_KIRO_FILE_CHAN
21418
21595
  return null;
21419
21596
  const candidates = [];
21420
21597
  for (const entry of content) {
21421
- if (isRecord6(entry) && entry.type === "diff")
21598
+ if (isRecord7(entry) && entry.type === "diff")
21422
21599
  candidates.push(entry);
21423
21600
  }
21424
21601
  if (candidates.length === 0 || candidates.length > MAX_KIRO_FILE_CHANGES_PER_TOOL)
@@ -21438,7 +21615,7 @@ function projectKiroFileChanges(content, cwd, textLimit = DEFAULT_KIRO_FILE_CHAN
21438
21615
  }
21439
21616
 
21440
21617
  // dist/projection.js
21441
- function isRecord7(value) {
21618
+ function isRecord8(value) {
21442
21619
  return typeof value === "object" && value !== null && !Array.isArray(value);
21443
21620
  }
21444
21621
  function projectKiroUserInput(interactionId, turnId, params, itemId) {
@@ -21518,7 +21695,7 @@ function projectKiroUserInput(interactionId, turnId, params, itemId) {
21518
21695
  }
21519
21696
  function projectKiroRequirementQuestion(interactionId, turnId, request) {
21520
21697
  const meta3 = request._meta?.kiro;
21521
- if (!isRecord7(meta3) || meta3.kind !== "analyze-requirements")
21698
+ if (!isRecord8(meta3) || meta3.kind !== "analyze-requirements")
21522
21699
  return null;
21523
21700
  if (request.options.length === 0 || request.options.some((option) => option.kind !== "allow_once" || !option.optionId.trim() || !option.name.trim()) || new Set(request.options.map((option) => option.optionId)).size !== request.options.length)
21524
21701
  throw new Error("Kiro returned invalid requirement choices");
@@ -21577,13 +21754,13 @@ function projectKiroPermission(interactionId, turnId, request) {
21577
21754
  const responses = /* @__PURE__ */ new Map();
21578
21755
  let description;
21579
21756
  const rawRequest = request;
21580
- const meta3 = isRecord7(rawRequest._meta) ? rawRequest._meta : void 0;
21581
- const kiroMeta = meta3 && isRecord7(meta3.kiro) ? meta3.kiro : void 0;
21757
+ const meta3 = isRecord8(rawRequest._meta) ? rawRequest._meta : void 0;
21758
+ const kiroMeta = meta3 && isRecord8(meta3.kiro) ? meta3.kiro : void 0;
21582
21759
  if (kiroMeta && kiroMeta.type === "turn_approval") {
21583
- const files = Array.isArray(kiroMeta.files) ? kiroMeta.files.flatMap((file2) => isRecord7(file2) && typeof file2.path === "string" ? [file2.path] : []) : [];
21760
+ const files = Array.isArray(kiroMeta.files) ? kiroMeta.files.flatMap((file2) => isRecord8(file2) && typeof file2.path === "string" ? [file2.path] : []) : [];
21584
21761
  description = ["Review modified files for this turn", ...files].join("\n");
21585
21762
  }
21586
- const consent = kiroMeta && isRecord7(kiroMeta.consent) ? kiroMeta.consent : void 0;
21763
+ const consent = kiroMeta && isRecord8(kiroMeta.consent) ? kiroMeta.consent : void 0;
21587
21764
  if (consent) {
21588
21765
  const resource = consent.triggeringResource ?? consent.resource;
21589
21766
  if (typeof resource === "string" && resource.trim())
@@ -21656,10 +21833,10 @@ function projectKiroPermission(interactionId, turnId, request) {
21656
21833
  function projectKiroToolCall(itemId, toolCall) {
21657
21834
  const hostItemId = hostItemIdSchema.parse(itemId);
21658
21835
  const meta3 = toolCall.metadata;
21659
- const kiroMeta = meta3 && isRecord7(meta3.kiro) ? meta3.kiro : void 0;
21836
+ const kiroMeta = meta3 && isRecord8(meta3.kiro) ? meta3.kiro : void 0;
21660
21837
  if (kiroMeta && kiroMeta.kind === "agent-subtask") {
21661
21838
  const subtaskId = typeof kiroMeta.agentSubtaskId === "string" ? kiroMeta.agentSubtaskId : toolCall.toolCallId;
21662
- const input = isRecord7(toolCall.rawInput) ? toolCall.rawInput : {};
21839
+ const input = isRecord8(toolCall.rawInput) ? toolCall.rawInput : {};
21663
21840
  const subagentState = {
21664
21841
  subagentId: subtaskId,
21665
21842
  description: typeof input.prompt === "string" ? input.prompt : "Subagent task",
@@ -21678,12 +21855,12 @@ function projectKiroToolCall(itemId, toolCall) {
21678
21855
  }
21679
21856
  if (toolCall.kind === "execute" || typeof toolCall.name === "string" && toolCall.name.toLowerCase().includes("execute")) {
21680
21857
  let command = "execute";
21681
- if (isRecord7(toolCall.rawInput) && typeof toolCall.rawInput.command === "string") {
21858
+ if (isRecord8(toolCall.rawInput) && typeof toolCall.rawInput.command === "string") {
21682
21859
  command = toolCall.rawInput.command;
21683
21860
  }
21684
21861
  let exitCode;
21685
21862
  let output2;
21686
- if (isRecord7(toolCall.rawOutput)) {
21863
+ if (isRecord8(toolCall.rawOutput)) {
21687
21864
  if (typeof toolCall.rawOutput.exitCode === "number") {
21688
21865
  exitCode = toolCall.rawOutput.exitCode;
21689
21866
  }
@@ -21714,7 +21891,7 @@ function projectKiroToolCall(itemId, toolCall) {
21714
21891
  type: "toolExecution",
21715
21892
  itemId: hostItemId,
21716
21893
  toolName: toolCall.name || toolCall.title || "tool",
21717
- arguments: isRecord7(toolCall.rawInput) ? toolCall.rawInput : {},
21894
+ arguments: isRecord8(toolCall.rawInput) ? toolCall.rawInput : {},
21718
21895
  ...output !== void 0 ? { output } : {}
21719
21896
  };
21720
21897
  return toolItem;
@@ -21924,7 +22101,7 @@ var KiroTurnOutput = class {
21924
22101
  };
21925
22102
 
21926
22103
  // dist/usage.js
21927
- function isRecord8(value) {
22104
+ function isRecord9(value) {
21928
22105
  return typeof value === "object" && value !== null && !Array.isArray(value);
21929
22106
  }
21930
22107
  function nonNegative(value) {
@@ -21934,7 +22111,7 @@ var KiroUsage = class {
21934
22111
  #credits = /* @__PURE__ */ new Map();
21935
22112
  #contextUsagePercent;
21936
22113
  observe(value) {
21937
- if (!isRecord8(value))
22114
+ if (!isRecord9(value))
21938
22115
  return;
21939
22116
  if (value.kind === "context_usage")
21940
22117
  this.context(value);
@@ -21943,8 +22120,8 @@ var KiroUsage = class {
21943
22120
  const key = Array.isArray(ids) && ids.length > 0 && ids.every((id) => typeof id === "string" && id.length > 0) ? `requests:${JSON.stringify([...new Set(ids)].sort())}` : typeof value.executionId === "string" && value.executionId.length > 0 ? `execution:${value.executionId}` : void 0;
21944
22121
  if (!key || !Array.isArray(value.promptTurnSummaries))
21945
22122
  return;
21946
- const credits = value.promptTurnSummaries.filter((entry) => isRecord8(entry) && entry.unit === "credit");
21947
- if (credits.length === 0 || !credits.every((entry) => isRecord8(entry) && nonNegative(entry.usage)))
22123
+ const credits = value.promptTurnSummaries.filter((entry) => isRecord9(entry) && entry.unit === "credit");
22124
+ if (credits.length === 0 || !credits.every((entry) => isRecord9(entry) && nonNegative(entry.usage)))
21948
22125
  return;
21949
22126
  const total = credits.reduce((sum, entry) => sum + entry.usage, 0);
21950
22127
  if (nonNegative(total))
@@ -21952,9 +22129,9 @@ var KiroUsage = class {
21952
22129
  }
21953
22130
  }
21954
22131
  context(value) {
21955
- if (!isRecord8(value))
22132
+ if (!isRecord9(value))
21956
22133
  return;
21957
- const percent = isRecord8(value.contextUsage) ? value.contextUsage.usagePercentage : value.usagePercentage;
22134
+ const percent = isRecord9(value.contextUsage) ? value.contextUsage.usagePercentage : value.usagePercentage;
21958
22135
  if (nonNegative(percent))
21959
22136
  this.#contextUsagePercent = percent;
21960
22137
  }
@@ -22009,7 +22186,7 @@ function encodeKiroPermissionMode(nativeValue) {
22009
22186
  }
22010
22187
 
22011
22188
  // dist/history.js
22012
- function isRecord9(value) {
22189
+ function isRecord10(value) {
22013
22190
  return typeof value === "object" && value !== null && !Array.isArray(value);
22014
22191
  }
22015
22192
  function kiroHomeDir(environment = process.env) {
@@ -22054,7 +22231,7 @@ async function readKiroNativeMessages(sessionDirectory) {
22054
22231
  const raw = await readFile(messagesFile, "utf8");
22055
22232
  return raw.split("\n").map((line) => line.trim()).filter((line) => line.length > 0).map((line) => {
22056
22233
  const row = JSON.parse(line);
22057
- if (!isRecord9(row) || typeof row.id !== "string" || !isRecord9(row.payload) || typeof row.payload.type !== "string")
22234
+ if (!isRecord10(row) || typeof row.id !== "string" || !isRecord10(row.payload) || typeof row.payload.type !== "string")
22058
22235
  throw new Error("Invalid Kiro history row");
22059
22236
  return row;
22060
22237
  });
@@ -22248,7 +22425,7 @@ async function readKiroSnapshot(location) {
22248
22425
  kind: row.payload.kind,
22249
22426
  rawInput: row.payload.args ?? row.payload.rawInput,
22250
22427
  rawOutput: result?.payload.content ?? result?.payload.rawOutput,
22251
- ...isRecord9(row.payload._meta) ? { metadata: row.payload._meta } : {},
22428
+ ...isRecord10(row.payload._meta) ? { metadata: row.payload._meta } : {},
22252
22429
  status: succeeded ? "completed" : "failed"
22253
22430
  }),
22254
22431
  outcome: toolOutcome
@@ -22317,7 +22494,7 @@ async function readKiroSnapshot(location) {
22317
22494
  }
22318
22495
 
22319
22496
  // dist/kiro-adapter.js
22320
- function isRecord10(value) {
22497
+ function isRecord11(value) {
22321
22498
  return typeof value === "object" && value !== null && !Array.isArray(value);
22322
22499
  }
22323
22500
  var KIRO_SESSION_CAPABILITIES = {
@@ -22343,6 +22520,7 @@ var KIRO_SESSION_CAPABILITIES = {
22343
22520
  var KiroAdapter = class {
22344
22521
  harnessId = harnessIdSchema.parse("kiro-cli");
22345
22522
  commandCatalog = KIRO_COMMAND_CATALOG;
22523
+ liveCommandCatalog = true;
22346
22524
  #options;
22347
22525
  #deps;
22348
22526
  #sessions = /* @__PURE__ */ new Set();
@@ -22414,7 +22592,7 @@ var KiroAdapter = class {
22414
22592
  const transport = this.#createTransport(cwd);
22415
22593
  try {
22416
22594
  const initialize = await transport.inspect();
22417
- const modelCatalog = isRecord10(initialize) && isRecord10(initialize.catalog) ? initialize.catalog : parseKiroModelCatalog(isRecord10(initialize) ? initialize.configOptions : void 0);
22595
+ const modelCatalog = isRecord11(initialize) && isRecord11(initialize.catalog) ? initialize.catalog : parseKiroModelCatalog(isRecord11(initialize) ? initialize.configOptions : void 0);
22418
22596
  if (modelCatalog.models.length === 0)
22419
22597
  throw new Error("Kiro returned no native model catalog");
22420
22598
  return {
@@ -22754,7 +22932,7 @@ var KiroSession = class {
22754
22932
  };
22755
22933
  this.outputs = this.#channel.outputs;
22756
22934
  this.commands = {
22757
- list: async () => ({ ok: true, value: KIRO_COMMAND_CATALOG }),
22935
+ list: async () => ({ ok: true, value: this.#liveCommandCatalog() }),
22758
22936
  execute: async (cmd) => this.#executeHarnessCommand(cmd)
22759
22937
  };
22760
22938
  }
@@ -22835,7 +23013,7 @@ var KiroSession = class {
22835
23013
  }
22836
23014
  };
22837
23015
  } catch (error51) {
22838
- if (this.#newSessionWithoutTurn && isRecord10(error51) && error51.code === "ENOENT") {
23016
+ if (this.#newSessionWithoutTurn && isRecord11(error51) && error51.code === "ENOENT") {
22839
23017
  return { ok: true, value: { turns: [], state: this.#state() } };
22840
23018
  }
22841
23019
  return {
@@ -22914,7 +23092,7 @@ var KiroSession = class {
22914
23092
  if (event.type === "usage") {
22915
23093
  this.observeUsage(event);
22916
23094
  const meta3 = event.metadata?.kiro;
22917
- if (isRecord10(meta3) && meta3.kind === "user_message_id_assigned" && typeof meta3.userMessageId === "string") {
23095
+ if (isRecord11(meta3) && meta3.kind === "user_message_id_assigned" && typeof meta3.userMessageId === "string") {
22918
23096
  assignedUserMessageId = meta3.userMessageId;
22919
23097
  }
22920
23098
  } else if (event.type === "compaction.completed") {
@@ -22996,7 +23174,7 @@ var KiroSession = class {
22996
23174
  });
22997
23175
  })
22998
23176
  ]);
22999
- if (isRecord10(promptResult) && promptResult.stopReason === "cancelled") {
23177
+ if (isRecord11(promptResult) && promptResult.stopReason === "cancelled") {
23000
23178
  turnOutcome = { status: "cancelled", reason: "User cancelled" };
23001
23179
  } else {
23002
23180
  turnOutcome = { status: "succeeded" };
@@ -23262,7 +23440,21 @@ var KiroSession = class {
23262
23440
  ...this.#thinking
23263
23441
  };
23264
23442
  }
23443
+ /** Built-ins plus the steering, agent and skill commands the open Session advertises. */
23444
+ #liveCommandCatalog() {
23445
+ const native = this.#transport.availableCommands ?? null;
23446
+ return mergeLiveHarnessCommands(KIRO_COMMAND_CATALOG, KIRO_LIVE_COMMAND_ID_PREFIX, native ? kiroLiveCommands(native) : null);
23447
+ }
23265
23448
  async #executeHarnessCommand(command) {
23449
+ const livePrompt = liveHarnessCommandPrompt(this.#liveCommandCatalog(), KIRO_LIVE_COMMAND_ID_PREFIX, command.commandId, command.arguments?.text);
23450
+ if (livePrompt !== null) {
23451
+ const started = await this.execute({
23452
+ type: "turn.start",
23453
+ turnId: hostTurnIdSchema.parse(command.turnId),
23454
+ input: [{ type: "text", text: livePrompt }]
23455
+ });
23456
+ return started.ok ? { ok: true, value: { turnId: command.turnId } } : started;
23457
+ }
23266
23458
  if (this.#closed)
23267
23459
  return {
23268
23460
  ok: false,
@@ -23311,7 +23503,7 @@ var KiroSession = class {
23311
23503
  }
23312
23504
  });
23313
23505
  const result2 = await Promise.race([stopped, this.#transport.compact()]);
23314
- if (isRecord10(result2) && result2.success === false) {
23506
+ if (isRecord11(result2) && result2.success === false) {
23315
23507
  throw new Error("Kiro context compaction did not complete");
23316
23508
  }
23317
23509
  this.#channel.emit({