@wirecat/zoom-cli 0.76.0 → 0.77.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 +12 -11
- package/contracts/wirecat.json +53 -105
- package/dist/answer-entities.d.ts +1 -141
- package/dist/answer-entities.d.ts.map +1 -1
- package/dist/answer-entities.js +0 -31
- package/dist/answer-entities.js.map +1 -1
- package/dist/api.d.ts +18 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +179 -54
- package/dist/api.js.map +1 -1
- package/dist/archive-commands.d.ts +0 -3
- package/dist/archive-commands.d.ts.map +1 -1
- package/dist/archive-commands.js +1 -54
- package/dist/archive-commands.js.map +1 -1
- package/dist/bin/zm.js +2 -2
- package/dist/bundle/{all-profiles-AAMFP7IN.js → all-profiles-PMCFNDMA.js} +11 -11
- package/dist/bundle/answer-policy-XU7KEW2V.js +121 -0
- package/dist/bundle/{anthropic-6KIS53QB.js → anthropic-TGJOKLUS.js} +6 -6
- package/dist/bundle/{app-server-6QYNNYEU.js → app-server-OAODUFM3.js} +73 -63
- package/dist/bundle/{bun-QVVCH4MJ.js → bun-HJHVHJJV.js} +2 -2
- package/dist/bundle/{bun-sqlite-Y2ZFMNQ3.js → bun-sqlite-PLBOY6FP.js} +7 -7
- package/dist/bundle/{chunk-OWZETMRE.js → chunk-2QDD6S2R.js} +8 -8
- package/dist/bundle/{chunk-FGRFIXG2.js → chunk-2QRGJSKO.js} +2 -2
- package/dist/bundle/{chunk-D2TGXSHQ.js → chunk-36SI35XZ.js} +5 -5
- package/dist/bundle/{chunk-4JPOELCT.js → chunk-375BH5OD.js} +4 -4
- package/dist/bundle/{chunk-OFODCJ2A.js → chunk-3TLQF3DN.js} +3 -3
- package/dist/bundle/{chunk-K3K3WKDB.js → chunk-4QNW4NK6.js} +1 -1
- package/dist/bundle/{chunk-YEBWRWE3.js → chunk-4Z4VOQRR.js} +17 -17
- package/dist/bundle/{chunk-LGBLYFKI.js → chunk-5A5W322G.js} +6 -2
- package/dist/bundle/chunk-5C5UEKUJ.js +170 -0
- package/dist/bundle/chunk-5C6CRSEM.js +389 -0
- package/dist/bundle/{chunk-VG63EXRC.js → chunk-5KHCFIWI.js} +2 -2
- package/dist/bundle/{chunk-LEVOI6Z3.js → chunk-635GRAO5.js} +12 -12
- package/dist/bundle/{chunk-Y2BGABXP.js → chunk-6JRBMNRN.js} +3 -3
- package/dist/bundle/{chunk-XC4V6YCS.js → chunk-6YCFDDRO.js} +1 -1
- package/dist/bundle/{chunk-VRA4RVQU.js → chunk-77JQIY2V.js} +3 -3
- package/dist/bundle/{chunk-CPOFLYPU.js → chunk-7AFYZOHU.js} +29 -29
- package/dist/bundle/{chunk-IXPBSDKB.js → chunk-7CMYNW3W.js} +4 -4
- package/dist/bundle/chunk-7DTU7QZP.js +72 -0
- package/dist/bundle/chunk-7ILGYNWX.js +773 -0
- package/dist/bundle/{chunk-Y4WEAWU7.js → chunk-7S3N5CTA.js} +1 -1
- package/dist/bundle/chunk-7SNU7RFU.js +229 -0
- package/dist/bundle/{chunk-TK77DCE5.js → chunk-A6LK2W5J.js} +1 -1
- package/dist/bundle/{chunk-UAV74EY4.js → chunk-ADJIYY33.js} +1 -1
- package/dist/bundle/{chunk-JWMOHEDL.js → chunk-B7XFDMFV.js} +10 -10
- package/dist/bundle/{chunk-GYTAHH5Y.js → chunk-BOJCRTQW.js} +2 -2
- package/dist/bundle/{chunk-HUHH25AG.js → chunk-CJL5GHTQ.js} +913 -544
- package/dist/bundle/{chunk-T2QVWRJF.js → chunk-CL6QAZGT.js} +39 -67
- package/dist/bundle/{chunk-NQ356ERO.js → chunk-CUJJZJ4R.js} +44 -8
- package/dist/bundle/{chunk-OINDAHXC.js → chunk-CZ6OO66B.js} +4 -4
- package/dist/bundle/chunk-DCEQIKFD.js +259 -0
- package/dist/bundle/{chunk-55SWKR6Y.js → chunk-DDUNPLET.js} +256 -588
- package/dist/bundle/{chunk-6VCQ4CTK.js → chunk-DYIRJINE.js} +1 -1
- package/dist/bundle/{chunk-WKT5RPSY.js → chunk-E3UPMPUV.js} +8 -8
- package/dist/bundle/{chunk-5T7TBK5Y.js → chunk-ECRFXQHA.js} +1 -1
- package/dist/bundle/{chunk-LOEK6IFQ.js → chunk-F4ROWGLU.js} +57 -35
- package/dist/bundle/{chunk-UYZDH5LK.js → chunk-FDQE2CLT.js} +1 -1
- package/dist/bundle/{chunk-M7WYBGQT.js → chunk-FRC5QIPQ.js} +8 -8
- package/dist/bundle/{chunk-3D5PETD2.js → chunk-FS5HPXQN.js} +9 -9
- package/dist/bundle/{chunk-QY6GE7CL.js → chunk-GHBDYYPO.js} +2 -2
- package/dist/bundle/{chunk-OOYIPK4F.js → chunk-H2EVYY5Z.js} +1 -1
- package/dist/bundle/{chunk-PFLJJQWW.js → chunk-I3QMPQYD.js} +49 -49
- package/dist/bundle/{chunk-XWQKRKMT.js → chunk-ICZVSVTW.js} +71 -252
- package/dist/bundle/{chunk-R47GYLNN.js → chunk-IJTBB23F.js} +29 -27
- package/dist/bundle/{chunk-WZJ7ZYR4.js → chunk-IS6MUPN2.js} +4 -4
- package/dist/bundle/{chunk-ORM73DZO.js → chunk-IUOKIZZN.js} +2 -2
- package/dist/bundle/{chunk-FMJ4QSSU.js → chunk-IZMRQ3MV.js} +10 -10
- package/dist/bundle/{chunk-HWYSJ4SL.js → chunk-JFVZVPRW.js} +3 -3
- package/dist/bundle/{chunk-7RORMNKP.js → chunk-JMU3E2WA.js} +2 -2
- package/dist/bundle/{chunk-6SXCGS3A.js → chunk-JQUYHPQD.js} +7 -7
- package/dist/bundle/{chunk-MDTEAKA5.js → chunk-KHBSQROH.js} +5 -5
- package/dist/bundle/{chunk-EPPE6ZTS.js → chunk-KYKW2W6X.js} +1 -1
- package/dist/bundle/chunk-LMZUC4CS.js +101 -0
- package/dist/bundle/{chunk-X73YEFQE.js → chunk-LUAS73NT.js} +18 -18
- package/dist/bundle/{chunk-25GMFXPF.js → chunk-LWMDLXEO.js} +2032 -2657
- package/dist/bundle/{chunk-GPIQY4YB.js → chunk-LYVHQ6DJ.js} +14 -14
- package/dist/bundle/{chunk-CXHUOPN5.js → chunk-MCLZ74II.js} +7 -7
- package/dist/bundle/chunk-MIG4RLDB.js +555 -0
- package/dist/bundle/{chunk-JADBHKBP.js → chunk-MMAZUJBO.js} +1 -1
- package/dist/bundle/{chunk-VABYJQYE.js → chunk-MTH3JJHF.js} +24 -22
- package/dist/bundle/{chunk-EZXW3ZCR.js → chunk-NJJEUG4C.js} +12 -12
- package/dist/bundle/{chunk-GZYICXO4.js → chunk-NKKVVPL5.js} +1 -1
- package/dist/bundle/{chunk-QLUU3BV2.js → chunk-NOF6LABG.js} +6 -6
- package/dist/bundle/{chunk-KEFDP6NL.js → chunk-NPDPD2H3.js} +12 -12
- package/dist/bundle/{chunk-5EII5RIL.js → chunk-NPIVV52M.js} +1 -1
- package/dist/bundle/{chunk-UG2QDGAH.js → chunk-OOIU36FA.js} +1 -1
- package/dist/bundle/{chunk-IUSY4ZJK.js → chunk-OXXJW3A5.js} +806 -1523
- package/dist/bundle/chunk-PM3MB3E7.js +295 -0
- package/dist/bundle/{chunk-EBIK5Q73.js → chunk-PO4RZ4XZ.js} +1 -1
- package/dist/bundle/{chunk-EZJSAYWZ.js → chunk-Q7ZW7XAX.js} +31 -87
- package/dist/bundle/{chunk-CS62FET6.js → chunk-QAGECFHL.js} +22 -22
- package/dist/bundle/{chunk-WNXC42IU.js → chunk-QE4L2QQZ.js} +9 -9
- package/dist/bundle/{chunk-YESHGC3M.js → chunk-QKNO3JTG.js} +2 -2
- package/dist/bundle/{chunk-TYAFL66K.js → chunk-QUGESVOE.js} +15 -31
- package/dist/bundle/{chunk-DQHS336B.js → chunk-RQS3W4P6.js} +7 -6
- package/dist/bundle/{chunk-XHVFX74L.js → chunk-SFPUSEOT.js} +2 -2
- package/dist/bundle/{chunk-YGKM2ZWF.js → chunk-SP5OMHOO.js} +3 -3
- package/dist/bundle/chunk-STNZQBY4.js +335 -0
- package/dist/bundle/{chunk-RJK5ADMH.js → chunk-SVJQRG5N.js} +16 -16
- package/dist/bundle/{chunk-B7ZREOBD.js → chunk-SY5NGYKA.js} +12 -12
- package/dist/bundle/{chunk-GB5LI5RM.js → chunk-T4CI3YXW.js} +6 -6
- package/dist/bundle/{chunk-ELW3LMJZ.js → chunk-T6RSYDFA.js} +342 -154
- package/dist/bundle/{chunk-ZETM63M6.js → chunk-TY4FFK2P.js} +6 -6
- package/dist/bundle/chunk-UGRGYLEI.js +224 -0
- package/dist/bundle/{chunk-4ERYXY4Y.js → chunk-VGERRRDC.js} +1 -1
- package/dist/bundle/{chunk-XRH2NKW4.js → chunk-VJ2TLU7R.js} +6 -6
- package/dist/bundle/{chunk-2HKUQ7DR.js → chunk-W7UCN7MF.js} +3 -3
- package/dist/bundle/{chunk-IVFNHIU4.js → chunk-WD5OL5JB.js} +81 -5
- package/dist/bundle/{chunk-CE5Y7PQU.js → chunk-XC3MWABM.js} +4 -4
- package/dist/bundle/{chunk-ZFYNJERV.js → chunk-XCA5N63N.js} +6 -6
- package/dist/bundle/chunk-XVHDT4CO.js +31 -0
- package/dist/bundle/{chunk-65VRWNDP.js → chunk-YFN5A7OP.js} +4 -4
- package/dist/bundle/{chunk-VCFSUGPE.js → chunk-YJIGGUPI.js} +4 -4
- package/dist/bundle/{chunk-RXUVXAMM.js → chunk-YVI5SQPY.js} +1 -1
- package/dist/bundle/{chunk-FBVJGJDM.js → chunk-ZRNNMBPC.js} +27 -574
- package/dist/bundle/{chunk-VJANMYEC.js → chunk-ZUMKZOHR.js} +3 -3
- package/dist/bundle/{chunk-35AH33VJ.js → chunk-ZZ32DXTH.js} +1 -1
- package/dist/bundle/{cli-FHMLYHUZ.js → cli-Y27PHKBV.js} +101 -84
- package/dist/bundle/command-contract-GB7YA3KW.js +45 -0
- package/dist/bundle/{command-server-entry-YEZM52R5.js → command-server-entry-AXQSW2X6.js} +35 -31
- package/dist/bundle/config-2OOABHR7.js +108 -0
- package/dist/bundle/{decode-SIYRMJOK.js → decode-ZRNOOTUZ.js} +16 -8
- package/dist/bundle/{dispatch-SMER3WDX.js → dispatch-2GHGPAYH.js} +9 -9
- package/dist/bundle/{dist-BSJETSFE.js → dist-MUFVAMKB.js} +25 -22
- package/dist/bundle/{echarts-UZJ6AREV.js → echarts-F4PHDYET.js} +2 -2
- package/dist/bundle/{embed-A7DSHVI7.js → embed-KWHCKPCV.js} +7 -7
- package/dist/bundle/{embedder-WQBR4UGS.js → embedder-U3R3RY54.js} +10 -10
- package/dist/bundle/{failure-73UQXQTW.js → failure-S2YXEN4A.js} +3 -3
- package/dist/bundle/first-run-F4YR2E2C.js +29 -0
- package/dist/bundle/first-screen-HPRHD3VK.js +43 -0
- package/dist/bundle/{folders-BH4SV6SI.js → folders-DVTRFQKW.js} +5 -5
- package/dist/bundle/{instructions-SDDUBGH4.js → instructions-JU4YW6QY.js} +1 -1
- package/dist/bundle/{main-KL4FN5F3.js → main-5UCRPACH.js} +24 -24
- package/dist/bundle/{mcp-GN4FTJX5.js → mcp-O6ACR2DX.js} +2 -2
- package/dist/bundle/meeting-combined-IWU5SPAH.js +26 -0
- package/dist/bundle/meeting-model-ILIUJECZ.js +26 -0
- package/dist/bundle/meeting-semantic-5DKRGZFS.js +23 -0
- package/dist/bundle/{meetings-URPXBHV7.js → meetings-T2UY35DV.js} +25 -7
- package/dist/bundle/{node-ELCNUOCE.js → node-MAVRAF4M.js} +2 -2
- package/dist/bundle/{node-sqlite-QLSNHZBM.js → node-sqlite-TFBQ5NDI.js} +8 -8
- package/dist/bundle/{oauth-LZ64S7Y3.js → oauth-7IG5HWSY.js} +8 -8
- package/dist/bundle/{open-WB4HUPQT.js → open-3R3N7L3X.js} +6 -6
- package/dist/bundle/openai-DD5I3DWC.js +28 -0
- package/dist/bundle/{output-file-AHPQA5LR.js → output-file-KKHHAYWF.js} +6 -6
- package/dist/bundle/{process-67DAKAAQ.js → process-OIO254NR.js} +1 -1
- package/dist/bundle/{program-CIMACIBE.js → program-IBYRU76H.js} +423 -251
- package/dist/bundle/{prompt-GG53UBDJ.js → prompt-LNEOO7PN.js} +6 -6
- package/dist/bundle/{recognize-CFJ3CAEH.js → recognize-2WYLT3PC.js} +5 -5
- package/dist/bundle/{remote-BLEM7C3Q.js → remote-7EAJEIV7.js} +11 -11
- package/dist/bundle/{rerank-ERN6PC66.js → rerank-DZBZ744F.js} +8 -8
- package/dist/bundle/run-log-CCIVRSHP.js +135 -0
- package/dist/bundle/{serve-FJPPTJXH.js → serve-T3KQV5SS.js} +15 -15
- package/dist/bundle/{server-FLUSDUGM.js → server-2QQAQZ2J.js} +59 -49
- package/dist/bundle/server-OJQMPF2R.js +84 -0
- package/dist/bundle/{services-LXC6DVUQ.js → services-DETAKMC3.js} +78 -54
- package/dist/bundle/{speech-WFEZTKXA.js → speech-HD57JNTK.js} +34 -18
- package/dist/bundle/{sqlite-runtime-KN33VSP7.js → sqlite-runtime-OCETZSEZ.js} +7 -7
- package/dist/bundle/{state-TXS4ZHIT.js → state-ZKVQ4DBI.js} +7 -7
- package/dist/bundle/{store-ZUREZYZB.js → store-7IZ2WMHF.js} +24 -20
- package/dist/bundle/{store-MUOXLVL4.js → store-GEAQ7V5R.js} +26 -22
- package/dist/bundle/store-connection-BALCZW7P.js +101 -0
- package/dist/bundle/store-maintenance-command-SBT4LDSI.js +76 -0
- package/dist/bundle/{streaming-ZSCHRC5S.js → streaming-CLBAO3MG.js} +7 -7
- package/dist/bundle/{tokens-YVDOY4EV.js → tokens-WH73ZWFI.js} +10 -10
- package/dist/bundle/zm.js +9 -9
- package/dist/bundle/{zoom-app-O6GIMB7Y.js → zoom-app-ZDTYMJET.js} +8 -8
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +3 -0
- package/dist/commands.js.map +1 -1
- package/dist/first-screen.d.ts.map +1 -1
- package/dist/first-screen.js +3 -5
- package/dist/first-screen.js.map +1 -1
- package/dist/meeting-integration-commands.d.ts.map +1 -1
- package/dist/meeting-integration-commands.js +46 -28
- package/dist/meeting-integration-commands.js.map +1 -1
- package/dist/meeting-source.d.ts.map +1 -1
- package/dist/meeting-source.js +15 -1
- package/dist/meeting-source.js.map +1 -1
- package/dist/permissions.d.ts +8 -4
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +25 -24
- package/dist/permissions.js.map +1 -1
- package/dist/program-bindings.d.ts.map +1 -1
- package/dist/program-bindings.js +8 -5
- package/dist/program-bindings.js.map +1 -1
- package/dist/program.d.ts +2 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js.map +1 -1
- package/dist/remote-meetings.d.ts +38 -8
- package/dist/remote-meetings.d.ts.map +1 -1
- package/dist/remote-meetings.js +52 -29
- package/dist/remote-meetings.js.map +1 -1
- package/dist/run.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/zoom-app.d.ts.map +1 -1
- package/dist/zoom-app.js +1 -0
- package/dist/zoom-app.js.map +1 -1
- package/package.json +3 -3
- package/skills/zoom-cli/SKILL.md +2 -2
- package/dist/bundle/answer-policy-ETAELI4A.js +0 -110
- package/dist/bundle/chunk-64N7MY3I.js +0 -161
- package/dist/bundle/command-contract-HUZ4I23S.js +0 -41
- package/dist/bundle/config-KVTWN7QZ.js +0 -97
- package/dist/bundle/first-run-SY6XSUZ3.js +0 -29
- package/dist/bundle/first-screen-ZDMODGWS.js +0 -39
- package/dist/bundle/openai-KN6JE4QU.js +0 -28
- package/dist/bundle/run-log-S67YPJF6.js +0 -124
- package/dist/bundle/server-UNJY3TSJ.js +0 -74
- package/dist/bundle/store-connection-NRNEBUPU.js +0 -90
- package/dist/bundle/store-maintenance-command-OBOPYFZ5.js +0 -65
- /package/dist/bundle/{chunk-BDCC2J2Z.js → chunk-VKE77B3F.js} +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/cli/command-server-argv.js
|
|
8
8
|
var COMMAND_SERVER_ARGV = ["commands", "--serve"];
|
|
9
9
|
var isCommandServer = /* @__PURE__ */ __name((args) => args.length === COMMAND_SERVER_ARGV.length && COMMAND_SERVER_ARGV.every((word, at) => args[at] === word), "isCommandServer");
|
|
10
10
|
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
withTimeLimit
|
|
5
|
+
} from "./chunk-6YCFDDRO.js";
|
|
6
|
+
import {
|
|
7
|
+
EmptyAnswer,
|
|
8
|
+
checkedOptions,
|
|
9
|
+
messagesFor,
|
|
10
|
+
range,
|
|
11
|
+
systemFor,
|
|
12
|
+
validateImages
|
|
13
|
+
} from "./chunk-YFN5A7OP.js";
|
|
14
|
+
import {
|
|
15
|
+
refuseOffComputer
|
|
16
|
+
} from "./chunk-QE4L2QQZ.js";
|
|
17
|
+
import {
|
|
18
|
+
envName
|
|
19
|
+
} from "./chunk-GHBDYYPO.js";
|
|
20
|
+
import {
|
|
21
|
+
PLAIN_HTTP_REFUSED,
|
|
22
|
+
endpoint,
|
|
23
|
+
endpointFetch,
|
|
24
|
+
modelAddressAllowed,
|
|
25
|
+
onThisComputer
|
|
26
|
+
} from "./chunk-SP5OMHOO.js";
|
|
27
|
+
import {
|
|
28
|
+
Credentials,
|
|
29
|
+
pathsAreOverridden,
|
|
30
|
+
resolvePaths
|
|
31
|
+
} from "./chunk-QAGECFHL.js";
|
|
32
|
+
import {
|
|
33
|
+
array,
|
|
34
|
+
integer,
|
|
35
|
+
number,
|
|
36
|
+
optional,
|
|
37
|
+
picklist,
|
|
38
|
+
pipe,
|
|
39
|
+
strictObject,
|
|
40
|
+
string,
|
|
41
|
+
union
|
|
42
|
+
} from "./chunk-FS5HPXQN.js";
|
|
43
|
+
import {
|
|
44
|
+
CliError
|
|
45
|
+
} from "./chunk-4QNW4NK6.js";
|
|
46
|
+
import {
|
|
47
|
+
__name
|
|
48
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
49
|
+
|
|
50
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/models/openai.js
|
|
51
|
+
var options = strictObject({
|
|
52
|
+
temperature: range(0, 2),
|
|
53
|
+
top_p: range(0, 1),
|
|
54
|
+
presence_penalty: range(-2, 2),
|
|
55
|
+
frequency_penalty: range(-2, 2),
|
|
56
|
+
seed: optional(pipe(number(), integer())),
|
|
57
|
+
stop: optional(union([string(), array(string())])),
|
|
58
|
+
response_format: optional(strictObject({ type: picklist(["text", "json_object"]) }))
|
|
59
|
+
});
|
|
60
|
+
var openai = {
|
|
61
|
+
images: true,
|
|
62
|
+
baseUrl: "https://api.openai.com/v1",
|
|
63
|
+
validate: /* @__PURE__ */ __name((given) => checkedOptions("openai", options, given), "validate"),
|
|
64
|
+
complete: /* @__PURE__ */ __name((target, request, checked, apiKey, fetcher) => withTimeLimit(12e4, async (deadline) => {
|
|
65
|
+
const response = await fetcher(`${target.baseUrl.replace(/\/+$/, "")}/chat/completions`, {
|
|
66
|
+
method: "POST",
|
|
67
|
+
headers: { "Content-Type": "application/json", ...apiKey ? { Authorization: `Bearer ${apiKey}` } : {} },
|
|
68
|
+
body: JSON.stringify({
|
|
69
|
+
...checked,
|
|
70
|
+
model: target.model,
|
|
71
|
+
messages: [
|
|
72
|
+
{ role: "system", content: systemFor(request) },
|
|
73
|
+
...messagesFor(request),
|
|
74
|
+
...request.images === void 0 ? [] : [
|
|
75
|
+
{
|
|
76
|
+
role: "user",
|
|
77
|
+
content: [
|
|
78
|
+
{ type: "text", text: request.prompt },
|
|
79
|
+
...request.images.map((image) => ({
|
|
80
|
+
type: "image_url",
|
|
81
|
+
image_url: { url: `data:${image.mimeType};base64,${image.data}`, detail: "high" }
|
|
82
|
+
}))
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
],
|
|
87
|
+
...new URL(target.baseUrl).hostname === "api.openai.com" ? { max_completion_tokens: request.maxTokens } : { max_tokens: request.maxTokens }
|
|
88
|
+
}),
|
|
89
|
+
signal: deadline,
|
|
90
|
+
redirect: "error"
|
|
91
|
+
});
|
|
92
|
+
if (!response.ok)
|
|
93
|
+
throw new Error("provider rejected request");
|
|
94
|
+
const body = await response.json();
|
|
95
|
+
const choice = body.choices?.[0];
|
|
96
|
+
const content = choice?.message?.content;
|
|
97
|
+
const total = body.usage?.total_tokens;
|
|
98
|
+
const counted = Number.isInteger(total) && (total ?? 0) >= 1;
|
|
99
|
+
const local = onThisComputer(target.baseUrl);
|
|
100
|
+
const finish = choice?.finish_reason ?? null;
|
|
101
|
+
if (finish !== "stop" && !(local && finish === null))
|
|
102
|
+
throw new Error("incomplete response");
|
|
103
|
+
if (typeof content !== "string" || content.trim() === "")
|
|
104
|
+
throw new EmptyAnswer();
|
|
105
|
+
if (!counted && !local)
|
|
106
|
+
throw new Error("incomplete response");
|
|
107
|
+
const { prompt_tokens: input, completion_tokens: output } = body.usage ?? {};
|
|
108
|
+
return {
|
|
109
|
+
text: content,
|
|
110
|
+
// No count from a server on this computer costs nothing; a rough one keeps the gateway's check meaningful.
|
|
111
|
+
tokens: counted ? total : Math.max(1, Math.ceil(content.length / 4)),
|
|
112
|
+
...Number.isInteger(input) && Number.isInteger(output) ? { usage: { input, output } } : {}
|
|
113
|
+
};
|
|
114
|
+
}), "complete")
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/models/index.js
|
|
118
|
+
var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
119
|
+
complete: /* @__PURE__ */ __name(async (request) => {
|
|
120
|
+
if (deps.signal?.aborted)
|
|
121
|
+
throw new CliError("cancelled", "model request cancelled");
|
|
122
|
+
const target = deps.resolve(request.purpose);
|
|
123
|
+
if (!target || target.provider === "off")
|
|
124
|
+
throw new CliError("configuration_error", `models.${request.purpose}.provider is not configured; no model was called`);
|
|
125
|
+
if (!request.purpose || !Number.isSafeInteger(request.maxTokens) || request.maxTokens < 1 || typeof request.prompt !== "string")
|
|
126
|
+
throw new CliError("validation_error", "a model request needs a purpose, prompt and positive whole maxTokens");
|
|
127
|
+
validateImages(request.images);
|
|
128
|
+
let adapter = deps.adapters?.[target.provider];
|
|
129
|
+
if (!adapter && target.provider === "openai")
|
|
130
|
+
adapter = openai;
|
|
131
|
+
if (!adapter && target.provider === "anthropic")
|
|
132
|
+
adapter = (await import("./anthropic-TGJOKLUS.js")).anthropic;
|
|
133
|
+
if (!adapter)
|
|
134
|
+
throw new CliError("validation_error", `no model adapter for ${target.provider}`);
|
|
135
|
+
if (request.images !== void 0 && adapter.images !== true)
|
|
136
|
+
throw new CliError("validation_error", "the model adapter does not support image inputs");
|
|
137
|
+
const options2 = adapter.validate(request.options ?? {});
|
|
138
|
+
const baseUrl = target.baseUrl ?? adapter.baseUrl;
|
|
139
|
+
if (!target.model.trim() || !endpoint(baseUrl))
|
|
140
|
+
throw new CliError("validation_error", "a model target needs a model and an HTTP/S endpoint without credentials, query or fragment");
|
|
141
|
+
if (!modelAddressAllowed(baseUrl))
|
|
142
|
+
throw new CliError("validation_error", `${PLAIN_HTTP_REFUSED}; no data was sent`, {
|
|
143
|
+
reason: "model.address-refused"
|
|
144
|
+
});
|
|
145
|
+
refuseOffComputer(deps.env ?? process.env, baseUrl, `${request.purpose} data`);
|
|
146
|
+
if (!await deps.consent(request, { ...target, baseUrl }))
|
|
147
|
+
throw new CliError("permission_error", `model consent for ${request.purpose} is missing; no data was sent`);
|
|
148
|
+
const apiKey = await deps.key?.(target.provider, target);
|
|
149
|
+
if (deps.signal?.aborted)
|
|
150
|
+
throw new CliError("cancelled", "model request cancelled");
|
|
151
|
+
const fetcher = deps.fetch ?? endpointFetch(baseUrl, 12e4);
|
|
152
|
+
let limited = false;
|
|
153
|
+
let unreachable = false;
|
|
154
|
+
let refused = false;
|
|
155
|
+
let status;
|
|
156
|
+
const cancellable = /* @__PURE__ */ __name(async (input, init) => {
|
|
157
|
+
const signal = init?.signal ?? (input instanceof Request ? input.signal : void 0);
|
|
158
|
+
let response;
|
|
159
|
+
try {
|
|
160
|
+
response = await fetcher(input, {
|
|
161
|
+
...init,
|
|
162
|
+
signal: deps.signal ? AbortSignal.any([deps.signal, ...signal ? [signal] : []]) : signal
|
|
163
|
+
});
|
|
164
|
+
} catch (error) {
|
|
165
|
+
unreachable = true;
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
if (!response.ok)
|
|
169
|
+
status = response.status;
|
|
170
|
+
if (response.status === 429)
|
|
171
|
+
limited = true;
|
|
172
|
+
if (response.status === 401 || response.status === 403)
|
|
173
|
+
refused = true;
|
|
174
|
+
return response;
|
|
175
|
+
}, "cancellable");
|
|
176
|
+
try {
|
|
177
|
+
const answer = await adapter.complete({ ...target, baseUrl }, request, options2, apiKey, cancellable);
|
|
178
|
+
if (deps.signal?.aborted)
|
|
179
|
+
throw new Error("cancelled");
|
|
180
|
+
if (typeof answer.text !== "string" || !Number.isSafeInteger(answer.tokens) || answer.tokens < 1)
|
|
181
|
+
throw new Error("incomplete");
|
|
182
|
+
return { ...answer, provider: target.provider, model: target.model };
|
|
183
|
+
} catch (error) {
|
|
184
|
+
if (limited)
|
|
185
|
+
throw new CliError("rate_limited", `${request.purpose} provider rate limit reached; no result was stored`);
|
|
186
|
+
const reason = refused ? "model.key-rejected" : unreachable && !deps.signal?.aborted ? "model.unreachable" : error instanceof EmptyAnswer ? "model.empty-answer" : void 0;
|
|
187
|
+
throw new CliError("invalid_response", `${request.purpose} provider failed or returned an incomplete response; no result was stored`, reason === void 0 && status === void 0 ? void 0 : { ...reason === void 0 ? {} : { reason }, ...status === void 0 ? {} : { status } });
|
|
188
|
+
}
|
|
189
|
+
}, "complete")
|
|
190
|
+
}), "modelGateway");
|
|
191
|
+
|
|
192
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
|
|
193
|
+
var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
|
|
194
|
+
const host = new URL(baseUrl).host;
|
|
195
|
+
return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
|
|
196
|
+
}, "endpointKeyName");
|
|
197
|
+
var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) => {
|
|
198
|
+
const where = { appName: app.appName, prefix: app.envPrefix, env };
|
|
199
|
+
const credentials = /* @__PURE__ */ __name((provider) => new Credentials({
|
|
200
|
+
configDir: resolvePaths(where).config,
|
|
201
|
+
service: app.appName,
|
|
202
|
+
...["openai", "anthropic"].includes(provider) ? { envVar: envName(app, `${provider.toUpperCase()}_API_KEY`) } : {},
|
|
203
|
+
isolated: pathsAreOverridden(where),
|
|
204
|
+
env,
|
|
205
|
+
...keyring ? { keyring } : {},
|
|
206
|
+
warn: /* @__PURE__ */ __name((message) => process.stderr.write(`${message}
|
|
207
|
+
`), "warn")
|
|
208
|
+
}), "credentials");
|
|
209
|
+
const account = /* @__PURE__ */ __name((provider) => `embeddings:${provider}`, "account");
|
|
210
|
+
return {
|
|
211
|
+
read: /* @__PURE__ */ __name((provider) => {
|
|
212
|
+
const stored = credentials(provider).read(account(provider));
|
|
213
|
+
if (stored)
|
|
214
|
+
return { key: stored.secret, source: stored.source };
|
|
215
|
+
const shared = ["openai", "anthropic"].includes(provider) ? env[`${provider.toUpperCase()}_API_KEY`]?.trim() : void 0;
|
|
216
|
+
return shared ? { key: shared, source: "env" } : void 0;
|
|
217
|
+
}, "read"),
|
|
218
|
+
/** A key kept under the provider's own name, as an owner may have stored it by hand for the whole tool. */
|
|
219
|
+
readPlain: /* @__PURE__ */ __name((provider) => credentials(provider).read(provider)?.secret, "readPlain"),
|
|
220
|
+
write: /* @__PURE__ */ __name((provider, key) => credentials(provider).write(account(provider), key, { signIn: true }), "write"),
|
|
221
|
+
remove: /* @__PURE__ */ __name((provider) => credentials(provider).remove(account(provider)), "remove")
|
|
222
|
+
};
|
|
223
|
+
}, "embeddingKeys");
|
|
224
|
+
|
|
225
|
+
export {
|
|
226
|
+
modelGateway,
|
|
227
|
+
endpointKeyName,
|
|
228
|
+
embeddingKeys
|
|
229
|
+
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/store/normalize.js
|
|
8
8
|
var NORMALIZER_VERSION = 1;
|
|
9
9
|
var fold = /* @__PURE__ */ __name((text) => text.normalize("NFKD").replace(new RegExp("\\p{M}+", "gu"), "").normalize("NFC").toLowerCase(), "fold");
|
|
10
10
|
var normalize = /* @__PURE__ */ __name((text) => fold(text).replace(new RegExp("\\p{Cc}", "gu"), " ").replace(/\s+/gu, " ").trim(), "normalize");
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/cli/stdin-field.js
|
|
8
8
|
var fields = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
var readsStdin = /* @__PURE__ */ __name((command, field) => {
|
|
10
10
|
fields.set(command, field);
|
|
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
LEVELS
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2QDD6S2R.js";
|
|
6
6
|
import {
|
|
7
7
|
WORD_BODY,
|
|
8
8
|
e164Of
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Q7ZW7XAX.js";
|
|
10
10
|
import {
|
|
11
11
|
resolvePaths,
|
|
12
12
|
writeSecurely
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QAGECFHL.js";
|
|
14
14
|
import {
|
|
15
15
|
array,
|
|
16
16
|
getDotPath,
|
|
@@ -29,18 +29,18 @@ import {
|
|
|
29
29
|
string,
|
|
30
30
|
transform,
|
|
31
31
|
unknown
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-FS5HPXQN.js";
|
|
33
33
|
import {
|
|
34
34
|
CliError
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-4QNW4NK6.js";
|
|
36
36
|
import {
|
|
37
37
|
visibleControls
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-KYKW2W6X.js";
|
|
39
39
|
import {
|
|
40
40
|
__name
|
|
41
41
|
} from "./chunk-ZVVMGPBJ.js";
|
|
42
42
|
|
|
43
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/domain/vcard.js
|
|
44
44
|
import { createHash } from "node:crypto";
|
|
45
45
|
var MAX_ID = 512;
|
|
46
46
|
var AS_WORD = new RegExp(`^${WORD_BODY}$`);
|
|
@@ -271,7 +271,7 @@ var envelopeOfVcard = /* @__PURE__ */ __name((text, { provider, account, batchId
|
|
|
271
271
|
};
|
|
272
272
|
}, "envelopeOfVcard");
|
|
273
273
|
|
|
274
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
274
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/domain/formatting.js
|
|
275
275
|
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "the messenger formatter returned invalid text spans"), "invalid");
|
|
276
276
|
var validateFormattedText = /* @__PURE__ */ __name((formatted) => {
|
|
277
277
|
const { text, spans } = formatted;
|
|
@@ -331,7 +331,7 @@ var visibleFormattedText = /* @__PURE__ */ __name((formatted) => {
|
|
|
331
331
|
};
|
|
332
332
|
}, "visibleFormattedText");
|
|
333
333
|
|
|
334
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
334
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/moderation/check.js
|
|
335
335
|
var INVITE = /max\.ru\/join\/|(t|telegram)\.me\/(\+|joinchat\/)|tg:\/\/join/i;
|
|
336
336
|
var LINK = /https?:\/\/\S+/i;
|
|
337
337
|
var STRENGTH = { report: 0, delete: 1, remove: 2 };
|
|
@@ -519,7 +519,7 @@ var nextPoint = /* @__PURE__ */ __name((rows, found) => {
|
|
|
519
519
|
}, "nextPoint");
|
|
520
520
|
var someUndone = /* @__PURE__ */ __name((rows) => rows.some(undone), "someUndone");
|
|
521
521
|
|
|
522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/moderation/rules.js
|
|
523
523
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
524
524
|
import { join } from "node:path";
|
|
525
525
|
var RULE_ACTIONS = ["report", "delete", "remove"];
|
|
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
CliError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4QNW4NK6.js";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-ZVVMGPBJ.js";
|
|
9
9
|
|
|
10
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.667.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_0b2555be96e01c2163d7c05aae2e84c1/node_modules/@wirecat/cli-core/dist/cli/input-policy.js
|
|
11
11
|
var MAX_BUFFERED_INPUT = 16 * 1024 * 1024;
|
|
12
12
|
var MAX_SECRET_INPUT = 64 * 1024;
|
|
13
13
|
var policies = /* @__PURE__ */ new WeakMap();
|