flavor-code 1.4.2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +53 -1
  2. package/README.zh-CN.md +53 -1
  3. package/dist/agent/loop.d.ts +1 -0
  4. package/dist/{app-4CUS3GEJ.js → app-TVY2HM5L.js} +891 -604
  5. package/dist/apply-WOW3QU5I.js +51 -0
  6. package/dist/broker-cli-X5H46FZV.js +15 -0
  7. package/dist/check-CSKTV4O2.js +16 -0
  8. package/dist/chunk-3563SW4X.js +10513 -0
  9. package/dist/chunk-36IDJRLQ.js +630 -0
  10. package/dist/chunk-3UX2CGDW.js +1955 -0
  11. package/dist/chunk-4TMLXZVZ.js +75 -0
  12. package/dist/{chunk-7YFHRORG.js → chunk-5BDKRA6U.js} +412 -172
  13. package/dist/chunk-6F66UXBI.js +48 -0
  14. package/dist/{chunk-KMBDK4SN.js → chunk-6URQ7FIF.js} +24 -88
  15. package/dist/chunk-7Y64WNBB.js +8930 -0
  16. package/dist/chunk-AA4QNKTF.js +501 -0
  17. package/dist/chunk-BDX777JR.js +11 -0
  18. package/dist/chunk-CVP5OUHD.js +103 -0
  19. package/dist/chunk-EWD7FWTH.js +14547 -0
  20. package/dist/{chunk-N5MXHJKD.js → chunk-GTFP2R5I.js} +1 -1
  21. package/dist/{chunk-W2TIY6JY.js → chunk-IKGT4MDT.js} +2028 -516
  22. package/dist/chunk-IQEEFDEE.js +389 -0
  23. package/dist/chunk-IU3UBETC.js +30 -0
  24. package/dist/chunk-JQM2L2YM.js +1003 -0
  25. package/dist/chunk-KRWWCVXA.js +74 -0
  26. package/dist/chunk-OKHV7CTB.js +482 -0
  27. package/dist/chunk-ONRY3C2L.js +196 -0
  28. package/dist/chunk-PULWAH6E.js +474 -0
  29. package/dist/chunk-PZ5NKRVA.js +85 -0
  30. package/dist/chunk-QACFKPZP.js +43704 -0
  31. package/dist/chunk-RBAZLFKB.js +1022 -0
  32. package/dist/chunk-RV3EXUXM.js +30 -0
  33. package/dist/chunk-TIEOVQW6.js +61 -0
  34. package/dist/chunk-WLZUAVVU.js +15 -0
  35. package/dist/chunk-X442CJJH.js +114 -0
  36. package/dist/chunk-X6U6BO5D.js +2130 -0
  37. package/dist/{chunk-RAYH6K2H.js → chunk-Y7EH4NVO.js} +1 -1
  38. package/dist/{chunk-S32JRDZK.js → chunk-ZKKVSR37.js} +6 -1
  39. package/dist/{claude-ink-VQU3C5UL.js → claude-ink-F554I3GJ.js} +9 -4
  40. package/dist/cli-MAWCV2YR.js +163 -0
  41. package/dist/cli-main.js +3805 -473
  42. package/dist/cli.js +50 -4
  43. package/dist/config/load.d.ts +8 -0
  44. package/dist/config/protected-file.d.ts +2 -0
  45. package/dist/config/schema.d.ts +14 -0
  46. package/dist/context/global-instructions.d.ts +12 -0
  47. package/dist/context/manager.d.ts +4 -0
  48. package/dist/desktop/main.js +4943 -1562
  49. package/dist/desktop/preload.cjs +30 -0
  50. package/dist/desktop-renderer/assets/index-BWklSoOO.css +1 -0
  51. package/dist/desktop-renderer/assets/index-CjC0Ibiq.js +153 -0
  52. package/dist/desktop-renderer/assets/{interactive-terminal-ouQQ3brz.js → interactive-terminal-IjIT3Xoa.js} +1 -1
  53. package/dist/desktop-renderer/index.html +2 -2
  54. package/dist/doctor-SEL32R7M.js +20 -0
  55. package/dist/harness/local.d.ts +1 -0
  56. package/dist/load-RHWXNUCS.js +25 -0
  57. package/dist/log-ATFIPRNU.js +19 -0
  58. package/dist/manager-IYBNNKUP.js +191 -0
  59. package/dist/models/anthropic.d.ts +3 -0
  60. package/dist/node-LOIXT44J.js +879 -0
  61. package/dist/plugin-worker-entry.js +1 -1
  62. package/dist/production-TQROFEPV.js +46 -0
  63. package/dist/production.d.ts +28 -1
  64. package/dist/project-3QXE22TG.js +11 -0
  65. package/dist/react-M6JGXSJZ.js +7 -0
  66. package/dist/recorder-FAGJJH3N.js +11 -0
  67. package/dist/sdk/index.js +30 -8
  68. package/dist/server-2KLKPHPL.js +11 -0
  69. package/dist/session/store.d.ts +1 -0
  70. package/dist/store-MZZERW7K.js +18 -0
  71. package/dist/ui/commands.d.ts +11 -3
  72. package/dist/ui/session.d.ts +2 -1
  73. package/dist/usage-summary-G5FBOJLK.js +13 -0
  74. package/dist/write-stream-CGD57URC.js +77 -0
  75. package/package.json +1 -1
  76. package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +649 -1
  77. package/dist/chunk-B23V72YR.js +0 -170
  78. package/dist/chunk-QKND3FX7.js +0 -26103
  79. package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +0 -1
  80. package/dist/desktop-renderer/assets/index-CPXrzFgv.js +0 -154
  81. package/dist/load-UPOG3XQR.js +0 -19
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as createFlavorRequire } from "node:module"; const require = createFlavorRequire(import.meta.url);
3
+
4
+ // src/utils/spawn-executable.ts
5
+ import { accessSync, constants, existsSync, statSync } from "fs";
6
+ import { delimiter, extname, isAbsolute, resolve } from "path";
7
+ var WINDOWS_BATCH = /\.(?:bat|cmd)$/iu;
8
+ var WINDOWS_CMD_SHIM = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/iu;
9
+ var CMD_META = /([()\][%!^"`<>&|;, *?])/gu;
10
+ function prepareSpawnInvocation(command, args, options = {}) {
11
+ if ((options.platform ?? process.platform) !== "win32") return { command, args: [...args] };
12
+ const env = options.env ?? process.env;
13
+ const commandFile = resolveExecutablePath(command, options);
14
+ if (commandFile === void 0 || !WINDOWS_BATCH.test(commandFile)) {
15
+ return { command: commandFile ?? command, args: [...args] };
16
+ }
17
+ const doubleEscape = WINDOWS_CMD_SHIM.test(commandFile);
18
+ const shellCommand = [escapeCmdCommand(commandFile), ...args.map((arg) => escapeCmdArgument(arg, doubleEscape))].join(" ");
19
+ return {
20
+ command: environmentValue(env, "ComSpec") ?? "cmd.exe",
21
+ args: ["/d", "/s", "/c", `"${shellCommand}"`],
22
+ windowsVerbatimArguments: true
23
+ };
24
+ }
25
+ function resolveExecutablePath(command, options = {}) {
26
+ const platform = options.platform ?? process.platform;
27
+ const env = options.env ?? process.env;
28
+ if (platform === "win32") return resolveWindowsCommand(command, options.cwd, env);
29
+ const hasPath = isAbsolute(command) || command.includes("/");
30
+ const bases = hasPath ? [isAbsolute(command) ? command : resolve(options.cwd ?? process.cwd(), command)] : (env.PATH ?? "").split(delimiter).filter(Boolean).map((entry) => resolve(entry, command));
31
+ return bases.find(isExecutableFile);
32
+ }
33
+ function resolveWindowsCommand(command, cwd, env) {
34
+ const pathValue = environmentValue(env, "PATH") ?? "";
35
+ const pathExt = (environmentValue(env, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean);
36
+ const hasPath = isAbsolute(command) || /[\\/]/u.test(command);
37
+ const bases = hasPath ? [isAbsolute(command) ? command : resolve(cwd ?? process.cwd(), command)] : [
38
+ resolve(cwd ?? process.cwd(), command),
39
+ ...pathValue.split(";").filter(Boolean).map((entry) => resolve(unquote(entry), command))
40
+ ];
41
+ for (const base of bases) {
42
+ const candidates = extname(base).length > 0 ? [base] : [...pathExt.map((extension) => `${base}${extension}`), base];
43
+ for (const candidate of candidates) {
44
+ if (isRegularFile(candidate)) return resolve(candidate);
45
+ }
46
+ }
47
+ return void 0;
48
+ }
49
+ function environmentValue(env, name) {
50
+ const key = Object.keys(env).find((candidate) => candidate.toLowerCase() === name.toLowerCase());
51
+ return key === void 0 ? void 0 : env[key];
52
+ }
53
+ function unquote(value) {
54
+ const trimmed = value.trim();
55
+ return trimmed.startsWith('"') && trimmed.endsWith('"') ? trimmed.slice(1, -1) : trimmed;
56
+ }
57
+ function isRegularFile(path) {
58
+ try {
59
+ return existsSync(path) && statSync(path).isFile();
60
+ } catch {
61
+ return false;
62
+ }
63
+ }
64
+ function isExecutableFile(path) {
65
+ try {
66
+ if (!existsSync(path) || !statSync(path).isFile()) return false;
67
+ accessSync(path, constants.X_OK);
68
+ return true;
69
+ } catch {
70
+ return false;
71
+ }
72
+ }
73
+ function escapeCmdCommand(value) {
74
+ return value.replace(CMD_META, "^$1");
75
+ }
76
+ function escapeCmdArgument(value, doubleEscapeMetaCharacters) {
77
+ let escaped = value.replace(/(?=(\\+?)?)\1"/gu, '$1$1\\"').replace(/(?=(\\+?)?)\1$/gu, "$1$1");
78
+ escaped = `"${escaped}"`.replace(CMD_META, "^$1");
79
+ return doubleEscapeMetaCharacters ? escaped.replace(CMD_META, "^$1") : escaped;
80
+ }
81
+
82
+ export {
83
+ prepareSpawnInvocation,
84
+ resolveExecutablePath
85
+ };