@co0ontty/wand 4.63.0 → 4.64.0-beta.g3402a64

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 (83) hide show
  1. package/dist/build-info.d.ts +18 -0
  2. package/dist/build-info.js +13 -0
  3. package/dist/build-info.json +4 -4
  4. package/dist/config.js +6 -11
  5. package/dist/env-utils.d.ts +5 -0
  6. package/dist/env-utils.js +4 -0
  7. package/dist/git-quick-commit.js +7 -11
  8. package/dist/ios-ota.js +8 -29
  9. package/dist/layout-tree.d.ts +6 -0
  10. package/dist/layout-tree.js +9 -0
  11. package/dist/missions.js +2 -2
  12. package/dist/models.js +2 -5
  13. package/dist/path-repair.js +2 -1
  14. package/dist/process-manager.js +10 -20
  15. package/dist/provider-cli-updater.js +3 -6
  16. package/dist/pty-shell-launch.js +3 -5
  17. package/dist/server-app-connect.js +11 -46
  18. package/dist/server-github-routes.js +12 -11
  19. package/dist/server-local-preview-routes.js +6 -1
  20. package/dist/server-request.d.ts +4 -2
  21. package/dist/server-request.js +25 -4
  22. package/dist/server-session-routes.js +14 -78
  23. package/dist/server-settings-routes.d.ts +2 -6
  24. package/dist/server-settings-routes.js +3 -8
  25. package/dist/server-task-routes.d.ts +9 -6
  26. package/dist/server-task-routes.js +50 -43
  27. package/dist/server-update-routes.d.ts +2 -5
  28. package/dist/server-update-routes.js +42 -9
  29. package/dist/server-workspace-routes.js +4 -12
  30. package/dist/server.js +33 -99
  31. package/dist/session-ai-context.js +6 -38
  32. package/dist/session-provider.d.ts +16 -0
  33. package/dist/session-provider.js +49 -0
  34. package/dist/session-registry.d.ts +10 -0
  35. package/dist/session-registry.js +41 -14
  36. package/dist/session-topic.js +3 -11
  37. package/dist/shell-quote.d.ts +9 -0
  38. package/dist/shell-quote.js +13 -0
  39. package/dist/signal-utils.d.ts +10 -0
  40. package/dist/signal-utils.js +38 -0
  41. package/dist/storage.js +17 -55
  42. package/dist/structured-client-protocol.js +4 -8
  43. package/dist/structured-codex-protocol.js +1 -6
  44. package/dist/structured-content.d.ts +2 -0
  45. package/dist/structured-content.js +6 -0
  46. package/dist/structured-exec-host.d.ts +0 -2
  47. package/dist/structured-exec-host.js +2 -11
  48. package/dist/structured-exec-pump.js +2 -12
  49. package/dist/structured-grok-adapter.js +1 -5
  50. package/dist/structured-opencode-adapter.js +1 -5
  51. package/dist/structured-pi-adapter.js +9 -11
  52. package/dist/structured-provider-common.d.ts +11 -3
  53. package/dist/structured-provider-common.js +16 -23
  54. package/dist/structured-qoder-adapter.js +3 -8
  55. package/dist/structured-session-manager.js +6 -17
  56. package/dist/task-title.js +4 -12
  57. package/dist/task-types.d.ts +23 -1
  58. package/dist/task-types.js +26 -0
  59. package/dist/terminal-daemon-protocol.d.ts +0 -6
  60. package/dist/terminal-daemon-server.js +1 -9
  61. package/dist/text-utils.d.ts +7 -0
  62. package/dist/text-utils.js +15 -0
  63. package/dist/tui/attach.js +17 -93
  64. package/dist/tui/commands.d.ts +2 -0
  65. package/dist/tui/commands.js +3 -2
  66. package/dist/tui/index.js +28 -115
  67. package/dist/tui/runtime-utils.d.ts +7 -0
  68. package/dist/tui/runtime-utils.js +33 -0
  69. package/dist/tui/service-actions.d.ts +31 -0
  70. package/dist/tui/service-actions.js +86 -0
  71. package/dist/tui/snapshot.js +1 -8
  72. package/dist/update-helper.js +6 -35
  73. package/dist/web-ui/content/scripts.js +397 -497
  74. package/dist/web-ui/content/styles.css +1 -1
  75. package/dist/web-ui/content/tailwind.css +7210 -0
  76. package/dist/web-ui/embedded-assets.js +2 -2
  77. package/dist/web-ui/index.js +3 -3
  78. package/dist/web-ui/provider-identity.d.ts +4 -0
  79. package/dist/web-ui/provider-identity.js +9 -0
  80. package/dist/web-ui/styles.js +24 -7
  81. package/dist/workspace-binding.d.ts +2 -0
  82. package/dist/workspace-binding.js +4 -3
  83. package/package.json +9 -12
@@ -1,16 +1,12 @@
1
1
  import { spawn, spawnSync } from "node:child_process";
2
- import { chmodSync, existsSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { chmodSync, existsSync, mkdtempSync, writeFileSync } from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
5
  import process from "node:process";
6
6
  import { fileURLToPath } from "node:url";
7
+ import { readServiceEntrypoint } from "./tui/commands.js";
7
8
  import { resolveGlobalWandBin } from "./npm-update-utils.js";
8
- function shellQuote(value) {
9
- return `'${value.replace(/'/g, `'\\''`)}'`;
10
- }
11
- function shellArray(values) {
12
- return values.map((value) => shellQuote(value)).join(" ");
13
- }
9
+ import { shellQuote, shellQuoteAll } from "./shell-quote.js";
14
10
  function resolveBashPath() {
15
11
  return existsSync("/bin/bash") ? "/bin/bash" : "bash";
16
12
  }
@@ -92,34 +88,9 @@ export function isStableServiceEntrypoint(entrypoint, stableBin) {
92
88
  return false;
93
89
  }
94
90
  }
95
- function readManagedServiceEntrypoint(scope) {
96
- if (process.platform === "darwin") {
97
- const plist = scope === "system"
98
- ? "/Library/LaunchDaemons/com.wand.web.plist"
99
- : path.join(os.homedir(), "Library/LaunchAgents/com.wand.web.plist");
100
- const result = spawnSync("plutil", ["-extract", "ProgramArguments.1", "raw", "-o", "-", plist], { encoding: "utf8", timeout: 5_000 });
101
- return result.status === 0 ? (result.stdout || "").trim() || null : null;
102
- }
103
- if (process.platform === "linux") {
104
- const unit = scope === "system"
105
- ? "/etc/systemd/system/wand.service"
106
- : path.join(os.homedir(), ".config/systemd/user/wand.service");
107
- try {
108
- const execStart = readFileSync(unit, "utf8").split("\n").find((line) => line.startsWith("ExecStart="));
109
- if (!execStart)
110
- return null;
111
- const tokens = execStart.slice("ExecStart=".length).trim().split(/\s+/);
112
- return tokens[1] || null;
113
- }
114
- catch {
115
- return null;
116
- }
117
- }
118
- return null;
119
- }
120
91
  function managedServiceUpdatePreflight(scope) {
121
92
  const stableBin = resolveGlobalWandBin();
122
- const entrypoint = readManagedServiceEntrypoint(scope);
93
+ const entrypoint = readServiceEntrypoint(scope);
123
94
  if (isStableServiceEntrypoint(entrypoint, stableBin))
124
95
  return { ok: true };
125
96
  const command = scope === "system"
@@ -176,7 +147,7 @@ export function buildDetachedUpdateHelperScript(opts, logPath, serviceScope, upd
176
147
  if (updateUtilsPath.endsWith(".ts") && nodeLoaderArgs.length === 0) {
177
148
  throw new Error("本地 TypeScript 更新 helper 无法解析 tsx loader,请先运行 npm install。");
178
149
  }
179
- const nodeLoaderCommand = nodeLoaderArgs.length > 0 ? `${shellArray(nodeLoaderArgs)} ` : "";
150
+ const nodeLoaderCommand = nodeLoaderArgs.length > 0 ? `${shellQuoteAll(nodeLoaderArgs)} ` : "";
180
151
  return `#!/usr/bin/env bash
181
152
  set -euo pipefail
182
153
  LOG=${shellQuote(logPath)}
@@ -197,7 +168,7 @@ NODE_BIN=${shellQuote(process.execPath)}
197
168
  UPDATE_UTILS=${shellQuote(updateUtilsPath)}
198
169
  GLOBAL_CLI_PATH_FILE=${shellQuote(`${logPath}.cli-path`)}
199
170
  WORKING_DIRECTORY=${shellQuote(opts.cwd)}
200
- CLI_ARGS=(${shellArray(opts.cliArgs)})
171
+ CLI_ARGS=(${shellQuoteAll(opts.cliArgs)})
201
172
  GLOBAL_CLI=""
202
173
  PARENT_EXITED=0
203
174