@wirecat/drive-cli 0.63.0 → 0.65.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 +2 -1
- package/dist/bin/drive.js +2 -2
- package/dist/bundle/{all-profiles-GZJS3UKC.js → all-profiles-PD7GJHFA.js} +14 -13
- package/dist/bundle/{anthropic-RGV3WXX5.js → anthropic-PJKFON5H.js} +25 -14
- package/dist/bundle/{app-server-AA2PJ7PV.js → app-server-6ELQA6FJ.js} +59 -56
- package/dist/bundle/{bun-OXZYIA3R.js → bun-P54TGES2.js} +2 -2
- package/dist/bundle/{bun-sqlite-D45NSDM3.js → bun-sqlite-TND5ZRJH.js} +12 -8
- package/dist/bundle/chunk-2AFI4KGI.js +185 -0
- package/dist/bundle/{chunk-Q5DJTRKV.js → chunk-3HXNDF6Q.js} +2 -2
- package/dist/bundle/{chunk-DJHLVUL6.js → chunk-3ONWN3IA.js} +278 -49
- package/dist/bundle/{chunk-WYGWWHZP.js → chunk-42G2XNPN.js} +2 -2
- package/dist/bundle/chunk-4AOINPN2.js +66 -0
- package/dist/bundle/{chunk-J4DIHPZ6.js → chunk-4EDWLR22.js} +1 -1
- package/dist/bundle/{chunk-ABYGSJZ4.js → chunk-4Y5YBFMS.js} +7 -7
- package/dist/bundle/{chunk-YGU6ULU5.js → chunk-54V4H6PM.js} +16 -16
- package/dist/bundle/{chunk-2TFXK3R4.js → chunk-5XSBCMAF.js} +4 -4
- package/dist/bundle/{chunk-2HF2MRXI.js → chunk-6DCLZLGX.js} +1 -1
- package/dist/bundle/{chunk-OD4U7GUY.js → chunk-7AQGVX5O.js} +20 -20
- package/dist/bundle/{chunk-YIP7ELON.js → chunk-7TAP7Y2E.js} +727 -518
- package/dist/bundle/{chunk-TF23BZW5.js → chunk-A27UVLPK.js} +3 -3
- package/dist/bundle/{chunk-LZEOQW7S.js → chunk-A4QNADEX.js} +58 -52
- package/dist/bundle/{chunk-FXBHOCJK.js → chunk-ADLS6FVG.js} +1 -1
- package/dist/bundle/{chunk-LMAVCYLQ.js → chunk-B2LPCHQN.js} +4 -4
- package/dist/bundle/{chunk-5PPL7JDM.js → chunk-CGQRZRTH.js} +2 -2
- package/dist/bundle/{chunk-VAUMOZU5.js → chunk-CWLL63JD.js} +107 -48
- package/dist/bundle/{chunk-V3NVXIQR.js → chunk-D6Z43SOG.js} +1563 -266
- package/dist/bundle/{chunk-OXY6SSZG.js → chunk-D7WB54P7.js} +127 -28
- package/dist/bundle/{chunk-VJEOGKAN.js → chunk-DA63E2UM.js} +13 -9
- package/dist/bundle/{chunk-EOOGWUTP.js → chunk-ECEP4SO3.js} +20 -20
- package/dist/bundle/{chunk-NEFSGCVA.js → chunk-EHU6EYGO.js} +38 -28
- package/dist/bundle/{chunk-4OSSOWDM.js → chunk-ELJUBPY4.js} +1 -1
- package/dist/bundle/{chunk-FRIJUILO.js → chunk-EM7NL5ES.js} +3 -3
- package/dist/bundle/{chunk-3BZRKLJ6.js → chunk-EU5MD24W.js} +13 -13
- package/dist/bundle/{chunk-MOTRI3SY.js → chunk-EZ2OLYEK.js} +24 -2
- package/dist/bundle/{chunk-6MQSQ4LX.js → chunk-F56DRBGY.js} +370 -717
- package/dist/bundle/{chunk-ZOJU7ZFI.js → chunk-FA6JNXCC.js} +8 -8
- package/dist/bundle/{chunk-ND6LLYGF.js → chunk-FBHSWQU7.js} +1531 -136
- package/dist/bundle/{chunk-Z42YYLTS.js → chunk-GW3LBY3T.js} +74 -72
- package/dist/bundle/{chunk-Y6GNA7HE.js → chunk-HP3NT6JJ.js} +23 -5
- package/dist/bundle/{chunk-DJ3SDJZY.js → chunk-I272E6UR.js} +9 -8
- package/dist/bundle/{chunk-L37LMMRJ.js → chunk-IBO23OID.js} +2 -2
- package/dist/bundle/{chunk-CE2TJBLP.js → chunk-II4S2DBJ.js} +3 -3
- package/dist/bundle/{chunk-ZM5J6ZMB.js → chunk-IKHOIXJR.js} +2 -2
- package/dist/bundle/{chunk-PO5RQQIG.js → chunk-IMHW7VIV.js} +5 -5
- package/dist/bundle/{chunk-3HK5WMI5.js → chunk-JMJIH6JH.js} +6 -6
- package/dist/bundle/{chunk-FUITWY7O.js → chunk-JPPPLKAO.js} +26 -1
- package/dist/bundle/{chunk-4S4JMW6I.js → chunk-LMKPP2JP.js} +1 -1
- package/dist/bundle/{chunk-HZZCEQTH.js → chunk-M7ELUGU6.js} +4 -4
- package/dist/bundle/{chunk-ZMOUUOT2.js → chunk-MCPOZNWG.js} +1 -1
- package/dist/bundle/{chunk-XNVFKMVR.js → chunk-NI5PD5KM.js} +39485 -35729
- package/dist/bundle/{chunk-2TDUGC5D.js → chunk-NQ5XMSLA.js} +4927 -1978
- package/dist/bundle/chunk-NQRTKYJB.js +257 -0
- package/dist/bundle/{chunk-44SBK6KB.js → chunk-O6K2E7OA.js} +4201 -2565
- package/dist/bundle/{chunk-534OBX5Y.js → chunk-O7ZDCOZE.js} +1 -1
- package/dist/bundle/{chunk-7EMQ26BA.js → chunk-OFJXHEFT.js} +13 -13
- package/dist/bundle/chunk-OWMZUWCM.js +109 -0
- package/dist/bundle/chunk-PHOL2DZM.js +138 -0
- package/dist/bundle/{chunk-UQLWMGSD.js → chunk-PLP5527C.js} +5 -5
- package/dist/bundle/{chunk-3QINVLZI.js → chunk-RNHGQ35R.js} +1 -1
- package/dist/bundle/{chunk-27YUUGXQ.js → chunk-RX5CJ55S.js} +1 -1
- package/dist/bundle/{chunk-XIUDS3OK.js → chunk-SE352DBY.js} +1 -1
- package/dist/bundle/chunk-SEQWBZYH.js +18 -0
- package/dist/bundle/{chunk-33MGFUED.js → chunk-SIWXYB4E.js} +3789 -3538
- package/dist/bundle/{chunk-4CIZWCXV.js → chunk-SNLSEYJO.js} +1 -1
- package/dist/bundle/{chunk-XDC3TWTL.js → chunk-SS4LKLD7.js} +52 -605
- package/dist/bundle/{chunk-BKYMKVHT.js → chunk-TMHF4BCL.js} +2 -2
- package/dist/bundle/{chunk-FEZF3TII.js → chunk-TOVWMURV.js} +74 -6
- package/dist/bundle/{chunk-QCKZ3GAA.js → chunk-TTP4NOP3.js} +4 -4
- package/dist/bundle/chunk-UTNRBOEN.js +53 -0
- package/dist/bundle/{chunk-2NIC72HH.js → chunk-VDZY3L7U.js} +3 -1
- package/dist/bundle/chunk-VHQYWFWV.js +13 -0
- package/dist/bundle/{chunk-VKPCONDQ.js → chunk-VLXWAH5E.js} +4 -4
- package/dist/bundle/{chunk-6KQJSFYF.js → chunk-VMAMRFFC.js} +23 -23
- package/dist/bundle/{chunk-6EY46GAN.js → chunk-W2XY6C5S.js} +2 -2
- package/dist/bundle/{chunk-J24ZFCWM.js → chunk-WRAUO5EJ.js} +22 -24
- package/dist/bundle/{chunk-S4RXABDR.js → chunk-WRMJN6UQ.js} +3 -3
- package/dist/bundle/{chunk-UPOSDTPT.js → chunk-WVJHZIDH.js} +3 -3
- package/dist/bundle/{chunk-E4SDKMBJ.js → chunk-X7YGGWXI.js} +1 -59
- package/dist/bundle/{chunk-O2XOX4HB.js → chunk-XPWZSW6Y.js} +50 -34
- package/dist/bundle/{chunk-PDCCYHCH.js → chunk-XYE7XZPB.js} +5 -5
- package/dist/bundle/{chunk-RKELRWH7.js → chunk-Y5PKRITX.js} +5 -5
- package/dist/bundle/{chunk-XR6ESRU6.js → chunk-Z2ADO6UA.js} +2 -2
- package/dist/bundle/{chunk-YUWPNG7B.js → chunk-ZD4MB7NH.js} +1 -1
- package/dist/bundle/{chunk-TWUH22Z5.js → chunk-ZILALBYQ.js} +4 -4
- package/dist/bundle/{chunk-SXM6MHRR.js → chunk-ZR2EJPMQ.js} +44 -15
- package/dist/bundle/command-contract-25E4PYMD.js +40 -0
- package/dist/bundle/command-server-entry-36JXYIJB.js +170 -0
- package/dist/bundle/{decode-G5YEIPNC.js → decode-T5ZW57WZ.js} +8 -8
- package/dist/bundle/{dispatch-GEFIXA6X.js → dispatch-RMA2XFYA.js} +11 -11
- package/dist/bundle/drive.js +11 -11
- package/dist/bundle/{echarts-W2CWHNXR.js → echarts-KQ44LPSF.js} +2 -2
- package/dist/bundle/{embed-OBFFPVF4.js → embed-Q7XST53J.js} +9 -9
- package/dist/bundle/{embedder-NGCBQHIG.js → embedder-RWZSBVW2.js} +12 -12
- package/dist/bundle/entry-HPLW4QL2.js +25 -0
- package/dist/bundle/{failure-GV77W3CD.js → failure-7NP4QPIN.js} +4 -4
- package/dist/bundle/first-run-RL3RKYZW.js +30 -0
- package/dist/bundle/first-screen-NX3TM2VJ.js +38 -0
- package/dist/bundle/google-DPD5N6AQ.js +42 -0
- package/dist/bundle/{google-api-Z3NSTBBR.js → google-api-P5DRHD7L.js} +61 -56
- package/dist/bundle/grants-TX4MHLI4.js +109 -0
- package/dist/bundle/{identity-OM6GFZ7T.js → identity-VDV6CHRW.js} +6 -6
- package/dist/bundle/{instructions-YQBQSYSS.js → instructions-Q45FVY6H.js} +1 -1
- package/dist/bundle/{login-7RYSDVN3.js → login-XKN3NI6X.js} +67 -62
- package/dist/bundle/{mcp-GWDA3HOA.js → mcp-7KQUJNFN.js} +2 -2
- package/dist/bundle/{node-IVU33RL7.js → node-MSW565D3.js} +2 -2
- package/dist/bundle/{node-KM3CUABH.js → node-P4E63KXA.js} +9 -9
- package/dist/bundle/{node-sqlite-SIH5BEW2.js → node-sqlite-S74XVVHL.js} +13 -9
- package/dist/bundle/oauth-6R7AWAES.js +22 -0
- package/dist/bundle/{open-IAO2SNII.js → open-P7UQG7XJ.js} +8 -8
- package/dist/bundle/{openai-SGOUBHXP.js → openai-DDHJ57KZ.js} +19 -40
- package/dist/bundle/{process-BPBMV3AT.js → process-NMUB5SHK.js} +1 -1
- package/dist/bundle/{program-MYKKJ4F6.js → program-PJNWP6JW.js} +517 -330
- package/dist/bundle/prompt-VOSMK4C2.js +19 -0
- package/dist/bundle/{reasons-57J2D77K.js → reasons-KDAXOC5S.js} +5 -5
- package/dist/bundle/{recognize-A5C5RPB3.js → recognize-GZIY63HS.js} +7 -7
- package/dist/bundle/{remote-VWYFLRGO.js → remote-V3YGN7LN.js} +10 -10
- package/dist/bundle/{rerank-4NGQWREA.js → rerank-XRU6AVN7.js} +10 -10
- package/dist/bundle/{serve-Y6LQTFH5.js → serve-NDOAFA57.js} +12 -12
- package/dist/bundle/{server-6AUHIIUA.js → server-BKGWJYMC.js} +46 -44
- package/dist/bundle/server-QD2MUJJZ.js +72 -0
- package/dist/bundle/{services-2W4J7EMW.js → services-TYDMFQCA.js} +129 -39
- package/dist/bundle/{sqlite-runtime-P6BBDX2H.js → sqlite-runtime-UAFJKSJR.js} +9 -9
- package/dist/bundle/{start-AFFA3LKM.js → start-2ZLDP2OE.js} +30 -8
- package/dist/bundle/{state-PXKKXR3R.js → state-6SP27J2K.js} +9 -9
- package/dist/bundle/{store-CN6JEUC4.js → store-4UUY545Q.js} +42 -18
- package/dist/bundle/{store-IVV2BAGZ.js → store-EJN27MXI.js} +69 -28
- package/dist/bundle/store-maintenance-command-LETURZDC.js +60 -0
- package/dist/bundle/tokens-MTFJPTYT.js +107 -0
- package/dist/commands/account.d.ts +4 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +33 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +6 -5
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/context.d.ts +4 -2
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/documents.d.ts +2 -0
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +39 -3
- package/dist/commands/documents.js.map +1 -1
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +32 -2
- package/dist/config.js.map +1 -1
- package/dist/documents-add.d.ts +49 -0
- package/dist/documents-add.d.ts.map +1 -0
- package/dist/documents-add.js +122 -0
- package/dist/documents-add.js.map +1 -0
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +9 -1
- package/dist/errors.js.map +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.d.ts.map +1 -1
- package/dist/knowledge.js +15 -17
- package/dist/knowledge.js.map +1 -1
- package/dist/model.d.ts +3 -0
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js.map +1 -1
- package/dist/profile-lock.d.ts +1 -0
- package/dist/profile-lock.d.ts.map +1 -1
- package/dist/profile-lock.js +1 -0
- package/dist/profile-lock.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +24 -15
- package/dist/program.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +25 -0
- package/dist/reasons.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +20 -0
- package/dist/store.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/dist/bundle/chunk-AEX37ETW.js +0 -35
- package/dist/bundle/chunk-OTROVC4E.js +0 -62
- package/dist/bundle/chunk-Z5KC7XBR.js +0 -33
- package/dist/bundle/command-contract-BRW3AP44.js +0 -38
- package/dist/bundle/entry-ET6HGM7A.js +0 -22
- package/dist/bundle/first-run-JG52UZVO.js +0 -30
- package/dist/bundle/first-screen-CIL3GFAA.js +0 -36
- package/dist/bundle/google-CIWUVJ5C.js +0 -36
- package/dist/bundle/grants-3S4RL3WB.js +0 -104
- package/dist/bundle/oauth-PT4JEHLL.js +0 -22
- package/dist/bundle/prompt-3ZM64DCB.js +0 -17
- package/dist/bundle/server-PFHI35HA.js +0 -69
- package/dist/bundle/store-maintenance-command-MSY2QNEH.js +0 -59
- package/dist/bundle/tokens-P4LPNUFW.js +0 -102
- package/dist/bundle/{chunk-ZQ3GWKDQ.js → chunk-YVNHQFLC.js} +0 -0
- package/dist/bundle/{mdast-util-from-markdown-FXEPSNER.js → mdast-util-from-markdown-CE73EWJ2.js} +3 -3
|
@@ -8,18 +8,26 @@ import {
|
|
|
8
8
|
queryFieldsOf,
|
|
9
9
|
timezoneOf,
|
|
10
10
|
validateQuery
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ECEP4SO3.js";
|
|
12
12
|
import {
|
|
13
13
|
isCliFailure,
|
|
14
14
|
isStoreDamage
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4AOINPN2.js";
|
|
16
16
|
import {
|
|
17
17
|
refuseOwnerStoreInTests
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UTNRBOEN.js";
|
|
19
|
+
import {
|
|
20
|
+
createRecordLog,
|
|
21
|
+
resolvePaths,
|
|
22
|
+
writeSecurely
|
|
23
|
+
} from "./chunk-7AQGVX5O.js";
|
|
19
24
|
import {
|
|
20
25
|
singleLine,
|
|
21
26
|
visibleControls
|
|
22
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-6DCLZLGX.js";
|
|
28
|
+
import {
|
|
29
|
+
traceIdOf
|
|
30
|
+
} from "./chunk-W2XY6C5S.js";
|
|
23
31
|
import {
|
|
24
32
|
STEPS,
|
|
25
33
|
array,
|
|
@@ -46,15 +54,530 @@ import {
|
|
|
46
54
|
string,
|
|
47
55
|
union,
|
|
48
56
|
unknown
|
|
49
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-TOVWMURV.js";
|
|
50
58
|
import {
|
|
51
59
|
CliError
|
|
52
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-ELJUBPY4.js";
|
|
53
61
|
import {
|
|
54
62
|
__name
|
|
55
63
|
} from "./chunk-ZVVMGPBJ.js";
|
|
56
64
|
|
|
57
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
65
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/scope.js
|
|
66
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
67
|
+
import { randomBytes } from "node:crypto";
|
|
68
|
+
|
|
69
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/run.js
|
|
70
|
+
import { randomUUID } from "node:crypto";
|
|
71
|
+
import { appendFileSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
72
|
+
import { userInfo } from "node:os";
|
|
73
|
+
import { join, sep } from "node:path";
|
|
74
|
+
|
|
75
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/log-keys.js
|
|
76
|
+
var snake = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
|
|
77
|
+
var camel = /* @__PURE__ */ __name((key) => key.replace(/_([a-z0-9])/g, (_, letter) => letter.toUpperCase()), "camel");
|
|
78
|
+
var renamed = /* @__PURE__ */ __name((record2, name) => Object.fromEntries(Object.entries(record2).map(([key, value]) => [name(key), value])), "renamed");
|
|
79
|
+
var logAttributes = /* @__PURE__ */ __name((event2) => renamed(event2, snake), "logAttributes");
|
|
80
|
+
var fromLogAttributes = /* @__PURE__ */ __name((attributes) => renamed(attributes, camel), "fromLogAttributes");
|
|
81
|
+
var snakeLogger = /* @__PURE__ */ __name((logger) => ({
|
|
82
|
+
debug: /* @__PURE__ */ __name((event2, message) => logger.debug(logAttributes(event2), message), "debug"),
|
|
83
|
+
info: /* @__PURE__ */ __name((event2, message) => logger.info(logAttributes(event2), message), "info"),
|
|
84
|
+
warn: /* @__PURE__ */ __name((event2, message) => logger.warn(logAttributes(event2), message), "warn"),
|
|
85
|
+
error: /* @__PURE__ */ __name((event2, message) => logger.error(logAttributes(event2), message), "error")
|
|
86
|
+
}), "snakeLogger");
|
|
87
|
+
|
|
88
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/log-attributes.js
|
|
89
|
+
var diagnostic = {
|
|
90
|
+
event: true,
|
|
91
|
+
operation: true,
|
|
92
|
+
opcode: true,
|
|
93
|
+
seq: true,
|
|
94
|
+
status: true,
|
|
95
|
+
method: true,
|
|
96
|
+
endpointTemplate: true,
|
|
97
|
+
bytes: true,
|
|
98
|
+
ids: true,
|
|
99
|
+
counts: true,
|
|
100
|
+
durationMs: true,
|
|
101
|
+
outcome: true,
|
|
102
|
+
errorCode: true,
|
|
103
|
+
providerError: true,
|
|
104
|
+
level: true,
|
|
105
|
+
transport: true,
|
|
106
|
+
attempt: true,
|
|
107
|
+
waitMs: true,
|
|
108
|
+
code: true,
|
|
109
|
+
detail: true,
|
|
110
|
+
reason: true,
|
|
111
|
+
ageMs: true,
|
|
112
|
+
kind: true,
|
|
113
|
+
table: true,
|
|
114
|
+
op: true,
|
|
115
|
+
n: true
|
|
116
|
+
};
|
|
117
|
+
var send = {
|
|
118
|
+
profile: true,
|
|
119
|
+
chatId: true,
|
|
120
|
+
outcome: true,
|
|
121
|
+
kind: true,
|
|
122
|
+
action: true,
|
|
123
|
+
people: true,
|
|
124
|
+
messageId: true,
|
|
125
|
+
key: true,
|
|
126
|
+
count: true,
|
|
127
|
+
forEveryone: true,
|
|
128
|
+
sendId: true,
|
|
129
|
+
operationId: true,
|
|
130
|
+
parentOperationId: true,
|
|
131
|
+
replyTo: true,
|
|
132
|
+
threadId: true,
|
|
133
|
+
sendAs: true,
|
|
134
|
+
resultChatId: true,
|
|
135
|
+
length: true,
|
|
136
|
+
attachments: true,
|
|
137
|
+
scheduledFor: true,
|
|
138
|
+
notify: true,
|
|
139
|
+
origin: true,
|
|
140
|
+
reservation: true,
|
|
141
|
+
errorCode: true
|
|
142
|
+
};
|
|
143
|
+
var background = [
|
|
144
|
+
"job",
|
|
145
|
+
"pid",
|
|
146
|
+
"schedule",
|
|
147
|
+
"exitCode",
|
|
148
|
+
"tool",
|
|
149
|
+
"tier",
|
|
150
|
+
"actorType",
|
|
151
|
+
"actorId",
|
|
152
|
+
"agent",
|
|
153
|
+
"targetType",
|
|
154
|
+
"targetId"
|
|
155
|
+
];
|
|
156
|
+
var crash = ["errorClass", "frames"];
|
|
157
|
+
var dropped = ["dropped"];
|
|
158
|
+
var LOG_ATTRIBUTES = [
|
|
159
|
+
...new Set([...Object.keys(diagnostic), ...Object.keys(send), ...background, ...crash, ...dropped].map((key) => Object.keys(logAttributes({ [key]: true }))[0]))
|
|
160
|
+
].sort();
|
|
161
|
+
|
|
162
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/run.js
|
|
163
|
+
var KEEP_RUNS_FOR_DAYS = 30;
|
|
164
|
+
var KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7;
|
|
165
|
+
var KEEP_STORE_RUNS_FOR_DAYS = 3;
|
|
166
|
+
var RUNS_SIZE_LIMIT_MB = 200;
|
|
167
|
+
var runsDirFor = /* @__PURE__ */ __name((app, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "runs"), "runsDirFor");
|
|
168
|
+
var startRun = /* @__PURE__ */ __name((options) => {
|
|
169
|
+
const now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
170
|
+
const startedAt = options.startedAt ?? now();
|
|
171
|
+
const id5 = options.runId ?? newRunId(startedAt, options.command);
|
|
172
|
+
const dir = join(options.runsDir, day(startedAt), id5);
|
|
173
|
+
pruneRuns(options.runsDir, {
|
|
174
|
+
keepDays: options.keepDays ?? KEEP_RUNS_FOR_DAYS,
|
|
175
|
+
keepSuccessDays: options.keepSuccessDays ?? KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
|
|
176
|
+
keepStoreDays: options.keepStoreDays ?? KEEP_STORE_RUNS_FOR_DAYS,
|
|
177
|
+
maxBytes: options.maxBytes ?? RUNS_SIZE_LIMIT_MB * 1024 * 1024,
|
|
178
|
+
now: startedAt
|
|
179
|
+
});
|
|
180
|
+
refuseRealStateInTests(dir);
|
|
181
|
+
const metadata = {
|
|
182
|
+
runId: id5,
|
|
183
|
+
command: options.command,
|
|
184
|
+
...options.profile === void 0 ? {} : { profile: options.profile },
|
|
185
|
+
startedAt: startedAt.toISOString(),
|
|
186
|
+
status: "running",
|
|
187
|
+
cliVersion: options.cliVersion,
|
|
188
|
+
runtime: runtime(),
|
|
189
|
+
platform: process.platform,
|
|
190
|
+
arch: process.arch,
|
|
191
|
+
...options.traceId === void 0 ? {} : { traceId: options.traceId },
|
|
192
|
+
...options.context
|
|
193
|
+
};
|
|
194
|
+
let file;
|
|
195
|
+
const opened = /* @__PURE__ */ __name(() => {
|
|
196
|
+
if (file)
|
|
197
|
+
return file;
|
|
198
|
+
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
199
|
+
const events = join(dir, "events.jsonl");
|
|
200
|
+
writeFileSync(events, "", { flag: "a", mode: 384 });
|
|
201
|
+
file = snakeLogger(createRecordLog({
|
|
202
|
+
to: events,
|
|
203
|
+
runId: id5,
|
|
204
|
+
command: options.command,
|
|
205
|
+
resource: { service: options.service, version: options.cliVersion },
|
|
206
|
+
allow: LOG_ATTRIBUTES,
|
|
207
|
+
...options.traceId === void 0 ? {} : { traceId: options.traceId },
|
|
208
|
+
...options.onError === void 0 ? {} : { onError: options.onError }
|
|
209
|
+
}));
|
|
210
|
+
writeRunFile(dir, metadata);
|
|
211
|
+
return file;
|
|
212
|
+
}, "opened");
|
|
213
|
+
if (!options.lazy)
|
|
214
|
+
opened();
|
|
215
|
+
let finished = false;
|
|
216
|
+
const operations = /* @__PURE__ */ new Set();
|
|
217
|
+
const codes = /* @__PURE__ */ new Set();
|
|
218
|
+
const tables = /* @__PURE__ */ new Set();
|
|
219
|
+
const noted = /* @__PURE__ */ __name((level) => (event2, message) => {
|
|
220
|
+
const { operation, errorCode, error_code, code, kind: kind2, table } = event2;
|
|
221
|
+
if (typeof operation === "string")
|
|
222
|
+
operations.add(operation);
|
|
223
|
+
if (kind2 === "store" && typeof table === "string")
|
|
224
|
+
tables.add(table);
|
|
225
|
+
for (const value of [errorCode, error_code, code])
|
|
226
|
+
if (typeof value === "string")
|
|
227
|
+
codes.add(value);
|
|
228
|
+
if (finished)
|
|
229
|
+
return;
|
|
230
|
+
opened()[level](event2, message);
|
|
231
|
+
}, "noted");
|
|
232
|
+
const logger = { debug: noted("debug"), info: noted("info"), warn: noted("warn"), error: noted("error") };
|
|
233
|
+
return {
|
|
234
|
+
id: id5,
|
|
235
|
+
dir,
|
|
236
|
+
logger,
|
|
237
|
+
finish: /* @__PURE__ */ __name(async (status, extra = {}) => {
|
|
238
|
+
if (finished)
|
|
239
|
+
return;
|
|
240
|
+
finished = true;
|
|
241
|
+
const completedAt = now();
|
|
242
|
+
const final = {
|
|
243
|
+
...metadata,
|
|
244
|
+
...extra,
|
|
245
|
+
status,
|
|
246
|
+
completedAt: completedAt.toISOString(),
|
|
247
|
+
durationMs: completedAt.getTime() - startedAt.getTime(),
|
|
248
|
+
operations: [...operations].sort(),
|
|
249
|
+
codes: [...codes].sort(),
|
|
250
|
+
...tables.size > 0 ? { tables: [...tables].sort() } : {}
|
|
251
|
+
};
|
|
252
|
+
if (file || status !== "success") {
|
|
253
|
+
opened();
|
|
254
|
+
writeRunFile(dir, final);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
mkdirSync(join(dir, ".."), { recursive: true, mode: 448 });
|
|
259
|
+
appendIndex(join(dir, ".."), runFileOf(final));
|
|
260
|
+
} catch (error) {
|
|
261
|
+
options.onError?.(error);
|
|
262
|
+
}
|
|
263
|
+
}, "finish")
|
|
264
|
+
};
|
|
265
|
+
}, "startRun");
|
|
266
|
+
var refuseRealStateInTests = /* @__PURE__ */ __name((dir, env = process.env) => {
|
|
267
|
+
if (env.VITEST === void 0)
|
|
268
|
+
return;
|
|
269
|
+
let home;
|
|
270
|
+
try {
|
|
271
|
+
home = userInfo().homedir;
|
|
272
|
+
} catch {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
if (dir.startsWith(join(home, ".local", "share") + sep))
|
|
276
|
+
throw new Error(`a test opened a run in the real data folder: ${dir}`);
|
|
277
|
+
}, "refuseRealStateInTests");
|
|
278
|
+
var runtime = /* @__PURE__ */ __name(() => {
|
|
279
|
+
const bun = process.versions.bun;
|
|
280
|
+
return bun ? `bun ${bun}` : `node ${process.versions.node}`;
|
|
281
|
+
}, "runtime");
|
|
282
|
+
var newRunId = /* @__PURE__ */ __name((startedAt, command) => {
|
|
283
|
+
const stamp = startedAt.toISOString().replace(/[-:]/g, "").replace(/\.\d+Z$/, "Z");
|
|
284
|
+
const slug = command.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
|
|
285
|
+
return `${stamp}-${slug}-${randomUUID().slice(0, 6)}`;
|
|
286
|
+
}, "newRunId");
|
|
287
|
+
var INDEX = "index.jsonl";
|
|
288
|
+
var appendIndex = /* @__PURE__ */ __name((dayDir, written) => {
|
|
289
|
+
appendFileSync(join(dayDir, INDEX), `${JSON.stringify(written)}
|
|
290
|
+
`, { mode: 384 });
|
|
291
|
+
}, "appendIndex");
|
|
292
|
+
var writeRunFile = /* @__PURE__ */ __name((dir, metadata) => {
|
|
293
|
+
const written = runFileOf(metadata);
|
|
294
|
+
writeSecurely(join(dir, "run.json"), `${JSON.stringify(written, null, 2)}
|
|
295
|
+
`, 384);
|
|
296
|
+
try {
|
|
297
|
+
appendIndex(join(dir, ".."), written);
|
|
298
|
+
} catch {
|
|
299
|
+
}
|
|
300
|
+
}, "writeRunFile");
|
|
301
|
+
var matchesListFilter = /* @__PURE__ */ __name((run2, filter) => (filter.runId === void 0 || run2.runId === filter.runId) && (filter.command === void 0 || run2.command === filter.command) && (filter.profile === void 0 || run2.profile === filter.profile) && (filter.status === void 0 || run2.status === filter.status) && (filter.errorCode === void 0 || run2.errorCode === filter.errorCode), "matchesListFilter");
|
|
302
|
+
var listRuns = /* @__PURE__ */ __name((runsDir, { since, atLeast = Number.POSITIVE_INFINITY, filter = {} } = {}) => {
|
|
303
|
+
const first = since === void 0 ? void 0 : day(new Date(since));
|
|
304
|
+
const runs = [];
|
|
305
|
+
for (const date of days(runsDir).sort().reverse()) {
|
|
306
|
+
if (first !== void 0 && date < first || runs.length >= atLeast)
|
|
307
|
+
break;
|
|
308
|
+
for (const metadata of runsOfDay(join(runsDir, date))) {
|
|
309
|
+
if (matchesListFilter(metadata, filter))
|
|
310
|
+
runs.push(metadata);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return runs;
|
|
314
|
+
}, "listRuns");
|
|
315
|
+
var indexedRuns = /* @__PURE__ */ __name((dayDir) => {
|
|
316
|
+
const latest = /* @__PURE__ */ new Map();
|
|
317
|
+
let raw = "";
|
|
318
|
+
try {
|
|
319
|
+
raw = readFileSync(join(dayDir, INDEX), "utf8");
|
|
320
|
+
} catch {
|
|
321
|
+
}
|
|
322
|
+
for (const line2 of raw.split("\n")) {
|
|
323
|
+
if (line2.trim() === "")
|
|
324
|
+
continue;
|
|
325
|
+
try {
|
|
326
|
+
const metadata = metadataOf(JSON.parse(line2));
|
|
327
|
+
if (typeof metadata.runId === "string")
|
|
328
|
+
latest.set(metadata.runId, metadata);
|
|
329
|
+
} catch {
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return latest;
|
|
333
|
+
}, "indexedRuns");
|
|
334
|
+
var runsOfDay = /* @__PURE__ */ __name((dayDir) => {
|
|
335
|
+
const latest = indexedRuns(dayDir);
|
|
336
|
+
for (const entry of safeReaddir(dayDir)) {
|
|
337
|
+
if (entry === INDEX || entry.startsWith(".") || latest.has(entry))
|
|
338
|
+
continue;
|
|
339
|
+
const metadata = readRun(join(dayDir, entry));
|
|
340
|
+
if (metadata)
|
|
341
|
+
latest.set(metadata.runId, metadata);
|
|
342
|
+
}
|
|
343
|
+
return [...latest.values()].sort((a, b) => a.runId < b.runId ? 1 : a.runId > b.runId ? -1 : 0);
|
|
344
|
+
}, "runsOfDay");
|
|
345
|
+
var findRun = /* @__PURE__ */ __name((runsDir, id5) => {
|
|
346
|
+
const stamped = /^(\d{4})(\d{2})(\d{2})T/.exec(id5);
|
|
347
|
+
const likely = stamped ? [`${stamped[1]}-${stamped[2]}-${stamped[3]}`] : [];
|
|
348
|
+
const dates = [.../* @__PURE__ */ new Set([...likely, ...days(runsDir)])];
|
|
349
|
+
for (const date of dates) {
|
|
350
|
+
const dir = join(runsDir, date, id5);
|
|
351
|
+
const metadata = readRun(dir);
|
|
352
|
+
if (metadata)
|
|
353
|
+
return { dir, metadata };
|
|
354
|
+
}
|
|
355
|
+
for (const date of dates) {
|
|
356
|
+
const metadata = indexedRuns(join(runsDir, date)).get(id5);
|
|
357
|
+
if (metadata)
|
|
358
|
+
return { dir: join(runsDir, date, id5), metadata };
|
|
359
|
+
}
|
|
360
|
+
return void 0;
|
|
361
|
+
}, "findRun");
|
|
362
|
+
var readEvents = /* @__PURE__ */ __name((dir) => {
|
|
363
|
+
let raw;
|
|
364
|
+
try {
|
|
365
|
+
raw = readFileSync(join(dir, "events.jsonl"), "utf8");
|
|
366
|
+
} catch {
|
|
367
|
+
return [];
|
|
368
|
+
}
|
|
369
|
+
const events = [];
|
|
370
|
+
for (const line2 of raw.split("\n")) {
|
|
371
|
+
if (line2.trim() === "")
|
|
372
|
+
continue;
|
|
373
|
+
try {
|
|
374
|
+
const parsed = JSON.parse(line2);
|
|
375
|
+
if (parsed !== null && typeof parsed === "object")
|
|
376
|
+
events.push(eventOf(parsed));
|
|
377
|
+
} catch {
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return events;
|
|
381
|
+
}, "readEvents");
|
|
382
|
+
var eventOf = /* @__PURE__ */ __name((line2) => {
|
|
383
|
+
const { attributes, time: time2, severity: severity2 } = line2;
|
|
384
|
+
if (attributes === null || typeof attributes !== "object")
|
|
385
|
+
return logAttributes(line2);
|
|
386
|
+
return { time: time2, severity: severity2, ...logAttributes(attributes) };
|
|
387
|
+
}, "eventOf");
|
|
388
|
+
var pruneRuns = /* @__PURE__ */ __name((runsDir, { keepDays, keepSuccessDays = keepDays, keepStoreDays = KEEP_STORE_RUNS_FOR_DAYS, maxBytes, now }) => {
|
|
389
|
+
const cutoff = day(new Date(now.getTime() - keepDays * DAY_MS));
|
|
390
|
+
const before = /* @__PURE__ */ __name((days2) => day(new Date(now.getTime() - Math.min(days2, keepDays) * DAY_MS)), "before");
|
|
391
|
+
const successCutoff = before(keepSuccessDays);
|
|
392
|
+
const storeCutoff = before(keepStoreDays);
|
|
393
|
+
const keptFor = /* @__PURE__ */ __name((metadata) => metadata.keptBecauseStore ? keepStoreDays : metadata.operations?.includes(STORE_WRITE) ? Math.max(keepSuccessDays, keepStoreDays) : keepSuccessDays, "keptFor");
|
|
394
|
+
let removed = 0;
|
|
395
|
+
for (const date of days(runsDir)) {
|
|
396
|
+
if (date >= cutoff) {
|
|
397
|
+
if (date < storeCutoff)
|
|
398
|
+
dropSuccesses(join(runsDir, date), STORE_RUNS_DROPPED, (metadata) => keptFor(metadata) <= keepStoreDays);
|
|
399
|
+
if (date < successCutoff)
|
|
400
|
+
dropSuccesses(join(runsDir, date), SUCCESSES_DROPPED, (metadata) => keptFor(metadata) <= keepSuccessDays);
|
|
401
|
+
continue;
|
|
402
|
+
}
|
|
403
|
+
try {
|
|
404
|
+
rmSync(join(runsDir, date), { recursive: true, force: true });
|
|
405
|
+
removed += 1;
|
|
406
|
+
} catch {
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (maxBytes !== void 0)
|
|
410
|
+
removed += fitSize(runsDir, maxBytes, now);
|
|
411
|
+
return removed;
|
|
412
|
+
}, "pruneRuns");
|
|
413
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
414
|
+
var STORE_WRITE = "store.write";
|
|
415
|
+
var SUCCESSES_DROPPED = ".successes-dropped";
|
|
416
|
+
var STORE_RUNS_DROPPED = ".store-runs-dropped";
|
|
417
|
+
var SIZE_CHECKED = ".size-checked";
|
|
418
|
+
var dropSuccesses = /* @__PURE__ */ __name((dayDir, marker = SUCCESSES_DROPPED, drops = () => true) => {
|
|
419
|
+
const done = join(dayDir, marker);
|
|
420
|
+
try {
|
|
421
|
+
statSync(done);
|
|
422
|
+
return;
|
|
423
|
+
} catch {
|
|
424
|
+
}
|
|
425
|
+
const dropped2 = /* @__PURE__ */ __name((metadata) => metadata?.status === "success" && drops(metadata), "dropped");
|
|
426
|
+
try {
|
|
427
|
+
const kept = [];
|
|
428
|
+
for (const [id5, metadata] of indexedRuns(dayDir)) {
|
|
429
|
+
if (dropped2(metadata))
|
|
430
|
+
rmSync(join(dayDir, id5), { recursive: true, force: true });
|
|
431
|
+
else
|
|
432
|
+
kept.push(JSON.stringify(runFileOf(metadata)));
|
|
433
|
+
}
|
|
434
|
+
for (const entry of safeReaddir(dayDir)) {
|
|
435
|
+
if (entry === INDEX || entry.startsWith("."))
|
|
436
|
+
continue;
|
|
437
|
+
if (dropped2(readRun(join(dayDir, entry))))
|
|
438
|
+
rmSync(join(dayDir, entry), { recursive: true, force: true });
|
|
439
|
+
}
|
|
440
|
+
writeSecurely(join(dayDir, INDEX), kept.map((line2) => `${line2}
|
|
441
|
+
`).join(""), 384);
|
|
442
|
+
writeFileSync(done, "", { mode: 384 });
|
|
443
|
+
} catch {
|
|
444
|
+
}
|
|
445
|
+
}, "dropSuccesses");
|
|
446
|
+
var sizeOf = /* @__PURE__ */ __name((path) => {
|
|
447
|
+
let total = 0;
|
|
448
|
+
for (const entry of safeReaddir(path)) {
|
|
449
|
+
const full = join(path, entry);
|
|
450
|
+
try {
|
|
451
|
+
const stat = statSync(full);
|
|
452
|
+
total += stat.isDirectory() ? sizeOf(full) : stat.size;
|
|
453
|
+
} catch {
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
return total;
|
|
457
|
+
}, "sizeOf");
|
|
458
|
+
var fitSize = /* @__PURE__ */ __name((runsDir, maxBytes, now) => {
|
|
459
|
+
const stamp = join(runsDir, SIZE_CHECKED);
|
|
460
|
+
const today = day(now);
|
|
461
|
+
try {
|
|
462
|
+
if (readFileSync(stamp, "utf8").trim() === today)
|
|
463
|
+
return 0;
|
|
464
|
+
} catch {
|
|
465
|
+
}
|
|
466
|
+
const dates = days(runsDir).sort();
|
|
467
|
+
const sizes = new Map(dates.map((date) => [date, sizeOf(join(runsDir, date))]));
|
|
468
|
+
let total = [...sizes.values()].reduce((sum, size) => sum + size, 0);
|
|
469
|
+
let removed = 0;
|
|
470
|
+
for (const date of dates) {
|
|
471
|
+
if (total <= maxBytes || date === today)
|
|
472
|
+
break;
|
|
473
|
+
dropSuccesses(join(runsDir, date));
|
|
474
|
+
const after = sizeOf(join(runsDir, date));
|
|
475
|
+
total -= (sizes.get(date) ?? 0) - after;
|
|
476
|
+
sizes.set(date, after);
|
|
477
|
+
}
|
|
478
|
+
for (const date of dates) {
|
|
479
|
+
if (total <= maxBytes || date === today)
|
|
480
|
+
break;
|
|
481
|
+
try {
|
|
482
|
+
rmSync(join(runsDir, date), { recursive: true, force: true });
|
|
483
|
+
total -= sizes.get(date) ?? 0;
|
|
484
|
+
removed += 1;
|
|
485
|
+
} catch {
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
try {
|
|
489
|
+
mkdirSync(runsDir, { recursive: true, mode: 448 });
|
|
490
|
+
writeFileSync(stamp, today, { mode: 384 });
|
|
491
|
+
} catch {
|
|
492
|
+
}
|
|
493
|
+
return removed;
|
|
494
|
+
}, "fitSize");
|
|
495
|
+
var day = /* @__PURE__ */ __name((date) => date.toISOString().slice(0, 10), "day");
|
|
496
|
+
var days = /* @__PURE__ */ __name((runsDir) => safeReaddir(runsDir).filter((entry) => /^\d{4}-\d{2}-\d{2}$/.test(entry)), "days");
|
|
497
|
+
var readRun = /* @__PURE__ */ __name((dir) => {
|
|
498
|
+
try {
|
|
499
|
+
return metadataOf(JSON.parse(readFileSync(join(dir, "run.json"), "utf8")));
|
|
500
|
+
} catch {
|
|
501
|
+
return void 0;
|
|
502
|
+
}
|
|
503
|
+
}, "readRun");
|
|
504
|
+
var safeReaddir = /* @__PURE__ */ __name((dir) => {
|
|
505
|
+
try {
|
|
506
|
+
return readdirSync(dir);
|
|
507
|
+
} catch {
|
|
508
|
+
return [];
|
|
509
|
+
}
|
|
510
|
+
}, "safeReaddir");
|
|
511
|
+
var runFileOf = /* @__PURE__ */ __name(({ partial, ...metadata }) => ({
|
|
512
|
+
...logAttributes(metadata),
|
|
513
|
+
...partial ? { partial: { ...logAttributes(partial), failures: partial.failures.map((failure) => logAttributes(failure)) } } : {}
|
|
514
|
+
}), "runFileOf");
|
|
515
|
+
var metadataOf = /* @__PURE__ */ __name((parsed) => {
|
|
516
|
+
const { partial, ...metadata } = fromLogAttributes(parsed);
|
|
517
|
+
if (partial === null || typeof partial !== "object")
|
|
518
|
+
return metadata;
|
|
519
|
+
const { failures, ...rest } = fromLogAttributes(partial);
|
|
520
|
+
return {
|
|
521
|
+
...metadata,
|
|
522
|
+
partial: {
|
|
523
|
+
...rest,
|
|
524
|
+
failures: Array.isArray(failures) ? failures.map((failure) => fromLogAttributes(failure)) : []
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
}, "metadataOf");
|
|
528
|
+
|
|
529
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/scope.js
|
|
530
|
+
var scopes = new AsyncLocalStorage();
|
|
531
|
+
var processScope;
|
|
532
|
+
var ownProcesses = new AsyncLocalStorage();
|
|
533
|
+
var asOwnProcess = /* @__PURE__ */ __name((body) => ownProcesses.run({}, body), "asOwnProcess");
|
|
534
|
+
var currentRun = /* @__PURE__ */ __name(() => {
|
|
535
|
+
const scope2 = scopes.getStore();
|
|
536
|
+
if (scope2)
|
|
537
|
+
return scope2;
|
|
538
|
+
const own = ownProcesses.getStore();
|
|
539
|
+
const fresh = /* @__PURE__ */ __name(() => ({
|
|
540
|
+
runId: newRunId(/* @__PURE__ */ new Date(), "process"),
|
|
541
|
+
command: "",
|
|
542
|
+
startedAt: Date.now(),
|
|
543
|
+
...traceOf(process.env)
|
|
544
|
+
}), "fresh");
|
|
545
|
+
if (own) {
|
|
546
|
+
own.scope ??= fresh();
|
|
547
|
+
return own.scope;
|
|
548
|
+
}
|
|
549
|
+
processScope ??= fresh();
|
|
550
|
+
return processScope;
|
|
551
|
+
}, "currentRun");
|
|
552
|
+
var inRun = /* @__PURE__ */ __name((scope2, body) => scopes.run(scope2, body), "inRun");
|
|
553
|
+
var runEvent = /* @__PURE__ */ __name((event2) => scopes.getStore()?.events?.(event2), "runEvent");
|
|
554
|
+
var typedCommand = /* @__PURE__ */ __name((tool, words2, profile = currentRun().profile) => [tool, profile, words2].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
|
|
555
|
+
var useAsProcessRun = /* @__PURE__ */ __name((scope2) => {
|
|
556
|
+
const own = ownProcesses.getStore();
|
|
557
|
+
if (own)
|
|
558
|
+
own.scope = scope2;
|
|
559
|
+
else
|
|
560
|
+
processScope = scope2;
|
|
561
|
+
}, "useAsProcessRun");
|
|
562
|
+
var processRun = /* @__PURE__ */ __name(() => {
|
|
563
|
+
const own = ownProcesses.getStore();
|
|
564
|
+
return own ? own.scope : processScope;
|
|
565
|
+
}, "processRun");
|
|
566
|
+
var enclosingTraceId = /* @__PURE__ */ __name(() => scopes.getStore()?.traceId, "enclosingTraceId");
|
|
567
|
+
var traceOf = /* @__PURE__ */ __name((env) => {
|
|
568
|
+
const traceId = traceIdOf(env.TRACEPARENT);
|
|
569
|
+
return traceId === void 0 ? {} : { traceId };
|
|
570
|
+
}, "traceOf");
|
|
571
|
+
var childTrace = /* @__PURE__ */ __name(() => {
|
|
572
|
+
const hex = /* @__PURE__ */ __name((bytes) => randomBytes(bytes).toString("hex"), "hex");
|
|
573
|
+
const traceId = hex(16);
|
|
574
|
+
return { traceId, traceparent: `00-${traceId}-${hex(8)}-01` };
|
|
575
|
+
}, "childTrace");
|
|
576
|
+
var attempts = new AsyncLocalStorage();
|
|
577
|
+
var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
|
|
578
|
+
var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
|
|
579
|
+
|
|
580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/payment.js
|
|
58
581
|
var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
|
|
59
582
|
var PAYMENT_DIRECTIONS = ["to_us", "from_us"];
|
|
60
583
|
var PAYMENT_STATES = ["expected", "paid", "cancelled"];
|
|
@@ -148,7 +671,7 @@ var paymentTitle = /* @__PURE__ */ __name((fact) => {
|
|
|
148
671
|
return `${grouped(payment.amount)} ${payment.currency} ${way}${party}${item}${due} (${payment.state})`;
|
|
149
672
|
}, "paymentTitle");
|
|
150
673
|
|
|
151
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
674
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/passage.js
|
|
152
675
|
var meetingHitContextLimits = /* @__PURE__ */ __name((options = {}) => {
|
|
153
676
|
const { before = 3, after = 3, bytes = 65536, max_read_bytes = 4194304, expected_fingerprint } = options;
|
|
154
677
|
if (![before, after].every((value) => Number.isSafeInteger(value) && value >= 0) || before + after > 999 || !Number.isSafeInteger(bytes) || bytes < 2 || bytes > 4194304 || !Number.isSafeInteger(max_read_bytes) || max_read_bytes < 1 || max_read_bytes > 67108864 || expected_fingerprint !== void 0 && (typeof expected_fingerprint !== "string" || !/^[a-f0-9]{64}$/.test(expected_fingerprint)))
|
|
@@ -161,7 +684,7 @@ var validateMeetingPassage = /* @__PURE__ */ __name((reference2, options) => {
|
|
|
161
684
|
throw new CliError("validation_error", "choose a cue reference and json, text or markdown output");
|
|
162
685
|
}, "validateMeetingPassage");
|
|
163
686
|
|
|
164
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
687
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/reference.js
|
|
165
688
|
var invalid2 = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
|
|
166
689
|
var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
|
|
167
690
|
if (!Number.isSafeInteger(value) || value < minimum)
|
|
@@ -169,24 +692,24 @@ var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
|
|
|
169
692
|
return value;
|
|
170
693
|
}, "integer");
|
|
171
694
|
var formatMeetingReference = /* @__PURE__ */ __name((reference2) => {
|
|
172
|
-
const
|
|
695
|
+
const parts2 = [integer2(reference2.accountId), integer2(reference2.meetingId)];
|
|
173
696
|
if (reference2.transcriptId !== void 0)
|
|
174
|
-
|
|
697
|
+
parts2.push(integer2(reference2.transcriptId));
|
|
175
698
|
if (reference2.cuePosition !== void 0) {
|
|
176
699
|
if (reference2.transcriptId === void 0)
|
|
177
700
|
throw invalid2();
|
|
178
|
-
|
|
701
|
+
parts2.push(integer2(reference2.cuePosition, 0));
|
|
179
702
|
}
|
|
180
|
-
return `meeting:${
|
|
703
|
+
return `meeting:${parts2.join("/")}`;
|
|
181
704
|
}, "formatMeetingReference");
|
|
182
705
|
var parseMeetingReference = /* @__PURE__ */ __name((text7) => {
|
|
183
706
|
const value = text7.trim();
|
|
184
707
|
if (!value.startsWith("meeting:"))
|
|
185
708
|
throw invalid2();
|
|
186
|
-
const
|
|
187
|
-
if (
|
|
709
|
+
const parts2 = value.slice(8).split("/");
|
|
710
|
+
if (parts2.length < 2 || parts2.length > 4 || parts2.some((part) => !/^\d+$/.test(part)))
|
|
188
711
|
throw invalid2();
|
|
189
|
-
const ids2 =
|
|
712
|
+
const ids2 = parts2.map(Number);
|
|
190
713
|
const reference2 = {
|
|
191
714
|
type: "meeting",
|
|
192
715
|
accountId: integer2(ids2[0]),
|
|
@@ -198,7 +721,7 @@ var parseMeetingReference = /* @__PURE__ */ __name((text7) => {
|
|
|
198
721
|
}, "parseMeetingReference");
|
|
199
722
|
var canonicalMeetingReference = /* @__PURE__ */ __name((text7) => formatMeetingReference(parseMeetingReference(text7)), "canonicalMeetingReference");
|
|
200
723
|
|
|
201
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
724
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/item.js
|
|
202
725
|
var text = string();
|
|
203
726
|
var count = pipe(number(), integer(), minValue(0));
|
|
204
727
|
var MEETING_ISSUES = ["time_without_zone"];
|
|
@@ -263,7 +786,7 @@ var MEETING_QUERY = {
|
|
|
263
786
|
})
|
|
264
787
|
};
|
|
265
788
|
|
|
266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
789
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/answers.js
|
|
267
790
|
var text2 = string();
|
|
268
791
|
var count2 = pipe(number(), integer(), minValue(0));
|
|
269
792
|
var iso2 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
@@ -466,10 +989,10 @@ var meetingHitItem = /* @__PURE__ */ __name((hit) => ({
|
|
|
466
989
|
var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search meetings", args = {}, meta = {}) => {
|
|
467
990
|
const items = found.items.map(meetingHitItem);
|
|
468
991
|
const cursor = found.hasMore && found.nextCursor !== null ? found.nextCursor : void 0;
|
|
469
|
-
const
|
|
992
|
+
const pending2 = found.coverage.indexing === "pending";
|
|
470
993
|
const next = [
|
|
471
994
|
...cursor === void 0 ? [] : [stepOf(PAGE_NEXT, { command, args: { ...args, cursor, limit }, values: { shown: items.length } })],
|
|
472
|
-
...
|
|
995
|
+
...pending2 ? [
|
|
473
996
|
stepOf(SEARCH_AGAIN, {
|
|
474
997
|
command,
|
|
475
998
|
args: Object.fromEntries(Object.entries(args).filter(([key]) => key !== "cursor"))
|
|
@@ -485,7 +1008,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
|
|
|
485
1008
|
...cursor === void 0 ? {} : { next_cursor: cursor }
|
|
486
1009
|
},
|
|
487
1010
|
...next.length > 0 ? { next } : {},
|
|
488
|
-
...
|
|
1011
|
+
...pending2 ? {
|
|
489
1012
|
missing: [
|
|
490
1013
|
{
|
|
491
1014
|
field: "excerpt",
|
|
@@ -498,7 +1021,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
|
|
|
498
1021
|
};
|
|
499
1022
|
}, "meetingHitsList");
|
|
500
1023
|
|
|
501
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1024
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
|
|
502
1025
|
var joinKeyOf = /* @__PURE__ */ __name((url) => {
|
|
503
1026
|
const parsed = urlOf(url);
|
|
504
1027
|
if (!parsed)
|
|
@@ -532,7 +1055,7 @@ var urlOf = /* @__PURE__ */ __name((url) => {
|
|
|
532
1055
|
}
|
|
533
1056
|
}, "urlOf");
|
|
534
1057
|
|
|
535
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1058
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
|
|
536
1059
|
var ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'", apos: "'", nbsp: " " };
|
|
537
1060
|
var SECRET_LINE = /(?<![\p{L}\p{N}])(pass ?codes?|passwords?|pwd|pins?|access ?codes?|meeting ?codes?|kennwort|пароль|пин-?код|код доступа)(?![\p{L}\p{N}])|pwd=/iu;
|
|
538
1061
|
var htmlToText = /* @__PURE__ */ __name((html) => html.replace(/<\s*br\s*\/?>/giu, "\n").replace(/<\/\s*(p|div|li|tr|h[1-6])\s*>/giu, "\n").replace(/<a\s[^>]*href\s*=\s*"([^"]*)"[^>]*>/giu, " $1 ").replace(/<[^>]+>/gu, "").replace(/&(amp|lt|gt|quot|#39|apos|nbsp);/gu, (_, name) => ENTITIES[name] ?? ""), "htmlToText");
|
|
@@ -541,8 +1064,8 @@ var calendarText = /* @__PURE__ */ __name((text7, { dropSecretLines = true } = {
|
|
|
541
1064
|
if (!text7)
|
|
542
1065
|
return null;
|
|
543
1066
|
const kept = htmlToText(text7).split(/\r?\n/u).map((line2) => withoutLinkQueries(line2).replace(/[ \t]+/gu, " ").trim()).filter((line2) => !dropSecretLines || !SECRET_LINE.test(line2));
|
|
544
|
-
const
|
|
545
|
-
return
|
|
1067
|
+
const joined2 = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
|
|
1068
|
+
return joined2 || null;
|
|
546
1069
|
}, "calendarText");
|
|
547
1070
|
var ENTRY_METADATA_KEYS = [
|
|
548
1071
|
"colorId",
|
|
@@ -569,7 +1092,7 @@ var entryMetadata = /* @__PURE__ */ __name((metadata) => {
|
|
|
569
1092
|
return kept;
|
|
570
1093
|
}, "entryMetadata");
|
|
571
1094
|
|
|
572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1095
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
|
|
573
1096
|
import { createHash } from "node:crypto";
|
|
574
1097
|
var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256").update(JSON.stringify({
|
|
575
1098
|
reference: cue2.reference,
|
|
@@ -583,7 +1106,7 @@ var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256"
|
|
|
583
1106
|
text: cue2.text
|
|
584
1107
|
})).digest("hex"), "meetingCueFingerprint");
|
|
585
1108
|
|
|
586
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1109
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
|
|
587
1110
|
var EVENT_QUERY = defineQuery({
|
|
588
1111
|
entity: "event",
|
|
589
1112
|
backend: "sql",
|
|
@@ -599,7 +1122,7 @@ var EVENT_QUERY = defineQuery({
|
|
|
599
1122
|
]
|
|
600
1123
|
});
|
|
601
1124
|
|
|
602
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1125
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
|
|
603
1126
|
var UNTIL = /(?:^|;)UNTIL=(\d{4})(\d{2})(\d{2})(?:T(\d{2})(\d{2})(\d{2})Z?)?(?:;|$)/iu;
|
|
604
1127
|
var seriesEnd = /* @__PURE__ */ __name((entry) => {
|
|
605
1128
|
if (entry.recurrenceEndsAt !== null)
|
|
@@ -608,8 +1131,8 @@ var seriesEnd = /* @__PURE__ */ __name((entry) => {
|
|
|
608
1131
|
const until = rule === void 0 ? null : UNTIL.exec(rule.slice("RRULE:".length));
|
|
609
1132
|
if (!until)
|
|
610
1133
|
return Number.POSITIVE_INFINITY;
|
|
611
|
-
const [, year, month,
|
|
612
|
-
return Date.UTC(Number(year), Number(month) - 1, Number(
|
|
1134
|
+
const [, year, month, day2, hour = "23", minute = "59", second = "59"] = until;
|
|
1135
|
+
return Date.UTC(Number(year), Number(month) - 1, Number(day2), Number(hour), Number(minute), Number(second)) + 864e5;
|
|
613
1136
|
}, "seriesEnd");
|
|
614
1137
|
var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
|
|
615
1138
|
if (entry.kind === "occurrence" && !entry.exception)
|
|
@@ -622,7 +1145,7 @@ var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
|
|
|
622
1145
|
return Math.max(entry.endsAt ?? start, start + 1) > window.from;
|
|
623
1146
|
}, "entryInWindow");
|
|
624
1147
|
|
|
625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1148
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/events.js
|
|
626
1149
|
var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now()) => {
|
|
627
1150
|
const current = await store.meeting(details.meeting.id);
|
|
628
1151
|
if (!current)
|
|
@@ -665,7 +1188,7 @@ var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now())
|
|
|
665
1188
|
return (await store.events()).find((e) => e.id === linked?.meeting.eventId) ?? null;
|
|
666
1189
|
}, "linkEvent");
|
|
667
1190
|
|
|
668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1191
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
|
|
669
1192
|
var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((text7) => text7.normalize("NFKC").toLowerCase(), "normalizeMeetingParticipantQuery");
|
|
670
1193
|
var validateMeetingParticipantQuery = /* @__PURE__ */ __name((query) => {
|
|
671
1194
|
if (typeof query !== "string" || !query.trim() || query.length > 500 || query.includes("\0"))
|
|
@@ -689,7 +1212,7 @@ var validateMeetingParticipantSearch = /* @__PURE__ */ __name((query, input) =>
|
|
|
689
1212
|
};
|
|
690
1213
|
}, "validateMeetingParticipantSearch");
|
|
691
1214
|
|
|
692
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1215
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/reads.js
|
|
693
1216
|
var MeetingError = class extends CliError {
|
|
694
1217
|
static {
|
|
695
1218
|
__name(this, "MeetingError");
|
|
@@ -821,7 +1344,7 @@ var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store, id5, accountId)
|
|
|
821
1344
|
return wholeList(details.summaries.map((one) => meetingSummaryItem(details.meeting.accountId, one)));
|
|
822
1345
|
}, "meetingSummaryAnswer");
|
|
823
1346
|
|
|
824
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1347
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/export.js
|
|
825
1348
|
var timestamp = /* @__PURE__ */ __name((milliseconds) => {
|
|
826
1349
|
if (!Number.isSafeInteger(milliseconds) || milliseconds < 0)
|
|
827
1350
|
throw new MeetingError("validation_error", "transcript times must be nonnegative integer milliseconds");
|
|
@@ -883,30 +1406,30 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id5, options) => {
|
|
|
883
1406
|
text: row.text
|
|
884
1407
|
})));
|
|
885
1408
|
} else {
|
|
886
|
-
const
|
|
1409
|
+
const parts2 = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
|
|
887
1410
|
if (details.meeting.description !== null)
|
|
888
|
-
|
|
1411
|
+
parts2.push("## Description", quote(details.meeting.description));
|
|
889
1412
|
for (const summary of details.summaries) {
|
|
890
|
-
|
|
1413
|
+
parts2.push(`## ${heading(summary.title ?? "Summary")}`);
|
|
891
1414
|
if (summary.content !== null)
|
|
892
|
-
|
|
1415
|
+
parts2.push(quote(summary.content));
|
|
893
1416
|
else {
|
|
894
1417
|
if (summary.overview !== null)
|
|
895
|
-
|
|
1418
|
+
parts2.push(quote(summary.overview));
|
|
896
1419
|
for (const section of summary.sections)
|
|
897
|
-
|
|
1420
|
+
parts2.push(`### ${heading(section.label)}`, quote(section.text));
|
|
898
1421
|
if (summary.nextSteps.length > 0)
|
|
899
|
-
|
|
1422
|
+
parts2.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
|
|
900
1423
|
}
|
|
901
1424
|
}
|
|
902
1425
|
for (const part of transcripts) {
|
|
903
|
-
|
|
1426
|
+
parts2.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
|
|
904
1427
|
if (part.transcript.supersededAt !== null)
|
|
905
|
-
|
|
1428
|
+
parts2.push("Version: superseded");
|
|
906
1429
|
for (const row of [...part.rows].sort((a, b) => a.position - b.position))
|
|
907
|
-
|
|
1430
|
+
parts2.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
|
|
908
1431
|
}
|
|
909
|
-
content = `${
|
|
1432
|
+
content = `${parts2.join("\n\n")}
|
|
910
1433
|
`;
|
|
911
1434
|
}
|
|
912
1435
|
return {
|
|
@@ -917,10 +1440,10 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id5, options) => {
|
|
|
917
1440
|
};
|
|
918
1441
|
}, "exportMeeting");
|
|
919
1442
|
|
|
920
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1443
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
921
1444
|
import { createHash as createHash2 } from "node:crypto";
|
|
922
1445
|
|
|
923
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1446
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
|
|
924
1447
|
var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
|
|
925
1448
|
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T.+(?:Z|[+-]\d{2}:\d{2})$/i.test(value) || !Number.isFinite(Date.parse(value)))
|
|
926
1449
|
throw new CliError("validation_error", `${name} must be an ISO timestamp with a timezone, such as 2026-11-09T09:00:00Z`);
|
|
@@ -931,7 +1454,7 @@ var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
|
|
|
931
1454
|
return new Date(value).toISOString();
|
|
932
1455
|
}, "meetingTimestamp");
|
|
933
1456
|
|
|
934
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1457
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
935
1458
|
var TASK_TYPES = ["bug", "feature", "chore"];
|
|
936
1459
|
var invalid3 = /* @__PURE__ */ __name((message) => {
|
|
937
1460
|
throw new CliError("validation_error", message);
|
|
@@ -945,10 +1468,10 @@ var findingHash = /* @__PURE__ */ __name((value) => createHash2("sha256").update
|
|
|
945
1468
|
var snakeCase = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snakeCase");
|
|
946
1469
|
var findingWhere = /* @__PURE__ */ __name((of) => {
|
|
947
1470
|
const id5 = typeof of.id === "string" ? of.id : null;
|
|
948
|
-
const
|
|
1471
|
+
const kind2 = typeof of.kind === "string" ? of.kind : null;
|
|
949
1472
|
return {
|
|
950
|
-
where: id5 ||
|
|
951
|
-
named: { ...id5 ? { finding: id5 } : {}, ...
|
|
1473
|
+
where: id5 || kind2 ? ` in ${[id5, kind2 && `(${kind2})`].filter(Boolean).join(" ")}` : "",
|
|
1474
|
+
named: { ...id5 ? { finding: id5 } : {}, ...kind2 ? { kind: kind2 } : {} }
|
|
952
1475
|
};
|
|
953
1476
|
}, "findingWhere");
|
|
954
1477
|
var findingFields = /* @__PURE__ */ __name((value, allowed, noun, of = value) => {
|
|
@@ -976,13 +1499,15 @@ var validEvidence = /* @__PURE__ */ __name((raw, rules) => {
|
|
|
976
1499
|
const evidence = raw.map((item) => {
|
|
977
1500
|
if (!item || typeof item !== "object")
|
|
978
1501
|
return invalid3("finding evidence is a reference and fingerprint");
|
|
979
|
-
findingFields(item, ["reference", "fingerprint"], rules.singular);
|
|
1502
|
+
findingFields(item, rules.quotes ? ["reference", "fingerprint", "quote"] : ["reference", "fingerprint"], rules.singular);
|
|
980
1503
|
if (typeof item.reference !== "string" || typeof item.fingerprint !== "string")
|
|
981
1504
|
return invalid3("evidence requires a reference and fingerprint");
|
|
982
1505
|
const reference2 = rules.reference(item.reference);
|
|
983
1506
|
if (!/^[a-f0-9]{64}$/.test(item.fingerprint))
|
|
984
1507
|
return invalid3(`finding evidence requires exact ${rules.cited} references and fingerprints`);
|
|
985
|
-
|
|
1508
|
+
if (item.quote === void 0)
|
|
1509
|
+
return { reference: reference2, fingerprint: item.fingerprint };
|
|
1510
|
+
return { reference: reference2, fingerprint: item.fingerprint, quote: findingText(item.quote, rules.quotes ?? 0) };
|
|
986
1511
|
}).sort((a, b) => a.reference.localeCompare(b.reference));
|
|
987
1512
|
if (new Set(evidence.map((item) => item.reference)).size !== evidence.length)
|
|
988
1513
|
return invalid3(`duplicate evidence ${rules.cited}`);
|
|
@@ -1104,7 +1629,7 @@ var validateBatch = /* @__PURE__ */ __name((input, rules, most, one) => {
|
|
|
1104
1629
|
var validateFindings = /* @__PURE__ */ __name((input, rules) => validateBatch(input, rules, 16, (finding, ids2) => validateFinding(finding, rules, ids2)), "validateFindings");
|
|
1105
1630
|
var findingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "findingFingerprint");
|
|
1106
1631
|
|
|
1107
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/findings.js
|
|
1108
1633
|
var MEETING_FINDINGS_KIND = "meeting_findings";
|
|
1109
1634
|
var cue = /* @__PURE__ */ __name((raw) => {
|
|
1110
1635
|
const reference2 = canonicalMeetingReference(raw);
|
|
@@ -1115,7 +1640,7 @@ var cue = /* @__PURE__ */ __name((raw) => {
|
|
|
1115
1640
|
var validateMeetingFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "meeting findings", singular: "meeting finding", cited: "cue", reference: cue }), "validateMeetingFindings");
|
|
1116
1641
|
var meetingFindingFingerprint = findingFingerprint;
|
|
1117
1642
|
|
|
1118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1643
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
|
|
1119
1644
|
var context = {
|
|
1120
1645
|
command: "search meetings",
|
|
1121
1646
|
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
|
|
@@ -1178,7 +1703,7 @@ var MEETING_FIELDS = defineQuery({
|
|
|
1178
1703
|
});
|
|
1179
1704
|
var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
|
|
1180
1705
|
var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
|
|
1181
|
-
var liftMeetingFields = /* @__PURE__ */ __name((query, request, now) => {
|
|
1706
|
+
var liftMeetingFields = /* @__PURE__ */ __name((query, request, now, timezone) => {
|
|
1182
1707
|
let ast;
|
|
1183
1708
|
try {
|
|
1184
1709
|
ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
|
|
@@ -1204,7 +1729,7 @@ var liftMeetingFields = /* @__PURE__ */ __name((query, request, now) => {
|
|
|
1204
1729
|
if (node.field === "date") {
|
|
1205
1730
|
once("since", "--since-time");
|
|
1206
1731
|
once("until", "--until-time");
|
|
1207
|
-
const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive !== false, node.upper_inclusive !== false, timezoneOf(), node.span, now);
|
|
1732
|
+
const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive !== false, node.upper_inclusive !== false, timezoneOf(timezone), node.span, now);
|
|
1208
1733
|
if (range.lower !== void 0)
|
|
1209
1734
|
next.since = range.lower + (range.lower_inclusive ? 0 : 1);
|
|
1210
1735
|
if (range.upper !== void 0)
|
|
@@ -1235,7 +1760,7 @@ var meetingWordsQuery = /* @__PURE__ */ __name((text7) => {
|
|
|
1235
1760
|
return { version: 1, language: "lucene-v1", root };
|
|
1236
1761
|
}, "meetingWordsQuery");
|
|
1237
1762
|
|
|
1238
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1763
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/language.js
|
|
1239
1764
|
var LATIN_WORDS = {
|
|
1240
1765
|
en: ["the", "and", "is", "that", "you", "this", "what", "have", "with", "are"],
|
|
1241
1766
|
es: ["el", "los", "las", "por", "pero", "para", "est\xE1", "muy", "tambi\xE9n", "hay"],
|
|
@@ -1284,7 +1809,7 @@ var transcriptLanguage = /* @__PURE__ */ __name((texts) => {
|
|
|
1284
1809
|
return null;
|
|
1285
1810
|
}, "transcriptLanguage");
|
|
1286
1811
|
|
|
1287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1812
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
|
|
1288
1813
|
var contentHash = /* @__PURE__ */ __name(async (text7) => {
|
|
1289
1814
|
const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text7));
|
|
1290
1815
|
return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
@@ -1321,7 +1846,7 @@ var timestamp2 = /* @__PURE__ */ __name((value) => {
|
|
|
1321
1846
|
return time2;
|
|
1322
1847
|
}, "timestamp");
|
|
1323
1848
|
|
|
1324
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1849
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
|
|
1325
1850
|
var TranscriptTextError = class extends Error {
|
|
1326
1851
|
static {
|
|
1327
1852
|
__name(this, "TranscriptTextError");
|
|
@@ -1376,7 +1901,7 @@ var parseTranscriptText = /* @__PURE__ */ __name((input) => {
|
|
|
1376
1901
|
return { header, lines };
|
|
1377
1902
|
}, "parseTranscriptText");
|
|
1378
1903
|
|
|
1379
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1904
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
|
|
1380
1905
|
var VttError = class extends Error {
|
|
1381
1906
|
static {
|
|
1382
1907
|
__name(this, "VttError");
|
|
@@ -1428,7 +1953,7 @@ var parseVtt = /* @__PURE__ */ __name((input) => {
|
|
|
1428
1953
|
return cues;
|
|
1429
1954
|
}, "parseVtt");
|
|
1430
1955
|
|
|
1431
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1956
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/import.js
|
|
1432
1957
|
var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now()) => {
|
|
1433
1958
|
const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
|
|
1434
1959
|
for (const file of files) {
|
|
@@ -1461,10 +1986,10 @@ var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now())
|
|
|
1461
1986
|
return report;
|
|
1462
1987
|
}, "importFiles");
|
|
1463
1988
|
|
|
1464
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1989
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/links.js
|
|
1465
1990
|
var CHAT_MESSAGES_READ = 1e5;
|
|
1466
1991
|
|
|
1467
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1992
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/provider.js
|
|
1468
1993
|
var snapshotMeetingScope = /* @__PURE__ */ __name((scope2) => {
|
|
1469
1994
|
const provider = scope2?.provider;
|
|
1470
1995
|
const account = scope2?.account;
|
|
@@ -1473,7 +1998,7 @@ var snapshotMeetingScope = /* @__PURE__ */ __name((scope2) => {
|
|
|
1473
1998
|
return Object.freeze({ provider, account });
|
|
1474
1999
|
}, "snapshotMeetingScope");
|
|
1475
2000
|
|
|
1476
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2001
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
|
|
1477
2002
|
var nonempty = /* @__PURE__ */ __name((value, name) => {
|
|
1478
2003
|
if (typeof value !== "string" || !value.trim())
|
|
1479
2004
|
throw new CliError("validation_error", `${name} must be nonempty`);
|
|
@@ -1539,7 +2064,7 @@ var dispatchMeetingMutation = /* @__PURE__ */ __name(async (options, dispatch) =
|
|
|
1539
2064
|
return { applied: true, value: await dispatch(signal) };
|
|
1540
2065
|
}, "dispatchMeetingMutation");
|
|
1541
2066
|
|
|
1542
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2067
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/meeting-context.js
|
|
1543
2068
|
var id = /* @__PURE__ */ __name((value) => {
|
|
1544
2069
|
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
|
|
1545
2070
|
throw new CliError("validation_error", "meeting context identifiers must be positive integers");
|
|
@@ -1661,7 +2186,7 @@ var createMeetingContext = /* @__PURE__ */ __name((scope2, accountId, ports) =>
|
|
|
1661
2186
|
};
|
|
1662
2187
|
}, "createMeetingContext");
|
|
1663
2188
|
|
|
1664
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2189
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
|
|
1665
2190
|
var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
|
|
1666
2191
|
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
1667
2192
|
throw new CliError("validation_error", "meeting preparation context is required");
|
|
@@ -1686,7 +2211,7 @@ var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
|
|
|
1686
2211
|
return { ...input, limit, maxReadBytes };
|
|
1687
2212
|
}, "validateMeetingPreparationContext");
|
|
1688
2213
|
|
|
1689
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2214
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
|
|
1690
2215
|
var count3 = pipe(number(), integer(), minValue(0));
|
|
1691
2216
|
var id2 = pipe(string(), minLength(1));
|
|
1692
2217
|
var meetingProjectEvidence = strictObject({
|
|
@@ -1807,7 +2332,7 @@ var meetingProjectEvidenceAnswer = /* @__PURE__ */ __name((page, prepared, comma
|
|
|
1807
2332
|
};
|
|
1808
2333
|
}, "meetingProjectEvidenceAnswer");
|
|
1809
2334
|
|
|
1810
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2335
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
|
|
1811
2336
|
var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
|
|
1812
2337
|
const integer3 = /* @__PURE__ */ __name((value, low, high) => Number.isSafeInteger(value) && value >= low && value <= high, "integer");
|
|
1813
2338
|
if (typeof query !== "string" || !query.trim() || query.includes("\0") || new TextEncoder().encode(query).byteLength > 65536 || !integer3(options.limit ?? 100, 1, 1e3) || !integer3(options.maxReadBytes ?? 4194304, 1, 67108864) || [
|
|
@@ -1827,7 +2352,7 @@ var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
|
|
|
1827
2352
|
throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
|
|
1828
2353
|
}, "validateMeetingHitSearch");
|
|
1829
2354
|
|
|
1830
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2355
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
|
|
1831
2356
|
var ids = {
|
|
1832
2357
|
meeting_id: "meetingId",
|
|
1833
2358
|
identity_id: "participantIdentityId",
|
|
@@ -1918,7 +2443,7 @@ var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project2, request =
|
|
|
1918
2443
|
return { project: project2.trim(), options, query: frozen.join(" AND ") };
|
|
1919
2444
|
}, "prepareMeetingProjectEvidence");
|
|
1920
2445
|
|
|
1921
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2446
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
|
|
1922
2447
|
var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project2, request = {}, now = Date.now()) => {
|
|
1923
2448
|
const prepared = prepareMeetingProjectEvidence(project2, request, now);
|
|
1924
2449
|
const page = await read(prepared.project, prepared.options);
|
|
@@ -1926,7 +2451,7 @@ var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project2, r
|
|
|
1926
2451
|
return meetingProjectEvidenceAnswer(page, prepared);
|
|
1927
2452
|
}, "readMeetingProjectEvidence");
|
|
1928
2453
|
|
|
1929
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2454
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/pull.js
|
|
1930
2455
|
var participantInput = /* @__PURE__ */ __name((p, provider, occurrenceId2, position, accountId) => {
|
|
1931
2456
|
const { identityExternalId, ...fields2 } = p;
|
|
1932
2457
|
const externalId = identityExternalId ?? (p.email ? `email:${p.email.toLowerCase()}` : p.externalId) ?? `name:${p.displayName ?? "unknown"}@${accountId}/${occurrenceId2}:${position}`;
|
|
@@ -2088,7 +2613,7 @@ unlinked`, format)],
|
|
|
2088
2613
|
return report;
|
|
2089
2614
|
}, "pull");
|
|
2090
2615
|
|
|
2091
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2616
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
|
|
2092
2617
|
var text4 = string();
|
|
2093
2618
|
var count4 = pipe(number(), integer(), minValue(0));
|
|
2094
2619
|
var id3 = pipe(number(), integer(), minValue(1));
|
|
@@ -2282,10 +2807,10 @@ var eventItem = /* @__PURE__ */ __name((one) => ({
|
|
|
2282
2807
|
updated_at: new Date(one.updatedAt).toISOString()
|
|
2283
2808
|
}), "eventItem");
|
|
2284
2809
|
|
|
2285
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2810
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
|
|
2286
2811
|
var strongRecordingValidator = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length <= 1024 && /^"[\x21\x23-\x7e\x80-\xff]*"$/.test(value), "strongRecordingValidator");
|
|
2287
2812
|
|
|
2288
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2813
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
|
|
2289
2814
|
var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
2290
2815
|
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
2291
2816
|
throw new CliError("validation_error", "related history request is required");
|
|
@@ -2315,7 +2840,7 @@ var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
|
2315
2840
|
return { ...input, anchorIds: [...new Set(input.anchorIds)], limit, maxReadBytes };
|
|
2316
2841
|
}, "validateMeetingRelatedHistory");
|
|
2317
2842
|
|
|
2318
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
|
|
2319
2844
|
var text5 = string();
|
|
2320
2845
|
var identifier = pipe(text5, minLength(1));
|
|
2321
2846
|
var nullableText = nullable(text5);
|
|
@@ -2357,7 +2882,8 @@ var personResult = strictObject({
|
|
|
2357
2882
|
participant_id: identifier,
|
|
2358
2883
|
person_uid: text5,
|
|
2359
2884
|
previous_person_uid: nullableText,
|
|
2360
|
-
changed: flag
|
|
2885
|
+
changed: flag,
|
|
2886
|
+
proposal: optional(text5)
|
|
2361
2887
|
});
|
|
2362
2888
|
var meetingChange = strictObject({
|
|
2363
2889
|
scope,
|
|
@@ -2448,14 +2974,14 @@ var MEETING_RESULT_ENTITIES = {
|
|
|
2448
2974
|
meeting_repair: repair
|
|
2449
2975
|
};
|
|
2450
2976
|
|
|
2451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2977
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/review.js
|
|
2452
2978
|
var REVIEW_LIMIT = { default: 50, most: 200 };
|
|
2453
2979
|
|
|
2454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2980
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
|
|
2455
2981
|
var SAVE_HELP = `Worth keeping \u2014 a decision, a promise, a preference? Record it with \`memo facts add\` or
|
|
2456
2982
|
\`memo memories add\`, citing the msg: locator or meeting: reference as --evidence.`;
|
|
2457
2983
|
|
|
2458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
|
|
2459
2985
|
var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
|
|
2460
2986
|
input.signal?.throwIfAborted();
|
|
2461
2987
|
if (!Number.isSafeInteger(input.accountId) || input.accountId <= 0)
|
|
@@ -2476,10 +3002,10 @@ var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
|
|
|
2476
3002
|
return { ...input, limit, maxReadBytes };
|
|
2477
3003
|
}, "validateMeetingSeriesHistory");
|
|
2478
3004
|
|
|
2479
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3005
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
|
|
2480
3006
|
var occurrenceId = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim().length > 0 && value.length <= 1e3 && !/[\0\r\n]/.test(value), "occurrenceId");
|
|
2481
3007
|
|
|
2482
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3008
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
|
|
2483
3009
|
function invalid4(field, response = false) {
|
|
2484
3010
|
throw new CliError(response ? "invalid_response" : "validation_error", `invalid meeting inventory ${field}`);
|
|
2485
3011
|
}
|
|
@@ -2508,7 +3034,7 @@ var validateMeetingSeriesInventoryCursor = /* @__PURE__ */ __name((value) => {
|
|
|
2508
3034
|
cursorDetails(value);
|
|
2509
3035
|
}, "validateMeetingSeriesInventoryCursor");
|
|
2510
3036
|
|
|
2511
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3037
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/stats.js
|
|
2512
3038
|
var MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
|
|
2513
3039
|
var zoneOf = /* @__PURE__ */ __name((timeZone) => {
|
|
2514
3040
|
const zone = timeZone ?? "UTC";
|
|
@@ -2521,13 +3047,13 @@ var zoneOf = /* @__PURE__ */ __name((timeZone) => {
|
|
|
2521
3047
|
}, "zoneOf");
|
|
2522
3048
|
var DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
2523
3049
|
var weekStart = /* @__PURE__ */ __name((at, format) => {
|
|
2524
|
-
const
|
|
2525
|
-
const
|
|
2526
|
-
return new Date(
|
|
3050
|
+
const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
3051
|
+
const day2 = Date.UTC(Number(parts2.year), Number(parts2.month) - 1, Number(parts2.day));
|
|
3052
|
+
return new Date(day2 - DAYS.indexOf(parts2.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
|
|
2527
3053
|
}, "weekStart");
|
|
2528
3054
|
var dayKey = /* @__PURE__ */ __name((at, format) => {
|
|
2529
|
-
const
|
|
2530
|
-
return `${
|
|
3055
|
+
const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
3056
|
+
return `${parts2.year}-${parts2.month}-${parts2.day}`;
|
|
2531
3057
|
}, "dayKey");
|
|
2532
3058
|
var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
|
|
2533
3059
|
timeZone: zone,
|
|
@@ -2643,7 +3169,17 @@ var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
|
|
|
2643
3169
|
};
|
|
2644
3170
|
}, "aggregateMeetingStats");
|
|
2645
3171
|
|
|
2646
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3172
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/store.js
|
|
3173
|
+
var READ_BUDGET_EXCEEDED = "Meeting search exceeds its stored text byte budget";
|
|
3174
|
+
|
|
3175
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/store/source-review.js
|
|
3176
|
+
var SOURCE_REVIEW_KIND = "memory_source_review";
|
|
3177
|
+
var SOURCE_REVIEW_CAUSES = ["changed", "outdated", "deleted", "contradicted"];
|
|
3178
|
+
var ERASED_TEXT = "[source erased]";
|
|
3179
|
+
var severity = /* @__PURE__ */ __name((cause) => SOURCE_REVIEW_CAUSES.indexOf(cause), "severity");
|
|
3180
|
+
var graver = /* @__PURE__ */ __name((a, b) => severity(b) > severity(a) ? b : a, "graver");
|
|
3181
|
+
|
|
3182
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/tasks/model.js
|
|
2647
3183
|
var TASK_KINDS = ["question", "request", "mention", "promise"];
|
|
2648
3184
|
var TASK_STATES = ["open", "todo", "in_progress", "done", "dismissed"];
|
|
2649
3185
|
var CLOSED_STATES = ["done", "dismissed"];
|
|
@@ -2658,7 +3194,7 @@ function closeTask(task, state, by, at, reason) {
|
|
|
2658
3194
|
}
|
|
2659
3195
|
__name(closeTask, "closeTask");
|
|
2660
3196
|
|
|
2661
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3197
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/tasks/priority.js
|
|
2662
3198
|
var PRIORITY_LABELS = ["low", "medium", "high", "critical"];
|
|
2663
3199
|
var MIDDLE = { low: 0.125, medium: 0.375, high: 0.625, critical: 0.875 };
|
|
2664
3200
|
var LEGACY_PRIORITY_SCORES = [0.875, 0.625, 0.375, 0.1875, 0.0625];
|
|
@@ -2687,7 +3223,7 @@ var priorityOf = /* @__PURE__ */ __name((value) => {
|
|
|
2687
3223
|
}, "priorityOf");
|
|
2688
3224
|
var priorityOption = /* @__PURE__ */ __name((value) => priorityOf(value) ?? "none", "priorityOption");
|
|
2689
3225
|
|
|
2690
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3226
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/tasks/service.js
|
|
2691
3227
|
function createTaskService({ store, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now"), newId = /* @__PURE__ */ __name(() => crypto.randomUUID(), "newId") }) {
|
|
2692
3228
|
async function find(id5) {
|
|
2693
3229
|
const task = await store.get(id5);
|
|
@@ -2747,13 +3283,13 @@ function median(values) {
|
|
|
2747
3283
|
}
|
|
2748
3284
|
__name(median, "median");
|
|
2749
3285
|
|
|
2750
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3286
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/tasks/store.js
|
|
2751
3287
|
function matches(task, filter) {
|
|
2752
3288
|
return (filter.account === void 0 || task.account === filter.account) && (filter.state === void 0 || task.state === filter.state) && (filter.group === void 0 || task.group === filter.group) && (filter.kind === void 0 || task.kind === filter.kind) && (filter.createdBefore === void 0 || task.createdAt < filter.createdBefore);
|
|
2753
3289
|
}
|
|
2754
3290
|
__name(matches, "matches");
|
|
2755
3291
|
|
|
2756
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3292
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/knowledge.js
|
|
2757
3293
|
var FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed", "rejected"];
|
|
2758
3294
|
var MEMORY_KINDS = ["summary", "digest", "preference"];
|
|
2759
3295
|
var MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"];
|
|
@@ -2761,7 +3297,10 @@ var MEMORY_SCOPES = ["personal", "work"];
|
|
|
2761
3297
|
var WORK_TASK_TYPES = ["bug", "feature", "chore"];
|
|
2762
3298
|
var TASK_TYPES2 = [...WORK_TASK_TYPES, ...TASK_KINDS];
|
|
2763
3299
|
|
|
2764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3300
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/categories.js
|
|
3301
|
+
var CATEGORIES = ["client", "supplier", "partner", "employer"];
|
|
3302
|
+
|
|
3303
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/entities/fields.js
|
|
2765
3304
|
var text6 = string();
|
|
2766
3305
|
var id4 = pipe(string(), minLength(1));
|
|
2767
3306
|
var time = isoTime;
|
|
@@ -2779,13 +3318,14 @@ var evidenceSource = strictObject({
|
|
|
2779
3318
|
tool: nullable(text6),
|
|
2780
3319
|
missing: boolean()
|
|
2781
3320
|
});
|
|
3321
|
+
var sourceReview = nullable(strictObject({ id: id4, cause: picklist(SOURCE_REVIEW_CAUSES) }));
|
|
2782
3322
|
var author = strictObject({
|
|
2783
3323
|
type: picklist(["person", "bot"]),
|
|
2784
3324
|
id: id4,
|
|
2785
3325
|
name: nullable(text6)
|
|
2786
3326
|
});
|
|
2787
3327
|
|
|
2788
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3328
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
|
|
2789
3329
|
var organization = strictObject({
|
|
2790
3330
|
id: id4,
|
|
2791
3331
|
ref: reference,
|
|
@@ -2815,108 +3355,7 @@ var reminder = strictObject({
|
|
|
2815
3355
|
receipt: nullable(text6)
|
|
2816
3356
|
});
|
|
2817
3357
|
|
|
2818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2819
|
-
import { readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
2820
|
-
var damageMarkPath = /* @__PURE__ */ __name((store) => `${store}.damaged.json`, "damageMarkPath");
|
|
2821
|
-
var healthMarkPath = /* @__PURE__ */ __name((store) => `${store}.health.json`, "healthMarkPath");
|
|
2822
|
-
var inodeOf = /* @__PURE__ */ __name((store) => statSync(store, { throwIfNoEntry: false })?.ino, "inodeOf");
|
|
2823
|
-
var readJson = /* @__PURE__ */ __name((path) => {
|
|
2824
|
-
try {
|
|
2825
|
-
return JSON.parse(readFileSync(path, "utf8"));
|
|
2826
|
-
} catch (error) {
|
|
2827
|
-
if (error.code === "ENOENT")
|
|
2828
|
-
return null;
|
|
2829
|
-
throw error;
|
|
2830
|
-
}
|
|
2831
|
-
}, "readJson");
|
|
2832
|
-
var ownerStoreInTests = /* @__PURE__ */ __name((store) => {
|
|
2833
|
-
try {
|
|
2834
|
-
refuseOwnerStoreInTests(store);
|
|
2835
|
-
return false;
|
|
2836
|
-
} catch {
|
|
2837
|
-
return true;
|
|
2838
|
-
}
|
|
2839
|
-
}, "ownerStoreInTests");
|
|
2840
|
-
var sqliteFailure = /* @__PURE__ */ __name((error) => isCliFailure(error) && error.details?.reason === "store.damaged" ? error.cause : error, "sqliteFailure");
|
|
2841
|
-
var markStoreDamaged = /* @__PURE__ */ __name((error, { store, command, version, runId, now = Date.now }) => {
|
|
2842
|
-
const failure = sqliteFailure(error);
|
|
2843
|
-
if (!isStoreDamage(failure) || ownerStoreInTests(store))
|
|
2844
|
-
return false;
|
|
2845
|
-
const inode = inodeOf(store);
|
|
2846
|
-
if (inode === void 0)
|
|
2847
|
-
return false;
|
|
2848
|
-
const mark = {
|
|
2849
|
-
at: new Date(now()).toISOString(),
|
|
2850
|
-
command,
|
|
2851
|
-
...version ? { cli_version: version } : {},
|
|
2852
|
-
...runId ? { run_id: runId } : {},
|
|
2853
|
-
error: failure.message.slice(0, 500),
|
|
2854
|
-
inode
|
|
2855
|
-
};
|
|
2856
|
-
try {
|
|
2857
|
-
writeFileSync(damageMarkPath(store), `${JSON.stringify(mark, null, 2)}
|
|
2858
|
-
`, { flag: "wx", mode: 384 });
|
|
2859
|
-
return true;
|
|
2860
|
-
} catch {
|
|
2861
|
-
return false;
|
|
2862
|
-
}
|
|
2863
|
-
}, "markStoreDamaged");
|
|
2864
|
-
var readDamageMark = /* @__PURE__ */ __name((store) => {
|
|
2865
|
-
const path = damageMarkPath(store);
|
|
2866
|
-
let mark;
|
|
2867
|
-
try {
|
|
2868
|
-
mark = readJson(path);
|
|
2869
|
-
} catch {
|
|
2870
|
-
return { at: "unknown", command: "unknown", error: `${path} cannot be read`, inode: inodeOf(store) ?? 0 };
|
|
2871
|
-
}
|
|
2872
|
-
if (mark === null)
|
|
2873
|
-
return null;
|
|
2874
|
-
if (mark.inode !== inodeOf(store)) {
|
|
2875
|
-
clearDamageMark(store);
|
|
2876
|
-
return null;
|
|
2877
|
-
}
|
|
2878
|
-
return mark;
|
|
2879
|
-
}, "readDamageMark");
|
|
2880
|
-
var clearDamageMark = /* @__PURE__ */ __name((store) => rmSync(damageMarkPath(store), { force: true }), "clearDamageMark");
|
|
2881
|
-
var refuseDamagedStore = /* @__PURE__ */ __name((store, cli) => {
|
|
2882
|
-
const mark = readDamageMark(store);
|
|
2883
|
-
if (!mark)
|
|
2884
|
-
return;
|
|
2885
|
-
throw new CliError("configuration_error", `the store was found damaged at ${mark.at} by \`${mark.command}\` (${mark.error}), so nothing writes to it until it is recovered; \`${cli ?? "<cli>"} store recover\` says what is damaged and what to do`, { reason: "store.damaged" });
|
|
2886
|
-
}, "refuseDamagedStore");
|
|
2887
|
-
var readHealthMark = /* @__PURE__ */ __name((store) => {
|
|
2888
|
-
try {
|
|
2889
|
-
return readJson(healthMarkPath(store));
|
|
2890
|
-
} catch {
|
|
2891
|
-
return null;
|
|
2892
|
-
}
|
|
2893
|
-
}, "readHealthMark");
|
|
2894
|
-
var recordDeepCheck = /* @__PURE__ */ __name((store, health, { cli, version, schema, now = Date.now }) => {
|
|
2895
|
-
const previous = readHealthMark(store);
|
|
2896
|
-
if (ownerStoreInTests(store))
|
|
2897
|
-
return { previous, cleared: null };
|
|
2898
|
-
const checkedAt = new Date(now()).toISOString();
|
|
2899
|
-
const mark = {
|
|
2900
|
-
checked_at: checkedAt,
|
|
2901
|
-
ok: health.ok,
|
|
2902
|
-
problems: health.problems ?? 0,
|
|
2903
|
-
schema,
|
|
2904
|
-
cli,
|
|
2905
|
-
...version ? { cli_version: version } : {},
|
|
2906
|
-
last_ok_at: health.ok ? checkedAt : previous?.last_ok_at ?? null
|
|
2907
|
-
};
|
|
2908
|
-
const cleared = health.ok ? readDamageMark(store) : null;
|
|
2909
|
-
try {
|
|
2910
|
-
writeFileSync(healthMarkPath(store), `${JSON.stringify(mark, null, 2)}
|
|
2911
|
-
`, { mode: 384 });
|
|
2912
|
-
} catch {
|
|
2913
|
-
}
|
|
2914
|
-
if (cleared)
|
|
2915
|
-
clearDamageMark(store);
|
|
2916
|
-
return { previous, cleared };
|
|
2917
|
-
}, "recordDeepCheck");
|
|
2918
|
-
|
|
2919
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/money.js
|
|
3358
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/money.js
|
|
2920
3359
|
var CURRENCY_SCALES = {
|
|
2921
3360
|
AED: 2,
|
|
2922
3361
|
AMD: 2,
|
|
@@ -3010,7 +3449,7 @@ var quantityOf = /* @__PURE__ */ __name((text7) => {
|
|
|
3010
3449
|
}, "quantityOf");
|
|
3011
3450
|
var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
|
|
3012
3451
|
|
|
3013
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3452
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/finance.js
|
|
3014
3453
|
var INVOICE_DIRECTIONS = ["receivable", "payable"];
|
|
3015
3454
|
var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
|
|
3016
3455
|
var MONEY_DIRECTIONS = ["in", "out"];
|
|
@@ -3039,7 +3478,722 @@ var paymentLine = /* @__PURE__ */ __name((payment) => {
|
|
|
3039
3478
|
var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
|
|
3040
3479
|
var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
|
|
3041
3480
|
|
|
3042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3481
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/business.js
|
|
3482
|
+
var CATALOG_KINDS = ["product", "service"];
|
|
3483
|
+
var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
|
|
3484
|
+
var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
|
|
3485
|
+
var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
|
|
3486
|
+
var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
|
|
3487
|
+
var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
|
|
3488
|
+
var TRANSACTION_STATUSES = ["pending", "booked"];
|
|
3489
|
+
var ORDER_DIRECTIONS = ["purchase", "sale"];
|
|
3490
|
+
var intervalOf = /* @__PURE__ */ __name((text7, reason = "subscription.interval") => {
|
|
3491
|
+
const match = typeof text7 === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text7.trim()) : null;
|
|
3492
|
+
if (!match)
|
|
3493
|
+
throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
|
|
3494
|
+
return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
|
|
3495
|
+
}, "intervalOf");
|
|
3496
|
+
var intervalText = /* @__PURE__ */ __name(({ count: count7, unit }) => `${count7}-${unit}`, "intervalText");
|
|
3497
|
+
var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
|
|
3498
|
+
var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
|
|
3499
|
+
var productLine = /* @__PURE__ */ __name((product) => {
|
|
3500
|
+
const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
|
|
3501
|
+
const per = price && product.unit !== null ? ` per ${product.unit}` : "";
|
|
3502
|
+
return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
|
|
3503
|
+
}, "productLine");
|
|
3504
|
+
var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
|
|
3505
|
+
var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
|
|
3506
|
+
var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
|
|
3507
|
+
var transactionLine = /* @__PURE__ */ __name((transaction) => `${moneyLabel(transaction.amount, transaction.currency)} ${transaction.direction}${transaction.label === null ? "" : ` \xB7 ${transaction.label}`}, ${dayMonth(transaction.date)}` + notes(transaction.status === "pending" ? "pending" : null, pending(transaction.review)), "transactionLine");
|
|
3508
|
+
|
|
3509
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/store/marks.js
|
|
3510
|
+
import { readFileSync as readFileSync2, rmSync as rmSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
3511
|
+
var damageMarkPath = /* @__PURE__ */ __name((store) => `${store}.damaged.json`, "damageMarkPath");
|
|
3512
|
+
var healthMarkPath = /* @__PURE__ */ __name((store) => `${store}.health.json`, "healthMarkPath");
|
|
3513
|
+
var journalMarkPath = /* @__PURE__ */ __name((store) => `${store}.journal.json`, "journalMarkPath");
|
|
3514
|
+
var inodeOf = /* @__PURE__ */ __name((store) => statSync2(store, { throwIfNoEntry: false })?.ino, "inodeOf");
|
|
3515
|
+
var readJson = /* @__PURE__ */ __name((path) => {
|
|
3516
|
+
try {
|
|
3517
|
+
return JSON.parse(readFileSync2(path, "utf8"));
|
|
3518
|
+
} catch (error) {
|
|
3519
|
+
if (error.code === "ENOENT")
|
|
3520
|
+
return null;
|
|
3521
|
+
throw error;
|
|
3522
|
+
}
|
|
3523
|
+
}, "readJson");
|
|
3524
|
+
var ownerStoreInTests = /* @__PURE__ */ __name((store) => {
|
|
3525
|
+
try {
|
|
3526
|
+
refuseOwnerStoreInTests(store);
|
|
3527
|
+
return false;
|
|
3528
|
+
} catch {
|
|
3529
|
+
return true;
|
|
3530
|
+
}
|
|
3531
|
+
}, "ownerStoreInTests");
|
|
3532
|
+
var sqliteFailure = /* @__PURE__ */ __name((error) => isCliFailure(error) && error.details?.reason === "store.damaged" ? error.cause : error, "sqliteFailure");
|
|
3533
|
+
var markStoreDamaged = /* @__PURE__ */ __name((error, { store, command, version, runId, now = Date.now }) => {
|
|
3534
|
+
const failure = sqliteFailure(error);
|
|
3535
|
+
if (!isStoreDamage(failure) || ownerStoreInTests(store))
|
|
3536
|
+
return false;
|
|
3537
|
+
const inode = inodeOf(store);
|
|
3538
|
+
if (inode === void 0)
|
|
3539
|
+
return false;
|
|
3540
|
+
const mark = {
|
|
3541
|
+
at: new Date(now()).toISOString(),
|
|
3542
|
+
command,
|
|
3543
|
+
...version ? { cli_version: version } : {},
|
|
3544
|
+
...runId ? { run_id: runId } : {},
|
|
3545
|
+
error: failure.message.slice(0, 500),
|
|
3546
|
+
inode
|
|
3547
|
+
};
|
|
3548
|
+
try {
|
|
3549
|
+
writeFileSync2(damageMarkPath(store), `${JSON.stringify(mark, null, 2)}
|
|
3550
|
+
`, { flag: "wx", mode: 384 });
|
|
3551
|
+
return true;
|
|
3552
|
+
} catch {
|
|
3553
|
+
return false;
|
|
3554
|
+
}
|
|
3555
|
+
}, "markStoreDamaged");
|
|
3556
|
+
var readDamageMark = /* @__PURE__ */ __name((store) => {
|
|
3557
|
+
const path = damageMarkPath(store);
|
|
3558
|
+
let mark;
|
|
3559
|
+
try {
|
|
3560
|
+
mark = readJson(path);
|
|
3561
|
+
} catch {
|
|
3562
|
+
return { at: "unknown", command: "unknown", error: `${path} cannot be read`, inode: inodeOf(store) ?? 0 };
|
|
3563
|
+
}
|
|
3564
|
+
if (mark === null)
|
|
3565
|
+
return null;
|
|
3566
|
+
if (mark.inode !== inodeOf(store)) {
|
|
3567
|
+
clearDamageMark(store);
|
|
3568
|
+
return null;
|
|
3569
|
+
}
|
|
3570
|
+
return mark;
|
|
3571
|
+
}, "readDamageMark");
|
|
3572
|
+
var clearDamageMark = /* @__PURE__ */ __name((store) => rmSync2(damageMarkPath(store), { force: true }), "clearDamageMark");
|
|
3573
|
+
var refuseDamagedStore = /* @__PURE__ */ __name((store, cli) => {
|
|
3574
|
+
const mark = readDamageMark(store);
|
|
3575
|
+
if (!mark)
|
|
3576
|
+
return;
|
|
3577
|
+
throw new CliError("configuration_error", `the store was found damaged at ${mark.at} by \`${mark.command}\` (${mark.error}), so nothing writes to it until it is recovered; \`${cli ?? "<cli>"} store recover\` says what is damaged and what to do`, { reason: "store.damaged" });
|
|
3578
|
+
}, "refuseDamagedStore");
|
|
3579
|
+
var markJournalLost = /* @__PURE__ */ __name((store, { seen, command, now = Date.now }) => {
|
|
3580
|
+
if (ownerStoreInTests(store))
|
|
3581
|
+
return;
|
|
3582
|
+
const mark = { at: new Date(now()).toISOString(), command, seen };
|
|
3583
|
+
try {
|
|
3584
|
+
writeFileSync2(journalMarkPath(store), `${JSON.stringify(mark, null, 2)}
|
|
3585
|
+
`, { flag: "wx", mode: 384 });
|
|
3586
|
+
} catch {
|
|
3587
|
+
}
|
|
3588
|
+
}, "markJournalLost");
|
|
3589
|
+
var readJournalMark = /* @__PURE__ */ __name((store) => {
|
|
3590
|
+
try {
|
|
3591
|
+
return readJson(journalMarkPath(store));
|
|
3592
|
+
} catch {
|
|
3593
|
+
return null;
|
|
3594
|
+
}
|
|
3595
|
+
}, "readJournalMark");
|
|
3596
|
+
var readHealthMark = /* @__PURE__ */ __name((store) => {
|
|
3597
|
+
try {
|
|
3598
|
+
return readJson(healthMarkPath(store));
|
|
3599
|
+
} catch {
|
|
3600
|
+
return null;
|
|
3601
|
+
}
|
|
3602
|
+
}, "readHealthMark");
|
|
3603
|
+
var recordDeepCheck = /* @__PURE__ */ __name((store, health, { cli, version, schema, now = Date.now }) => {
|
|
3604
|
+
const previous = readHealthMark(store);
|
|
3605
|
+
if (ownerStoreInTests(store))
|
|
3606
|
+
return { previous, cleared: null };
|
|
3607
|
+
const checkedAt = new Date(now()).toISOString();
|
|
3608
|
+
const mark = {
|
|
3609
|
+
checked_at: checkedAt,
|
|
3610
|
+
ok: health.ok,
|
|
3611
|
+
problems: health.problems ?? 0,
|
|
3612
|
+
schema,
|
|
3613
|
+
cli,
|
|
3614
|
+
...version ? { cli_version: version } : {},
|
|
3615
|
+
last_ok_at: health.ok ? checkedAt : previous?.last_ok_at ?? null
|
|
3616
|
+
};
|
|
3617
|
+
const cleared = health.ok ? readDamageMark(store) : null;
|
|
3618
|
+
try {
|
|
3619
|
+
writeFileSync2(healthMarkPath(store), `${JSON.stringify(mark, null, 2)}
|
|
3620
|
+
`, { mode: 384 });
|
|
3621
|
+
} catch {
|
|
3622
|
+
}
|
|
3623
|
+
if (cleared)
|
|
3624
|
+
clearDamageMark(store);
|
|
3625
|
+
if (health.ok)
|
|
3626
|
+
rmSync2(journalMarkPath(store), { force: true });
|
|
3627
|
+
return { previous, cleared };
|
|
3628
|
+
}, "recordDeepCheck");
|
|
3629
|
+
|
|
3630
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/locator.js
|
|
3631
|
+
var SCHEME = "msg:";
|
|
3632
|
+
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
|
|
3633
|
+
var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
|
|
3634
|
+
var parseLocator = /* @__PURE__ */ __name((reference2) => {
|
|
3635
|
+
const trimmed = reference2.trim();
|
|
3636
|
+
const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
|
|
3637
|
+
if (parts2.length !== 4 || parts2.some((part) => part === "")) {
|
|
3638
|
+
throw new CliError("validation_error", `"${singleLine(reference2)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`);
|
|
3639
|
+
}
|
|
3640
|
+
const [provider, account, chat, message] = parts2.map(decodeURIComponent);
|
|
3641
|
+
return { provider, account, chat, message };
|
|
3642
|
+
}, "parseLocator");
|
|
3643
|
+
|
|
3644
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/references.js
|
|
3645
|
+
var SIMPLE_REFERENCES = [
|
|
3646
|
+
"note",
|
|
3647
|
+
"document",
|
|
3648
|
+
"person",
|
|
3649
|
+
"organization",
|
|
3650
|
+
"project",
|
|
3651
|
+
"task",
|
|
3652
|
+
"memory",
|
|
3653
|
+
"fact",
|
|
3654
|
+
"bot",
|
|
3655
|
+
"event",
|
|
3656
|
+
"invoice",
|
|
3657
|
+
"payment",
|
|
3658
|
+
"order",
|
|
3659
|
+
"deal",
|
|
3660
|
+
"lead",
|
|
3661
|
+
"pipeline",
|
|
3662
|
+
"product",
|
|
3663
|
+
"contract",
|
|
3664
|
+
"subscription",
|
|
3665
|
+
"wallet",
|
|
3666
|
+
"transaction",
|
|
3667
|
+
"entity"
|
|
3668
|
+
];
|
|
3669
|
+
var malformed = /* @__PURE__ */ __name((text7, shape) => new CliError("validation_error", `"${singleLine(text7)}" is not a reference \u2014 expected ${shape}`, {
|
|
3670
|
+
reason: "ref.malformed"
|
|
3671
|
+
}), "malformed");
|
|
3672
|
+
var parts = /* @__PURE__ */ __name((rest, count7, text7, shape) => {
|
|
3673
|
+
const split = rest.split("/");
|
|
3674
|
+
if (split.length !== count7 || split.some((part) => part === ""))
|
|
3675
|
+
throw malformed(text7, shape);
|
|
3676
|
+
return split.map(decodeURIComponent);
|
|
3677
|
+
}, "parts");
|
|
3678
|
+
var encoded = /* @__PURE__ */ __name((...values) => values.map(encodeURIComponent).join("/"), "encoded");
|
|
3679
|
+
var folderPath = /* @__PURE__ */ __name((path) => {
|
|
3680
|
+
const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
|
|
3681
|
+
return clean === "" ? path.trim() === "" ? "" : null : clean;
|
|
3682
|
+
}, "folderPath");
|
|
3683
|
+
var MEETING_SHAPE = "meeting:<account>/<meeting>[/<transcript>[/<cue>]] with safe integer ids";
|
|
3684
|
+
var kind = /* @__PURE__ */ __name((spec) => spec, "kind");
|
|
3685
|
+
var simple = /* @__PURE__ */ __name((prefix) => kind({
|
|
3686
|
+
prefix,
|
|
3687
|
+
type: prefix,
|
|
3688
|
+
shape: `${prefix}:<id>`,
|
|
3689
|
+
parse: /* @__PURE__ */ __name((rest, text7) => {
|
|
3690
|
+
if (!rest.trim())
|
|
3691
|
+
throw new CliError("validation_error", `"${singleLine(text7)}" names no ${prefix}`, {
|
|
3692
|
+
reason: "ref.malformed"
|
|
3693
|
+
});
|
|
3694
|
+
return { type: prefix, id: rest };
|
|
3695
|
+
}, "parse"),
|
|
3696
|
+
format: /* @__PURE__ */ __name((reference2) => `${reference2.type}:${reference2.id}`, "format")
|
|
3697
|
+
}), "simple");
|
|
3698
|
+
var REF_KINDS = [
|
|
3699
|
+
kind({
|
|
3700
|
+
prefix: "msg",
|
|
3701
|
+
type: "message",
|
|
3702
|
+
shape: "msg:<provider>/<account>/<chat>/<message>",
|
|
3703
|
+
parse: /* @__PURE__ */ __name((_, text7) => {
|
|
3704
|
+
try {
|
|
3705
|
+
return { type: "message", ...parseLocator(text7) };
|
|
3706
|
+
} catch {
|
|
3707
|
+
throw malformed(text7, "msg:<provider>/<account>/<chat>/<message>");
|
|
3708
|
+
}
|
|
3709
|
+
}, "parse"),
|
|
3710
|
+
format: formatLocator
|
|
3711
|
+
}),
|
|
3712
|
+
kind({
|
|
3713
|
+
prefix: "chat",
|
|
3714
|
+
type: "chat",
|
|
3715
|
+
shape: "chat:<provider>/<account>/<chat>",
|
|
3716
|
+
parse: /* @__PURE__ */ __name((rest, text7) => {
|
|
3717
|
+
const [provider, account, chat] = parts(rest, 3, text7, "chat:<provider>/<account>/<chat>");
|
|
3718
|
+
return { type: "chat", provider, account, chat };
|
|
3719
|
+
}, "parse"),
|
|
3720
|
+
format: /* @__PURE__ */ __name(({ provider, account, chat }) => `chat:${encoded(provider, account, chat)}`, "format")
|
|
3721
|
+
}),
|
|
3722
|
+
kind({
|
|
3723
|
+
prefix: "contact",
|
|
3724
|
+
type: "contact",
|
|
3725
|
+
shape: "contact:<provider>/<id>",
|
|
3726
|
+
parse: /* @__PURE__ */ __name((rest, text7) => {
|
|
3727
|
+
const [provider, id5] = parts(rest, 2, text7, "contact:<provider>/<id>");
|
|
3728
|
+
return { type: "contact", provider, id: id5 };
|
|
3729
|
+
}, "parse"),
|
|
3730
|
+
format: /* @__PURE__ */ __name(({ provider, id: id5 }) => `contact:${encoded(provider, id5)}`, "format")
|
|
3731
|
+
}),
|
|
3732
|
+
kind({
|
|
3733
|
+
prefix: "folder",
|
|
3734
|
+
type: "folder",
|
|
3735
|
+
shape: "folder:<id>[/<path>]",
|
|
3736
|
+
parse: /* @__PURE__ */ __name((rest, text7) => {
|
|
3737
|
+
const slash = rest.indexOf("/");
|
|
3738
|
+
const id5 = decodeURIComponent(slash < 0 ? rest : rest.slice(0, slash));
|
|
3739
|
+
const path = slash < 0 ? null : folderPath(decodeURIComponent(rest.slice(slash + 1)));
|
|
3740
|
+
if (!id5.trim() || path === "")
|
|
3741
|
+
throw malformed(text7, "folder:<id>[/<path>]");
|
|
3742
|
+
return { type: "folder", id: id5, path };
|
|
3743
|
+
}, "parse"),
|
|
3744
|
+
format: /* @__PURE__ */ __name(({ id: id5, path }) => path === null ? `folder:${encodeURIComponent(id5)}` : `folder:${encoded(id5, path)}`, "format")
|
|
3745
|
+
}),
|
|
3746
|
+
kind({
|
|
3747
|
+
prefix: "meeting",
|
|
3748
|
+
type: "meeting",
|
|
3749
|
+
shape: MEETING_SHAPE,
|
|
3750
|
+
parse: /* @__PURE__ */ __name((_, text7) => {
|
|
3751
|
+
try {
|
|
3752
|
+
return parseMeetingReference(text7);
|
|
3753
|
+
} catch {
|
|
3754
|
+
throw malformed(text7, MEETING_SHAPE);
|
|
3755
|
+
}
|
|
3756
|
+
}, "parse"),
|
|
3757
|
+
format: formatMeetingReference
|
|
3758
|
+
}),
|
|
3759
|
+
...SIMPLE_REFERENCES.map(simple)
|
|
3760
|
+
];
|
|
3761
|
+
var byPrefix = new Map(REF_KINDS.map((spec) => [spec.prefix, spec]));
|
|
3762
|
+
var byType = new Map(REF_KINDS.map((spec) => [spec.type, spec]));
|
|
3763
|
+
var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity");
|
|
3764
|
+
var distance = /* @__PURE__ */ __name((a, b) => {
|
|
3765
|
+
let row = Array.from({ length: b.length + 1 }, (_, at) => at);
|
|
3766
|
+
for (const [i, x] of [...a].entries()) {
|
|
3767
|
+
const next = [i + 1];
|
|
3768
|
+
for (const [j, y] of [...b].entries())
|
|
3769
|
+
next.push(Math.min(row[j + 1] + 1, next[j] + 1, row[j] + (x === y ? 0 : 1)));
|
|
3770
|
+
row = next;
|
|
3771
|
+
}
|
|
3772
|
+
return row[b.length];
|
|
3773
|
+
}, "distance");
|
|
3774
|
+
var nearest = /* @__PURE__ */ __name((typed) => offered.find((prefix) => typed.length >= 2 && prefix.startsWith(typed)) ?? offered.map((prefix) => ({ prefix, far: distance(typed, prefix) })).filter(({ far }) => far <= 2).sort((a, b) => a.far - b.far)[0]?.prefix, "nearest");
|
|
3775
|
+
var unknownKind = /* @__PURE__ */ __name((text7, prefix, rest) => {
|
|
3776
|
+
const near2 = prefix === "" ? void 0 : nearest(prefix);
|
|
3777
|
+
const kinds = offered.map((one) => `${one}:`).join(", ");
|
|
3778
|
+
const hint = near2 === void 0 ? `; kinds: ${kinds}` : `; did you mean ${near2}:${singleLine(rest)}? Kinds: ${kinds}`;
|
|
3779
|
+
return new CliError("validation_error", `"${singleLine(text7)}" is no kind of reference${hint}`, {
|
|
3780
|
+
reason: "ref.unknown-kind"
|
|
3781
|
+
});
|
|
3782
|
+
}, "unknownKind");
|
|
3783
|
+
var formatReference = /* @__PURE__ */ __name((reference2) => byType.get(reference2.type).format(reference2), "formatReference");
|
|
3784
|
+
var parseReference = /* @__PURE__ */ __name((text7) => {
|
|
3785
|
+
const reference2 = text7.trim();
|
|
3786
|
+
const colon = reference2.indexOf(":");
|
|
3787
|
+
const prefix = colon < 0 ? "" : reference2.slice(0, colon);
|
|
3788
|
+
const rest = reference2.slice(colon + 1);
|
|
3789
|
+
const spec = byPrefix.get(prefix);
|
|
3790
|
+
if (!spec)
|
|
3791
|
+
throw unknownKind(reference2, prefix, rest);
|
|
3792
|
+
return spec.parse(rest, reference2);
|
|
3793
|
+
}, "parseReference");
|
|
3794
|
+
var canonicalReference = /* @__PURE__ */ __name((text7) => formatReference(parseReference(text7)), "canonicalReference");
|
|
3795
|
+
var looksLikeReference = /* @__PURE__ */ __name((text7) => {
|
|
3796
|
+
const match = /^([a-z]+):\S+$/.exec(text7.trim());
|
|
3797
|
+
return match !== null && byPrefix.has(match[1]);
|
|
3798
|
+
}, "looksLikeReference");
|
|
3799
|
+
|
|
3800
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/providers.js
|
|
3801
|
+
var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events", "crm"];
|
|
3802
|
+
var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
|
|
3803
|
+
var PROVIDERS = [
|
|
3804
|
+
{ name: "telegram", kind: "messages", aliases: ["tg"], command: "tg", opens: MESSENGER_OPENS },
|
|
3805
|
+
{ name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
|
|
3806
|
+
{ name: "max", kind: "messages", aliases: [], command: "max", opens: MESSENGER_OPENS },
|
|
3807
|
+
{ name: "max-bot", kind: "messages", aliases: [] },
|
|
3808
|
+
{ name: "whatsapp", kind: "messages", aliases: ["wa"], command: "wa", opens: MESSENGER_OPENS },
|
|
3809
|
+
{ name: "whatsapp-bot", kind: "messages", aliases: ["wa-bot"] },
|
|
3810
|
+
{ name: "email", kind: "mail", aliases: [] },
|
|
3811
|
+
{ name: "notes", kind: "notes", aliases: [] },
|
|
3812
|
+
{ name: "local", kind: "notes", aliases: [] },
|
|
3813
|
+
{ name: "obsidian", kind: "notes", aliases: [] },
|
|
3814
|
+
{ name: "added", kind: "notes", aliases: [] },
|
|
3815
|
+
{ name: "zoom", kind: "meetings", aliases: [] },
|
|
3816
|
+
// A phone export's records: its SMS and its calls in the one account the import names.
|
|
3817
|
+
{ name: "phone", kind: "messages", kinds: ["messages", "events"], aliases: [], imported: true }
|
|
3818
|
+
];
|
|
3819
|
+
var LABELS = {
|
|
3820
|
+
telegram: "Telegram",
|
|
3821
|
+
"telegram-bot": "Telegram bot",
|
|
3822
|
+
max: "MAX",
|
|
3823
|
+
"max-bot": "MAX bot",
|
|
3824
|
+
whatsapp: "WhatsApp",
|
|
3825
|
+
"whatsapp-bot": "WhatsApp bot",
|
|
3826
|
+
"google-drive": "Google Drive",
|
|
3827
|
+
added: "added by hand",
|
|
3828
|
+
email: "mail"
|
|
3829
|
+
};
|
|
3830
|
+
var providerLabel = /* @__PURE__ */ __name((provider) => LABELS[provider] ?? provider, "providerLabel");
|
|
3831
|
+
var FOLDER_PROVIDERS = ["local", "obsidian", "folder"];
|
|
3832
|
+
var isFolderProvider = /* @__PURE__ */ __name((provider) => FOLDER_PROVIDERS.includes(provider), "isFolderProvider");
|
|
3833
|
+
var folderProviderSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${FOLDER_PROVIDERS.map((name) => `'${name}'`).join(", ")})`, "folderProviderSql");
|
|
3834
|
+
var folderProviderOf = /* @__PURE__ */ __name((format) => format === "markdown" ? "local" : "obsidian", "folderProviderOf");
|
|
3835
|
+
var DOCUMENT_ACCOUNT_PROVIDERS = ["google-drive"];
|
|
3836
|
+
var isDocumentAccountProvider = /* @__PURE__ */ __name((provider) => DOCUMENT_ACCOUNT_PROVIDERS.includes(provider), "isDocumentAccountProvider");
|
|
3837
|
+
var ADDED_PROVIDER = "added";
|
|
3838
|
+
var ADDED_ACCOUNT = "owner";
|
|
3839
|
+
var notAdded = `d.account_id NOT IN (SELECT id FROM accounts WHERE provider = '${ADDED_PROVIDER}')`;
|
|
3840
|
+
var filesAccountSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${[...FOLDER_PROVIDERS, ...DOCUMENT_ACCOUNT_PROVIDERS, ADDED_PROVIDER].map((name) => `'${name}'`).join(", ")})`, "filesAccountSql");
|
|
3841
|
+
var INTERNAL_NOTES = "internal";
|
|
3842
|
+
var UNKNOWN_PROVIDER = "unknown provider \u2014 run its CLI once";
|
|
3843
|
+
var WORD = /^[a-z0-9][a-z0-9_-]*$/;
|
|
3844
|
+
var invalid5 = /* @__PURE__ */ __name((message) => {
|
|
3845
|
+
throw new CliError("validation_error", message);
|
|
3846
|
+
}, "invalid");
|
|
3847
|
+
var wordOf = /* @__PURE__ */ __name((value, what) => typeof value === "string" && WORD.test(value) ? value : invalid5(`${what} is lowercase letters, digits, - and _ \u2014 not ${JSON.stringify(value)}`), "wordOf");
|
|
3848
|
+
var OPEN_KINDS = new Set(REF_KINDS.map(({ type }) => type).filter((type) => type !== "entity"));
|
|
3849
|
+
var COMMAND_WORDS = /^[a-z0-9][a-z0-9_-]*( [a-z0-9][a-z0-9_-]*)*$/;
|
|
3850
|
+
var opensOf = /* @__PURE__ */ __name((value, named) => {
|
|
3851
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
3852
|
+
return invalid5(`provider ${named}'s opens maps a kind of reference to a command`);
|
|
3853
|
+
const known = Object.entries(value).filter(([kind2]) => OPEN_KINDS.has(kind2));
|
|
3854
|
+
for (const [kind2, command] of known)
|
|
3855
|
+
if (typeof command !== "string" || !COMMAND_WORDS.test(command))
|
|
3856
|
+
invalid5(`provider ${named} opens a ${kind2} with command words, not ${JSON.stringify(command)}`);
|
|
3857
|
+
return Object.fromEntries(known);
|
|
3858
|
+
}, "opensOf");
|
|
3859
|
+
var providerEntryOf = /* @__PURE__ */ __name((value) => {
|
|
3860
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
3861
|
+
return invalid5("a provider entry is an object");
|
|
3862
|
+
const { name, kind: kind2, kinds, aliases = [], command, opens, imported } = value;
|
|
3863
|
+
const named = wordOf(name, "a provider's name");
|
|
3864
|
+
const isKindWord = /* @__PURE__ */ __name((one) => typeof one === "string" && KINDS.includes(one), "isKindWord");
|
|
3865
|
+
const given = kinds === void 0 ? [kind2] : Array.isArray(kinds) && kinds.length > 0 ? kinds : [void 0];
|
|
3866
|
+
for (const one of given)
|
|
3867
|
+
if (!isKindWord(one))
|
|
3868
|
+
invalid5(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(one)}`);
|
|
3869
|
+
const list = [...new Set(given)];
|
|
3870
|
+
if (kind2 !== void 0 && kind2 !== list[0])
|
|
3871
|
+
invalid5(`provider ${named}'s kind is the first of its kinds`);
|
|
3872
|
+
if (!Array.isArray(aliases))
|
|
3873
|
+
invalid5(`provider ${named}'s aliases are a list`);
|
|
3874
|
+
if (imported !== void 0 && typeof imported !== "boolean")
|
|
3875
|
+
invalid5(`provider ${named}'s imported is true or false`);
|
|
3876
|
+
return {
|
|
3877
|
+
name: named,
|
|
3878
|
+
kind: list[0],
|
|
3879
|
+
...list.length > 1 ? { kinds: list } : {},
|
|
3880
|
+
...imported === true ? { imported: true } : {},
|
|
3881
|
+
aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
|
|
3882
|
+
...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) },
|
|
3883
|
+
...opens === void 0 ? {} : { opens: opensOf(opens, named) }
|
|
3884
|
+
};
|
|
3885
|
+
}, "providerEntryOf");
|
|
3886
|
+
var kindsOfEntry = /* @__PURE__ */ __name((entry) => entry.kinds ?? [entry.kind], "kindsOfEntry");
|
|
3887
|
+
var describe = /* @__PURE__ */ __name((entry) => `${entry.name} (${kindsOfEntry(entry).join(", ")}${entry.command ? `, from ${entry.command}` : ""})`, "describe");
|
|
3888
|
+
var unitedKinds = /* @__PURE__ */ __name((known, entry) => [
|
|
3889
|
+
.../* @__PURE__ */ new Set([...known, ...entry])
|
|
3890
|
+
], "unitedKinds");
|
|
3891
|
+
var wordsOf = /* @__PURE__ */ __name(({ name, aliases }) => [name, ...aliases], "wordsOf");
|
|
3892
|
+
var joined = /* @__PURE__ */ __name((known, entry) => {
|
|
3893
|
+
const same = known.find(({ name }) => name === entry.name);
|
|
3894
|
+
const kinds = same ? unitedKinds(kindsOfEntry(same), kindsOfEntry(entry)) : kindsOfEntry(entry);
|
|
3895
|
+
if (same && same.kind !== entry.kind)
|
|
3896
|
+
invalid5(`two provider entries disagree on the kind: ${describe(same)} and ${describe(entry)}`);
|
|
3897
|
+
if (same && entry.imported === true && same.imported !== true)
|
|
3898
|
+
invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
|
|
3899
|
+
const merged = same ? {
|
|
3900
|
+
...same,
|
|
3901
|
+
...kinds.length > 1 ? { kinds } : {},
|
|
3902
|
+
aliases: [.../* @__PURE__ */ new Set([...same.aliases, ...entry.aliases])],
|
|
3903
|
+
...entry.command ? { command: entry.command } : {},
|
|
3904
|
+
...entry.opens ? { opens: { ...same.opens, ...entry.opens } } : {}
|
|
3905
|
+
} : entry;
|
|
3906
|
+
const others = known.filter((one) => one !== same);
|
|
3907
|
+
for (const word of wordsOf(merged)) {
|
|
3908
|
+
const owner = others.find((one) => wordsOf(one).includes(word));
|
|
3909
|
+
if (owner)
|
|
3910
|
+
invalid5(`"${word}" names two providers: ${describe(owner)} and ${describe(merged)}`);
|
|
3911
|
+
}
|
|
3912
|
+
return same ? known.map((one) => one === same ? merged : one) : [...known, merged];
|
|
3913
|
+
}, "joined");
|
|
3914
|
+
var registry = PROVIDERS;
|
|
3915
|
+
var providers = /* @__PURE__ */ __name(() => registry, "providers");
|
|
3916
|
+
var useStoredProviders = /* @__PURE__ */ __name((entries) => {
|
|
3917
|
+
const left = [];
|
|
3918
|
+
registry = entries.reduce((known, entry) => {
|
|
3919
|
+
try {
|
|
3920
|
+
return joined(known, providerEntryOf(entry));
|
|
3921
|
+
} catch (error) {
|
|
3922
|
+
if (!(error instanceof CliError))
|
|
3923
|
+
throw error;
|
|
3924
|
+
left.push(entry);
|
|
3925
|
+
return known;
|
|
3926
|
+
}
|
|
3927
|
+
}, PROVIDERS);
|
|
3928
|
+
return left;
|
|
3929
|
+
}, "useStoredProviders");
|
|
3930
|
+
var addProvider = /* @__PURE__ */ __name((entry) => {
|
|
3931
|
+
registry = joined(registry, providerEntryOf(entry));
|
|
3932
|
+
}, "addProvider");
|
|
3933
|
+
var isKind = /* @__PURE__ */ __name((word) => KINDS.includes(word.toLowerCase()), "isKind");
|
|
3934
|
+
var providerNamed = /* @__PURE__ */ __name((word) => {
|
|
3935
|
+
const wanted = word.toLowerCase();
|
|
3936
|
+
return registry.find((entry) => wordsOf(entry).includes(wanted));
|
|
3937
|
+
}, "providerNamed");
|
|
3938
|
+
var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
|
|
3939
|
+
var kindsIn = /* @__PURE__ */ __name((provider) => {
|
|
3940
|
+
if (isFolderProvider(provider))
|
|
3941
|
+
return ["notes"];
|
|
3942
|
+
const entry = registry.find(({ name }) => name === provider);
|
|
3943
|
+
return entry ? kindsOfEntry(entry) : [];
|
|
3944
|
+
}, "kindsIn");
|
|
3945
|
+
var importedOf = /* @__PURE__ */ __name((entry, held) => {
|
|
3946
|
+
const builtIn = PROVIDERS.find(({ name }) => name === entry.name);
|
|
3947
|
+
if (builtIn) {
|
|
3948
|
+
if (entry.imported === true && builtIn.imported !== true)
|
|
3949
|
+
invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
|
|
3950
|
+
return builtIn.imported === true;
|
|
3951
|
+
}
|
|
3952
|
+
if (held === void 0)
|
|
3953
|
+
return entry.imported === true;
|
|
3954
|
+
if (entry.imported === true && held.imported !== true)
|
|
3955
|
+
invalid5(`provider ${entry.name} was registered without imported: an entry cannot make it import-only later`);
|
|
3956
|
+
return held.imported === true;
|
|
3957
|
+
}, "importedOf");
|
|
3958
|
+
var isImportedProvider = /* @__PURE__ */ __name((provider) => registry.find(({ name }) => name === provider)?.imported === true, "isImportedProvider");
|
|
3959
|
+
var holdsKind = /* @__PURE__ */ __name((provider, kind2) => kindsIn(provider).includes(kind2), "holdsKind");
|
|
3960
|
+
var holdsKindOf = /* @__PURE__ */ __name((provider, kind2) => kindIn(provider) === void 0 ? kind2 === "messages" : holdsKind(provider, kind2), "holdsKindOf");
|
|
3961
|
+
var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
|
|
3962
|
+
|
|
3963
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/search/query.js
|
|
3964
|
+
var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
|
|
3965
|
+
var inSource = /* @__PURE__ */ __name((source, provider) => source === "all" || source === "bots" && isBotProvider(provider) || source === "personal" && !isBotProvider(provider) || source === provider || providerNamed(source)?.name === provider || isKind(source) && holdsKindOf(provider, source), "inSource");
|
|
3966
|
+
var fail = /* @__PURE__ */ __name((message) => {
|
|
3967
|
+
throw new CliError("validation_error", message);
|
|
3968
|
+
}, "fail");
|
|
3969
|
+
var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
|
|
3970
|
+
const sources = [...providers2, "personal", "bots", "all"];
|
|
3971
|
+
const source = value.toLowerCase();
|
|
3972
|
+
if (sources.includes(source))
|
|
3973
|
+
return source;
|
|
3974
|
+
if (source === "mail")
|
|
3975
|
+
return "email";
|
|
3976
|
+
if (source === "messages")
|
|
3977
|
+
return source;
|
|
3978
|
+
if (isKind(source))
|
|
3979
|
+
fail(`${name}${source} names ${source}, which a message search does not read \u2014 search ${source === "meetings" || source === "events" ? `all --source ${source}` : "notes"} does`);
|
|
3980
|
+
const named = providerNamed(source);
|
|
3981
|
+
if (named && providers2.includes(named.name))
|
|
3982
|
+
return named.name;
|
|
3983
|
+
return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
|
|
3984
|
+
}, "sourceOf");
|
|
3985
|
+
|
|
3986
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/search/account-list.js
|
|
3987
|
+
var ACCOUNT_GROUPS = "accountGroups";
|
|
3988
|
+
var ACCOUNT_GROUPS_SETTING = "account_groups";
|
|
3989
|
+
var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
|
|
3990
|
+
var fail2 = /* @__PURE__ */ __name((message) => {
|
|
3991
|
+
throw new CliError("validation_error", message);
|
|
3992
|
+
}, "fail");
|
|
3993
|
+
var isAccountList = /* @__PURE__ */ __name((value) => value.includes(",") || value.includes(":"), "isAccountList");
|
|
3994
|
+
var itemsOf = /* @__PURE__ */ __name((value) => {
|
|
3995
|
+
const items = value.split(",").map((item) => item.trim());
|
|
3996
|
+
if (items.some((item) => item === ""))
|
|
3997
|
+
fail2(`"${value}" has an empty entry \u2014 separate accounts with one comma`);
|
|
3998
|
+
return items;
|
|
3999
|
+
}, "itemsOf");
|
|
4000
|
+
var isGroupName = /* @__PURE__ */ __name((name) => GROUP_NAME.test(name), "isGroupName");
|
|
4001
|
+
var groupName = /* @__PURE__ */ __name((name) => isGroupName(name) ? name : fail2(`a group name is letters, digits, - and _ \u2014 not "${name}"`), "groupName");
|
|
4002
|
+
var groupMembers = /* @__PURE__ */ __name((value) => itemsOf(value).map((item) => item.toLowerCase().startsWith("group:") ? fail2(`a group lists accounts, not other groups \u2014 "${item}"`) : item.includes(":") && item.split(":")[1] === "" ? fail2(`"${item}" names no account after the colon`) : item), "groupMembers");
|
|
4003
|
+
var describe2 = /* @__PURE__ */ __name((accounts) => accounts.map(({ provider, account, name }) => `${provider}:${account}${name ? ` (${name})` : ""}`).join(", "), "describe");
|
|
4004
|
+
var listedHolds = /* @__PURE__ */ __name((account, kind2) => (account.kinds ?? (account.kind === void 0 ? [] : [account.kind])).includes(kind2), "listedHolds");
|
|
4005
|
+
var kindHere = /* @__PURE__ */ __name((provider, running) => provider === running.provider ? kindOf(provider) : kindIn(provider), "kindHere");
|
|
4006
|
+
var kindsOfHere = /* @__PURE__ */ __name((provider, running) => {
|
|
4007
|
+
const kinds = kindsIn(provider);
|
|
4008
|
+
return { kind: kindHere(provider, running), ...kinds.length > 1 ? { kinds } : {} };
|
|
4009
|
+
}, "kindsOfHere");
|
|
4010
|
+
var heldOf = /* @__PURE__ */ __name((stored, running) => [
|
|
4011
|
+
...stored.filter(({ provider }) => kindIn(provider) !== "notes" && !isDocumentAccountProvider(provider)).map(({ provider, account, name }) => ({ provider, account, name, ...kindsOfHere(provider, running) })),
|
|
4012
|
+
{ provider: "notes", account: INTERNAL_NOTES, name: null, kind: "notes" },
|
|
4013
|
+
...stored.filter(({ provider }) => isFolderProvider(provider)).map(({ id: id5, name, provider, account }) => ({
|
|
4014
|
+
provider: "notes",
|
|
4015
|
+
account: String(id5),
|
|
4016
|
+
name,
|
|
4017
|
+
kind: "notes",
|
|
4018
|
+
stored: { provider, account }
|
|
4019
|
+
})),
|
|
4020
|
+
...stored.filter(({ provider }) => isDocumentAccountProvider(provider) || provider === ADDED_PROVIDER).map(({ id: id5, provider, account, name }) => ({
|
|
4021
|
+
provider: "notes",
|
|
4022
|
+
account: String(id5),
|
|
4023
|
+
name,
|
|
4024
|
+
kind: "notes",
|
|
4025
|
+
stored: { provider, account }
|
|
4026
|
+
}))
|
|
4027
|
+
], "heldOf");
|
|
4028
|
+
var storedAs = /* @__PURE__ */ __name((held, key) => held.filter(({ stored }) => stored?.provider === key.provider && (key.account === "" || stored.account === key.account)), "storedAs");
|
|
4029
|
+
var registry2 = /* @__PURE__ */ __name(() => providers().map(({ name, aliases }) => aliases.length ? `${name} (${aliases.join(", ")})` : name).join(", "), "registry");
|
|
4030
|
+
var providerOf = /* @__PURE__ */ __name((prefix, held, { running, profiles }) => {
|
|
4031
|
+
const wanted = prefix.toLowerCase();
|
|
4032
|
+
if (wanted === running.command?.toLowerCase())
|
|
4033
|
+
return running.provider;
|
|
4034
|
+
const providers2 = [...new Set(held.map(({ provider }) => provider))];
|
|
4035
|
+
if (providers2.includes(wanted) || isDocumentAccountProvider(wanted))
|
|
4036
|
+
return wanted;
|
|
4037
|
+
const named = providerNamed(wanted);
|
|
4038
|
+
if (named)
|
|
4039
|
+
return named.name;
|
|
4040
|
+
const recorded = Object.values(profiles[wanted] ?? {})[0];
|
|
4041
|
+
if (recorded)
|
|
4042
|
+
return recorded.provider;
|
|
4043
|
+
return fail2(`${prefix} is not a provider \u2014 they are ${registry2()}; the store holds ${providers2.join(", ")}`);
|
|
4044
|
+
}, "providerOf");
|
|
4045
|
+
var profilesOf = /* @__PURE__ */ __name((provider, profiles) => Object.values(profiles).flatMap((named) => Object.entries(named).filter(([, key]) => key.provider === provider)), "profilesOf");
|
|
4046
|
+
var accountOf = /* @__PURE__ */ __name((prefix, ref, held, context3) => {
|
|
4047
|
+
const provider = providerOf(prefix, held, context3);
|
|
4048
|
+
if (isDocumentAccountProvider(provider) && !context3.profiles[prefix.toLowerCase()]?.[ref]) {
|
|
4049
|
+
const stored = storedAs(held, { provider, account: ref })[0];
|
|
4050
|
+
if (stored)
|
|
4051
|
+
return stored;
|
|
4052
|
+
}
|
|
4053
|
+
const folder = isFolderProvider(provider);
|
|
4054
|
+
const ofProvider = folder ? storedAs(held, { provider, account: "" }) : held.filter((one) => one.provider === provider);
|
|
4055
|
+
const byId = ofProvider.find(({ account, stored }) => account === ref || account === ref.toLowerCase() || folder && stored?.account === ref.toUpperCase());
|
|
4056
|
+
if (byId)
|
|
4057
|
+
return byId;
|
|
4058
|
+
const keyed = /* @__PURE__ */ __name((key) => ofProvider.find(({ account }) => account === key.account) ?? {
|
|
4059
|
+
...key,
|
|
4060
|
+
name: null,
|
|
4061
|
+
...kindsOfHere(key.provider, context3.running)
|
|
4062
|
+
}, "keyed");
|
|
4063
|
+
const recorded = context3.profiles[prefix.toLowerCase()]?.[ref];
|
|
4064
|
+
if (recorded && isFolderProvider(recorded.provider)) {
|
|
4065
|
+
const folder2 = held.find((one) => one.provider === "notes" && one.name === recorded.account);
|
|
4066
|
+
if (folder2)
|
|
4067
|
+
return folder2;
|
|
4068
|
+
return fail2(`no stored folder for ${prefix}:${ref}; sync that profile first`);
|
|
4069
|
+
}
|
|
4070
|
+
if (recorded && isDocumentAccountProvider(recorded.provider)) {
|
|
4071
|
+
const account = storedAs(held, recorded)[0];
|
|
4072
|
+
if (account)
|
|
4073
|
+
return account;
|
|
4074
|
+
return fail2(`no stored documents for ${prefix}:${ref}; sync that profile first`);
|
|
4075
|
+
}
|
|
4076
|
+
if (recorded)
|
|
4077
|
+
return keyed(recorded);
|
|
4078
|
+
const byProfile = [
|
|
4079
|
+
...new Map(profilesOf(provider, context3.profiles).filter(([name]) => name === ref).map(([, key]) => [key.account, key])).values()
|
|
4080
|
+
];
|
|
4081
|
+
if (byProfile.length === 1)
|
|
4082
|
+
return keyed(byProfile[0]);
|
|
4083
|
+
const byName = ofProvider.filter(({ name }) => name?.toLowerCase() === ref.toLowerCase());
|
|
4084
|
+
if (byName.length === 1)
|
|
4085
|
+
return byName[0];
|
|
4086
|
+
if (byName.length > 1 || byProfile.length > 1)
|
|
4087
|
+
fail2(`${provider}:${ref} names more than one account \u2014 use the id: ${describe2(ofProvider)}`);
|
|
4088
|
+
const names = profilesOf(provider, context3.profiles).map(([name]) => name);
|
|
4089
|
+
return fail2(`no ${provider} account "${ref}" \u2014 the store holds ${describe2(ofProvider) || "none"}` + (names.length ? `; profiles: ${[...new Set(names)].join(", ")}` : ""));
|
|
4090
|
+
}, "accountOf");
|
|
4091
|
+
var accountsOfWord = /* @__PURE__ */ __name((word, held, context3) => {
|
|
4092
|
+
const wanted = word.toLowerCase();
|
|
4093
|
+
if (wanted === "all")
|
|
4094
|
+
return [...held];
|
|
4095
|
+
if (wanted === "personal" || wanted === "bots")
|
|
4096
|
+
return held.filter((one) => listedHolds(one, "messages") && isBotProvider(one.provider) === (wanted === "bots"));
|
|
4097
|
+
if (isKind(wanted))
|
|
4098
|
+
return held.filter((one) => listedHolds(one, wanted));
|
|
4099
|
+
const recorded = context3.profiles[wanted];
|
|
4100
|
+
if (recorded && Object.values(recorded).every((key) => isFolderProvider(key.provider) || isDocumentAccountProvider(key.provider)))
|
|
4101
|
+
return Object.keys(recorded).map((profile) => accountOf(word, profile, held, context3));
|
|
4102
|
+
const provider = providerOf(word, held, context3);
|
|
4103
|
+
if (isDocumentAccountProvider(provider) || isFolderProvider(provider))
|
|
4104
|
+
return storedAs(held, { provider, account: "" });
|
|
4105
|
+
return held.filter((one) => one.provider === provider);
|
|
4106
|
+
}, "accountsOfWord");
|
|
4107
|
+
var keyOf = /* @__PURE__ */ __name(({ provider, account }) => `${provider}\0${account}`, "keyOf");
|
|
4108
|
+
var sourceOf2 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "sourceOf");
|
|
4109
|
+
var sameAs = /* @__PURE__ */ __name((key) => (one) => one.provider === key.provider && one.account === key.account, "sameAs");
|
|
4110
|
+
var entriesOfList = /* @__PURE__ */ __name((value, context3) => {
|
|
4111
|
+
const held = heldOf(context3.held, context3.running);
|
|
4112
|
+
const entries = [];
|
|
4113
|
+
const entry = /* @__PURE__ */ __name((item, group) => {
|
|
4114
|
+
const colon = item.indexOf(":");
|
|
4115
|
+
if (colon === -1) {
|
|
4116
|
+
try {
|
|
4117
|
+
entries.push({ entry: item, accounts: accountsOfWord(item, held, context3) });
|
|
4118
|
+
} catch (error) {
|
|
4119
|
+
if (!group || !(error instanceof CliError))
|
|
4120
|
+
throw error;
|
|
4121
|
+
fail2(`"${item}" in group ${group}: ${error.message}`);
|
|
4122
|
+
}
|
|
4123
|
+
return;
|
|
4124
|
+
}
|
|
4125
|
+
const prefix = item.slice(0, colon);
|
|
4126
|
+
const ref = item.slice(colon + 1).trim();
|
|
4127
|
+
if (ref === "")
|
|
4128
|
+
fail2(`"${item}" names no account after the colon`);
|
|
4129
|
+
if (prefix.toLowerCase() === "group") {
|
|
4130
|
+
if (group)
|
|
4131
|
+
fail2(`group ${group} lists another group \u2014 a group lists accounts`);
|
|
4132
|
+
const members = context3.groups[ref];
|
|
4133
|
+
if (!members) {
|
|
4134
|
+
const known = Object.keys(context3.groups);
|
|
4135
|
+
fail2(`no account group "${ref}" \u2014 ${known.length ? `there are ${known.join(", ")}` : "none saved yet"}; \`config set ${ACCOUNT_GROUPS_SETTING}.${ref} <accounts>\` saves one`);
|
|
4136
|
+
}
|
|
4137
|
+
for (const member of members)
|
|
4138
|
+
entry(member, ref);
|
|
4139
|
+
return;
|
|
4140
|
+
}
|
|
4141
|
+
entries.push({ entry: item, accounts: [accountOf(prefix, ref, held, context3)] });
|
|
4142
|
+
}, "entry");
|
|
4143
|
+
for (const item of itemsOf(value))
|
|
4144
|
+
entry(item);
|
|
4145
|
+
const { only } = context3;
|
|
4146
|
+
return entries.map(({ entry: entry2, accounts }) => ({
|
|
4147
|
+
entry: entry2,
|
|
4148
|
+
accounts: accounts.filter((one) => only === void 0 || only.has(keyOf(one))).map(({ provider, account, kind: kind2, kinds }) => ({
|
|
4149
|
+
provider,
|
|
4150
|
+
account,
|
|
4151
|
+
kind: kind2,
|
|
4152
|
+
...kinds === void 0 ? {} : { kinds }
|
|
4153
|
+
}))
|
|
4154
|
+
}));
|
|
4155
|
+
}, "entriesOfList");
|
|
4156
|
+
var accountsOfList = /* @__PURE__ */ __name((value, context3) => {
|
|
4157
|
+
const chosen = /* @__PURE__ */ new Map();
|
|
4158
|
+
for (const { accounts } of entriesOfList(value, context3))
|
|
4159
|
+
for (const one of accounts)
|
|
4160
|
+
if (!chosen.has(keyOf(one)))
|
|
4161
|
+
chosen.set(keyOf(one), one);
|
|
4162
|
+
return [...chosen.values()];
|
|
4163
|
+
}, "accountsOfList");
|
|
4164
|
+
var READS = {
|
|
4165
|
+
messages: "messenger messages \u2014 search messages reads them",
|
|
4166
|
+
mail: "a mailbox \u2014 memo search mail reads it",
|
|
4167
|
+
notes: "notes \u2014 search notes reads them",
|
|
4168
|
+
documents: "documents \u2014 search notes reads them",
|
|
4169
|
+
meetings: "meetings \u2014 search all reads them",
|
|
4170
|
+
events: "calendar events \u2014 no search reads them yet",
|
|
4171
|
+
crm: "CRM deals and leads \u2014 search all reads them"
|
|
4172
|
+
};
|
|
4173
|
+
var fitting = /* @__PURE__ */ __name((entries, kinds, what, reasonOf = (kind2) => READS[kind2], alsoFits = () => false) => {
|
|
4174
|
+
const chosen = /* @__PURE__ */ new Map();
|
|
4175
|
+
const skipped = [];
|
|
4176
|
+
for (const { entry, accounts } of entries) {
|
|
4177
|
+
const fits = accounts.filter((one) => kinds.some((kind2) => listedHolds(one, kind2)) || alsoFits(one));
|
|
4178
|
+
for (const { provider, account } of fits)
|
|
4179
|
+
if (!chosen.has(keyOf({ provider, account })))
|
|
4180
|
+
chosen.set(keyOf({ provider, account }), { provider, account });
|
|
4181
|
+
const known = accounts.filter(({ kind: kind2 }) => kind2 !== void 0);
|
|
4182
|
+
const unknown2 = accounts.filter((one) => one.kind === void 0 && !alsoFits(one));
|
|
4183
|
+
if (known.length)
|
|
4184
|
+
for (const { provider, account } of unknown2)
|
|
4185
|
+
skipped.push({ source: `${provider}:${account}`, code: "not_found", reason: UNKNOWN_PROVIDER });
|
|
4186
|
+
if (fits.length)
|
|
4187
|
+
continue;
|
|
4188
|
+
const other = known[0];
|
|
4189
|
+
skipped.push(other?.kind ? { source: entry, code: "validation_error", reason: reasonOf(other.kind) } : unknown2.length ? { source: entry, code: "not_found", reason: UNKNOWN_PROVIDER } : { source: entry, code: "not_found", reason: "no account in the store" });
|
|
4190
|
+
}
|
|
4191
|
+
if (chosen.size === 0)
|
|
4192
|
+
fail2(`--source names nothing ${what} reads: ${skipped.map(({ source, reason }) => `${source} (${reason})`).join(", ")}`);
|
|
4193
|
+
return { accounts: [...chosen.values()], skipped };
|
|
4194
|
+
}, "fitting");
|
|
4195
|
+
|
|
4196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/deals.js
|
|
3043
4197
|
var DEAL_KINDS = ["deal", "lead"];
|
|
3044
4198
|
var DEAL_STATUSES = ["open", "won", "lost"];
|
|
3045
4199
|
var STAGE_OUTCOMES = DEAL_STATUSES;
|
|
@@ -3049,17 +4203,18 @@ var dealLine = /* @__PURE__ */ __name((deal) => {
|
|
|
3049
4203
|
return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
|
|
3050
4204
|
}, "dealLine");
|
|
3051
4205
|
|
|
3052
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4206
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/orders.js
|
|
3053
4207
|
var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
|
|
3054
4208
|
var ORDER_PURPOSES = ["personal", "business", "client", "other"];
|
|
3055
4209
|
var orderLine = /* @__PURE__ */ __name((order) => {
|
|
4210
|
+
const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
|
|
3056
4211
|
const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
|
|
3057
4212
|
const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
|
|
3058
|
-
return `${order.number ?? `#${order.id}`} \xB7 ${
|
|
4213
|
+
return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
|
|
3059
4214
|
}, "orderLine");
|
|
3060
4215
|
var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
|
|
3061
4216
|
|
|
3062
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4217
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/relations.js
|
|
3063
4218
|
var ORGANIZATION_ROLES = [
|
|
3064
4219
|
"employee",
|
|
3065
4220
|
"contractor",
|
|
@@ -3070,6 +4225,21 @@ var ORGANIZATION_ROLES = [
|
|
|
3070
4225
|
"contact"
|
|
3071
4226
|
];
|
|
3072
4227
|
var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
|
|
4228
|
+
var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
|
|
4229
|
+
var RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"];
|
|
4230
|
+
var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
|
|
4231
|
+
var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
|
|
4232
|
+
var checkEngagement = /* @__PURE__ */ __name((kind2, from, to, level) => {
|
|
4233
|
+
if (kind2 !== "member-of" || from !== "person" || to !== "project")
|
|
4234
|
+
throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
|
|
4235
|
+
reason: "relationship.engagement-ends"
|
|
4236
|
+
});
|
|
4237
|
+
if (!isEngagement(level))
|
|
4238
|
+
throw new CliError("validation_error", `an engagement level is one of ${ENGAGEMENT_LEVELS.join(", ")}`, {
|
|
4239
|
+
reason: "relationship.engagement-unknown"
|
|
4240
|
+
});
|
|
4241
|
+
return level;
|
|
4242
|
+
}, "checkEngagement");
|
|
3073
4243
|
var RELATIONS = {
|
|
3074
4244
|
"member-of": {
|
|
3075
4245
|
from: ["person", "organization", "project", "chat", "email_thread"],
|
|
@@ -3080,46 +4250,58 @@ var RELATIONS = {
|
|
|
3080
4250
|
"customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
|
|
3081
4251
|
"partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
|
|
3082
4252
|
"related-to": {
|
|
3083
|
-
from: ["person", "organization", "project", "task", "deal", "lead"],
|
|
4253
|
+
from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
|
|
3084
4254
|
to: ["person", "organization", "project", "task"],
|
|
3085
|
-
roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES } }
|
|
4255
|
+
roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
|
|
3086
4256
|
}
|
|
3087
4257
|
};
|
|
3088
4258
|
var RELATION_KINDS = Object.keys(RELATIONS);
|
|
3089
|
-
var specOf = /* @__PURE__ */ __name((
|
|
3090
|
-
var isRelationKind = /* @__PURE__ */ __name((
|
|
4259
|
+
var specOf = /* @__PURE__ */ __name((kind2) => Object.hasOwn(RELATIONS, kind2) ? RELATIONS[kind2] : void 0, "specOf");
|
|
4260
|
+
var isRelationKind = /* @__PURE__ */ __name((kind2) => specOf(kind2) !== void 0, "isRelationKind");
|
|
3091
4261
|
var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
|
|
3092
|
-
var
|
|
3093
|
-
|
|
4262
|
+
var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
|
|
4263
|
+
var checkEnds = /* @__PURE__ */ __name((kind2, from, to) => {
|
|
4264
|
+
const spec = specOf(kind2);
|
|
3094
4265
|
if (!spec)
|
|
3095
4266
|
throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
|
|
3096
|
-
if (memberOnly(from) && (
|
|
4267
|
+
if (memberOnly(from) && (kind2 !== "member-of" || to !== "project"))
|
|
3097
4268
|
throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
|
|
4269
|
+
if (partyOnly(from, to))
|
|
4270
|
+
throw new CliError("validation_error", "a contract is related only to a person or an organization");
|
|
3098
4271
|
if (!spec.from.includes(from) || !spec.to.includes(to))
|
|
3099
|
-
throw new CliError("validation_error", `${
|
|
4272
|
+
throw new CliError("validation_error", `${kind2} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
|
|
3100
4273
|
return spec;
|
|
3101
4274
|
}, "checkEnds");
|
|
3102
|
-
var
|
|
3103
|
-
|
|
3104
|
-
|
|
4275
|
+
var isParty = /* @__PURE__ */ __name((type) => type === "person" || type === "organization", "isParty");
|
|
4276
|
+
var rolesOf = /* @__PURE__ */ __name((kind2, from, to) => {
|
|
4277
|
+
const spec = specOf(kind2);
|
|
4278
|
+
if (kind2 === "member-of" && from !== "person")
|
|
3105
4279
|
return void 0;
|
|
3106
4280
|
return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
|
|
3107
4281
|
}, "rolesOf");
|
|
3108
|
-
var ROLE_LISTS = {
|
|
3109
|
-
|
|
3110
|
-
|
|
4282
|
+
var ROLE_LISTS = {
|
|
4283
|
+
organization: ORGANIZATION_ROLES,
|
|
4284
|
+
project: PROJECT_ROLES,
|
|
4285
|
+
deal: DEAL_ROLES,
|
|
4286
|
+
contract: CONTRACT_ROLES,
|
|
4287
|
+
related: RELATED_ROLES
|
|
4288
|
+
};
|
|
4289
|
+
var roleListOf = /* @__PURE__ */ __name((kind2, from, to) => {
|
|
4290
|
+
if (kind2 === "related-to" && isParty(from) && isParty(to))
|
|
4291
|
+
return "related";
|
|
4292
|
+
const roles = rolesOf(kind2, from, to);
|
|
3111
4293
|
return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
|
|
3112
4294
|
}, "roleListOf");
|
|
3113
|
-
var checkRole = /* @__PURE__ */ __name((
|
|
3114
|
-
const roles = rolesOf(
|
|
4295
|
+
var checkRole = /* @__PURE__ */ __name((kind2, from, to, role, extra = []) => {
|
|
4296
|
+
const roles = rolesOf(kind2, from, to)?.concat(extra);
|
|
3115
4297
|
if (roles && !roles.includes(role))
|
|
3116
|
-
throw new CliError("validation_error", `a ${from}'s role on ${
|
|
4298
|
+
throw new CliError("validation_error", `a ${from}'s role on ${kind2} ${to} is one of ${roles.join(", ")}`, {
|
|
3117
4299
|
reason: "relationship.role-unknown"
|
|
3118
4300
|
});
|
|
3119
4301
|
return role;
|
|
3120
4302
|
}, "checkRole");
|
|
3121
|
-
var isSymmetric = /* @__PURE__ */ __name((
|
|
3122
|
-
var inverseOf = /* @__PURE__ */ __name((
|
|
4303
|
+
var isSymmetric = /* @__PURE__ */ __name((kind2) => specOf(kind2)?.symmetric === true, "isSymmetric");
|
|
4304
|
+
var inverseOf = /* @__PURE__ */ __name((kind2) => specOf(kind2)?.symmetric ? kind2 : specOf(kind2)?.inverse ?? null, "inverseOf");
|
|
3123
4305
|
var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
|
|
3124
4306
|
var standingOf = /* @__PURE__ */ __name((link, now) => {
|
|
3125
4307
|
if (link.endsAt != null && link.endsAt <= now)
|
|
@@ -3131,10 +4313,11 @@ var standingOf = /* @__PURE__ */ __name((link, now) => {
|
|
|
3131
4313
|
return link.accountId != null ? "reported" : "proposed";
|
|
3132
4314
|
}, "standingOf");
|
|
3133
4315
|
var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
|
|
3134
|
-
var
|
|
4316
|
+
var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
|
|
4317
|
+
var notOverriddenSql = /* @__PURE__ */ __name((alias) => `NOT EXISTS (SELECT 1 FROM links override WHERE ${KEYED} AND override.kind = ${alias}.kind AND override.from_type = ${alias}.from_type AND override.from_id = ${alias}.from_id AND override.to_type = ${alias}.to_type AND override.to_id = ${alias}.to_id AND json_extract(override.metadata, '$.overrides') = ${alias}.id)`, "notOverriddenSql");
|
|
3135
4318
|
var usableLinkSql = /* @__PURE__ */ __name((alias, now) => `(${alias}.confirmed = 1 OR (${alias}.account_id IS NOT NULL AND ${alias}.deleted_at IS NULL))` + (now === void 0 ? "" : ` AND (${alias}.ends_at IS NULL OR ${alias}.ends_at > ${Math.trunc(now)})`), "usableLinkSql");
|
|
3136
4319
|
|
|
3137
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4320
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/tags.js
|
|
3138
4321
|
var TAG_TYPES = ["chat", "contact", "message", "task"];
|
|
3139
4322
|
var TAG = /^[a-z0-9-]{1,32}$/;
|
|
3140
4323
|
var tagOf = /* @__PURE__ */ __name((value) => {
|
|
@@ -3148,7 +4331,17 @@ var normalizeTag = /* @__PURE__ */ __name((value) => {
|
|
|
3148
4331
|
return tag;
|
|
3149
4332
|
}, "normalizeTag");
|
|
3150
4333
|
|
|
3151
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4334
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/store/sqlite/link-source.js
|
|
4335
|
+
var REPORTER_SQL = "(SELECT provider || ':' || external_id FROM accounts r WHERE r.id = links.account_id) AS reporter";
|
|
4336
|
+
var sourceOf3 = /* @__PURE__ */ __name((database, row, metadata) => {
|
|
4337
|
+
const reporter = row.account_id == null ? void 0 : "reporter" in row ? row.reporter : database.prepare("SELECT provider || ':' || external_id AS key FROM accounts WHERE id = ?").get(Number(row.account_id))?.key;
|
|
4338
|
+
return {
|
|
4339
|
+
...typeof reporter === "string" ? { account: reporter } : {},
|
|
4340
|
+
...typeof metadata.derived === "string" ? { derived: metadata.derived } : {}
|
|
4341
|
+
};
|
|
4342
|
+
}, "sourceOf");
|
|
4343
|
+
|
|
4344
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/store/sqlite/link-kinds.js
|
|
3152
4345
|
var LINK_KINDS = [
|
|
3153
4346
|
"links-to",
|
|
3154
4347
|
"blocked-by",
|
|
@@ -3169,10 +4362,37 @@ var LINK_KINDS = [
|
|
|
3169
4362
|
];
|
|
3170
4363
|
var LINK_ORIGINS = ["file", "owner", "suggested", "message"];
|
|
3171
4364
|
var LINK_SOURCES = [...LINK_ORIGINS, "calendar"];
|
|
3172
|
-
var linkKind = /* @__PURE__ */ __name((
|
|
4365
|
+
var linkKind = /* @__PURE__ */ __name((kind2) => `'${kind2}'`, "linkKind");
|
|
3173
4366
|
var COUNTERPART_ROLE = "counterpart";
|
|
3174
4367
|
|
|
3175
4368
|
export {
|
|
4369
|
+
logAttributes,
|
|
4370
|
+
fromLogAttributes,
|
|
4371
|
+
snakeLogger,
|
|
4372
|
+
LOG_ATTRIBUTES,
|
|
4373
|
+
KEEP_RUNS_FOR_DAYS,
|
|
4374
|
+
KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
|
|
4375
|
+
KEEP_STORE_RUNS_FOR_DAYS,
|
|
4376
|
+
RUNS_SIZE_LIMIT_MB,
|
|
4377
|
+
runsDirFor,
|
|
4378
|
+
startRun,
|
|
4379
|
+
runtime,
|
|
4380
|
+
newRunId,
|
|
4381
|
+
listRuns,
|
|
4382
|
+
findRun,
|
|
4383
|
+
readEvents,
|
|
4384
|
+
asOwnProcess,
|
|
4385
|
+
currentRun,
|
|
4386
|
+
inRun,
|
|
4387
|
+
runEvent,
|
|
4388
|
+
typedCommand,
|
|
4389
|
+
useAsProcessRun,
|
|
4390
|
+
processRun,
|
|
4391
|
+
enclosingTraceId,
|
|
4392
|
+
traceOf,
|
|
4393
|
+
childTrace,
|
|
4394
|
+
withAttempt,
|
|
4395
|
+
currentAttempt,
|
|
3176
4396
|
formatMeetingReference,
|
|
3177
4397
|
parseMeetingReference,
|
|
3178
4398
|
canonicalMeetingReference,
|
|
@@ -3260,6 +4480,44 @@ export {
|
|
|
3260
4480
|
validateMeetingSeriesInventoryCursor,
|
|
3261
4481
|
aggregateMeetingCounts,
|
|
3262
4482
|
aggregateMeetingStats,
|
|
4483
|
+
READ_BUDGET_EXCEEDED,
|
|
4484
|
+
SOURCE_REVIEW_KIND,
|
|
4485
|
+
SOURCE_REVIEW_CAUSES,
|
|
4486
|
+
ERASED_TEXT,
|
|
4487
|
+
severity,
|
|
4488
|
+
graver,
|
|
4489
|
+
text6 as text,
|
|
4490
|
+
id4 as id,
|
|
4491
|
+
time,
|
|
4492
|
+
zonedTime,
|
|
4493
|
+
count6 as count,
|
|
4494
|
+
untrusted,
|
|
4495
|
+
providerMetadata,
|
|
4496
|
+
evidenceSource,
|
|
4497
|
+
sourceReview,
|
|
4498
|
+
author,
|
|
4499
|
+
TASK_KINDS,
|
|
4500
|
+
TASK_STATES,
|
|
4501
|
+
CLOSED_STATES,
|
|
4502
|
+
TASK_ORIGINS,
|
|
4503
|
+
TASK_VERDICTS,
|
|
4504
|
+
isClosedState,
|
|
4505
|
+
PRIORITY_LABELS,
|
|
4506
|
+
priorityLabel,
|
|
4507
|
+
priorityBand,
|
|
4508
|
+
legacyPriority,
|
|
4509
|
+
checkedScore,
|
|
4510
|
+
priorityOf,
|
|
4511
|
+
priorityOption,
|
|
4512
|
+
createTaskService,
|
|
4513
|
+
matches,
|
|
4514
|
+
FACT_STATUSES,
|
|
4515
|
+
MEMORY_KINDS,
|
|
4516
|
+
MEMORY_STATUSES,
|
|
4517
|
+
MEMORY_SCOPES,
|
|
4518
|
+
WORK_TASK_TYPES,
|
|
4519
|
+
TASK_TYPES2 as TASK_TYPES,
|
|
4520
|
+
CATEGORIES,
|
|
3263
4521
|
parseDecimal,
|
|
3264
4522
|
formatDecimal,
|
|
3265
4523
|
currencyOf,
|
|
@@ -3270,26 +4528,26 @@ export {
|
|
|
3270
4528
|
moneyLabel,
|
|
3271
4529
|
quantityOf,
|
|
3272
4530
|
lineUnits,
|
|
4531
|
+
DEAL_KINDS,
|
|
4532
|
+
DEAL_STATUSES,
|
|
4533
|
+
STAGE_OUTCOMES,
|
|
4534
|
+
DEAL_ROLES,
|
|
4535
|
+
dealLine,
|
|
3273
4536
|
INVOICE_DIRECTIONS,
|
|
3274
4537
|
INVOICE_STATUSES,
|
|
3275
4538
|
MONEY_DIRECTIONS,
|
|
3276
4539
|
FINANCE_REVIEWS,
|
|
3277
4540
|
settledStatus,
|
|
3278
|
-
dayMonth,
|
|
3279
|
-
notes,
|
|
3280
4541
|
invoiceLine,
|
|
3281
4542
|
paymentLine,
|
|
3282
4543
|
invoiceTitle,
|
|
3283
4544
|
paymentEntryTitle,
|
|
3284
|
-
DEAL_KINDS,
|
|
3285
|
-
DEAL_STATUSES,
|
|
3286
|
-
STAGE_OUTCOMES,
|
|
3287
|
-
DEAL_ROLES,
|
|
3288
|
-
dealLine,
|
|
3289
4545
|
ORDER_STATUSES,
|
|
3290
4546
|
ORDER_PURPOSES,
|
|
3291
4547
|
orderLine,
|
|
3292
4548
|
orderTitle,
|
|
4549
|
+
isEngagement,
|
|
4550
|
+
checkEngagement,
|
|
3293
4551
|
RELATION_KINDS,
|
|
3294
4552
|
isRelationKind,
|
|
3295
4553
|
checkEnds,
|
|
@@ -3302,55 +4560,94 @@ export {
|
|
|
3302
4560
|
STANDINGS,
|
|
3303
4561
|
standingOf,
|
|
3304
4562
|
isUsable,
|
|
4563
|
+
KEYED,
|
|
3305
4564
|
notOverriddenSql,
|
|
3306
4565
|
usableLinkSql,
|
|
4566
|
+
organization,
|
|
4567
|
+
project,
|
|
4568
|
+
reminder,
|
|
4569
|
+
CATALOG_KINDS,
|
|
4570
|
+
BUSINESS_KINDS,
|
|
4571
|
+
CONTRACT_KINDS,
|
|
4572
|
+
CONTRACT_STATUSES,
|
|
4573
|
+
SUBSCRIPTION_STATUSES,
|
|
4574
|
+
WALLET_KINDS,
|
|
4575
|
+
TRANSACTION_STATUSES,
|
|
4576
|
+
ORDER_DIRECTIONS,
|
|
4577
|
+
intervalOf,
|
|
4578
|
+
productLine,
|
|
4579
|
+
contractLine,
|
|
4580
|
+
subscriptionLine,
|
|
4581
|
+
walletLine,
|
|
4582
|
+
transactionLine,
|
|
3307
4583
|
TAG_TYPES,
|
|
3308
4584
|
tagOf,
|
|
3309
4585
|
normalizeTag,
|
|
4586
|
+
REPORTER_SQL,
|
|
4587
|
+
sourceOf3 as sourceOf,
|
|
3310
4588
|
LINK_KINDS,
|
|
3311
4589
|
LINK_ORIGINS,
|
|
3312
4590
|
LINK_SOURCES,
|
|
3313
4591
|
linkKind,
|
|
3314
4592
|
COUNTERPART_ROLE,
|
|
3315
|
-
TASK_KINDS,
|
|
3316
|
-
TASK_STATES,
|
|
3317
|
-
CLOSED_STATES,
|
|
3318
|
-
TASK_ORIGINS,
|
|
3319
|
-
TASK_VERDICTS,
|
|
3320
|
-
isClosedState,
|
|
3321
|
-
PRIORITY_LABELS,
|
|
3322
|
-
priorityLabel,
|
|
3323
|
-
priorityBand,
|
|
3324
|
-
legacyPriority,
|
|
3325
|
-
checkedScore,
|
|
3326
|
-
priorityOf,
|
|
3327
|
-
priorityOption,
|
|
3328
|
-
createTaskService,
|
|
3329
|
-
matches,
|
|
3330
|
-
FACT_STATUSES,
|
|
3331
|
-
MEMORY_KINDS,
|
|
3332
|
-
MEMORY_STATUSES,
|
|
3333
|
-
MEMORY_SCOPES,
|
|
3334
|
-
WORK_TASK_TYPES,
|
|
3335
|
-
TASK_TYPES2 as TASK_TYPES,
|
|
3336
|
-
text6 as text,
|
|
3337
|
-
id4 as id,
|
|
3338
|
-
time,
|
|
3339
|
-
zonedTime,
|
|
3340
|
-
count6 as count,
|
|
3341
|
-
untrusted,
|
|
3342
|
-
providerMetadata,
|
|
3343
|
-
evidenceSource,
|
|
3344
|
-
author,
|
|
3345
|
-
organization,
|
|
3346
|
-
project,
|
|
3347
|
-
reminder,
|
|
3348
4593
|
damageMarkPath,
|
|
3349
4594
|
healthMarkPath,
|
|
4595
|
+
journalMarkPath,
|
|
3350
4596
|
markStoreDamaged,
|
|
3351
4597
|
readDamageMark,
|
|
3352
4598
|
clearDamageMark,
|
|
3353
4599
|
refuseDamagedStore,
|
|
4600
|
+
markJournalLost,
|
|
4601
|
+
readJournalMark,
|
|
3354
4602
|
readHealthMark,
|
|
3355
|
-
recordDeepCheck
|
|
4603
|
+
recordDeepCheck,
|
|
4604
|
+
formatLocator,
|
|
4605
|
+
isLocator,
|
|
4606
|
+
parseLocator,
|
|
4607
|
+
SIMPLE_REFERENCES,
|
|
4608
|
+
formatReference,
|
|
4609
|
+
parseReference,
|
|
4610
|
+
canonicalReference,
|
|
4611
|
+
looksLikeReference,
|
|
4612
|
+
providerLabel,
|
|
4613
|
+
isFolderProvider,
|
|
4614
|
+
folderProviderSql,
|
|
4615
|
+
folderProviderOf,
|
|
4616
|
+
DOCUMENT_ACCOUNT_PROVIDERS,
|
|
4617
|
+
isDocumentAccountProvider,
|
|
4618
|
+
ADDED_PROVIDER,
|
|
4619
|
+
ADDED_ACCOUNT,
|
|
4620
|
+
notAdded,
|
|
4621
|
+
filesAccountSql,
|
|
4622
|
+
INTERNAL_NOTES,
|
|
4623
|
+
UNKNOWN_PROVIDER,
|
|
4624
|
+
providerEntryOf,
|
|
4625
|
+
kindsOfEntry,
|
|
4626
|
+
unitedKinds,
|
|
4627
|
+
providers,
|
|
4628
|
+
useStoredProviders,
|
|
4629
|
+
addProvider,
|
|
4630
|
+
isKind,
|
|
4631
|
+
providerNamed,
|
|
4632
|
+
kindIn,
|
|
4633
|
+
importedOf,
|
|
4634
|
+
isImportedProvider,
|
|
4635
|
+
holdsKind,
|
|
4636
|
+
holdsKindOf,
|
|
4637
|
+
isBotProvider,
|
|
4638
|
+
inSource,
|
|
4639
|
+
sourceOf as sourceOf2,
|
|
4640
|
+
ACCOUNT_GROUPS,
|
|
4641
|
+
ACCOUNT_GROUPS_SETTING,
|
|
4642
|
+
isAccountList,
|
|
4643
|
+
isGroupName,
|
|
4644
|
+
groupName,
|
|
4645
|
+
groupMembers,
|
|
4646
|
+
listedHolds,
|
|
4647
|
+
keyOf,
|
|
4648
|
+
sourceOf2 as sourceOf3,
|
|
4649
|
+
sameAs,
|
|
4650
|
+
entriesOfList,
|
|
4651
|
+
accountsOfList,
|
|
4652
|
+
fitting
|
|
3356
4653
|
};
|