@karlorz/codexhost-cli-win32-x64 0.18.0-0 → 0.19.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +317 -59
  4. package/app/console-web.js +1889 -141
  5. package/app/cpa-live-voice-hook.js +1938 -428
  6. package/app/desktop-controller.mjs +2081 -212
  7. package/app/host-runtime.mjs +14818 -3381
  8. package/app/overlay-voice-bootstrap.js +1616 -0
  9. package/app/plugins/antigravity/plugin.mjs +963 -324
  10. package/app/plugins/claude-code/plugin.mjs +395 -67
  11. package/app/plugins/codebuddy/plugin.mjs +409 -76
  12. package/app/plugins/codex-usage/plugin.mjs +316 -58
  13. package/app/plugins/copilot/plugin.mjs +316 -58
  14. package/app/plugins/cursor-cli/plugin.mjs +391 -68
  15. package/app/plugins/deepseek-harness/manifest.json +2 -2
  16. package/app/plugins/deepseek-harness/plugin.mjs +343 -63
  17. package/app/plugins/devin/plugin.mjs +316 -58
  18. package/app/plugins/grok/plugin.mjs +1350 -1026
  19. package/app/plugins/hermes/plugin.mjs +395 -70
  20. package/app/plugins/kimi-code/plugin.mjs +316 -58
  21. package/app/plugins/kiro-cli/plugin.mjs +544 -74
  22. package/app/plugins/omp/plugin.mjs +1264 -902
  23. package/app/plugins/opencode/plugin.mjs +316 -58
  24. package/app/plugins/pi/plugin.mjs +1189 -862
  25. package/app/plugins/qoder/plugin.mjs +318 -62
  26. package/app/plugins/qoder-cn/plugin.mjs +318 -62
  27. package/app/plugins/qwen-code/plugin.mjs +425 -150
  28. package/app/plugins/workbuddy/plugin.mjs +409 -76
  29. package/app/plugins/zcode/plugin.mjs +389 -61
  30. package/app/renderer-extension.js +11830 -8531
  31. package/app/voice-profile-pins.json +25 -0
  32. package/app/voice-qualification.json +4 -0
  33. package/app/web/assets/index-BCyiiDDL.js +199 -0
  34. package/app/web/assets/index-BNQIOOHE.css +1 -0
  35. package/app/web/codexhost-settings.js +1895 -190
  36. package/app/web/index.html +2 -2
  37. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
  38. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +69 -69
  39. package/app/web/plugins/deepseek-ai__dsh-client-file-upload/client.js +1 -1
  40. package/app/web/plugins/deepseek-ai__dsh-client-locale/client.js +3 -3
  41. package/app/web/plugins/deepseek-ai__dsh-client-ui-attachment/client.js +1 -1
  42. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +129 -8
  43. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +65 -63
  44. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +95 -93
  45. package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
  46. package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
  47. package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +1 -1
  48. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
  49. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.excel.js +1 -1
  50. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
  51. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +79 -79
  52. package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +1 -1
  53. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +11 -11
  54. package/app/web-modules/server.mjs +3279 -1676
  55. package/bin/codexhost.exe +0 -0
  56. package/libexec/codexhost-node-repl.exe +0 -0
  57. package/libexec/codexhost-shim.exe +0 -0
  58. package/libexec/codexhost-updater.exe +0 -0
  59. package/package.json +1 -1
  60. package/app/web/assets/index-Bs17Kuah.js +0 -199
  61. package/app/web/assets/index-C3lniEH1.css +0 -1
@@ -3432,8 +3432,8 @@ var require_utils = __commonJS({
3432
3432
  }
3433
3433
  return ind;
3434
3434
  }
3435
- function removeDotSegments(path5) {
3436
- let input = path5;
3435
+ function removeDotSegments(path6) {
3436
+ let input = path6;
3437
3437
  const output = [];
3438
3438
  let nextSlash = -1;
3439
3439
  let len = 0;
@@ -3685,8 +3685,8 @@ var require_schemes = __commonJS({
3685
3685
  wsComponent.secure = void 0;
3686
3686
  }
3687
3687
  if (wsComponent.resourceName) {
3688
- const [path5, query] = wsComponent.resourceName.split("?");
3689
- wsComponent.path = path5 && path5 !== "/" ? path5 : void 0;
3688
+ const [path6, query] = wsComponent.resourceName.split("?");
3689
+ wsComponent.path = path6 && path6 !== "/" ? path6 : void 0;
3690
3690
  wsComponent.query = query;
3691
3691
  wsComponent.resourceName = void 0;
3692
3692
  }
@@ -6897,7 +6897,7 @@ var require_dist = __commonJS({
6897
6897
 
6898
6898
  // dist/qwen-code-adapter.js
6899
6899
  import { randomUUID as randomUUID2 } from "node:crypto";
6900
- import path4 from "node:path";
6900
+ import path5 from "node:path";
6901
6901
 
6902
6902
  // ../../../node_modules/zod/v4/classic/external.js
6903
6903
  var external_exports = {};
@@ -7665,10 +7665,10 @@ function mergeDefs(...defs) {
7665
7665
  function cloneDef(schema) {
7666
7666
  return mergeDefs(schema._zod.def);
7667
7667
  }
7668
- function getElementAtPath(obj, path5) {
7669
- if (!path5)
7668
+ function getElementAtPath(obj, path6) {
7669
+ if (!path6)
7670
7670
  return obj;
7671
- return path5.reduce((acc, key) => acc?.[key], obj);
7671
+ return path6.reduce((acc, key) => acc?.[key], obj);
7672
7672
  }
7673
7673
  function promiseAllObject(promisesObj) {
7674
7674
  const keys = Object.keys(promisesObj);
@@ -8077,11 +8077,11 @@ function explicitlyAborted(x, startIndex = 0) {
8077
8077
  }
8078
8078
  return false;
8079
8079
  }
8080
- function prefixIssues(path5, issues) {
8080
+ function prefixIssues(path6, issues) {
8081
8081
  return issues.map((iss) => {
8082
8082
  var _a3;
8083
8083
  (_a3 = iss).path ?? (_a3.path = []);
8084
- iss.path.unshift(path5);
8084
+ iss.path.unshift(path6);
8085
8085
  return iss;
8086
8086
  });
8087
8087
  }
@@ -8228,16 +8228,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
8228
8228
  }
8229
8229
  function formatError(error51, mapper = (issue2) => issue2.message) {
8230
8230
  const fieldErrors = { _errors: [] };
8231
- const processError = (error52, path5 = []) => {
8231
+ const processError = (error52, path6 = []) => {
8232
8232
  for (const issue2 of error52.issues) {
8233
8233
  if (issue2.code === "invalid_union" && issue2.errors.length) {
8234
- issue2.errors.map((issues) => processError({ issues }, [...path5, ...issue2.path]));
8234
+ issue2.errors.map((issues) => processError({ issues }, [...path6, ...issue2.path]));
8235
8235
  } else if (issue2.code === "invalid_key") {
8236
- processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
8236
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
8237
8237
  } else if (issue2.code === "invalid_element") {
8238
- processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
8238
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
8239
8239
  } else {
8240
- const fullpath = [...path5, ...issue2.path];
8240
+ const fullpath = [...path6, ...issue2.path];
8241
8241
  if (fullpath.length === 0) {
8242
8242
  fieldErrors._errors.push(mapper(issue2));
8243
8243
  } else {
@@ -8264,17 +8264,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
8264
8264
  }
8265
8265
  function treeifyError(error51, mapper = (issue2) => issue2.message) {
8266
8266
  const result = { errors: [] };
8267
- const processError = (error52, path5 = []) => {
8267
+ const processError = (error52, path6 = []) => {
8268
8268
  var _a3, _b;
8269
8269
  for (const issue2 of error52.issues) {
8270
8270
  if (issue2.code === "invalid_union" && issue2.errors.length) {
8271
- issue2.errors.map((issues) => processError({ issues }, [...path5, ...issue2.path]));
8271
+ issue2.errors.map((issues) => processError({ issues }, [...path6, ...issue2.path]));
8272
8272
  } else if (issue2.code === "invalid_key") {
8273
- processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
8273
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
8274
8274
  } else if (issue2.code === "invalid_element") {
8275
- processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
8275
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
8276
8276
  } else {
8277
- const fullpath = [...path5, ...issue2.path];
8277
+ const fullpath = [...path6, ...issue2.path];
8278
8278
  if (fullpath.length === 0) {
8279
8279
  result.errors.push(mapper(issue2));
8280
8280
  continue;
@@ -8306,8 +8306,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
8306
8306
  }
8307
8307
  function toDotPath(_path) {
8308
8308
  const segs = [];
8309
- const path5 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
8310
- for (const seg of path5) {
8309
+ const path6 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
8310
+ for (const seg of path6) {
8311
8311
  if (typeof seg === "number")
8312
8312
  segs.push(`[${seg}]`);
8313
8313
  else if (typeof seg === "symbol")
@@ -20999,13 +20999,13 @@ function resolveRef(ref, ctx) {
20999
20999
  if (!ref.startsWith("#")) {
21000
21000
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
21001
21001
  }
21002
- const path5 = ref.slice(1).split("/").filter(Boolean);
21003
- if (path5.length === 0) {
21002
+ const path6 = ref.slice(1).split("/").filter(Boolean);
21003
+ if (path6.length === 0) {
21004
21004
  return ctx.rootSchema;
21005
21005
  }
21006
21006
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
21007
- if (path5[0] === defsKey) {
21008
- const key = path5[1];
21007
+ if (path6[0] === defsKey) {
21008
+ const key = path6[1];
21009
21009
  if (!key || !ctx.defs[key]) {
21010
21010
  throw new Error(`Reference not found: ${ref}`);
21011
21011
  }
@@ -21440,7 +21440,7 @@ var harnessGoalSetSchema = external_exports.object({
21440
21440
  origin: goalOriginSchema
21441
21441
  });
21442
21442
 
21443
- // ../../shared-contracts/dist/realtime-call.js
21443
+ // ../../shared-contracts/dist/realtime-call-core.js
21444
21444
  var REALTIME_CALL_FORWARDED_HEADERS = [
21445
21445
  "openai-alpha",
21446
21446
  "thread-id",
@@ -21449,7 +21449,9 @@ var REALTIME_CALL_FORWARDED_HEADERS = [
21449
21449
  "x-codex-turn-metadata"
21450
21450
  ];
21451
21451
  var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
21452
- var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
21452
+ var REALTIME_CALL_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/u;
21453
+
21454
+ // ../../shared-contracts/dist/realtime-call.js
21453
21455
  var requestId = external_exports.string().min(1).max(128);
21454
21456
  var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
21455
21457
  external_exports.object({
@@ -21504,12 +21506,6 @@ var RELAY_PUBLIC_ORIGIN = "https://codexhost.karldigi.dev";
21504
21506
  var RELAY_PUBLIC_RESOURCE = `${RELAY_PUBLIC_ORIGIN}/mcp`;
21505
21507
  var RELAY_WAIT_TIMEOUT_MAX_MS = 25e3;
21506
21508
  var RELAY_MAX_BODY_BYTES = 2 * 1024 * 1024;
21507
- var RELAY_ALLOWED_ROUTES = [
21508
- "/v1/enroll/status",
21509
- "/v1/thread/read",
21510
- "/v1/thread/wait",
21511
- "/v1/thread/send"
21512
- ];
21513
21509
  var relayLinkHelloSchema = external_exports.strictObject({
21514
21510
  v: external_exports.literal(RELAY_LINK_PROTOCOL_VERSION),
21515
21511
  secret: external_exports.string().min(1).max(4096)
@@ -21521,8 +21517,11 @@ var relayLinkHelloAckSchema = external_exports.strictObject({
21521
21517
  var relayLinkRequestSchema = external_exports.strictObject({
21522
21518
  requestId: external_exports.string().min(1).max(128),
21523
21519
  deadlineMs: external_exports.number().int().positive(),
21524
- route: external_exports.enum(RELAY_ALLOWED_ROUTES),
21525
- body: external_exports.record(external_exports.string(), external_exports.unknown())
21520
+ route: external_exports.string().min(1).max(128),
21521
+ body: external_exports.record(external_exports.string(), external_exports.unknown()),
21522
+ operationalClient: external_exports.string().min(1).max(64).optional(),
21523
+ oauthClientId: external_exports.string().min(1).max(128).optional(),
21524
+ dispatchGrant: external_exports.enum(["legacy-four", "full-dispatch"]).optional()
21526
21525
  });
21527
21526
  var relayLinkErrorSchema = external_exports.strictObject({
21528
21527
  code: external_exports.string().min(1).max(64),
@@ -21566,6 +21565,204 @@ var relayEnrollStatusResultSchema = external_exports.strictObject({
21566
21565
  runtime: external_exports.enum(["reachable", "unreachable"])
21567
21566
  });
21568
21567
 
21568
+ // ../../shared-contracts/dist/external-clients.js
21569
+ var EXTERNAL_CLIENT_NAME_PATTERN = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/u;
21570
+ var externalClientNameSchema = external_exports.string().trim().min(1).max(64).regex(EXTERNAL_CLIENT_NAME_PATTERN);
21571
+ var externalClientAccessSchema = external_exports.enum(["all-threads", "selected-workspaces"]);
21572
+ var externalClientConnectionModeSchema = external_exports.enum(["public-relay", "local", "direct"]);
21573
+ var externalClientDispatchGrantSchema = external_exports.enum(["legacy-four", "full-dispatch"]);
21574
+ var workspacePathSchema = external_exports.string().trim().min(1).max(4096);
21575
+ var directUrlSchema = external_exports.string().trim().max(2048);
21576
+ var externalClientPublicViewSchema = external_exports.strictObject({
21577
+ name: externalClientNameSchema,
21578
+ createdAt: external_exports.string().min(1).max(64),
21579
+ access: externalClientAccessSchema,
21580
+ workspaces: external_exports.array(workspacePathSchema).max(64),
21581
+ connectionMode: externalClientConnectionModeSchema,
21582
+ dispatchGrant: externalClientDispatchGrantSchema,
21583
+ oauthClientId: external_exports.string().trim().min(1).max(128).optional(),
21584
+ directUrl: directUrlSchema.optional(),
21585
+ mcpUrl: external_exports.string().min(1).max(2048).optional(),
21586
+ mcpUrlNote: external_exports.string().min(1).max(512).optional()
21587
+ });
21588
+ var externalClientListParamsSchema = external_exports.strictObject({});
21589
+ var externalClientListResultSchema = external_exports.strictObject({
21590
+ clients: external_exports.array(externalClientPublicViewSchema).max(256)
21591
+ });
21592
+ var externalClientWriteFieldsSchema = external_exports.strictObject({
21593
+ access: externalClientAccessSchema.optional(),
21594
+ workspaces: external_exports.array(workspacePathSchema).max(64).optional(),
21595
+ connectionMode: externalClientConnectionModeSchema.optional(),
21596
+ dispatchGrant: externalClientDispatchGrantSchema.optional(),
21597
+ oauthClientId: external_exports.string().trim().min(1).max(128).optional(),
21598
+ directUrl: directUrlSchema.optional()
21599
+ });
21600
+ var externalClientCreateParamsSchema = externalClientWriteFieldsSchema.extend({
21601
+ name: externalClientNameSchema
21602
+ });
21603
+ var externalClientCreateResultSchema = externalClientPublicViewSchema.extend({
21604
+ token: external_exports.string().min(1).max(256).optional()
21605
+ });
21606
+ var externalClientUpdateParamsSchema = externalClientWriteFieldsSchema.extend({
21607
+ name: externalClientNameSchema,
21608
+ clearOauthClientId: external_exports.literal(true).optional()
21609
+ });
21610
+ var externalClientRevokeParamsSchema = external_exports.strictObject({
21611
+ name: externalClientNameSchema
21612
+ });
21613
+ var externalClientRevokeResultSchema = external_exports.strictObject({
21614
+ name: externalClientNameSchema,
21615
+ revoked: external_exports.literal(true)
21616
+ });
21617
+ var stringProp = (description) => ({ type: "string", description });
21618
+ var integerProp = (description) => ({
21619
+ type: "integer",
21620
+ minimum: 0,
21621
+ description
21622
+ });
21623
+ var threadProp = stringProp("Thread id or codex://threads/<id> link");
21624
+ var EXTERNAL_MCP_TOOL_DESCRIPTORS = [
21625
+ {
21626
+ name: "harness_list",
21627
+ description: "List the Harnesses this codexhost can delegate to.",
21628
+ inputSchema: { type: "object", properties: {} }
21629
+ },
21630
+ {
21631
+ name: "harness_inspect",
21632
+ description: "Read a Harness's Models, Thinking options and defaults; use the returned ids when delegating.",
21633
+ inputSchema: {
21634
+ type: "object",
21635
+ properties: {
21636
+ harnessId: stringProp("Harness id from harness_list"),
21637
+ cwd: stringProp("Absolute workspace path"),
21638
+ refresh: { type: "boolean" }
21639
+ },
21640
+ required: ["harnessId"]
21641
+ }
21642
+ },
21643
+ {
21644
+ name: "delegate_start",
21645
+ description: "Start a task in a new Thread and return at once. Without parentThread the work belongs to this client and cwd is required. watch=true records an event for this client when the Thread stops (read it with events_poll or the SSE stream).",
21646
+ inputSchema: {
21647
+ type: "object",
21648
+ properties: {
21649
+ harnessId: stringProp("Harness id from harness_list"),
21650
+ task: stringProp("The full task text"),
21651
+ taskName: stringProp("Short display name"),
21652
+ cwd: stringProp("Absolute workspace path"),
21653
+ model: stringProp("Model id from harness_inspect"),
21654
+ thinking: stringProp("Thinking option id from harness_inspect"),
21655
+ parentThread: stringProp("Optional parent Thread"),
21656
+ requestId: stringProp("Reuse to retry idempotently"),
21657
+ refs: {
21658
+ type: "array",
21659
+ items: { type: "string" },
21660
+ description: "Absolute URIs of where the work came from"
21661
+ },
21662
+ watch: { type: "boolean", description: "Record an event when the Thread stops" },
21663
+ watchTimeoutMs: integerProp("How long to watch; default 29 minutes")
21664
+ },
21665
+ required: ["harnessId", "task"]
21666
+ }
21667
+ },
21668
+ {
21669
+ name: "thread_read",
21670
+ description: "Read a Thread's status and latest result, or page its visible messages (view=messages). Never changes the Thread.",
21671
+ inputSchema: {
21672
+ type: "object",
21673
+ properties: {
21674
+ thread: threadProp,
21675
+ view: { type: "string", enum: ["result", "messages"] },
21676
+ cursor: stringProp("Message cursor"),
21677
+ limit: integerProp("Messages per page, at most 100")
21678
+ },
21679
+ required: ["thread"]
21680
+ }
21681
+ },
21682
+ {
21683
+ name: "thread_wait",
21684
+ description: "Wait up to timeoutMs (at most 60000) for a Thread to stop, then return the same snapshot as thread_read plus timedOut.",
21685
+ inputSchema: {
21686
+ type: "object",
21687
+ properties: {
21688
+ thread: threadProp,
21689
+ timeoutMs: integerProp("At most 60000; default 30000"),
21690
+ view: { type: "string", enum: ["result", "messages"] }
21691
+ },
21692
+ required: ["thread"]
21693
+ }
21694
+ },
21695
+ {
21696
+ name: "thread_list",
21697
+ description: "List Threads: by workspace (cwd), by parent Thread, by the client that started them, or by reference.",
21698
+ inputSchema: {
21699
+ type: "object",
21700
+ properties: {
21701
+ cwd: stringProp("Absolute workspace path"),
21702
+ parent: stringProp("Parent Thread"),
21703
+ client: stringProp("Client name"),
21704
+ ref: stringProp("Reference URI"),
21705
+ limit: integerProp("At most 100; default 25"),
21706
+ cursor: stringProp("Cursor from a previous page"),
21707
+ sort: {
21708
+ type: "string",
21709
+ enum: [
21710
+ "created-asc",
21711
+ "created-desc",
21712
+ "updated-asc",
21713
+ "updated-desc",
21714
+ "recency-asc",
21715
+ "recency-desc"
21716
+ ]
21717
+ }
21718
+ }
21719
+ }
21720
+ },
21721
+ {
21722
+ name: "thread_send",
21723
+ description: "Start a new Turn in an idle Thread. THREAD_BUSY means its current Turn is still running; messages are not queued.",
21724
+ inputSchema: {
21725
+ type: "object",
21726
+ properties: { thread: threadProp, message: stringProp("Message text") },
21727
+ required: ["thread", "message"]
21728
+ }
21729
+ },
21730
+ {
21731
+ name: "thread_cancel",
21732
+ description: "Cancel a Thread's active Turn, keeping the Thread and its history.",
21733
+ inputSchema: { type: "object", properties: { thread: threadProp }, required: ["thread"] }
21734
+ },
21735
+ {
21736
+ name: "thread_watch",
21737
+ description: "Record one event for this client when the Thread stops or the watch expires.",
21738
+ inputSchema: {
21739
+ type: "object",
21740
+ properties: { thread: threadProp, timeoutMs: integerProp("Default 29 minutes") },
21741
+ required: ["thread"]
21742
+ }
21743
+ },
21744
+ {
21745
+ name: "thread_watches",
21746
+ description: "List watches that have not been delivered yet.",
21747
+ inputSchema: { type: "object", properties: {} }
21748
+ },
21749
+ {
21750
+ name: "events_poll",
21751
+ description: "Read this client's events after a cursor (0 for all retained). Waits up to timeoutMs (at most 60000) for the first one. Pass the returned cursor back next time. CURSOR_EXPIRED: reconcile with thread_list client=<this client>.",
21752
+ inputSchema: {
21753
+ type: "object",
21754
+ properties: {
21755
+ after: integerProp("Cursor; 0 for all retained"),
21756
+ timeoutMs: integerProp("At most 60000; default 0"),
21757
+ limit: integerProp("At most 100")
21758
+ }
21759
+ }
21760
+ }
21761
+ ];
21762
+
21763
+ // ../../shared-contracts/dist/external-mcp-map.js
21764
+ var DEFAULT_WATCH_MS = 29 * 6e4;
21765
+
21569
21766
  // ../../shared-contracts/dist/grok-computer-use.js
21570
21767
  var grokComputerUseGetSchema = external_exports.object({}).strict();
21571
21768
  var grokComputerUseSetSchema = external_exports.object({
@@ -22162,11 +22359,61 @@ var threadSteeringInspectResultSchema = external_exports.object({
22162
22359
  delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
22163
22360
  }).strict();
22164
22361
 
22362
+ // ../../shared-contracts/dist/voice-settings.js
22363
+ var voiceRoutesSchema = external_exports.strictObject({
22364
+ chatExperience: external_exports.enum(["chatgpt", "codex"]),
22365
+ chatConnection: external_exports.enum(["desktop", "gateway"]),
22366
+ workConnection: external_exports.enum(["desktop", "gateway"])
22367
+ });
22368
+ var DEFAULT_VOICE_ROUTES = Object.freeze({
22369
+ chatExperience: "chatgpt",
22370
+ chatConnection: "desktop",
22371
+ workConnection: "gateway"
22372
+ });
22373
+ var voiceSettingsSchema = voiceRoutesSchema.extend({ inject: external_exports.boolean() });
22374
+ var voiceSettingsRequestSchema = external_exports.discriminatedUnion("operation", [
22375
+ external_exports.strictObject({
22376
+ operation: external_exports.literal("get"),
22377
+ runtime: external_exports.strictObject({
22378
+ id: external_exports.string().uuid(),
22379
+ revision: external_exports.string().max(64),
22380
+ activeCall: external_exports.boolean()
22381
+ }).optional()
22382
+ }),
22383
+ external_exports.strictObject({ operation: external_exports.literal("migrate"), routes: voiceRoutesSchema }),
22384
+ external_exports.strictObject({
22385
+ operation: external_exports.literal("set"),
22386
+ settings: voiceSettingsSchema,
22387
+ revision: external_exports.string().max(64)
22388
+ }),
22389
+ external_exports.strictObject({ operation: external_exports.literal("restart"), confirm: external_exports.literal(true) })
22390
+ ]);
22391
+ var voiceSettingsStateSchema = external_exports.strictObject({
22392
+ settings: voiceSettingsSchema,
22393
+ initialized: external_exports.boolean(),
22394
+ revision: external_exports.string(),
22395
+ activeInject: external_exports.boolean().nullable(),
22396
+ envOverride: external_exports.enum(["0", "1"]).nullable(),
22397
+ activeEnvOverride: external_exports.enum(["0", "1"]).nullable(),
22398
+ routesActive: external_exports.boolean().nullable(),
22399
+ activeCall: external_exports.boolean().nullable(),
22400
+ gatewayReady: external_exports.boolean().nullable(),
22401
+ restartAvailable: external_exports.boolean(),
22402
+ restart: external_exports.strictObject({
22403
+ phase: external_exports.enum(["idle", "restarting", "succeeded", "failed"]),
22404
+ error: external_exports.string().nullable()
22405
+ })
22406
+ });
22407
+
22165
22408
  // ../../shared-contracts/dist/client-channel.js
22166
22409
  var CLIENT_CHANNEL_VERSION = 1;
22167
22410
  var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
22168
22411
  var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
22169
22412
  var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
22413
+ var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
22414
+ var clientThreadTreeSchema = external_exports.object({
22415
+ parents: external_exports.record(external_exports.string().min(1), external_exports.string().min(1))
22416
+ }).strict();
22170
22417
  var clientProjectlessWorkspaceSchema = external_exports.object({
22171
22418
  prompt: external_exports.string().max(16384).optional()
22172
22419
  }).strict();
@@ -22183,6 +22430,11 @@ var clientChannelCursorSchema = external_exports.object({
22183
22430
  sequence: external_exports.number().int().nonnegative()
22184
22431
  });
22185
22432
  var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
22433
+ external_exports.object({
22434
+ type: external_exports.literal("skills-changed"),
22435
+ cursor: clientChannelCursorSchema,
22436
+ cwd: external_exports.string().optional()
22437
+ }),
22186
22438
  external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
22187
22439
  external_exports.object({
22188
22440
  type: external_exports.literal("preferences-changed"),
@@ -22380,6 +22632,28 @@ var voiceTranscribeResultSchema = external_exports.discriminatedUnion("ok", [
22380
22632
  external_exports.object({ ok: external_exports.literal(false), error: external_exports.object({ code: voiceErrorCodeSchema }).strict() }).strict()
22381
22633
  ]);
22382
22634
 
22635
+ // ../../shared-contracts/dist/skills.js
22636
+ var skillsListParamsSchema = external_exports.object({
22637
+ threadId: hostThreadIdSchema.optional(),
22638
+ cwd: external_exports.string().min(1).optional()
22639
+ }).strict().refine((params) => !(params.threadId && params.cwd), {
22640
+ message: "Specify threadId or cwd, not both"
22641
+ });
22642
+ var librarySkillSchema = external_exports.object({
22643
+ name: external_exports.string().min(1).regex(/^[^\s[\]]+$/u),
22644
+ description: external_exports.string().optional(),
22645
+ path: external_exports.string().min(1),
22646
+ scope: external_exports.enum(["project", "global"]),
22647
+ source: external_exports.string().min(1)
22648
+ }).strict();
22649
+ var skillsListResultSchema = external_exports.object({
22650
+ revision: external_exports.number().int().nonnegative(),
22651
+ complete: external_exports.boolean(),
22652
+ skills: external_exports.array(librarySkillSchema),
22653
+ warnings: external_exports.array(external_exports.string()).optional()
22654
+ }).strict();
22655
+ var skillsChangedParamsSchema = external_exports.object({ cwd: external_exports.string().min(1).optional() }).strict();
22656
+
22383
22657
  // ../../shared-contracts/dist/web-access-tokens.js
22384
22658
  var webNetworkAccessUrlSchema = external_exports.object({
22385
22659
  /**
@@ -22485,8 +22759,8 @@ var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
22485
22759
  var delegationReadParamsSchema = external_exports.strictObject({
22486
22760
  threadId: external_exports.string().min(1).max(1024),
22487
22761
  view: external_exports.enum(["result", "messages"]),
22488
- cursor: external_exports.string().min(1).max(8192).optional(),
22489
- limit: external_exports.number().int().min(1).max(100).optional()
22762
+ from: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),
22763
+ to: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional()
22490
22764
  });
22491
22765
 
22492
22766
  // ../../shared-contracts/dist/credential-imports.js
@@ -22938,6 +23212,10 @@ var CONSOLE_HOST_METHODS = Object.freeze([
22938
23212
  "codexhost/voice/gateway-status",
22939
23213
  "codexhost/enrollment/list",
22940
23214
  "codexhost/enrollment/revoke",
23215
+ "codexhost/external-clients/list",
23216
+ "codexhost/external-clients/create",
23217
+ "codexhost/external-clients/update",
23218
+ "codexhost/external-clients/revoke",
22941
23219
  "codexhost/console/remote-connections",
22942
23220
  "codexhost/runtime/status",
22943
23221
  "codexhost/remote/ssh-setup",
@@ -23482,6 +23760,17 @@ var updateStatusResultSchema = external_exports.strictObject({
23482
23760
  status: updateStatusSchema.nullable()
23483
23761
  });
23484
23762
 
23763
+ // ../../shared-contracts/dist/thread-watch-notice.js
23764
+ var THREAD_WATCH_NOTICE_OUTCOMES = [
23765
+ "completed",
23766
+ "failed",
23767
+ "interrupted",
23768
+ "timedOut",
23769
+ "unreadable",
23770
+ "notFound"
23771
+ ];
23772
+ var ENTRY_PATTERN = new RegExp(String.raw`^- \[([^\]\n]+)\]\(thread://([^\s()<>"?#/]+)\): ` + `(${THREAD_WATCH_NOTICE_OUTCOMES.join("|")})(?:. (.+))?$`, "u");
23773
+
23485
23774
  // ../../shared-contracts/dist/remote-runtime.js
23486
23775
  var remoteUpdatePhaseSchema = external_exports.enum([
23487
23776
  "idle",
@@ -23529,6 +23818,14 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
23529
23818
  archived: external_exports.boolean()
23530
23819
  }),
23531
23820
  external_exports.strictObject({ kind: external_exports.literal("read"), ...thread }),
23821
+ external_exports.strictObject({
23822
+ kind: external_exports.literal("configure"),
23823
+ ...thread,
23824
+ epoch: identity,
23825
+ modelId: identity.optional(),
23826
+ thinkingOptionId: identity.optional(),
23827
+ permissionModeId: identity.optional()
23828
+ }).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting"),
23532
23829
  external_exports.strictObject({
23533
23830
  kind: external_exports.literal("prompt"),
23534
23831
  ...thread,
@@ -23601,6 +23898,13 @@ var remoteConnectionsReplySchema = external_exports.union([
23601
23898
  external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
23602
23899
  ]);
23603
23900
 
23901
+ // ../../shared-contracts/dist/thread-title.js
23902
+ var threadTitleInputSchema = external_exports.strictObject({
23903
+ prompt: external_exports.string().trim().min(1).max(2e3),
23904
+ cwd: external_exports.string().max(4096).nullable()
23905
+ });
23906
+ var threadTitleResultSchema = external_exports.string().trim().min(1).max(60).nullable();
23907
+
23604
23908
  // ../../shared-contracts/dist/web-ui-extensions.js
23605
23909
  var webUiExtensionIdSchema = external_exports.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u);
23606
23910
  var localizedTextSchema2 = external_exports.union([
@@ -23641,52 +23945,6 @@ var webUiExtensionInstallSchema = external_exports.object({
23641
23945
  var webUiExtensionEnabledSchema = external_exports.object({ id: webUiExtensionIdSchema, enabled: external_exports.boolean() }).strict();
23642
23946
  var webUiExtensionRemoveSchema = external_exports.object({ id: webUiExtensionIdSchema }).strict();
23643
23947
 
23644
- // ../../shared-contracts/dist/voice-settings.js
23645
- var voiceRoutesSchema = external_exports.strictObject({
23646
- chatExperience: external_exports.enum(["chatgpt", "codex"]),
23647
- chatConnection: external_exports.enum(["desktop", "gateway"]),
23648
- workConnection: external_exports.enum(["desktop", "gateway"])
23649
- });
23650
- var DEFAULT_VOICE_ROUTES = Object.freeze({
23651
- chatExperience: "chatgpt",
23652
- chatConnection: "desktop",
23653
- workConnection: "gateway"
23654
- });
23655
- var voiceSettingsSchema = voiceRoutesSchema.extend({ inject: external_exports.boolean() });
23656
- var voiceSettingsRequestSchema = external_exports.discriminatedUnion("operation", [
23657
- external_exports.strictObject({
23658
- operation: external_exports.literal("get"),
23659
- runtime: external_exports.strictObject({
23660
- id: external_exports.string().uuid(),
23661
- revision: external_exports.string().max(64),
23662
- activeCall: external_exports.boolean()
23663
- }).optional()
23664
- }),
23665
- external_exports.strictObject({ operation: external_exports.literal("migrate"), routes: voiceRoutesSchema }),
23666
- external_exports.strictObject({
23667
- operation: external_exports.literal("set"),
23668
- settings: voiceSettingsSchema,
23669
- revision: external_exports.string().max(64)
23670
- }),
23671
- external_exports.strictObject({ operation: external_exports.literal("restart"), confirm: external_exports.literal(true) })
23672
- ]);
23673
- var voiceSettingsStateSchema = external_exports.strictObject({
23674
- settings: voiceSettingsSchema,
23675
- initialized: external_exports.boolean(),
23676
- revision: external_exports.string(),
23677
- activeInject: external_exports.boolean().nullable(),
23678
- envOverride: external_exports.enum(["0", "1"]).nullable(),
23679
- activeEnvOverride: external_exports.enum(["0", "1"]).nullable(),
23680
- routesActive: external_exports.boolean().nullable(),
23681
- activeCall: external_exports.boolean().nullable(),
23682
- gatewayReady: external_exports.boolean().nullable(),
23683
- restartAvailable: external_exports.boolean(),
23684
- restart: external_exports.strictObject({
23685
- phase: external_exports.enum(["idle", "restarting", "succeeded", "failed"]),
23686
- error: external_exports.string().nullable()
23687
- })
23688
- });
23689
-
23690
23948
  // ../../shared-contracts/dist/background-activity.js
23691
23949
  var backgroundActivitySchema = external_exports.strictObject({
23692
23950
  id: external_exports.string().min(1),
@@ -25746,7 +26004,9 @@ var It = class n2 {
25746
26004
  f && (k.execPath = f), this.childProcess = Fs(d, m, k);
25747
26005
  } else K.debug(`Spawning CLI (${s.type}): ${s.command} ${[...s.args, ...e].join(" ")}`), this.childProcess = jn(s.command, [...s.args, ...e], { cwd: t, env: o, stdio: ["pipe", "pipe", r], signal: this.abortController.signal });
25748
26006
  } else K.debug(`Spawning CLI (${s.type}): ${s.command} ${[...s.args, ...e].join(" ")}`), this.childProcess = jn(s.command, [...s.args, ...e], { cwd: t, env: o, stdio: ["pipe", "pipe", r], signal: this.abortController.signal });
25749
- this.childStdin = this.childProcess.stdin, this.childStdout = this.childProcess.stdout, (this.options.debug || this.options.stderr) && this.childProcess.stderr?.on("data", (i) => {
26007
+ this.childStdin = this.childProcess.stdin, this.childStdin.on("error", (i) => {
26008
+ this.inputClosed = true, K.warn(`CLI stdin closed: ${i.message}`);
26009
+ }), this.childStdout = this.childProcess.stdout, (this.options.debug || this.options.stderr) && this.childProcess.stderr?.on("data", (i) => {
25750
26010
  K.debug(i.toString());
25751
26011
  }), this.abortHandler = () => {
25752
26012
  this.killChildProcess();
@@ -28027,57 +28287,6 @@ var sd = /* @__PURE__ */ new Set(["plan", "default"]);
28027
28287
  var Ds = pe.filter((n18) => !sd.has(n18));
28028
28288
  var rd = pe.join(", ");
28029
28289
 
28030
- // dist/permission-modes.js
28031
- var nativePermissionModes = /* @__PURE__ */ new Set([
28032
- "plan",
28033
- "default",
28034
- "auto-edit",
28035
- "auto",
28036
- "yolo"
28037
- ]);
28038
- var QWEN_CODE_DEFAULT_PERMISSION_MODE_ID = harnessPermissionModeIdSchema.parse("default");
28039
- var QWEN_CODE_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.parse({
28040
- modes: [
28041
- {
28042
- id: "plan",
28043
- label: "Plan",
28044
- description: "Analyze only, do not modify files or execute commands."
28045
- },
28046
- {
28047
- id: "default",
28048
- label: "Default",
28049
- description: "Require approval for file edits or shell commands."
28050
- },
28051
- {
28052
- id: "auto-edit",
28053
- label: "Auto Edit",
28054
- description: "Automatically approve file edits."
28055
- },
28056
- {
28057
- id: "auto",
28058
- label: "Auto",
28059
- description: "LLM classifier auto-approves safe actions, blocks risky ones."
28060
- },
28061
- {
28062
- id: "yolo",
28063
- label: "YOLO",
28064
- description: "Automatically approve all tools.",
28065
- dangerous: true
28066
- }
28067
- ],
28068
- defaultModeId: QWEN_CODE_DEFAULT_PERMISSION_MODE_ID
28069
- });
28070
- function decodeQwenCodePermissionModeId(permissionModeId) {
28071
- const parsed = harnessPermissionModeIdSchema.parse(permissionModeId);
28072
- if (!nativePermissionModes.has(parsed)) {
28073
- throw new Error("Qwen Code Permission Mode belongs to another Adapter");
28074
- }
28075
- return parsed;
28076
- }
28077
-
28078
- // dist/command.js
28079
- import path2 from "node:path";
28080
-
28081
28290
  // ../../harness-discovery/dist/environment.js
28082
28291
  import fs from "node:fs";
28083
28292
  import path from "node:path";
@@ -28124,6 +28333,20 @@ function newestFirst(names) {
28124
28333
  return [...names].sort((left, right) => right.localeCompare(left, void 0, { numeric: true }));
28125
28334
  }
28126
28335
 
28336
+ // ../../harness-discovery/dist/node-runtime.js
28337
+ import path2 from "node:path";
28338
+ function withNodeRuntimeOnPath(environment, runtimeExecutable = process.execPath, platform = process.platform) {
28339
+ const pathKey = Object.keys(environment).find((name) => name.toLowerCase() === "path") ?? "PATH";
28340
+ const delimiter = platform === "win32" ? ";" : ":";
28341
+ const runtimeDirectory = path2.dirname(runtimeExecutable);
28342
+ const directories = (environment[pathKey] ?? "").split(delimiter).filter(Boolean);
28343
+ const equal = platform === "win32" ? (value) => value.toLowerCase() : (value) => value;
28344
+ if (!directories.some((directory) => equal(directory) === equal(runtimeDirectory))) {
28345
+ directories.push(runtimeDirectory);
28346
+ }
28347
+ return { ...environment, [pathKey]: directories.join(delimiter) };
28348
+ }
28349
+
28127
28350
  // ../../harness-discovery/dist/resolve.js
28128
28351
  import os from "node:os";
28129
28352
 
@@ -28287,7 +28510,56 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
28287
28510
  return void 0;
28288
28511
  }
28289
28512
 
28513
+ // dist/permission-modes.js
28514
+ var nativePermissionModes = /* @__PURE__ */ new Set([
28515
+ "plan",
28516
+ "default",
28517
+ "auto-edit",
28518
+ "auto",
28519
+ "yolo"
28520
+ ]);
28521
+ var QWEN_CODE_DEFAULT_PERMISSION_MODE_ID = harnessPermissionModeIdSchema.parse("default");
28522
+ var QWEN_CODE_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.parse({
28523
+ modes: [
28524
+ {
28525
+ id: "plan",
28526
+ label: "Plan",
28527
+ description: "Analyze only, do not modify files or execute commands."
28528
+ },
28529
+ {
28530
+ id: "default",
28531
+ label: "Default",
28532
+ description: "Require approval for file edits or shell commands."
28533
+ },
28534
+ {
28535
+ id: "auto-edit",
28536
+ label: "Auto Edit",
28537
+ description: "Automatically approve file edits."
28538
+ },
28539
+ {
28540
+ id: "auto",
28541
+ label: "Auto",
28542
+ description: "LLM classifier auto-approves safe actions, blocks risky ones."
28543
+ },
28544
+ {
28545
+ id: "yolo",
28546
+ label: "YOLO",
28547
+ description: "Automatically approve all tools.",
28548
+ dangerous: true
28549
+ }
28550
+ ],
28551
+ defaultModeId: QWEN_CODE_DEFAULT_PERMISSION_MODE_ID
28552
+ });
28553
+ function decodeQwenCodePermissionModeId(permissionModeId) {
28554
+ const parsed = harnessPermissionModeIdSchema.parse(permissionModeId);
28555
+ if (!nativePermissionModes.has(parsed)) {
28556
+ throw new Error("Qwen Code Permission Mode belongs to another Adapter");
28557
+ }
28558
+ return parsed;
28559
+ }
28560
+
28290
28561
  // dist/command.js
28562
+ import path3 from "node:path";
28291
28563
  var QWEN_NPM_ENTRY = "node_modules/@qwen-code/qwen-code/cli-entry.js";
28292
28564
  var qwenCodeDiscoverySpec = {
28293
28565
  id: "qwen-code",
@@ -28319,7 +28591,7 @@ function resolveQwenCodeExecutable(input = {}, dependencies = {}) {
28319
28591
  }, dependencies);
28320
28592
  if (!resolution)
28321
28593
  throw new Error("Executable file not found: Qwen Code CLI is not installed");
28322
- return targetPath(platform).isAbsolute(resolution.executable) ? resolution.executable : path2.resolve(resolution.executable);
28594
+ return targetPath(platform).isAbsolute(resolution.executable) ? resolution.executable : path3.resolve(resolution.executable);
28323
28595
  }
28324
28596
 
28325
28597
  // dist/qwen-tool-output.js
@@ -28675,7 +28947,7 @@ var QwenCodeSdkTransport = class {
28675
28947
  cwd: this.#options.cwd,
28676
28948
  ...input.model ? { model: input.model } : {},
28677
28949
  ...this.#options.commandTimeoutMs ? { timeout: { controlRequest: this.#options.commandTimeoutMs } } : {},
28678
- ...environment ? { env: environment } : {},
28950
+ env: environment,
28679
28951
  abortController,
28680
28952
  includePartialMessages: true,
28681
28953
  pathToQwenExecutable: executable,
@@ -28702,10 +28974,13 @@ var QwenCodeSdkTransport = class {
28702
28974
  throw classifyError(error51);
28703
28975
  }
28704
28976
  }
28977
+ /**
28978
+ * The SDK merges `env` over `process.env`. Supplying PATH here keeps a
28979
+ * `#!/usr/bin/env node` launcher runnable when the Host started with a
28980
+ * minimal PATH (for example from a login item).
28981
+ */
28705
28982
  #environment() {
28706
- const environment = this.#options.environment;
28707
- if (!environment)
28708
- return void 0;
28983
+ const environment = withNodeRuntimeOnPath({ ...process.env, ...this.#options.environment });
28709
28984
  return Object.fromEntries(Object.entries(environment).filter((entry) => typeof entry[1] === "string"));
28710
28985
  }
28711
28986
  #canUseTool = async (toolName, input) => {
@@ -28919,7 +29194,7 @@ function stateForQwenCodeModel(modelState, nativeState, model2 = modelState.curr
28919
29194
  // dist/qwen-history.js
28920
29195
  import { readFile } from "node:fs/promises";
28921
29196
  import os2 from "node:os";
28922
- import path3 from "node:path";
29197
+ import path4 from "node:path";
28923
29198
  var QWEN_CODE_TURN_KEY_PREFIX = "qwen-turn-";
28924
29199
  function qwenCodeTurnKey(ordinal) {
28925
29200
  return `${QWEN_CODE_TURN_KEY_PREFIX}${ordinal}`;
@@ -29164,21 +29439,21 @@ function sanitizeCwd(cwd) {
29164
29439
  return (process.platform === "win32" ? cwd.toLowerCase() : cwd).replace(/[^a-zA-Z0-9]/g, "-");
29165
29440
  }
29166
29441
  function resolveQwenDirectory(value, cwd) {
29167
- const expanded = value === "~" || value.startsWith("~/") || value.startsWith("~\\") ? path3.join(os2.homedir(), ...value.slice(value === "~" ? 1 : 2).split(/[/\\]+/u).filter(Boolean)) : value;
29168
- return path3.isAbsolute(expanded) ? expanded : path3.resolve(cwd, expanded);
29442
+ const expanded = value === "~" || value.startsWith("~/") || value.startsWith("~\\") ? path4.join(os2.homedir(), ...value.slice(value === "~" ? 1 : 2).split(/[/\\]+/u).filter(Boolean)) : value;
29443
+ return path4.isAbsolute(expanded) ? expanded : path4.resolve(cwd, expanded);
29169
29444
  }
29170
29445
  function qwenRuntimeBase(cwd, environment) {
29171
29446
  const overrides = Object.fromEntries(Object.entries(environment ?? {}).filter((entry) => typeof entry[1] === "string"));
29172
29447
  const effectiveEnvironment = { ...process.env, ...overrides };
29173
29448
  const configured = effectiveEnvironment.QWEN_RUNTIME_DIR || effectiveEnvironment.QWEN_HOME;
29174
- return configured ? resolveQwenDirectory(configured, cwd) : path3.join(os2.homedir(), ".qwen");
29449
+ return configured ? resolveQwenDirectory(configured, cwd) : path4.join(os2.homedir(), ".qwen");
29175
29450
  }
29176
29451
  async function readQwenCodeHistory(cwd, harnessId, sessionId, knownTurnRefs = [], toolOutputLimit = 64e3, environment) {
29177
29452
  const runtimeBase = qwenRuntimeBase(cwd, environment);
29178
- const projectDir = path3.join(runtimeBase, "projects", sanitizeCwd(cwd), "chats");
29453
+ const projectDir = path4.join(runtimeBase, "projects", sanitizeCwd(cwd), "chats");
29179
29454
  const paths = [
29180
- path3.join(projectDir, `${sessionId}.jsonl`),
29181
- path3.join(projectDir, "archive", `${sessionId}.jsonl`)
29455
+ path4.join(projectDir, `${sessionId}.jsonl`),
29456
+ path4.join(projectDir, "archive", `${sessionId}.jsonl`)
29182
29457
  ];
29183
29458
  let lastReadError;
29184
29459
  for (const filePath of paths) {
@@ -29921,7 +30196,7 @@ var QwenCodeAdapter = class {
29921
30196
  if (this.#closePromise) {
29922
30197
  return { status: "unavailable", error: invalidState("Qwen Code Adapter is closed") };
29923
30198
  }
29924
- const cwd = path4.resolve(input.cwd ?? process.cwd());
30199
+ const cwd = path5.resolve(input.cwd ?? process.cwd());
29925
30200
  if (!input.refresh) {
29926
30201
  const cached2 = this.#inspectionCache.get(cwd);
29927
30202
  if (cached2)
@@ -29988,7 +30263,7 @@ var QwenCodeAdapter = class {
29988
30263
  }
29989
30264
  };
29990
30265
  }
29991
- const cwd = path4.resolve(input.cwd);
30266
+ const cwd = path5.resolve(input.cwd);
29992
30267
  const sessionEnvironment = mergeEnvironment(this.#environment, input.environment);
29993
30268
  let initialPermissionModeId = QWEN_CODE_DEFAULT_PERMISSION_MODE_ID;
29994
30269
  if (input.kind === "create") {