@wirecat/notion-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 +33 -0
- package/LICENSE +204 -0
- package/README.md +36 -2
- package/contracts/wirecat.json +1315 -0
- package/dist/bin/notion.d.ts +3 -0
- package/dist/bin/notion.d.ts.map +1 -0
- package/dist/bin/notion.js +40 -0
- package/dist/bin/notion.js.map +1 -0
- package/dist/bundle/all-profiles-OETMCOLN.js +278 -0
- package/dist/bundle/anthropic-5Y3O2TYM.js +91 -0
- package/dist/bundle/app-server-IVWBIVHC.js +231 -0
- package/dist/bundle/bun-EO636SAD.js +169 -0
- package/dist/bundle/bun-sqlite-C2T7QJ2M.js +76 -0
- package/dist/bundle/chunk-24FAYAML.js +52 -0
- package/dist/bundle/chunk-2YR3RYT4.js +73 -0
- package/dist/bundle/chunk-35K5T6WV.js +24 -0
- package/dist/bundle/chunk-3D3PFXBP.js +2315 -0
- package/dist/bundle/chunk-47R43UVJ.js +1068 -0
- package/dist/bundle/chunk-4GC5DBHW.js +100 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-64D5VUZ4.js +9564 -0
- package/dist/bundle/chunk-66PL7P4C.js +23 -0
- package/dist/bundle/chunk-7FII4DCE.js +362 -0
- package/dist/bundle/chunk-7N5QB6NL.js +156 -0
- package/dist/bundle/chunk-AE2KQ37N.js +95 -0
- package/dist/bundle/chunk-AQZO3ITW.js +58 -0
- package/dist/bundle/chunk-B2WFKFYL.js +1488 -0
- package/dist/bundle/chunk-B2XKEEFX.js +230 -0
- package/dist/bundle/chunk-B4B65XIO.js +73 -0
- package/dist/bundle/chunk-BWICUW7W.js +288 -0
- package/dist/bundle/chunk-CLG2ISQH.js +206 -0
- package/dist/bundle/chunk-CWVAYQXI.js +185 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DIM5YWBU.js +53 -0
- package/dist/bundle/chunk-EGTBL3MJ.js +6848 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-EPAZ7DJB.js +783 -0
- package/dist/bundle/chunk-ESZT4WW3.js +142 -0
- package/dist/bundle/chunk-EU5WCOMQ.js +4001 -0
- package/dist/bundle/chunk-F6MLJ3V5.js +72 -0
- package/dist/bundle/chunk-FF4DDBCB.js +1028 -0
- package/dist/bundle/chunk-GA3URWIF.js +46 -0
- package/dist/bundle/chunk-HRTIRRXR.js +3112 -0
- package/dist/bundle/chunk-HWRKURQH.js +54 -0
- package/dist/bundle/chunk-IQWEJEB5.js +39724 -0
- package/dist/bundle/chunk-JK44XO2S.js +392 -0
- package/dist/bundle/chunk-JKIN5TOU.js +131 -0
- package/dist/bundle/chunk-K5TWMQSY.js +188 -0
- package/dist/bundle/chunk-KHOVVPLC.js +18 -0
- package/dist/bundle/chunk-NLDYZBTC.js +5862 -0
- package/dist/bundle/chunk-OWJDC4CB.js +217 -0
- package/dist/bundle/chunk-QBC23NHD.js +38 -0
- package/dist/bundle/chunk-QC3KOJT4.js +300 -0
- package/dist/bundle/chunk-R6ZM45NF.js +1239 -0
- package/dist/bundle/chunk-RAZKIHGH.js +76 -0
- package/dist/bundle/chunk-RDZ7SVBZ.js +731 -0
- package/dist/bundle/chunk-RLSFOR2D.js +161 -0
- package/dist/bundle/chunk-RSIS7BR7.js +2778 -0
- package/dist/bundle/chunk-ST2UC7FS.js +1324 -0
- package/dist/bundle/chunk-TR7R5DL4.js +370 -0
- package/dist/bundle/chunk-TSCIIXN3.js +106 -0
- package/dist/bundle/chunk-UWIA2G6Q.js +12737 -0
- package/dist/bundle/chunk-UWW24JQF.js +66 -0
- package/dist/bundle/chunk-WK3OSDNV.js +1197 -0
- package/dist/bundle/chunk-WM7663C2.js +1221 -0
- package/dist/bundle/chunk-WVZFXI36.js +274 -0
- package/dist/bundle/chunk-WWMB4UHF.js +78 -0
- package/dist/bundle/chunk-XC5CKHX2.js +63 -0
- package/dist/bundle/chunk-XL2HXHP3.js +82 -0
- package/dist/bundle/chunk-XQUUANA2.js +24600 -0
- package/dist/bundle/chunk-XYIT2XB3.js +1372 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YA4LSSDZ.js +64499 -0
- package/dist/bundle/chunk-ZI3YTXSF.js +2 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-6G5DC2FN.js +35 -0
- package/dist/bundle/command-server-entry-A66DJ3MH.js +164 -0
- package/dist/bundle/decode-7XOFRAAT.js +163 -0
- package/dist/bundle/definitions-M3U4UYHN.js +45607 -0
- package/dist/bundle/dispatch-FEKU5UXC.js +411 -0
- package/dist/bundle/dist-YFKABFFF.js +7577 -0
- package/dist/bundle/echarts-XD2JSWU4.js +42501 -0
- package/dist/bundle/embed-F3HYGAF7.js +38 -0
- package/dist/bundle/embedder-GSEDDUH7.js +111 -0
- package/dist/bundle/failure-HDJLR2YJ.js +25 -0
- package/dist/bundle/first-run-TXNTIUSP.js +28 -0
- package/dist/bundle/first-screen-JZPJND7J.js +33 -0
- package/dist/bundle/instructions-NZGJ4FW5.js +11 -0
- package/dist/bundle/mcp-VFIOZDVY.js +167 -0
- package/dist/bundle/node-KM3CUABH.js +2340 -0
- package/dist/bundle/node-RPKPDYQS.js +176 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-KH2UUYVO.js +74 -0
- package/dist/bundle/notion.js +185 -0
- package/dist/bundle/oauth-NKAI7TQD.js +20 -0
- package/dist/bundle/open-WSAEAA2V.js +23 -0
- package/dist/bundle/openai-JPVDGHG5.js +238 -0
- package/dist/bundle/process-5ZFVKOQX.js +91 -0
- package/dist/bundle/program-M3D56D6T.js +28854 -0
- package/dist/bundle/prompt-FROYQ5LV.js +17 -0
- package/dist/bundle/recognize-NYCHQMCX.js +26 -0
- package/dist/bundle/remote-4OERF3Z4.js +32 -0
- package/dist/bundle/rerank-TEGXFUWY.js +52 -0
- package/dist/bundle/schemas-MZNNOEYN.js +12214 -0
- package/dist/bundle/serve-HLYYBAXY.js +199 -0
- package/dist/bundle/server-D5OYNEUW.js +193 -0
- package/dist/bundle/server-LWZGVMNW.js +62 -0
- package/dist/bundle/sqlite-runtime-H2S5RR2F.js +20 -0
- package/dist/bundle/state-OPOXCDZL.js +36 -0
- package/dist/bundle/store-NHMXEJPD.js +164 -0
- package/dist/bundle/store-Y3KRLCJ7.js +281 -0
- package/dist/bundle/store-maintenance-command-D4W7WSLQ.js +53 -0
- package/dist/commands/api.d.ts +4 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +140 -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/databases.d.ts +3 -0
- package/dist/commands/databases.d.ts.map +1 -0
- package/dist/commands/databases.js +65 -0
- package/dist/commands/databases.js.map +1 -0
- package/dist/commands/documents.d.ts +3 -0
- package/dist/commands/documents.d.ts.map +1 -0
- package/dist/commands/documents.js +41 -0
- package/dist/commands/documents.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 +104 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +13 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +46 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +58 -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 +45603 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/manifest.d.ts +3 -0
- package/dist/generated/manifest.d.ts.map +1 -0
- package/dist/generated/manifest.js +2089 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/metadata.d.ts +6 -0
- package/dist/generated/metadata.d.ts.map +1 -0
- package/dist/generated/metadata.js +24 -0
- package/dist/generated/metadata.js.map +1 -0
- package/dist/generated/schemas.d.ts +1223 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +11557 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +11120 -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 +7 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +29 -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/notion/client.d.ts +42 -0
- package/dist/notion/client.d.ts.map +1 -0
- package/dist/notion/client.js +118 -0
- package/dist/notion/client.js.map +1 -0
- package/dist/notion/errors.d.ts +24 -0
- package/dist/notion/errors.d.ts.map +1 -0
- package/dist/notion/errors.js +102 -0
- package/dist/notion/errors.js.map +1 -0
- package/dist/notion/ids.d.ts +7 -0
- package/dist/notion/ids.d.ts.map +1 -0
- package/dist/notion/ids.js +37 -0
- package/dist/notion/ids.js.map +1 -0
- package/dist/notion/links.d.ts +6 -0
- package/dist/notion/links.d.ts.map +1 -0
- package/dist/notion/links.js +22 -0
- package/dist/notion/links.js.map +1 -0
- package/dist/notion/notion.d.ts +95 -0
- package/dist/notion/notion.d.ts.map +1 -0
- package/dist/notion/notion.js +269 -0
- package/dist/notion/notion.js.map +1 -0
- package/dist/notion/port.d.ts +13 -0
- package/dist/notion/port.d.ts.map +1 -0
- package/dist/notion/port.js +60 -0
- package/dist/notion/port.js.map +1 -0
- package/dist/notion/read-posts.d.ts +36 -0
- package/dist/notion/read-posts.d.ts.map +1 -0
- package/dist/notion/read-posts.js +24 -0
- package/dist/notion/read-posts.js.map +1 -0
- package/dist/notion/reads.d.ts +327 -0
- package/dist/notion/reads.d.ts.map +1 -0
- package/dist/notion/reads.js +18 -0
- package/dist/notion/reads.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +62 -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/sync/cursor.d.ts +54 -0
- package/dist/sync/cursor.d.ts.map +1 -0
- package/dist/sync/cursor.js +52 -0
- package/dist/sync/cursor.js.map +1 -0
- package/dist/sync/front-matter.d.ts +10 -0
- package/dist/sync/front-matter.d.ts.map +1 -0
- package/dist/sync/front-matter.js +114 -0
- package/dist/sync/front-matter.js.map +1 -0
- package/dist/sync/markdown.d.ts +8 -0
- package/dist/sync/markdown.d.ts.map +1 -0
- package/dist/sync/markdown.js +40 -0
- package/dist/sync/markdown.js.map +1 -0
- package/dist/sync/source.d.ts +64 -0
- package/dist/sync/source.d.ts.map +1 -0
- package/dist/sync/source.js +634 -0
- package/dist/sync/source.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/package.json +85 -4
- package/skills/notion-cli/SKILL.md +34 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
stdinFieldOf
|
|
5
|
+
} from "./chunk-KHOVVPLC.js";
|
|
6
|
+
import {
|
|
7
|
+
commandPathOf
|
|
8
|
+
} from "./chunk-JKIN5TOU.js";
|
|
9
|
+
import {
|
|
10
|
+
commandServerRequest,
|
|
11
|
+
metaOf
|
|
12
|
+
} from "./chunk-UWIA2G6Q.js";
|
|
13
|
+
import {
|
|
14
|
+
errorObjectOf,
|
|
15
|
+
renderError
|
|
16
|
+
} from "./chunk-WM7663C2.js";
|
|
17
|
+
import {
|
|
18
|
+
CliError
|
|
19
|
+
} from "./chunk-F6MLJ3V5.js";
|
|
20
|
+
import {
|
|
21
|
+
__name
|
|
22
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
23
|
+
|
|
24
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_8be6aa3a41727a76ce87cf0d5a7bd659/node_modules/@wirecat/cli-core/dist/cli/command-server.js
|
|
25
|
+
import { createInterface } from "node:readline";
|
|
26
|
+
|
|
27
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_8be6aa3a41727a76ce87cf0d5a7bd659/node_modules/@wirecat/cli-core/dist/cli/command-server-argv.js
|
|
28
|
+
var COMMAND_SERVER_ARGV = ["commands", "--serve"];
|
|
29
|
+
var isCommandServer = /* @__PURE__ */ __name((args) => args.length === COMMAND_SERVER_ARGV.length && COMMAND_SERVER_ARGV.every((word, at) => args[at] === word), "isCommandServer");
|
|
30
|
+
|
|
31
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_8be6aa3a41727a76ce87cf0d5a7bd659/node_modules/@wirecat/cli-core/dist/cli/command-server.js
|
|
32
|
+
var COMMAND_SERVER_PROTOCOL = 1;
|
|
33
|
+
var COMMAND_SERVER_IDLE_MS = 10 * 6e4;
|
|
34
|
+
var COMMAND_SERVER_CONCURRENT = 8;
|
|
35
|
+
var runsAlone = /* @__PURE__ */ __name((command) => commandPathOf(command)[0] === "store", "runsAlone");
|
|
36
|
+
var enterCommandServer = /* @__PURE__ */ __name(async (command, cli) => {
|
|
37
|
+
const request = commandServerRequest();
|
|
38
|
+
if (!request)
|
|
39
|
+
return;
|
|
40
|
+
refuseInCommandServer(command, cli);
|
|
41
|
+
if (runsAlone(command))
|
|
42
|
+
await request.alone();
|
|
43
|
+
}, "enterCommandServer");
|
|
44
|
+
var refuseInCommandServer = /* @__PURE__ */ __name((command, cli) => {
|
|
45
|
+
if (!commandServerRequest())
|
|
46
|
+
return;
|
|
47
|
+
const typed = [cli, ...commandPathOf(command)].join(" ");
|
|
48
|
+
const { lifetime } = metaOf(command);
|
|
49
|
+
if (lifetime)
|
|
50
|
+
throw new CliError("validation_error", `\`${typed}\` ${lifetime === "persistent" ? "runs until it is stopped" : "waits on a person"}; the command server runs only commands that return \u2014 start it as a process of its own`);
|
|
51
|
+
if (stdinFieldOf(command))
|
|
52
|
+
throw new CliError("validation_error", `\`${typed}\` reads its input on stdin, which the command server does not pass on \u2014 start it as a process of its own`);
|
|
53
|
+
}, "refuseInCommandServer");
|
|
54
|
+
var refusal = /* @__PURE__ */ __name((cli, message) => `${renderError(errorObjectOf(new CliError("validation_error", message)), { cli, interactive: false })}
|
|
55
|
+
`, "refusal");
|
|
56
|
+
var requestOf = /* @__PURE__ */ __name((line, cli) => {
|
|
57
|
+
let parsed;
|
|
58
|
+
try {
|
|
59
|
+
parsed = JSON.parse(line);
|
|
60
|
+
} catch {
|
|
61
|
+
return { id: null, error: "a request is one JSON object per line" };
|
|
62
|
+
}
|
|
63
|
+
const { id, argv } = parsed ?? {};
|
|
64
|
+
const known = typeof id === "number" && Number.isFinite(id) ? id : null;
|
|
65
|
+
if (known === null)
|
|
66
|
+
return { id: null, error: 'a request needs a numeric "id"' };
|
|
67
|
+
if (!Array.isArray(argv) || !argv.every((word) => typeof word === "string"))
|
|
68
|
+
return { id: known, error: '"argv" is a list of strings' };
|
|
69
|
+
if (isCommandServer(argv))
|
|
70
|
+
return { id: known, error: `\`${cli} commands --serve\` cannot run inside itself` };
|
|
71
|
+
return { id: known, argv };
|
|
72
|
+
}, "requestOf");
|
|
73
|
+
var serveCommands = /* @__PURE__ */ __name(async ({ input, write, run, cli, version, idleMs = COMMAND_SERVER_IDLE_MS, concurrent = COMMAND_SERVER_CONCURRENT, signal }) => {
|
|
74
|
+
const send = /* @__PURE__ */ __name((value) => write(`${JSON.stringify(value)}
|
|
75
|
+
`), "send");
|
|
76
|
+
await send({ ready: true, protocol: COMMAND_SERVER_PROTOCOL, version, concurrent });
|
|
77
|
+
const lines = createInterface({ input, crlfDelay: Number.POSITIVE_INFINITY });
|
|
78
|
+
return new Promise((resolve) => {
|
|
79
|
+
const waiting = [];
|
|
80
|
+
let active = 0;
|
|
81
|
+
let running = 0;
|
|
82
|
+
let gated = false;
|
|
83
|
+
let drained;
|
|
84
|
+
let turns = Promise.resolve();
|
|
85
|
+
let timer;
|
|
86
|
+
let ending = false;
|
|
87
|
+
let done = false;
|
|
88
|
+
const finish = /* @__PURE__ */ __name(() => {
|
|
89
|
+
if (done)
|
|
90
|
+
return;
|
|
91
|
+
done = true;
|
|
92
|
+
clearTimeout(timer);
|
|
93
|
+
lines.close();
|
|
94
|
+
resolve(0);
|
|
95
|
+
}, "finish");
|
|
96
|
+
const settle = /* @__PURE__ */ __name(() => {
|
|
97
|
+
if (running === 0 && drained) {
|
|
98
|
+
const go = drained;
|
|
99
|
+
drained = void 0;
|
|
100
|
+
go();
|
|
101
|
+
}
|
|
102
|
+
pump();
|
|
103
|
+
if (active > 0 || waiting.length > 0 || done)
|
|
104
|
+
return;
|
|
105
|
+
if (ending)
|
|
106
|
+
finish();
|
|
107
|
+
else {
|
|
108
|
+
clearTimeout(timer);
|
|
109
|
+
timer = setTimeout(finish, idleMs);
|
|
110
|
+
}
|
|
111
|
+
}, "settle");
|
|
112
|
+
const start = /* @__PURE__ */ __name((line) => {
|
|
113
|
+
active += 1;
|
|
114
|
+
running += 1;
|
|
115
|
+
let holdsPlace = true;
|
|
116
|
+
let ended = false;
|
|
117
|
+
let turn;
|
|
118
|
+
let release;
|
|
119
|
+
const alone = /* @__PURE__ */ __name(() => {
|
|
120
|
+
if (turn)
|
|
121
|
+
return turn;
|
|
122
|
+
holdsPlace = false;
|
|
123
|
+
running -= 1;
|
|
124
|
+
turn = turns.then(() => new Promise((go) => {
|
|
125
|
+
if (ended)
|
|
126
|
+
return go();
|
|
127
|
+
gated = true;
|
|
128
|
+
drained = /* @__PURE__ */ __name(() => {
|
|
129
|
+
if (ended)
|
|
130
|
+
gated = false;
|
|
131
|
+
else {
|
|
132
|
+
holdsPlace = true;
|
|
133
|
+
running += 1;
|
|
134
|
+
}
|
|
135
|
+
go();
|
|
136
|
+
}, "drained");
|
|
137
|
+
settle();
|
|
138
|
+
}));
|
|
139
|
+
turns = turn.then(() => ended && !holdsPlace ? void 0 : new Promise((free) => release = free));
|
|
140
|
+
return turn;
|
|
141
|
+
}, "alone");
|
|
142
|
+
const answer = /* @__PURE__ */ __name(async () => {
|
|
143
|
+
const request = requestOf(line, cli);
|
|
144
|
+
if ("error" in request)
|
|
145
|
+
return send({ id: request.id, code: 2, stdout: "", stderr: refusal(cli, request.error) });
|
|
146
|
+
const answered = await run(request.argv, alone);
|
|
147
|
+
return send({ id: request.id, ...answered });
|
|
148
|
+
}, "answer");
|
|
149
|
+
answer().catch(finish).finally(() => {
|
|
150
|
+
ended = true;
|
|
151
|
+
active -= 1;
|
|
152
|
+
if (holdsPlace)
|
|
153
|
+
running -= 1;
|
|
154
|
+
if (release) {
|
|
155
|
+
gated = false;
|
|
156
|
+
release();
|
|
157
|
+
}
|
|
158
|
+
settle();
|
|
159
|
+
});
|
|
160
|
+
}, "start");
|
|
161
|
+
const pump = /* @__PURE__ */ __name(() => {
|
|
162
|
+
while (!done && !gated && running < concurrent && waiting.length > 0)
|
|
163
|
+
start(waiting.shift());
|
|
164
|
+
}, "pump");
|
|
165
|
+
lines.on("line", (line) => {
|
|
166
|
+
if (done || ending || line.trim() === "")
|
|
167
|
+
return;
|
|
168
|
+
clearTimeout(timer);
|
|
169
|
+
waiting.push(line);
|
|
170
|
+
pump();
|
|
171
|
+
});
|
|
172
|
+
const end = /* @__PURE__ */ __name(() => {
|
|
173
|
+
ending = true;
|
|
174
|
+
settle();
|
|
175
|
+
}, "end");
|
|
176
|
+
lines.on("close", end);
|
|
177
|
+
if (signal?.aborted)
|
|
178
|
+
end();
|
|
179
|
+
signal?.addEventListener("abort", end, { once: true });
|
|
180
|
+
settle();
|
|
181
|
+
});
|
|
182
|
+
}, "serveCommands");
|
|
183
|
+
|
|
184
|
+
export {
|
|
185
|
+
COMMAND_SERVER_CONCURRENT,
|
|
186
|
+
enterCommandServer,
|
|
187
|
+
serveCommands
|
|
188
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
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.663.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_8be6aa3a41727a76ce87cf0d5a7bd659/node_modules/@wirecat/cli-core/dist/cli/stdin-field.js
|
|
8
|
+
var fields = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
var readsStdin = /* @__PURE__ */ __name((command, field) => {
|
|
10
|
+
fields.set(command, field);
|
|
11
|
+
return command;
|
|
12
|
+
}, "readsStdin");
|
|
13
|
+
var stdinFieldOf = /* @__PURE__ */ __name((command) => fields.get(command), "stdinFieldOf");
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
readsStdin,
|
|
17
|
+
stdinFieldOf
|
|
18
|
+
};
|