@liberseek/boft-cli-win32-arm64 0.7.5 → 0.7.6

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.
@@ -7,7 +7,7 @@ var __export = (target, all) => {
7
7
 
8
8
  // dist/kiro-adapter.js
9
9
  import { randomUUID } from "node:crypto";
10
- import path6 from "node:path";
10
+ import path7 from "node:path";
11
11
 
12
12
  // ../../../node_modules/zod/v4/classic/external.js
13
13
  var external_exports = {};
@@ -775,10 +775,10 @@ function mergeDefs(...defs) {
775
775
  function cloneDef(schema) {
776
776
  return mergeDefs(schema._zod.def);
777
777
  }
778
- function getElementAtPath(obj, path7) {
779
- if (!path7)
778
+ function getElementAtPath(obj, path8) {
779
+ if (!path8)
780
780
  return obj;
781
- return path7.reduce((acc, key) => acc?.[key], obj);
781
+ return path8.reduce((acc, key) => acc?.[key], obj);
782
782
  }
783
783
  function promiseAllObject(promisesObj) {
784
784
  const keys = Object.keys(promisesObj);
@@ -1187,11 +1187,11 @@ function explicitlyAborted(x, startIndex = 0) {
1187
1187
  }
1188
1188
  return false;
1189
1189
  }
1190
- function prefixIssues(path7, issues) {
1190
+ function prefixIssues(path8, issues) {
1191
1191
  return issues.map((iss) => {
1192
1192
  var _a3;
1193
1193
  (_a3 = iss).path ?? (_a3.path = []);
1194
- iss.path.unshift(path7);
1194
+ iss.path.unshift(path8);
1195
1195
  return iss;
1196
1196
  });
1197
1197
  }
@@ -1338,16 +1338,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
1338
1338
  }
1339
1339
  function formatError(error51, mapper = (issue2) => issue2.message) {
1340
1340
  const fieldErrors = { _errors: [] };
1341
- const processError = (error52, path7 = []) => {
1341
+ const processError = (error52, path8 = []) => {
1342
1342
  for (const issue2 of error52.issues) {
1343
1343
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1344
- issue2.errors.map((issues) => processError({ issues }, [...path7, ...issue2.path]));
1344
+ issue2.errors.map((issues) => processError({ issues }, [...path8, ...issue2.path]));
1345
1345
  } else if (issue2.code === "invalid_key") {
1346
- processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
1346
+ processError({ issues: issue2.issues }, [...path8, ...issue2.path]);
1347
1347
  } else if (issue2.code === "invalid_element") {
1348
- processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
1348
+ processError({ issues: issue2.issues }, [...path8, ...issue2.path]);
1349
1349
  } else {
1350
- const fullpath = [...path7, ...issue2.path];
1350
+ const fullpath = [...path8, ...issue2.path];
1351
1351
  if (fullpath.length === 0) {
1352
1352
  fieldErrors._errors.push(mapper(issue2));
1353
1353
  } else {
@@ -1374,17 +1374,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
1374
1374
  }
1375
1375
  function treeifyError(error51, mapper = (issue2) => issue2.message) {
1376
1376
  const result = { errors: [] };
1377
- const processError = (error52, path7 = []) => {
1377
+ const processError = (error52, path8 = []) => {
1378
1378
  var _a3, _b;
1379
1379
  for (const issue2 of error52.issues) {
1380
1380
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1381
- issue2.errors.map((issues) => processError({ issues }, [...path7, ...issue2.path]));
1381
+ issue2.errors.map((issues) => processError({ issues }, [...path8, ...issue2.path]));
1382
1382
  } else if (issue2.code === "invalid_key") {
1383
- processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
1383
+ processError({ issues: issue2.issues }, [...path8, ...issue2.path]);
1384
1384
  } else if (issue2.code === "invalid_element") {
1385
- processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
1385
+ processError({ issues: issue2.issues }, [...path8, ...issue2.path]);
1386
1386
  } else {
1387
- const fullpath = [...path7, ...issue2.path];
1387
+ const fullpath = [...path8, ...issue2.path];
1388
1388
  if (fullpath.length === 0) {
1389
1389
  result.errors.push(mapper(issue2));
1390
1390
  continue;
@@ -1416,8 +1416,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
1416
1416
  }
1417
1417
  function toDotPath(_path) {
1418
1418
  const segs = [];
1419
- const path7 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
1420
- for (const seg of path7) {
1419
+ const path8 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
1420
+ for (const seg of path8) {
1421
1421
  if (typeof seg === "number")
1422
1422
  segs.push(`[${seg}]`);
1423
1423
  else if (typeof seg === "symbol")
@@ -14109,13 +14109,13 @@ function resolveRef(ref, ctx) {
14109
14109
  if (!ref.startsWith("#")) {
14110
14110
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
14111
14111
  }
14112
- const path7 = ref.slice(1).split("/").filter(Boolean);
14113
- if (path7.length === 0) {
14112
+ const path8 = ref.slice(1).split("/").filter(Boolean);
14113
+ if (path8.length === 0) {
14114
14114
  return ctx.rootSchema;
14115
14115
  }
14116
14116
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
14117
- if (path7[0] === defsKey) {
14118
- const key = path7[1];
14117
+ if (path8[0] === defsKey) {
14118
+ const key = path8[1];
14119
14119
  if (!key || !ctx.defs[key]) {
14120
14120
  throw new Error(`Reference not found: ${ref}`);
14121
14121
  }
@@ -14578,6 +14578,55 @@ var credentialImportsParamsSchema = external_exports.object({
14578
14578
  request: credentialImportsRequestSchema
14579
14579
  }).strict();
14580
14580
 
14581
+ // ../../shared-contracts/dist/harness-display-settings.js
14582
+ var harnessDisplayEntriesSchema = external_exports.array(external_exports.strictObject({
14583
+ agent: external_exports.string().min(1).max(128),
14584
+ section: external_exports.enum(["main", "more", "auto"])
14585
+ })).max(256).refine((entries) => new Set(entries.map((entry) => entry.agent)).size === entries.length, "Duplicate Harness IDs");
14586
+ var harnessDisplaySettingsSchema = external_exports.strictObject({
14587
+ entries: harnessDisplayEntriesSchema.nullable()
14588
+ });
14589
+ var harnessDisplayGetSchema = external_exports.strictObject({});
14590
+ var harnessDisplaySetSchema = external_exports.strictObject({
14591
+ entries: harnessDisplayEntriesSchema,
14592
+ /** Import legacy Desktop preferences only if no shared settings exist yet. */
14593
+ initializeOnly: external_exports.boolean().optional()
14594
+ });
14595
+
14596
+ // ../../shared-contracts/dist/console.js
14597
+ var consoleAnnouncementSchema = external_exports.strictObject({
14598
+ title: external_exports.string().trim().min(1).max(200),
14599
+ type: external_exports.enum(["info", "warning", "danger"]),
14600
+ body: external_exports.string().trim().min(1).max(16 * 1024)
14601
+ });
14602
+ var consoleOpenParamsSchema = external_exports.strictObject({});
14603
+ var consoleOpenResultSchema = external_exports.strictObject({
14604
+ /** The console address. */
14605
+ url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
14606
+ });
14607
+ var CONSOLE_HOST_METHODS = Object.freeze([
14608
+ "codexhost/harness/plugins/list",
14609
+ "codexhost/harness/display-settings/get",
14610
+ "codexhost/harness/display-settings/set",
14611
+ "codexhost/harness/inspect",
14612
+ "codexhost/harness/launch-settings/get",
14613
+ "codexhost/harness/launch-settings/set",
14614
+ "codexhost/harness/web-ui/open",
14615
+ "codexhost/harness/accounts/sources",
14616
+ "codexhost/harness/accounts/list",
14617
+ "codexhost/harness/accounts/inspect",
14618
+ "codexhost/harness/credential-imports",
14619
+ "codexhost/harness/session-import/sources",
14620
+ "codexhost/harness/session-import/list",
14621
+ "codexhost/harness/session-import/import",
14622
+ "codexhost/account/list",
14623
+ "codexhost/account/refresh",
14624
+ "codexhost/account/usage/inspect",
14625
+ "codexhost/update/check",
14626
+ "codexhost/update/start",
14627
+ "codexhost/update/status"
14628
+ ]);
14629
+
14581
14630
  // ../../shared-contracts/dist/version.js
14582
14631
  var WORKSPACE_CONTRACT_VERSION = 1;
14583
14632
 
@@ -14631,6 +14680,12 @@ var hostTurnIdSchema = opaqueIdSchema.brand();
14631
14680
  var hostItemIdSchema = opaqueIdSchema.brand();
14632
14681
  var hostInteractionIdSchema = opaqueIdSchema.brand();
14633
14682
 
14683
+ // ../../shared-contracts/dist/manual-compaction.js
14684
+ var threadManualCompactionStartedSchema = external_exports.strictObject({
14685
+ threadId: hostThreadIdSchema,
14686
+ turnId: hostTurnIdSchema
14687
+ });
14688
+
14634
14689
  // ../../shared-contracts/dist/thread-usage.js
14635
14690
  var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
14636
14691
  var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
@@ -14691,6 +14746,10 @@ var threadUsageSnapshotSchema = external_exports.object({
14691
14746
  var usagePercentSchema = external_exports.number().finite().min(0).max(100);
14692
14747
  var accountCreditsProductUsageSchema = external_exports.object({
14693
14748
  product: external_exports.string().min(1),
14749
+ used: external_exports.number().finite().nonnegative().optional(),
14750
+ // Zero is a real empty cap, not an absent field.
14751
+ limit: external_exports.number().finite().nonnegative().optional(),
14752
+ unit: external_exports.string().min(1).max(32).optional(),
14694
14753
  usagePercent: usagePercentSchema,
14695
14754
  resetsAt: external_exports.string().min(1).optional()
14696
14755
  }).strict();
@@ -14700,11 +14759,14 @@ var accountResetCreditsSchema = external_exports.object({
14700
14759
  expiresAt: external_exports.array(external_exports.string().min(1)).min(1).max(32).optional()
14701
14760
  }).strict();
14702
14761
  var accountCreditsSnapshotSchema = external_exports.object({
14762
+ used: external_exports.number().finite().nonnegative().optional(),
14763
+ // Zero is a real empty cap, not an absent field.
14764
+ limit: external_exports.number().finite().nonnegative().optional(),
14765
+ unit: external_exports.string().trim().min(1).max(32).optional(),
14703
14766
  /** Native label when the primary limit is scoped to a model or product group. */
14704
14767
  label: external_exports.string().min(1).optional(),
14705
14768
  usedPercent: usagePercentSchema.optional(),
14706
14769
  remaining: external_exports.number().finite().optional(),
14707
- unit: external_exports.string().trim().min(1).max(32).optional(),
14708
14770
  resetsAt: external_exports.string().min(1).optional(),
14709
14771
  periodType: external_exports.enum(["weekly", "monthly", "five_hour", "seven_day", "unknown"]),
14710
14772
  productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
@@ -14735,12 +14797,27 @@ var threadUsageInspectionSchema = external_exports.object({
14735
14797
  }).strict();
14736
14798
 
14737
14799
  // ../../shared-contracts/dist/harness-accounts.js
14738
- var harnessAccountSnapshotSchema = external_exports.object({
14800
+ var accountBalanceSnapshotSchema = external_exports.object({
14801
+ amount: external_exports.number().finite().nonnegative(),
14802
+ /** ISO 4217 code as reported by the Provider, for example `CNY`. */
14803
+ currency: external_exports.string().trim().min(1).max(8),
14804
+ /** Native label when the Harness exposes several Billing Sources. */
14805
+ label: external_exports.string().trim().min(1).max(128).optional()
14806
+ }).strict();
14807
+ var harnessAccountSnapshotObject = external_exports.object({
14739
14808
  email: external_exports.string().trim().min(1).max(320).optional(),
14740
14809
  label: external_exports.string().trim().min(1).max(256).optional(),
14741
14810
  plan: external_exports.string().trim().min(1).max(128).optional(),
14742
- credits: accountCreditsSnapshotSchema
14811
+ credits: accountCreditsSnapshotSchema.optional(),
14812
+ balance: accountBalanceSnapshotSchema.optional()
14743
14813
  }).strict();
14814
+ function requireReportedQuota(schema) {
14815
+ return schema.refine((value) => {
14816
+ const reported = value;
14817
+ return reported.credits !== void 0 || reported.balance !== void 0;
14818
+ }, { message: "Account must report either credits or a balance" });
14819
+ }
14820
+ var harnessAccountSnapshotSchema = requireReportedQuota(harnessAccountSnapshotObject);
14744
14821
  var harnessAccountIdentityShape = {
14745
14822
  harnessId: harnessIdSchema,
14746
14823
  harnessName: external_exports.string().trim().min(1).max(128)
@@ -14751,11 +14828,13 @@ var harnessAccountSourceListResultSchema = external_exports.object({ sources: ex
14751
14828
  var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
14752
14829
  var harnessAccountInspectResultSchema = external_exports.object({
14753
14830
  ...harnessAccountIdentityShape,
14754
- account: harnessAccountSnapshotSchema.nullable()
14831
+ account: harnessAccountSnapshotSchema.nullable(),
14832
+ /** Every Billing Source from one Harness; `account` remains the first for older clients. */
14833
+ accounts: external_exports.array(harnessAccountSnapshotSchema).max(8).optional()
14755
14834
  }).strict();
14756
14835
  var harnessAccountListParamsSchema = external_exports.object({ refresh: external_exports.boolean().optional() }).strict();
14757
14836
  var harnessAccountListResultSchema = external_exports.object({
14758
- accounts: external_exports.array(harnessAccountSnapshotSchema.extend(harnessAccountIdentityShape)).max(128)
14837
+ accounts: external_exports.array(requireReportedQuota(harnessAccountSnapshotObject.extend(harnessAccountIdentityShape))).max(128)
14759
14838
  }).strict();
14760
14839
 
14761
14840
  // ../../shared-contracts/dist/json-value.js
@@ -14893,6 +14972,8 @@ var harnessModelSchema = external_exports.object({
14893
14972
  ref: harnessModelRefSchema,
14894
14973
  label: nonBlankTextSchema2.max(HARNESS_MODEL_LABEL_MAX_LENGTH),
14895
14974
  resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
14975
+ /** Optional opaque selection for this same Model with priority processing enabled. */
14976
+ fastModel: harnessModelRefSchema.optional(),
14896
14977
  supportedThinkingOptionIds: external_exports.array(harnessThinkingOptionIdSchema).optional()
14897
14978
  }).strict();
14898
14979
  var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionSchema).superRefine((options, context) => {
@@ -14925,6 +15006,16 @@ var harnessModelCatalogSchema = external_exports.object({
14925
15006
  });
14926
15007
  }
14927
15008
  refs.add(model.ref.id);
15009
+ if (model.fastModel) {
15010
+ if (refs.has(model.fastModel.id) || catalog.models.some((entry) => entry.ref.id === model.fastModel?.id)) {
15011
+ context.addIssue({
15012
+ code: "custom",
15013
+ message: "Fast Model refs must be distinct and unique",
15014
+ path: ["models", index, "fastModel"]
15015
+ });
15016
+ }
15017
+ refs.add(model.fastModel.id);
15018
+ }
14928
15019
  const supportedThinkingIds = /* @__PURE__ */ new Set();
14929
15020
  for (const [optionIndex, optionId] of (model.supportedThinkingOptionIds ?? []).entries()) {
14930
15021
  if (supportedThinkingIds.has(optionId)) {
@@ -15047,11 +15138,13 @@ var threadThinkingSelectParamsSchema = external_exports.object({
15047
15138
  thinkingOptionId: harnessThinkingOptionIdSchema
15048
15139
  }).strict();
15049
15140
  var threadInspectionParamsSchema = external_exports.object({
15050
- threadId: hostThreadIdSchema
15141
+ threadId: hostThreadIdSchema,
15142
+ includeReferenceCapability: external_exports.boolean().optional()
15051
15143
  }).strict();
15052
15144
  var codexThreadInspectionSchema = external_exports.object({
15053
15145
  owner: external_exports.literal("codex"),
15054
- locked: external_exports.literal(true)
15146
+ locked: external_exports.literal(true),
15147
+ supportsThreadReferences: external_exports.literal(true).optional()
15055
15148
  }).strict();
15056
15149
  var externalThreadInspectionSchema = external_exports.object({
15057
15150
  owner: external_exports.literal("external"),
@@ -15179,10 +15272,31 @@ var harnessLaunchSettingsSchema = external_exports.object({
15179
15272
  restartRequired: external_exports.boolean()
15180
15273
  }).strict();
15181
15274
 
15275
+ // ../../shared-contracts/dist/harness-installation.js
15276
+ var harnessInstallationParamsSchema = external_exports.object({
15277
+ harnessId: harnessIdSchema,
15278
+ action: external_exports.enum(["check", "update"])
15279
+ }).strict();
15280
+ var harnessInstallationStateSchema = external_exports.object({
15281
+ currentVersion: external_exports.string().min(1).max(128),
15282
+ latestVersion: external_exports.string().min(1).max(128),
15283
+ updateAvailable: external_exports.boolean(),
15284
+ canUpdate: external_exports.boolean(),
15285
+ message: external_exports.string().max(2048).optional()
15286
+ }).strict();
15287
+
15182
15288
  // ../../shared-contracts/dist/codex-accounts.js
15183
15289
  var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
15184
15290
  var nonBlankTextSchema3 = external_exports.string().trim().min(1);
15185
15291
  var codexAccountAuthKindSchema = external_exports.enum(["api", "chatgpt"]);
15292
+ var codexAccountSiteUrlPattern = /^https?:\/\/(?:\[[0-9a-fA-F:]+\]|[^/\s:@?#]+)(?::\d{1,5})?(?:[/?#][^\s]*)?$/u;
15293
+ function isCodexAccountSiteUrl(value) {
15294
+ return value.length > 0 && value.length <= 2048 && codexAccountSiteUrlPattern.test(value);
15295
+ }
15296
+ var externalUrlOpenParamsSchema = external_exports.object({
15297
+ url: external_exports.string().max(2048).refine(isCodexAccountSiteUrl, "External URL must be http(s)")
15298
+ }).strict();
15299
+ var externalUrlOpenResultSchema = external_exports.object({}).strict();
15186
15300
  var codexAccountPlanTypeSchema = external_exports.enum([
15187
15301
  "free",
15188
15302
  "go",
@@ -15208,7 +15322,8 @@ var codexAccountSchema = external_exports.object({
15208
15322
  email: external_exports.string().email().max(320).optional(),
15209
15323
  planType: codexAccountPlanTypeSchema.optional(),
15210
15324
  authKind: codexAccountAuthKindSchema.optional(),
15211
- authIdentity: nonBlankTextSchema3.max(256).optional()
15325
+ authIdentity: nonBlankTextSchema3.max(256).optional(),
15326
+ siteUrl: external_exports.string().refine(isCodexAccountSiteUrl, "Account site URL must be http(s)").optional()
15212
15327
  }).strict();
15213
15328
  var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
15214
15329
  var codexAccountListResultSchema = external_exports.object({
@@ -15803,7 +15918,7 @@ function mergeLiveHarnessCommands(builtIns, idPrefix, live, exclusions = {}) {
15803
15918
  // dist/acp-transport.js
15804
15919
  import { spawn, spawnSync } from "node:child_process";
15805
15920
  import { Readable, Writable } from "node:stream";
15806
- import { execFile } from "node:child_process";
15921
+ import { execFile as execFile2 } from "node:child_process";
15807
15922
  import { promisify } from "node:util";
15808
15923
  import { setTimeout as delay } from "node:timers/promises";
15809
15924
 
@@ -15869,6 +15984,20 @@ function commandInvocation(command, arguments_, environment, platform = process.
15869
15984
  };
15870
15985
  }
15871
15986
 
15987
+ // ../../harness-discovery/dist/node-runtime.js
15988
+ import path3 from "node:path";
15989
+ function withNodeRuntimeOnPath(environment, runtimeExecutable = process.execPath, platform = process.platform) {
15990
+ const pathKey = Object.keys(environment).find((name) => name.toLowerCase() === "path") ?? "PATH";
15991
+ const delimiter = platform === "win32" ? ";" : ":";
15992
+ const runtimeDirectory = path3.dirname(runtimeExecutable);
15993
+ const directories = (environment[pathKey] ?? "").split(delimiter).filter(Boolean);
15994
+ const equal = platform === "win32" ? (value) => value.toLowerCase() : (value) => value;
15995
+ if (!directories.some((directory) => equal(directory) === equal(runtimeDirectory))) {
15996
+ directories.push(runtimeDirectory);
15997
+ }
15998
+ return { ...environment, [pathKey]: directories.join(delimiter) };
15999
+ }
16000
+
15872
16001
  // ../../harness-discovery/dist/resolve.js
15873
16002
  import os from "node:os";
15874
16003
 
@@ -16032,6 +16161,40 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
16032
16161
  return void 0;
16033
16162
  }
16034
16163
 
16164
+ // ../../harness-discovery/dist/installation.js
16165
+ import { execFile } from "node:child_process";
16166
+ import { homedir } from "node:os";
16167
+ function runInstallationCommand(command, args, environment, timeout = 3e4) {
16168
+ const env = withNodeRuntimeOnPath(environment);
16169
+ const invocation = /\.[cm]?js$/i.test(command) ? commandInvocation(process.execPath, [command, ...args], env) : commandInvocation(command, args, env);
16170
+ return new Promise((resolve, reject) => {
16171
+ const child = execFile(invocation.command, invocation.arguments, {
16172
+ env,
16173
+ cwd: env.HOME ?? env.USERPROFILE ?? homedir(),
16174
+ encoding: "utf8",
16175
+ timeout,
16176
+ killSignal: "SIGKILL",
16177
+ maxBuffer: 1024 * 1024,
16178
+ windowsHide: true,
16179
+ windowsVerbatimArguments: invocation.windowsVerbatimArguments
16180
+ }, (error51, stdout, stderr) => {
16181
+ if (error51)
16182
+ reject(new Error(error51.killed ? "Harness command timed out" : "Harness command failed; check the native installation and retry"));
16183
+ else
16184
+ resolve((stdout || stderr).trim());
16185
+ });
16186
+ child.stdin?.end();
16187
+ });
16188
+ }
16189
+ function installationVersion(value) {
16190
+ if (typeof value !== "string" || !/^v?\d+(?:\.\d+){1,3}(?:-[\w.-]+)?(?:\+[\w.-]+)?$/.test(value.trim()))
16191
+ throw new Error("Harness returned an invalid version");
16192
+ return value.trim().replace(/^v/, "");
16193
+ }
16194
+ function versionFromOutput(output) {
16195
+ return installationVersion(output.match(/\b\d+(?:\.\d+){1,3}(?:-[\w.-]+)?(?:\+[\w.-]+)?\b/)?.[0]);
16196
+ }
16197
+
16035
16198
  // ../../../node_modules/@agentclientprotocol/sdk/dist/schema/index.js
16036
16199
  var AGENT_METHODS = {
16037
16200
  initialize: "initialize",
@@ -20226,7 +20389,7 @@ function kiroLiveCommands(native) {
20226
20389
  }
20227
20390
 
20228
20391
  // dist/command.js
20229
- import path3 from "node:path";
20392
+ import path4 from "node:path";
20230
20393
  var KiroExecutableError = class extends Error {
20231
20394
  code = "KIRO_NOT_FOUND";
20232
20395
  };
@@ -20255,7 +20418,7 @@ function resolveKiroExecutable(input = {}, dependencies = {}) {
20255
20418
  }, dependencies);
20256
20419
  if (!resolution)
20257
20420
  throw new KiroExecutableError("Kiro CLI is not installed");
20258
- return targetPath(platform).isAbsolute(resolution.executable) ? resolution.executable : path3.resolve(resolution.executable);
20421
+ return targetPath(platform).isAbsolute(resolution.executable) ? resolution.executable : path4.resolve(resolution.executable);
20259
20422
  }
20260
20423
  function kiroInvocation(command, platform = process.platform) {
20261
20424
  return commandInvocation(command, ["acp", "--agent-engine", "v3", "--auth-method", "cli"], process.env, platform);
@@ -20512,7 +20675,7 @@ var KiroAcpTransport = class {
20512
20675
  environment
20513
20676
  });
20514
20677
  const invocation = commandInvocation(executable, ["chat", "--list-models", "--format", "json"], environment, process.platform);
20515
- const { stdout } = await promisify(execFile)(invocation.command, invocation.arguments, {
20678
+ const { stdout } = await promisify(execFile2)(invocation.command, invocation.arguments, {
20516
20679
  cwd: this.#options.cwd,
20517
20680
  env: environment,
20518
20681
  windowsHide: true,
@@ -21101,7 +21264,7 @@ ${fence}`;
21101
21264
 
21102
21265
  // dist/file-diff.js
21103
21266
  import { Buffer as Buffer2 } from "node:buffer";
21104
- import path4 from "node:path";
21267
+ import path5 from "node:path";
21105
21268
  import { fileURLToPath } from "node:url";
21106
21269
 
21107
21270
  // ../../../node_modules/diff/libesm/diff/base.js
@@ -21204,16 +21367,16 @@ var Diff = class {
21204
21367
  }
21205
21368
  }
21206
21369
  }
21207
- addToPath(path7, added, removed, oldPosInc, options) {
21208
- const last = path7.lastComponent;
21370
+ addToPath(path8, added, removed, oldPosInc, options) {
21371
+ const last = path8.lastComponent;
21209
21372
  if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
21210
21373
  return {
21211
- oldPos: path7.oldPos + oldPosInc,
21374
+ oldPos: path8.oldPos + oldPosInc,
21212
21375
  lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent }
21213
21376
  };
21214
21377
  } else {
21215
21378
  return {
21216
- oldPos: path7.oldPos + oldPosInc,
21379
+ oldPos: path8.oldPos + oldPosInc,
21217
21380
  lastComponent: { count: 1, added, removed, previousComponent: last }
21218
21381
  };
21219
21382
  }
@@ -21533,23 +21696,23 @@ function resolveFilePath(candidate) {
21533
21696
  }
21534
21697
  try {
21535
21698
  if (candidate.startsWith("file:")) {
21536
- return path4.resolve(fileURLToPath(new URL(candidate)));
21699
+ return path5.resolve(fileURLToPath(new URL(candidate)));
21537
21700
  }
21538
- return path4.resolve(candidate);
21701
+ return path5.resolve(candidate);
21539
21702
  } catch {
21540
21703
  try {
21541
21704
  const withoutScheme = candidate.replace(/^file:\/\/\/?/iu, "");
21542
- return path4.resolve(decodeURIComponent(withoutScheme));
21705
+ return path5.resolve(decodeURIComponent(withoutScheme));
21543
21706
  } catch {
21544
21707
  return null;
21545
21708
  }
21546
21709
  }
21547
21710
  }
21548
21711
  function displayPath(nativePath, cwd) {
21549
- const resolvedCwd = path4.resolve(cwd);
21550
- const resolvedPath = path4.resolve(nativePath);
21551
- const relative = path4.relative(resolvedCwd, resolvedPath);
21552
- const inside = relative.length > 0 && relative !== ".." && !relative.startsWith(`..${path4.sep}`);
21712
+ const resolvedCwd = path5.resolve(cwd);
21713
+ const resolvedPath = path5.resolve(nativePath);
21714
+ const relative = path5.relative(resolvedCwd, resolvedPath);
21715
+ const inside = relative.length > 0 && relative !== ".." && !relative.startsWith(`..${path5.sep}`);
21553
21716
  const selected = inside ? relative : resolvedPath;
21554
21717
  const normalized = selected.replaceAll("\\", "/");
21555
21718
  if (normalized.length === 0 || normalized === ".")
@@ -22155,7 +22318,7 @@ var KiroUsage = class {
22155
22318
  // dist/history.js
22156
22319
  import { access, readdir, readFile } from "node:fs/promises";
22157
22320
  import os2 from "node:os";
22158
- import path5 from "node:path";
22321
+ import path6 from "node:path";
22159
22322
 
22160
22323
  // dist/permission-modes.js
22161
22324
  var KIRO_DEFAULT_PERMISSION_MODE_ID = harnessPermissionModeIdSchema.parse("autopilot");
@@ -22191,12 +22354,12 @@ function isRecord10(value) {
22191
22354
  }
22192
22355
  function kiroHomeDir(environment = process.env) {
22193
22356
  const home = environment.HOME ?? environment.USERPROFILE ?? os2.homedir();
22194
- return environment.KIRO_HOME ?? path5.join(home, ".kiro");
22357
+ return environment.KIRO_HOME ?? path6.join(home, ".kiro");
22195
22358
  }
22196
22359
  async function locateKiroNativeSession(input, sessionId) {
22197
22360
  if (!sessionId || sessionId.trim().length === 0)
22198
22361
  return null;
22199
- const root = path5.join(input.homeDirectory ?? kiroHomeDir(input.environment), "sessions");
22362
+ const root = path6.join(input.homeDirectory ?? kiroHomeDir(input.environment), "sessions");
22200
22363
  let entries;
22201
22364
  try {
22202
22365
  entries = await readdir(root, { withFileTypes: true });
@@ -22206,14 +22369,14 @@ async function locateKiroNativeSession(input, sessionId) {
22206
22369
  for (const entry of entries) {
22207
22370
  if (!entry.isDirectory() || entry.name === "cli")
22208
22371
  continue;
22209
- const sessionDir = path5.join(root, entry.name, sessionId);
22210
- const metaFile = path5.join(sessionDir, "session.json");
22372
+ const sessionDir = path6.join(root, entry.name, sessionId);
22373
+ const metaFile = path6.join(sessionDir, "session.json");
22211
22374
  try {
22212
22375
  await access(metaFile);
22213
22376
  const content = await readFile(metaFile, "utf8");
22214
22377
  const meta3 = JSON.parse(content);
22215
22378
  if (meta3 && meta3.id === sessionId) {
22216
- const cwd = Array.isArray(meta3.workspacePaths) && meta3.workspacePaths.length > 0 ? path5.resolve(meta3.workspacePaths[0]) : process.cwd();
22379
+ const cwd = Array.isArray(meta3.workspacePaths) && meta3.workspacePaths.length > 0 ? path6.resolve(meta3.workspacePaths[0]) : process.cwd();
22217
22380
  return {
22218
22381
  sessionDirectory: sessionDir,
22219
22382
  sessionMeta: meta3,
@@ -22227,7 +22390,7 @@ async function locateKiroNativeSession(input, sessionId) {
22227
22390
  return null;
22228
22391
  }
22229
22392
  async function readKiroNativeMessages(sessionDirectory) {
22230
- const messagesFile = path5.join(sessionDirectory, "messages.jsonl");
22393
+ const messagesFile = path6.join(sessionDirectory, "messages.jsonl");
22231
22394
  const raw = await readFile(messagesFile, "utf8");
22232
22395
  return raw.split("\n").map((line) => line.trim()).filter((line) => line.length > 0).map((line) => {
22233
22396
  const row = JSON.parse(line);
@@ -22248,7 +22411,7 @@ async function readKiroSessionMessages(location, ancestors = /* @__PURE__ */ new
22248
22411
  if (first?.payload.operationType !== "Summary" || !location.sessionMeta.parentSessionId) {
22249
22412
  return rows;
22250
22413
  }
22251
- const parent = await locateKiroNativeSession({ homeDirectory: path5.resolve(location.sessionDirectory, "../../..") }, location.sessionMeta.parentSessionId);
22414
+ const parent = await locateKiroNativeSession({ homeDirectory: path6.resolve(location.sessionDirectory, "../../..") }, location.sessionMeta.parentSessionId);
22252
22415
  if (!parent)
22253
22416
  throw new Error("Kiro fork's archived parent history was not found");
22254
22417
  const parentRows = await readKiroSessionMessages(parent, ancestors);
@@ -22531,7 +22694,7 @@ var KiroAdapter = class {
22531
22694
  this.#deps = deps;
22532
22695
  }
22533
22696
  async inspect(input = {}) {
22534
- const cwd = path6.resolve(input.cwd ?? process.cwd());
22697
+ const cwd = path7.resolve(input.cwd ?? process.cwd());
22535
22698
  const cached2 = this.#inspectionCache.get(cwd);
22536
22699
  if (!input.refresh && cached2) {
22537
22700
  if (cached2.refreshAfter <= Date.now()) {
@@ -23643,14 +23806,31 @@ var KiroSession = class {
23643
23806
  }
23644
23807
  };
23645
23808
 
23809
+ // dist/installation.js
23810
+ function createKiroInstallation(environment, command) {
23811
+ return async (action) => {
23812
+ if (action === "update")
23813
+ throw new Error("Use Kiro CLI's original installer to update");
23814
+ const executable = resolveKiroExecutable({ environment, ...command ? { command } : {} });
23815
+ const currentVersion = versionFromOutput(await runInstallationCommand(executable, ["--version"], environment));
23816
+ return {
23817
+ currentVersion,
23818
+ latestVersion: "Unknown",
23819
+ updateAvailable: false,
23820
+ canUpdate: false,
23821
+ message: "Use Kiro CLI's original installer or native updater to check for and install updates."
23822
+ };
23823
+ };
23824
+ }
23825
+
23646
23826
  // dist/plugin.js
23647
23827
  var CODEXHOST_KIRO_COMMAND = "CODEXHOST_KIRO_COMMAND";
23648
23828
  function createHarnessAdapter(context) {
23649
23829
  const environment = { ...context.environment };
23650
- return new KiroAdapter({
23830
+ return Object.assign(new KiroAdapter({
23651
23831
  ...environment[CODEXHOST_KIRO_COMMAND] ? { command: environment[CODEXHOST_KIRO_COMMAND] } : {},
23652
23832
  environment
23653
- });
23833
+ }), { installation: createKiroInstallation(environment, environment[CODEXHOST_KIRO_COMMAND]) });
23654
23834
  }
23655
23835
  export {
23656
23836
  CODEXHOST_KIRO_COMMAND,