@codexhost/cli-linux-arm64 0.18.0-beta.5 → 0.19.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 (58) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +64 -4
  4. package/app/console-web.js +193 -73
  5. package/app/desktop-controller.mjs +274 -11
  6. package/app/host-runtime.mjs +12322 -2469
  7. package/app/plugins/antigravity/plugin.mjs +654 -216
  8. package/app/plugins/claude-code/plugin.mjs +138 -11
  9. package/app/plugins/codebuddy/plugin.mjs +152 -20
  10. package/app/plugins/codex-usage/plugin.mjs +59 -2
  11. package/app/plugins/copilot/plugin.mjs +59 -2
  12. package/app/plugins/cursor-cli/plugin.mjs +134 -12
  13. package/app/plugins/deepseek-harness/manifest.json +2 -2
  14. package/app/plugins/deepseek-harness/plugin.mjs +86 -7
  15. package/app/plugins/devin/plugin.mjs +59 -2
  16. package/app/plugins/grok/plugin.mjs +392 -269
  17. package/app/plugins/hermes/plugin.mjs +138 -14
  18. package/app/plugins/kimi-code/plugin.mjs +59 -2
  19. package/app/plugins/kiro-cli/plugin.mjs +287 -18
  20. package/app/plugins/omp/plugin.mjs +788 -627
  21. package/app/plugins/opencode/plugin.mjs +59 -2
  22. package/app/plugins/pi/plugin.mjs +899 -773
  23. package/app/plugins/qoder/plugin.mjs +61 -6
  24. package/app/plugins/qoder-cn/plugin.mjs +61 -6
  25. package/app/plugins/qwen-code/plugin.mjs +168 -94
  26. package/app/plugins/workbuddy/plugin.mjs +152 -20
  27. package/app/plugins/zcode/plugin.mjs +132 -5
  28. package/app/renderer-extension.js +739 -336
  29. package/app/web/assets/index-BNQIOOHE.css +1 -0
  30. package/app/web/assets/index-Feo4BkqN.js +199 -0
  31. package/app/web/codexhost-settings.js +151 -65
  32. package/app/web/index.html +2 -2
  33. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
  34. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
  35. package/app/web/plugins/deepseek-ai__dsh-client-file-upload/client.js +1 -1
  36. package/app/web/plugins/deepseek-ai__dsh-client-locale/client.js +3 -3
  37. package/app/web/plugins/deepseek-ai__dsh-client-ui-attachment/client.js +1 -1
  38. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +129 -8
  39. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +65 -63
  40. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +95 -93
  41. package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
  42. package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
  43. package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +1 -1
  44. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +3 -3
  45. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.excel.js +1 -1
  46. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
  47. package/app/web/plugins/deepseek-ai__dsh-client-ui-theme/client.js +1 -1
  48. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +16 -16
  49. package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +1 -1
  50. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +11 -11
  51. package/app/web/sw.js +40 -0
  52. package/app/web-modules/server.mjs +2339 -1514
  53. package/bin/codexhost +0 -0
  54. package/libexec/codexhost-shim +0 -0
  55. package/libexec/codexhost-updater +0 -0
  56. package/package.json +1 -1
  57. package/app/web/assets/index-C0aXz2jD.js +0 -199
  58. 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
  }
@@ -21992,6 +21992,10 @@ var CLIENT_CHANNEL_VERSION = 1;
21992
21992
  var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
21993
21993
  var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
21994
21994
  var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
21995
+ var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
21996
+ var clientThreadTreeSchema = external_exports.object({
21997
+ parents: external_exports.record(external_exports.string().min(1), external_exports.string().min(1))
21998
+ }).strict();
21995
21999
  var clientProjectlessWorkspaceSchema = external_exports.object({
21996
22000
  prompt: external_exports.string().max(16384).optional()
21997
22001
  }).strict();
@@ -22008,6 +22012,11 @@ var clientChannelCursorSchema = external_exports.object({
22008
22012
  sequence: external_exports.number().int().nonnegative()
22009
22013
  });
22010
22014
  var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
22015
+ external_exports.object({
22016
+ type: external_exports.literal("skills-changed"),
22017
+ cursor: clientChannelCursorSchema,
22018
+ cwd: external_exports.string().optional()
22019
+ }),
22011
22020
  external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
22012
22021
  external_exports.object({
22013
22022
  type: external_exports.literal("preferences-changed"),
@@ -22205,6 +22214,28 @@ var voiceTranscribeResultSchema = external_exports.discriminatedUnion("ok", [
22205
22214
  external_exports.object({ ok: external_exports.literal(false), error: external_exports.object({ code: voiceErrorCodeSchema }).strict() }).strict()
22206
22215
  ]);
22207
22216
 
22217
+ // ../../shared-contracts/dist/skills.js
22218
+ var skillsListParamsSchema = external_exports.object({
22219
+ threadId: hostThreadIdSchema.optional(),
22220
+ cwd: external_exports.string().min(1).optional()
22221
+ }).strict().refine((params) => !(params.threadId && params.cwd), {
22222
+ message: "Specify threadId or cwd, not both"
22223
+ });
22224
+ var librarySkillSchema = external_exports.object({
22225
+ name: external_exports.string().min(1).regex(/^[^\s[\]]+$/u),
22226
+ description: external_exports.string().optional(),
22227
+ path: external_exports.string().min(1),
22228
+ scope: external_exports.enum(["project", "global"]),
22229
+ source: external_exports.string().min(1)
22230
+ }).strict();
22231
+ var skillsListResultSchema = external_exports.object({
22232
+ revision: external_exports.number().int().nonnegative(),
22233
+ complete: external_exports.boolean(),
22234
+ skills: external_exports.array(librarySkillSchema),
22235
+ warnings: external_exports.array(external_exports.string()).optional()
22236
+ }).strict();
22237
+ var skillsChangedParamsSchema = external_exports.object({ cwd: external_exports.string().min(1).optional() }).strict();
22238
+
22208
22239
  // ../../shared-contracts/dist/web-access-tokens.js
22209
22240
  var webNetworkAccessUrlSchema = external_exports.object({
22210
22241
  /**
@@ -22310,8 +22341,8 @@ var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
22310
22341
  var delegationReadParamsSchema = external_exports.strictObject({
22311
22342
  threadId: external_exports.string().min(1).max(1024),
22312
22343
  view: external_exports.enum(["result", "messages"]),
22313
- cursor: external_exports.string().min(1).max(8192).optional(),
22314
- limit: external_exports.number().int().min(1).max(100).optional()
22344
+ from: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),
22345
+ to: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional()
22315
22346
  });
22316
22347
 
22317
22348
  // ../../shared-contracts/dist/credential-imports.js
@@ -23262,6 +23293,17 @@ var updateStatusResultSchema = external_exports.strictObject({
23262
23293
  status: updateStatusSchema.nullable()
23263
23294
  });
23264
23295
 
23296
+ // ../../shared-contracts/dist/thread-watch-notice.js
23297
+ var THREAD_WATCH_NOTICE_OUTCOMES = [
23298
+ "completed",
23299
+ "failed",
23300
+ "interrupted",
23301
+ "timedOut",
23302
+ "unreadable",
23303
+ "notFound"
23304
+ ];
23305
+ var ENTRY_PATTERN = new RegExp(String.raw`^- \[([^\]\n]+)\]\(thread://([^\s()<>"?#/]+)\): ` + `(${THREAD_WATCH_NOTICE_OUTCOMES.join("|")})(?:. (.+))?$`, "u");
23306
+
23265
23307
  // ../../shared-contracts/dist/remote-runtime.js
23266
23308
  var remoteUpdatePhaseSchema = external_exports.enum([
23267
23309
  "idle",
@@ -23309,6 +23351,14 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
23309
23351
  archived: external_exports.boolean()
23310
23352
  }),
23311
23353
  external_exports.strictObject({ kind: external_exports.literal("read"), ...thread }),
23354
+ external_exports.strictObject({
23355
+ kind: external_exports.literal("configure"),
23356
+ ...thread,
23357
+ epoch: identity,
23358
+ modelId: identity.optional(),
23359
+ thinkingOptionId: identity.optional(),
23360
+ permissionModeId: identity.optional()
23361
+ }).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting"),
23312
23362
  external_exports.strictObject({
23313
23363
  kind: external_exports.literal("prompt"),
23314
23364
  ...thread,
@@ -23381,6 +23431,13 @@ var remoteConnectionsReplySchema = external_exports.union([
23381
23431
  external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
23382
23432
  ]);
23383
23433
 
23434
+ // ../../shared-contracts/dist/thread-title.js
23435
+ var threadTitleInputSchema = external_exports.strictObject({
23436
+ prompt: external_exports.string().trim().min(1).max(2e3),
23437
+ cwd: external_exports.string().max(4096).nullable()
23438
+ });
23439
+ var threadTitleResultSchema = external_exports.string().trim().min(1).max(60).nullable();
23440
+
23384
23441
  // ../../shared-contracts/dist/web-ui-extensions.js
23385
23442
  var webUiExtensionIdSchema = external_exports.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u);
23386
23443
  var localizedTextSchema2 = external_exports.union([
@@ -25446,7 +25503,9 @@ var It = class n2 {
25446
25503
  f && (k.execPath = f), this.childProcess = Fs(d, m, k);
25447
25504
  } 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 });
25448
25505
  } 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 });
25449
- this.childStdin = this.childProcess.stdin, this.childStdout = this.childProcess.stdout, (this.options.debug || this.options.stderr) && this.childProcess.stderr?.on("data", (i) => {
25506
+ this.childStdin = this.childProcess.stdin, this.childStdin.on("error", (i) => {
25507
+ this.inputClosed = true, K.warn(`CLI stdin closed: ${i.message}`);
25508
+ }), this.childStdout = this.childProcess.stdout, (this.options.debug || this.options.stderr) && this.childProcess.stderr?.on("data", (i) => {
25450
25509
  K.debug(i.toString());
25451
25510
  }), this.abortHandler = () => {
25452
25511
  this.killChildProcess();
@@ -27727,57 +27786,6 @@ var sd = /* @__PURE__ */ new Set(["plan", "default"]);
27727
27786
  var Ds = pe.filter((n18) => !sd.has(n18));
27728
27787
  var rd = pe.join(", ");
27729
27788
 
27730
- // dist/permission-modes.js
27731
- var nativePermissionModes = /* @__PURE__ */ new Set([
27732
- "plan",
27733
- "default",
27734
- "auto-edit",
27735
- "auto",
27736
- "yolo"
27737
- ]);
27738
- var QWEN_CODE_DEFAULT_PERMISSION_MODE_ID = harnessPermissionModeIdSchema.parse("default");
27739
- var QWEN_CODE_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.parse({
27740
- modes: [
27741
- {
27742
- id: "plan",
27743
- label: "Plan",
27744
- description: "Analyze only, do not modify files or execute commands."
27745
- },
27746
- {
27747
- id: "default",
27748
- label: "Default",
27749
- description: "Require approval for file edits or shell commands."
27750
- },
27751
- {
27752
- id: "auto-edit",
27753
- label: "Auto Edit",
27754
- description: "Automatically approve file edits."
27755
- },
27756
- {
27757
- id: "auto",
27758
- label: "Auto",
27759
- description: "LLM classifier auto-approves safe actions, blocks risky ones."
27760
- },
27761
- {
27762
- id: "yolo",
27763
- label: "YOLO",
27764
- description: "Automatically approve all tools.",
27765
- dangerous: true
27766
- }
27767
- ],
27768
- defaultModeId: QWEN_CODE_DEFAULT_PERMISSION_MODE_ID
27769
- });
27770
- function decodeQwenCodePermissionModeId(permissionModeId) {
27771
- const parsed = harnessPermissionModeIdSchema.parse(permissionModeId);
27772
- if (!nativePermissionModes.has(parsed)) {
27773
- throw new Error("Qwen Code Permission Mode belongs to another Adapter");
27774
- }
27775
- return parsed;
27776
- }
27777
-
27778
- // dist/command.js
27779
- import path2 from "node:path";
27780
-
27781
27789
  // ../../harness-discovery/dist/environment.js
27782
27790
  import fs from "node:fs";
27783
27791
  import path from "node:path";
@@ -27824,6 +27832,20 @@ function newestFirst(names) {
27824
27832
  return [...names].sort((left, right) => right.localeCompare(left, void 0, { numeric: true }));
27825
27833
  }
27826
27834
 
27835
+ // ../../harness-discovery/dist/node-runtime.js
27836
+ import path2 from "node:path";
27837
+ function withNodeRuntimeOnPath(environment, runtimeExecutable = process.execPath, platform = process.platform) {
27838
+ const pathKey = Object.keys(environment).find((name) => name.toLowerCase() === "path") ?? "PATH";
27839
+ const delimiter = platform === "win32" ? ";" : ":";
27840
+ const runtimeDirectory = path2.dirname(runtimeExecutable);
27841
+ const directories = (environment[pathKey] ?? "").split(delimiter).filter(Boolean);
27842
+ const equal = platform === "win32" ? (value) => value.toLowerCase() : (value) => value;
27843
+ if (!directories.some((directory) => equal(directory) === equal(runtimeDirectory))) {
27844
+ directories.push(runtimeDirectory);
27845
+ }
27846
+ return { ...environment, [pathKey]: directories.join(delimiter) };
27847
+ }
27848
+
27827
27849
  // ../../harness-discovery/dist/resolve.js
27828
27850
  import os from "node:os";
27829
27851
 
@@ -27987,7 +28009,56 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
27987
28009
  return void 0;
27988
28010
  }
27989
28011
 
28012
+ // dist/permission-modes.js
28013
+ var nativePermissionModes = /* @__PURE__ */ new Set([
28014
+ "plan",
28015
+ "default",
28016
+ "auto-edit",
28017
+ "auto",
28018
+ "yolo"
28019
+ ]);
28020
+ var QWEN_CODE_DEFAULT_PERMISSION_MODE_ID = harnessPermissionModeIdSchema.parse("default");
28021
+ var QWEN_CODE_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.parse({
28022
+ modes: [
28023
+ {
28024
+ id: "plan",
28025
+ label: "Plan",
28026
+ description: "Analyze only, do not modify files or execute commands."
28027
+ },
28028
+ {
28029
+ id: "default",
28030
+ label: "Default",
28031
+ description: "Require approval for file edits or shell commands."
28032
+ },
28033
+ {
28034
+ id: "auto-edit",
28035
+ label: "Auto Edit",
28036
+ description: "Automatically approve file edits."
28037
+ },
28038
+ {
28039
+ id: "auto",
28040
+ label: "Auto",
28041
+ description: "LLM classifier auto-approves safe actions, blocks risky ones."
28042
+ },
28043
+ {
28044
+ id: "yolo",
28045
+ label: "YOLO",
28046
+ description: "Automatically approve all tools.",
28047
+ dangerous: true
28048
+ }
28049
+ ],
28050
+ defaultModeId: QWEN_CODE_DEFAULT_PERMISSION_MODE_ID
28051
+ });
28052
+ function decodeQwenCodePermissionModeId(permissionModeId) {
28053
+ const parsed = harnessPermissionModeIdSchema.parse(permissionModeId);
28054
+ if (!nativePermissionModes.has(parsed)) {
28055
+ throw new Error("Qwen Code Permission Mode belongs to another Adapter");
28056
+ }
28057
+ return parsed;
28058
+ }
28059
+
27990
28060
  // dist/command.js
28061
+ import path3 from "node:path";
27991
28062
  var QWEN_NPM_ENTRY = "node_modules/@qwen-code/qwen-code/cli-entry.js";
27992
28063
  var qwenCodeDiscoverySpec = {
27993
28064
  id: "qwen-code",
@@ -28019,7 +28090,7 @@ function resolveQwenCodeExecutable(input = {}, dependencies = {}) {
28019
28090
  }, dependencies);
28020
28091
  if (!resolution)
28021
28092
  throw new Error("Executable file not found: Qwen Code CLI is not installed");
28022
- return targetPath(platform).isAbsolute(resolution.executable) ? resolution.executable : path2.resolve(resolution.executable);
28093
+ return targetPath(platform).isAbsolute(resolution.executable) ? resolution.executable : path3.resolve(resolution.executable);
28023
28094
  }
28024
28095
 
28025
28096
  // dist/qwen-tool-output.js
@@ -28375,7 +28446,7 @@ var QwenCodeSdkTransport = class {
28375
28446
  cwd: this.#options.cwd,
28376
28447
  ...input.model ? { model: input.model } : {},
28377
28448
  ...this.#options.commandTimeoutMs ? { timeout: { controlRequest: this.#options.commandTimeoutMs } } : {},
28378
- ...environment ? { env: environment } : {},
28449
+ env: environment,
28379
28450
  abortController,
28380
28451
  includePartialMessages: true,
28381
28452
  pathToQwenExecutable: executable,
@@ -28402,10 +28473,13 @@ var QwenCodeSdkTransport = class {
28402
28473
  throw classifyError(error51);
28403
28474
  }
28404
28475
  }
28476
+ /**
28477
+ * The SDK merges `env` over `process.env`. Supplying PATH here keeps a
28478
+ * `#!/usr/bin/env node` launcher runnable when the Host started with a
28479
+ * minimal PATH (for example from a login item).
28480
+ */
28405
28481
  #environment() {
28406
- const environment = this.#options.environment;
28407
- if (!environment)
28408
- return void 0;
28482
+ const environment = withNodeRuntimeOnPath({ ...process.env, ...this.#options.environment });
28409
28483
  return Object.fromEntries(Object.entries(environment).filter((entry) => typeof entry[1] === "string"));
28410
28484
  }
28411
28485
  #canUseTool = async (toolName, input) => {
@@ -28619,7 +28693,7 @@ function stateForQwenCodeModel(modelState, nativeState, model2 = modelState.curr
28619
28693
  // dist/qwen-history.js
28620
28694
  import { readFile } from "node:fs/promises";
28621
28695
  import os2 from "node:os";
28622
- import path3 from "node:path";
28696
+ import path4 from "node:path";
28623
28697
  var QWEN_CODE_TURN_KEY_PREFIX = "qwen-turn-";
28624
28698
  function qwenCodeTurnKey(ordinal) {
28625
28699
  return `${QWEN_CODE_TURN_KEY_PREFIX}${ordinal}`;
@@ -28864,21 +28938,21 @@ function sanitizeCwd(cwd) {
28864
28938
  return (process.platform === "win32" ? cwd.toLowerCase() : cwd).replace(/[^a-zA-Z0-9]/g, "-");
28865
28939
  }
28866
28940
  function resolveQwenDirectory(value, cwd) {
28867
- const expanded = value === "~" || value.startsWith("~/") || value.startsWith("~\\") ? path3.join(os2.homedir(), ...value.slice(value === "~" ? 1 : 2).split(/[/\\]+/u).filter(Boolean)) : value;
28868
- return path3.isAbsolute(expanded) ? expanded : path3.resolve(cwd, expanded);
28941
+ const expanded = value === "~" || value.startsWith("~/") || value.startsWith("~\\") ? path4.join(os2.homedir(), ...value.slice(value === "~" ? 1 : 2).split(/[/\\]+/u).filter(Boolean)) : value;
28942
+ return path4.isAbsolute(expanded) ? expanded : path4.resolve(cwd, expanded);
28869
28943
  }
28870
28944
  function qwenRuntimeBase(cwd, environment) {
28871
28945
  const overrides = Object.fromEntries(Object.entries(environment ?? {}).filter((entry) => typeof entry[1] === "string"));
28872
28946
  const effectiveEnvironment = { ...process.env, ...overrides };
28873
28947
  const configured = effectiveEnvironment.QWEN_RUNTIME_DIR || effectiveEnvironment.QWEN_HOME;
28874
- return configured ? resolveQwenDirectory(configured, cwd) : path3.join(os2.homedir(), ".qwen");
28948
+ return configured ? resolveQwenDirectory(configured, cwd) : path4.join(os2.homedir(), ".qwen");
28875
28949
  }
28876
28950
  async function readQwenCodeHistory(cwd, harnessId, sessionId, knownTurnRefs = [], toolOutputLimit = 64e3, environment) {
28877
28951
  const runtimeBase = qwenRuntimeBase(cwd, environment);
28878
- const projectDir = path3.join(runtimeBase, "projects", sanitizeCwd(cwd), "chats");
28952
+ const projectDir = path4.join(runtimeBase, "projects", sanitizeCwd(cwd), "chats");
28879
28953
  const paths = [
28880
- path3.join(projectDir, `${sessionId}.jsonl`),
28881
- path3.join(projectDir, "archive", `${sessionId}.jsonl`)
28954
+ path4.join(projectDir, `${sessionId}.jsonl`),
28955
+ path4.join(projectDir, "archive", `${sessionId}.jsonl`)
28882
28956
  ];
28883
28957
  let lastReadError;
28884
28958
  for (const filePath of paths) {
@@ -29621,7 +29695,7 @@ var QwenCodeAdapter = class {
29621
29695
  if (this.#closePromise) {
29622
29696
  return { status: "unavailable", error: invalidState("Qwen Code Adapter is closed") };
29623
29697
  }
29624
- const cwd = path4.resolve(input.cwd ?? process.cwd());
29698
+ const cwd = path5.resolve(input.cwd ?? process.cwd());
29625
29699
  if (!input.refresh) {
29626
29700
  const cached2 = this.#inspectionCache.get(cwd);
29627
29701
  if (cached2)
@@ -29688,7 +29762,7 @@ var QwenCodeAdapter = class {
29688
29762
  }
29689
29763
  };
29690
29764
  }
29691
- const cwd = path4.resolve(input.cwd);
29765
+ const cwd = path5.resolve(input.cwd);
29692
29766
  const sessionEnvironment = mergeEnvironment(this.#environment, input.environment);
29693
29767
  let initialPermissionModeId = QWEN_CODE_DEFAULT_PERMISSION_MODE_ID;
29694
29768
  if (input.kind === "create") {