@wirecat/yandex-disk-cli 0.0.0-stage → 0.1.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 +25 -0
- package/LICENSE +204 -0
- package/README.md +243 -2
- package/contracts/wirecat.json +1554 -0
- package/dist/bin/ydisk.d.ts +3 -0
- package/dist/bin/ydisk.d.ts.map +1 -0
- package/dist/bin/ydisk.js +40 -0
- package/dist/bin/ydisk.js.map +1 -0
- package/dist/bundle/all-profiles-4OLZF3RT.js +279 -0
- package/dist/bundle/anthropic-DKB4OJXZ.js +91 -0
- package/dist/bundle/app-server-G4545SSV.js +247 -0
- package/dist/bundle/bun-RXEQKFED.js +169 -0
- package/dist/bundle/bun-sqlite-VHT5LN7U.js +76 -0
- package/dist/bundle/chunk-2BITUXGC.js +12289 -0
- package/dist/bundle/chunk-2CLWDQKA.js +39330 -0
- package/dist/bundle/chunk-2JFDOPKA.js +9575 -0
- package/dist/bundle/chunk-3GVI2MAO.js +106 -0
- package/dist/bundle/chunk-3SZBWBMI.js +131 -0
- package/dist/bundle/chunk-44VSEXW6.js +4054 -0
- package/dist/bundle/chunk-4YPRRQBE.js +95 -0
- package/dist/bundle/chunk-5COYRL5B.js +379 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-5DM7DIZL.js +1402 -0
- package/dist/bundle/chunk-6R2DVTVZ.js +24 -0
- package/dist/bundle/chunk-762BS35H.js +2787 -0
- package/dist/bundle/chunk-AG64V7AB.js +1233 -0
- package/dist/bundle/chunk-BC5HGIXB.js +334 -0
- package/dist/bundle/chunk-BH7LFEX7.js +36 -0
- package/dist/bundle/chunk-BLNPGY7N.js +53 -0
- package/dist/bundle/chunk-CNIA2LJF.js +372 -0
- package/dist/bundle/chunk-COSXMDC7.js +230 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-D7FO33KU.js +785 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DJH26PQ3.js +1396 -0
- package/dist/bundle/chunk-DJPT7IUC.js +64567 -0
- package/dist/bundle/chunk-DTMSCZDW.js +209 -0
- package/dist/bundle/chunk-E6LGZ5LX.js +16 -0
- package/dist/bundle/chunk-E6YRIHS5.js +92 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-F3DDSZTF.js +78 -0
- package/dist/bundle/chunk-F4WWTQNL.js +188 -0
- package/dist/bundle/chunk-FDDAUASC.js +1028 -0
- package/dist/bundle/chunk-FMNPG6N2.js +170 -0
- package/dist/bundle/chunk-FOKJ4POB.js +274 -0
- package/dist/bundle/chunk-G22C7JG6.js +731 -0
- package/dist/bundle/chunk-GA442SYZ.js +161 -0
- package/dist/bundle/chunk-GEBSW7UK.js +6848 -0
- package/dist/bundle/chunk-GGRKWAOK.js +594 -0
- package/dist/bundle/chunk-HHINRNZA.js +788 -0
- package/dist/bundle/chunk-HUZCL33L.js +128 -0
- package/dist/bundle/chunk-IALSIQVT.js +142 -0
- package/dist/bundle/chunk-IOXR2QBX.js +398 -0
- package/dist/bundle/chunk-J5CXR6VX.js +63 -0
- package/dist/bundle/chunk-J5PWSTOX.js +82 -0
- package/dist/bundle/chunk-J7BVAEHR.js +364 -0
- package/dist/bundle/chunk-JH46HMZW.js +1334 -0
- package/dist/bundle/chunk-JOBO7F6W.js +52 -0
- package/dist/bundle/chunk-JXZ5B3L5.js +2333 -0
- package/dist/bundle/chunk-KBIAMDZN.js +66 -0
- package/dist/bundle/chunk-KFVDL2QS.js +146 -0
- package/dist/bundle/chunk-LNHTLSR5.js +288 -0
- package/dist/bundle/chunk-M24RAKMJ.js +58 -0
- package/dist/bundle/chunk-MDQ57Q3H.js +1197 -0
- package/dist/bundle/chunk-MGUEZYFA.js +5546 -0
- package/dist/bundle/chunk-MLXQ4X5L.js +206 -0
- package/dist/bundle/chunk-NQAKARHE.js +54 -0
- package/dist/bundle/chunk-OF7VVUDQ.js +23 -0
- package/dist/bundle/chunk-OQVPE3XK.js +324 -0
- package/dist/bundle/chunk-OR3QG7UR.js +259 -0
- package/dist/bundle/chunk-OUUYVROP.js +76 -0
- package/dist/bundle/chunk-PQBAM64O.js +168 -0
- package/dist/bundle/chunk-PYVIA7WF.js +88 -0
- package/dist/bundle/chunk-Q6HK3PHE.js +72 -0
- package/dist/bundle/chunk-QB3KECV2.js +218 -0
- package/dist/bundle/chunk-QGWXSFYN.js +73 -0
- package/dist/bundle/chunk-RC5QAAAE.js +29 -0
- package/dist/bundle/chunk-RMJ26HLB.js +18 -0
- package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
- package/dist/bundle/chunk-T7ZUDA4C.js +72 -0
- package/dist/bundle/chunk-TRCSMVV5.js +72 -0
- package/dist/bundle/chunk-UD2BQEKA.js +46 -0
- package/dist/bundle/chunk-V4TL55GS.js +1068 -0
- package/dist/bundle/chunk-VJNWN5VU.js +4072 -0
- package/dist/bundle/chunk-VRRNBLMA.js +1227 -0
- package/dist/bundle/chunk-WUCMMNFJ.js +771 -0
- package/dist/bundle/chunk-XDESE3NY.js +44 -0
- package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
- package/dist/bundle/chunk-XQUUANA2.js +24600 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-Z2QEON7B.js +2275 -0
- package/dist/bundle/chunk-ZMJ56GME.js +7 -0
- package/dist/bundle/chunk-ZTSB3D7Q.js +100 -0
- package/dist/bundle/chunk-ZVJWD3FK.js +38 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-YIOYGPJA.js +40 -0
- package/dist/bundle/command-server-entry-MHBQDXS4.js +169 -0
- package/dist/bundle/decode-NUGJIOUW.js +297 -0
- package/dist/bundle/definitions-AILHKEQT.js +2005 -0
- package/dist/bundle/dispatch-5LC4UEGY.js +411 -0
- package/dist/bundle/dist-4I2W6X2I.js +7577 -0
- package/dist/bundle/echarts-MHSH6PGC.js +42501 -0
- package/dist/bundle/embed-ZDXTHHYS.js +38 -0
- package/dist/bundle/embedder-XFEELFUL.js +111 -0
- package/dist/bundle/failure-5S7VPBYK.js +25 -0
- package/dist/bundle/first-run-JHCHT3RJ.js +29 -0
- package/dist/bundle/first-screen-FHGQ6QRV.js +40 -0
- package/dist/bundle/instructions-WKSMBUFX.js +11 -0
- package/dist/bundle/mcp-HS2ZDUVR.js +167 -0
- 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-K4U4NYRZ.js +25 -0
- package/dist/bundle/meeting-model-KCEG6Y5O.js +26 -0
- package/dist/bundle/meeting-semantic-VYGSV3H6.js +22 -0
- package/dist/bundle/micromark-extension-gfm-5X7YT43T.js +1838 -0
- package/dist/bundle/node-CM6NC6UE.js +176 -0
- package/dist/bundle/node-KM3CUABH.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-5YDQ3LIJ.js +74 -0
- package/dist/bundle/notes-search-PGO7KM2U.js +62 -0
- package/dist/bundle/oauth-NY4C5UCK.js +20 -0
- package/dist/bundle/open-YNUTA6ZE.js +23 -0
- package/dist/bundle/openai-4CVT5PHH.js +241 -0
- package/dist/bundle/process-2XT3TL27.js +91 -0
- package/dist/bundle/program-FMIVF5T6.js +31904 -0
- package/dist/bundle/prompt-VNWY3H6S.js +17 -0
- package/dist/bundle/recognize-JS4PBPSZ.js +26 -0
- package/dist/bundle/remote-RCLFH4V2.js +32 -0
- package/dist/bundle/rerank-EG6VKYGO.js +52 -0
- package/dist/bundle/schemas-ED2LHKXK.js +645 -0
- package/dist/bundle/serve-AHG25QXB.js +199 -0
- package/dist/bundle/server-5FTB7WM3.js +78 -0
- package/dist/bundle/server-JNZVSAZE.js +209 -0
- package/dist/bundle/sqlite-runtime-XSZOAQPF.js +20 -0
- package/dist/bundle/state-XGVAJFF7.js +36 -0
- package/dist/bundle/store-OHSCWZEV.js +177 -0
- package/dist/bundle/store-PKSPKJXL.js +293 -0
- package/dist/bundle/store-maintenance-command-KAWGBSWK.js +69 -0
- package/dist/bundle/ydisk.js +183 -0
- package/dist/commands/api.d.ts +9 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +59 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/comments.d.ts +3 -0
- package/dist/commands/comments.d.ts.map +1 -0
- package/dist/commands/comments.js +114 -0
- package/dist/commands/comments.js.map +1 -0
- package/dist/commands/files.d.ts +3 -0
- package/dist/commands/files.d.ts.map +1 -0
- package/dist/commands/files.js +272 -0
- package/dist/commands/files.js.map +1 -0
- package/dist/commands/library.d.ts +13 -0
- package/dist/commands/library.d.ts.map +1 -0
- package/dist/commands/library.js +118 -0
- package/dist/commands/library.js.map +1 -0
- package/dist/commands/session.d.ts +3 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +99 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +62 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +80 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +77 -0
- package/dist/context.js.map +1 -0
- package/dist/generated/definitions.d.ts +3 -0
- package/dist/generated/definitions.d.ts.map +1 -0
- package/dist/generated/definitions.js +2001 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/manifest.d.ts +6 -0
- package/dist/generated/manifest.d.ts.map +1 -0
- package/dist/generated/manifest.js +1473 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/schemas.d.ts +127 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +545 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +829 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +5 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/identity.d.ts +10 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +33 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +65 -0
- package/dist/program.js.map +1 -0
- package/dist/sample/comments.d.ts +61 -0
- package/dist/sample/comments.d.ts.map +1 -0
- package/dist/sample/comments.js +39 -0
- package/dist/sample/comments.js.map +1 -0
- package/dist/sample/records.d.ts +16 -0
- package/dist/sample/records.d.ts.map +1 -0
- package/dist/sample/records.js +22 -0
- package/dist/sample/records.js.map +1 -0
- package/dist/sample/transport.d.ts +42 -0
- package/dist/sample/transport.d.ts.map +1 -0
- package/dist/sample/transport.js +153 -0
- package/dist/sample/transport.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/dist/yandex/source.d.ts +39 -0
- package/dist/yandex/source.d.ts.map +1 -0
- package/dist/yandex/source.js +189 -0
- package/dist/yandex/source.js.map +1 -0
- package/dist/yandex/transport.d.ts +41 -0
- package/dist/yandex/transport.d.ts.map +1 -0
- package/dist/yandex/transport.js +152 -0
- package/dist/yandex/transport.js.map +1 -0
- package/dist/yandex/writes.d.ts +27 -0
- package/dist/yandex/writes.d.ts.map +1 -0
- package/dist/yandex/writes.js +61 -0
- package/dist/yandex/writes.js.map +1 -0
- package/package.json +88 -4
- package/skills/yandex-disk-cli/SKILL.md +46 -0
- package/skills/yandex-disk-cli/references/api/api-disk-operations-operation-id.md +13 -0
- package/skills/yandex-disk-cli/references/api/api-disk-public-resources.md +50 -0
- package/skills/yandex-disk-cli/references/api/api-disk-resources.md +171 -0
- package/skills/yandex-disk-cli/references/api/api-disk-trash-resources.md +48 -0
- package/skills/yandex-disk-cli/references/api/api-disk.md +13 -0
- package/skills/yandex-disk-cli/references/api.md +17 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
questionTerms
|
|
5
|
+
} from "./chunk-PQBAM64O.js";
|
|
6
|
+
import {
|
|
7
|
+
validateVector
|
|
8
|
+
} from "./chunk-FMNPG6N2.js";
|
|
9
|
+
import {
|
|
10
|
+
meaningFloor
|
|
11
|
+
} from "./chunk-BC5HGIXB.js";
|
|
12
|
+
import {
|
|
13
|
+
RRF_K
|
|
14
|
+
} from "./chunk-WUCMMNFJ.js";
|
|
15
|
+
import {
|
|
16
|
+
formatMeetingReference,
|
|
17
|
+
liftMeetingFields,
|
|
18
|
+
parseMeetingReference,
|
|
19
|
+
refreshMeetingIndex
|
|
20
|
+
} from "./chunk-VJNWN5VU.js";
|
|
21
|
+
import {
|
|
22
|
+
CliError
|
|
23
|
+
} from "./chunk-T7ZUDA4C.js";
|
|
24
|
+
import {
|
|
25
|
+
__name
|
|
26
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
27
|
+
|
|
28
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.692.0_@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_comm_daa46dda8170ab81fe68d59b38277e40/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
|
|
29
|
+
import { createHash } from "node:crypto";
|
|
30
|
+
|
|
31
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.692.0_@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_comm_daa46dda8170ab81fe68d59b38277e40/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
|
|
32
|
+
var resolveMeetingSelection = /* @__PURE__ */ __name(async (store, request) => {
|
|
33
|
+
const { project, tag, topic, ...input } = request;
|
|
34
|
+
input.signal?.throwIfAborted();
|
|
35
|
+
if (project !== void 0 && input.projectId !== void 0 || [tag, topic].filter((value) => value !== void 0).length + Number(input.tagId !== void 0) > 1)
|
|
36
|
+
throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
|
|
37
|
+
const selection = [];
|
|
38
|
+
const knowledge = store.knowledge;
|
|
39
|
+
if (!knowledge && [project, tag, topic].some((value) => value !== void 0))
|
|
40
|
+
throw new CliError("configuration_error", "this store cannot resolve project, tag or topic names");
|
|
41
|
+
for (const [kind, name] of [
|
|
42
|
+
["project", project],
|
|
43
|
+
["tag", tag],
|
|
44
|
+
["topic", topic]
|
|
45
|
+
]) {
|
|
46
|
+
if (name === void 0)
|
|
47
|
+
continue;
|
|
48
|
+
if (!knowledge)
|
|
49
|
+
continue;
|
|
50
|
+
const found = await knowledge.resolveVocabulary(name, { kind, signal: input.signal });
|
|
51
|
+
input.signal?.throwIfAborted();
|
|
52
|
+
if (found.ambiguous || found.matches.length !== 1)
|
|
53
|
+
throw new CliError(found.matches.length ? "validation_error" : "not_found", `the ${kind} name needs one canonical record`, {
|
|
54
|
+
candidates: found.matches.map((entry2) => ({ kind: entry2.kind, id: entry2.id, name: entry2.name }))
|
|
55
|
+
});
|
|
56
|
+
const entry = found.matches[0];
|
|
57
|
+
const id = Number(entry?.id);
|
|
58
|
+
if (!entry || entry.kind !== kind || !Number.isSafeInteger(id) || id < 1)
|
|
59
|
+
throw new CliError("invalid_response", "vocabulary resolution returned an invalid canonical record");
|
|
60
|
+
if (kind === "project")
|
|
61
|
+
input.projectId = id;
|
|
62
|
+
else
|
|
63
|
+
input.tagId = id;
|
|
64
|
+
selection.push({ kind, id, name: entry.name, by: "explicit-link" });
|
|
65
|
+
}
|
|
66
|
+
return { input, selection };
|
|
67
|
+
}, "resolveMeetingSelection");
|
|
68
|
+
|
|
69
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.692.0_@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_comm_daa46dda8170ab81fe68d59b38277e40/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
|
|
70
|
+
var DEPTH = 200;
|
|
71
|
+
var cursorOf = /* @__PURE__ */ __name((value, key) => {
|
|
72
|
+
if (value === void 0)
|
|
73
|
+
return 0;
|
|
74
|
+
let cursor;
|
|
75
|
+
try {
|
|
76
|
+
cursor = JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
|
|
77
|
+
} catch {
|
|
78
|
+
throw new CliError("validation_error", "the cursor is not from a combined meeting search; search again");
|
|
79
|
+
}
|
|
80
|
+
if (cursor?.version !== 1 || cursor.key !== key || !Number.isSafeInteger(cursor.offset) || cursor.offset < 0)
|
|
81
|
+
throw new CliError("validation_error", "the cursor belongs to another query, filter or model; search again");
|
|
82
|
+
return cursor.offset;
|
|
83
|
+
}, "cursorOf");
|
|
84
|
+
var searchMeetingsCombined = /* @__PURE__ */ __name(async (store, embedder, typed, request) => {
|
|
85
|
+
const { maxChunks, maxRows, maxTextBytes, ...chosen } = request;
|
|
86
|
+
const { query, request: words } = liftMeetingFields(typed, chosen);
|
|
87
|
+
const { input, selection } = await resolveMeetingSelection(store, words);
|
|
88
|
+
const { after, limit = 20, maxReadBytes, ...filters } = input;
|
|
89
|
+
const terms = questionTerms(query);
|
|
90
|
+
const wordQuery = terms === null ? query : terms.join(" ");
|
|
91
|
+
const key = createHash("sha256").update(JSON.stringify([query, embedder.key, Object.entries(filters).filter(([name]) => name !== "signal")])).digest("base64url");
|
|
92
|
+
const offset = cursorOf(after, key);
|
|
93
|
+
let byWords = [];
|
|
94
|
+
let indexing = "ready";
|
|
95
|
+
let refused;
|
|
96
|
+
if (wordQuery.trim()) {
|
|
97
|
+
await refreshMeetingIndex(store.meetings, input.accountId, input.signal);
|
|
98
|
+
try {
|
|
99
|
+
const page = await store.meetings.searchHits(wordQuery, { ...filters, limit: DEPTH, maxReadBytes });
|
|
100
|
+
byWords = page.items;
|
|
101
|
+
indexing = page.coverage.indexing;
|
|
102
|
+
} catch (error) {
|
|
103
|
+
if (!(error instanceof CliError) || error.code !== "validation_error")
|
|
104
|
+
throw error;
|
|
105
|
+
refused = error.message;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
input.signal?.throwIfAborted();
|
|
109
|
+
const vectors = await embedder.embed([query], "query");
|
|
110
|
+
if (vectors.length !== 1)
|
|
111
|
+
throw new CliError("invalid_response", "Meeting query model returned another vector count");
|
|
112
|
+
const vector = vectors[0];
|
|
113
|
+
const ranked = await store.meetingVectors.ranked(embedder.key, validateVector(vector, embedder.dims), {
|
|
114
|
+
...filters,
|
|
115
|
+
limit: DEPTH,
|
|
116
|
+
...maxChunks === void 0 ? {} : { maxChunks },
|
|
117
|
+
...maxRows === void 0 ? {} : { maxRows },
|
|
118
|
+
...maxTextBytes === void 0 ? {} : { maxTextBytes }
|
|
119
|
+
});
|
|
120
|
+
const floor = meaningFloor(embedder.key);
|
|
121
|
+
const byMeaning = ranked.items.filter(({ score }) => score > floor);
|
|
122
|
+
const merged = /* @__PURE__ */ new Map();
|
|
123
|
+
byMeaning.forEach((hit, rank) => {
|
|
124
|
+
const reference = { type: "meeting", accountId: input.accountId, meetingId: hit.meetingId };
|
|
125
|
+
const first = formatMeetingReference({
|
|
126
|
+
...reference,
|
|
127
|
+
transcriptId: hit.transcriptId,
|
|
128
|
+
cuePosition: hit.firstPosition
|
|
129
|
+
});
|
|
130
|
+
merged.set(`${hit.transcriptId}:${hit.firstPosition}`, {
|
|
131
|
+
ref: first,
|
|
132
|
+
meetingId: hit.meetingId,
|
|
133
|
+
scope: "transcript",
|
|
134
|
+
text: hit.text,
|
|
135
|
+
startMs: null,
|
|
136
|
+
source: { title: hit.title, startedAt: hit.startedAt, url: null },
|
|
137
|
+
by: ["meaning"],
|
|
138
|
+
score: hit.score,
|
|
139
|
+
passage: {
|
|
140
|
+
first,
|
|
141
|
+
last: formatMeetingReference({ ...reference, transcriptId: hit.transcriptId, cuePosition: hit.lastPosition })
|
|
142
|
+
},
|
|
143
|
+
fused: 1 / (RRF_K + rank + 1)
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
byWords.forEach((hit, rank) => {
|
|
147
|
+
const share = 1 / (RRF_K + rank + 1);
|
|
148
|
+
const cue = hit.scope === "transcript" ? parseMeetingReference(hit.ref) : void 0;
|
|
149
|
+
const within = cue?.cuePosition === void 0 ? void 0 : byMeaning.find((passage) => passage.transcriptId === cue.transcriptId && passage.firstPosition <= cue.cuePosition && cue.cuePosition <= passage.lastPosition);
|
|
150
|
+
const held = within && merged.get(`${within.transcriptId}:${within.firstPosition}`);
|
|
151
|
+
const found = {
|
|
152
|
+
ref: hit.ref,
|
|
153
|
+
text: hit.text,
|
|
154
|
+
startMs: hit.startMs,
|
|
155
|
+
...hit.match === void 0 ? {} : { match: hit.match },
|
|
156
|
+
...hit.corrections === void 0 ? {} : { corrections: hit.corrections }
|
|
157
|
+
};
|
|
158
|
+
if (held && !held.by.includes("words")) {
|
|
159
|
+
Object.assign(held, found, { by: ["words", "meaning"], fused: held.fused + share });
|
|
160
|
+
if (hit.source?.url)
|
|
161
|
+
held.source.url = hit.source.url;
|
|
162
|
+
} else if (held)
|
|
163
|
+
held.fused += share;
|
|
164
|
+
else
|
|
165
|
+
merged.set(`w:${hit.ref}:${hit.scope}:${hit.id}`, {
|
|
166
|
+
...found,
|
|
167
|
+
meetingId: hit.meetingId,
|
|
168
|
+
scope: hit.scope,
|
|
169
|
+
source: {
|
|
170
|
+
title: hit.source?.title ?? null,
|
|
171
|
+
startedAt: hit.source?.startedAt ?? null,
|
|
172
|
+
url: hit.source?.url ?? null
|
|
173
|
+
},
|
|
174
|
+
by: ["words"],
|
|
175
|
+
score: null,
|
|
176
|
+
fused: share
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
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));
|
|
180
|
+
const items = ordered.slice(offset, offset + limit).map(({ fused: _, ...hit }) => hit);
|
|
181
|
+
const hasMore = ordered.length > offset + limit;
|
|
182
|
+
return {
|
|
183
|
+
items,
|
|
184
|
+
hasMore,
|
|
185
|
+
nextCursor: hasMore ? Buffer.from(JSON.stringify({ version: 1, key, offset: offset + limit })).toString("base64url") : null,
|
|
186
|
+
selection,
|
|
187
|
+
words: {
|
|
188
|
+
query: wordQuery,
|
|
189
|
+
...terms === null ? {} : { from: "question" },
|
|
190
|
+
...refused === void 0 ? {} : { refused }
|
|
191
|
+
},
|
|
192
|
+
model: { key: embedder.key, model: embedder.model, kind: embedder.kind, dims: embedder.dims },
|
|
193
|
+
coverage: {
|
|
194
|
+
archiveCompleteness: "unknown",
|
|
195
|
+
indexCompleteness: "unknown",
|
|
196
|
+
indexing,
|
|
197
|
+
/** Every vector of the selection was compared; false when `maxChunks` stopped the scan. */
|
|
198
|
+
meaningScanComplete: ranked.complete,
|
|
199
|
+
scanned: ranked.scanned,
|
|
200
|
+
/** Each side ranks this many at most; pages past them hold nothing more. */
|
|
201
|
+
depth: DEPTH
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
}, "searchMeetingsCombined");
|
|
205
|
+
|
|
206
|
+
export {
|
|
207
|
+
resolveMeetingSelection,
|
|
208
|
+
searchMeetingsCombined
|
|
209
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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@0.692.0_@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_comm_daa46dda8170ab81fe68d59b38277e40/node_modules/@wirecat/cli-core/dist/store/normalize.js
|
|
8
|
+
var NORMALIZER_VERSION = 1;
|
|
9
|
+
var fold = /* @__PURE__ */ __name((text) => text.normalize("NFKD").replace(new RegExp("\\p{M}+", "gu"), "").normalize("NFC").toLowerCase(), "fold");
|
|
10
|
+
var normalize = /* @__PURE__ */ __name((text) => fold(text).replace(new RegExp("\\p{Cc}", "gu"), " ").replace(/\s+/gu, " ").trim(), "normalize");
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
NORMALIZER_VERSION,
|
|
14
|
+
fold,
|
|
15
|
+
normalize
|
|
16
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
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@0.692.0_@wirecat+cli-base@0.110.0_@scalar+openapi-upgrader@0.4.6_comm_daa46dda8170ab81fe68d59b38277e40/node_modules/@wirecat/cli-core/dist/runs/secrets.js
|
|
8
|
+
var SECRET_WORDS = /* @__PURE__ */ new Set([
|
|
9
|
+
"authorization",
|
|
10
|
+
"cookie",
|
|
11
|
+
"credential",
|
|
12
|
+
"credentials",
|
|
13
|
+
"passphrase",
|
|
14
|
+
"password",
|
|
15
|
+
"passwd",
|
|
16
|
+
"pwd",
|
|
17
|
+
"pass",
|
|
18
|
+
"passcode",
|
|
19
|
+
"pin",
|
|
20
|
+
"otp",
|
|
21
|
+
"2fa",
|
|
22
|
+
"secret",
|
|
23
|
+
"token",
|
|
24
|
+
"contrase\xF1a",
|
|
25
|
+
"contrasena",
|
|
26
|
+
"clave",
|
|
27
|
+
"\u043F\u0430\u0440\u043E\u043B\u044C",
|
|
28
|
+
"\u043F\u0438\u043D",
|
|
29
|
+
"\u043A\u043E\u0434",
|
|
30
|
+
...["api", "auth", "service", "account", "db", "database", "priv", "private", "client"].map((word) => `${word}key`),
|
|
31
|
+
...["db", "database", "key"].map((word) => `${word}pass`)
|
|
32
|
+
]);
|
|
33
|
+
var secretNamed = /* @__PURE__ */ __name((name) => {
|
|
34
|
+
const words = name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[\s_.-]+/).map((word) => word.toLowerCase());
|
|
35
|
+
return words.some((word, at) => SECRET_WORDS.has(word) || SECRET_WORDS.has(word + (words[at + 1] ?? "")));
|
|
36
|
+
}, "secretNamed");
|
|
37
|
+
var START = "(?<![A-Za-z0-9_-])";
|
|
38
|
+
var END = "(?![A-Za-z0-9_-])";
|
|
39
|
+
var KNOWN_TOKENS = new RegExp(`${[
|
|
40
|
+
"gh[pousr]_[A-Za-z0-9]{36,}",
|
|
41
|
+
"github_pat_[A-Za-z0-9_]{22,}",
|
|
42
|
+
"sk-[A-Za-z0-9_-]{20,}",
|
|
43
|
+
"xox[abprs]-[A-Za-z0-9-]{10,}",
|
|
44
|
+
"(?:AKIA|ASIA)[A-Z0-9]{16}",
|
|
45
|
+
"AIza[A-Za-z0-9_-]{35}",
|
|
46
|
+
"(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{10,}",
|
|
47
|
+
"npm_[A-Za-z0-9]{36}",
|
|
48
|
+
"eyJ[A-Za-z0-9_-]{5,}\\.eyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]*"
|
|
49
|
+
].map((pattern) => `${START}${pattern}${END}`).join("|")}|(?<!\\d)\\d{8,10}:[A-Za-z0-9_-]{35}${END}`, "g");
|
|
50
|
+
var WEBHOOK_PATH = /(\/rest\/\d+\/)[^/\s?#"']+/g;
|
|
51
|
+
var PRIVATE_KEY = /-----BEGIN[A-Z ]* PRIVATE KEY-----[\s\S]*?(?:-----END[A-Z ]* PRIVATE KEY-----|$)/g;
|
|
52
|
+
var SCHEME = /(?<![A-Za-z])(Bearer|Basic)(\s+)(?![A-Z]?[a-z]+(?![A-Za-z0-9]))[A-Za-z0-9._~+/=-]{8,}/g;
|
|
53
|
+
var NAMED_PAIR = /(?<![\p{L}\p{N}])([\p{L}\p{N}_.-]*(?:token|pass|pwd|pin|otp|2fa|secret|credential|cookie|authorization|key|contrase|clave|пароль|пин|код)[\p{L}\p{N}_.-]*)(["']?\s*(?:=>|[:=])\s*["']?|\s+(?![\p{L}]+(?![\p{L}\p{N}])))((?:Bearer\s+|Basic\s+)?)([^\s"'&,;]+)/giu;
|
|
54
|
+
var looksRandom = /* @__PURE__ */ __name((run) => {
|
|
55
|
+
if (run.length < 20)
|
|
56
|
+
return false;
|
|
57
|
+
const classes = [/[a-z]/, /[A-Z]/, /\d/, /[^A-Za-z0-9]/].filter((kind) => kind.test(run)).length;
|
|
58
|
+
if (classes < 3)
|
|
59
|
+
return false;
|
|
60
|
+
let switches = 0;
|
|
61
|
+
for (let at = 1; at < run.length; at++) {
|
|
62
|
+
const [before, after] = [run[at - 1], run[at]];
|
|
63
|
+
if (/[a-z]/.test(before) && /[A-Z]/.test(after) || /[A-Z]/.test(before) && /[a-z]/.test(after))
|
|
64
|
+
switches += 1;
|
|
65
|
+
}
|
|
66
|
+
if (switches / run.length < 0.15)
|
|
67
|
+
return false;
|
|
68
|
+
const pieces = run.match(/[A-Z]?[a-z]+|[A-Z]+(?![a-z])|\d+/g) ?? [];
|
|
69
|
+
if (pieces.join("").length / Math.max(pieces.length, 1) >= 2.75)
|
|
70
|
+
return false;
|
|
71
|
+
return entropy(run) >= 3.5;
|
|
72
|
+
}, "looksRandom");
|
|
73
|
+
var entropy = /* @__PURE__ */ __name((text) => {
|
|
74
|
+
const counts = /* @__PURE__ */ new Map();
|
|
75
|
+
for (const char of text)
|
|
76
|
+
counts.set(char, (counts.get(char) ?? 0) + 1);
|
|
77
|
+
let bits = 0;
|
|
78
|
+
for (const count of counts.values())
|
|
79
|
+
bits -= count / text.length * Math.log2(count / text.length);
|
|
80
|
+
return bits;
|
|
81
|
+
}, "entropy");
|
|
82
|
+
var withoutSecrets = /* @__PURE__ */ __name((text, mark = "[redacted]") => text.replace(WEBHOOK_PATH, `$1${mark}`).replace(PRIVATE_KEY, mark).replace(KNOWN_TOKENS, mark).replace(SCHEME, `$1$2${mark}`).replace(NAMED_PAIR, (whole, name, separator, scheme) => secretNamed(name) ? `${name}${separator}${scheme}${mark}` : whole).replace(/[!-~]{20,}/g, (token) => (
|
|
83
|
+
// A URL or a path is somebody's address, not a key; a credential in one is caught by the rules above.
|
|
84
|
+
token.includes("://") || /^(?:\/|~\/|\.\.?\/)/.test(token) ? token : token.replace(RUN, (run) => looksRandom(run) ? mark : run.replace(HEX, (hex) => entropy(hex) >= 3 ? mark : hex))
|
|
85
|
+
)), "withoutSecrets");
|
|
86
|
+
var RUN = /(?<![A-Za-z0-9_+/-])[A-Za-z0-9_+/-]{20,}/g;
|
|
87
|
+
var HEX = /(?<![A-Za-z0-9])(?=[0-9]*[a-f])[0-9a-f]{20,}(?![A-Za-z0-9])/g;
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
secretNamed,
|
|
91
|
+
withoutSecrets
|
|
92
|
+
};
|