@wirecat/slack-cli 0.0.0-stage → 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 +121 -0
- package/LICENSE +204 -0
- package/README.md +131 -2
- package/contracts/wirecat.json +5526 -0
- package/dist/bin/slack.d.ts +3 -0
- package/dist/bin/slack.d.ts.map +1 -0
- package/dist/bin/slack.js +40 -0
- package/dist/bin/slack.js.map +1 -0
- package/dist/bundle/agent-GOFXFUQP.js +37 -0
- package/dist/bundle/all-profiles-4C7VOT2D.js +320 -0
- package/dist/bundle/anthropic-ZD66TC5S.js +91 -0
- package/dist/bundle/app-server-QNCVEDMY.js +249 -0
- package/dist/bundle/bun-2FULBYXS.js +169 -0
- package/dist/bundle/bun-sqlite-PMS26ZUT.js +76 -0
- package/dist/bundle/chunk-2LB5BWC4.js +362 -0
- package/dist/bundle/chunk-2ZEYRHZV.js +18 -0
- package/dist/bundle/chunk-3IJ3THPV.js +7 -0
- package/dist/bundle/chunk-3IZF5ENR.js +61 -0
- package/dist/bundle/chunk-4HSVEQ3R.js +29 -0
- package/dist/bundle/chunk-4QPMHVM5.js +1007 -0
- package/dist/bundle/chunk-53LIHHXC.js +16 -0
- package/dist/bundle/chunk-5F36CXDM.js +794 -0
- package/dist/bundle/chunk-5LPREGD3.js +12636 -0
- package/dist/bundle/chunk-5R5YRYIP.js +1148 -0
- package/dist/bundle/chunk-5RSQTG7L.js +388 -0
- package/dist/bundle/chunk-5SXZETJF.js +170 -0
- package/dist/bundle/chunk-6PDQP5RM.js +50 -0
- package/dist/bundle/chunk-75BLNPN3.js +1197 -0
- package/dist/bundle/chunk-7BEO72EN.js +131 -0
- package/dist/bundle/chunk-7F6RNAIM.js +230 -0
- package/dist/bundle/chunk-AG7FP64Z.js +77 -0
- package/dist/bundle/chunk-BRXTN5LJ.js +338 -0
- package/dist/bundle/chunk-CABZAU37.js +319 -0
- package/dist/bundle/chunk-CCOSG3F2.js +24616 -0
- package/dist/bundle/chunk-CDTZSFTN.js +58 -0
- package/dist/bundle/chunk-CMZBCWND.js +1246 -0
- package/dist/bundle/chunk-CRQEEJNF.js +185 -0
- package/dist/bundle/chunk-CWYU4R65.js +358 -0
- package/dist/bundle/chunk-CZFR6JQX.js +52 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DVHX7R54.js +4072 -0
- package/dist/bundle/chunk-DYKOG7QR.js +9596 -0
- package/dist/bundle/chunk-ECDI42G6.js +100 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-ELY2TLCY.js +259 -0
- package/dist/bundle/chunk-ERRVUVKR.js +156 -0
- package/dist/bundle/chunk-FBWR4E5D.js +353 -0
- package/dist/bundle/chunk-GKS6KL57.js +6848 -0
- package/dist/bundle/chunk-H2COZZ55.js +2787 -0
- package/dist/bundle/chunk-HGXTEK7R.js +82 -0
- package/dist/bundle/chunk-HXLXM7HV.js +726 -0
- package/dist/bundle/chunk-IPP4N6HD.js +24 -0
- package/dist/bundle/chunk-IWTVR7S7.js +53 -0
- package/dist/bundle/chunk-IYJH75D4.js +63 -0
- package/dist/bundle/chunk-JCZLRT4Z.js +39 -0
- package/dist/bundle/chunk-JGRWMR5H.js +123 -0
- package/dist/bundle/chunk-JYRYQJBN.js +633 -0
- package/dist/bundle/chunk-KIKLDI74.js +161 -0
- package/dist/bundle/chunk-L4WO3XH6.js +2020 -0
- package/dist/bundle/chunk-LQDNUAK3.js +274 -0
- package/dist/bundle/chunk-LV5ONLQH.js +38 -0
- package/dist/bundle/chunk-M27Z23OZ.js +23 -0
- package/dist/bundle/chunk-M5XTZHXM.js +142 -0
- package/dist/bundle/chunk-MJBEGUIZ.js +76 -0
- package/dist/bundle/chunk-N4WOLGIV.js +2333 -0
- package/dist/bundle/chunk-N5K4OHPT.js +206 -0
- package/dist/bundle/chunk-NYAPUET7.js +108 -0
- package/dist/bundle/chunk-P4IFLOIK.js +218 -0
- package/dist/bundle/chunk-P6G2QTCD.js +288 -0
- package/dist/bundle/chunk-PL5P7UKW.js +25216 -0
- package/dist/bundle/chunk-PU7R6XNV.js +80 -0
- package/dist/bundle/chunk-QLLBACDR.js +72 -0
- package/dist/bundle/chunk-QP7XN5KX.js +407 -0
- package/dist/bundle/chunk-QY2F6A3D.js +557 -0
- package/dist/bundle/chunk-RLIT7VAZ.js +66 -0
- package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
- package/dist/bundle/chunk-SKGAKI62.js +86 -0
- package/dist/bundle/chunk-SQMZP5MA.js +66653 -0
- package/dist/bundle/chunk-UB6NTICY.js +95 -0
- package/dist/bundle/chunk-UBHQO5HV.js +778 -0
- package/dist/bundle/chunk-UM4RKO24.js +106 -0
- package/dist/bundle/chunk-VAHFY732.js +1068 -0
- package/dist/bundle/chunk-VGDM4C3F.js +188 -0
- package/dist/bundle/chunk-VOUAKCPM.js +41181 -0
- package/dist/bundle/chunk-WCCFJ4Q6.js +3736 -0
- package/dist/bundle/chunk-WV6EXRDV.js +46 -0
- package/dist/bundle/chunk-WVAT5TGY.js +334 -0
- package/dist/bundle/chunk-WW76JMKE.js +1243 -0
- package/dist/bundle/chunk-XXOMUKC6.js +54 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YDO6RJ2P.js +1337 -0
- package/dist/bundle/chunk-ZBCFZCJW.js +388 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-BWGRUY6L.js +37 -0
- package/dist/bundle/command-server-entry-BATOWE3Y.js +166 -0
- package/dist/bundle/decode-MZQGYXJH.js +297 -0
- package/dist/bundle/definitions-3EONB23J.js +8600 -0
- package/dist/bundle/dispatch-NYC4ARWX.js +411 -0
- package/dist/bundle/dist-AMLBQVKM.js +7577 -0
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/echarts-7OYGL2GW.js +42501 -0
- package/dist/bundle/embed-4I25DVKZ.js +38 -0
- package/dist/bundle/embedder-YXKQHAZO.js +111 -0
- package/dist/bundle/emoji-4LYX3GOS.js +4271 -0
- package/dist/bundle/failure-3YOVYZTX.js +25 -0
- package/dist/bundle/first-run-2VL2BOV7.js +29 -0
- package/dist/bundle/first-screen-C7FIWZL2.js +37 -0
- package/dist/bundle/instructions-UMNDHXG2.js +11 -0
- package/dist/bundle/mcp-V27RHILF.js +167 -0
- package/dist/bundle/meeting-combined-LS6XO4JH.js +24 -0
- package/dist/bundle/meeting-model-VIR465CY.js +25 -0
- package/dist/bundle/meeting-semantic-H5J3OOF2.js +22 -0
- package/dist/bundle/node-JJ3WDCNJ.js +2340 -0
- package/dist/bundle/node-PYFPGL4E.js +176 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-LFWPGDVP.js +74 -0
- package/dist/bundle/oauth-42VCSIVL.js +20 -0
- package/dist/bundle/open-XJ5R5LHC.js +23 -0
- package/dist/bundle/openai-RZBLV4HG.js +238 -0
- package/dist/bundle/process-DD6H3K7L.js +91 -0
- package/dist/bundle/program-OIYIBNSA.js +35443 -0
- package/dist/bundle/prompt-NQRDM5LY.js +17 -0
- package/dist/bundle/recognize-EM7H2IZS.js +26 -0
- package/dist/bundle/remote-Z6NU6QQA.js +31 -0
- package/dist/bundle/rerank-PNPCSPNF.js +52 -0
- package/dist/bundle/schemas-JMKNP4U3.js +2765 -0
- package/dist/bundle/serve-SQVGX76J.js +199 -0
- package/dist/bundle/server-NPJH45FZ.js +212 -0
- package/dist/bundle/server-Z4ZMGRAH.js +79 -0
- package/dist/bundle/slack.js +184 -0
- package/dist/bundle/sqlite-runtime-F3AJGAPN.js +20 -0
- package/dist/bundle/state-JT7ZFSXN.js +36 -0
- package/dist/bundle/store-FXGMHRF3.js +181 -0
- package/dist/bundle/store-J5ZL2USR.js +295 -0
- package/dist/bundle/store-maintenance-command-TIHOIKLZ.js +66 -0
- package/dist/bundle/surface-NW6T5OR6.js +65 -0
- package/dist/commands/api.d.ts +7 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +49 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/session.d.ts +7 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +26 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +24 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +75 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +59 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +75 -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 +8596 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/emoji.d.ts +2 -0
- package/dist/generated/emoji.d.ts.map +1 -0
- package/dist/generated/emoji.js +4265 -0
- package/dist/generated/emoji.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 +6139 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/schemas.d.ts +631 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +2426 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +3220 -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 +29 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +32 -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/messenger.d.ts +12 -0
- package/dist/messenger.d.ts.map +1 -0
- package/dist/messenger.js +184 -0
- package/dist/messenger.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +116 -0
- package/dist/program.js.map +1 -0
- package/dist/reasons.d.ts +7 -0
- package/dist/reasons.d.ts.map +1 -0
- package/dist/reasons.js +20 -0
- package/dist/reasons.js.map +1 -0
- package/dist/setup/flow.d.ts +2 -0
- package/dist/setup/flow.d.ts.map +1 -0
- package/dist/setup/flow.js +83 -0
- package/dist/setup/flow.js.map +1 -0
- package/dist/setup/guide.d.ts +6 -0
- package/dist/setup/guide.d.ts.map +1 -0
- package/dist/setup/guide.js +13 -0
- package/dist/setup/guide.js.map +1 -0
- package/dist/setup/texts.d.ts +24 -0
- package/dist/setup/texts.d.ts.map +1 -0
- package/dist/setup/texts.js +24 -0
- package/dist/setup/texts.js.map +1 -0
- package/dist/slack/adapter.d.ts +36 -0
- package/dist/slack/adapter.d.ts.map +1 -0
- package/dist/slack/adapter.js +574 -0
- package/dist/slack/adapter.js.map +1 -0
- package/dist/slack/app-manifest.d.ts +25 -0
- package/dist/slack/app-manifest.d.ts.map +1 -0
- package/dist/slack/app-manifest.js +51 -0
- package/dist/slack/app-manifest.js.map +1 -0
- package/dist/slack/client.d.ts +45 -0
- package/dist/slack/client.d.ts.map +1 -0
- package/dist/slack/client.js +236 -0
- package/dist/slack/client.js.map +1 -0
- package/dist/slack/map.d.ts +437 -0
- package/dist/slack/map.d.ts.map +1 -0
- package/dist/slack/map.js +411 -0
- package/dist/slack/map.js.map +1 -0
- package/dist/slack/mrkdwn.d.ts +9 -0
- package/dist/slack/mrkdwn.d.ts.map +1 -0
- package/dist/slack/mrkdwn.js +56 -0
- package/dist/slack/mrkdwn.js.map +1 -0
- package/dist/slack/search.d.ts +24 -0
- package/dist/slack/search.d.ts.map +1 -0
- package/dist/slack/search.js +99 -0
- package/dist/slack/search.js.map +1 -0
- package/dist/slack/threads.d.ts +28 -0
- package/dist/slack/threads.d.ts.map +1 -0
- package/dist/slack/threads.js +56 -0
- package/dist/slack/threads.js.map +1 -0
- package/dist/slack/tokens.d.ts +17 -0
- package/dist/slack/tokens.d.ts.map +1 -0
- package/dist/slack/tokens.js +27 -0
- package/dist/slack/tokens.js.map +1 -0
- package/dist/slack/writes.d.ts +43 -0
- package/dist/slack/writes.d.ts.map +1 -0
- package/dist/slack/writes.js +277 -0
- package/dist/slack/writes.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/package.json +89 -4
- package/skills/slack-cli/SKILL.md +117 -0
- package/skills/slack-cli/references/api/api-admin.md +541 -0
- package/skills/slack-cli/references/api/api-api.md +13 -0
- package/skills/slack-cli/references/api/api-apps.md +78 -0
- package/skills/slack-cli/references/api/api-auth.md +18 -0
- package/skills/slack-cli/references/api/api-bots.md +12 -0
- package/skills/slack-cli/references/api/api-calls.md +68 -0
- package/skills/slack-cli/references/api/api-chat.md +123 -0
- package/skills/slack-cli/references/api/api-conversations.md +230 -0
- package/skills/slack-cli/references/api/api-dialog.md +13 -0
- package/skills/slack-cli/references/api/api-dnd.md +31 -0
- package/skills/slack-cli/references/api/api-emoji.md +8 -0
- package/skills/slack-cli/references/api/api-files.md +120 -0
- package/skills/slack-cli/references/api/api-migration.md +14 -0
- package/skills/slack-cli/references/api/api-pins.md +37 -0
- package/skills/slack-cli/references/api/api-reactions.md +58 -0
- package/skills/slack-cli/references/api/api-reminders.md +51 -0
- package/skills/slack-cli/references/api/api-search.md +18 -0
- package/skills/slack-cli/references/api/api-stars.md +42 -0
- package/skills/slack-cli/references/api/api-team.md +55 -0
- package/skills/slack-cli/references/api/api-usergroups.md +80 -0
- package/skills/slack-cli/references/api/api-users.md +101 -0
- package/skills/slack-cli/references/api/api-views.md +46 -0
- package/skills/slack-cli/references/api/api-workflows.md +36 -0
- package/skills/slack-cli/references/api.md +35 -0
|
@@ -0,0 +1,46 @@
|
|
|
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-base@0.132.0_@scalar+openapi-upgrader@0.4.6_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/executable.js
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
9
|
+
import { win32 } from "node:path";
|
|
10
|
+
var variable = /* @__PURE__ */ __name((env, name) => Object.entries(env).find(([key]) => key.toUpperCase() === name)?.[1], "variable");
|
|
11
|
+
var executableOnPath = /* @__PURE__ */ __name((command, env, platform = process.platform, exists = existsSync) => {
|
|
12
|
+
if (platform !== "win32" || win32.isAbsolute(command))
|
|
13
|
+
return command;
|
|
14
|
+
if (/[\\/]/.test(command))
|
|
15
|
+
return command;
|
|
16
|
+
const extensions = win32.extname(command) ? [""] : (variable(env, "PATHEXT") ?? ".EXE;.COM;.CMD;.BAT").split(";").filter((ext) => /^\.[a-z0-9]+$/i.test(ext));
|
|
17
|
+
for (const entry of (variable(env, "PATH") ?? "").split(";")) {
|
|
18
|
+
const directory = entry.replace(/^"(.*)"$/, "$1");
|
|
19
|
+
for (const extension of extensions) {
|
|
20
|
+
const candidate = win32.join(directory, command + extension);
|
|
21
|
+
if (exists(candidate))
|
|
22
|
+
return candidate;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return command;
|
|
26
|
+
}, "executableOnPath");
|
|
27
|
+
var executableEnvironment = /* @__PURE__ */ __name((env, platform = process.platform) => {
|
|
28
|
+
if (platform !== "win32")
|
|
29
|
+
return env;
|
|
30
|
+
const configured = variable(env, "COMSPEC");
|
|
31
|
+
const system = variable(env, "SYSTEMROOT");
|
|
32
|
+
const shell = configured ? configured : system && win32.isAbsolute(system) ? win32.join(system, "System32", "cmd.exe") : void 0;
|
|
33
|
+
if (!shell)
|
|
34
|
+
return env;
|
|
35
|
+
const result = { ...env };
|
|
36
|
+
for (const key of Object.keys(result))
|
|
37
|
+
if (key.toUpperCase() === "COMSPEC")
|
|
38
|
+
delete result[key];
|
|
39
|
+
result.comspec = shell;
|
|
40
|
+
return result;
|
|
41
|
+
}, "executableEnvironment");
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
executableOnPath,
|
|
45
|
+
executableEnvironment
|
|
46
|
+
};
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
readSharedSection,
|
|
5
|
+
sharedConfigPath,
|
|
6
|
+
writeSharedSection
|
|
7
|
+
} from "./chunk-75BLNPN3.js";
|
|
8
|
+
import {
|
|
9
|
+
filesPresent,
|
|
10
|
+
sharedModelsDirectory
|
|
11
|
+
} from "./chunk-LQDNUAK3.js";
|
|
12
|
+
import {
|
|
13
|
+
storePath
|
|
14
|
+
} from "./chunk-XXOMUKC6.js";
|
|
15
|
+
import {
|
|
16
|
+
array,
|
|
17
|
+
check,
|
|
18
|
+
getDotPath,
|
|
19
|
+
integer,
|
|
20
|
+
maxLength,
|
|
21
|
+
maxValue,
|
|
22
|
+
minLength,
|
|
23
|
+
minValue,
|
|
24
|
+
number,
|
|
25
|
+
optional,
|
|
26
|
+
picklist,
|
|
27
|
+
pipe,
|
|
28
|
+
regex,
|
|
29
|
+
safeParse,
|
|
30
|
+
startsWith,
|
|
31
|
+
strictObject,
|
|
32
|
+
string,
|
|
33
|
+
trim,
|
|
34
|
+
url
|
|
35
|
+
} from "./chunk-S4UUN6LD.js";
|
|
36
|
+
import {
|
|
37
|
+
CliError
|
|
38
|
+
} from "./chunk-QLLBACDR.js";
|
|
39
|
+
import {
|
|
40
|
+
__name
|
|
41
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
42
|
+
|
|
43
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.738.0_@wirecat+cli-base@0.132.0_@scalar+openapi-upgrader@0.4.6_comm_2f4ef0250212140e76029d09a7f79b43/node_modules/@wirecat/cli-core/dist/embeddings/models.js
|
|
44
|
+
import { existsSync } from "node:fs";
|
|
45
|
+
import { join } from "node:path";
|
|
46
|
+
var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/${repository}/resolve/${commit}/${name}`, "huggingFace");
|
|
47
|
+
var e5 = huggingFace("Xenova/multilingual-e5-small", "761b726dd34fb83930e26aab4e9ac3899aa1fa78");
|
|
48
|
+
var e5Large = huggingFace("Xenova/multilingual-e5-large", "00fc3aeb3dbb95842de2ac1961d33c6319acf57b");
|
|
49
|
+
var gemma = huggingFace("onnx-community/embeddinggemma-300m-ONNX", "5090578d9565bb06545b4552f76e6bc2c93e4a66");
|
|
50
|
+
var TEXT_MODELS = [
|
|
51
|
+
{
|
|
52
|
+
id: "e5-small",
|
|
53
|
+
title: "multilingual-e5-small, 8-bit",
|
|
54
|
+
size: "small",
|
|
55
|
+
languages: "about 100 languages, Russian and English among them",
|
|
56
|
+
licence: "MIT",
|
|
57
|
+
dims: 384,
|
|
58
|
+
maxTokens: 512,
|
|
59
|
+
// 100k-message corpus, one 8-thread session on Ryzen AI 9 HX 470: 31–32 chunks/s.
|
|
60
|
+
chunksPerSecond: 31,
|
|
61
|
+
pooling: "mean",
|
|
62
|
+
prefix: { query: "query: ", passage: "passage: " },
|
|
63
|
+
onnx: "onnx/model_quantized.onnx",
|
|
64
|
+
files: [
|
|
65
|
+
{
|
|
66
|
+
name: "onnx/model_quantized.onnx",
|
|
67
|
+
url: e5("onnx/model_quantized.onnx"),
|
|
68
|
+
sha256: "f80102d3f2a1229f387d3c81909990d8945513e347b0eab049f7de3c6f98c193",
|
|
69
|
+
bytes: 118308185
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "tokenizer.json",
|
|
73
|
+
url: e5("tokenizer.json"),
|
|
74
|
+
sha256: "0b44a9d7b51c3c62626640cda0e2c2f70fdacdc25bbbd68038369d14ebdf4c39",
|
|
75
|
+
bytes: 17082730
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "tokenizer_config.json",
|
|
79
|
+
url: e5("tokenizer_config.json"),
|
|
80
|
+
sha256: "a1d6bc8734a6f635dc158508bef000f8e2e5a759c7d92f984b2c86e5ff53425b",
|
|
81
|
+
bytes: 443
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: "embeddinggemma",
|
|
87
|
+
title: "EmbeddingGemma 300M, 4-bit",
|
|
88
|
+
size: "medium",
|
|
89
|
+
languages: "over 100 languages \u2014 the best of the two on chat, about seven times slower",
|
|
90
|
+
licence: "Gemma Terms of Use",
|
|
91
|
+
terms: "https://ai.google.dev/gemma/terms",
|
|
92
|
+
// Gemma Terms of Use §3.1: every copy carries this notice and the use restrictions of §3.2.
|
|
93
|
+
notice: "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms. Its use is restricted by the Gemma Prohibited Use Policy: https://ai.google.dev/gemma/prohibited_use_policy",
|
|
94
|
+
dims: 768,
|
|
95
|
+
maxTokens: 2048,
|
|
96
|
+
// 2026-11-08, 1,200-character chunks, 8 threads on the Ryzen AI 9 HX 470: 8.3 chunks/s against e5-small's 52.7, so
|
|
97
|
+
// 5 on the scale e5-small's 31 sets. It was 2, which held a memo sync to 39 chunks.
|
|
98
|
+
chunksPerSecond: 5,
|
|
99
|
+
pooling: "sentence_embedding",
|
|
100
|
+
prefix: { query: "task: search result | query: ", passage: "title: none | text: " },
|
|
101
|
+
onnx: "onnx/model_q4.onnx",
|
|
102
|
+
externalData: "onnx/model_q4.onnx_data",
|
|
103
|
+
files: [
|
|
104
|
+
{
|
|
105
|
+
name: "onnx/model_q4.onnx",
|
|
106
|
+
url: gemma("onnx/model_q4.onnx"),
|
|
107
|
+
sha256: "ad1dfee81a70f7944b9b9d1cc6e48075b832881cf33fab2f2b248be78f3f0043",
|
|
108
|
+
bytes: 519322
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "onnx/model_q4.onnx_data",
|
|
112
|
+
url: gemma("onnx/model_q4.onnx_data"),
|
|
113
|
+
sha256: "599962c3143b040de2dd05e5975be3e9091dd067cacc6a8f7186e3203bab9e02",
|
|
114
|
+
bytes: 196725760
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "tokenizer.json",
|
|
118
|
+
url: gemma("tokenizer.json"),
|
|
119
|
+
sha256: "4dda02faaf32bc91031dc8c88457ac272b00c1016cc679757d1c441b248b9c47",
|
|
120
|
+
bytes: 20323312
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "tokenizer_config.json",
|
|
124
|
+
url: gemma("tokenizer_config.json"),
|
|
125
|
+
sha256: "3ca953eea6c3c9fcda9cf3df22949ff18b216f7c74bd6459230f3f1013953f3a",
|
|
126
|
+
bytes: 1156830
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "e5-large",
|
|
132
|
+
title: "multilingual-e5-large, 8-bit",
|
|
133
|
+
size: "large",
|
|
134
|
+
languages: "about 100 languages, Russian and English among them \u2014 reads better than e5-small, several times slower",
|
|
135
|
+
licence: "MIT",
|
|
136
|
+
dims: 1024,
|
|
137
|
+
maxTokens: 512,
|
|
138
|
+
// 2026-11-07, one 8-thread session on the Ryzen AI 9 HX 470 while other benchmarks ran: 3.4 chunks/s.
|
|
139
|
+
chunksPerSecond: 4,
|
|
140
|
+
pooling: "mean",
|
|
141
|
+
prefix: { query: "query: ", passage: "passage: " },
|
|
142
|
+
onnx: "onnx/model_quantized.onnx",
|
|
143
|
+
files: [
|
|
144
|
+
{
|
|
145
|
+
name: "onnx/model_quantized.onnx",
|
|
146
|
+
url: e5Large("onnx/model_quantized.onnx"),
|
|
147
|
+
sha256: "0a8d65db9a36f810ba5da15249f13145fcdc7890e6656f1fd38cd8b7c4db1fca",
|
|
148
|
+
bytes: 561768762
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "tokenizer.json",
|
|
152
|
+
url: e5Large("tokenizer.json"),
|
|
153
|
+
sha256: "62c24cdc13d4c9952d63718d6c9fa4c287974249e16b7ade6d5a85e7bbb75626",
|
|
154
|
+
bytes: 17082660
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "tokenizer_config.json",
|
|
158
|
+
url: e5Large("tokenizer_config.json"),
|
|
159
|
+
sha256: "efb5c0d09722e5fe59a462cd2a9976ee216d55b037597d997cd3fe833216da15",
|
|
160
|
+
bytes: 418
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
];
|
|
165
|
+
var DEFAULT_TEXT_MODEL = "embeddinggemma";
|
|
166
|
+
var PREVIOUS_DEFAULT_TEXT_MODEL = "e5-small";
|
|
167
|
+
var SECTION = "text_models";
|
|
168
|
+
var slug = pipe(string(), regex(/^[a-z0-9][a-z0-9._-]{0,62}$/, "is not a model id: a-z, 0-9, . _ -"));
|
|
169
|
+
var words = pipe(string(), trim(), minLength(1), maxLength(300));
|
|
170
|
+
var fileName = pipe(string(), check((name) => /^[\w.-]+(\/[\w.-]+)*$/.test(name) && !name.split("/").some((part) => part === ".." || part === "."), "is not a file inside the model's folder"));
|
|
171
|
+
var modelFile = strictObject({
|
|
172
|
+
name: fileName,
|
|
173
|
+
url: pipe(string(), url(), startsWith("https://", "has to be an https address")),
|
|
174
|
+
sha256: pipe(string(), regex(/^[0-9a-f]{64}$/, "has to be a sha256 in hex")),
|
|
175
|
+
bytes: pipe(number(), integer(), minValue(1))
|
|
176
|
+
});
|
|
177
|
+
var CustomTextModelShape = pipe(strictObject({
|
|
178
|
+
id: slug,
|
|
179
|
+
title: words,
|
|
180
|
+
languages: words,
|
|
181
|
+
licence: words,
|
|
182
|
+
terms: optional(pipe(string(), url())),
|
|
183
|
+
dims: pipe(number(), integer(), minValue(1), maxValue(8192)),
|
|
184
|
+
maxTokens: pipe(number(), integer(), minValue(16), maxValue(32768)),
|
|
185
|
+
chunksPerSecond: optional(pipe(number(), minValue(0.01))),
|
|
186
|
+
pooling: picklist(["mean", "sentence_embedding"]),
|
|
187
|
+
prefix: strictObject({
|
|
188
|
+
query: pipe(string(), maxLength(200)),
|
|
189
|
+
passage: pipe(string(), maxLength(200))
|
|
190
|
+
}),
|
|
191
|
+
onnx: fileName,
|
|
192
|
+
externalData: optional(fileName),
|
|
193
|
+
files: pipe(array(modelFile), minLength(1), maxLength(16))
|
|
194
|
+
}), check((model) => !TEXT_MODELS.some((one) => one.id === model.id), "takes the id of a model this version ships; choose another"), check((model) => {
|
|
195
|
+
const names = model.files.map(({ name }) => name);
|
|
196
|
+
return [model.onnx, model.externalData, "tokenizer.json", "tokenizer_config.json"].every((name) => name === void 0 || names.includes(name));
|
|
197
|
+
}, "has to list its onnx file, its external data and tokenizer.json and tokenizer_config.json among files"));
|
|
198
|
+
var TextModelsSection = strictObject({
|
|
199
|
+
use: optional(slug),
|
|
200
|
+
custom: optional(array(CustomTextModelShape))
|
|
201
|
+
});
|
|
202
|
+
var textModelsFile = /* @__PURE__ */ __name((env = process.env) => sharedConfigPath(storePath(env), env), "textModelsFile");
|
|
203
|
+
var readTextModelsSection = /* @__PURE__ */ __name((env = process.env) => {
|
|
204
|
+
const path = textModelsFile(env);
|
|
205
|
+
const section = readSharedSection(path, SECTION);
|
|
206
|
+
if (section === void 0)
|
|
207
|
+
return {};
|
|
208
|
+
const checked = safeParse(TextModelsSection, section);
|
|
209
|
+
if (!checked.success) {
|
|
210
|
+
const issue = checked.issues[0];
|
|
211
|
+
const at = issue ? getDotPath(issue) : null;
|
|
212
|
+
throw new CliError("configuration_error", `${path}: ${SECTION}${at ? `.${at}` : ""} ${issue?.message ?? "is not valid"}`);
|
|
213
|
+
}
|
|
214
|
+
const ids = checked.output.custom?.map(({ id }) => id) ?? [];
|
|
215
|
+
const twice = ids.find((id, at) => ids.indexOf(id) !== at);
|
|
216
|
+
if (twice)
|
|
217
|
+
throw new CliError("configuration_error", `${path}: ${SECTION}.custom names ${twice} twice`);
|
|
218
|
+
return checked.output;
|
|
219
|
+
}, "readTextModelsSection");
|
|
220
|
+
var writeTextModelsSection = /* @__PURE__ */ __name((section, env = process.env) => writeSharedSection(textModelsFile(env), SECTION, section.use === void 0 && !section.custom?.length ? void 0 : section), "writeTextModelsSection");
|
|
221
|
+
var textModels = /* @__PURE__ */ __name((env = process.env) => [
|
|
222
|
+
...TEXT_MODELS,
|
|
223
|
+
...(readTextModelsSection(env).custom ?? []).map((model) => ({ ...model, custom: true }))
|
|
224
|
+
], "textModels");
|
|
225
|
+
var textModel = /* @__PURE__ */ __name((id, env = process.env) => {
|
|
226
|
+
const known = textModels(env);
|
|
227
|
+
const found = known.find((model) => model.id === id);
|
|
228
|
+
if (!found) {
|
|
229
|
+
throw new CliError("validation_error", `no text model ${id} \u2014 one of: ${known.map((model) => model.id).join(", ")}`);
|
|
230
|
+
}
|
|
231
|
+
return found;
|
|
232
|
+
}, "textModel");
|
|
233
|
+
var downloaded = /* @__PURE__ */ __name((id, env) => {
|
|
234
|
+
const model = TEXT_MODELS.find((one) => one.id === id);
|
|
235
|
+
const directory = sharedModelsDirectory("text", env);
|
|
236
|
+
return model !== void 0 && filesPresent(model.files.map((file) => [file, join(directory, model.id, file.name)]));
|
|
237
|
+
}, "downloaded");
|
|
238
|
+
var chosenTextModel = /* @__PURE__ */ __name((env = process.env) => {
|
|
239
|
+
const use = readTextModelsSection(env).use;
|
|
240
|
+
if (use !== void 0)
|
|
241
|
+
return { id: use, from: "chosen" };
|
|
242
|
+
const kept = !downloaded(DEFAULT_TEXT_MODEL, env) && existsSync(join(sharedModelsDirectory("text", env), PREVIOUS_DEFAULT_TEXT_MODEL));
|
|
243
|
+
return { id: kept ? PREVIOUS_DEFAULT_TEXT_MODEL : DEFAULT_TEXT_MODEL, from: "default" };
|
|
244
|
+
}, "chosenTextModel");
|
|
245
|
+
var mmarco = huggingFace("cross-encoder/mmarco-mMiniLMv2-L12-H384-v1", "1427fd652930e4ba29e8149678df786c240d8825");
|
|
246
|
+
var bge = huggingFace("onnx-community/bge-reranker-v2-m3-ONNX", "6f5ff65298512715a1e669753bc754d2bc8f367b");
|
|
247
|
+
var RERANK_MODELS = [
|
|
248
|
+
{
|
|
249
|
+
id: "mmarco",
|
|
250
|
+
title: "mMARCO mMiniLMv2-L12 cross-encoder, 8-bit",
|
|
251
|
+
languages: "about 100 languages, Russian and English among them",
|
|
252
|
+
licence: "Apache-2.0",
|
|
253
|
+
maxTokens: 512,
|
|
254
|
+
// The x86 name is the quantizer's target; WebAssembly and native ONNX Runtime both run it on any processor.
|
|
255
|
+
onnx: "onnx/model_quint8_avx2.onnx",
|
|
256
|
+
files: [
|
|
257
|
+
{
|
|
258
|
+
name: "onnx/model_quint8_avx2.onnx",
|
|
259
|
+
url: mmarco("onnx/model_quint8_avx2.onnx"),
|
|
260
|
+
sha256: "6c2513767fb63d008a4377bef7a7a3555433d9436342bb53e35a3a72ffc52d4b",
|
|
261
|
+
bytes: 118620016
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "tokenizer.json",
|
|
265
|
+
url: mmarco("tokenizer.json"),
|
|
266
|
+
sha256: "62c24cdc13d4c9952d63718d6c9fa4c287974249e16b7ade6d5a85e7bbb75626",
|
|
267
|
+
bytes: 17082660
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: "tokenizer_config.json",
|
|
271
|
+
url: mmarco("tokenizer_config.json"),
|
|
272
|
+
sha256: "e7fbfbfa6347b4e414c1cee50d142e2c2f9a895dad68b068ae83a8b564c3837e",
|
|
273
|
+
bytes: 435
|
|
274
|
+
}
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
id: "bge-reranker-v2-m3",
|
|
279
|
+
title: "BGE reranker v2 m3, 8-bit",
|
|
280
|
+
languages: "over 100 languages \u2014 better than mmarco in the benchmark, about seven times slower",
|
|
281
|
+
licence: "Apache-2.0 (BAAI's; the ONNX export declares none)",
|
|
282
|
+
maxTokens: 512,
|
|
283
|
+
onnx: "onnx/model_quantized.onnx",
|
|
284
|
+
files: [
|
|
285
|
+
{
|
|
286
|
+
name: "onnx/model_quantized.onnx",
|
|
287
|
+
url: bge("onnx/model_quantized.onnx"),
|
|
288
|
+
sha256: "912fc1215c2dbff6499700534bd8d31253af01573861abbfc43afd1fab6cce5d",
|
|
289
|
+
bytes: 570727094
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: "tokenizer.json",
|
|
293
|
+
url: bge("tokenizer.json"),
|
|
294
|
+
sha256: "8bf8afbfd11306bd872018c53bfdf2e160a56f8edbcf49933324404791c148d3",
|
|
295
|
+
bytes: 17082900
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: "tokenizer_config.json",
|
|
299
|
+
url: bge("tokenizer_config.json"),
|
|
300
|
+
sha256: "b87c8703482b0300d3da30e201519aa641f6a450f5eb5bf1e624afbf70c74d80",
|
|
301
|
+
bytes: 1203
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
];
|
|
306
|
+
var DEFAULT_RERANK_MODEL = "mmarco";
|
|
307
|
+
var rerankModel = /* @__PURE__ */ __name((id) => {
|
|
308
|
+
const found = RERANK_MODELS.find((model) => model.id === id);
|
|
309
|
+
if (!found) {
|
|
310
|
+
throw new CliError("validation_error", `no reranker ${id} \u2014 one of: ${RERANK_MODELS.map((model) => model.id).join(", ")}`);
|
|
311
|
+
}
|
|
312
|
+
return found;
|
|
313
|
+
}, "rerankModel");
|
|
314
|
+
var vectorModelKey = /* @__PURE__ */ __name((model) => {
|
|
315
|
+
const weights = model.custom ? model.files.find(({ name }) => name === model.onnx)?.sha256.slice(0, 12) : void 0;
|
|
316
|
+
return `local:${model.id}${weights ? `@${weights}` : ""}:${model.dims}`;
|
|
317
|
+
}, "vectorModelKey");
|
|
318
|
+
var meaningFloor = /* @__PURE__ */ __name((key) => key === "local:e5-small:384" ? 0.8 : 0, "meaningFloor");
|
|
319
|
+
|
|
320
|
+
export {
|
|
321
|
+
DEFAULT_TEXT_MODEL,
|
|
322
|
+
PREVIOUS_DEFAULT_TEXT_MODEL,
|
|
323
|
+
CustomTextModelShape,
|
|
324
|
+
readTextModelsSection,
|
|
325
|
+
writeTextModelsSection,
|
|
326
|
+
textModels,
|
|
327
|
+
textModel,
|
|
328
|
+
chosenTextModel,
|
|
329
|
+
RERANK_MODELS,
|
|
330
|
+
DEFAULT_RERANK_MODEL,
|
|
331
|
+
rerankModel,
|
|
332
|
+
vectorModelKey,
|
|
333
|
+
meaningFloor
|
|
334
|
+
};
|