@wirecat/notion-cli 0.1.0 → 0.2.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/CHANGELOG.md +40 -0
- package/README.md +10 -4
- package/contracts/wirecat.json +650 -1
- package/dist/bin/notion.js +2 -2
- package/dist/bundle/{all-profiles-OETMCOLN.js → all-profiles-JGYLQZ5C.js} +9 -9
- package/dist/bundle/{anthropic-5Y3O2TYM.js → anthropic-S2VSMIKQ.js} +5 -5
- package/dist/bundle/{app-server-IVWBIVHC.js → app-server-SASYDBCA.js} +55 -46
- package/dist/bundle/{bun-EO636SAD.js → bun-LU5LP3JI.js} +2 -2
- package/dist/bundle/{bun-sqlite-C2T7QJ2M.js → bun-sqlite-JBSINB4O.js} +6 -6
- package/dist/bundle/{chunk-DIM5YWBU.js → chunk-22QQUKWA.js} +1 -1
- package/dist/bundle/{chunk-B4B65XIO.js → chunk-2F4QQ7WB.js} +3 -3
- package/dist/bundle/{chunk-2YR3RYT4.js → chunk-2F6VO5HA.js} +3 -3
- package/dist/bundle/chunk-2LWO3PDX.js +726 -0
- package/dist/bundle/{chunk-RSIS7BR7.js → chunk-3AL7QUS3.js} +20 -20
- package/dist/bundle/{chunk-RDZ7SVBZ.js → chunk-3Z4YTSRY.js} +3 -3
- package/dist/bundle/{chunk-QBC23NHD.js → chunk-4HWJOU7N.js} +1 -1
- package/dist/bundle/{chunk-WM7663C2.js → chunk-4IPURN72.js} +8 -8
- package/dist/bundle/{chunk-CLG2ISQH.js → chunk-4ZTVJHWU.js} +4 -4
- package/dist/bundle/{chunk-IQWEJEB5.js → chunk-5IYKVRH2.js} +26157 -21070
- package/dist/bundle/{chunk-7FII4DCE.js → chunk-5NFK5EM2.js} +7 -7
- package/dist/bundle/{chunk-K5TWMQSY.js → chunk-5QIQEUOG.js} +8 -8
- package/dist/bundle/{chunk-F6MLJ3V5.js → chunk-5RDNBG7D.js} +2 -2
- package/dist/bundle/{chunk-ST2UC7FS.js → chunk-5RSC54NA.js} +30 -26
- package/dist/bundle/{chunk-7N5QB6NL.js → chunk-6EVKHZKN.js} +5 -3
- package/dist/bundle/{chunk-EU5WCOMQ.js → chunk-6RA3EABS.js} +45 -34
- package/dist/bundle/{chunk-JKIN5TOU.js → chunk-AOCUKEAX.js} +4 -4
- package/dist/bundle/{chunk-OWJDC4CB.js → chunk-B26TQZKZ.js} +12 -12
- package/dist/bundle/{chunk-WK3OSDNV.js → chunk-B7ON6KPT.js} +7 -7
- package/dist/bundle/{chunk-RLSFOR2D.js → chunk-BNPTZ5ZB.js} +4 -4
- package/dist/bundle/{chunk-WVZFXI36.js → chunk-D7QSEEYW.js} +4 -4
- package/dist/bundle/{chunk-JK44XO2S.js → chunk-DH5PRHT4.js} +56 -56
- package/dist/bundle/chunk-EUIVXFLJ.js +259 -0
- package/dist/bundle/{chunk-64D5VUZ4.js → chunk-FPY6EJ7B.js} +67 -63
- package/dist/bundle/{chunk-EGTBL3MJ.js → chunk-FT3LN3HP.js} +1 -1
- package/dist/bundle/{chunk-NLDYZBTC.js → chunk-FWVBPRL4.js} +1129 -2555
- package/dist/bundle/{chunk-UWIA2G6Q.js → chunk-FXEJY4OL.js} +329 -528
- package/dist/bundle/{chunk-R6ZM45NF.js → chunk-G3EZFRSS.js} +88 -30
- package/dist/bundle/{chunk-B2XKEEFX.js → chunk-GZOUFX3C.js} +4 -4
- package/dist/bundle/{chunk-WWMB4UHF.js → chunk-HL52XXZX.js} +1 -1
- package/dist/bundle/{chunk-4GC5DBHW.js → chunk-KCLOUUYF.js} +3 -3
- package/dist/bundle/chunk-KFVDL2QS.js +146 -0
- package/dist/bundle/{chunk-35K5T6WV.js → chunk-KGERXYTV.js} +1 -1
- package/dist/bundle/{chunk-BWICUW7W.js → chunk-KM6WHPHI.js} +2 -2
- package/dist/bundle/{chunk-AE2KQ37N.js → chunk-LAYPFBOM.js} +6 -6
- package/dist/bundle/chunk-LLG2POQ7.js +170 -0
- package/dist/bundle/{chunk-B2WFKFYL.js → chunk-M3KB25D3.js} +20 -116
- package/dist/bundle/{chunk-RAZKIHGH.js → chunk-M7S2NDWB.js} +3 -3
- package/dist/bundle/chunk-MGUEZYFA.js +5546 -0
- package/dist/bundle/chunk-MY742GAD.js +1977 -0
- package/dist/bundle/chunk-MZU2YFBZ.js +823 -0
- package/dist/bundle/{chunk-AQZO3ITW.js → chunk-NOQ7B5N7.js} +2 -2
- package/dist/bundle/{chunk-QC3KOJT4.js → chunk-NQWV4WQO.js} +6 -6
- package/dist/bundle/{chunk-FF4DDBCB.js → chunk-ODBZNSZ6.js} +6 -6
- package/dist/bundle/{chunk-TR7R5DL4.js → chunk-OTV53F34.js} +9 -9
- package/dist/bundle/{chunk-KHOVVPLC.js → chunk-P7CUM5IB.js} +1 -1
- package/dist/bundle/{chunk-CWVAYQXI.js → chunk-RV64YUQX.js} +8 -8
- package/dist/bundle/{chunk-TSCIIXN3.js → chunk-SHJQ6JKG.js} +2 -2
- package/dist/bundle/{chunk-24FAYAML.js → chunk-SWAOWNKW.js} +3 -3
- package/dist/bundle/chunk-SZOVLP44.js +29 -0
- package/dist/bundle/chunk-TPX2M45D.js +385 -0
- package/dist/bundle/{chunk-UWW24JQF.js → chunk-TSDBSIFM.js} +3 -3
- package/dist/bundle/{chunk-YA4LSSDZ.js → chunk-VBHETQVV.js} +1435 -1788
- package/dist/bundle/{chunk-HRTIRRXR.js → chunk-VCIALTEM.js} +33 -6
- package/dist/bundle/{chunk-ESZT4WW3.js → chunk-WCSOH4JS.js} +3 -3
- package/dist/bundle/{chunk-HWRKURQH.js → chunk-WF4D56CA.js} +2 -2
- package/dist/bundle/chunk-WJHZMR2W.js +335 -0
- package/dist/bundle/chunk-X4TIMMKJ.js +16 -0
- package/dist/bundle/{chunk-XL2HXHP3.js → chunk-XF26XKTS.js} +2 -2
- package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
- package/dist/bundle/{chunk-47R43UVJ.js → chunk-YMYUBZWT.js} +19 -19
- package/dist/bundle/{chunk-3D3PFXBP.js → chunk-YNTLT3Z3.js} +10 -15
- package/dist/bundle/{chunk-GA3URWIF.js → chunk-YVI5SQPY.js} +1 -1
- package/dist/bundle/{chunk-XC5CKHX2.js → chunk-Z56QFOBR.js} +1 -1
- package/dist/bundle/{chunk-EPAZ7DJB.js → chunk-ZKAEZXUP.js} +42 -38
- package/dist/bundle/{chunk-66PL7P4C.js → chunk-ZZ32DXTH.js} +1 -1
- package/dist/bundle/command-contract-JS5V27NX.js +38 -0
- package/dist/bundle/{command-server-entry-A66DJ3MH.js → command-server-entry-UFSG7KRO.js} +26 -23
- package/dist/bundle/decode-7LLWTSPT.js +297 -0
- package/dist/bundle/{dispatch-FEKU5UXC.js → dispatch-2GY6JIJH.js} +8 -8
- package/dist/bundle/{dist-YFKABFFF.js → dist-ILNOLGYN.js} +1 -1
- package/dist/bundle/{echarts-XD2JSWU4.js → echarts-BXX4OQWC.js} +2 -2
- package/dist/bundle/{embed-F3HYGAF7.js → embed-JXFNBTKH.js} +6 -6
- package/dist/bundle/{embedder-GSEDDUH7.js → embedder-57YZ44KO.js} +9 -9
- package/dist/bundle/{failure-HDJLR2YJ.js → failure-MYT4HPE3.js} +2 -2
- package/dist/bundle/{first-run-TXNTIUSP.js → first-run-3PF7T74J.js} +12 -11
- package/dist/bundle/first-screen-7BEROEQR.js +36 -0
- package/dist/bundle/{instructions-NZGJ4FW5.js → instructions-2VECIDXF.js} +1 -1
- package/dist/bundle/{mcp-VFIOZDVY.js → mcp-O6ACR2DX.js} +2 -2
- package/dist/bundle/mdast-util-from-markdown-R66F4HZA.js +1958 -0
- package/dist/bundle/mdast-util-gfm-LN2ELINH.js +2699 -0
- package/dist/bundle/meeting-combined-PPUQ3KBR.js +24 -0
- package/dist/bundle/meeting-model-ZNMYKMCD.js +26 -0
- package/dist/bundle/meeting-semantic-ETN3A4BJ.js +22 -0
- package/dist/bundle/micromark-extension-gfm-5X7YT43T.js +1838 -0
- package/dist/bundle/{node-RPKPDYQS.js → node-MPEQSFI3.js} +2 -2
- package/dist/bundle/{node-sqlite-KH2UUYVO.js → node-sqlite-WA32MYSJ.js} +7 -7
- package/dist/bundle/notion.js +13 -13
- package/dist/bundle/{oauth-NKAI7TQD.js → oauth-IAFZG3IR.js} +7 -7
- package/dist/bundle/{open-WSAEAA2V.js → open-M3JQUC5G.js} +5 -5
- package/dist/bundle/{openai-JPVDGHG5.js → openai-HXUEHUSD.js} +30 -28
- package/dist/bundle/{process-5ZFVKOQX.js → process-F6TKXWWA.js} +1 -1
- package/dist/bundle/{program-M3D56D6T.js → program-Y7JAB6TG.js} +5289 -924
- package/dist/bundle/{prompt-FROYQ5LV.js → prompt-IMUQLZD2.js} +5 -5
- package/dist/bundle/{recognize-NYCHQMCX.js → recognize-2MZAYHAA.js} +4 -4
- package/dist/bundle/{remote-4OERF3Z4.js → remote-OV4LB6VR.js} +10 -10
- package/dist/bundle/{rerank-TEGXFUWY.js → rerank-ZIULUS34.js} +7 -7
- package/dist/bundle/{schemas-MZNNOEYN.js → schemas-DIVZS6TU.js} +1 -1
- package/dist/bundle/{serve-HLYYBAXY.js → serve-YU7QBP6L.js} +9 -9
- package/dist/bundle/server-FKQET4ZO.js +71 -0
- package/dist/bundle/{server-D5OYNEUW.js → server-LGMNONSB.js} +47 -38
- package/dist/bundle/services-5WY4DCPJ.js +581 -0
- package/dist/bundle/{sqlite-runtime-H2S5RR2F.js → sqlite-runtime-5MXZDETH.js} +6 -6
- package/dist/bundle/{state-OPOXCDZL.js → state-LWMZH2KI.js} +6 -6
- package/dist/bundle/{store-NHMXEJPD.js → store-EPZYV4VW.js} +17 -13
- package/dist/bundle/{store-Y3KRLCJ7.js → store-QE6FEIZD.js} +25 -20
- package/dist/bundle/store-maintenance-command-ZUUUFCHL.js +62 -0
- package/dist/commands/documents.d.ts +2 -1
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +2 -2
- package/dist/commands/documents.js.map +1 -1
- package/dist/commands/library.d.ts +10 -0
- package/dist/commands/library.d.ts.map +1 -0
- package/dist/commands/library.js +468 -0
- package/dist/commands/library.js.map +1 -0
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +4 -3
- package/dist/commands/session.js.map +1 -1
- package/dist/context.d.ts +5 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +12 -3
- package/dist/context.js.map +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +1 -0
- package/dist/identity.js.map +1 -1
- package/dist/knowledge.d.ts +27 -0
- package/dist/knowledge.d.ts.map +1 -0
- package/dist/knowledge.js +87 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/library.d.ts +44 -0
- package/dist/library.d.ts.map +1 -0
- package/dist/library.js +149 -0
- package/dist/library.js.map +1 -0
- package/dist/notion/client.d.ts +4 -1
- package/dist/notion/client.d.ts.map +1 -1
- package/dist/notion/client.js +5 -2
- package/dist/notion/client.js.map +1 -1
- package/dist/notion/errors.d.ts.map +1 -1
- package/dist/notion/errors.js +26 -1
- package/dist/notion/errors.js.map +1 -1
- package/dist/notion/reads.d.ts +4 -0
- package/dist/notion/reads.d.ts.map +1 -1
- package/dist/program.js +2 -2
- package/dist/program.js.map +1 -1
- package/dist/sync/cursor.d.ts +81 -0
- package/dist/sync/cursor.d.ts.map +1 -1
- package/dist/sync/cursor.js +63 -2
- package/dist/sync/cursor.js.map +1 -1
- package/dist/sync/files.d.ts +77 -0
- package/dist/sync/files.d.ts.map +1 -0
- package/dist/sync/files.js +12 -0
- package/dist/sync/files.js.map +1 -0
- package/dist/sync/markdown.d.ts +4 -1
- package/dist/sync/markdown.d.ts.map +1 -1
- package/dist/sync/markdown.js +8 -6
- package/dist/sync/markdown.js.map +1 -1
- package/dist/sync/source.d.ts +6 -59
- package/dist/sync/source.d.ts.map +1 -1
- package/dist/sync/source.js +616 -255
- package/dist/sync/source.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/notion-cli/SKILL.md +12 -1
- package/dist/bundle/command-contract-6G5DC2FN.js +0 -35
- package/dist/bundle/decode-7XOFRAAT.js +0 -163
- package/dist/bundle/first-screen-JZPJND7J.js +0 -33
- package/dist/bundle/server-LWZGVMNW.js +0 -62
- package/dist/bundle/store-maintenance-command-D4W7WSLQ.js +0 -53
- package/dist/commands/comments.d.ts +0 -3
- package/dist/commands/comments.d.ts.map +0 -1
- package/dist/commands/comments.js +0 -114
- package/dist/commands/comments.js.map +0 -1
- package/dist/sample/comments.d.ts +0 -61
- package/dist/sample/comments.d.ts.map +0 -1
- package/dist/sample/comments.js +0 -39
- package/dist/sample/comments.js.map +0 -1
- package/dist/sample/records.d.ts +0 -16
- package/dist/sample/records.d.ts.map +0 -1
- package/dist/sample/records.js +0 -22
- package/dist/sample/records.js.map +0 -1
- package/dist/sample/transport.d.ts +0 -42
- package/dist/sample/transport.d.ts.map +0 -1
- package/dist/sample/transport.js +0 -153
- package/dist/sample/transport.js.map +0 -1
- /package/dist/bundle/{chunk-ZI3YTXSF.js → chunk-VKE77B3F.js} +0 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
validateVector
|
|
5
|
+
} from "./chunk-LLG2POQ7.js";
|
|
6
|
+
import {
|
|
7
|
+
meaningFloor
|
|
8
|
+
} from "./chunk-WJHZMR2W.js";
|
|
9
|
+
import {
|
|
10
|
+
MESSAGE_PARSING,
|
|
11
|
+
RRF_K,
|
|
12
|
+
plainQuery
|
|
13
|
+
} from "./chunk-MZU2YFBZ.js";
|
|
14
|
+
import {
|
|
15
|
+
normalize
|
|
16
|
+
} from "./chunk-X4TIMMKJ.js";
|
|
17
|
+
import {
|
|
18
|
+
MEETING_FIELD_NAMES,
|
|
19
|
+
formatMeetingReference,
|
|
20
|
+
implicitTextTerms,
|
|
21
|
+
liftMeetingFields,
|
|
22
|
+
parseLucene,
|
|
23
|
+
parseMeetingReference,
|
|
24
|
+
walkQuery
|
|
25
|
+
} from "./chunk-FWVBPRL4.js";
|
|
26
|
+
import {
|
|
27
|
+
CliError
|
|
28
|
+
} from "./chunk-5RDNBG7D.js";
|
|
29
|
+
import {
|
|
30
|
+
__name
|
|
31
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
32
|
+
|
|
33
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
|
|
34
|
+
import { createHash } from "node:crypto";
|
|
35
|
+
|
|
36
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/search/question-plan.js
|
|
37
|
+
var words = /* @__PURE__ */ __name((text) => normalize(text).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
|
|
38
|
+
var joinedHyphens = /* @__PURE__ */ __name((text) => (normalize(text).match(new RegExp("(?<![:\\p{L}\\p{N}-])\\p{L}[\\p{L}\\p{N}]*(?:-\\p{L}[\\p{L}\\p{N}]*)+", "gu")) ?? []).map((word) => word.replaceAll("-", "")), "joinedHyphens");
|
|
39
|
+
var scaffolding = new Set(words("what which how many much who where when is are was were do does did can could should we the a an for of to under from in on at has have \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u043E\u0435 \u043A\u0442\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u0447\u0442\u043E \u0432\u043E \u043F\u043E \u043D\u0430 \u0432 \u043A \u0441 \u0443 \u0447\u0435\u0440\u0435\u0437 \u043B\u0438 \u0434\u043E\u043B\u0436\u0435\u043D \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0443\u0436\u043D\u043E \u0438\u0434\u0451\u0442 \u0438\u0434\u0435\u0442 \u043C\u043E\u0436\u043D\u043E \u043C\u043E\u0436\u0435\u0442 \u043C\u043E\u0433\u0443\u0442"));
|
|
40
|
+
var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
|
|
41
|
+
var QUESTION_STARTS = new Set(words("what which how who whom whose where when why can could should would did do does is are was were will \u0447\u0442\u043E \u043A\u0442\u043E \u043A\u043E\u0433\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u043E\u0435 \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u0443\u044E \u043A\u0430\u043A\u0438\u043C \u043A\u0430\u043A\u043E\u0433\u043E \u043A\u0430\u043A\u0438\u0445 \u043F\u043E\u0447\u0435\u043C\u0443 \u0437\u0430\u0447\u0435\u043C \u043E\u0442\u043A\u0443\u0434\u0430 \u043A\u0443\u0434\u0430 \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043B\u0438 \u043C\u043E\u0436\u043D\u043E \u0440\u0430\u0437\u0432\u0435 \u0447\u0435\u0439 \u0447\u044C\u044F \u0447\u044C\u0451 \u0447\u044C\u0438"));
|
|
42
|
+
var QUESTION_FILLER = new Set(words("about any did does why whom whose would will \u044D\u0442\u043E \u043C\u044B \u0432\u044B \u044F \u043E\u043D\u0438 \u043E\u043D \u043E\u043D\u0430 \u043E \u043E\u0431 \u043F\u0440\u043E \u043B\u0438"));
|
|
43
|
+
var LINKING = new Set(words("and or but not nor with without this that these those there their they them you your our its his her all any and for into onto over then than also just and \u043F\u0440\u0438 \u0434\u043B\u044F \u0431\u0435\u0437 \u043D\u0430\u0434 \u043F\u043E\u0434 \u0438\u043B\u0438 \u043B\u0438\u0431\u043E \u0435\u0433\u043E \u0435\u0451 \u0438\u0445 \u0432\u0441\u0435 \u0432\u0441\u0451 \u0443\u0436\u0435 \u0435\u0449\u0451 \u0442\u0430\u043A \u0442\u043E\u0436\u0435 \u0442\u0430\u043A\u0436\u0435 \u0431\u044B\u043B \u0431\u044B\u043B\u0430 \u0431\u044B\u043B\u0438 \u0431\u044B\u043B\u043E \u0431\u0443\u0434\u0435\u0442 \u044D\u0442\u043E \u044D\u0442\u0430 \u044D\u0442\u043E\u0442 \u044D\u0442\u0438 \u0442\u0430\u043C \u0442\u0443\u0442"));
|
|
44
|
+
var isFunctionWord = /* @__PURE__ */ __name((word) => scaffolding.has(word) || QUESTION_STARTS.has(word) || QUESTION_FILLER.has(word) || LINKING.has(word), "isFunctionWord");
|
|
45
|
+
var questionTerms = /* @__PURE__ */ __name((text) => /\?\s*$/u.test(text) || QUESTION_STARTS.has(words(text)[0] ?? "") ? words(text).filter((word) => !scaffolding.has(word) && !QUESTION_STARTS.has(word) && !QUESTION_FILLER.has(word)) : null, "questionTerms");
|
|
46
|
+
function planQuestion(text, strict = false) {
|
|
47
|
+
if (strict)
|
|
48
|
+
return {
|
|
49
|
+
changed: false,
|
|
50
|
+
natural: false,
|
|
51
|
+
queries: [text],
|
|
52
|
+
scope: "",
|
|
53
|
+
terms: words(text),
|
|
54
|
+
rankingTerms: words(text),
|
|
55
|
+
removed: [],
|
|
56
|
+
aliases: []
|
|
57
|
+
};
|
|
58
|
+
const inputAst = parseLucene(text, MESSAGE_PARSING);
|
|
59
|
+
const rawTextual = walkQuery(inputAst.root).filter((node) => node.field === "text" || node.field === "exact");
|
|
60
|
+
const body = rawTextual.map((node) => node.value).join(" ");
|
|
61
|
+
const prefix = words(body).slice(0, 2);
|
|
62
|
+
const questionPrefix = [
|
|
63
|
+
"what",
|
|
64
|
+
"which",
|
|
65
|
+
"how",
|
|
66
|
+
"who",
|
|
67
|
+
"where",
|
|
68
|
+
"when",
|
|
69
|
+
"can",
|
|
70
|
+
"could",
|
|
71
|
+
"should",
|
|
72
|
+
"\u0441\u043A\u043E\u043B\u044C\u043A\u043E",
|
|
73
|
+
"\u043A\u0430\u043A\u043E\u0438",
|
|
74
|
+
"\u043A\u0430\u043A\u0430\u044F",
|
|
75
|
+
"\u043A\u0430\u043A\u0438\u0435",
|
|
76
|
+
"\u043A\u0430\u043A\u043E\u0435",
|
|
77
|
+
"\u043A\u0442\u043E",
|
|
78
|
+
"\u043A\u043E\u043C\u0443",
|
|
79
|
+
"\u043A\u0435\u043C",
|
|
80
|
+
"\u0433\u0434\u0435",
|
|
81
|
+
"\u043A\u043E\u0433\u0434\u0430",
|
|
82
|
+
"\u043A\u0430\u043A",
|
|
83
|
+
"\u0447\u0442\u043E",
|
|
84
|
+
"\u043C\u043E\u0436\u043D\u043E",
|
|
85
|
+
"\u043C\u043E\u0436\u0435\u0442",
|
|
86
|
+
"\u043C\u043E\u0433\u0443\u0442"
|
|
87
|
+
].includes(prefix[0] ?? "") || ["\u043A", "\u0432\u043E"].includes(prefix[0] ?? "") && ["\u043A\u043E\u043C\u0443", "\u0441\u043A\u043E\u043B\u044C\u043A\u043E"].includes(prefix[1] ?? "");
|
|
88
|
+
const natural = questionWord.test(body) && (/\?/u.test(body) || questionPrefix);
|
|
89
|
+
let cleaned = text;
|
|
90
|
+
if (natural && !text.includes("\\")) {
|
|
91
|
+
const last = rawTextual.at(-1);
|
|
92
|
+
const mark = (last?.span.end ?? 0) - 1;
|
|
93
|
+
if (last?.operator === "wildcard" && text[mark] === "?")
|
|
94
|
+
cleaned = text.slice(0, mark) + text.slice(mark + 1);
|
|
95
|
+
}
|
|
96
|
+
const ast = cleaned === text ? inputAst : parseLucene(cleaned, MESSAGE_PARSING);
|
|
97
|
+
const predicates = walkQuery(ast.root);
|
|
98
|
+
const textual = predicates.filter((p) => p.field === "text" || p.field === "exact");
|
|
99
|
+
const fields = predicates.filter((p) => p.field !== "text" && p.field !== "exact");
|
|
100
|
+
const scope = fields.map((p) => {
|
|
101
|
+
const raw = cleaned.slice(p.span.start, p.span.end);
|
|
102
|
+
return new RegExp(`^${p.field}[:=<>]`, "u").test(raw) ? raw : `${p.field}:${raw}`;
|
|
103
|
+
}).join(" ");
|
|
104
|
+
const bypass = strict || !natural || implicitTextTerms(cleaned).size === 0 || // A quoted single word is how `plainQuery` keeps `10:30` or `HH:MM` literal; it is no phrase the asker wrote.
|
|
105
|
+
textual.some((p) => !(p.operator === "term" || p.operator === "phrase" && !/\s/u.test(p.value)) || p.field === "exact");
|
|
106
|
+
if (bypass)
|
|
107
|
+
return {
|
|
108
|
+
changed: false,
|
|
109
|
+
natural: false,
|
|
110
|
+
queries: [text],
|
|
111
|
+
scope,
|
|
112
|
+
terms: textual.flatMap((p) => words(p.value)),
|
|
113
|
+
rankingTerms: textual.flatMap((p) => words(p.value)),
|
|
114
|
+
removed: [],
|
|
115
|
+
aliases: []
|
|
116
|
+
};
|
|
117
|
+
const original = textual.flatMap((p) => words(p.value));
|
|
118
|
+
const removed = original.filter((w) => scaffolding.has(w));
|
|
119
|
+
const terms = [...new Set(original.filter((w) => !scaffolding.has(w)))];
|
|
120
|
+
if (!terms.length)
|
|
121
|
+
return {
|
|
122
|
+
changed: false,
|
|
123
|
+
natural: true,
|
|
124
|
+
queries: [text],
|
|
125
|
+
scope,
|
|
126
|
+
terms,
|
|
127
|
+
rankingTerms: original,
|
|
128
|
+
removed,
|
|
129
|
+
aliases: []
|
|
130
|
+
};
|
|
131
|
+
const alias = [...terms];
|
|
132
|
+
const changes = [];
|
|
133
|
+
const replace = /* @__PURE__ */ __name((from, to) => {
|
|
134
|
+
for (let i = 0; i < alias.length; i++)
|
|
135
|
+
if (from.includes(alias[i] ?? "")) {
|
|
136
|
+
changes.push(`${alias[i]} -> ${to}`);
|
|
137
|
+
alias[i] = to;
|
|
138
|
+
}
|
|
139
|
+
}, "replace");
|
|
140
|
+
if (terms.some((w) => ["refund", "euros", "euro", "money", "\u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0430", "\u0432\u043E\u0437\u0432\u0440\u0430\u0442", "\u0435\u0432\u0440\u043E"].includes(w))) {
|
|
141
|
+
replace(["returned", "refunded", "received"], "refund");
|
|
142
|
+
replace(["\u0432\u0435\u0440\u043D\u0443\u043B\u0438", "\u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0435\u043D\u043E", "\u043F\u0435\u0440\u0435\u0447\u0438\u0441\u043B\u0435\u043D\u043E"], "\u0432\u043E\u0437\u0432\u0440\u0430\u0442");
|
|
143
|
+
}
|
|
144
|
+
if (terms.some((w) => ["log", "logs", "retention", "backup", "\u043B\u043E\u0433\u043E\u0432", "\u043B\u043E\u0433\u0438", "\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435", "\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F"].includes(w))) {
|
|
145
|
+
replace(["lifetime", "kept", "keep"], "retention");
|
|
146
|
+
replace(["\u0445\u0440\u0430\u043D\u044F\u0442\u0441\u044F", "\u0445\u0440\u0430\u043D\u044F\u0442", "\u0445\u0440\u0430\u043D\u0438\u0442\u044C", "\u0441\u0440\u043E\u043A"], "\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435");
|
|
147
|
+
}
|
|
148
|
+
if (terms.includes("service") || terms.includes("build"))
|
|
149
|
+
replace(["currently", "now"], "current");
|
|
150
|
+
const render = /* @__PURE__ */ __name((ws) => [...new Set(ws)].join(" ") + (scope ? ` ${scope}` : ""), "render");
|
|
151
|
+
const queries = [.../* @__PURE__ */ new Set([render(terms), render(alias)])].slice(0, 2);
|
|
152
|
+
return { changed: true, natural: true, queries, scope, terms, rankingTerms: original, removed, aliases: changes };
|
|
153
|
+
}
|
|
154
|
+
__name(planQuestion, "planQuestion");
|
|
155
|
+
var questionText = /* @__PURE__ */ __name((text) => text.replace(new RegExp("(?<=\\p{L})\\?(?=\\s|$)", "gu"), "").replace(/"(?:[^"\\]|\\.)*"|(?<=\d):(?=\d)/gu, (found) => found === ":" ? " " : found), "questionText");
|
|
156
|
+
var lookupTerms = /* @__PURE__ */ __name((plan) => [
|
|
157
|
+
...new Set(plan.terms.concat(plan.aliases.flatMap((alias) => words(alias.split(" -> ")[1] ?? ""))))
|
|
158
|
+
], "lookupTerms");
|
|
159
|
+
var anyOfTerms = /* @__PURE__ */ __name((terms, scope) => `(${terms.join(" OR ")})${scope ? ` ${scope}` : ""}`, "anyOfTerms");
|
|
160
|
+
var questionLookup = /* @__PURE__ */ __name((text) => {
|
|
161
|
+
let plan;
|
|
162
|
+
try {
|
|
163
|
+
plan = planQuestion(questionText(text));
|
|
164
|
+
} catch (error) {
|
|
165
|
+
if (error instanceof CliError)
|
|
166
|
+
return void 0;
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
const terms = plan.changed ? lookupTerms(plan) : [];
|
|
170
|
+
return terms.length ? anyOfTerms(terms, plan.scope) : void 0;
|
|
171
|
+
}, "questionLookup");
|
|
172
|
+
|
|
173
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
|
|
174
|
+
var refreshMeetingIndex = /* @__PURE__ */ __name(async (meetings, accountId, signal) => {
|
|
175
|
+
let before = Number.POSITIVE_INFINITY;
|
|
176
|
+
for (; ; ) {
|
|
177
|
+
signal?.throwIfAborted();
|
|
178
|
+
const { indexed, remaining } = await meetings.indexSearch({
|
|
179
|
+
accountId,
|
|
180
|
+
limit: 1e3,
|
|
181
|
+
maxReadBytes: 64 * 1024 ** 2,
|
|
182
|
+
signal
|
|
183
|
+
});
|
|
184
|
+
if (remaining === 0 || indexed === 0 || remaining >= before)
|
|
185
|
+
return;
|
|
186
|
+
before = remaining;
|
|
187
|
+
}
|
|
188
|
+
}, "refreshMeetingIndex");
|
|
189
|
+
var resolveMeetingSelection = /* @__PURE__ */ __name(async (store, request) => {
|
|
190
|
+
const { project, tag, topic, ...input } = request;
|
|
191
|
+
input.signal?.throwIfAborted();
|
|
192
|
+
if (project !== void 0 && input.projectId !== void 0 || [tag, topic].filter((value) => value !== void 0).length + Number(input.tagId !== void 0) > 1)
|
|
193
|
+
throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
|
|
194
|
+
const selection = [];
|
|
195
|
+
const knowledge = store.knowledge;
|
|
196
|
+
if (!knowledge && [project, tag, topic].some((value) => value !== void 0))
|
|
197
|
+
throw new CliError("configuration_error", "this store cannot resolve project, tag or topic names");
|
|
198
|
+
for (const [kind, name] of [
|
|
199
|
+
["project", project],
|
|
200
|
+
["tag", tag],
|
|
201
|
+
["topic", topic]
|
|
202
|
+
]) {
|
|
203
|
+
if (name === void 0)
|
|
204
|
+
continue;
|
|
205
|
+
if (!knowledge)
|
|
206
|
+
continue;
|
|
207
|
+
const found = await knowledge.resolveVocabulary(name, { kind, signal: input.signal });
|
|
208
|
+
input.signal?.throwIfAborted();
|
|
209
|
+
if (found.ambiguous || found.matches.length !== 1)
|
|
210
|
+
throw new CliError(found.matches.length ? "validation_error" : "not_found", `the ${kind} name needs one canonical record`, {
|
|
211
|
+
candidates: found.matches.map((entry2) => ({ kind: entry2.kind, id: entry2.id, name: entry2.name }))
|
|
212
|
+
});
|
|
213
|
+
const entry = found.matches[0];
|
|
214
|
+
const id = Number(entry?.id);
|
|
215
|
+
if (!entry || entry.kind !== kind || !Number.isSafeInteger(id) || id < 1)
|
|
216
|
+
throw new CliError("invalid_response", "vocabulary resolution returned an invalid canonical record");
|
|
217
|
+
if (kind === "project")
|
|
218
|
+
input.projectId = id;
|
|
219
|
+
else
|
|
220
|
+
input.tagId = id;
|
|
221
|
+
selection.push({ kind, id, name: entry.name, by: "explicit-link" });
|
|
222
|
+
}
|
|
223
|
+
return { input, selection };
|
|
224
|
+
}, "resolveMeetingSelection");
|
|
225
|
+
var searchMeetingHits = /* @__PURE__ */ __name(async (store, query, request, options = {}) => {
|
|
226
|
+
const lifted = liftMeetingFields(plainQuery(query, MEETING_FIELD_NAMES), request);
|
|
227
|
+
const { input, selection } = await resolveMeetingSelection(store, lifted.request);
|
|
228
|
+
if (options.refreshIndex !== false)
|
|
229
|
+
await refreshMeetingIndex(store.meetings, input.accountId, input.signal);
|
|
230
|
+
const result = await store.meetings.searchHits(lifted.query, input);
|
|
231
|
+
input.signal?.throwIfAborted();
|
|
232
|
+
return { ...result, selection };
|
|
233
|
+
}, "searchMeetingHits");
|
|
234
|
+
|
|
235
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
|
|
236
|
+
var DEPTH = 200;
|
|
237
|
+
var cursorOf = /* @__PURE__ */ __name((value, key) => {
|
|
238
|
+
if (value === void 0)
|
|
239
|
+
return 0;
|
|
240
|
+
let cursor;
|
|
241
|
+
try {
|
|
242
|
+
cursor = JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
|
|
243
|
+
} catch {
|
|
244
|
+
throw new CliError("validation_error", "the cursor is not from a combined meeting search; search again");
|
|
245
|
+
}
|
|
246
|
+
if (cursor?.version !== 1 || cursor.key !== key || !Number.isSafeInteger(cursor.offset) || cursor.offset < 0)
|
|
247
|
+
throw new CliError("validation_error", "the cursor belongs to another query, filter or model; search again");
|
|
248
|
+
return cursor.offset;
|
|
249
|
+
}, "cursorOf");
|
|
250
|
+
var searchMeetingsCombined = /* @__PURE__ */ __name(async (store, embedder, typed, request) => {
|
|
251
|
+
const { maxChunks, maxRows, maxTextBytes, ...chosen } = request;
|
|
252
|
+
const { query, request: words2 } = liftMeetingFields(typed, chosen);
|
|
253
|
+
const { input, selection } = await resolveMeetingSelection(store, words2);
|
|
254
|
+
const { after, limit = 20, maxReadBytes, ...filters } = input;
|
|
255
|
+
const terms = questionTerms(query);
|
|
256
|
+
const wordQuery = terms === null ? query : terms.join(" ");
|
|
257
|
+
const key = createHash("sha256").update(JSON.stringify([query, embedder.key, Object.entries(filters).filter(([name]) => name !== "signal")])).digest("base64url");
|
|
258
|
+
const offset = cursorOf(after, key);
|
|
259
|
+
let byWords = [];
|
|
260
|
+
let indexing = "ready";
|
|
261
|
+
let refused;
|
|
262
|
+
if (wordQuery.trim()) {
|
|
263
|
+
await refreshMeetingIndex(store.meetings, input.accountId, input.signal);
|
|
264
|
+
try {
|
|
265
|
+
const page = await store.meetings.searchHits(wordQuery, { ...filters, limit: DEPTH, maxReadBytes });
|
|
266
|
+
byWords = page.items;
|
|
267
|
+
indexing = page.coverage.indexing;
|
|
268
|
+
} catch (error) {
|
|
269
|
+
if (!(error instanceof CliError) || error.code !== "validation_error")
|
|
270
|
+
throw error;
|
|
271
|
+
refused = error.message;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
input.signal?.throwIfAborted();
|
|
275
|
+
const vectors = await embedder.embed([query], "query");
|
|
276
|
+
if (vectors.length !== 1)
|
|
277
|
+
throw new CliError("invalid_response", "Meeting query model returned another vector count");
|
|
278
|
+
const vector = vectors[0];
|
|
279
|
+
const ranked = await store.meetingVectors.ranked(embedder.key, validateVector(vector, embedder.dims), {
|
|
280
|
+
...filters,
|
|
281
|
+
limit: DEPTH,
|
|
282
|
+
...maxChunks === void 0 ? {} : { maxChunks },
|
|
283
|
+
...maxRows === void 0 ? {} : { maxRows },
|
|
284
|
+
...maxTextBytes === void 0 ? {} : { maxTextBytes }
|
|
285
|
+
});
|
|
286
|
+
const floor = meaningFloor(embedder.key);
|
|
287
|
+
const byMeaning = ranked.items.filter(({ score }) => score > floor);
|
|
288
|
+
const merged = /* @__PURE__ */ new Map();
|
|
289
|
+
byMeaning.forEach((hit, rank) => {
|
|
290
|
+
const reference = { type: "meeting", accountId: input.accountId, meetingId: hit.meetingId };
|
|
291
|
+
const first = formatMeetingReference({
|
|
292
|
+
...reference,
|
|
293
|
+
transcriptId: hit.transcriptId,
|
|
294
|
+
cuePosition: hit.firstPosition
|
|
295
|
+
});
|
|
296
|
+
merged.set(`${hit.transcriptId}:${hit.firstPosition}`, {
|
|
297
|
+
ref: first,
|
|
298
|
+
meetingId: hit.meetingId,
|
|
299
|
+
scope: "transcript",
|
|
300
|
+
text: hit.text,
|
|
301
|
+
startMs: null,
|
|
302
|
+
source: { title: hit.title, startedAt: hit.startedAt, url: null },
|
|
303
|
+
by: ["meaning"],
|
|
304
|
+
score: hit.score,
|
|
305
|
+
passage: {
|
|
306
|
+
first,
|
|
307
|
+
last: formatMeetingReference({ ...reference, transcriptId: hit.transcriptId, cuePosition: hit.lastPosition })
|
|
308
|
+
},
|
|
309
|
+
fused: 1 / (RRF_K + rank + 1)
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
byWords.forEach((hit, rank) => {
|
|
313
|
+
const share = 1 / (RRF_K + rank + 1);
|
|
314
|
+
const cue = hit.scope === "transcript" ? parseMeetingReference(hit.ref) : void 0;
|
|
315
|
+
const within = cue?.cuePosition === void 0 ? void 0 : byMeaning.find((passage) => passage.transcriptId === cue.transcriptId && passage.firstPosition <= cue.cuePosition && cue.cuePosition <= passage.lastPosition);
|
|
316
|
+
const held = within && merged.get(`${within.transcriptId}:${within.firstPosition}`);
|
|
317
|
+
const found = {
|
|
318
|
+
ref: hit.ref,
|
|
319
|
+
text: hit.text,
|
|
320
|
+
startMs: hit.startMs,
|
|
321
|
+
...hit.match === void 0 ? {} : { match: hit.match },
|
|
322
|
+
...hit.corrections === void 0 ? {} : { corrections: hit.corrections }
|
|
323
|
+
};
|
|
324
|
+
if (held && !held.by.includes("words")) {
|
|
325
|
+
Object.assign(held, found, { by: ["words", "meaning"], fused: held.fused + share });
|
|
326
|
+
if (hit.source?.url)
|
|
327
|
+
held.source.url = hit.source.url;
|
|
328
|
+
} else if (held)
|
|
329
|
+
held.fused += share;
|
|
330
|
+
else
|
|
331
|
+
merged.set(`w:${hit.ref}:${hit.scope}:${hit.id}`, {
|
|
332
|
+
...found,
|
|
333
|
+
meetingId: hit.meetingId,
|
|
334
|
+
scope: hit.scope,
|
|
335
|
+
source: {
|
|
336
|
+
title: hit.source?.title ?? null,
|
|
337
|
+
startedAt: hit.source?.startedAt ?? null,
|
|
338
|
+
url: hit.source?.url ?? null
|
|
339
|
+
},
|
|
340
|
+
by: ["words"],
|
|
341
|
+
score: null,
|
|
342
|
+
fused: share
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
const ordered = [...merged.values()].sort((a, b) => b.fused - a.fused || Number(b.by.includes("words")) - Number(a.by.includes("words")) || (b.score ?? -2) - (a.score ?? -2));
|
|
346
|
+
const items = ordered.slice(offset, offset + limit).map(({ fused: _, ...hit }) => hit);
|
|
347
|
+
const hasMore = ordered.length > offset + limit;
|
|
348
|
+
return {
|
|
349
|
+
items,
|
|
350
|
+
hasMore,
|
|
351
|
+
nextCursor: hasMore ? Buffer.from(JSON.stringify({ version: 1, key, offset: offset + limit })).toString("base64url") : null,
|
|
352
|
+
selection,
|
|
353
|
+
words: {
|
|
354
|
+
query: wordQuery,
|
|
355
|
+
...terms === null ? {} : { from: "question" },
|
|
356
|
+
...refused === void 0 ? {} : { refused }
|
|
357
|
+
},
|
|
358
|
+
model: { key: embedder.key, model: embedder.model, kind: embedder.kind, dims: embedder.dims },
|
|
359
|
+
coverage: {
|
|
360
|
+
archiveCompleteness: "unknown",
|
|
361
|
+
indexCompleteness: "unknown",
|
|
362
|
+
indexing,
|
|
363
|
+
/** Every vector of the selection was compared; false when `maxChunks` stopped the scan. */
|
|
364
|
+
meaningScanComplete: ranked.complete,
|
|
365
|
+
scanned: ranked.scanned,
|
|
366
|
+
/** Each side ranks this many at most; pages past them hold nothing more. */
|
|
367
|
+
depth: DEPTH
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
}, "searchMeetingsCombined");
|
|
371
|
+
|
|
372
|
+
export {
|
|
373
|
+
words,
|
|
374
|
+
joinedHyphens,
|
|
375
|
+
isFunctionWord,
|
|
376
|
+
planQuestion,
|
|
377
|
+
questionText,
|
|
378
|
+
lookupTerms,
|
|
379
|
+
anyOfTerms,
|
|
380
|
+
questionLookup,
|
|
381
|
+
refreshMeetingIndex,
|
|
382
|
+
resolveMeetingSelection,
|
|
383
|
+
searchMeetingHits,
|
|
384
|
+
searchMeetingsCombined
|
|
385
|
+
};
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
id,
|
|
6
6
|
text,
|
|
7
7
|
time
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MY742GAD.js";
|
|
9
9
|
import {
|
|
10
10
|
reference
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4IPURN72.js";
|
|
12
12
|
import {
|
|
13
13
|
array,
|
|
14
14
|
nullable,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
unknown
|
|
21
21
|
} from "./chunk-XYIT2XB3.js";
|
|
22
22
|
|
|
23
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/entities/note.js
|
|
24
24
|
var link = {
|
|
25
25
|
target_text: nullable(text),
|
|
26
26
|
kind: text,
|