@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.
- package/CHANGELOG.md +25 -0
- package/LICENSE +204 -0
- package/README.md +243 -2
- package/contracts/wirecat.json +1554 -0
- package/dist/bin/ydisk.d.ts +3 -0
- package/dist/bin/ydisk.d.ts.map +1 -0
- package/dist/bin/ydisk.js +40 -0
- package/dist/bin/ydisk.js.map +1 -0
- package/dist/bundle/all-profiles-4OLZF3RT.js +279 -0
- package/dist/bundle/anthropic-DKB4OJXZ.js +91 -0
- package/dist/bundle/app-server-G4545SSV.js +247 -0
- package/dist/bundle/bun-RXEQKFED.js +169 -0
- package/dist/bundle/bun-sqlite-VHT5LN7U.js +76 -0
- package/dist/bundle/chunk-2BITUXGC.js +12289 -0
- package/dist/bundle/chunk-2CLWDQKA.js +39330 -0
- package/dist/bundle/chunk-2JFDOPKA.js +9575 -0
- package/dist/bundle/chunk-3GVI2MAO.js +106 -0
- package/dist/bundle/chunk-3SZBWBMI.js +131 -0
- package/dist/bundle/chunk-44VSEXW6.js +4054 -0
- package/dist/bundle/chunk-4YPRRQBE.js +95 -0
- package/dist/bundle/chunk-5COYRL5B.js +379 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-5DM7DIZL.js +1402 -0
- package/dist/bundle/chunk-6R2DVTVZ.js +24 -0
- package/dist/bundle/chunk-762BS35H.js +2787 -0
- package/dist/bundle/chunk-AG64V7AB.js +1233 -0
- package/dist/bundle/chunk-BC5HGIXB.js +334 -0
- package/dist/bundle/chunk-BH7LFEX7.js +36 -0
- package/dist/bundle/chunk-BLNPGY7N.js +53 -0
- package/dist/bundle/chunk-CNIA2LJF.js +372 -0
- package/dist/bundle/chunk-COSXMDC7.js +230 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-D7FO33KU.js +785 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DJH26PQ3.js +1396 -0
- package/dist/bundle/chunk-DJPT7IUC.js +64567 -0
- package/dist/bundle/chunk-DTMSCZDW.js +209 -0
- package/dist/bundle/chunk-E6LGZ5LX.js +16 -0
- package/dist/bundle/chunk-E6YRIHS5.js +92 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-F3DDSZTF.js +78 -0
- package/dist/bundle/chunk-F4WWTQNL.js +188 -0
- package/dist/bundle/chunk-FDDAUASC.js +1028 -0
- package/dist/bundle/chunk-FMNPG6N2.js +170 -0
- package/dist/bundle/chunk-FOKJ4POB.js +274 -0
- package/dist/bundle/chunk-G22C7JG6.js +731 -0
- package/dist/bundle/chunk-GA442SYZ.js +161 -0
- package/dist/bundle/chunk-GEBSW7UK.js +6848 -0
- package/dist/bundle/chunk-GGRKWAOK.js +594 -0
- package/dist/bundle/chunk-HHINRNZA.js +788 -0
- package/dist/bundle/chunk-HUZCL33L.js +128 -0
- package/dist/bundle/chunk-IALSIQVT.js +142 -0
- package/dist/bundle/chunk-IOXR2QBX.js +398 -0
- package/dist/bundle/chunk-J5CXR6VX.js +63 -0
- package/dist/bundle/chunk-J5PWSTOX.js +82 -0
- package/dist/bundle/chunk-J7BVAEHR.js +364 -0
- package/dist/bundle/chunk-JH46HMZW.js +1334 -0
- package/dist/bundle/chunk-JOBO7F6W.js +52 -0
- package/dist/bundle/chunk-JXZ5B3L5.js +2333 -0
- package/dist/bundle/chunk-KBIAMDZN.js +66 -0
- package/dist/bundle/chunk-KFVDL2QS.js +146 -0
- package/dist/bundle/chunk-LNHTLSR5.js +288 -0
- package/dist/bundle/chunk-M24RAKMJ.js +58 -0
- package/dist/bundle/chunk-MDQ57Q3H.js +1197 -0
- package/dist/bundle/chunk-MGUEZYFA.js +5546 -0
- package/dist/bundle/chunk-MLXQ4X5L.js +206 -0
- package/dist/bundle/chunk-NQAKARHE.js +54 -0
- package/dist/bundle/chunk-OF7VVUDQ.js +23 -0
- package/dist/bundle/chunk-OQVPE3XK.js +324 -0
- package/dist/bundle/chunk-OR3QG7UR.js +259 -0
- package/dist/bundle/chunk-OUUYVROP.js +76 -0
- package/dist/bundle/chunk-PQBAM64O.js +168 -0
- package/dist/bundle/chunk-PYVIA7WF.js +88 -0
- package/dist/bundle/chunk-Q6HK3PHE.js +72 -0
- package/dist/bundle/chunk-QB3KECV2.js +218 -0
- package/dist/bundle/chunk-QGWXSFYN.js +73 -0
- package/dist/bundle/chunk-RC5QAAAE.js +29 -0
- package/dist/bundle/chunk-RMJ26HLB.js +18 -0
- package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
- package/dist/bundle/chunk-T7ZUDA4C.js +72 -0
- package/dist/bundle/chunk-TRCSMVV5.js +72 -0
- package/dist/bundle/chunk-UD2BQEKA.js +46 -0
- package/dist/bundle/chunk-V4TL55GS.js +1068 -0
- package/dist/bundle/chunk-VJNWN5VU.js +4072 -0
- package/dist/bundle/chunk-VRRNBLMA.js +1227 -0
- package/dist/bundle/chunk-WUCMMNFJ.js +771 -0
- package/dist/bundle/chunk-XDESE3NY.js +44 -0
- package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
- package/dist/bundle/chunk-XQUUANA2.js +24600 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-Z2QEON7B.js +2275 -0
- package/dist/bundle/chunk-ZMJ56GME.js +7 -0
- package/dist/bundle/chunk-ZTSB3D7Q.js +100 -0
- package/dist/bundle/chunk-ZVJWD3FK.js +38 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-YIOYGPJA.js +40 -0
- package/dist/bundle/command-server-entry-MHBQDXS4.js +169 -0
- package/dist/bundle/decode-NUGJIOUW.js +297 -0
- package/dist/bundle/definitions-AILHKEQT.js +2005 -0
- package/dist/bundle/dispatch-5LC4UEGY.js +411 -0
- package/dist/bundle/dist-4I2W6X2I.js +7577 -0
- package/dist/bundle/echarts-MHSH6PGC.js +42501 -0
- package/dist/bundle/embed-ZDXTHHYS.js +38 -0
- package/dist/bundle/embedder-XFEELFUL.js +111 -0
- package/dist/bundle/failure-5S7VPBYK.js +25 -0
- package/dist/bundle/first-run-JHCHT3RJ.js +29 -0
- package/dist/bundle/first-screen-FHGQ6QRV.js +40 -0
- package/dist/bundle/instructions-WKSMBUFX.js +11 -0
- package/dist/bundle/mcp-HS2ZDUVR.js +167 -0
- package/dist/bundle/mdast-util-from-markdown-R66F4HZA.js +1958 -0
- package/dist/bundle/mdast-util-gfm-LN2ELINH.js +2699 -0
- package/dist/bundle/meeting-combined-K4U4NYRZ.js +25 -0
- package/dist/bundle/meeting-model-KCEG6Y5O.js +26 -0
- package/dist/bundle/meeting-semantic-VYGSV3H6.js +22 -0
- package/dist/bundle/micromark-extension-gfm-5X7YT43T.js +1838 -0
- package/dist/bundle/node-CM6NC6UE.js +176 -0
- package/dist/bundle/node-KM3CUABH.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-5YDQ3LIJ.js +74 -0
- package/dist/bundle/notes-search-PGO7KM2U.js +62 -0
- package/dist/bundle/oauth-NY4C5UCK.js +20 -0
- package/dist/bundle/open-YNUTA6ZE.js +23 -0
- package/dist/bundle/openai-4CVT5PHH.js +241 -0
- package/dist/bundle/process-2XT3TL27.js +91 -0
- package/dist/bundle/program-FMIVF5T6.js +31904 -0
- package/dist/bundle/prompt-VNWY3H6S.js +17 -0
- package/dist/bundle/recognize-JS4PBPSZ.js +26 -0
- package/dist/bundle/remote-RCLFH4V2.js +32 -0
- package/dist/bundle/rerank-EG6VKYGO.js +52 -0
- package/dist/bundle/schemas-ED2LHKXK.js +645 -0
- package/dist/bundle/serve-AHG25QXB.js +199 -0
- package/dist/bundle/server-5FTB7WM3.js +78 -0
- package/dist/bundle/server-JNZVSAZE.js +209 -0
- package/dist/bundle/sqlite-runtime-XSZOAQPF.js +20 -0
- package/dist/bundle/state-XGVAJFF7.js +36 -0
- package/dist/bundle/store-OHSCWZEV.js +177 -0
- package/dist/bundle/store-PKSPKJXL.js +293 -0
- package/dist/bundle/store-maintenance-command-KAWGBSWK.js +69 -0
- package/dist/bundle/ydisk.js +183 -0
- package/dist/commands/api.d.ts +9 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +59 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/comments.d.ts +3 -0
- package/dist/commands/comments.d.ts.map +1 -0
- package/dist/commands/comments.js +114 -0
- package/dist/commands/comments.js.map +1 -0
- package/dist/commands/files.d.ts +3 -0
- package/dist/commands/files.d.ts.map +1 -0
- package/dist/commands/files.js +272 -0
- package/dist/commands/files.js.map +1 -0
- package/dist/commands/library.d.ts +13 -0
- package/dist/commands/library.d.ts.map +1 -0
- package/dist/commands/library.js +118 -0
- package/dist/commands/library.js.map +1 -0
- package/dist/commands/session.d.ts +3 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +99 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +62 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +80 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +77 -0
- package/dist/context.js.map +1 -0
- package/dist/generated/definitions.d.ts +3 -0
- package/dist/generated/definitions.d.ts.map +1 -0
- package/dist/generated/definitions.js +2001 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/manifest.d.ts +6 -0
- package/dist/generated/manifest.d.ts.map +1 -0
- package/dist/generated/manifest.js +1473 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/schemas.d.ts +127 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +545 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +829 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +5 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/identity.d.ts +10 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +33 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +65 -0
- package/dist/program.js.map +1 -0
- package/dist/sample/comments.d.ts +61 -0
- package/dist/sample/comments.d.ts.map +1 -0
- package/dist/sample/comments.js +39 -0
- package/dist/sample/comments.js.map +1 -0
- package/dist/sample/records.d.ts +16 -0
- package/dist/sample/records.d.ts.map +1 -0
- package/dist/sample/records.js +22 -0
- package/dist/sample/records.js.map +1 -0
- package/dist/sample/transport.d.ts +42 -0
- package/dist/sample/transport.d.ts.map +1 -0
- package/dist/sample/transport.js +153 -0
- package/dist/sample/transport.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/dist/yandex/source.d.ts +39 -0
- package/dist/yandex/source.d.ts.map +1 -0
- package/dist/yandex/source.js +189 -0
- package/dist/yandex/source.js.map +1 -0
- package/dist/yandex/transport.d.ts +41 -0
- package/dist/yandex/transport.d.ts.map +1 -0
- package/dist/yandex/transport.js +152 -0
- package/dist/yandex/transport.js.map +1 -0
- package/dist/yandex/writes.d.ts +27 -0
- package/dist/yandex/writes.d.ts.map +1 -0
- package/dist/yandex/writes.js +61 -0
- package/dist/yandex/writes.js.map +1 -0
- package/package.json +88 -4
- package/skills/yandex-disk-cli/SKILL.md +46 -0
- package/skills/yandex-disk-cli/references/api/api-disk-operations-operation-id.md +13 -0
- package/skills/yandex-disk-cli/references/api/api-disk-public-resources.md +50 -0
- package/skills/yandex-disk-cli/references/api/api-disk-resources.md +171 -0
- package/skills/yandex-disk-cli/references/api/api-disk-trash-resources.md +48 -0
- package/skills/yandex-disk-cli/references/api/api-disk.md +13 -0
- package/skills/yandex-disk-cli/references/api.md +17 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
WARM_IDLE_MS,
|
|
5
|
+
defaultThreads,
|
|
6
|
+
isTextModelInstalled,
|
|
7
|
+
loadModel,
|
|
8
|
+
meanOf,
|
|
9
|
+
openEmbedder,
|
|
10
|
+
placedText,
|
|
11
|
+
runEmbedders,
|
|
12
|
+
textModelsDirectory,
|
|
13
|
+
truncated,
|
|
14
|
+
unit,
|
|
15
|
+
warmEmbedders
|
|
16
|
+
} from "./chunk-FDDAUASC.js";
|
|
17
|
+
import "./chunk-FOKJ4POB.js";
|
|
18
|
+
import "./chunk-NQAKARHE.js";
|
|
19
|
+
import "./chunk-762BS35H.js";
|
|
20
|
+
import "./chunk-AG64V7AB.js";
|
|
21
|
+
import "./chunk-S4UUN6LD.js";
|
|
22
|
+
import "./chunk-Y5E2WNWB.js";
|
|
23
|
+
import "./chunk-T7ZUDA4C.js";
|
|
24
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
25
|
+
export {
|
|
26
|
+
WARM_IDLE_MS,
|
|
27
|
+
defaultThreads,
|
|
28
|
+
isTextModelInstalled,
|
|
29
|
+
loadModel,
|
|
30
|
+
meanOf,
|
|
31
|
+
openEmbedder,
|
|
32
|
+
placedText,
|
|
33
|
+
runEmbedders,
|
|
34
|
+
textModelsDirectory,
|
|
35
|
+
truncated,
|
|
36
|
+
unit,
|
|
37
|
+
warmEmbedders
|
|
38
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
openSession,
|
|
5
|
+
truncated,
|
|
6
|
+
unit
|
|
7
|
+
} from "./chunk-FDDAUASC.js";
|
|
8
|
+
import "./chunk-FOKJ4POB.js";
|
|
9
|
+
import "./chunk-NQAKARHE.js";
|
|
10
|
+
import "./chunk-762BS35H.js";
|
|
11
|
+
import "./chunk-AG64V7AB.js";
|
|
12
|
+
import "./chunk-S4UUN6LD.js";
|
|
13
|
+
import {
|
|
14
|
+
importFrom
|
|
15
|
+
} from "./chunk-Y5E2WNWB.js";
|
|
16
|
+
import {
|
|
17
|
+
CliError
|
|
18
|
+
} from "./chunk-T7ZUDA4C.js";
|
|
19
|
+
import {
|
|
20
|
+
__name
|
|
21
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
22
|
+
|
|
23
|
+
// 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/images/picture/embedder.js
|
|
24
|
+
import { readFileSync } from "node:fs";
|
|
25
|
+
import { join } from "node:path";
|
|
26
|
+
|
|
27
|
+
// 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/images/picture/preprocess.js
|
|
28
|
+
var SIZE = 224;
|
|
29
|
+
var MEAN = [0.48145466, 0.4578275, 0.40821073];
|
|
30
|
+
var STD = [0.26862954, 0.26130258, 0.27577711];
|
|
31
|
+
var importCanvas = /* @__PURE__ */ __name(async () => {
|
|
32
|
+
try {
|
|
33
|
+
return await importFrom(new URL("images/picture/preprocess.js", import.meta.resolve("@wirecat/cli-core")).href, "@napi-rs/canvas");
|
|
34
|
+
} catch {
|
|
35
|
+
throw new CliError("validation_error", "searching pictures needs the optional package @napi-rs/canvas to read an image \u2014 install it next to this tool");
|
|
36
|
+
}
|
|
37
|
+
}, "importCanvas");
|
|
38
|
+
var preprocess = /* @__PURE__ */ __name(async (bytes, load = importCanvas) => {
|
|
39
|
+
const { createCanvas, loadImage } = await load();
|
|
40
|
+
let image;
|
|
41
|
+
try {
|
|
42
|
+
image = await loadImage(bytes);
|
|
43
|
+
} catch {
|
|
44
|
+
throw new CliError("invalid_response", "the file is not an image this tool can read");
|
|
45
|
+
}
|
|
46
|
+
const scale = SIZE / Math.min(image.width, image.height);
|
|
47
|
+
const width = Math.max(SIZE, Math.round(image.width * scale));
|
|
48
|
+
const height = Math.max(SIZE, Math.round(image.height * scale));
|
|
49
|
+
const surface = createCanvas(SIZE, SIZE);
|
|
50
|
+
const context = surface.getContext("2d");
|
|
51
|
+
context.fillStyle = "#ffffff";
|
|
52
|
+
context.fillRect(0, 0, SIZE, SIZE);
|
|
53
|
+
context.imageSmoothingQuality = "high";
|
|
54
|
+
context.drawImage(image, 0, 0, image.width, image.height, Math.round((SIZE - width) / 2), Math.round((SIZE - height) / 2), width, height);
|
|
55
|
+
const { data } = context.getImageData(0, 0, SIZE, SIZE);
|
|
56
|
+
const plane = SIZE * SIZE;
|
|
57
|
+
const pixels = new Float32Array(3 * plane);
|
|
58
|
+
for (let at = 0; at < plane; at++) {
|
|
59
|
+
for (let channel = 0; channel < 3; channel++) {
|
|
60
|
+
pixels[channel * plane + at] = (data[at * 4 + channel] / 255 - MEAN[channel]) / STD[channel];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return pixels;
|
|
64
|
+
}, "preprocess");
|
|
65
|
+
|
|
66
|
+
// 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/images/picture/embedder.js
|
|
67
|
+
var openPictureEmbedder = /* @__PURE__ */ __name(async (model, directory, { threads = 4, canvas } = {}) => {
|
|
68
|
+
const { Tokenizer } = await importFrom(new URL("images/picture/embedder.js", import.meta.resolve("@wirecat/cli-core")).href, "@huggingface/tokenizers");
|
|
69
|
+
const path = /* @__PURE__ */ __name((name) => join(directory, model.id, name), "path");
|
|
70
|
+
const tokenizer = new Tokenizer(JSON.parse(readFileSync(path("tokenizer.json"), "utf8")), JSON.parse(readFileSync(path("tokenizer_config.json"), "utf8")));
|
|
71
|
+
const sessions = [];
|
|
72
|
+
const lazy = /* @__PURE__ */ __name((name) => {
|
|
73
|
+
let opened;
|
|
74
|
+
return () => {
|
|
75
|
+
opened ??= openSession(readFileSync(path(name)), threads).then((created) => {
|
|
76
|
+
sessions.push(created.session);
|
|
77
|
+
return created;
|
|
78
|
+
});
|
|
79
|
+
return opened;
|
|
80
|
+
};
|
|
81
|
+
}, "lazy");
|
|
82
|
+
const vision = lazy(model.vision);
|
|
83
|
+
const text = lazy(model.text);
|
|
84
|
+
return {
|
|
85
|
+
model,
|
|
86
|
+
embedImage: /* @__PURE__ */ __name(async (bytes) => {
|
|
87
|
+
const pixels = await preprocess(bytes, canvas);
|
|
88
|
+
const { ort, session } = await vision();
|
|
89
|
+
const output = await session.run({ pixel_values: new ort.Tensor("float32", pixels, [1, 3, SIZE, SIZE]) });
|
|
90
|
+
return unit(Float32Array.from(output.image_embeds?.data));
|
|
91
|
+
}, "embedImage"),
|
|
92
|
+
embedQuery: /* @__PURE__ */ __name(async (query) => {
|
|
93
|
+
const ids = truncated(tokenizer.encode(query.toLowerCase()).ids, model.maxTokens);
|
|
94
|
+
const shape = [1, ids.length];
|
|
95
|
+
const { ort, session } = await text();
|
|
96
|
+
const feeds = {
|
|
97
|
+
input_ids: new ort.Tensor("int64", BigInt64Array.from(ids, BigInt), shape)
|
|
98
|
+
};
|
|
99
|
+
if (session.inputNames.includes("attention_mask"))
|
|
100
|
+
feeds.attention_mask = new ort.Tensor("int64", new BigInt64Array(ids.length).fill(1n), shape);
|
|
101
|
+
const output = await session.run(feeds);
|
|
102
|
+
return unit(Float32Array.from(output.text_embeds?.data));
|
|
103
|
+
}, "embedQuery"),
|
|
104
|
+
close: /* @__PURE__ */ __name(async () => {
|
|
105
|
+
await Promise.all(sessions.map((session) => session.release()));
|
|
106
|
+
}, "close")
|
|
107
|
+
};
|
|
108
|
+
}, "openPictureEmbedder");
|
|
109
|
+
export {
|
|
110
|
+
openPictureEmbedder
|
|
111
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
catchCrashes,
|
|
5
|
+
errorObjectOf,
|
|
6
|
+
errorRecordOf,
|
|
7
|
+
exitCodeOfAnswer,
|
|
8
|
+
exitCodeOfError,
|
|
9
|
+
mcpErrorResult,
|
|
10
|
+
renderError,
|
|
11
|
+
retryOf
|
|
12
|
+
} from "./chunk-AG64V7AB.js";
|
|
13
|
+
import "./chunk-S4UUN6LD.js";
|
|
14
|
+
import "./chunk-T7ZUDA4C.js";
|
|
15
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
16
|
+
export {
|
|
17
|
+
catchCrashes,
|
|
18
|
+
errorObjectOf,
|
|
19
|
+
errorRecordOf,
|
|
20
|
+
exitCodeOfAnswer,
|
|
21
|
+
exitCodeOfError,
|
|
22
|
+
mcpErrorResult,
|
|
23
|
+
renderError,
|
|
24
|
+
retryOf
|
|
25
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
askSetupQuestions,
|
|
5
|
+
asksAtStart,
|
|
6
|
+
setupAtStart,
|
|
7
|
+
systemLanguage
|
|
8
|
+
} from "./chunk-QB3KECV2.js";
|
|
9
|
+
import "./chunk-IALSIQVT.js";
|
|
10
|
+
import "./chunk-UD2BQEKA.js";
|
|
11
|
+
import "./chunk-JOBO7F6W.js";
|
|
12
|
+
import "./chunk-JXZ5B3L5.js";
|
|
13
|
+
import "./chunk-E6LGZ5LX.js";
|
|
14
|
+
import "./chunk-MDQ57Q3H.js";
|
|
15
|
+
import "./chunk-OF7VVUDQ.js";
|
|
16
|
+
import "./chunk-D72URWJE.js";
|
|
17
|
+
import "./chunk-NQAKARHE.js";
|
|
18
|
+
import "./chunk-762BS35H.js";
|
|
19
|
+
import "./chunk-AG64V7AB.js";
|
|
20
|
+
import "./chunk-S4UUN6LD.js";
|
|
21
|
+
import "./chunk-Y5E2WNWB.js";
|
|
22
|
+
import "./chunk-T7ZUDA4C.js";
|
|
23
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
24
|
+
export {
|
|
25
|
+
askSetupQuestions,
|
|
26
|
+
asksAtStart,
|
|
27
|
+
setupAtStart,
|
|
28
|
+
systemLanguage
|
|
29
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
firstScreen,
|
|
5
|
+
installHelp
|
|
6
|
+
} from "./chunk-OQVPE3XK.js";
|
|
7
|
+
import "./chunk-EH6ZEJGT.js";
|
|
8
|
+
import {
|
|
9
|
+
WIRECAT_TOOLS
|
|
10
|
+
} from "./chunk-PYVIA7WF.js";
|
|
11
|
+
import "./chunk-3SZBWBMI.js";
|
|
12
|
+
import "./chunk-2BITUXGC.js";
|
|
13
|
+
import "./chunk-J7BVAEHR.js";
|
|
14
|
+
import "./chunk-JOBO7F6W.js";
|
|
15
|
+
import "./chunk-IOXR2QBX.js";
|
|
16
|
+
import "./chunk-BC5HGIXB.js";
|
|
17
|
+
import "./chunk-J5CXR6VX.js";
|
|
18
|
+
import "./chunk-KBIAMDZN.js";
|
|
19
|
+
import "./chunk-D7FO33KU.js";
|
|
20
|
+
import "./chunk-E6YRIHS5.js";
|
|
21
|
+
import "./chunk-VRRNBLMA.js";
|
|
22
|
+
import "./chunk-TRCSMVV5.js";
|
|
23
|
+
import "./chunk-RC5QAAAE.js";
|
|
24
|
+
import "./chunk-VJNWN5VU.js";
|
|
25
|
+
import "./chunk-ZMJ56GME.js";
|
|
26
|
+
import "./chunk-CNIA2LJF.js";
|
|
27
|
+
import "./chunk-MDQ57Q3H.js";
|
|
28
|
+
import "./chunk-FOKJ4POB.js";
|
|
29
|
+
import "./chunk-NQAKARHE.js";
|
|
30
|
+
import "./chunk-762BS35H.js";
|
|
31
|
+
import "./chunk-AG64V7AB.js";
|
|
32
|
+
import "./chunk-S4UUN6LD.js";
|
|
33
|
+
import "./chunk-Y5E2WNWB.js";
|
|
34
|
+
import "./chunk-T7ZUDA4C.js";
|
|
35
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
36
|
+
export {
|
|
37
|
+
WIRECAT_TOOLS,
|
|
38
|
+
firstScreen,
|
|
39
|
+
installHelp
|
|
40
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
appInstructions,
|
|
5
|
+
instructions
|
|
6
|
+
} from "./chunk-BLNPGY7N.js";
|
|
7
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
8
|
+
export {
|
|
9
|
+
appInstructions,
|
|
10
|
+
instructions
|
|
11
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
executableEnvironment,
|
|
5
|
+
executableOnPath
|
|
6
|
+
} from "./chunk-UD2BQEKA.js";
|
|
7
|
+
import {
|
|
8
|
+
require_cross_spawn
|
|
9
|
+
} from "./chunk-D72URWJE.js";
|
|
10
|
+
import {
|
|
11
|
+
__name,
|
|
12
|
+
__toESM
|
|
13
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
14
|
+
|
|
15
|
+
// 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/mcp/index.js
|
|
16
|
+
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
17
|
+
var realRun = /* @__PURE__ */ __name((file, args) => {
|
|
18
|
+
const result = import_cross_spawn.default.sync(executableOnPath(file, process.env), args, {
|
|
19
|
+
encoding: "utf8",
|
|
20
|
+
timeout: 1e4,
|
|
21
|
+
maxBuffer: 256e3,
|
|
22
|
+
env: executableEnvironment(process.env)
|
|
23
|
+
});
|
|
24
|
+
return { status: result.status, error: result.error, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
|
|
25
|
+
}, "realRun");
|
|
26
|
+
var executable = /* @__PURE__ */ __name((client) => client === "codex" ? "codex" : "claude", "executable");
|
|
27
|
+
var presentIn = /* @__PURE__ */ __name((client, name, run) => {
|
|
28
|
+
const state = lookUp(client, name, run);
|
|
29
|
+
if (state === "unavailable")
|
|
30
|
+
throw new Error(`${executable(client)} is not installed or could not be started`);
|
|
31
|
+
return state === "registered";
|
|
32
|
+
}, "presentIn");
|
|
33
|
+
var setupArguments = /* @__PURE__ */ __name((client, name, entry) => {
|
|
34
|
+
const variables = Object.entries(entry.env ?? {}).flatMap(([key, value]) => ["--env", `${key}=${value}`]);
|
|
35
|
+
if (client === "codex")
|
|
36
|
+
return ["mcp", "add", name, ...variables, "--", entry.command, ...entry.args];
|
|
37
|
+
return ["mcp", "add", "--scope", "user", name, ...variables, "--", entry.command, ...entry.args];
|
|
38
|
+
}, "setupArguments");
|
|
39
|
+
var checkName = /* @__PURE__ */ __name((name) => {
|
|
40
|
+
if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name))
|
|
41
|
+
throw new Error("the MCP name must be letters, digits, _ or -");
|
|
42
|
+
}, "checkName");
|
|
43
|
+
var lookUp = /* @__PURE__ */ __name((client, name, run) => {
|
|
44
|
+
const file = executable(client);
|
|
45
|
+
const existing = run(file, ["mcp", "get", name, ...client === "codex" ? ["--json"] : []]);
|
|
46
|
+
if (existing.error)
|
|
47
|
+
return "unavailable";
|
|
48
|
+
if (existing.status === 0)
|
|
49
|
+
return "registered";
|
|
50
|
+
if (!/No MCP server named/i.test(existing.stdout + existing.stderr)) {
|
|
51
|
+
throw new Error(`${file} could not check its MCP configuration`);
|
|
52
|
+
}
|
|
53
|
+
return "missing";
|
|
54
|
+
}, "lookUp");
|
|
55
|
+
var stdioEntryStatus = /* @__PURE__ */ __name((client, name, { run = realRun } = {}) => {
|
|
56
|
+
checkName(name);
|
|
57
|
+
return { client, name, state: lookUp(client, name, run) };
|
|
58
|
+
}, "stdioEntryStatus");
|
|
59
|
+
var removeArguments = /* @__PURE__ */ __name((client, name) => (
|
|
60
|
+
// Claude Code without a scope removes from whichever scope holds the name, which may be a project's own entry.
|
|
61
|
+
client === "codex" ? ["mcp", "remove", name] : ["mcp", "remove", "--scope", "user", name]
|
|
62
|
+
), "removeArguments");
|
|
63
|
+
var removeStdioEntry = /* @__PURE__ */ __name((client, name, { run = realRun } = {}) => {
|
|
64
|
+
checkName(name);
|
|
65
|
+
if (!presentIn(client, name, run))
|
|
66
|
+
return { client, name, removed: false };
|
|
67
|
+
const file = executable(client);
|
|
68
|
+
const removed = run(file, removeArguments(client, name));
|
|
69
|
+
if (removed.status !== 0 || removed.error)
|
|
70
|
+
throw new Error(`${file} could not remove ${name}`);
|
|
71
|
+
return { client, name, removed: true };
|
|
72
|
+
}, "removeStdioEntry");
|
|
73
|
+
var installStdioEntry = /* @__PURE__ */ __name((client, name, entry, { run = realRun } = {}) => {
|
|
74
|
+
checkName(name);
|
|
75
|
+
if (!entry.command || entry.args.some((arg) => arg.includes("\0")))
|
|
76
|
+
throw new Error("invalid MCP command");
|
|
77
|
+
const file = executable(client);
|
|
78
|
+
if (presentIn(client, name, run))
|
|
79
|
+
throw new Error(`${name} is already configured in ${file}; remove it there first`);
|
|
80
|
+
const args = setupArguments(client, name, entry);
|
|
81
|
+
const added = run(file, args);
|
|
82
|
+
if (added.status !== 0 || added.error)
|
|
83
|
+
throw new Error(`${file} could not add ${name}`);
|
|
84
|
+
return { client, name, command: [entry.command, ...entry.args] };
|
|
85
|
+
}, "installStdioEntry");
|
|
86
|
+
var probeStdio = /* @__PURE__ */ __name(async (entry, { timeoutMs = 1e4, start = /* @__PURE__ */ __name((file, args, env) => (0, import_cross_spawn.default)(executableOnPath(file, env), args, {
|
|
87
|
+
env: executableEnvironment(env),
|
|
88
|
+
stdio: "pipe"
|
|
89
|
+
}), "start") } = {}) => {
|
|
90
|
+
const child = start(entry.command, entry.args, { ...process.env, ...entry.env });
|
|
91
|
+
let buffer = "";
|
|
92
|
+
let timer;
|
|
93
|
+
const pending = /* @__PURE__ */ new Map();
|
|
94
|
+
const request = /* @__PURE__ */ __name((id, method, params) => new Promise((resolve, reject) => {
|
|
95
|
+
pending.set(id, { resolve, reject });
|
|
96
|
+
child.stdin.write(`${JSON.stringify({ jsonrpc: "2.0", id, method, params })}
|
|
97
|
+
`);
|
|
98
|
+
}), "request");
|
|
99
|
+
const fail = /* @__PURE__ */ __name((error) => {
|
|
100
|
+
for (const waiter of pending.values())
|
|
101
|
+
waiter.reject(error);
|
|
102
|
+
pending.clear();
|
|
103
|
+
}, "fail");
|
|
104
|
+
child.on("error", () => fail(new Error("the MCP server could not be started")));
|
|
105
|
+
child.on("exit", () => fail(new Error("the MCP server exited before answering")));
|
|
106
|
+
child.stdin.on("error", () => fail(new Error("the MCP server closed its input")));
|
|
107
|
+
child.stdout.setEncoding("utf8");
|
|
108
|
+
child.stdout.on("data", (chunk) => {
|
|
109
|
+
buffer += chunk;
|
|
110
|
+
if (buffer.length > 1e6)
|
|
111
|
+
return fail(new Error("the MCP server sent too much output"));
|
|
112
|
+
for (let newline = buffer.indexOf("\n"); newline !== -1; newline = buffer.indexOf("\n")) {
|
|
113
|
+
const line = buffer.slice(0, newline);
|
|
114
|
+
buffer = buffer.slice(newline + 1);
|
|
115
|
+
try {
|
|
116
|
+
const value = JSON.parse(line);
|
|
117
|
+
if (typeof value.id !== "number")
|
|
118
|
+
continue;
|
|
119
|
+
const waiter = pending.get(value.id);
|
|
120
|
+
if (!waiter)
|
|
121
|
+
continue;
|
|
122
|
+
pending.delete(value.id);
|
|
123
|
+
if (value.error)
|
|
124
|
+
waiter.reject(new Error("the MCP server rejected the handshake"));
|
|
125
|
+
else
|
|
126
|
+
waiter.resolve(value.result ?? {});
|
|
127
|
+
} catch {
|
|
128
|
+
fail(new Error("the MCP server sent invalid JSON"));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
try {
|
|
133
|
+
timer = setTimeout(() => fail(new Error("the MCP server did not answer in time")), timeoutMs);
|
|
134
|
+
await request(1, "initialize", {
|
|
135
|
+
protocolVersion: "2025-11-25",
|
|
136
|
+
capabilities: {},
|
|
137
|
+
clientInfo: { name: "cli-base-mcp-doctor", version: "1" }
|
|
138
|
+
});
|
|
139
|
+
child.stdin.write(`${JSON.stringify({ jsonrpc: "2.0", method: "notifications/initialized" })}
|
|
140
|
+
`);
|
|
141
|
+
const result = await request(2, "tools/list", {});
|
|
142
|
+
const tools = result.tools;
|
|
143
|
+
if (!Array.isArray(tools))
|
|
144
|
+
throw new Error("the MCP server returned no tool list");
|
|
145
|
+
const named = tools.filter((item) => item !== null && typeof item === "object" && "name" in item && typeof item.name === "string");
|
|
146
|
+
if (named.length !== tools.length)
|
|
147
|
+
throw new Error("the MCP server returned an invalid tool list");
|
|
148
|
+
return {
|
|
149
|
+
tools: named.map((item) => item.name),
|
|
150
|
+
potentialWrites: named.filter((item) => item.annotations?.readOnlyHint !== true).map((item) => item.name)
|
|
151
|
+
};
|
|
152
|
+
} finally {
|
|
153
|
+
if (timer)
|
|
154
|
+
clearTimeout(timer);
|
|
155
|
+
pending.clear();
|
|
156
|
+
child.stdin.end();
|
|
157
|
+
child.kill();
|
|
158
|
+
}
|
|
159
|
+
}, "probeStdio");
|
|
160
|
+
export {
|
|
161
|
+
installStdioEntry,
|
|
162
|
+
probeStdio,
|
|
163
|
+
removeArguments,
|
|
164
|
+
removeStdioEntry,
|
|
165
|
+
setupArguments,
|
|
166
|
+
stdioEntryStatus
|
|
167
|
+
};
|