@wirecat/tg-cli 0.99.0 → 0.100.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/README.md +3 -2
- package/dist/bin/tg.js +23 -28
- package/dist/bundle/adapter-2LVPMFKF.js +2790 -0
- package/dist/bundle/all-profiles-BLTK2AAB.js +255 -0
- package/dist/bundle/anthropic-RJE4XEOO.js +71 -0
- package/dist/bundle/bot-api-4XM3NVWG.js +39793 -0
- package/dist/bundle/bot-history-WVM5GEQN.js +167 -0
- package/dist/bundle/bun-UZXO2LRQ.js +169 -0
- package/dist/bundle/bun-sqlite-GJLGSQIT.js +70 -0
- package/dist/bundle/chunk-2IM4M7Q2.js +98 -0
- package/dist/bundle/chunk-2MXQ2EUN.js +1344 -0
- package/dist/bundle/chunk-2XUGPE5W.js +73 -0
- package/dist/bundle/chunk-3KHKYYCR.js +24782 -0
- package/dist/bundle/chunk-3MVHRZWR.js +2 -0
- package/dist/bundle/chunk-3N6LXAPE.js +724 -0
- package/dist/bundle/chunk-3QDPV34J.js +6668 -0
- package/dist/bundle/chunk-3S5CL55R.js +100 -0
- package/dist/bundle/chunk-4U7QOFDA.js +33511 -0
- package/dist/bundle/chunk-4VBDVZNE.js +524 -0
- package/dist/bundle/chunk-4YCLWWZ3.js +277 -0
- package/dist/bundle/chunk-66E5QDLH.js +24 -0
- package/dist/bundle/chunk-6VEOR6GD.js +166 -0
- package/dist/bundle/chunk-6YLT4YVJ.js +45 -0
- package/dist/bundle/chunk-7BFO3DY6.js +21 -0
- package/dist/bundle/chunk-A7OBVRJV.js +738 -0
- package/dist/bundle/chunk-AFV74GK3.js +50 -0
- package/dist/bundle/chunk-ASDZHG5I.js +25 -0
- package/dist/bundle/chunk-ATZ44Z77.js +3253 -0
- package/dist/bundle/chunk-AVWK4NCW.js +24600 -0
- package/dist/bundle/chunk-BAIZAZ6Q.js +82 -0
- package/dist/bundle/chunk-BJG6JA5U.js +35 -0
- package/dist/bundle/chunk-BL36RR34.js +285 -0
- package/dist/bundle/chunk-BZANDKWT.js +71 -0
- package/dist/bundle/chunk-CV5ASHTW.js +8170 -0
- package/dist/bundle/chunk-DN4QUTWU.js +78 -0
- package/dist/bundle/chunk-DVOUKGFK.js +1950 -0
- package/dist/bundle/chunk-GTURDJJD.js +570 -0
- package/dist/bundle/chunk-GYEOQS2D.js +2795 -0
- package/dist/bundle/chunk-H3X5LS6U.js +153 -0
- package/dist/bundle/chunk-HKT5EOT5.js +6848 -0
- package/dist/bundle/chunk-HXTTDIL7.js +82 -0
- package/dist/bundle/chunk-I6WZJVRT.js +1123 -0
- package/dist/bundle/chunk-JFJVS5JC.js +41 -0
- package/dist/bundle/chunk-JSKT5UZX.js +2315 -0
- package/dist/bundle/chunk-KE6L2UEG.js +3068 -0
- package/dist/bundle/chunk-LI7TXFLS.js +122 -0
- package/dist/bundle/chunk-MQNFEVAH.js +58 -0
- package/dist/bundle/chunk-MUEXF4ME.js +582 -0
- package/dist/bundle/chunk-OOOV3JBZ.js +35527 -0
- package/dist/bundle/chunk-OW3COBN5.js +1275 -0
- package/dist/bundle/chunk-P26LWFNZ.js +35 -0
- package/dist/bundle/chunk-Q26JMPBP.js +215 -0
- package/dist/bundle/chunk-QU2FJMFB.js +18282 -0
- package/dist/bundle/chunk-QY3YOOTP.js +18 -0
- package/dist/bundle/chunk-RDQMV6EU.js +46 -0
- package/dist/bundle/chunk-RER6DAHP.js +3514 -0
- package/dist/bundle/chunk-SGJYU3SB.js +54 -0
- package/dist/bundle/chunk-SMJTL5U7.js +117 -0
- package/dist/bundle/chunk-SYPL4PHV.js +76 -0
- package/dist/bundle/chunk-THVNP6S6.js +31 -0
- package/dist/bundle/chunk-U7LXA4SO.js +1007 -0
- package/dist/bundle/chunk-UD4DOZCN.js +886 -0
- package/dist/bundle/chunk-UMLPXNJI.js +63 -0
- package/dist/bundle/chunk-V4JSVH4M.js +190 -0
- package/dist/bundle/chunk-WE3LBRMB.js +2374 -0
- package/dist/bundle/chunk-WKOY3POD.js +452 -0
- package/dist/bundle/chunk-X4Y2ROJI.js +541 -0
- package/dist/bundle/chunk-YG7PNCSW.js +230 -0
- package/dist/bundle/chunk-Z2FHEIXN.js +63 -0
- package/dist/bundle/chunk-ZZLKX62Z.js +928 -0
- package/dist/bundle/command-contract-AIVKJYIR.js +31 -0
- package/dist/bundle/dist-RJMT44PL.js +7577 -0
- package/dist/bundle/echarts-YHSYUWLY.js +42501 -0
- package/dist/bundle/embed-3HGI2XIW.js +35 -0
- package/dist/bundle/embedder-2CJMZETJ.js +108 -0
- package/dist/bundle/entry-UVE53OV3.js +14 -0
- package/dist/bundle/first-run-6GYC2QS3.js +24 -0
- package/dist/bundle/first-screen-HRRLVLOG.js +29 -0
- package/dist/bundle/identity-HEV5E57G.js +11 -0
- package/dist/bundle/instructions-5UVAXSQV.js +9 -0
- package/dist/bundle/mcp-NWXBVNUA.js +165 -0
- package/dist/bundle/node-IUL5HSYI.js +2340 -0
- package/dist/bundle/node-UPPL626U.js +21 -0
- package/dist/bundle/node-YHYEGYVE.js +176 -0
- package/dist/bundle/node-sqlite-CQ33A3R2.js +46 -0
- package/dist/bundle/oauth-OB3JFAD7.js +18 -0
- package/dist/bundle/open-JHGZIXU2.js +20 -0
- package/dist/bundle/process-PSKS3N5B.js +91 -0
- package/dist/bundle/program-RPYVPNRX.js +1060 -0
- package/dist/bundle/prompt-7BXUMJGG.js +13 -0
- package/dist/bundle/proxy-transport-3EEMW2HW.js +17 -0
- package/dist/bundle/recognize-YMZPL47R.js +191 -0
- package/dist/bundle/remote-LQ3Q22NG.js +26 -0
- package/dist/bundle/rerank-SM7IYVXJ.js +49 -0
- package/dist/bundle/serve-GHUEP5H5.js +181 -0
- package/dist/bundle/server-A45HVXQY.js +178 -0
- package/dist/bundle/server-K2BQPPHN.js +785 -0
- package/dist/bundle/state-WIOL52GZ.js +30 -0
- package/dist/bundle/store-XE5AKUJZ.js +121 -0
- package/dist/bundle/store-maintenance-command-YS5E7VUN.js +46 -0
- package/dist/bundle/tg.js +40 -0
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +1 -1
- package/dist/commands/context.js.map +1 -1
- package/dist/install/postinstall.js +1 -1
- package/dist/install/postinstall.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +4 -2
- /package/skills/{wirecat-tg → tg-cli}/SKILL.md +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createRequire as __tgRequire } from "node:module";
|
|
2
|
+
const require = __tgRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
__name
|
|
5
|
+
} from "./chunk-AFV74GK3.js";
|
|
6
|
+
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/http/listen.js
|
|
8
|
+
import { createServer } from "node:http";
|
|
9
|
+
import { Readable } from "node:stream";
|
|
10
|
+
var MAX_BODY = 4 * 1024 * 1024;
|
|
11
|
+
var TooLarge = class extends Error {
|
|
12
|
+
static {
|
|
13
|
+
__name(this, "TooLarge");
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var readBody = /* @__PURE__ */ __name((incoming, limit) => new Promise((resolve, reject) => {
|
|
17
|
+
if (Number(incoming.headers["content-length"] ?? 0) > limit)
|
|
18
|
+
return reject(new TooLarge());
|
|
19
|
+
const chunks = [];
|
|
20
|
+
let size = 0;
|
|
21
|
+
incoming.on("data", (chunk) => {
|
|
22
|
+
size += chunk.length;
|
|
23
|
+
if (size > limit) {
|
|
24
|
+
incoming.destroy();
|
|
25
|
+
reject(new TooLarge());
|
|
26
|
+
} else
|
|
27
|
+
chunks.push(chunk);
|
|
28
|
+
});
|
|
29
|
+
incoming.once("end", () => resolve(Buffer.concat(chunks)));
|
|
30
|
+
incoming.once("error", reject);
|
|
31
|
+
}), "readBody");
|
|
32
|
+
var toRequest = /* @__PURE__ */ __name(async (incoming, origin, maxBody) => {
|
|
33
|
+
const headers = new Headers();
|
|
34
|
+
for (const [name, value] of Object.entries(incoming.headers)) {
|
|
35
|
+
if (Array.isArray(value))
|
|
36
|
+
for (const one of value)
|
|
37
|
+
headers.append(name, one);
|
|
38
|
+
else if (value !== void 0)
|
|
39
|
+
headers.set(name, value);
|
|
40
|
+
}
|
|
41
|
+
const method = incoming.method ?? "GET";
|
|
42
|
+
const body = method === "GET" || method === "HEAD" ? void 0 : await readBody(incoming, maxBody);
|
|
43
|
+
if (body)
|
|
44
|
+
headers.set("content-length", String(body.length));
|
|
45
|
+
return new Request(new URL(incoming.url ?? "/", origin), { method, headers, ...body ? { body } : {} });
|
|
46
|
+
}, "toRequest");
|
|
47
|
+
var send = /* @__PURE__ */ __name(async (response, outgoing) => {
|
|
48
|
+
outgoing.writeHead(response.status, Object.fromEntries(response.headers));
|
|
49
|
+
if (!response.body)
|
|
50
|
+
return void outgoing.end();
|
|
51
|
+
const body = Readable.fromWeb(response.body);
|
|
52
|
+
outgoing.once("close", () => body.destroy());
|
|
53
|
+
body.pipe(outgoing);
|
|
54
|
+
}, "send");
|
|
55
|
+
var listen = /* @__PURE__ */ __name((handle, { host, port, maxBody = MAX_BODY }) => new Promise((resolve, reject) => {
|
|
56
|
+
const server = createServer((incoming, outgoing) => {
|
|
57
|
+
toRequest(incoming, `http://${host}`, maxBody).then(handle).then((response) => send(response, outgoing)).catch((error) => {
|
|
58
|
+
if (!outgoing.headersSent)
|
|
59
|
+
outgoing.writeHead(error instanceof TooLarge ? 413 : 500, { connection: "close" });
|
|
60
|
+
outgoing.end();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
server.once("error", reject);
|
|
64
|
+
server.listen(port, host, () => {
|
|
65
|
+
const { port: bound } = server.address();
|
|
66
|
+
resolve({
|
|
67
|
+
url: new URL(`http://${host}:${bound}`),
|
|
68
|
+
close: /* @__PURE__ */ __name(() => new Promise((done) => {
|
|
69
|
+
server.close(() => done());
|
|
70
|
+
server.closeAllConnections();
|
|
71
|
+
}), "close")
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}), "listen");
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
listen
|
|
78
|
+
};
|