@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
|
@@ -0,0 +1,555 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
createRecordLog,
|
|
5
|
+
resolvePaths,
|
|
6
|
+
traceIdOf,
|
|
7
|
+
writeSecurely
|
|
8
|
+
} from "./chunk-QAGECFHL.js";
|
|
9
|
+
import {
|
|
10
|
+
__name
|
|
11
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
12
|
+
|
|
13
|
+
// 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/runs/run.js
|
|
14
|
+
import { randomUUID } from "node:crypto";
|
|
15
|
+
import { appendFileSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
16
|
+
import { userInfo } from "node:os";
|
|
17
|
+
import { join, sep } from "node:path";
|
|
18
|
+
|
|
19
|
+
// 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/runs/log-keys.js
|
|
20
|
+
var snake = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
|
|
21
|
+
var camel = /* @__PURE__ */ __name((key) => key.replace(/_([a-z0-9])/g, (_, letter) => letter.toUpperCase()), "camel");
|
|
22
|
+
var renamed = /* @__PURE__ */ __name((record, name) => Object.fromEntries(Object.entries(record).map(([key, value]) => [name(key), value])), "renamed");
|
|
23
|
+
var logAttributes = /* @__PURE__ */ __name((event) => renamed(event, snake), "logAttributes");
|
|
24
|
+
var fromLogAttributes = /* @__PURE__ */ __name((attributes) => renamed(attributes, camel), "fromLogAttributes");
|
|
25
|
+
var snakeLogger = /* @__PURE__ */ __name((logger) => ({
|
|
26
|
+
debug: /* @__PURE__ */ __name((event, message) => logger.debug(logAttributes(event), message), "debug"),
|
|
27
|
+
info: /* @__PURE__ */ __name((event, message) => logger.info(logAttributes(event), message), "info"),
|
|
28
|
+
warn: /* @__PURE__ */ __name((event, message) => logger.warn(logAttributes(event), message), "warn"),
|
|
29
|
+
error: /* @__PURE__ */ __name((event, message) => logger.error(logAttributes(event), message), "error")
|
|
30
|
+
}), "snakeLogger");
|
|
31
|
+
|
|
32
|
+
// 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/runs/log-attributes.js
|
|
33
|
+
var diagnostic = {
|
|
34
|
+
event: true,
|
|
35
|
+
operation: true,
|
|
36
|
+
opcode: true,
|
|
37
|
+
seq: true,
|
|
38
|
+
status: true,
|
|
39
|
+
method: true,
|
|
40
|
+
endpointTemplate: true,
|
|
41
|
+
bytes: true,
|
|
42
|
+
ids: true,
|
|
43
|
+
counts: true,
|
|
44
|
+
durationMs: true,
|
|
45
|
+
outcome: true,
|
|
46
|
+
errorCode: true,
|
|
47
|
+
providerError: true,
|
|
48
|
+
level: true,
|
|
49
|
+
transport: true,
|
|
50
|
+
attempt: true,
|
|
51
|
+
waitMs: true,
|
|
52
|
+
code: true,
|
|
53
|
+
detail: true,
|
|
54
|
+
reason: true,
|
|
55
|
+
ageMs: true,
|
|
56
|
+
kind: true,
|
|
57
|
+
table: true,
|
|
58
|
+
op: true,
|
|
59
|
+
n: true
|
|
60
|
+
};
|
|
61
|
+
var send = {
|
|
62
|
+
profile: true,
|
|
63
|
+
chatId: true,
|
|
64
|
+
outcome: true,
|
|
65
|
+
kind: true,
|
|
66
|
+
action: true,
|
|
67
|
+
people: true,
|
|
68
|
+
messageId: true,
|
|
69
|
+
key: true,
|
|
70
|
+
count: true,
|
|
71
|
+
forEveryone: true,
|
|
72
|
+
sendId: true,
|
|
73
|
+
operationId: true,
|
|
74
|
+
parentOperationId: true,
|
|
75
|
+
replyTo: true,
|
|
76
|
+
threadId: true,
|
|
77
|
+
sendAs: true,
|
|
78
|
+
resultChatId: true,
|
|
79
|
+
length: true,
|
|
80
|
+
attachments: true,
|
|
81
|
+
scheduledFor: true,
|
|
82
|
+
notify: true,
|
|
83
|
+
origin: true,
|
|
84
|
+
reservation: true,
|
|
85
|
+
errorCode: true
|
|
86
|
+
};
|
|
87
|
+
var background = [
|
|
88
|
+
"job",
|
|
89
|
+
"pid",
|
|
90
|
+
"schedule",
|
|
91
|
+
"exitCode",
|
|
92
|
+
"tool",
|
|
93
|
+
"tier",
|
|
94
|
+
"actorType",
|
|
95
|
+
"actorId",
|
|
96
|
+
"agent",
|
|
97
|
+
"targetType",
|
|
98
|
+
"targetId"
|
|
99
|
+
];
|
|
100
|
+
var crash = ["errorClass", "frames"];
|
|
101
|
+
var dropped = ["dropped"];
|
|
102
|
+
var LOG_ATTRIBUTES = [
|
|
103
|
+
...new Set([...Object.keys(diagnostic), ...Object.keys(send), ...background, ...crash, ...dropped].map((key) => Object.keys(logAttributes({ [key]: true }))[0]))
|
|
104
|
+
].sort();
|
|
105
|
+
|
|
106
|
+
// 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/runs/run.js
|
|
107
|
+
var KEEP_RUNS_FOR_DAYS = 30;
|
|
108
|
+
var KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7;
|
|
109
|
+
var KEEP_STORE_RUNS_FOR_DAYS = 3;
|
|
110
|
+
var RUNS_SIZE_LIMIT_MB = 200;
|
|
111
|
+
var runsDirFor = /* @__PURE__ */ __name((app, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "runs"), "runsDirFor");
|
|
112
|
+
var startRun = /* @__PURE__ */ __name((options) => {
|
|
113
|
+
const now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
114
|
+
const startedAt = options.startedAt ?? now();
|
|
115
|
+
const id = options.runId ?? newRunId(startedAt, options.command);
|
|
116
|
+
const dir = join(options.runsDir, day(startedAt), id);
|
|
117
|
+
pruneRuns(options.runsDir, {
|
|
118
|
+
keepDays: options.keepDays ?? KEEP_RUNS_FOR_DAYS,
|
|
119
|
+
keepSuccessDays: options.keepSuccessDays ?? KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
|
|
120
|
+
keepStoreDays: options.keepStoreDays ?? KEEP_STORE_RUNS_FOR_DAYS,
|
|
121
|
+
maxBytes: options.maxBytes ?? RUNS_SIZE_LIMIT_MB * 1024 * 1024,
|
|
122
|
+
now: startedAt
|
|
123
|
+
});
|
|
124
|
+
refuseRealStateInTests(dir);
|
|
125
|
+
const metadata = {
|
|
126
|
+
runId: id,
|
|
127
|
+
command: options.command,
|
|
128
|
+
...options.profile === void 0 ? {} : { profile: options.profile },
|
|
129
|
+
startedAt: startedAt.toISOString(),
|
|
130
|
+
status: "running",
|
|
131
|
+
cliVersion: options.cliVersion,
|
|
132
|
+
runtime: runtime(),
|
|
133
|
+
platform: process.platform,
|
|
134
|
+
arch: process.arch,
|
|
135
|
+
...options.traceId === void 0 ? {} : { traceId: options.traceId },
|
|
136
|
+
...options.context
|
|
137
|
+
};
|
|
138
|
+
let file;
|
|
139
|
+
const opened = /* @__PURE__ */ __name(() => {
|
|
140
|
+
if (file)
|
|
141
|
+
return file;
|
|
142
|
+
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
143
|
+
const events = join(dir, "events.jsonl");
|
|
144
|
+
writeFileSync(events, "", { flag: "a", mode: 384 });
|
|
145
|
+
file = snakeLogger(createRecordLog({
|
|
146
|
+
to: events,
|
|
147
|
+
runId: id,
|
|
148
|
+
command: options.command,
|
|
149
|
+
resource: { service: options.service, version: options.cliVersion },
|
|
150
|
+
allow: LOG_ATTRIBUTES,
|
|
151
|
+
...options.traceId === void 0 ? {} : { traceId: options.traceId },
|
|
152
|
+
...options.onError === void 0 ? {} : { onError: options.onError }
|
|
153
|
+
}));
|
|
154
|
+
writeRunFile(dir, metadata);
|
|
155
|
+
return file;
|
|
156
|
+
}, "opened");
|
|
157
|
+
if (!options.lazy)
|
|
158
|
+
opened();
|
|
159
|
+
let finished = false;
|
|
160
|
+
const operations = /* @__PURE__ */ new Set();
|
|
161
|
+
const codes = /* @__PURE__ */ new Set();
|
|
162
|
+
const tables = /* @__PURE__ */ new Set();
|
|
163
|
+
const noted = /* @__PURE__ */ __name((level) => (event, message) => {
|
|
164
|
+
const { operation, errorCode, error_code, code, kind, table } = event;
|
|
165
|
+
if (typeof operation === "string")
|
|
166
|
+
operations.add(operation);
|
|
167
|
+
if (kind === "store" && typeof table === "string")
|
|
168
|
+
tables.add(table);
|
|
169
|
+
for (const value of [errorCode, error_code, code])
|
|
170
|
+
if (typeof value === "string")
|
|
171
|
+
codes.add(value);
|
|
172
|
+
if (finished)
|
|
173
|
+
return;
|
|
174
|
+
opened()[level](event, message);
|
|
175
|
+
}, "noted");
|
|
176
|
+
const logger = { debug: noted("debug"), info: noted("info"), warn: noted("warn"), error: noted("error") };
|
|
177
|
+
return {
|
|
178
|
+
id,
|
|
179
|
+
dir,
|
|
180
|
+
logger,
|
|
181
|
+
finish: /* @__PURE__ */ __name(async (status, extra = {}) => {
|
|
182
|
+
if (finished)
|
|
183
|
+
return;
|
|
184
|
+
finished = true;
|
|
185
|
+
const completedAt = now();
|
|
186
|
+
const final = {
|
|
187
|
+
...metadata,
|
|
188
|
+
...extra,
|
|
189
|
+
status,
|
|
190
|
+
completedAt: completedAt.toISOString(),
|
|
191
|
+
durationMs: completedAt.getTime() - startedAt.getTime(),
|
|
192
|
+
operations: [...operations].sort(),
|
|
193
|
+
codes: [...codes].sort(),
|
|
194
|
+
...tables.size > 0 ? { tables: [...tables].sort() } : {}
|
|
195
|
+
};
|
|
196
|
+
if (file || status !== "success") {
|
|
197
|
+
opened();
|
|
198
|
+
writeRunFile(dir, final);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
try {
|
|
202
|
+
mkdirSync(join(dir, ".."), { recursive: true, mode: 448 });
|
|
203
|
+
appendIndex(join(dir, ".."), runFileOf(final));
|
|
204
|
+
} catch (error) {
|
|
205
|
+
options.onError?.(error);
|
|
206
|
+
}
|
|
207
|
+
}, "finish")
|
|
208
|
+
};
|
|
209
|
+
}, "startRun");
|
|
210
|
+
var refuseRealStateInTests = /* @__PURE__ */ __name((dir, env = process.env) => {
|
|
211
|
+
if (env.VITEST === void 0)
|
|
212
|
+
return;
|
|
213
|
+
let home;
|
|
214
|
+
try {
|
|
215
|
+
home = userInfo().homedir;
|
|
216
|
+
} catch {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (dir.startsWith(join(home, ".local", "share") + sep))
|
|
220
|
+
throw new Error(`a test opened a run in the real data folder: ${dir}`);
|
|
221
|
+
}, "refuseRealStateInTests");
|
|
222
|
+
var runtime = /* @__PURE__ */ __name(() => {
|
|
223
|
+
const bun = process.versions.bun;
|
|
224
|
+
return bun ? `bun ${bun}` : `node ${process.versions.node}`;
|
|
225
|
+
}, "runtime");
|
|
226
|
+
var newRunId = /* @__PURE__ */ __name((startedAt, command) => {
|
|
227
|
+
const stamp = startedAt.toISOString().replace(/[-:]/g, "").replace(/\.\d+Z$/, "Z");
|
|
228
|
+
const slug = command.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
|
|
229
|
+
return `${stamp}-${slug}-${randomUUID().slice(0, 6)}`;
|
|
230
|
+
}, "newRunId");
|
|
231
|
+
var INDEX = "index.jsonl";
|
|
232
|
+
var appendIndex = /* @__PURE__ */ __name((dayDir, written) => {
|
|
233
|
+
appendFileSync(join(dayDir, INDEX), `${JSON.stringify(written)}
|
|
234
|
+
`, { mode: 384 });
|
|
235
|
+
}, "appendIndex");
|
|
236
|
+
var writeRunFile = /* @__PURE__ */ __name((dir, metadata) => {
|
|
237
|
+
const written = runFileOf(metadata);
|
|
238
|
+
writeSecurely(join(dir, "run.json"), `${JSON.stringify(written, null, 2)}
|
|
239
|
+
`, 384);
|
|
240
|
+
try {
|
|
241
|
+
appendIndex(join(dir, ".."), written);
|
|
242
|
+
} catch {
|
|
243
|
+
}
|
|
244
|
+
}, "writeRunFile");
|
|
245
|
+
var matchesListFilter = /* @__PURE__ */ __name((run, filter) => (filter.runId === void 0 || run.runId === filter.runId) && (filter.command === void 0 || run.command === filter.command) && (filter.profile === void 0 || run.profile === filter.profile) && (filter.status === void 0 || run.status === filter.status) && (filter.errorCode === void 0 || run.errorCode === filter.errorCode), "matchesListFilter");
|
|
246
|
+
var listRuns = /* @__PURE__ */ __name((runsDir, { since, atLeast = Number.POSITIVE_INFINITY, filter = {} } = {}) => {
|
|
247
|
+
const first = since === void 0 ? void 0 : day(new Date(since));
|
|
248
|
+
const runs = [];
|
|
249
|
+
for (const date of days(runsDir).sort().reverse()) {
|
|
250
|
+
if (first !== void 0 && date < first || runs.length >= atLeast)
|
|
251
|
+
break;
|
|
252
|
+
for (const metadata of runsOfDay(join(runsDir, date))) {
|
|
253
|
+
if (matchesListFilter(metadata, filter))
|
|
254
|
+
runs.push(metadata);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return runs;
|
|
258
|
+
}, "listRuns");
|
|
259
|
+
var indexedRuns = /* @__PURE__ */ __name((dayDir) => {
|
|
260
|
+
const latest = /* @__PURE__ */ new Map();
|
|
261
|
+
let raw = "";
|
|
262
|
+
try {
|
|
263
|
+
raw = readFileSync(join(dayDir, INDEX), "utf8");
|
|
264
|
+
} catch {
|
|
265
|
+
}
|
|
266
|
+
for (const line of raw.split("\n")) {
|
|
267
|
+
if (line.trim() === "")
|
|
268
|
+
continue;
|
|
269
|
+
try {
|
|
270
|
+
const metadata = metadataOf(JSON.parse(line));
|
|
271
|
+
if (typeof metadata.runId === "string")
|
|
272
|
+
latest.set(metadata.runId, metadata);
|
|
273
|
+
} catch {
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return latest;
|
|
277
|
+
}, "indexedRuns");
|
|
278
|
+
var runsOfDay = /* @__PURE__ */ __name((dayDir) => {
|
|
279
|
+
const latest = indexedRuns(dayDir);
|
|
280
|
+
for (const entry of safeReaddir(dayDir)) {
|
|
281
|
+
if (entry === INDEX || entry.startsWith(".") || latest.has(entry))
|
|
282
|
+
continue;
|
|
283
|
+
const metadata = readRun(join(dayDir, entry));
|
|
284
|
+
if (metadata)
|
|
285
|
+
latest.set(metadata.runId, metadata);
|
|
286
|
+
}
|
|
287
|
+
return [...latest.values()].sort((a, b) => a.runId < b.runId ? 1 : a.runId > b.runId ? -1 : 0);
|
|
288
|
+
}, "runsOfDay");
|
|
289
|
+
var findRun = /* @__PURE__ */ __name((runsDir, id) => {
|
|
290
|
+
const stamped = /^(\d{4})(\d{2})(\d{2})T/.exec(id);
|
|
291
|
+
const likely = stamped ? [`${stamped[1]}-${stamped[2]}-${stamped[3]}`] : [];
|
|
292
|
+
const dates = [.../* @__PURE__ */ new Set([...likely, ...days(runsDir)])];
|
|
293
|
+
for (const date of dates) {
|
|
294
|
+
const dir = join(runsDir, date, id);
|
|
295
|
+
const metadata = readRun(dir);
|
|
296
|
+
if (metadata)
|
|
297
|
+
return { dir, metadata };
|
|
298
|
+
}
|
|
299
|
+
for (const date of dates) {
|
|
300
|
+
const metadata = indexedRuns(join(runsDir, date)).get(id);
|
|
301
|
+
if (metadata)
|
|
302
|
+
return { dir: join(runsDir, date, id), metadata };
|
|
303
|
+
}
|
|
304
|
+
return void 0;
|
|
305
|
+
}, "findRun");
|
|
306
|
+
var readEvents = /* @__PURE__ */ __name((dir) => {
|
|
307
|
+
let raw;
|
|
308
|
+
try {
|
|
309
|
+
raw = readFileSync(join(dir, "events.jsonl"), "utf8");
|
|
310
|
+
} catch {
|
|
311
|
+
return [];
|
|
312
|
+
}
|
|
313
|
+
const events = [];
|
|
314
|
+
for (const line of raw.split("\n")) {
|
|
315
|
+
if (line.trim() === "")
|
|
316
|
+
continue;
|
|
317
|
+
try {
|
|
318
|
+
const parsed = JSON.parse(line);
|
|
319
|
+
if (parsed !== null && typeof parsed === "object")
|
|
320
|
+
events.push(eventOf(parsed));
|
|
321
|
+
} catch {
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return events;
|
|
325
|
+
}, "readEvents");
|
|
326
|
+
var eventOf = /* @__PURE__ */ __name((line) => {
|
|
327
|
+
const { attributes, time, severity } = line;
|
|
328
|
+
if (attributes === null || typeof attributes !== "object")
|
|
329
|
+
return logAttributes(line);
|
|
330
|
+
return { time, severity, ...logAttributes(attributes) };
|
|
331
|
+
}, "eventOf");
|
|
332
|
+
var pruneRuns = /* @__PURE__ */ __name((runsDir, { keepDays, keepSuccessDays = keepDays, keepStoreDays = KEEP_STORE_RUNS_FOR_DAYS, maxBytes, now }) => {
|
|
333
|
+
const cutoff = day(new Date(now.getTime() - keepDays * DAY_MS));
|
|
334
|
+
const before = /* @__PURE__ */ __name((days2) => day(new Date(now.getTime() - Math.min(days2, keepDays) * DAY_MS)), "before");
|
|
335
|
+
const successCutoff = before(keepSuccessDays);
|
|
336
|
+
const storeCutoff = before(keepStoreDays);
|
|
337
|
+
const keptFor = /* @__PURE__ */ __name((metadata) => metadata.keptBecauseStore ? keepStoreDays : metadata.operations?.includes(STORE_WRITE) ? Math.max(keepSuccessDays, keepStoreDays) : keepSuccessDays, "keptFor");
|
|
338
|
+
let removed = 0;
|
|
339
|
+
for (const date of days(runsDir)) {
|
|
340
|
+
if (date >= cutoff) {
|
|
341
|
+
if (date < storeCutoff)
|
|
342
|
+
dropSuccesses(join(runsDir, date), STORE_RUNS_DROPPED, (metadata) => keptFor(metadata) <= keepStoreDays);
|
|
343
|
+
if (date < successCutoff)
|
|
344
|
+
dropSuccesses(join(runsDir, date), SUCCESSES_DROPPED, (metadata) => keptFor(metadata) <= keepSuccessDays);
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
try {
|
|
348
|
+
rmSync(join(runsDir, date), { recursive: true, force: true });
|
|
349
|
+
removed += 1;
|
|
350
|
+
} catch {
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
if (maxBytes !== void 0)
|
|
354
|
+
removed += fitSize(runsDir, maxBytes, now);
|
|
355
|
+
return removed;
|
|
356
|
+
}, "pruneRuns");
|
|
357
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
358
|
+
var STORE_WRITE = "store.write";
|
|
359
|
+
var SUCCESSES_DROPPED = ".successes-dropped";
|
|
360
|
+
var STORE_RUNS_DROPPED = ".store-runs-dropped";
|
|
361
|
+
var SIZE_CHECKED = ".size-checked";
|
|
362
|
+
var dropSuccesses = /* @__PURE__ */ __name((dayDir, marker = SUCCESSES_DROPPED, drops = () => true) => {
|
|
363
|
+
const done = join(dayDir, marker);
|
|
364
|
+
try {
|
|
365
|
+
statSync(done);
|
|
366
|
+
return;
|
|
367
|
+
} catch {
|
|
368
|
+
}
|
|
369
|
+
const dropped2 = /* @__PURE__ */ __name((metadata) => metadata?.status === "success" && drops(metadata), "dropped");
|
|
370
|
+
try {
|
|
371
|
+
const kept = [];
|
|
372
|
+
for (const [id, metadata] of indexedRuns(dayDir)) {
|
|
373
|
+
if (dropped2(metadata))
|
|
374
|
+
rmSync(join(dayDir, id), { recursive: true, force: true });
|
|
375
|
+
else
|
|
376
|
+
kept.push(JSON.stringify(runFileOf(metadata)));
|
|
377
|
+
}
|
|
378
|
+
for (const entry of safeReaddir(dayDir)) {
|
|
379
|
+
if (entry === INDEX || entry.startsWith("."))
|
|
380
|
+
continue;
|
|
381
|
+
if (dropped2(readRun(join(dayDir, entry))))
|
|
382
|
+
rmSync(join(dayDir, entry), { recursive: true, force: true });
|
|
383
|
+
}
|
|
384
|
+
writeSecurely(join(dayDir, INDEX), kept.map((line) => `${line}
|
|
385
|
+
`).join(""), 384);
|
|
386
|
+
writeFileSync(done, "", { mode: 384 });
|
|
387
|
+
} catch {
|
|
388
|
+
}
|
|
389
|
+
}, "dropSuccesses");
|
|
390
|
+
var sizeOf = /* @__PURE__ */ __name((path) => {
|
|
391
|
+
let total = 0;
|
|
392
|
+
for (const entry of safeReaddir(path)) {
|
|
393
|
+
const full = join(path, entry);
|
|
394
|
+
try {
|
|
395
|
+
const stat = statSync(full);
|
|
396
|
+
total += stat.isDirectory() ? sizeOf(full) : stat.size;
|
|
397
|
+
} catch {
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
return total;
|
|
401
|
+
}, "sizeOf");
|
|
402
|
+
var fitSize = /* @__PURE__ */ __name((runsDir, maxBytes, now) => {
|
|
403
|
+
const stamp = join(runsDir, SIZE_CHECKED);
|
|
404
|
+
const today = day(now);
|
|
405
|
+
try {
|
|
406
|
+
if (readFileSync(stamp, "utf8").trim() === today)
|
|
407
|
+
return 0;
|
|
408
|
+
} catch {
|
|
409
|
+
}
|
|
410
|
+
const dates = days(runsDir).sort();
|
|
411
|
+
const sizes = new Map(dates.map((date) => [date, sizeOf(join(runsDir, date))]));
|
|
412
|
+
let total = [...sizes.values()].reduce((sum, size) => sum + size, 0);
|
|
413
|
+
let removed = 0;
|
|
414
|
+
for (const date of dates) {
|
|
415
|
+
if (total <= maxBytes || date === today)
|
|
416
|
+
break;
|
|
417
|
+
dropSuccesses(join(runsDir, date));
|
|
418
|
+
const after = sizeOf(join(runsDir, date));
|
|
419
|
+
total -= (sizes.get(date) ?? 0) - after;
|
|
420
|
+
sizes.set(date, after);
|
|
421
|
+
}
|
|
422
|
+
for (const date of dates) {
|
|
423
|
+
if (total <= maxBytes || date === today)
|
|
424
|
+
break;
|
|
425
|
+
try {
|
|
426
|
+
rmSync(join(runsDir, date), { recursive: true, force: true });
|
|
427
|
+
total -= sizes.get(date) ?? 0;
|
|
428
|
+
removed += 1;
|
|
429
|
+
} catch {
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
try {
|
|
433
|
+
mkdirSync(runsDir, { recursive: true, mode: 448 });
|
|
434
|
+
writeFileSync(stamp, today, { mode: 384 });
|
|
435
|
+
} catch {
|
|
436
|
+
}
|
|
437
|
+
return removed;
|
|
438
|
+
}, "fitSize");
|
|
439
|
+
var day = /* @__PURE__ */ __name((date) => date.toISOString().slice(0, 10), "day");
|
|
440
|
+
var days = /* @__PURE__ */ __name((runsDir) => safeReaddir(runsDir).filter((entry) => /^\d{4}-\d{2}-\d{2}$/.test(entry)), "days");
|
|
441
|
+
var readRun = /* @__PURE__ */ __name((dir) => {
|
|
442
|
+
try {
|
|
443
|
+
return metadataOf(JSON.parse(readFileSync(join(dir, "run.json"), "utf8")));
|
|
444
|
+
} catch {
|
|
445
|
+
return void 0;
|
|
446
|
+
}
|
|
447
|
+
}, "readRun");
|
|
448
|
+
var safeReaddir = /* @__PURE__ */ __name((dir) => {
|
|
449
|
+
try {
|
|
450
|
+
return readdirSync(dir);
|
|
451
|
+
} catch {
|
|
452
|
+
return [];
|
|
453
|
+
}
|
|
454
|
+
}, "safeReaddir");
|
|
455
|
+
var runFileOf = /* @__PURE__ */ __name(({ partial, ...metadata }) => ({
|
|
456
|
+
...logAttributes(metadata),
|
|
457
|
+
...partial ? { partial: { ...logAttributes(partial), failures: partial.failures.map((failure) => logAttributes(failure)) } } : {}
|
|
458
|
+
}), "runFileOf");
|
|
459
|
+
var metadataOf = /* @__PURE__ */ __name((parsed) => {
|
|
460
|
+
const { partial, ...metadata } = fromLogAttributes(parsed);
|
|
461
|
+
if (partial === null || typeof partial !== "object")
|
|
462
|
+
return metadata;
|
|
463
|
+
const { failures, ...rest } = fromLogAttributes(partial);
|
|
464
|
+
return {
|
|
465
|
+
...metadata,
|
|
466
|
+
partial: {
|
|
467
|
+
...rest,
|
|
468
|
+
failures: Array.isArray(failures) ? failures.map((failure) => fromLogAttributes(failure)) : []
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
}, "metadataOf");
|
|
472
|
+
|
|
473
|
+
// 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/runs/scope.js
|
|
474
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
475
|
+
import { randomBytes } from "node:crypto";
|
|
476
|
+
var scopes = new AsyncLocalStorage();
|
|
477
|
+
var processScope;
|
|
478
|
+
var ownProcesses = new AsyncLocalStorage();
|
|
479
|
+
var asOwnProcess = /* @__PURE__ */ __name((body) => ownProcesses.run({}, body), "asOwnProcess");
|
|
480
|
+
var currentRun = /* @__PURE__ */ __name(() => {
|
|
481
|
+
const scope = scopes.getStore();
|
|
482
|
+
if (scope)
|
|
483
|
+
return scope;
|
|
484
|
+
const own = ownProcesses.getStore();
|
|
485
|
+
const fresh = /* @__PURE__ */ __name(() => ({
|
|
486
|
+
runId: newRunId(/* @__PURE__ */ new Date(), "process"),
|
|
487
|
+
command: "",
|
|
488
|
+
startedAt: Date.now(),
|
|
489
|
+
...traceOf(process.env)
|
|
490
|
+
}), "fresh");
|
|
491
|
+
if (own) {
|
|
492
|
+
own.scope ??= fresh();
|
|
493
|
+
return own.scope;
|
|
494
|
+
}
|
|
495
|
+
processScope ??= fresh();
|
|
496
|
+
return processScope;
|
|
497
|
+
}, "currentRun");
|
|
498
|
+
var inRun = /* @__PURE__ */ __name((scope, body) => scopes.run(scope, body), "inRun");
|
|
499
|
+
var runEvent = /* @__PURE__ */ __name((event) => scopes.getStore()?.events?.(event), "runEvent");
|
|
500
|
+
var typedCommand = /* @__PURE__ */ __name((tool, words, profile = currentRun().profile) => [tool, profile, words].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
|
|
501
|
+
var useAsProcessRun = /* @__PURE__ */ __name((scope) => {
|
|
502
|
+
const own = ownProcesses.getStore();
|
|
503
|
+
if (own)
|
|
504
|
+
own.scope = scope;
|
|
505
|
+
else
|
|
506
|
+
processScope = scope;
|
|
507
|
+
}, "useAsProcessRun");
|
|
508
|
+
var processRun = /* @__PURE__ */ __name(() => {
|
|
509
|
+
const own = ownProcesses.getStore();
|
|
510
|
+
return own ? own.scope : processScope;
|
|
511
|
+
}, "processRun");
|
|
512
|
+
var enclosingTraceId = /* @__PURE__ */ __name(() => scopes.getStore()?.traceId, "enclosingTraceId");
|
|
513
|
+
var traceOf = /* @__PURE__ */ __name((env) => {
|
|
514
|
+
const traceId = traceIdOf(env.TRACEPARENT);
|
|
515
|
+
return traceId === void 0 ? {} : { traceId };
|
|
516
|
+
}, "traceOf");
|
|
517
|
+
var childTrace = /* @__PURE__ */ __name(() => {
|
|
518
|
+
const hex = /* @__PURE__ */ __name((bytes) => randomBytes(bytes).toString("hex"), "hex");
|
|
519
|
+
const traceId = hex(16);
|
|
520
|
+
return { traceId, traceparent: `00-${traceId}-${hex(8)}-01` };
|
|
521
|
+
}, "childTrace");
|
|
522
|
+
var attempts = new AsyncLocalStorage();
|
|
523
|
+
var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
|
|
524
|
+
var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
|
|
525
|
+
|
|
526
|
+
export {
|
|
527
|
+
logAttributes,
|
|
528
|
+
fromLogAttributes,
|
|
529
|
+
snakeLogger,
|
|
530
|
+
LOG_ATTRIBUTES,
|
|
531
|
+
KEEP_RUNS_FOR_DAYS,
|
|
532
|
+
KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
|
|
533
|
+
KEEP_STORE_RUNS_FOR_DAYS,
|
|
534
|
+
RUNS_SIZE_LIMIT_MB,
|
|
535
|
+
runsDirFor,
|
|
536
|
+
startRun,
|
|
537
|
+
runtime,
|
|
538
|
+
newRunId,
|
|
539
|
+
listRuns,
|
|
540
|
+
findRun,
|
|
541
|
+
readEvents,
|
|
542
|
+
pruneRuns,
|
|
543
|
+
asOwnProcess,
|
|
544
|
+
currentRun,
|
|
545
|
+
inRun,
|
|
546
|
+
runEvent,
|
|
547
|
+
typedCommand,
|
|
548
|
+
useAsProcessRun,
|
|
549
|
+
processRun,
|
|
550
|
+
enclosingTraceId,
|
|
551
|
+
traceOf,
|
|
552
|
+
childTrace,
|
|
553
|
+
withAttempt,
|
|
554
|
+
currentAttempt
|
|
555
|
+
};
|
|
@@ -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/sqlite/drizzle/shared-5XR7K42U.js
|
|
8
8
|
var entityKind = /* @__PURE__ */ Symbol.for("drizzle:entityKind");
|
|
9
9
|
var kindsByConstructor = /* @__PURE__ */ new WeakMap();
|
|
10
10
|
function collectKinds(ctor) {
|