@wirecat/attio-cli 0.8.0 → 0.10.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 +23 -0
- package/contracts/wirecat.json +1 -0
- package/dist/bin/attio.js +11 -11
- package/dist/bundle/attio.js +5 -166
- package/dist/bundle/{chunk-UXJZISVL.js → chunk-OGWKDPR5.js} +2 -1
- package/dist/bundle/chunk-TQAECZFO.js +13 -0
- package/dist/bundle/{definitions-FODOIPM2.js → definitions-J73IBAHT.js} +1 -1
- package/dist/bundle/program-NSBWZ25F.js +6201 -0
- package/dist/bundle/{schemas-YGSTNU6F.js → schemas-G3HFAS45.js} +576 -29
- package/dist/commands/api.js +1 -2
- package/dist/commands/crm.js +1 -4
- package/dist/commands/schedule.js +1 -1
- package/dist/commands/session.js +1 -2
- package/dist/config.js +1 -2
- package/dist/context.js +1 -1
- package/dist/identity.js +1 -0
- package/dist/program.js +1 -2
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/dist/activities.d.ts +0 -4
- package/dist/activities.d.ts.map +0 -1
- package/dist/activities.js.map +0 -1
- package/dist/bin/attio.d.ts +0 -3
- package/dist/bin/attio.d.ts.map +0 -1
- package/dist/bin/attio.js.map +0 -1
- package/dist/bundle/agent-GUXXSLT5.js +0 -38
- package/dist/bundle/all-profiles-63N3EQ46.js +0 -320
- package/dist/bundle/anthropic-B4W7MZQE.js +0 -91
- package/dist/bundle/app-server-EXNGTHWO.js +0 -250
- package/dist/bundle/bun-OPDGMZZQ.js +0 -169
- package/dist/bundle/bun-sqlite-NBAY7FR2.js +0 -76
- package/dist/bundle/chunk-2JHVQMVC.js +0 -16
- package/dist/bundle/chunk-2QDUP74I.js +0 -794
- package/dist/bundle/chunk-2XBDILVW.js +0 -53
- package/dist/bundle/chunk-3HC5F3P7.js +0 -24
- package/dist/bundle/chunk-3MSHGNVE.js +0 -1243
- package/dist/bundle/chunk-3YM4B2GT.js +0 -63
- package/dist/bundle/chunk-4N7PP76S.js +0 -6848
- package/dist/bundle/chunk-4RBMCXZT.js +0 -1337
- package/dist/bundle/chunk-4RSWOPKL.js +0 -323
- package/dist/bundle/chunk-5JKTVAXX.js +0 -2788
- package/dist/bundle/chunk-5N2V6XO7.js +0 -119
- package/dist/bundle/chunk-5WD22IXQ.js +0 -66
- package/dist/bundle/chunk-6K4Z6CAM.js +0 -43997
- package/dist/bundle/chunk-6TD3DCWC.js +0 -106
- package/dist/bundle/chunk-7Z53MLQP.js +0 -388
- package/dist/bundle/chunk-AATTOFNY.js +0 -2045
- package/dist/bundle/chunk-APARYILG.js +0 -743
- package/dist/bundle/chunk-D72URWJE.js +0 -532
- package/dist/bundle/chunk-DFDN6AUB.js +0 -21
- package/dist/bundle/chunk-DM7KWVDZ.js +0 -3752
- package/dist/bundle/chunk-DNCLQPOM.js +0 -7
- package/dist/bundle/chunk-DPD4FMHN.js +0 -388
- package/dist/bundle/chunk-DPV53EZC.js +0 -206
- package/dist/bundle/chunk-DURNR4RO.js +0 -353
- package/dist/bundle/chunk-EH6ZEJGT.js +0 -932
- package/dist/bundle/chunk-EVUMQKV7.js +0 -76
- package/dist/bundle/chunk-EY36BTKZ.js +0 -108
- package/dist/bundle/chunk-FH6OEGGN.js +0 -557
- package/dist/bundle/chunk-FOP6G45D.js +0 -358
- package/dist/bundle/chunk-GGMAIIVE.js +0 -38
- package/dist/bundle/chunk-GTEX4IUO.js +0 -334
- package/dist/bundle/chunk-HZ3C4WXD.js +0 -142
- package/dist/bundle/chunk-IA7LLLEI.js +0 -100
- package/dist/bundle/chunk-J6GVVISK.js +0 -185
- package/dist/bundle/chunk-JG6LCSEX.js +0 -407
- package/dist/bundle/chunk-JIGEJZ4I.js +0 -68943
- package/dist/bundle/chunk-KVTNYRDO.js +0 -1007
- package/dist/bundle/chunk-L45WN3AR.js +0 -80
- package/dist/bundle/chunk-L72WUJAS.js +0 -54
- package/dist/bundle/chunk-LKH3UKLO.js +0 -230
- package/dist/bundle/chunk-LM3W7YOM.js +0 -274
- package/dist/bundle/chunk-M4AC55ZB.js +0 -12733
- package/dist/bundle/chunk-MCLQTCGH.js +0 -1202
- package/dist/bundle/chunk-NB7EOAUZ.js +0 -123
- package/dist/bundle/chunk-NISH4UXM.js +0 -58
- package/dist/bundle/chunk-OYEVYOCL.js +0 -259
- package/dist/bundle/chunk-P7G5HFY3.js +0 -288
- package/dist/bundle/chunk-PAEKXVJW.js +0 -188
- package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
- package/dist/bundle/chunk-PLPBEWD4.js +0 -170
- package/dist/bundle/chunk-PMQ7GP6X.js +0 -95
- package/dist/bundle/chunk-Q7ICVP25.js +0 -18
- package/dist/bundle/chunk-QPPOIWPY.js +0 -1246
- package/dist/bundle/chunk-QSJKSPWF.js +0 -131
- package/dist/bundle/chunk-RDVTHFPP.js +0 -338
- package/dist/bundle/chunk-RQORQN2V.js +0 -4072
- package/dist/bundle/chunk-RRTMPSQR.js +0 -29
- package/dist/bundle/chunk-S4UUN6LD.js +0 -1410
- package/dist/bundle/chunk-S6JG4YUH.js +0 -72
- package/dist/bundle/chunk-SCI7QEHF.js +0 -362
- package/dist/bundle/chunk-SSA6JBPA.js +0 -778
- package/dist/bundle/chunk-T4J7XFXT.js +0 -9667
- package/dist/bundle/chunk-TTF5DP4V.js +0 -1197
- package/dist/bundle/chunk-TXDR6YSF.js +0 -23
- package/dist/bundle/chunk-TY7NDMFY.js +0 -46
- package/dist/bundle/chunk-UDSL3MUU.js +0 -2333
- package/dist/bundle/chunk-UKHF37ZU.js +0 -1068
- package/dist/bundle/chunk-V57E7PJQ.js +0 -161
- package/dist/bundle/chunk-V7IF2K3P.js +0 -52
- package/dist/bundle/chunk-VB7FZOYX.js +0 -633
- package/dist/bundle/chunk-VZ5PPYDG.js +0 -77
- package/dist/bundle/chunk-WOPVBRPV.js +0 -29
- package/dist/bundle/chunk-WXQGA6XK.js +0 -50
- package/dist/bundle/chunk-XQGN2D44.js +0 -86
- package/dist/bundle/chunk-XQUUANA2.js +0 -24600
- package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
- package/dist/bundle/chunk-YNGU36GW.js +0 -218
- package/dist/bundle/chunk-YWDFYQOU.js +0 -82
- package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
- package/dist/bundle/chunk-ZZD2YPOX.js +0 -156
- package/dist/bundle/command-contract-KCCW4LNI.js +0 -37
- package/dist/bundle/command-server-entry-3NPPABQQ.js +0 -166
- package/dist/bundle/decode-26M7XE2B.js +0 -297
- package/dist/bundle/dispatch-2FTOHA5D.js +0 -411
- package/dist/bundle/dist-EM7KLEG4.js +0 -7577
- package/dist/bundle/dist-PAKDDIBT.js +0 -191
- package/dist/bundle/echarts-O3TNDAXJ.js +0 -42501
- package/dist/bundle/embed-XJLEAWXE.js +0 -38
- package/dist/bundle/embedder-OEL6PXEH.js +0 -111
- package/dist/bundle/failure-OHIXWTR6.js +0 -25
- package/dist/bundle/first-run-CIXGBXY6.js +0 -29
- package/dist/bundle/first-screen-5FK4D45F.js +0 -38
- package/dist/bundle/instructions-AMH5RWVJ.js +0 -11
- package/dist/bundle/mcp-5HFPWC3W.js +0 -167
- package/dist/bundle/meeting-combined-DMVGQNJ7.js +0 -24
- package/dist/bundle/meeting-model-2THAT7OH.js +0 -25
- package/dist/bundle/meeting-semantic-Q6XYFYUD.js +0 -22
- package/dist/bundle/node-EGMCBAO7.js +0 -176
- package/dist/bundle/node-KM3CUABH.js +0 -2340
- package/dist/bundle/node-TLZSIHIJ.js +0 -21
- package/dist/bundle/node-sqlite-2SWWGW6H.js +0 -74
- package/dist/bundle/oauth-V5LGTXF2.js +0 -20
- package/dist/bundle/open-25EKOTZA.js +0 -23
- package/dist/bundle/openai-VX3OLIHM.js +0 -238
- package/dist/bundle/process-SGHEN6MQ.js +0 -91
- package/dist/bundle/program-Z5NUNXME.js +0 -34214
- package/dist/bundle/prompt-2VSPX5S7.js +0 -17
- package/dist/bundle/recognize-NA5XUFKK.js +0 -26
- package/dist/bundle/remote-BOME6XOE.js +0 -31
- package/dist/bundle/rerank-NG3XMFCV.js +0 -52
- package/dist/bundle/serve-MR67OBED.js +0 -199
- package/dist/bundle/server-4BWAGJQO.js +0 -80
- package/dist/bundle/server-OP2HJNXD.js +0 -213
- package/dist/bundle/sqlite-runtime-V5U6F5EB.js +0 -20
- package/dist/bundle/state-L4MWAATO.js +0 -36
- package/dist/bundle/store-2ALTEH55.js +0 -181
- package/dist/bundle/store-CXZFRG5D.js +0 -297
- package/dist/bundle/store-maintenance-command-LC55DRQA.js +0 -67
- package/dist/bundle/surface-3GRJ7473.js +0 -66
- package/dist/commands/api.d.ts +0 -12
- package/dist/commands/api.d.ts.map +0 -1
- package/dist/commands/api.js.map +0 -1
- package/dist/commands/crm.d.ts +0 -7
- package/dist/commands/crm.d.ts.map +0 -1
- package/dist/commands/crm.js.map +0 -1
- package/dist/commands/schedule.d.ts +0 -3
- package/dist/commands/schedule.d.ts.map +0 -1
- package/dist/commands/schedule.js.map +0 -1
- package/dist/commands/session.d.ts +0 -8
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js.map +0 -1
- package/dist/config.d.ts +0 -13
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/context.d.ts +0 -37
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/generated/definitions.d.ts +0 -3
- package/dist/generated/definitions.d.ts.map +0 -1
- package/dist/generated/definitions.js.map +0 -1
- package/dist/generated/manifest.d.ts +0 -6
- package/dist/generated/manifest.d.ts.map +0 -1
- package/dist/generated/manifest.js.map +0 -1
- package/dist/generated/schemas.d.ts +0 -383
- package/dist/generated/schemas.d.ts.map +0 -1
- package/dist/generated/schemas.js.map +0 -1
- package/dist/generated/types.d.ts +0 -10166
- package/dist/generated/types.d.ts.map +0 -1
- package/dist/generated/types.js.map +0 -1
- package/dist/generated/wirecat-config.d.ts +0 -15
- package/dist/generated/wirecat-config.d.ts.map +0 -1
- package/dist/generated/wirecat-config.js.map +0 -1
- package/dist/hooks.d.ts +0 -33
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/identity.d.ts +0 -33
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/links.d.ts +0 -10
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js.map +0 -1
- package/dist/meetings.d.ts +0 -57
- package/dist/meetings.d.ts.map +0 -1
- package/dist/meetings.js.map +0 -1
- package/dist/program.d.ts +0 -6
- package/dist/program.d.ts.map +0 -1
- package/dist/program.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/wcat.d.ts +0 -3
- package/dist/wcat.d.ts.map +0 -1
- package/dist/wcat.js.map +0 -1
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
validateVector
|
|
5
|
-
} from "./chunk-PLPBEWD4.js";
|
|
6
|
-
import {
|
|
7
|
-
meaningFloor
|
|
8
|
-
} from "./chunk-GTEX4IUO.js";
|
|
9
|
-
import {
|
|
10
|
-
MESSAGE_PARSING,
|
|
11
|
-
RRF_K
|
|
12
|
-
} from "./chunk-SSA6JBPA.js";
|
|
13
|
-
import {
|
|
14
|
-
normalize
|
|
15
|
-
} from "./chunk-2JHVQMVC.js";
|
|
16
|
-
import {
|
|
17
|
-
formatMeetingReference,
|
|
18
|
-
implicitTextTerms,
|
|
19
|
-
liftMeetingFields,
|
|
20
|
-
parseLucene,
|
|
21
|
-
parseMeetingReference,
|
|
22
|
-
refreshMeetingIndex,
|
|
23
|
-
walkQuery
|
|
24
|
-
} from "./chunk-RQORQN2V.js";
|
|
25
|
-
import {
|
|
26
|
-
CliError
|
|
27
|
-
} from "./chunk-S6JG4YUH.js";
|
|
28
|
-
import {
|
|
29
|
-
__name
|
|
30
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
31
|
-
|
|
32
|
-
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
|
|
33
|
-
import { createHash } from "node:crypto";
|
|
34
|
-
|
|
35
|
-
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/search/question-plan.js
|
|
36
|
-
var words = /* @__PURE__ */ __name((text) => normalize(text).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
|
|
37
|
-
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");
|
|
38
|
-
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"));
|
|
39
|
-
var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
|
|
40
|
-
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"));
|
|
41
|
-
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"));
|
|
42
|
-
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"));
|
|
43
|
-
var isFunctionWord = /* @__PURE__ */ __name((word) => scaffolding.has(word) || QUESTION_STARTS.has(word) || QUESTION_FILLER.has(word) || LINKING.has(word), "isFunctionWord");
|
|
44
|
-
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");
|
|
45
|
-
function planQuestion(text, strict = false) {
|
|
46
|
-
if (strict)
|
|
47
|
-
return {
|
|
48
|
-
changed: false,
|
|
49
|
-
natural: false,
|
|
50
|
-
queries: [text],
|
|
51
|
-
scope: "",
|
|
52
|
-
terms: words(text),
|
|
53
|
-
rankingTerms: words(text),
|
|
54
|
-
removed: [],
|
|
55
|
-
aliases: []
|
|
56
|
-
};
|
|
57
|
-
const inputAst = parseLucene(text, MESSAGE_PARSING);
|
|
58
|
-
const rawTextual = walkQuery(inputAst.root).filter((node) => node.field === "text" || node.field === "exact");
|
|
59
|
-
const body = rawTextual.map((node) => node.value).join(" ");
|
|
60
|
-
const prefix = words(body).slice(0, 2);
|
|
61
|
-
const questionPrefix = [
|
|
62
|
-
"what",
|
|
63
|
-
"which",
|
|
64
|
-
"how",
|
|
65
|
-
"who",
|
|
66
|
-
"where",
|
|
67
|
-
"when",
|
|
68
|
-
"can",
|
|
69
|
-
"could",
|
|
70
|
-
"should",
|
|
71
|
-
"\u0441\u043A\u043E\u043B\u044C\u043A\u043E",
|
|
72
|
-
"\u043A\u0430\u043A\u043E\u0438",
|
|
73
|
-
"\u043A\u0430\u043A\u0430\u044F",
|
|
74
|
-
"\u043A\u0430\u043A\u0438\u0435",
|
|
75
|
-
"\u043A\u0430\u043A\u043E\u0435",
|
|
76
|
-
"\u043A\u0442\u043E",
|
|
77
|
-
"\u043A\u043E\u043C\u0443",
|
|
78
|
-
"\u043A\u0435\u043C",
|
|
79
|
-
"\u0433\u0434\u0435",
|
|
80
|
-
"\u043A\u043E\u0433\u0434\u0430",
|
|
81
|
-
"\u043A\u0430\u043A",
|
|
82
|
-
"\u0447\u0442\u043E",
|
|
83
|
-
"\u043C\u043E\u0436\u043D\u043E",
|
|
84
|
-
"\u043C\u043E\u0436\u0435\u0442",
|
|
85
|
-
"\u043C\u043E\u0433\u0443\u0442"
|
|
86
|
-
].includes(prefix[0] ?? "") || ["\u043A", "\u0432\u043E"].includes(prefix[0] ?? "") && ["\u043A\u043E\u043C\u0443", "\u0441\u043A\u043E\u043B\u044C\u043A\u043E"].includes(prefix[1] ?? "");
|
|
87
|
-
const natural = questionWord.test(body) && (/\?/u.test(body) || questionPrefix);
|
|
88
|
-
let cleaned = text;
|
|
89
|
-
if (natural && !text.includes("\\")) {
|
|
90
|
-
const last = rawTextual.at(-1);
|
|
91
|
-
const mark = (last?.span.end ?? 0) - 1;
|
|
92
|
-
if (last?.operator === "wildcard" && text[mark] === "?")
|
|
93
|
-
cleaned = text.slice(0, mark) + text.slice(mark + 1);
|
|
94
|
-
}
|
|
95
|
-
const ast = cleaned === text ? inputAst : parseLucene(cleaned, MESSAGE_PARSING);
|
|
96
|
-
const predicates = walkQuery(ast.root);
|
|
97
|
-
const textual = predicates.filter((p) => p.field === "text" || p.field === "exact");
|
|
98
|
-
const fields = predicates.filter((p) => p.field !== "text" && p.field !== "exact");
|
|
99
|
-
const scope = fields.map((p) => {
|
|
100
|
-
const raw = cleaned.slice(p.span.start, p.span.end);
|
|
101
|
-
return new RegExp(`^${p.field}[:=<>]`, "u").test(raw) ? raw : `${p.field}:${raw}`;
|
|
102
|
-
}).join(" ");
|
|
103
|
-
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.
|
|
104
|
-
textual.some((p) => !(p.operator === "term" || p.operator === "phrase" && !/\s/u.test(p.value)) || p.field === "exact");
|
|
105
|
-
if (bypass)
|
|
106
|
-
return {
|
|
107
|
-
changed: false,
|
|
108
|
-
natural: false,
|
|
109
|
-
queries: [text],
|
|
110
|
-
scope,
|
|
111
|
-
terms: textual.flatMap((p) => words(p.value)),
|
|
112
|
-
rankingTerms: textual.flatMap((p) => words(p.value)),
|
|
113
|
-
removed: [],
|
|
114
|
-
aliases: []
|
|
115
|
-
};
|
|
116
|
-
const original = textual.flatMap((p) => words(p.value));
|
|
117
|
-
const removed = original.filter((w) => scaffolding.has(w));
|
|
118
|
-
const terms = [...new Set(original.filter((w) => !scaffolding.has(w)))];
|
|
119
|
-
if (!terms.length)
|
|
120
|
-
return {
|
|
121
|
-
changed: false,
|
|
122
|
-
natural: true,
|
|
123
|
-
queries: [text],
|
|
124
|
-
scope,
|
|
125
|
-
terms,
|
|
126
|
-
rankingTerms: original,
|
|
127
|
-
removed,
|
|
128
|
-
aliases: []
|
|
129
|
-
};
|
|
130
|
-
const alias = [...terms];
|
|
131
|
-
const changes = [];
|
|
132
|
-
const replace = /* @__PURE__ */ __name((from, to) => {
|
|
133
|
-
for (let i = 0; i < alias.length; i++)
|
|
134
|
-
if (from.includes(alias[i] ?? "")) {
|
|
135
|
-
changes.push(`${alias[i]} -> ${to}`);
|
|
136
|
-
alias[i] = to;
|
|
137
|
-
}
|
|
138
|
-
}, "replace");
|
|
139
|
-
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))) {
|
|
140
|
-
replace(["returned", "refunded", "received"], "refund");
|
|
141
|
-
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");
|
|
142
|
-
}
|
|
143
|
-
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))) {
|
|
144
|
-
replace(["lifetime", "kept", "keep"], "retention");
|
|
145
|
-
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");
|
|
146
|
-
}
|
|
147
|
-
if (terms.includes("service") || terms.includes("build"))
|
|
148
|
-
replace(["currently", "now"], "current");
|
|
149
|
-
const render = /* @__PURE__ */ __name((ws) => [...new Set(ws)].join(" ") + (scope ? ` ${scope}` : ""), "render");
|
|
150
|
-
const queries = [.../* @__PURE__ */ new Set([render(terms), render(alias)])].slice(0, 2);
|
|
151
|
-
return { changed: true, natural: true, queries, scope, terms, rankingTerms: original, removed, aliases: changes };
|
|
152
|
-
}
|
|
153
|
-
__name(planQuestion, "planQuestion");
|
|
154
|
-
var questionText = /* @__PURE__ */ __name((text) => text.replace(new RegExp("(?<=\\p{L})\\?(?=\\s|$)", "gu"), "").replace(/"(?:[^"\\]|\\.)*"|(?<=\d):(?=\d)/gu, (found) => found === ":" ? " " : found), "questionText");
|
|
155
|
-
var lookupTerms = /* @__PURE__ */ __name((plan) => [
|
|
156
|
-
...new Set(plan.terms.concat(plan.aliases.flatMap((alias) => words(alias.split(" -> ")[1] ?? ""))))
|
|
157
|
-
], "lookupTerms");
|
|
158
|
-
var anyOfTerms = /* @__PURE__ */ __name((terms, scope) => `(${terms.join(" OR ")})${scope ? ` ${scope}` : ""}`, "anyOfTerms");
|
|
159
|
-
var questionLookup = /* @__PURE__ */ __name((text) => {
|
|
160
|
-
let plan;
|
|
161
|
-
try {
|
|
162
|
-
plan = planQuestion(questionText(text));
|
|
163
|
-
} catch (error) {
|
|
164
|
-
if (error instanceof CliError)
|
|
165
|
-
return void 0;
|
|
166
|
-
throw error;
|
|
167
|
-
}
|
|
168
|
-
const terms = plan.changed ? lookupTerms(plan) : [];
|
|
169
|
-
return terms.length ? anyOfTerms(terms, plan.scope) : void 0;
|
|
170
|
-
}, "questionLookup");
|
|
171
|
-
|
|
172
|
-
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
|
|
173
|
-
var resolveMeetingSelection = /* @__PURE__ */ __name(async (store, request) => {
|
|
174
|
-
const { project, tag, topic, ...input } = request;
|
|
175
|
-
input.signal?.throwIfAborted();
|
|
176
|
-
if (project !== void 0 && input.projectId !== void 0 || [tag, topic].filter((value) => value !== void 0).length + Number(input.tagId !== void 0) > 1)
|
|
177
|
-
throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
|
|
178
|
-
const selection = [];
|
|
179
|
-
const knowledge = store.knowledge;
|
|
180
|
-
if (!knowledge && [project, tag, topic].some((value) => value !== void 0))
|
|
181
|
-
throw new CliError("configuration_error", "this store cannot resolve project, tag or topic names");
|
|
182
|
-
for (const [kind, name] of [
|
|
183
|
-
["project", project],
|
|
184
|
-
["tag", tag],
|
|
185
|
-
["topic", topic]
|
|
186
|
-
]) {
|
|
187
|
-
if (name === void 0)
|
|
188
|
-
continue;
|
|
189
|
-
if (!knowledge)
|
|
190
|
-
continue;
|
|
191
|
-
const found = await knowledge.resolveVocabulary(name, { kind, signal: input.signal });
|
|
192
|
-
input.signal?.throwIfAborted();
|
|
193
|
-
if (found.ambiguous || found.matches.length !== 1)
|
|
194
|
-
throw new CliError(found.matches.length ? "validation_error" : "not_found", `the ${kind} name needs one canonical record`, {
|
|
195
|
-
candidates: found.matches.map((entry2) => ({ kind: entry2.kind, id: entry2.id, name: entry2.name }))
|
|
196
|
-
});
|
|
197
|
-
const entry = found.matches[0];
|
|
198
|
-
const id = Number(entry?.id);
|
|
199
|
-
if (!entry || entry.kind !== kind || !Number.isSafeInteger(id) || id < 1)
|
|
200
|
-
throw new CliError("invalid_response", "vocabulary resolution returned an invalid canonical record");
|
|
201
|
-
if (kind === "project")
|
|
202
|
-
input.projectId = id;
|
|
203
|
-
else
|
|
204
|
-
input.tagId = id;
|
|
205
|
-
selection.push({ kind, id, name: entry.name, by: "explicit-link" });
|
|
206
|
-
}
|
|
207
|
-
return { input, selection };
|
|
208
|
-
}, "resolveMeetingSelection");
|
|
209
|
-
|
|
210
|
-
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
|
|
211
|
-
var DEPTH = 200;
|
|
212
|
-
var cursorOf = /* @__PURE__ */ __name((value, key) => {
|
|
213
|
-
if (value === void 0)
|
|
214
|
-
return 0;
|
|
215
|
-
let cursor;
|
|
216
|
-
try {
|
|
217
|
-
cursor = JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
|
|
218
|
-
} catch {
|
|
219
|
-
throw new CliError("validation_error", "the cursor is not from a combined meeting search; search again");
|
|
220
|
-
}
|
|
221
|
-
if (cursor?.version !== 1 || cursor.key !== key || !Number.isSafeInteger(cursor.offset) || cursor.offset < 0)
|
|
222
|
-
throw new CliError("validation_error", "the cursor belongs to another query, filter or model; search again");
|
|
223
|
-
return cursor.offset;
|
|
224
|
-
}, "cursorOf");
|
|
225
|
-
var searchMeetingsCombined = /* @__PURE__ */ __name(async (store, embedder, typed, request) => {
|
|
226
|
-
const { maxChunks, maxRows, maxTextBytes, ...chosen } = request;
|
|
227
|
-
const { query, request: words2 } = liftMeetingFields(typed, chosen);
|
|
228
|
-
const { input, selection } = await resolveMeetingSelection(store, words2);
|
|
229
|
-
const { after, limit = 20, maxReadBytes, ...filters } = input;
|
|
230
|
-
const terms = questionTerms(query);
|
|
231
|
-
const wordQuery = terms === null ? query : terms.join(" ");
|
|
232
|
-
const key = createHash("sha256").update(JSON.stringify([query, embedder.key, Object.entries(filters).filter(([name]) => name !== "signal")])).digest("base64url");
|
|
233
|
-
const offset = cursorOf(after, key);
|
|
234
|
-
let byWords = [];
|
|
235
|
-
let indexing = "ready";
|
|
236
|
-
let refused;
|
|
237
|
-
if (wordQuery.trim()) {
|
|
238
|
-
await refreshMeetingIndex(store.meetings, input.accountId, input.signal);
|
|
239
|
-
try {
|
|
240
|
-
const page = await store.meetings.searchHits(wordQuery, { ...filters, limit: DEPTH, maxReadBytes });
|
|
241
|
-
byWords = page.items;
|
|
242
|
-
indexing = page.coverage.indexing;
|
|
243
|
-
} catch (error) {
|
|
244
|
-
if (!(error instanceof CliError) || error.code !== "validation_error")
|
|
245
|
-
throw error;
|
|
246
|
-
refused = error.message;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
input.signal?.throwIfAborted();
|
|
250
|
-
const vectors = await embedder.embed([query], "query");
|
|
251
|
-
if (vectors.length !== 1)
|
|
252
|
-
throw new CliError("invalid_response", "Meeting query model returned another vector count");
|
|
253
|
-
const vector = vectors[0];
|
|
254
|
-
const ranked = await store.meetingVectors.ranked(embedder.key, validateVector(vector, embedder.dims), {
|
|
255
|
-
...filters,
|
|
256
|
-
limit: DEPTH,
|
|
257
|
-
...maxChunks === void 0 ? {} : { maxChunks },
|
|
258
|
-
...maxRows === void 0 ? {} : { maxRows },
|
|
259
|
-
...maxTextBytes === void 0 ? {} : { maxTextBytes }
|
|
260
|
-
});
|
|
261
|
-
const floor = meaningFloor(embedder.key);
|
|
262
|
-
const byMeaning = ranked.items.filter(({ score }) => score > floor);
|
|
263
|
-
const merged = /* @__PURE__ */ new Map();
|
|
264
|
-
byMeaning.forEach((hit, rank) => {
|
|
265
|
-
const reference = { type: "meeting", accountId: input.accountId, meetingId: hit.meetingId };
|
|
266
|
-
const first = formatMeetingReference({
|
|
267
|
-
...reference,
|
|
268
|
-
transcriptId: hit.transcriptId,
|
|
269
|
-
cuePosition: hit.firstPosition
|
|
270
|
-
});
|
|
271
|
-
merged.set(`${hit.transcriptId}:${hit.firstPosition}`, {
|
|
272
|
-
ref: first,
|
|
273
|
-
meetingId: hit.meetingId,
|
|
274
|
-
scope: "transcript",
|
|
275
|
-
text: hit.text,
|
|
276
|
-
startMs: null,
|
|
277
|
-
source: { title: hit.title, startedAt: hit.startedAt, url: null },
|
|
278
|
-
by: ["meaning"],
|
|
279
|
-
score: hit.score,
|
|
280
|
-
passage: {
|
|
281
|
-
first,
|
|
282
|
-
last: formatMeetingReference({ ...reference, transcriptId: hit.transcriptId, cuePosition: hit.lastPosition })
|
|
283
|
-
},
|
|
284
|
-
fused: 1 / (RRF_K + rank + 1)
|
|
285
|
-
});
|
|
286
|
-
});
|
|
287
|
-
byWords.forEach((hit, rank) => {
|
|
288
|
-
const share = 1 / (RRF_K + rank + 1);
|
|
289
|
-
const cue = hit.scope === "transcript" ? parseMeetingReference(hit.ref) : void 0;
|
|
290
|
-
const within = cue?.cuePosition === void 0 ? void 0 : byMeaning.find((passage) => passage.transcriptId === cue.transcriptId && passage.firstPosition <= cue.cuePosition && cue.cuePosition <= passage.lastPosition);
|
|
291
|
-
const held = within && merged.get(`${within.transcriptId}:${within.firstPosition}`);
|
|
292
|
-
const found = {
|
|
293
|
-
ref: hit.ref,
|
|
294
|
-
text: hit.text,
|
|
295
|
-
startMs: hit.startMs,
|
|
296
|
-
...hit.match === void 0 ? {} : { match: hit.match },
|
|
297
|
-
...hit.corrections === void 0 ? {} : { corrections: hit.corrections }
|
|
298
|
-
};
|
|
299
|
-
if (held && !held.by.includes("words")) {
|
|
300
|
-
Object.assign(held, found, { by: ["words", "meaning"], fused: held.fused + share });
|
|
301
|
-
if (hit.source?.url)
|
|
302
|
-
held.source.url = hit.source.url;
|
|
303
|
-
} else if (held)
|
|
304
|
-
held.fused += share;
|
|
305
|
-
else
|
|
306
|
-
merged.set(`w:${hit.ref}:${hit.scope}:${hit.id}`, {
|
|
307
|
-
...found,
|
|
308
|
-
meetingId: hit.meetingId,
|
|
309
|
-
scope: hit.scope,
|
|
310
|
-
source: {
|
|
311
|
-
title: hit.source?.title ?? null,
|
|
312
|
-
startedAt: hit.source?.startedAt ?? null,
|
|
313
|
-
url: hit.source?.url ?? null
|
|
314
|
-
},
|
|
315
|
-
by: ["words"],
|
|
316
|
-
score: null,
|
|
317
|
-
fused: share
|
|
318
|
-
});
|
|
319
|
-
});
|
|
320
|
-
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));
|
|
321
|
-
const items = ordered.slice(offset, offset + limit).map(({ fused: _, ...hit }) => hit);
|
|
322
|
-
const hasMore = ordered.length > offset + limit;
|
|
323
|
-
return {
|
|
324
|
-
items,
|
|
325
|
-
hasMore,
|
|
326
|
-
nextCursor: hasMore ? Buffer.from(JSON.stringify({ version: 1, key, offset: offset + limit })).toString("base64url") : null,
|
|
327
|
-
selection,
|
|
328
|
-
words: {
|
|
329
|
-
query: wordQuery,
|
|
330
|
-
...terms === null ? {} : { from: "question" },
|
|
331
|
-
...refused === void 0 ? {} : { refused }
|
|
332
|
-
},
|
|
333
|
-
model: { key: embedder.key, model: embedder.model, kind: embedder.kind, dims: embedder.dims },
|
|
334
|
-
coverage: {
|
|
335
|
-
archiveCompleteness: "unknown",
|
|
336
|
-
indexCompleteness: "unknown",
|
|
337
|
-
indexing,
|
|
338
|
-
/** Every vector of the selection was compared; false when `maxChunks` stopped the scan. */
|
|
339
|
-
meaningScanComplete: ranked.complete,
|
|
340
|
-
scanned: ranked.scanned,
|
|
341
|
-
/** Each side ranks this many at most; pages past them hold nothing more. */
|
|
342
|
-
depth: DEPTH
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
}, "searchMeetingsCombined");
|
|
346
|
-
|
|
347
|
-
export {
|
|
348
|
-
words,
|
|
349
|
-
joinedHyphens,
|
|
350
|
-
isFunctionWord,
|
|
351
|
-
planQuestion,
|
|
352
|
-
questionText,
|
|
353
|
-
lookupTerms,
|
|
354
|
-
anyOfTerms,
|
|
355
|
-
questionLookup,
|
|
356
|
-
resolveMeetingSelection,
|
|
357
|
-
searchMeetingsCombined
|
|
358
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
__name
|
|
5
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
6
|
-
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/driver.js
|
|
8
|
-
var TIME_LIMIT_FUNCTION = "wc_time_limit";
|
|
9
|
-
var TimeLimitReached = class extends Error {
|
|
10
|
-
static {
|
|
11
|
-
__name(this, "TimeLimitReached");
|
|
12
|
-
}
|
|
13
|
-
constructor() {
|
|
14
|
-
super("the statement ran past its time limit");
|
|
15
|
-
this.name = "TimeLimitReached";
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
var beforeTimeLimit = /* @__PURE__ */ __name((until) => {
|
|
19
|
-
if (Date.now() > Number(until))
|
|
20
|
-
throw new TimeLimitReached();
|
|
21
|
-
return 1;
|
|
22
|
-
}, "beforeTimeLimit");
|
|
23
|
-
var JOURNAL_SIZE_LIMIT = 64 * 1024 * 1024;
|
|
24
|
-
var PRAGMAS = `
|
|
25
|
-
PRAGMA busy_timeout = 5000;
|
|
26
|
-
PRAGMA journal_mode = WAL;
|
|
27
|
-
PRAGMA journal_size_limit = ${JOURNAL_SIZE_LIMIT};
|
|
28
|
-
PRAGMA foreign_keys = ON;
|
|
29
|
-
`;
|
|
30
|
-
var isQueryOnly = /* @__PURE__ */ __name((database) => Number(Object.values(database.prepare("PRAGMA query_only").get() ?? {})[0]) === 1, "isQueryOnly");
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
TIME_LIMIT_FUNCTION,
|
|
34
|
-
TimeLimitReached,
|
|
35
|
-
beforeTimeLimit,
|
|
36
|
-
PRAGMAS,
|
|
37
|
-
isQueryOnly
|
|
38
|
-
};
|