@wirecat/yandex-disk-cli 0.0.0-stage → 0.1.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 (235) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/LICENSE +204 -0
  3. package/README.md +243 -2
  4. package/contracts/wirecat.json +1554 -0
  5. package/dist/bin/ydisk.d.ts +3 -0
  6. package/dist/bin/ydisk.d.ts.map +1 -0
  7. package/dist/bin/ydisk.js +40 -0
  8. package/dist/bin/ydisk.js.map +1 -0
  9. package/dist/bundle/all-profiles-4OLZF3RT.js +279 -0
  10. package/dist/bundle/anthropic-DKB4OJXZ.js +91 -0
  11. package/dist/bundle/app-server-G4545SSV.js +247 -0
  12. package/dist/bundle/bun-RXEQKFED.js +169 -0
  13. package/dist/bundle/bun-sqlite-VHT5LN7U.js +76 -0
  14. package/dist/bundle/chunk-2BITUXGC.js +12289 -0
  15. package/dist/bundle/chunk-2CLWDQKA.js +39330 -0
  16. package/dist/bundle/chunk-2JFDOPKA.js +9575 -0
  17. package/dist/bundle/chunk-3GVI2MAO.js +106 -0
  18. package/dist/bundle/chunk-3SZBWBMI.js +131 -0
  19. package/dist/bundle/chunk-44VSEXW6.js +4054 -0
  20. package/dist/bundle/chunk-4YPRRQBE.js +95 -0
  21. package/dist/bundle/chunk-5COYRL5B.js +379 -0
  22. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  23. package/dist/bundle/chunk-5DM7DIZL.js +1402 -0
  24. package/dist/bundle/chunk-6R2DVTVZ.js +24 -0
  25. package/dist/bundle/chunk-762BS35H.js +2787 -0
  26. package/dist/bundle/chunk-AG64V7AB.js +1233 -0
  27. package/dist/bundle/chunk-BC5HGIXB.js +334 -0
  28. package/dist/bundle/chunk-BH7LFEX7.js +36 -0
  29. package/dist/bundle/chunk-BLNPGY7N.js +53 -0
  30. package/dist/bundle/chunk-CNIA2LJF.js +372 -0
  31. package/dist/bundle/chunk-COSXMDC7.js +230 -0
  32. package/dist/bundle/chunk-D72URWJE.js +532 -0
  33. package/dist/bundle/chunk-D7FO33KU.js +785 -0
  34. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  35. package/dist/bundle/chunk-DJH26PQ3.js +1396 -0
  36. package/dist/bundle/chunk-DJPT7IUC.js +64567 -0
  37. package/dist/bundle/chunk-DTMSCZDW.js +209 -0
  38. package/dist/bundle/chunk-E6LGZ5LX.js +16 -0
  39. package/dist/bundle/chunk-E6YRIHS5.js +92 -0
  40. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  41. package/dist/bundle/chunk-F3DDSZTF.js +78 -0
  42. package/dist/bundle/chunk-F4WWTQNL.js +188 -0
  43. package/dist/bundle/chunk-FDDAUASC.js +1028 -0
  44. package/dist/bundle/chunk-FMNPG6N2.js +170 -0
  45. package/dist/bundle/chunk-FOKJ4POB.js +274 -0
  46. package/dist/bundle/chunk-G22C7JG6.js +731 -0
  47. package/dist/bundle/chunk-GA442SYZ.js +161 -0
  48. package/dist/bundle/chunk-GEBSW7UK.js +6848 -0
  49. package/dist/bundle/chunk-GGRKWAOK.js +594 -0
  50. package/dist/bundle/chunk-HHINRNZA.js +788 -0
  51. package/dist/bundle/chunk-HUZCL33L.js +128 -0
  52. package/dist/bundle/chunk-IALSIQVT.js +142 -0
  53. package/dist/bundle/chunk-IOXR2QBX.js +398 -0
  54. package/dist/bundle/chunk-J5CXR6VX.js +63 -0
  55. package/dist/bundle/chunk-J5PWSTOX.js +82 -0
  56. package/dist/bundle/chunk-J7BVAEHR.js +364 -0
  57. package/dist/bundle/chunk-JH46HMZW.js +1334 -0
  58. package/dist/bundle/chunk-JOBO7F6W.js +52 -0
  59. package/dist/bundle/chunk-JXZ5B3L5.js +2333 -0
  60. package/dist/bundle/chunk-KBIAMDZN.js +66 -0
  61. package/dist/bundle/chunk-KFVDL2QS.js +146 -0
  62. package/dist/bundle/chunk-LNHTLSR5.js +288 -0
  63. package/dist/bundle/chunk-M24RAKMJ.js +58 -0
  64. package/dist/bundle/chunk-MDQ57Q3H.js +1197 -0
  65. package/dist/bundle/chunk-MGUEZYFA.js +5546 -0
  66. package/dist/bundle/chunk-MLXQ4X5L.js +206 -0
  67. package/dist/bundle/chunk-NQAKARHE.js +54 -0
  68. package/dist/bundle/chunk-OF7VVUDQ.js +23 -0
  69. package/dist/bundle/chunk-OQVPE3XK.js +324 -0
  70. package/dist/bundle/chunk-OR3QG7UR.js +259 -0
  71. package/dist/bundle/chunk-OUUYVROP.js +76 -0
  72. package/dist/bundle/chunk-PQBAM64O.js +168 -0
  73. package/dist/bundle/chunk-PYVIA7WF.js +88 -0
  74. package/dist/bundle/chunk-Q6HK3PHE.js +72 -0
  75. package/dist/bundle/chunk-QB3KECV2.js +218 -0
  76. package/dist/bundle/chunk-QGWXSFYN.js +73 -0
  77. package/dist/bundle/chunk-RC5QAAAE.js +29 -0
  78. package/dist/bundle/chunk-RMJ26HLB.js +18 -0
  79. package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
  80. package/dist/bundle/chunk-T7ZUDA4C.js +72 -0
  81. package/dist/bundle/chunk-TRCSMVV5.js +72 -0
  82. package/dist/bundle/chunk-UD2BQEKA.js +46 -0
  83. package/dist/bundle/chunk-V4TL55GS.js +1068 -0
  84. package/dist/bundle/chunk-VJNWN5VU.js +4072 -0
  85. package/dist/bundle/chunk-VRRNBLMA.js +1227 -0
  86. package/dist/bundle/chunk-WUCMMNFJ.js +771 -0
  87. package/dist/bundle/chunk-XDESE3NY.js +44 -0
  88. package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
  89. package/dist/bundle/chunk-XQUUANA2.js +24600 -0
  90. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  91. package/dist/bundle/chunk-Z2QEON7B.js +2275 -0
  92. package/dist/bundle/chunk-ZMJ56GME.js +7 -0
  93. package/dist/bundle/chunk-ZTSB3D7Q.js +100 -0
  94. package/dist/bundle/chunk-ZVJWD3FK.js +38 -0
  95. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  96. package/dist/bundle/command-contract-YIOYGPJA.js +40 -0
  97. package/dist/bundle/command-server-entry-MHBQDXS4.js +169 -0
  98. package/dist/bundle/decode-NUGJIOUW.js +297 -0
  99. package/dist/bundle/definitions-AILHKEQT.js +2005 -0
  100. package/dist/bundle/dispatch-5LC4UEGY.js +411 -0
  101. package/dist/bundle/dist-4I2W6X2I.js +7577 -0
  102. package/dist/bundle/echarts-MHSH6PGC.js +42501 -0
  103. package/dist/bundle/embed-ZDXTHHYS.js +38 -0
  104. package/dist/bundle/embedder-XFEELFUL.js +111 -0
  105. package/dist/bundle/failure-5S7VPBYK.js +25 -0
  106. package/dist/bundle/first-run-JHCHT3RJ.js +29 -0
  107. package/dist/bundle/first-screen-FHGQ6QRV.js +40 -0
  108. package/dist/bundle/instructions-WKSMBUFX.js +11 -0
  109. package/dist/bundle/mcp-HS2ZDUVR.js +167 -0
  110. package/dist/bundle/mdast-util-from-markdown-R66F4HZA.js +1958 -0
  111. package/dist/bundle/mdast-util-gfm-LN2ELINH.js +2699 -0
  112. package/dist/bundle/meeting-combined-K4U4NYRZ.js +25 -0
  113. package/dist/bundle/meeting-model-KCEG6Y5O.js +26 -0
  114. package/dist/bundle/meeting-semantic-VYGSV3H6.js +22 -0
  115. package/dist/bundle/micromark-extension-gfm-5X7YT43T.js +1838 -0
  116. package/dist/bundle/node-CM6NC6UE.js +176 -0
  117. package/dist/bundle/node-KM3CUABH.js +2340 -0
  118. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  119. package/dist/bundle/node-sqlite-5YDQ3LIJ.js +74 -0
  120. package/dist/bundle/notes-search-PGO7KM2U.js +62 -0
  121. package/dist/bundle/oauth-NY4C5UCK.js +20 -0
  122. package/dist/bundle/open-YNUTA6ZE.js +23 -0
  123. package/dist/bundle/openai-4CVT5PHH.js +241 -0
  124. package/dist/bundle/process-2XT3TL27.js +91 -0
  125. package/dist/bundle/program-FMIVF5T6.js +31904 -0
  126. package/dist/bundle/prompt-VNWY3H6S.js +17 -0
  127. package/dist/bundle/recognize-JS4PBPSZ.js +26 -0
  128. package/dist/bundle/remote-RCLFH4V2.js +32 -0
  129. package/dist/bundle/rerank-EG6VKYGO.js +52 -0
  130. package/dist/bundle/schemas-ED2LHKXK.js +645 -0
  131. package/dist/bundle/serve-AHG25QXB.js +199 -0
  132. package/dist/bundle/server-5FTB7WM3.js +78 -0
  133. package/dist/bundle/server-JNZVSAZE.js +209 -0
  134. package/dist/bundle/sqlite-runtime-XSZOAQPF.js +20 -0
  135. package/dist/bundle/state-XGVAJFF7.js +36 -0
  136. package/dist/bundle/store-OHSCWZEV.js +177 -0
  137. package/dist/bundle/store-PKSPKJXL.js +293 -0
  138. package/dist/bundle/store-maintenance-command-KAWGBSWK.js +69 -0
  139. package/dist/bundle/ydisk.js +183 -0
  140. package/dist/commands/api.d.ts +9 -0
  141. package/dist/commands/api.d.ts.map +1 -0
  142. package/dist/commands/api.js +59 -0
  143. package/dist/commands/api.js.map +1 -0
  144. package/dist/commands/comments.d.ts +3 -0
  145. package/dist/commands/comments.d.ts.map +1 -0
  146. package/dist/commands/comments.js +114 -0
  147. package/dist/commands/comments.js.map +1 -0
  148. package/dist/commands/files.d.ts +3 -0
  149. package/dist/commands/files.d.ts.map +1 -0
  150. package/dist/commands/files.js +272 -0
  151. package/dist/commands/files.js.map +1 -0
  152. package/dist/commands/library.d.ts +13 -0
  153. package/dist/commands/library.d.ts.map +1 -0
  154. package/dist/commands/library.js +118 -0
  155. package/dist/commands/library.js.map +1 -0
  156. package/dist/commands/session.d.ts +3 -0
  157. package/dist/commands/session.d.ts.map +1 -0
  158. package/dist/commands/session.js +99 -0
  159. package/dist/commands/session.js.map +1 -0
  160. package/dist/config.d.ts +18 -0
  161. package/dist/config.d.ts.map +1 -0
  162. package/dist/config.js +62 -0
  163. package/dist/config.js.map +1 -0
  164. package/dist/context.d.ts +80 -0
  165. package/dist/context.d.ts.map +1 -0
  166. package/dist/context.js +77 -0
  167. package/dist/context.js.map +1 -0
  168. package/dist/generated/definitions.d.ts +3 -0
  169. package/dist/generated/definitions.d.ts.map +1 -0
  170. package/dist/generated/definitions.js +2001 -0
  171. package/dist/generated/definitions.js.map +1 -0
  172. package/dist/generated/manifest.d.ts +6 -0
  173. package/dist/generated/manifest.d.ts.map +1 -0
  174. package/dist/generated/manifest.js +1473 -0
  175. package/dist/generated/manifest.js.map +1 -0
  176. package/dist/generated/schemas.d.ts +127 -0
  177. package/dist/generated/schemas.d.ts.map +1 -0
  178. package/dist/generated/schemas.js +545 -0
  179. package/dist/generated/schemas.js.map +1 -0
  180. package/dist/generated/types.d.ts +829 -0
  181. package/dist/generated/types.d.ts.map +1 -0
  182. package/dist/generated/types.js +5 -0
  183. package/dist/generated/types.js.map +1 -0
  184. package/dist/identity.d.ts +10 -0
  185. package/dist/identity.d.ts.map +1 -0
  186. package/dist/identity.js +33 -0
  187. package/dist/identity.js.map +1 -0
  188. package/dist/index.d.ts +3 -0
  189. package/dist/index.d.ts.map +1 -0
  190. package/dist/index.js +3 -0
  191. package/dist/index.js.map +1 -0
  192. package/dist/program.d.ts +6 -0
  193. package/dist/program.d.ts.map +1 -0
  194. package/dist/program.js +65 -0
  195. package/dist/program.js.map +1 -0
  196. package/dist/sample/comments.d.ts +61 -0
  197. package/dist/sample/comments.d.ts.map +1 -0
  198. package/dist/sample/comments.js +39 -0
  199. package/dist/sample/comments.js.map +1 -0
  200. package/dist/sample/records.d.ts +16 -0
  201. package/dist/sample/records.d.ts.map +1 -0
  202. package/dist/sample/records.js +22 -0
  203. package/dist/sample/records.js.map +1 -0
  204. package/dist/sample/transport.d.ts +42 -0
  205. package/dist/sample/transport.d.ts.map +1 -0
  206. package/dist/sample/transport.js +153 -0
  207. package/dist/sample/transport.js.map +1 -0
  208. package/dist/version.d.ts +2 -0
  209. package/dist/version.d.ts.map +1 -0
  210. package/dist/version.js +2 -0
  211. package/dist/version.js.map +1 -0
  212. package/dist/wcat.d.ts +3 -0
  213. package/dist/wcat.d.ts.map +1 -0
  214. package/dist/wcat.js +4 -0
  215. package/dist/wcat.js.map +1 -0
  216. package/dist/yandex/source.d.ts +39 -0
  217. package/dist/yandex/source.d.ts.map +1 -0
  218. package/dist/yandex/source.js +189 -0
  219. package/dist/yandex/source.js.map +1 -0
  220. package/dist/yandex/transport.d.ts +41 -0
  221. package/dist/yandex/transport.d.ts.map +1 -0
  222. package/dist/yandex/transport.js +152 -0
  223. package/dist/yandex/transport.js.map +1 -0
  224. package/dist/yandex/writes.d.ts +27 -0
  225. package/dist/yandex/writes.d.ts.map +1 -0
  226. package/dist/yandex/writes.js +61 -0
  227. package/dist/yandex/writes.js.map +1 -0
  228. package/package.json +88 -4
  229. package/skills/yandex-disk-cli/SKILL.md +46 -0
  230. package/skills/yandex-disk-cli/references/api/api-disk-operations-operation-id.md +13 -0
  231. package/skills/yandex-disk-cli/references/api/api-disk-public-resources.md +50 -0
  232. package/skills/yandex-disk-cli/references/api/api-disk-resources.md +171 -0
  233. package/skills/yandex-disk-cli/references/api/api-disk-trash-resources.md +48 -0
  234. package/skills/yandex-disk-cli/references/api/api-disk.md +13 -0
  235. package/skills/yandex-disk-cli/references/api.md +17 -0
@@ -0,0 +1,206 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ singleLine
5
+ } from "./chunk-T7ZUDA4C.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
9
+
10
+ // node_modules/.pnpm/@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_commander@15.0.0_esbuild@0.28._2fe0e09d29eda9827e2087fd1a1cce67/node_modules/@wirecat/cli-base/dist/wcat/names.js
11
+ var FIRST_PARTY_TOOLS = [
12
+ { name: "tg", package: "@wirecat/tg-cli" },
13
+ { name: "max", package: "@wirecat/max-cli" },
14
+ { name: "wa", package: "@wirecat/whatsapp-cli" },
15
+ { name: "zm", package: "@wirecat/zoom-cli" },
16
+ { name: "drive", package: "@wirecat/drive-cli" },
17
+ { name: "memo", package: "@wirecat/cli-memo" },
18
+ { name: "mail", package: "@wirecat/mail-cli" },
19
+ // memo reads email today; the name is held for a tool of its own.
20
+ { name: "email" }
21
+ ];
22
+ var BUILT_IN_COMMANDS = ["help", "version", "shortcuts", "doctor", "update", "upgrade", "app"];
23
+ var RESERVED_NAMES = [
24
+ ...FIRST_PARTY_TOOLS.map((tool) => tool.name),
25
+ ...BUILT_IN_COMMANDS,
26
+ "wcat"
27
+ ];
28
+ var TOOL_NAME = /^[a-z][a-z0-9-]{0,39}$/;
29
+ var PROGRAM_PREFIX = "wcat-";
30
+ var DESCRIBE_FLAG = "--wcat-describe";
31
+ var DESCRIBE_MAX_BYTES = 64 * 1024;
32
+ var DISPATCH_FLAG = "--wcat-dispatch";
33
+
34
+ // node_modules/.pnpm/@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_commander@15.0.0_esbuild@0.28._2fe0e09d29eda9827e2087fd1a1cce67/node_modules/@wirecat/cli-base/dist/wcat/describe.js
35
+ var DESCRIBE_FORMAT = 1;
36
+ var DESCRIBE_MANIFEST_FORMAT = 2;
37
+ var describeAnswer = /* @__PURE__ */ __name((tool, manifest) => {
38
+ const answer = {
39
+ wcat_describe: DESCRIBE_FORMAT,
40
+ name: tool.command,
41
+ version: tool.version,
42
+ description: tool.description,
43
+ ...tool.docs ? { docs_url: tool.docs } : {}
44
+ };
45
+ if (!manifest)
46
+ return answer;
47
+ const full = {
48
+ ...answer,
49
+ wcat_describe: DESCRIBE_MANIFEST_FORMAT,
50
+ desktop: manifest.desktop,
51
+ manifest_sha256: manifest.sha256
52
+ };
53
+ return Buffer.byteLength(`${JSON.stringify(full)}
54
+ `) > DESCRIBE_MAX_BYTES ? answer : full;
55
+ }, "describeAnswer");
56
+ var MAX_TEXT = 200;
57
+ var clean = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? singleLine(value.trim()).slice(0, MAX_TEXT) : void 0, "clean");
58
+ var parseDescribe = /* @__PURE__ */ __name((text) => {
59
+ let answer;
60
+ try {
61
+ answer = JSON.parse(text);
62
+ } catch {
63
+ return void 0;
64
+ }
65
+ if (typeof answer !== "object" || answer === null || !("wcat_describe" in answer))
66
+ return void 0;
67
+ const { version, description, docs_url: docs, manifest_sha256: sha } = answer;
68
+ const url = clean(docs);
69
+ return {
70
+ version: clean(version) ?? "",
71
+ description: clean(description) ?? "",
72
+ ...url && /^https?:\/\//.test(url) ? { docs: url } : {},
73
+ ...typeof sha === "string" && /^[0-9a-f]{64}$/.test(sha) ? { manifestSha256: sha } : {}
74
+ };
75
+ }, "parseDescribe");
76
+
77
+ // node_modules/.pnpm/@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_commander@15.0.0_esbuild@0.28._2fe0e09d29eda9827e2087fd1a1cce67/node_modules/@wirecat/cli-base/dist/wcat/shim.js
78
+ import { lstatSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
79
+ import { join } from "node:path";
80
+ var SHIM_FORMAT = 2;
81
+ var MARK = /^(?:#|REM) wirecat-shim (\d+) (launcher|shortcut) (\S+)\r?$/m;
82
+ var NOTE = {
83
+ launcher: "Written by @wirecat/cli-base. Any WireCat tool rewrites it when it breaks; it is safe to delete.",
84
+ shortcut: "Made by `wcat shortcuts add`; `wcat shortcuts remove` takes it out."
85
+ };
86
+ var shellQuote = /* @__PURE__ */ __name((text) => `'${text.replaceAll("'", `'\\''`)}'`, "shellQuote");
87
+ var launcherBody = /* @__PURE__ */ __name((dir, target, name) => [
88
+ 'ok() { [ -f "$1" ] && [ -x "$1" ]; }',
89
+ `dir=${shellQuote(dir)}`,
90
+ `target=${shellQuote(join(dir, target))}`,
91
+ 'if ! ok "$target"; then',
92
+ ' for t in "$dir"/wcat-*; do',
93
+ ' if ok "$t"; then target=$t; break; fi',
94
+ " done",
95
+ "fi",
96
+ `if ok "$target"; then exec "$target" ${DISPATCH_FLAG} "$@"; fi`,
97
+ 'if [ -z "$WIRECAT_LAUNCHER_SKIP" ]; then',
98
+ " WIRECAT_LAUNCHER_SKIP=1; export WIRECAT_LAUNCHER_SKIP",
99
+ " set -f; oldifs=$IFS; IFS=:",
100
+ " for d in $PATH; do",
101
+ ` if [ -n "$d" ] && [ "$d" != "$dir" ] && ok "$d/${name}"; then IFS=$oldifs; exec "$d/${name}" "$@"; fi`,
102
+ " done",
103
+ " IFS=$oldifs; set +f",
104
+ "fi",
105
+ `printf '%s\\n' "${name}: $target is missing and no other ${name}-* program was found in $dir or on PATH." \\`,
106
+ ` "This launcher is safe to delete: $dir/${name}" >&2`,
107
+ "exit 127"
108
+ ], "launcherBody");
109
+ var shimFiles = /* @__PURE__ */ __name((kind, { dir, name, target, platform }) => {
110
+ const mark = `wirecat-shim ${SHIM_FORMAT} ${kind} ${target}`;
111
+ const extra = kind === "launcher" ? ` ${DISPATCH_FLAG}` : "";
112
+ if (platform !== "win32")
113
+ return [
114
+ {
115
+ path: join(dir, name),
116
+ text: [
117
+ "#!/bin/sh",
118
+ `# ${mark}`,
119
+ `# ${NOTE[kind]}`,
120
+ ...kind === "launcher" ? launcherBody(dir, target, name) : [`exec ${shellQuote(join(dir, target))} "$@"`],
121
+ ""
122
+ ].join("\n")
123
+ }
124
+ ];
125
+ return [
126
+ {
127
+ path: join(dir, `${name}.cmd`),
128
+ text: ["@ECHO off", `REM ${mark}`, `REM ${NOTE[kind]}`, `"%~dp0${target}"${extra} %*`, ""].join("\r\n")
129
+ },
130
+ {
131
+ path: join(dir, `${name}.ps1`),
132
+ text: [
133
+ `# ${mark}`,
134
+ `# ${NOTE[kind]}`,
135
+ // PowerShell hands a .cmd its arguments unquoted, so `a&b` would run `b`; npm and pnpm write a .ps1 beside
136
+ // their .cmd, and it is started instead whenever it is there.
137
+ `$stem = Join-Path $PSScriptRoot "${target.replace(/\.(cmd|exe|bat)$/i, "")}"`,
138
+ `$target = if (Test-Path -LiteralPath "$stem.ps1") { "$stem.ps1" } else { Join-Path $PSScriptRoot "${target}" }`,
139
+ "if ($MyInvocation.ExpectingInput) {",
140
+ ` $input | & $target${extra} @args`,
141
+ "} else {",
142
+ ` & $target${extra} @args`,
143
+ "}",
144
+ "exit $LASTEXITCODE",
145
+ ""
146
+ ].join("\r\n")
147
+ }
148
+ ];
149
+ }, "shimFiles");
150
+ var parseShim = /* @__PURE__ */ __name((text) => {
151
+ const found = MARK.exec(text.split("\n", 3).join("\n"));
152
+ if (!found)
153
+ return void 0;
154
+ return { format: Number(found[1]), kind: found[2], target: found[3] };
155
+ }, "parseShim");
156
+ var MAX_SHIM_BYTES = 4096;
157
+ var fileState = /* @__PURE__ */ __name((path) => {
158
+ let stat;
159
+ try {
160
+ stat = lstatSync(path);
161
+ } catch (error) {
162
+ return error.code === "ENOENT" ? { state: "missing" } : { state: "foreign" };
163
+ }
164
+ if (!stat.isFile() || stat.size > MAX_SHIM_BYTES)
165
+ return { state: "foreign" };
166
+ try {
167
+ const text = readFileSync(path, "utf8");
168
+ const mark = parseShim(text);
169
+ return mark ? { state: "ours", mark, text } : { state: "foreign" };
170
+ } catch {
171
+ return { state: "foreign" };
172
+ }
173
+ }, "fileState");
174
+ var exists = /* @__PURE__ */ __name((path) => {
175
+ try {
176
+ return statSync(path).isFile();
177
+ } catch {
178
+ return false;
179
+ }
180
+ }, "exists");
181
+ var writeShim = /* @__PURE__ */ __name(({ path, text }) => {
182
+ const temporary = `${path}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
183
+ try {
184
+ writeFileSync(temporary, text, { mode: 493 });
185
+ renameSync(temporary, path);
186
+ } finally {
187
+ rmSync(temporary, { force: true });
188
+ }
189
+ }, "writeShim");
190
+
191
+ export {
192
+ FIRST_PARTY_TOOLS,
193
+ BUILT_IN_COMMANDS,
194
+ TOOL_NAME,
195
+ PROGRAM_PREFIX,
196
+ DESCRIBE_FLAG,
197
+ DESCRIBE_MAX_BYTES,
198
+ DISPATCH_FLAG,
199
+ describeAnswer,
200
+ parseDescribe,
201
+ SHIM_FORMAT,
202
+ shimFiles,
203
+ fileState,
204
+ exists,
205
+ writeShim
206
+ };
@@ -0,0 +1,54 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ resolvePaths
5
+ } from "./chunk-762BS35H.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
9
+
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.692.0_@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_comm_daa46dda8170ab81fe68d59b38277e40/node_modules/@wirecat/cli-core/dist/store/path.js
11
+ import { realpathSync } from "node:fs";
12
+ import { userInfo } from "node:os";
13
+ import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
14
+ var wirecatDirectory = /* @__PURE__ */ __name((env = process.env, platform) => resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env, ...platform ? { platform } : {} }).state, "wirecatDirectory");
15
+ var storePath = /* @__PURE__ */ __name((env = process.env) => env.MESSAGING_STORE ?? join(wirecatDirectory(env), "wirecat.db"), "storePath");
16
+ var accountHome = /* @__PURE__ */ __name(() => {
17
+ try {
18
+ return userInfo().homedir;
19
+ } catch {
20
+ return void 0;
21
+ }
22
+ }, "accountHome");
23
+ var inOwnerFolder = /* @__PURE__ */ __name((file, home = accountHome()) => {
24
+ if (!home || file === ":memory:")
25
+ return false;
26
+ const owner = wirecatDirectory({ HOME: home, USERPROFILE: home });
27
+ const within = /* @__PURE__ */ __name((path, folder) => {
28
+ const inside = relative(folder, path);
29
+ return !(inside.startsWith("..") || isAbsolute(inside));
30
+ }, "within");
31
+ return within(resolve(file), owner) || within(settled(resolve(file)), settled(owner));
32
+ }, "inOwnerFolder");
33
+ var settled = /* @__PURE__ */ __name((path) => {
34
+ try {
35
+ return realpathSync(path);
36
+ } catch {
37
+ const parent = dirname(path);
38
+ return parent === path ? path : join(settled(parent), basename(path));
39
+ }
40
+ }, "settled");
41
+ var refuseOwnerStoreInTests = /* @__PURE__ */ __name((file, env = process.env, home = accountHome()) => {
42
+ if (!env.VITEST || !inOwnerFolder(file, home))
43
+ return;
44
+ throw new Error(`a test tried to open ${file}, in the owner's real WireCat folder; give it a MESSAGING_STORE or HOME of its own`);
45
+ }, "refuseOwnerStoreInTests");
46
+
47
+ export {
48
+ wirecatDirectory,
49
+ storePath,
50
+ accountHome,
51
+ inOwnerFolder,
52
+ settled,
53
+ refuseOwnerStoreInTests
54
+ };
@@ -0,0 +1,23 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ __name
5
+ } from "./chunk-ZVVMGPBJ.js";
6
+
7
+ // node_modules/.pnpm/@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_commander@15.0.0_esbuild@0.28._2fe0e09d29eda9827e2087fd1a1cce67/node_modules/@wirecat/cli-base/dist/installer.js
8
+ var installerOf = /* @__PURE__ */ __name((scriptPath) => {
9
+ const path = scriptPath.replaceAll("\\", "/");
10
+ if (path.includes("/_npx/"))
11
+ return "npx";
12
+ if (path.includes("/install/global/node_modules/"))
13
+ return "bun";
14
+ if (/\/\.?pnpm\//.test(path))
15
+ return "pnpm";
16
+ if (path.includes("/node_modules/"))
17
+ return "npm";
18
+ return path.includes("/dist/") ? "checkout" : "unknown";
19
+ }, "installerOf");
20
+
21
+ export {
22
+ installerOf
23
+ };
@@ -0,0 +1,324 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ wrapAnsi
5
+ } from "./chunk-EH6ZEJGT.js";
6
+ import {
7
+ WIRECAT_TOOLS
8
+ } from "./chunk-PYVIA7WF.js";
9
+ import {
10
+ commandPathOf,
11
+ outputOf
12
+ } from "./chunk-3SZBWBMI.js";
13
+ import {
14
+ Command,
15
+ Help,
16
+ NO_EFFECTS,
17
+ Option,
18
+ annotate,
19
+ commandAt,
20
+ environmentOf,
21
+ metaOf,
22
+ takesProfile
23
+ } from "./chunk-2BITUXGC.js";
24
+ import {
25
+ writes
26
+ } from "./chunk-AG64V7AB.js";
27
+ import {
28
+ CliError
29
+ } from "./chunk-T7ZUDA4C.js";
30
+ import {
31
+ __name
32
+ } from "./chunk-ZVVMGPBJ.js";
33
+
34
+ // node_modules/.pnpm/@wirecat+cli-core@0.692.0_@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_comm_daa46dda8170ab81fe68d59b38277e40/node_modules/@wirecat/cli-core/dist/cli/help/command-help.js
35
+ var ARGUMENT_KINDS = {
36
+ chat: "chat",
37
+ chats: "chat",
38
+ message: "message",
39
+ messages: "message",
40
+ post: "message",
41
+ person: "person",
42
+ people: "person",
43
+ task: "task",
44
+ meeting: "meeting",
45
+ folder: "folder",
46
+ folders: "folder",
47
+ topic: "topic",
48
+ note: "note",
49
+ document: "document",
50
+ model: "model"
51
+ };
52
+ var ENTITY_KINDS = {
53
+ message: "message",
54
+ message_link: "message",
55
+ chat: "chat",
56
+ contact: "person",
57
+ member: "person",
58
+ person: "person",
59
+ task: "task",
60
+ meeting: "meeting",
61
+ meeting_details: "meeting",
62
+ meeting_hit: "meeting",
63
+ meeting_summary: "meeting",
64
+ folder: "folder",
65
+ topic: "topic",
66
+ note: "note",
67
+ document: "document",
68
+ model: "model"
69
+ };
70
+ var HOME = {
71
+ chat: "chats",
72
+ message: "messages",
73
+ person: "contacts",
74
+ task: "tasks",
75
+ meeting: "meetings",
76
+ folder: "folders",
77
+ topic: "topics",
78
+ note: "notes",
79
+ document: "documents",
80
+ model: "models"
81
+ };
82
+ var SAMPLES = {
83
+ chat: "Team",
84
+ message: "1234",
85
+ post: "1234",
86
+ person: "Anna",
87
+ people: "Anna",
88
+ task: "12",
89
+ meeting: "123",
90
+ folder: "Work",
91
+ topic: "General",
92
+ model: "default",
93
+ query: '"invoice"',
94
+ text: '"on my way"',
95
+ title: '"Weekly sync"',
96
+ name: "daily",
97
+ id: "1",
98
+ file: "./report.pdf",
99
+ link: "https://example.com/join/abc",
100
+ url: "https://example.com",
101
+ since: "1d",
102
+ duration: "1d",
103
+ limit: "20"
104
+ };
105
+ var MAX_NEXT = 3;
106
+ var choices = /* @__PURE__ */ new WeakMap();
107
+ var nextUsually = /* @__PURE__ */ __name((command, choice) => {
108
+ choices.set(command, choice);
109
+ return command;
110
+ }, "nextUsually");
111
+ var kindOfArgument = /* @__PURE__ */ __name((argument) => ARGUMENT_KINDS[argument.name()], "kindOfArgument");
112
+ var runs = /* @__PURE__ */ __name((command) => command.commands.length === 0 || Boolean(command._actionHandler), "runs");
113
+ var leaves = /* @__PURE__ */ __name((command) => command.commands.filter((child) => !child._hidden).flatMap((child) => [...runs(child) ? [child] : [], ...leaves(child)]), "leaves");
114
+ var rootOf = /* @__PURE__ */ __name((command) => {
115
+ let at = command;
116
+ while (at.parent)
117
+ at = at.parent;
118
+ return at;
119
+ }, "rootOf");
120
+ var call = /* @__PURE__ */ __name((command) => [
121
+ rootOf(command).name(),
122
+ ...commandPathOf(command),
123
+ ...command.registeredArguments.map((one) => one.required ? `<${one.name()}>` : `[${one.name()}]`)
124
+ ].join(" "), "call");
125
+ var fieldsOf = /* @__PURE__ */ __name((schema) => {
126
+ const variants = schema.anyOf;
127
+ if (variants)
128
+ return variants.flatMap(fieldsOf);
129
+ const required = schema.required ?? [];
130
+ return [...required, ...Object.keys(schema.properties ?? {})];
131
+ }, "fieldsOf");
132
+ var returnsOf = /* @__PURE__ */ __name((command) => {
133
+ const output = metaOf(command).output;
134
+ const { item, coverage } = outputOf(command);
135
+ if (!output || coverage !== "declared-entity")
136
+ return "";
137
+ const fields = [...new Set(fieldsOf(item))];
138
+ const noun = (output.view ? `${output.entity} ${output.view}` : output.entity).replaceAll("_", " ");
139
+ const more = fields.length > 8 ? `, and ${fields.length - 8} more` : "";
140
+ const root = rootOf(command);
141
+ const schema = commandAt(root, "commands info") ? `; every field: ${root.name()} commands info ${commandPathOf(command).join(" ")}` : "";
142
+ return `${noun} \u2014 ${fields.slice(0, 8).join(", ")}${more}${schema}`;
143
+ }, "returnsOf");
144
+ var nextOf = /* @__PURE__ */ __name((command) => {
145
+ const root = rootOf(command);
146
+ const choice = choices.get(command) ?? {};
147
+ const drop = new Set(choice.drop ?? []);
148
+ const pinned = (choice.pin ?? []).flatMap((path) => commandAt(root, path) ?? []);
149
+ const output = metaOf(command).output;
150
+ const kind = output ? ENTITY_KINDS[output.entity] : void 0;
151
+ const all = leaves(root);
152
+ const derived = kind ? all.filter((other) => other !== command && !pinned.includes(other)).filter((other) => other.registeredArguments.some((argument) => kindOfArgument(argument) === kind)).map((other, order) => ({ other, order })).sort((a, b) => {
153
+ const rank = /* @__PURE__ */ __name((other) => [
154
+ Number(writes(metaOf(other).effects)),
155
+ Number(!other.registeredArguments.some((one) => one.required && kindOfArgument(one) === kind)),
156
+ Number(commandPathOf(other)[0] !== HOME[kind]),
157
+ Number(other.parent !== command.parent)
158
+ ], "rank");
159
+ const [left, right] = [rank(a.other), rank(b.other)];
160
+ return left.reduce((found, value, at) => found || value - (right[at] ?? 0), 0) || a.order - b.order;
161
+ }).map(({ other }) => other) : [];
162
+ return [...pinned, ...derived].filter((other) => !drop.has(commandPathOf(other).join(" "))).slice(0, MAX_NEXT);
163
+ }, "nextOf");
164
+ var sample = /* @__PURE__ */ __name((name) => SAMPLES[name] ?? `<${name}>`, "sample");
165
+ var generatedExample = /* @__PURE__ */ __name((command) => {
166
+ const { query } = metaOf(command);
167
+ const words = command.registeredArguments.flatMap((argument) => {
168
+ const name = argument.name();
169
+ if (name === "query" && query)
170
+ return [];
171
+ if (!argument.required && SAMPLES[name] === void 0)
172
+ return [];
173
+ return [argument.argChoices?.[0] ?? sample(name)];
174
+ });
175
+ const options = command.options.filter((option) => option.mandatory).flatMap((option) => {
176
+ const flag = option.long ?? option.short ?? option.flags;
177
+ const placeholder = /[<[]([^>\]]+)[>\]]/.exec(option.flags)?.[1];
178
+ if (!(option.required || option.optional))
179
+ return [flag];
180
+ return [flag, option.argChoices?.[0] ?? sample(placeholder ?? option.attributeName())];
181
+ });
182
+ return [rootOf(command).name(), ...commandPathOf(command), ...words, ...options].join(" ");
183
+ }, "generatedExample");
184
+ var profiled = /* @__PURE__ */ new WeakSet();
185
+ var EXAMPLE_PROFILE = "personal";
186
+ var withProfile = /* @__PURE__ */ __name((command, example) => {
187
+ const root = rootOf(command);
188
+ const top = commandPathOf(command)[0];
189
+ if (!profiled.has(root) || top === void 0 || !takesProfile(command))
190
+ return example;
191
+ if (example.split(" ").includes("--profiles"))
192
+ return example;
193
+ const prefix = `${root.name()} ${top}`;
194
+ return example === prefix || example.startsWith(`${prefix} `) ? `${root.name()} ${EXAMPLE_PROFILE} ${example.slice(root.name().length + 1)}` : example;
195
+ }, "withProfile");
196
+ var commandHelp = /* @__PURE__ */ __name((command) => {
197
+ const written = metaOf(command).examples ?? [];
198
+ return {
199
+ returns: returnsOf(command),
200
+ next: nextOf(command).map(call),
201
+ examples: (written.length > 0 ? written : [generatedExample(command)]).map((one) => withProfile(command, one)),
202
+ origin: written.length > 0 ? "written" : "generated"
203
+ };
204
+ }, "commandHelp");
205
+ var LABEL = 15;
206
+ var commandHelpText = /* @__PURE__ */ __name((command) => {
207
+ const { returns, next, examples } = commandHelp(command);
208
+ const rows = /* @__PURE__ */ __name((label, values) => values.map((value, at) => `${(at === 0 ? label : "").padEnd(LABEL)}${value}`), "rows");
209
+ const availability = environmentOf(command).discoveryAvailability?.({
210
+ ...metaOf(command),
211
+ path: commandPathOf(command)
212
+ });
213
+ const profileMatters = profiled.has(rootOf(command)) && takesProfile(command);
214
+ const access = !availability ? [] : availability.available ? profileMatters ? rows("Availability:", ["available for this profile"]) : [] : rows("Availability:", [`unavailable \u2014 ${availability.reason}`]);
215
+ return [
216
+ "",
217
+ ...access,
218
+ ...rows("Returns:", returns ? [returns] : []),
219
+ ...rows("Next usually:", next),
220
+ ...rows("Example:", examples),
221
+ ""
222
+ ].join("\n");
223
+ }, "commandHelpText");
224
+ var installCommandHelp = /* @__PURE__ */ __name((program, { profile = true } = {}) => {
225
+ if (profile)
226
+ profiled.add(program);
227
+ for (const command of leaves(program))
228
+ command.addHelpText("after", () => commandHelpText(command));
229
+ }, "installCommandHelp");
230
+
231
+ // node_modules/.pnpm/@wirecat+cli-core@0.692.0_@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_comm_daa46dda8170ab81fe68d59b38277e40/node_modules/@wirecat/cli-core/dist/cli/help/first-screen.js
232
+ var WIDTH = 100;
233
+ var widest = /* @__PURE__ */ __name((texts) => texts.reduce((most, text) => Math.max(most, text.length), 0), "widest");
234
+ var block = /* @__PURE__ */ __name((title, rows, column) => rows.length === 0 ? [] : ["", `${title}:`, ...rows.map(([left, right]) => ` ${left.padEnd(column)}${right}`)], "block");
235
+ var TOPICS = [
236
+ ["--json", "output"],
237
+ ["--offline", "offline"],
238
+ ["--timeout", "timeouts"],
239
+ ["--dry-run", "dry run"]
240
+ ];
241
+ var optionTopics = /* @__PURE__ */ __name((program) => {
242
+ const longs = new Set(program.options.map((option) => option.long));
243
+ const topics = TOPICS.filter(([long]) => longs.has(long)).map(([, topic]) => topic);
244
+ return topics.length > 0 ? topics.join(", ") : "the options every command takes";
245
+ }, "optionTopics");
246
+ var pointers = /* @__PURE__ */ __name((program, cli, start, profile) => {
247
+ const has = /* @__PURE__ */ __name((path) => commandAt(program, path) !== void 0, "has");
248
+ const next = [
249
+ has("commands") ? [`${cli} commands`, "every command, by section"] : void 0,
250
+ has("guide") ? [`${cli} guide`, "scenarios: command sequences for common tasks"] : void 0,
251
+ [`${cli} help options`, optionTopics(program)]
252
+ ].filter((row) => row !== void 0);
253
+ const rows = [
254
+ ...start ? [["Start here:", start, profile ? "(any profile name works)" : ""]] : [],
255
+ ...has("account list") ? [["", `${cli} account list`, "your profiles and their logged-in accounts"]] : [],
256
+ ...next.map(([command = "", does = ""], at) => [at === 0 ? "Next:" : "", command, does]),
257
+ ...has("skill show") ? [["For agents:", `${cli} skill show`, "rules and the discovery loop"]] : []
258
+ ];
259
+ const width = widest(rows.map(([, command]) => command)) + 2;
260
+ return ["", ...rows.map(([label, command, does]) => `${label.padEnd(14)}${command.padEnd(width)}${does}`.trimEnd())];
261
+ }, "pointers");
262
+ var firstScreen = /* @__PURE__ */ __name((program, screen = {}) => {
263
+ const cli = program.name();
264
+ const profile = screen.profile !== false;
265
+ const pitch = screen.pitch ?? program.description().split("\n")[0] ?? "";
266
+ const can = (screen.can ?? []).map(({ command, does }) => [command, does]);
267
+ const works = WIRECAT_TOOLS.filter((tool) => tool.command !== cli).map(({ command, shown, does }) => [shown ?? command, does]);
268
+ const column = Math.max(22, widest([...can, ...works].map(([left]) => left))) + 2;
269
+ const start = screen.start ?? (commandAt(program, "setup") ? `${cli} ${EXAMPLE_PROFILE} setup` : void 0);
270
+ return [
271
+ wrapAnsi(`${cli} \u2014 ${pitch}`, WIDTH),
272
+ "",
273
+ `Usage: ${cli} ${profile ? "<profile> " : ""}<command> [options]`,
274
+ ...profile ? ["Account commands start with your profile, a name you choose; none is ever assumed."] : [],
275
+ ...block("What you can do", can, column),
276
+ ...block("Works with", works, column),
277
+ ...pointers(program, cli, start, profile),
278
+ ""
279
+ ].join("\n");
280
+ }, "firstScreen");
281
+ var optionsScreen = /* @__PURE__ */ __name((program) => {
282
+ const helper = program.createHelp();
283
+ const width = helper.longestOptionTermLength(program, helper);
284
+ return [
285
+ `Options for every ${program.name()} command:`,
286
+ ...helper.visibleOptions(program).map((option) => helper.formatItem(helper.optionTerm(option), width, helper.optionDescription(option), helper)),
287
+ ""
288
+ ].join("\n");
289
+ }, "optionsScreen");
290
+ var installHelp = /* @__PURE__ */ __name((program, screen = {}) => {
291
+ let full = false;
292
+ const own = program.configureHelp();
293
+ program.configureHelp({
294
+ ...own,
295
+ // Commander copies this configuration to children made with `.command()`, so only the root gets the screen.
296
+ formatHelp: /* @__PURE__ */ __name((command, helper) => command === program && !full ? firstScreen(program, screen) : (own.formatHelp ?? Help.prototype.formatHelp).call(helper, command, helper), "formatHelp")
297
+ });
298
+ installCommandHelp(program, { profile: screen.profile !== false });
299
+ program.addOption(new Option("--help-all", "the full help: every command and option").hideHelp());
300
+ program.on("option:help-all", () => {
301
+ full = true;
302
+ program.help();
303
+ });
304
+ if (program.commands.some((command) => command.name() === "help"))
305
+ return program;
306
+ const help = annotate(new Command("help"), { effects: NO_EFFECTS, mcp: false }).description("this screen; help options: the options for every command; help <command>: that command's help").argument("[topic...]", "options, or a command path").action((topic) => {
307
+ if (topic.length === 0)
308
+ return program.outputHelp();
309
+ if (topic.length === 1 && topic[0] === "options")
310
+ return program.configureOutput().writeOut?.(optionsScreen(program));
311
+ const command = commandAt(program, topic.join(" "));
312
+ if (!command)
313
+ throw new CliError("validation_error", `no command "${topic.join(" ")}" \u2014 run \`${program.name()} help\`, or \`${program.name()} help options\``, { available: program.commands.map((one) => one.name()).filter((name) => name !== "help") });
314
+ command.outputHelp();
315
+ });
316
+ program.addCommand(help, { hidden: true });
317
+ return program;
318
+ }, "installHelp");
319
+
320
+ export {
321
+ nextUsually,
322
+ firstScreen,
323
+ installHelp
324
+ };