@wirecat/zoom-cli 0.64.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/dist/answer-entities.d.ts +13 -0
- package/dist/answer-entities.d.ts.map +1 -1
- package/dist/answer-entities.js +5 -0
- package/dist/answer-entities.js.map +1 -1
- package/dist/answers.d.ts +8 -0
- package/dist/answers.d.ts.map +1 -1
- package/dist/archive-import.d.ts +1 -1
- package/dist/archive-import.d.ts.map +1 -1
- package/dist/archive-import.js +2 -1
- package/dist/archive-import.js.map +1 -1
- package/dist/bin/zm.js +6 -2
- package/dist/bundle/{all-profiles-W2OVBZ7S.js → all-profiles-SKMLZJSY.js} +8 -8
- package/dist/bundle/answer-policy-BHDNSJWX.js +96 -0
- package/dist/bundle/{anthropic-P4BKQNBO.js → anthropic-TVHK7CY2.js} +4 -4
- package/dist/bundle/{app-server-AYUW45ND.js → app-server-44ASFH47.js} +53 -52
- package/dist/bundle/{bun-MNGPTYDQ.js → bun-O4WHGL2F.js} +2 -2
- package/dist/bundle/{bun-sqlite-PTPUSXAO.js → bun-sqlite-NS32GMM4.js} +3 -3
- package/dist/bundle/{chunk-CZKV4USJ.js → chunk-24F7JBLY.js} +59 -4
- package/dist/bundle/{chunk-A2FOW3ZC.js → chunk-25IDWPEN.js} +148 -97
- package/dist/bundle/{chunk-BMYZWBAX.js → chunk-266WOOB3.js} +4 -4
- package/dist/bundle/{chunk-23LOMA2I.js → chunk-2H5SXK7K.js} +45 -25
- package/dist/bundle/{chunk-24WCZURP.js → chunk-37PHGASE.js} +2 -2
- package/dist/bundle/{chunk-WFIJOFS5.js → chunk-3CZIWGZ6.js} +1 -1
- package/dist/bundle/{chunk-BO5YVG3X.js → chunk-5NGOP4EZ.js} +125 -35
- package/dist/bundle/{chunk-BWPKSUXW.js → chunk-6CS7ETBK.js} +4496 -386
- package/dist/bundle/{chunk-LEQCRVPD.js → chunk-7SQJCKR6.js} +1 -1
- package/dist/bundle/{chunk-RK3JBC4U.js → chunk-A6OA2EH2.js} +2 -2
- package/dist/bundle/{chunk-QK54GOGE.js → chunk-AMMD6YCJ.js} +7 -9
- package/dist/bundle/chunk-BLT3LR3U.js +34 -0
- package/dist/bundle/{chunk-X6M5DK66.js → chunk-BNXH73OU.js} +10 -10
- package/dist/bundle/{chunk-RJLNVHIU.js → chunk-BWRBALXG.js} +3 -3
- package/dist/bundle/{chunk-UFI5SX3F.js → chunk-C6BG57FA.js} +11 -11
- package/dist/bundle/{chunk-IIGXCYEL.js → chunk-CNEE6TPE.js} +13 -13
- package/dist/bundle/{chunk-TYKZCJD7.js → chunk-CVCRQW3A.js} +35 -35
- package/dist/bundle/{chunk-UCPL55YP.js → chunk-DNCKH7CO.js} +17 -17
- package/dist/bundle/{chunk-L4JGVSBN.js → chunk-DYJXAY7Q.js} +26 -25
- package/dist/bundle/{chunk-UABUBDYB.js → chunk-EA63UGWE.js} +2 -2
- package/dist/bundle/{chunk-UNO4G5NX.js → chunk-ERPRAYA7.js} +5 -5
- package/dist/bundle/{chunk-CZFV6XTW.js → chunk-FYJL276J.js} +3 -3
- package/dist/bundle/{chunk-YNYMWXXH.js → chunk-FYM27FCG.js} +32 -9
- package/dist/bundle/{chunk-H65B6A7Y.js → chunk-GBZF4IIP.js} +8 -8
- package/dist/bundle/{chunk-JRPYHDCO.js → chunk-GEX4V5TM.js} +4 -4
- package/dist/bundle/{chunk-5BCNJB2A.js → chunk-GMTXCFI7.js} +668 -504
- package/dist/bundle/{chunk-JM43EKTY.js → chunk-GXCNCMUY.js} +1896 -651
- package/dist/bundle/{chunk-FSYO3PUW.js → chunk-H7762LDA.js} +2 -2
- package/dist/bundle/{chunk-C3RRIJ5C.js → chunk-IPTI3Y2E.js} +6 -41
- package/dist/bundle/{chunk-7NDSBTKR.js → chunk-JF7ZEUXU.js} +34 -26
- package/dist/bundle/{chunk-5YLR24D5.js → chunk-K6ATTKQR.js} +13 -6
- package/dist/bundle/{chunk-R4NTPYXZ.js → chunk-KYLS5QGC.js} +2 -2
- package/dist/bundle/{chunk-OPP5CWAX.js → chunk-KZE3G4ZT.js} +34 -33
- package/dist/bundle/{chunk-I5QX2HAT.js → chunk-LOL6JYYN.js} +211 -106
- package/dist/bundle/{chunk-COTC7HF3.js → chunk-LPUFOWL3.js} +1 -1
- package/dist/bundle/{chunk-AF4HONAZ.js → chunk-M6IDHQ7N.js} +6402 -4395
- package/dist/bundle/{chunk-Y7TWNMTW.js → chunk-MH7AWCB4.js} +178 -49
- package/dist/bundle/{chunk-ZW4N73FO.js → chunk-MIB5X2XW.js} +3 -3
- package/dist/bundle/{chunk-Q3EDUZ5R.js → chunk-MPKKIL3U.js} +15 -12
- package/dist/bundle/{chunk-JMSKDW5G.js → chunk-MRWIXUYT.js} +2 -2
- package/dist/bundle/{chunk-HIGFBTEI.js → chunk-MZ6U6HNJ.js} +2 -2
- package/dist/bundle/{chunk-7SWNZ44U.js → chunk-NJSIHMAE.js} +2 -2
- package/dist/bundle/{chunk-HQHYPKSU.js → chunk-NNNEVWFF.js} +44 -31
- package/dist/bundle/{chunk-TJH5IQVZ.js → chunk-NO24PJNW.js} +1 -1
- package/dist/bundle/{chunk-7D56BQZL.js → chunk-OXUHTKO2.js} +2 -2
- package/dist/bundle/{chunk-IIP4J3PD.js → chunk-PV3UDPCI.js} +82 -6
- package/dist/bundle/{chunk-5FN4Q5H5.js → chunk-QI7BZS2G.js} +8 -13
- package/dist/bundle/{chunk-SMT6SFBK.js → chunk-QLCYAQ66.js} +2 -2
- package/dist/bundle/{chunk-PBJY5VR6.js → chunk-R5BAF5XE.js} +1 -1
- package/dist/bundle/{chunk-7VJIKJNW.js → chunk-RZLNHNSS.js} +8 -8
- package/dist/bundle/{chunk-3DGQJASQ.js → chunk-S4GDDO5S.js} +1 -1
- package/dist/bundle/{chunk-AAC6VNSL.js → chunk-SQWRZZOQ.js} +3 -3
- package/dist/bundle/{chunk-63MRRNDL.js → chunk-T3KICUOK.js} +6 -6
- package/dist/bundle/{chunk-7EOW47PV.js → chunk-TC7PD3LH.js} +4 -4
- package/dist/bundle/{chunk-XZSQLVED.js → chunk-TUIEDVI6.js} +2 -2
- package/dist/bundle/{chunk-H5LLZ5XA.js → chunk-U3ZUT557.js} +1 -1
- package/dist/bundle/{chunk-4XVRA6P5.js → chunk-U4RVOSX3.js} +1 -1
- package/dist/bundle/{chunk-EQYPTGCT.js → chunk-U5ASRBBF.js} +6 -4
- package/dist/bundle/{chunk-3IMEAZIM.js → chunk-UKU6MYUI.js} +4 -4
- package/dist/bundle/{chunk-J25UNZIL.js → chunk-UMHJZWZU.js} +9 -9
- package/dist/bundle/{chunk-HQHUPTZR.js → chunk-UPJXN2CO.js} +1308 -635
- package/dist/bundle/{chunk-OWXMQVVN.js → chunk-VH4F2EK4.js} +1 -1
- package/dist/bundle/{chunk-TJODNJKE.js → chunk-VJTGYBJJ.js} +18 -13
- package/dist/bundle/{chunk-54UEJGYB.js → chunk-VW2SW7ME.js} +3 -3
- package/dist/bundle/{chunk-2UONVSJQ.js → chunk-WLSF3GCC.js} +2 -2
- package/dist/bundle/{chunk-H3DMYF3W.js → chunk-XJQB47IL.js} +4 -4
- package/dist/bundle/{chunk-JZKNHA44.js → chunk-Y3EIK4XW.js} +1 -1
- package/dist/bundle/{chunk-3AAO5N4L.js → chunk-Z5424QL6.js} +2 -2
- package/dist/bundle/{chunk-K6OSD6DG.js → chunk-ZFNM3FNI.js} +75 -33
- package/dist/bundle/{chunk-SJIBJQJN.js → chunk-ZH743WNV.js} +40 -12
- package/dist/bundle/{chunk-JJZAGKUK.js → chunk-ZOGYTDHG.js} +2 -2
- package/dist/bundle/{chunk-6NBQJJT6.js → chunk-ZREFYKUB.js} +7 -7
- package/dist/bundle/{chunk-KJCCT3QY.js → chunk-ZXGRK44F.js} +14 -13
- package/dist/bundle/{cli-Y2ZO3D5U.js → cli-FDO6CP6R.js} +105 -59
- package/dist/bundle/command-contract-O4FDXM4U.js +37 -0
- package/dist/bundle/config-UBHKZG3J.js +78 -0
- package/dist/bundle/{decode-GO6GAYH2.js → decode-7SZI3TGZ.js} +3 -3
- package/dist/bundle/{dist-MIJKAGXW.js → dist-5GWUXW27.js} +18 -14
- package/dist/bundle/{echarts-NWK7LALR.js → echarts-FMACRZQC.js} +2 -2
- package/dist/bundle/{embed-2DOSN4DV.js → embed-24YSXHLP.js} +4 -4
- package/dist/bundle/{embedder-3Q3C2WKC.js → embedder-MEXN2TFB.js} +7 -7
- package/dist/bundle/{first-run-S75VKIT3.js → first-run-OCVEJH63.js} +8 -8
- package/dist/bundle/first-screen-KJIU25MH.js +35 -0
- package/dist/bundle/{folders-RSWEBHDZ.js → folders-DBAAMU26.js} +2 -2
- package/dist/bundle/{instructions-M3FZPQVI.js → instructions-E5FXYCWF.js} +1 -1
- package/dist/bundle/{main-R77BPRRS.js → main-EIUCXXDW.js} +17 -16
- package/dist/bundle/{mcp-YJEQYYTR.js → mcp-FUSDPAOL.js} +2 -2
- package/dist/bundle/{meetings-IV4Y4WRH.js → meetings-JDTRGXZJ.js} +16 -6
- package/dist/bundle/{node-I3GEHYGL.js → node-4SNKUPXT.js} +2 -2
- package/dist/bundle/{node-sqlite-W6MR2TVQ.js → node-sqlite-O4BAODFR.js} +9 -3
- package/dist/bundle/{oauth-M6YL4QXP.js → oauth-3YLHXGUW.js} +5 -5
- package/dist/bundle/{open-2VITLJAN.js → open-QGRMSNM2.js} +3 -2
- package/dist/bundle/{openai-OG6B3JCU.js → openai-7PSCSTH7.js} +9 -9
- package/dist/bundle/{output-file-XJJ3XMLQ.js → output-file-J26UQKRA.js} +3 -3
- package/dist/bundle/{process-UBA4L4B2.js → process-HQZOTT6U.js} +1 -1
- package/dist/bundle/{program-5R5MRXUM.js → program-47DT7SHE.js} +75 -75
- package/dist/bundle/{prompt-AVIXIM7Z.js → prompt-IUD7HCDC.js} +3 -3
- package/dist/bundle/{recognize-DJKTJOYU.js → recognize-DMJJHHXF.js} +2 -2
- package/dist/bundle/{remote-S3DTNYRP.js → remote-5WFSOVVB.js} +5 -5
- package/dist/bundle/{rerank-FMCDP6VF.js → rerank-UKQ65ECH.js} +5 -5
- package/dist/bundle/{run-log-T4MV2VEH.js → run-log-UGYL6NW2.js} +53 -53
- package/dist/bundle/{serve-5SGFJFMC.js → serve-WAOSED3I.js} +9 -8
- package/dist/bundle/server-HAXN772R.js +66 -0
- package/dist/bundle/{server-PCMCY7WK.js → server-NWZFNXC5.js} +42 -42
- package/dist/bundle/{services-SKRQ2POT.js → services-VPANRE72.js} +101 -28
- package/dist/bundle/{speech-FSDICIKO.js → speech-O6UNUDRW.js} +11 -11
- package/dist/bundle/{state-KPUSPWO6.js → state-BNE7I65A.js} +4 -4
- package/dist/bundle/{store-7MP2ZGQ7.js → store-4IIVSCJ4.js} +37 -18
- package/dist/bundle/{store-W7LFPKG2.js → store-QQH4FJXJ.js} +14 -13
- package/dist/bundle/store-connection-PPEQK2K3.js +76 -0
- package/dist/bundle/store-maintenance-command-JZXCT6NY.js +56 -0
- package/dist/bundle/{streaming-Q44ESD3E.js → streaming-S4EZB6P2.js} +4 -4
- package/dist/bundle/{tokens-TAFCHANI.js → tokens-VCXIH7WZ.js} +4 -4
- package/dist/bundle/zm.js +1 -1
- package/dist/local-transcription.d.ts.map +1 -1
- package/dist/local-transcription.js +1 -0
- package/dist/local-transcription.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/answer-policy-HOA43GNA.js +0 -96
- package/dist/bundle/chunk-JRPAZ2WD.js +0 -3635
- package/dist/bundle/command-contract-DGTZIH2F.js +0 -38
- package/dist/bundle/config-N2UHDKGG.js +0 -78
- package/dist/bundle/first-screen-DQNRT6GH.js +0 -36
- package/dist/bundle/server-EYGZLKKQ.js +0 -66
- package/dist/bundle/store-connection-3HNZFJC4.js +0 -76
- package/dist/bundle/store-maintenance-command-6WBLTUZP.js +0 -55
- /package/dist/bundle/{chunk-WJWLHLQ7.js → chunk-NUN6OGOV.js} +0 -0
|
@@ -1,21 +1,185 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
formatMeetingReference,
|
|
5
|
+
parseMeetingReference
|
|
6
|
+
} from "./chunk-GMTXCFI7.js";
|
|
3
7
|
import {
|
|
4
8
|
CliError,
|
|
5
9
|
singleLine
|
|
6
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JF7ZEUXU.js";
|
|
7
11
|
import {
|
|
8
12
|
__name
|
|
9
13
|
} from "./chunk-ZVVMGPBJ.js";
|
|
10
14
|
|
|
11
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/domain/locator.js
|
|
16
|
+
var SCHEME = "msg:";
|
|
17
|
+
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
|
|
18
|
+
var isLocator = /* @__PURE__ */ __name((reference) => reference.trim().startsWith(SCHEME), "isLocator");
|
|
19
|
+
var parseLocator = /* @__PURE__ */ __name((reference) => {
|
|
20
|
+
const trimmed = reference.trim();
|
|
21
|
+
const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
|
|
22
|
+
if (parts2.length !== 4 || parts2.some((part) => part === "")) {
|
|
23
|
+
throw new CliError("validation_error", `"${singleLine(reference)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`);
|
|
24
|
+
}
|
|
25
|
+
const [provider, account, chat, message] = parts2.map(decodeURIComponent);
|
|
26
|
+
return { provider, account, chat, message };
|
|
27
|
+
}, "parseLocator");
|
|
28
|
+
|
|
29
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/domain/references.js
|
|
30
|
+
var SIMPLE_REFERENCES = [
|
|
31
|
+
"note",
|
|
32
|
+
"document",
|
|
33
|
+
"person",
|
|
34
|
+
"organization",
|
|
35
|
+
"project",
|
|
36
|
+
"task",
|
|
37
|
+
"memory",
|
|
38
|
+
"fact",
|
|
39
|
+
"bot",
|
|
40
|
+
"event",
|
|
41
|
+
"entity"
|
|
42
|
+
];
|
|
43
|
+
var malformed = /* @__PURE__ */ __name((text, shape) => new CliError("validation_error", `"${singleLine(text)}" is not a reference \u2014 expected ${shape}`, {
|
|
44
|
+
reason: "ref.malformed"
|
|
45
|
+
}), "malformed");
|
|
46
|
+
var parts = /* @__PURE__ */ __name((rest, count, text, shape) => {
|
|
47
|
+
const split = rest.split("/");
|
|
48
|
+
if (split.length !== count || split.some((part) => part === ""))
|
|
49
|
+
throw malformed(text, shape);
|
|
50
|
+
return split.map(decodeURIComponent);
|
|
51
|
+
}, "parts");
|
|
52
|
+
var encoded = /* @__PURE__ */ __name((...values) => values.map(encodeURIComponent).join("/"), "encoded");
|
|
53
|
+
var folderPath = /* @__PURE__ */ __name((path) => {
|
|
54
|
+
const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
|
|
55
|
+
return clean === "" ? path.trim() === "" ? "" : null : clean;
|
|
56
|
+
}, "folderPath");
|
|
57
|
+
var MEETING_SHAPE = "meeting:<account>/<meeting>[/<transcript>[/<cue>]] with safe integer ids";
|
|
58
|
+
var kind = /* @__PURE__ */ __name((spec) => spec, "kind");
|
|
59
|
+
var simple = /* @__PURE__ */ __name((prefix) => kind({
|
|
60
|
+
prefix,
|
|
61
|
+
type: prefix,
|
|
62
|
+
shape: `${prefix}:<id>`,
|
|
63
|
+
parse: /* @__PURE__ */ __name((rest, text) => {
|
|
64
|
+
if (!rest.trim())
|
|
65
|
+
throw new CliError("validation_error", `"${singleLine(text)}" names no ${prefix}`, {
|
|
66
|
+
reason: "ref.malformed"
|
|
67
|
+
});
|
|
68
|
+
return { type: prefix, id: rest };
|
|
69
|
+
}, "parse"),
|
|
70
|
+
format: /* @__PURE__ */ __name((reference) => `${reference.type}:${reference.id}`, "format")
|
|
71
|
+
}), "simple");
|
|
72
|
+
var REF_KINDS = [
|
|
73
|
+
kind({
|
|
74
|
+
prefix: "msg",
|
|
75
|
+
type: "message",
|
|
76
|
+
shape: "msg:<provider>/<account>/<chat>/<message>",
|
|
77
|
+
parse: /* @__PURE__ */ __name((_, text) => {
|
|
78
|
+
try {
|
|
79
|
+
return { type: "message", ...parseLocator(text) };
|
|
80
|
+
} catch {
|
|
81
|
+
throw malformed(text, "msg:<provider>/<account>/<chat>/<message>");
|
|
82
|
+
}
|
|
83
|
+
}, "parse"),
|
|
84
|
+
format: formatLocator
|
|
85
|
+
}),
|
|
86
|
+
kind({
|
|
87
|
+
prefix: "chat",
|
|
88
|
+
type: "chat",
|
|
89
|
+
shape: "chat:<provider>/<account>/<chat>",
|
|
90
|
+
parse: /* @__PURE__ */ __name((rest, text) => {
|
|
91
|
+
const [provider, account, chat] = parts(rest, 3, text, "chat:<provider>/<account>/<chat>");
|
|
92
|
+
return { type: "chat", provider, account, chat };
|
|
93
|
+
}, "parse"),
|
|
94
|
+
format: /* @__PURE__ */ __name(({ provider, account, chat }) => `chat:${encoded(provider, account, chat)}`, "format")
|
|
95
|
+
}),
|
|
96
|
+
kind({
|
|
97
|
+
prefix: "contact",
|
|
98
|
+
type: "contact",
|
|
99
|
+
shape: "contact:<provider>/<id>",
|
|
100
|
+
parse: /* @__PURE__ */ __name((rest, text) => {
|
|
101
|
+
const [provider, id] = parts(rest, 2, text, "contact:<provider>/<id>");
|
|
102
|
+
return { type: "contact", provider, id };
|
|
103
|
+
}, "parse"),
|
|
104
|
+
format: /* @__PURE__ */ __name(({ provider, id }) => `contact:${encoded(provider, id)}`, "format")
|
|
105
|
+
}),
|
|
106
|
+
kind({
|
|
107
|
+
prefix: "folder",
|
|
108
|
+
type: "folder",
|
|
109
|
+
shape: "folder:<id>[/<path>]",
|
|
110
|
+
parse: /* @__PURE__ */ __name((rest, text) => {
|
|
111
|
+
const slash = rest.indexOf("/");
|
|
112
|
+
const id = decodeURIComponent(slash < 0 ? rest : rest.slice(0, slash));
|
|
113
|
+
const path = slash < 0 ? null : folderPath(decodeURIComponent(rest.slice(slash + 1)));
|
|
114
|
+
if (!id.trim() || path === "")
|
|
115
|
+
throw malformed(text, "folder:<id>[/<path>]");
|
|
116
|
+
return { type: "folder", id, path };
|
|
117
|
+
}, "parse"),
|
|
118
|
+
format: /* @__PURE__ */ __name(({ id, path }) => path === null ? `folder:${encodeURIComponent(id)}` : `folder:${encoded(id, path)}`, "format")
|
|
119
|
+
}),
|
|
120
|
+
kind({
|
|
121
|
+
prefix: "meeting",
|
|
122
|
+
type: "meeting",
|
|
123
|
+
shape: MEETING_SHAPE,
|
|
124
|
+
parse: /* @__PURE__ */ __name((_, text) => {
|
|
125
|
+
try {
|
|
126
|
+
return parseMeetingReference(text);
|
|
127
|
+
} catch {
|
|
128
|
+
throw malformed(text, MEETING_SHAPE);
|
|
129
|
+
}
|
|
130
|
+
}, "parse"),
|
|
131
|
+
format: formatMeetingReference
|
|
132
|
+
}),
|
|
133
|
+
...SIMPLE_REFERENCES.map(simple)
|
|
134
|
+
];
|
|
135
|
+
var byPrefix = new Map(REF_KINDS.map((spec) => [spec.prefix, spec]));
|
|
136
|
+
var byType = new Map(REF_KINDS.map((spec) => [spec.type, spec]));
|
|
137
|
+
var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity");
|
|
138
|
+
var distance = /* @__PURE__ */ __name((a, b) => {
|
|
139
|
+
let row = Array.from({ length: b.length + 1 }, (_, at) => at);
|
|
140
|
+
for (const [i, x] of [...a].entries()) {
|
|
141
|
+
const next = [i + 1];
|
|
142
|
+
for (const [j, y] of [...b].entries())
|
|
143
|
+
next.push(Math.min(row[j + 1] + 1, next[j] + 1, row[j] + (x === y ? 0 : 1)));
|
|
144
|
+
row = next;
|
|
145
|
+
}
|
|
146
|
+
return row[b.length];
|
|
147
|
+
}, "distance");
|
|
148
|
+
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");
|
|
149
|
+
var unknownKind = /* @__PURE__ */ __name((text, prefix, rest) => {
|
|
150
|
+
const near = prefix === "" ? void 0 : nearest(prefix);
|
|
151
|
+
const kinds = offered.map((one) => `${one}:`).join(", ");
|
|
152
|
+
const hint = near === void 0 ? `; kinds: ${kinds}` : `; did you mean ${near}:${singleLine(rest)}? Kinds: ${kinds}`;
|
|
153
|
+
return new CliError("validation_error", `"${singleLine(text)}" is no kind of reference${hint}`, {
|
|
154
|
+
reason: "ref.unknown-kind"
|
|
155
|
+
});
|
|
156
|
+
}, "unknownKind");
|
|
157
|
+
var formatReference = /* @__PURE__ */ __name((reference) => byType.get(reference.type).format(reference), "formatReference");
|
|
158
|
+
var parseReference = /* @__PURE__ */ __name((text) => {
|
|
159
|
+
const reference = text.trim();
|
|
160
|
+
const colon = reference.indexOf(":");
|
|
161
|
+
const prefix = colon < 0 ? "" : reference.slice(0, colon);
|
|
162
|
+
const rest = reference.slice(colon + 1);
|
|
163
|
+
const spec = byPrefix.get(prefix);
|
|
164
|
+
if (!spec)
|
|
165
|
+
throw unknownKind(reference, prefix, rest);
|
|
166
|
+
return spec.parse(rest, reference);
|
|
167
|
+
}, "parseReference");
|
|
168
|
+
var canonicalReference = /* @__PURE__ */ __name((text) => formatReference(parseReference(text)), "canonicalReference");
|
|
169
|
+
var looksLikeReference = /* @__PURE__ */ __name((text) => {
|
|
170
|
+
const match = /^([a-z]+):\S+$/.exec(text.trim());
|
|
171
|
+
return match !== null && byPrefix.has(match[1]);
|
|
172
|
+
}, "looksLikeReference");
|
|
173
|
+
|
|
174
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/domain/providers.js
|
|
12
175
|
var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events"];
|
|
176
|
+
var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
|
|
13
177
|
var PROVIDERS = [
|
|
14
|
-
{ name: "telegram", kind: "messages", aliases: ["tg"] },
|
|
178
|
+
{ name: "telegram", kind: "messages", aliases: ["tg"], command: "tg", opens: MESSENGER_OPENS },
|
|
15
179
|
{ name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
|
|
16
|
-
{ name: "max", kind: "messages", aliases: [] },
|
|
180
|
+
{ name: "max", kind: "messages", aliases: [], command: "max", opens: MESSENGER_OPENS },
|
|
17
181
|
{ name: "max-bot", kind: "messages", aliases: [] },
|
|
18
|
-
{ name: "whatsapp", kind: "messages", aliases: ["wa"] },
|
|
182
|
+
{ name: "whatsapp", kind: "messages", aliases: ["wa"], command: "wa", opens: MESSENGER_OPENS },
|
|
19
183
|
{ name: "whatsapp-bot", kind: "messages", aliases: ["wa-bot"] },
|
|
20
184
|
{ name: "email", kind: "mail", aliases: [] },
|
|
21
185
|
{ name: "notes", kind: "notes", aliases: [] },
|
|
@@ -23,6 +187,17 @@ var PROVIDERS = [
|
|
|
23
187
|
{ name: "obsidian", kind: "notes", aliases: [] },
|
|
24
188
|
{ name: "zoom", kind: "meetings", aliases: [] }
|
|
25
189
|
];
|
|
190
|
+
var LABELS = {
|
|
191
|
+
telegram: "Telegram",
|
|
192
|
+
"telegram-bot": "Telegram bot",
|
|
193
|
+
max: "MAX",
|
|
194
|
+
"max-bot": "MAX bot",
|
|
195
|
+
whatsapp: "WhatsApp",
|
|
196
|
+
"whatsapp-bot": "WhatsApp bot",
|
|
197
|
+
"google-drive": "Google Drive",
|
|
198
|
+
email: "mail"
|
|
199
|
+
};
|
|
200
|
+
var providerLabel = /* @__PURE__ */ __name((provider) => LABELS[provider] ?? provider, "providerLabel");
|
|
26
201
|
var FOLDER_PROVIDERS = ["local", "obsidian", "folder"];
|
|
27
202
|
var isFolderProvider = /* @__PURE__ */ __name((provider) => FOLDER_PROVIDERS.includes(provider), "isFolderProvider");
|
|
28
203
|
var folderProviderSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${FOLDER_PROVIDERS.map((name) => `'${name}'`).join(", ")})`, "folderProviderSql");
|
|
@@ -37,23 +212,35 @@ var invalid = /* @__PURE__ */ __name((message) => {
|
|
|
37
212
|
throw new CliError("validation_error", message);
|
|
38
213
|
}, "invalid");
|
|
39
214
|
var wordOf = /* @__PURE__ */ __name((value, what) => typeof value === "string" && WORD.test(value) ? value : invalid(`${what} is lowercase letters, digits, - and _ \u2014 not ${JSON.stringify(value)}`), "wordOf");
|
|
215
|
+
var OPEN_KINDS = new Set(REF_KINDS.map(({ type }) => type).filter((type) => type !== "entity"));
|
|
216
|
+
var COMMAND_WORDS = /^[a-z0-9][a-z0-9_-]*( [a-z0-9][a-z0-9_-]*)*$/;
|
|
217
|
+
var opensOf = /* @__PURE__ */ __name((value, named) => {
|
|
218
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
219
|
+
return invalid(`provider ${named}'s opens maps a kind of reference to a command`);
|
|
220
|
+
const known = Object.entries(value).filter(([kind2]) => OPEN_KINDS.has(kind2));
|
|
221
|
+
for (const [kind2, command] of known)
|
|
222
|
+
if (typeof command !== "string" || !COMMAND_WORDS.test(command))
|
|
223
|
+
invalid(`provider ${named} opens a ${kind2} with command words, not ${JSON.stringify(command)}`);
|
|
224
|
+
return Object.fromEntries(known);
|
|
225
|
+
}, "opensOf");
|
|
40
226
|
var providerEntryOf = /* @__PURE__ */ __name((value) => {
|
|
41
227
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
42
228
|
return invalid("a provider entry is an object");
|
|
43
|
-
const { name, kind, aliases = [], command } = value;
|
|
229
|
+
const { name, kind: kind2, aliases = [], command, opens } = value;
|
|
44
230
|
const named = wordOf(name, "a provider's name");
|
|
45
|
-
if (typeof
|
|
46
|
-
invalid(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(
|
|
231
|
+
if (typeof kind2 !== "string" || !KINDS.includes(kind2))
|
|
232
|
+
invalid(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(kind2)}`);
|
|
47
233
|
if (!Array.isArray(aliases))
|
|
48
234
|
invalid(`provider ${named}'s aliases are a list`);
|
|
49
235
|
return {
|
|
50
236
|
name: named,
|
|
51
|
-
kind,
|
|
237
|
+
kind: kind2,
|
|
52
238
|
aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
|
|
53
|
-
...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) }
|
|
239
|
+
...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) },
|
|
240
|
+
...opens === void 0 ? {} : { opens: opensOf(opens, named) }
|
|
54
241
|
};
|
|
55
242
|
}, "providerEntryOf");
|
|
56
|
-
var describe = /* @__PURE__ */ __name(({ name, kind, command }) => `${name} (${
|
|
243
|
+
var describe = /* @__PURE__ */ __name(({ name, kind: kind2, command }) => `${name} (${kind2}${command ? `, from ${command}` : ""})`, "describe");
|
|
57
244
|
var wordsOf = /* @__PURE__ */ __name(({ name, aliases }) => [name, ...aliases], "wordsOf");
|
|
58
245
|
var joined = /* @__PURE__ */ __name((known, entry) => {
|
|
59
246
|
const same = known.find(({ name }) => name === entry.name);
|
|
@@ -62,7 +249,8 @@ var joined = /* @__PURE__ */ __name((known, entry) => {
|
|
|
62
249
|
const merged = same ? {
|
|
63
250
|
...same,
|
|
64
251
|
aliases: [.../* @__PURE__ */ new Set([...same.aliases, ...entry.aliases])],
|
|
65
|
-
...entry.command ? { command: entry.command } : {}
|
|
252
|
+
...entry.command ? { command: entry.command } : {},
|
|
253
|
+
...entry.opens ? { opens: { ...same.opens, ...entry.opens } } : {}
|
|
66
254
|
} : entry;
|
|
67
255
|
const others = known.filter((one) => one !== same);
|
|
68
256
|
for (const word of wordsOf(merged)) {
|
|
@@ -102,93 +290,7 @@ var providerNamed = /* @__PURE__ */ __name((word) => {
|
|
|
102
290
|
var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
|
|
103
291
|
var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
|
|
104
292
|
|
|
105
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
106
|
-
var SCHEME = "msg:";
|
|
107
|
-
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
|
|
108
|
-
var isLocator = /* @__PURE__ */ __name((reference) => reference.trim().startsWith(SCHEME), "isLocator");
|
|
109
|
-
var parseLocator = /* @__PURE__ */ __name((reference) => {
|
|
110
|
-
const trimmed = reference.trim();
|
|
111
|
-
const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
|
|
112
|
-
if (parts2.length !== 4 || parts2.some((part) => part === "")) {
|
|
113
|
-
throw new CliError("validation_error", `"${singleLine(reference)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`);
|
|
114
|
-
}
|
|
115
|
-
const [provider, account, chat, message] = parts2.map(decodeURIComponent);
|
|
116
|
-
return { provider, account, chat, message };
|
|
117
|
-
}, "parseLocator");
|
|
118
|
-
|
|
119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/domain/references.js
|
|
120
|
-
var SIMPLE_REFERENCES = [
|
|
121
|
-
"note",
|
|
122
|
-
"document",
|
|
123
|
-
"person",
|
|
124
|
-
"organization",
|
|
125
|
-
"project",
|
|
126
|
-
"task",
|
|
127
|
-
"memory",
|
|
128
|
-
"fact",
|
|
129
|
-
"bot",
|
|
130
|
-
"entity"
|
|
131
|
-
];
|
|
132
|
-
var parts = /* @__PURE__ */ __name((rest, count, reference, shape) => {
|
|
133
|
-
const split = rest.split("/");
|
|
134
|
-
if (split.length !== count || split.some((part) => part === ""))
|
|
135
|
-
throw new CliError("validation_error", `"${singleLine(reference)}" is not a reference \u2014 expected ${shape}`);
|
|
136
|
-
return split.map(decodeURIComponent);
|
|
137
|
-
}, "parts");
|
|
138
|
-
var formatReference = /* @__PURE__ */ __name((reference) => {
|
|
139
|
-
switch (reference.type) {
|
|
140
|
-
case "message":
|
|
141
|
-
return formatLocator(reference);
|
|
142
|
-
case "chat":
|
|
143
|
-
return `chat:${[reference.provider, reference.account, reference.chat].map(encodeURIComponent).join("/")}`;
|
|
144
|
-
case "contact":
|
|
145
|
-
return `contact:${[reference.provider, reference.id].map(encodeURIComponent).join("/")}`;
|
|
146
|
-
case "folder":
|
|
147
|
-
return reference.path === null ? `folder:${encodeURIComponent(reference.id)}` : `folder:${encodeURIComponent(reference.id)}/${encodeURIComponent(reference.path)}`;
|
|
148
|
-
default:
|
|
149
|
-
return `${reference.type}:${reference.id}`;
|
|
150
|
-
}
|
|
151
|
-
}, "formatReference");
|
|
152
|
-
var parseReference = /* @__PURE__ */ __name((text) => {
|
|
153
|
-
const reference = text.trim();
|
|
154
|
-
const colon = reference.indexOf(":");
|
|
155
|
-
const prefix = colon < 0 ? "" : reference.slice(0, colon);
|
|
156
|
-
const rest = reference.slice(colon + 1);
|
|
157
|
-
switch (prefix) {
|
|
158
|
-
case "msg":
|
|
159
|
-
return { type: "message", ...parseLocator(reference) };
|
|
160
|
-
case "chat": {
|
|
161
|
-
const [provider, account, chat] = parts(rest, 3, reference, "chat:<provider>/<account>/<chat>");
|
|
162
|
-
return { type: "chat", provider, account, chat };
|
|
163
|
-
}
|
|
164
|
-
case "contact": {
|
|
165
|
-
const [provider, id] = parts(rest, 2, reference, "contact:<provider>/<id>");
|
|
166
|
-
return { type: "contact", provider, id };
|
|
167
|
-
}
|
|
168
|
-
case "folder": {
|
|
169
|
-
const slash = rest.indexOf("/");
|
|
170
|
-
const id = decodeURIComponent(slash < 0 ? rest : rest.slice(0, slash));
|
|
171
|
-
const path = slash < 0 ? null : folderPath(decodeURIComponent(rest.slice(slash + 1)));
|
|
172
|
-
if (!id.trim() || path === "")
|
|
173
|
-
throw new CliError("validation_error", `"${singleLine(reference)}" is not a reference \u2014 expected folder:<id>[/<path>]`);
|
|
174
|
-
return { type: "folder", id, path };
|
|
175
|
-
}
|
|
176
|
-
default:
|
|
177
|
-
if (SIMPLE_REFERENCES.includes(prefix)) {
|
|
178
|
-
if (!rest.trim())
|
|
179
|
-
throw new CliError("validation_error", `"${singleLine(reference)}" names no ${prefix}`);
|
|
180
|
-
return { type: prefix, id: rest };
|
|
181
|
-
}
|
|
182
|
-
throw new CliError("validation_error", `"${singleLine(reference)}" is not a reference \u2014 expected msg:, chat:, contact:, folder:, ${SIMPLE_REFERENCES.filter((one) => one !== "entity").join(":, ")}:`);
|
|
183
|
-
}
|
|
184
|
-
}, "parseReference");
|
|
185
|
-
var folderPath = /* @__PURE__ */ __name((path) => {
|
|
186
|
-
const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
|
|
187
|
-
return clean === "" ? path.trim() === "" ? "" : null : clean;
|
|
188
|
-
}, "folderPath");
|
|
189
|
-
var canonicalReference = /* @__PURE__ */ __name((text) => formatReference(parseReference(text)), "canonicalReference");
|
|
190
|
-
|
|
191
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.533.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_d95b0b392230247c519664df7aaeaaab/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
293
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
192
294
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
193
295
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
194
296
|
var counterValue = /* @__PURE__ */ __name((message, field) => {
|
|
@@ -225,7 +327,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
225
327
|
return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
|
|
226
328
|
}, "counterFreshness");
|
|
227
329
|
|
|
228
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
330
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
229
331
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
230
332
|
var AUTHOR_MEASURES = [
|
|
231
333
|
"messages",
|
|
@@ -366,8 +468,17 @@ var rankingWords = /* @__PURE__ */ __name((text) => withoutUrls(text).match(/[\p
|
|
|
366
468
|
var rankingQuestion = /* @__PURE__ */ __name((text) => withoutUrls(text).includes("?"), "rankingQuestion");
|
|
367
469
|
|
|
368
470
|
export {
|
|
471
|
+
formatLocator,
|
|
472
|
+
isLocator,
|
|
473
|
+
parseLocator,
|
|
474
|
+
REF_KINDS,
|
|
475
|
+
formatReference,
|
|
476
|
+
parseReference,
|
|
477
|
+
canonicalReference,
|
|
478
|
+
looksLikeReference,
|
|
369
479
|
KINDS,
|
|
370
480
|
PROVIDERS,
|
|
481
|
+
providerLabel,
|
|
371
482
|
FOLDER_PROVIDERS,
|
|
372
483
|
isFolderProvider,
|
|
373
484
|
folderProviderSql,
|
|
@@ -386,12 +497,6 @@ export {
|
|
|
386
497
|
providerNamed,
|
|
387
498
|
kindIn,
|
|
388
499
|
kindOf,
|
|
389
|
-
formatLocator,
|
|
390
|
-
isLocator,
|
|
391
|
-
parseLocator,
|
|
392
|
-
formatReference,
|
|
393
|
-
parseReference,
|
|
394
|
-
canonicalReference,
|
|
395
500
|
COUNTER_FIELDS,
|
|
396
501
|
validCounter,
|
|
397
502
|
counterValue,
|
|
@@ -527,7 +527,7 @@ var require_cross_spawn = __commonJS({
|
|
|
527
527
|
}
|
|
528
528
|
});
|
|
529
529
|
|
|
530
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
530
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/executable.js
|
|
531
531
|
import { existsSync } from "node:fs";
|
|
532
532
|
import { win32 } from "node:path";
|
|
533
533
|
var variable = /* @__PURE__ */ __name((env, name) => Object.entries(env).find(([key]) => key.toUpperCase() === name)?.[1], "variable");
|