@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,7 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// 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/standards/monthly.js
|
|
5
|
+
import { dirname, join } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
var CI_PAGE = join(dirname(fileURLToPath(new URL("standards/monthly.js", import.meta.resolve("@wirecat/cli-base")).href)), "../../docs/standards/ci.md");
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
MAX_SECRET_INPUT,
|
|
5
|
+
bufferedInput,
|
|
6
|
+
inputPolicy
|
|
7
|
+
} from "./chunk-J5PWSTOX.js";
|
|
8
|
+
import {
|
|
9
|
+
CliError
|
|
10
|
+
} from "./chunk-T7ZUDA4C.js";
|
|
11
|
+
import {
|
|
12
|
+
__name
|
|
13
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
14
|
+
|
|
15
|
+
// 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/terminal/prompt.js
|
|
16
|
+
import { createInterface } from "node:readline";
|
|
17
|
+
import { Writable } from "node:stream";
|
|
18
|
+
var EMPTY_TRIES = 3;
|
|
19
|
+
var pasteHint = /* @__PURE__ */ __name((platform = process.platform) => `Nothing arrived. To paste in a terminal, use ${platform === "darwin" ? "Cmd+V" : "Ctrl+Shift+V (or right-click \u2192 Paste)"}.`, "pasteHint");
|
|
20
|
+
var readSecret = /* @__PURE__ */ __name(async (prompt, { input = process.stdin, output = process.stderr, echo = false, signal: givenSignal } = {}) => {
|
|
21
|
+
const policy = inputPolicy(input);
|
|
22
|
+
const signals = [givenSignal, policy.signal].filter((one) => one !== void 0);
|
|
23
|
+
const signal = signals.length ? AbortSignal.any(signals) : void 0;
|
|
24
|
+
const cancelled = /* @__PURE__ */ __name(() => new CliError("cancelled", "cancelled \u2014 nothing was stored"), "cancelled");
|
|
25
|
+
if (signal?.aborted)
|
|
26
|
+
throw cancelled();
|
|
27
|
+
if (input.isTTY && policy.noInput)
|
|
28
|
+
throw new CliError("validation_error", "interactive input is disabled \u2014 provide the input through a pipe", {
|
|
29
|
+
reason: "input.required"
|
|
30
|
+
});
|
|
31
|
+
if (!input.isTTY) {
|
|
32
|
+
return (await bufferedInput(input, {
|
|
33
|
+
maxBytes: Math.min(policy.maxBytes ?? MAX_SECRET_INPUT, MAX_SECRET_INPUT),
|
|
34
|
+
...signal ? { signal } : {}
|
|
35
|
+
})).toString("utf8").trim();
|
|
36
|
+
}
|
|
37
|
+
let muted = false;
|
|
38
|
+
const shim = new Writable({
|
|
39
|
+
write(chunk, _encoding, done) {
|
|
40
|
+
if (!muted)
|
|
41
|
+
output.write(chunk);
|
|
42
|
+
done();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const reader = createInterface({ input, output: shim, terminal: true });
|
|
46
|
+
const abort = /* @__PURE__ */ __name(() => reader.close(), "abort");
|
|
47
|
+
let bytes = 0;
|
|
48
|
+
let inputFailure;
|
|
49
|
+
const data = /* @__PURE__ */ __name((chunk) => {
|
|
50
|
+
bytes += Buffer.byteLength(chunk);
|
|
51
|
+
if (bytes > Math.min(policy.maxBytes ?? MAX_SECRET_INPUT, MAX_SECRET_INPUT)) {
|
|
52
|
+
inputFailure = new CliError("validation_error", "secret input exceeds its byte limit", {
|
|
53
|
+
reason: "input.too-large",
|
|
54
|
+
retryable: false
|
|
55
|
+
});
|
|
56
|
+
reader.close();
|
|
57
|
+
}
|
|
58
|
+
}, "data");
|
|
59
|
+
const inputError = /* @__PURE__ */ __name((error) => {
|
|
60
|
+
inputFailure = error;
|
|
61
|
+
reader.close();
|
|
62
|
+
}, "inputError");
|
|
63
|
+
input.on("data", data).on("error", inputError);
|
|
64
|
+
try {
|
|
65
|
+
const answer = await new Promise((resolve, reject) => {
|
|
66
|
+
const cancel = /* @__PURE__ */ __name(() => reject(inputFailure ?? cancelled()), "cancel");
|
|
67
|
+
reader.once("SIGINT", cancel);
|
|
68
|
+
reader.once("close", cancel);
|
|
69
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
70
|
+
const ask = /* @__PURE__ */ __name((tries) => {
|
|
71
|
+
muted = false;
|
|
72
|
+
reader.question(prompt, (line) => {
|
|
73
|
+
if (echo || line.trim() || tries >= EMPTY_TRIES)
|
|
74
|
+
return resolve(line);
|
|
75
|
+
output.write(`
|
|
76
|
+
${pasteHint()}
|
|
77
|
+
`);
|
|
78
|
+
ask(tries + 1);
|
|
79
|
+
});
|
|
80
|
+
muted = !echo;
|
|
81
|
+
}, "ask");
|
|
82
|
+
ask(1);
|
|
83
|
+
});
|
|
84
|
+
if (!echo && !answer.trim())
|
|
85
|
+
throw new CliError("validation_error", `nothing arrived after ${EMPTY_TRIES} tries. ${pasteHint()}`, {
|
|
86
|
+
reason: "input.empty"
|
|
87
|
+
});
|
|
88
|
+
return answer.trim();
|
|
89
|
+
} finally {
|
|
90
|
+
input.off("data", data).off("error", inputError);
|
|
91
|
+
signal?.removeEventListener("abort", abort);
|
|
92
|
+
reader.close();
|
|
93
|
+
output.write("\n");
|
|
94
|
+
}
|
|
95
|
+
}, "readSecret");
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
pasteHint,
|
|
99
|
+
readSecret
|
|
100
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
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-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/driver.js
|
|
8
|
+
var TIME_LIMIT_FUNCTION = "wc_time_limit";
|
|
9
|
+
var TimeLimitReached = class extends Error {
|
|
10
|
+
static {
|
|
11
|
+
__name(this, "TimeLimitReached");
|
|
12
|
+
}
|
|
13
|
+
constructor() {
|
|
14
|
+
super("the statement ran past its time limit");
|
|
15
|
+
this.name = "TimeLimitReached";
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var beforeTimeLimit = /* @__PURE__ */ __name((until) => {
|
|
19
|
+
if (Date.now() > Number(until))
|
|
20
|
+
throw new TimeLimitReached();
|
|
21
|
+
return 1;
|
|
22
|
+
}, "beforeTimeLimit");
|
|
23
|
+
var JOURNAL_SIZE_LIMIT = 64 * 1024 * 1024;
|
|
24
|
+
var PRAGMAS = `
|
|
25
|
+
PRAGMA busy_timeout = 5000;
|
|
26
|
+
PRAGMA journal_mode = WAL;
|
|
27
|
+
PRAGMA journal_size_limit = ${JOURNAL_SIZE_LIMIT};
|
|
28
|
+
PRAGMA foreign_keys = ON;
|
|
29
|
+
`;
|
|
30
|
+
var isQueryOnly = /* @__PURE__ */ __name((database) => Number(Object.values(database.prepare("PRAGMA query_only").get() ?? {})[0]) === 1, "isQueryOnly");
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
TIME_LIMIT_FUNCTION,
|
|
34
|
+
TimeLimitReached,
|
|
35
|
+
beforeTimeLimit,
|
|
36
|
+
PRAGMAS,
|
|
37
|
+
isQueryOnly
|
|
38
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
12
|
+
}) : x)(function(x) {
|
|
13
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
14
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15
|
+
});
|
|
16
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
17
|
+
try {
|
|
18
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw mod = 0, e;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var __export = (target, all) => {
|
|
24
|
+
for (var name in all)
|
|
25
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
+
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
36
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
37
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
38
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
39
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
40
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
41
|
+
mod
|
|
42
|
+
));
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
__name,
|
|
46
|
+
__require,
|
|
47
|
+
__commonJS,
|
|
48
|
+
__export,
|
|
49
|
+
__toESM
|
|
50
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
SCHEMA_DIALECT,
|
|
5
|
+
commandContract,
|
|
6
|
+
commandPathOf,
|
|
7
|
+
findCommand,
|
|
8
|
+
outputOf
|
|
9
|
+
} from "./chunk-3SZBWBMI.js";
|
|
10
|
+
import "./chunk-2BITUXGC.js";
|
|
11
|
+
import "./chunk-J7BVAEHR.js";
|
|
12
|
+
import "./chunk-JOBO7F6W.js";
|
|
13
|
+
import "./chunk-IOXR2QBX.js";
|
|
14
|
+
import "./chunk-BC5HGIXB.js";
|
|
15
|
+
import "./chunk-J5CXR6VX.js";
|
|
16
|
+
import "./chunk-KBIAMDZN.js";
|
|
17
|
+
import "./chunk-D7FO33KU.js";
|
|
18
|
+
import "./chunk-E6YRIHS5.js";
|
|
19
|
+
import "./chunk-VRRNBLMA.js";
|
|
20
|
+
import "./chunk-TRCSMVV5.js";
|
|
21
|
+
import "./chunk-RC5QAAAE.js";
|
|
22
|
+
import "./chunk-VJNWN5VU.js";
|
|
23
|
+
import "./chunk-ZMJ56GME.js";
|
|
24
|
+
import "./chunk-CNIA2LJF.js";
|
|
25
|
+
import "./chunk-MDQ57Q3H.js";
|
|
26
|
+
import "./chunk-FOKJ4POB.js";
|
|
27
|
+
import "./chunk-NQAKARHE.js";
|
|
28
|
+
import "./chunk-762BS35H.js";
|
|
29
|
+
import "./chunk-AG64V7AB.js";
|
|
30
|
+
import "./chunk-S4UUN6LD.js";
|
|
31
|
+
import "./chunk-Y5E2WNWB.js";
|
|
32
|
+
import "./chunk-T7ZUDA4C.js";
|
|
33
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
34
|
+
export {
|
|
35
|
+
SCHEMA_DIALECT,
|
|
36
|
+
commandContract,
|
|
37
|
+
commandPathOf,
|
|
38
|
+
findCommand,
|
|
39
|
+
outputOf
|
|
40
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
COMMAND_SERVER_CONCURRENT,
|
|
5
|
+
enterCommandServer,
|
|
6
|
+
serveCommands
|
|
7
|
+
} from "./chunk-F4WWTQNL.js";
|
|
8
|
+
import "./chunk-RMJ26HLB.js";
|
|
9
|
+
import {
|
|
10
|
+
ensureSqlite
|
|
11
|
+
} from "./chunk-3GVI2MAO.js";
|
|
12
|
+
import "./chunk-3SZBWBMI.js";
|
|
13
|
+
import {
|
|
14
|
+
commandServerRequest,
|
|
15
|
+
exitCodeSet,
|
|
16
|
+
inCommandServerRequest
|
|
17
|
+
} from "./chunk-2BITUXGC.js";
|
|
18
|
+
import "./chunk-J7BVAEHR.js";
|
|
19
|
+
import "./chunk-JOBO7F6W.js";
|
|
20
|
+
import "./chunk-IOXR2QBX.js";
|
|
21
|
+
import "./chunk-BC5HGIXB.js";
|
|
22
|
+
import "./chunk-J5CXR6VX.js";
|
|
23
|
+
import "./chunk-KBIAMDZN.js";
|
|
24
|
+
import "./chunk-D7FO33KU.js";
|
|
25
|
+
import "./chunk-E6YRIHS5.js";
|
|
26
|
+
import {
|
|
27
|
+
asOwnProcess
|
|
28
|
+
} from "./chunk-VRRNBLMA.js";
|
|
29
|
+
import "./chunk-TRCSMVV5.js";
|
|
30
|
+
import "./chunk-RC5QAAAE.js";
|
|
31
|
+
import "./chunk-VJNWN5VU.js";
|
|
32
|
+
import "./chunk-ZMJ56GME.js";
|
|
33
|
+
import "./chunk-CNIA2LJF.js";
|
|
34
|
+
import "./chunk-MDQ57Q3H.js";
|
|
35
|
+
import "./chunk-FOKJ4POB.js";
|
|
36
|
+
import "./chunk-NQAKARHE.js";
|
|
37
|
+
import "./chunk-4YPRRQBE.js";
|
|
38
|
+
import "./chunk-ZVJWD3FK.js";
|
|
39
|
+
import "./chunk-762BS35H.js";
|
|
40
|
+
import {
|
|
41
|
+
catchCrashes
|
|
42
|
+
} from "./chunk-AG64V7AB.js";
|
|
43
|
+
import "./chunk-S4UUN6LD.js";
|
|
44
|
+
import "./chunk-Y5E2WNWB.js";
|
|
45
|
+
import {
|
|
46
|
+
CliError
|
|
47
|
+
} from "./chunk-T7ZUDA4C.js";
|
|
48
|
+
import {
|
|
49
|
+
__name
|
|
50
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
51
|
+
|
|
52
|
+
// 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/command-server-entry.js
|
|
53
|
+
import { PassThrough } from "node:stream";
|
|
54
|
+
var route = /* @__PURE__ */ __name((stream, sink) => {
|
|
55
|
+
const original = stream.write;
|
|
56
|
+
stream.write = ((chunk, encoding, callback) => {
|
|
57
|
+
sink()(typeof chunk === "string" ? Buffer.from(chunk, typeof encoding === "string" ? encoding : "utf8") : Buffer.from(chunk));
|
|
58
|
+
const done = typeof encoding === "function" ? encoding : callback;
|
|
59
|
+
if (done)
|
|
60
|
+
process.nextTick(done);
|
|
61
|
+
return true;
|
|
62
|
+
});
|
|
63
|
+
return () => {
|
|
64
|
+
stream.write = original;
|
|
65
|
+
};
|
|
66
|
+
}, "route");
|
|
67
|
+
var closedStdin = /* @__PURE__ */ __name(() => {
|
|
68
|
+
const stdin = new PassThrough();
|
|
69
|
+
stdin.end();
|
|
70
|
+
return stdin;
|
|
71
|
+
}, "closedStdin");
|
|
72
|
+
var useStdin = /* @__PURE__ */ __name((outside) => Object.defineProperty(process, "stdin", {
|
|
73
|
+
get: /* @__PURE__ */ __name(() => commandServerRequest()?.stdin ?? outside, "get"),
|
|
74
|
+
configurable: true,
|
|
75
|
+
enumerable: true
|
|
76
|
+
}), "useStdin");
|
|
77
|
+
var roomFor = /* @__PURE__ */ __name((runs) => {
|
|
78
|
+
const emitters = [process, process.stdout, process.stderr];
|
|
79
|
+
const before = emitters.map((emitter) => emitter.getMaxListeners());
|
|
80
|
+
for (const emitter of emitters)
|
|
81
|
+
emitter.setMaxListeners(emitter.getMaxListeners() + 2 * runs);
|
|
82
|
+
return () => {
|
|
83
|
+
for (const [at, emitter] of emitters.entries())
|
|
84
|
+
emitter.setMaxListeners(before[at]);
|
|
85
|
+
};
|
|
86
|
+
}, "roomFor");
|
|
87
|
+
var serveEntry = /* @__PURE__ */ __name(async (entry, io, { firstRunAt, commanderExit }) => {
|
|
88
|
+
const release = catchCrashes({
|
|
89
|
+
cli: entry.app.command,
|
|
90
|
+
interactive: false,
|
|
91
|
+
...entry.reasons ? { reasons: entry.reasons } : {},
|
|
92
|
+
target: io.signals
|
|
93
|
+
});
|
|
94
|
+
const stopper = new AbortController();
|
|
95
|
+
const stop = /* @__PURE__ */ __name(() => stopper.abort(new CliError("cancelled", "the command server was stopped", { retryable: false })), "stop");
|
|
96
|
+
const protocol = io.stdout.write.bind(io.stdout);
|
|
97
|
+
const ownStderr = io.stderr.write.bind(io.stderr);
|
|
98
|
+
const toStderr = /* @__PURE__ */ __name((chunk) => {
|
|
99
|
+
ownStderr(chunk);
|
|
100
|
+
}, "toStderr");
|
|
101
|
+
const sink = /* @__PURE__ */ __name((pick) => () => {
|
|
102
|
+
const request = commandServerRequest();
|
|
103
|
+
return request ? (chunk) => pick(request).push(chunk) : toStderr;
|
|
104
|
+
}, "sink");
|
|
105
|
+
const unrouteOut = route(process.stdout, sink((request) => request.stdout));
|
|
106
|
+
const unrouteErr = route(process.stderr, sink((request) => request.stderr));
|
|
107
|
+
const stdin = Object.getOwnPropertyDescriptor(process, "stdin");
|
|
108
|
+
const requests = io.stdin;
|
|
109
|
+
useStdin(closedStdin());
|
|
110
|
+
const unroom = roomFor(COMMAND_SERVER_CONCURRENT);
|
|
111
|
+
io.signals.on("SIGINT", stop).on("SIGTERM", stop);
|
|
112
|
+
io.stdout.on("error", stop);
|
|
113
|
+
const run = /* @__PURE__ */ __name(async (argv, alone) => {
|
|
114
|
+
const request = { stdout: [], stderr: [], stdin: closedStdin(), alone };
|
|
115
|
+
const requestIo = { ...io, argv: [...io.argv.slice(0, 2), ...argv], stdin: request.stdin };
|
|
116
|
+
const context = {
|
|
117
|
+
args: argv,
|
|
118
|
+
env: io.env,
|
|
119
|
+
tty: false,
|
|
120
|
+
signal: stopper.signal,
|
|
121
|
+
atStart: /* @__PURE__ */ __name(async (command) => {
|
|
122
|
+
await enterCommandServer(command, entry.app.command);
|
|
123
|
+
await firstRunAt(entry, requestIo, () => true)(command);
|
|
124
|
+
}, "atStart"),
|
|
125
|
+
ask: /* @__PURE__ */ __name(async () => false, "ask"),
|
|
126
|
+
openBrowser: /* @__PURE__ */ __name(async () => void 0, "openBrowser"),
|
|
127
|
+
outputClosed: /* @__PURE__ */ __name(() => false, "outputClosed"),
|
|
128
|
+
setExitCode: /* @__PURE__ */ __name((code2) => {
|
|
129
|
+
request.exitCode = code2;
|
|
130
|
+
}, "setExitCode")
|
|
131
|
+
};
|
|
132
|
+
const code = await inCommandServerRequest(request, () => asOwnProcess(async () => {
|
|
133
|
+
try {
|
|
134
|
+
const returned = await entry.run(context);
|
|
135
|
+
return typeof returned === "number" ? returned : exitCodeSet() ?? 0;
|
|
136
|
+
} catch (error) {
|
|
137
|
+
return commanderExit(error) ?? entry.fail(error, context);
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
140
|
+
const text = /* @__PURE__ */ __name((chunks) => Buffer.concat(chunks).toString("utf8"), "text");
|
|
141
|
+
return { code, stdout: text(request.stdout), stderr: text(request.stderr) };
|
|
142
|
+
}, "run");
|
|
143
|
+
try {
|
|
144
|
+
if (entry.sqlite)
|
|
145
|
+
await ensureSqlite();
|
|
146
|
+
await serveCommands({
|
|
147
|
+
input: requests,
|
|
148
|
+
write: /* @__PURE__ */ __name((line) => new Promise((resolve) => protocol(line) ? resolve() : io.stdout.once("drain", resolve)), "write"),
|
|
149
|
+
run,
|
|
150
|
+
cli: entry.app.command,
|
|
151
|
+
concurrent: COMMAND_SERVER_CONCURRENT,
|
|
152
|
+
version: entry.app.version,
|
|
153
|
+
signal: stopper.signal
|
|
154
|
+
});
|
|
155
|
+
io.setExitCode(0);
|
|
156
|
+
} finally {
|
|
157
|
+
io.signals.off("SIGINT", stop).off("SIGTERM", stop);
|
|
158
|
+
unroom();
|
|
159
|
+
unrouteOut();
|
|
160
|
+
unrouteErr();
|
|
161
|
+
if (stdin)
|
|
162
|
+
Object.defineProperty(process, "stdin", stdin);
|
|
163
|
+
requests.destroy?.();
|
|
164
|
+
release();
|
|
165
|
+
}
|
|
166
|
+
}, "serveEntry");
|
|
167
|
+
export {
|
|
168
|
+
serveEntry
|
|
169
|
+
};
|