@wirecat/hubspot-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 +29 -0
- package/LICENSE +204 -0
- package/README.md +256 -2
- package/contracts/wirecat.json +1965 -0
- package/dist/bin/hubspot.d.ts +3 -0
- package/dist/bin/hubspot.d.ts.map +1 -0
- package/dist/bin/hubspot.js +40 -0
- package/dist/bin/hubspot.js.map +1 -0
- package/dist/bundle/all-profiles-64JAUYW4.js +279 -0
- package/dist/bundle/anthropic-VJOS4OUM.js +91 -0
- package/dist/bundle/app-server-422MCA7S.js +245 -0
- package/dist/bundle/bun-M3J2QTR3.js +169 -0
- package/dist/bundle/bun-sqlite-IX3XYA5F.js +76 -0
- package/dist/bundle/chunk-24ERVFJP.js +73 -0
- package/dist/bundle/chunk-2QZK5BEP.js +392 -0
- package/dist/bundle/chunk-2TWQIWWG.js +1328 -0
- package/dist/bundle/chunk-2VGD63G6.js +604 -0
- package/dist/bundle/chunk-2VGZRYEH.js +334 -0
- package/dist/bundle/chunk-36ITRDYY.js +63116 -0
- package/dist/bundle/chunk-43EKCUBJ.js +72 -0
- package/dist/bundle/chunk-4W6BMH45.js +731 -0
- package/dist/bundle/chunk-5A6ZYNAQ.js +2003 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-5GBUCHRU.js +274 -0
- package/dist/bundle/chunk-5K7QLJMM.js +4072 -0
- package/dist/bundle/chunk-65TWQ7BV.js +54 -0
- package/dist/bundle/chunk-7ELMWE3P.js +12066 -0
- package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
- package/dist/bundle/chunk-B3MANLNK.js +602 -0
- package/dist/bundle/chunk-BKXDHU3G.js +1395 -0
- package/dist/bundle/chunk-C32AKHTY.js +2310 -0
- package/dist/bundle/chunk-CLAN3FES.js +1246 -0
- package/dist/bundle/chunk-CWXOXIWS.js +46 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-DB2XKHI4.js +72 -0
- package/dist/bundle/chunk-DBEQI5YM.js +100 -0
- package/dist/bundle/chunk-DFCHHR5M.js +38 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DRWWJLI6.js +188 -0
- package/dist/bundle/chunk-DSP36YHQ.js +29 -0
- package/dist/bundle/chunk-E52JAS35.js +1028 -0
- package/dist/bundle/chunk-E5WLE7BM.js +78 -0
- package/dist/bundle/chunk-ECEZOLOD.js +230 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-FBCCBCFH.js +288 -0
- package/dist/bundle/chunk-FKA7DOCK.js +53 -0
- package/dist/bundle/chunk-FOZYMDRL.js +259 -0
- package/dist/bundle/chunk-FPUGMDJV.js +7 -0
- package/dist/bundle/chunk-FTFV3HFW.js +721 -0
- package/dist/bundle/chunk-H3TNVEQX.js +782 -0
- package/dist/bundle/chunk-HC5ZWE5X.js +193 -0
- package/dist/bundle/chunk-HCAZV5NP.js +95 -0
- package/dist/bundle/chunk-HTAN663T.js +4045 -0
- package/dist/bundle/chunk-HZRQLAHO.js +16 -0
- package/dist/bundle/chunk-IMJQRPLN.js +92 -0
- package/dist/bundle/chunk-JLDBMEKZ.js +106 -0
- package/dist/bundle/chunk-JRCPCVPI.js +9393 -0
- package/dist/bundle/chunk-LNV33FDC.js +786 -0
- package/dist/bundle/chunk-LOBVOGOE.js +66 -0
- package/dist/bundle/chunk-MVA5HVKL.js +1392 -0
- package/dist/bundle/chunk-N2XADGL4.js +76 -0
- package/dist/bundle/chunk-NHHJHXMQ.js +58 -0
- package/dist/bundle/chunk-NUU4WZVL.js +52 -0
- package/dist/bundle/chunk-NWHEHV3K.js +133 -0
- package/dist/bundle/chunk-NXERIDPJ.js +319 -0
- package/dist/bundle/chunk-O3DYRCIT.js +23 -0
- package/dist/bundle/chunk-O55RWNSH.js +161 -0
- package/dist/bundle/chunk-P5BHKKBI.js +206 -0
- package/dist/bundle/chunk-PPHBRESD.js +82 -0
- package/dist/bundle/chunk-PVKF24ZW.js +364 -0
- package/dist/bundle/chunk-QGFX5MXL.js +460 -0
- package/dist/bundle/chunk-QJW35N5V.js +761 -0
- package/dist/bundle/chunk-QU25DA5N.js +360 -0
- package/dist/bundle/chunk-RMIYKDUL.js +1068 -0
- package/dist/bundle/chunk-RR5MX5TM.js +142 -0
- package/dist/bundle/chunk-SAKK2YRU.js +218 -0
- package/dist/bundle/chunk-SDQGB4KB.js +185 -0
- package/dist/bundle/chunk-TBJYLC5K.js +2788 -0
- package/dist/bundle/chunk-TI46WQXQ.js +1197 -0
- package/dist/bundle/chunk-TKVL2C3B.js +170 -0
- package/dist/bundle/chunk-TOSCB4SO.js +1227 -0
- package/dist/bundle/chunk-TP7GDWVF.js +6848 -0
- package/dist/bundle/chunk-UUMUL4L3.js +72 -0
- package/dist/bundle/chunk-VIEYMDBR.js +41 -0
- package/dist/bundle/chunk-W53EJOFQ.js +63 -0
- package/dist/bundle/chunk-W7HM2VGO.js +24 -0
- package/dist/bundle/chunk-WE4UFASG.js +88 -0
- package/dist/bundle/chunk-WQBX7XYP.js +26174 -0
- package/dist/bundle/chunk-X2M6NIQG.js +18 -0
- package/dist/bundle/chunk-X7XUX7A4.js +1846 -0
- package/dist/bundle/chunk-XRREFEIW.js +372 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-ZBDSHFG4.js +40933 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-C6CBFXZF.js +40 -0
- package/dist/bundle/command-server-entry-DJKVVZCQ.js +169 -0
- package/dist/bundle/decode-FC65Y4IV.js +297 -0
- package/dist/bundle/definitions-MVPICAWV.js +2991 -0
- package/dist/bundle/dispatch-KOISQ5QJ.js +411 -0
- package/dist/bundle/dist-MYZZKZJ7.js +7577 -0
- package/dist/bundle/echarts-FVTUDXDU.js +42501 -0
- package/dist/bundle/embed-VNBZFPYH.js +38 -0
- package/dist/bundle/embedder-6U4NOFRO.js +111 -0
- package/dist/bundle/failure-FZ6VYKEQ.js +25 -0
- package/dist/bundle/first-run-RPIJZEDT.js +29 -0
- package/dist/bundle/first-screen-RTVMGHAE.js +40 -0
- package/dist/bundle/hubspot.js +198 -0
- package/dist/bundle/instructions-HET7BCYK.js +11 -0
- package/dist/bundle/mcp-RGNRW77S.js +167 -0
- package/dist/bundle/meeting-combined-L5AGBPYX.js +25 -0
- package/dist/bundle/meeting-model-NTB4RK3F.js +25 -0
- package/dist/bundle/meeting-semantic-JY3OGCBS.js +22 -0
- package/dist/bundle/node-CXZIFHZC.js +176 -0
- package/dist/bundle/node-P4E63KXA.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-P3O7XN7Q.js +74 -0
- package/dist/bundle/oauth-HNCY4B2S.js +20 -0
- package/dist/bundle/open-F4P6YV54.js +23 -0
- package/dist/bundle/openai-4AICLIK3.js +238 -0
- package/dist/bundle/process-5RUXWGYS.js +91 -0
- package/dist/bundle/program-POG5GHUQ.js +9241 -0
- package/dist/bundle/prompt-NFMDVBZ4.js +17 -0
- package/dist/bundle/recognize-DKN3RY4V.js +26 -0
- package/dist/bundle/remote-6QHAGQWY.js +31 -0
- package/dist/bundle/rerank-M4KHEHUZ.js +52 -0
- package/dist/bundle/schemas-JRL3DLMP.js +952 -0
- package/dist/bundle/serve-DNU43ND6.js +199 -0
- package/dist/bundle/server-C3ZHA7AZ.js +77 -0
- package/dist/bundle/server-XJSNF3K5.js +207 -0
- package/dist/bundle/source-A3SBLHC4.js +934 -0
- package/dist/bundle/sqlite-runtime-EMQAC63N.js +20 -0
- package/dist/bundle/state-T45CX7VY.js +36 -0
- package/dist/bundle/store-6LCEVBAZ.js +176 -0
- package/dist/bundle/store-6TZ2FCVA.js +295 -0
- package/dist/bundle/store-CCDNUB6A.js +32 -0
- package/dist/bundle/store-maintenance-command-BRCG6MNA.js +68 -0
- package/dist/commands/account.d.ts +3 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +87 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/api.d.ts +9 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +65 -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/crm-shared.d.ts +8 -0
- package/dist/commands/crm-shared.d.ts.map +1 -0
- package/dist/commands/crm-shared.js +93 -0
- package/dist/commands/crm-shared.js.map +1 -0
- package/dist/commands/schedule.d.ts +3 -0
- package/dist/commands/schedule.d.ts.map +1 -0
- package/dist/commands/schedule.js +9 -0
- package/dist/commands/schedule.js.map +1 -0
- package/dist/commands/session.d.ts +14 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +164 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +22 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +28 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +88 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +137 -0
- package/dist/context.js.map +1 -0
- package/dist/crm/activities.d.ts +24 -0
- package/dist/crm/activities.d.ts.map +1 -0
- package/dist/crm/activities.js +214 -0
- package/dist/crm/activities.js.map +1 -0
- package/dist/crm/associations.d.ts +20 -0
- package/dist/crm/associations.d.ts.map +1 -0
- package/dist/crm/associations.js +47 -0
- package/dist/crm/associations.js.map +1 -0
- package/dist/crm/records.d.ts +63 -0
- package/dist/crm/records.d.ts.map +1 -0
- package/dist/crm/records.js +333 -0
- package/dist/crm/records.js.map +1 -0
- package/dist/crm/search.d.ts +57 -0
- package/dist/crm/search.d.ts.map +1 -0
- package/dist/crm/search.js +47 -0
- package/dist/crm/search.js.map +1 -0
- package/dist/crm/source.d.ts +32 -0
- package/dist/crm/source.d.ts.map +1 -0
- package/dist/crm/source.js +369 -0
- package/dist/crm/source.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 +2987 -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 +6499 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/schemas.d.ts +205 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +810 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +1114 -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/hubspot/account.d.ts +12 -0
- package/dist/hubspot/account.d.ts.map +1 -0
- package/dist/hubspot/account.js +23 -0
- package/dist/hubspot/account.js.map +1 -0
- package/dist/hubspot/transport.d.ts +76 -0
- package/dist/hubspot/transport.d.ts.map +1 -0
- package/dist/hubspot/transport.js +346 -0
- package/dist/hubspot/transport.js.map +1 -0
- package/dist/identity.d.ts +7 -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/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +77 -0
- package/dist/program.js.map +1 -0
- package/dist/reasons.d.ts +10 -0
- package/dist/reasons.d.ts.map +1 -0
- package/dist/reasons.js +33 -0
- package/dist/reasons.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/setup/flow.d.ts +2 -0
- package/dist/setup/flow.d.ts.map +1 -0
- package/dist/setup/flow.js +97 -0
- package/dist/setup/flow.js.map +1 -0
- package/dist/setup/texts.en.json +19 -0
- package/dist/setup/texts.es.json +19 -0
- package/dist/setup/texts.ru.json +19 -0
- package/dist/store.d.ts +16 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +34 -0
- package/dist/store.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/whoami.d.ts +19 -0
- package/dist/whoami.d.ts.map +1 -0
- package/dist/whoami.js +15 -0
- package/dist/whoami.js.map +1 -0
- package/package.json +98 -4
- package/skills/hubspot-cli/SKILL.md +97 -0
- package/skills/hubspot-cli/references/api/api-basic.md +462 -0
- package/skills/hubspot-cli/references/api/api-batch.md +149 -0
- package/skills/hubspot-cli/references/api/api-search.md +147 -0
- package/skills/hubspot-cli/references/api.md +15 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
WARM_IDLE_MS,
|
|
5
|
+
defaultThreads,
|
|
6
|
+
isTextModelInstalled,
|
|
7
|
+
loadModel,
|
|
8
|
+
meanOf,
|
|
9
|
+
openEmbedder,
|
|
10
|
+
placedText,
|
|
11
|
+
runEmbedders,
|
|
12
|
+
textModelsDirectory,
|
|
13
|
+
truncated,
|
|
14
|
+
unit,
|
|
15
|
+
warmEmbedders
|
|
16
|
+
} from "./chunk-E52JAS35.js";
|
|
17
|
+
import "./chunk-5GBUCHRU.js";
|
|
18
|
+
import "./chunk-65TWQ7BV.js";
|
|
19
|
+
import "./chunk-TBJYLC5K.js";
|
|
20
|
+
import "./chunk-TOSCB4SO.js";
|
|
21
|
+
import "./chunk-MVA5HVKL.js";
|
|
22
|
+
import "./chunk-Y5E2WNWB.js";
|
|
23
|
+
import "./chunk-DB2XKHI4.js";
|
|
24
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
25
|
+
export {
|
|
26
|
+
WARM_IDLE_MS,
|
|
27
|
+
defaultThreads,
|
|
28
|
+
isTextModelInstalled,
|
|
29
|
+
loadModel,
|
|
30
|
+
meanOf,
|
|
31
|
+
openEmbedder,
|
|
32
|
+
placedText,
|
|
33
|
+
runEmbedders,
|
|
34
|
+
textModelsDirectory,
|
|
35
|
+
truncated,
|
|
36
|
+
unit,
|
|
37
|
+
warmEmbedders
|
|
38
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
openSession,
|
|
5
|
+
truncated,
|
|
6
|
+
unit
|
|
7
|
+
} from "./chunk-E52JAS35.js";
|
|
8
|
+
import "./chunk-5GBUCHRU.js";
|
|
9
|
+
import "./chunk-65TWQ7BV.js";
|
|
10
|
+
import "./chunk-TBJYLC5K.js";
|
|
11
|
+
import "./chunk-TOSCB4SO.js";
|
|
12
|
+
import "./chunk-MVA5HVKL.js";
|
|
13
|
+
import {
|
|
14
|
+
importFrom
|
|
15
|
+
} from "./chunk-Y5E2WNWB.js";
|
|
16
|
+
import {
|
|
17
|
+
CliError
|
|
18
|
+
} from "./chunk-DB2XKHI4.js";
|
|
19
|
+
import {
|
|
20
|
+
__name
|
|
21
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
22
|
+
|
|
23
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/images/picture/embedder.js
|
|
24
|
+
import { readFileSync } from "node:fs";
|
|
25
|
+
import { join } from "node:path";
|
|
26
|
+
|
|
27
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/images/picture/preprocess.js
|
|
28
|
+
var SIZE = 224;
|
|
29
|
+
var MEAN = [0.48145466, 0.4578275, 0.40821073];
|
|
30
|
+
var STD = [0.26862954, 0.26130258, 0.27577711];
|
|
31
|
+
var importCanvas = /* @__PURE__ */ __name(async () => {
|
|
32
|
+
try {
|
|
33
|
+
return await importFrom(new URL("images/picture/preprocess.js", import.meta.resolve("@wirecat/cli-core")).href, "@napi-rs/canvas");
|
|
34
|
+
} catch {
|
|
35
|
+
throw new CliError("validation_error", "searching pictures needs the optional package @napi-rs/canvas to read an image \u2014 install it next to this tool");
|
|
36
|
+
}
|
|
37
|
+
}, "importCanvas");
|
|
38
|
+
var preprocess = /* @__PURE__ */ __name(async (bytes, load = importCanvas) => {
|
|
39
|
+
const { createCanvas, loadImage } = await load();
|
|
40
|
+
let image;
|
|
41
|
+
try {
|
|
42
|
+
image = await loadImage(bytes);
|
|
43
|
+
} catch {
|
|
44
|
+
throw new CliError("invalid_response", "the file is not an image this tool can read");
|
|
45
|
+
}
|
|
46
|
+
const scale = SIZE / Math.min(image.width, image.height);
|
|
47
|
+
const width = Math.max(SIZE, Math.round(image.width * scale));
|
|
48
|
+
const height = Math.max(SIZE, Math.round(image.height * scale));
|
|
49
|
+
const surface = createCanvas(SIZE, SIZE);
|
|
50
|
+
const context = surface.getContext("2d");
|
|
51
|
+
context.fillStyle = "#ffffff";
|
|
52
|
+
context.fillRect(0, 0, SIZE, SIZE);
|
|
53
|
+
context.imageSmoothingQuality = "high";
|
|
54
|
+
context.drawImage(image, 0, 0, image.width, image.height, Math.round((SIZE - width) / 2), Math.round((SIZE - height) / 2), width, height);
|
|
55
|
+
const { data } = context.getImageData(0, 0, SIZE, SIZE);
|
|
56
|
+
const plane = SIZE * SIZE;
|
|
57
|
+
const pixels = new Float32Array(3 * plane);
|
|
58
|
+
for (let at = 0; at < plane; at++) {
|
|
59
|
+
for (let channel = 0; channel < 3; channel++) {
|
|
60
|
+
pixels[channel * plane + at] = (data[at * 4 + channel] / 255 - MEAN[channel]) / STD[channel];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return pixels;
|
|
64
|
+
}, "preprocess");
|
|
65
|
+
|
|
66
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/images/picture/embedder.js
|
|
67
|
+
var openPictureEmbedder = /* @__PURE__ */ __name(async (model, directory, { threads = 4, canvas } = {}) => {
|
|
68
|
+
const { Tokenizer } = await importFrom(new URL("images/picture/embedder.js", import.meta.resolve("@wirecat/cli-core")).href, "@huggingface/tokenizers");
|
|
69
|
+
const path = /* @__PURE__ */ __name((name) => join(directory, model.id, name), "path");
|
|
70
|
+
const tokenizer = new Tokenizer(JSON.parse(readFileSync(path("tokenizer.json"), "utf8")), JSON.parse(readFileSync(path("tokenizer_config.json"), "utf8")));
|
|
71
|
+
const sessions = [];
|
|
72
|
+
const lazy = /* @__PURE__ */ __name((name) => {
|
|
73
|
+
let opened;
|
|
74
|
+
return () => {
|
|
75
|
+
opened ??= openSession(readFileSync(path(name)), threads).then((created) => {
|
|
76
|
+
sessions.push(created.session);
|
|
77
|
+
return created;
|
|
78
|
+
});
|
|
79
|
+
return opened;
|
|
80
|
+
};
|
|
81
|
+
}, "lazy");
|
|
82
|
+
const vision = lazy(model.vision);
|
|
83
|
+
const text = lazy(model.text);
|
|
84
|
+
return {
|
|
85
|
+
model,
|
|
86
|
+
embedImage: /* @__PURE__ */ __name(async (bytes) => {
|
|
87
|
+
const pixels = await preprocess(bytes, canvas);
|
|
88
|
+
const { ort, session } = await vision();
|
|
89
|
+
const output = await session.run({ pixel_values: new ort.Tensor("float32", pixels, [1, 3, SIZE, SIZE]) });
|
|
90
|
+
return unit(Float32Array.from(output.image_embeds?.data));
|
|
91
|
+
}, "embedImage"),
|
|
92
|
+
embedQuery: /* @__PURE__ */ __name(async (query) => {
|
|
93
|
+
const ids = truncated(tokenizer.encode(query.toLowerCase()).ids, model.maxTokens);
|
|
94
|
+
const shape = [1, ids.length];
|
|
95
|
+
const { ort, session } = await text();
|
|
96
|
+
const feeds = {
|
|
97
|
+
input_ids: new ort.Tensor("int64", BigInt64Array.from(ids, BigInt), shape)
|
|
98
|
+
};
|
|
99
|
+
if (session.inputNames.includes("attention_mask"))
|
|
100
|
+
feeds.attention_mask = new ort.Tensor("int64", new BigInt64Array(ids.length).fill(1n), shape);
|
|
101
|
+
const output = await session.run(feeds);
|
|
102
|
+
return unit(Float32Array.from(output.text_embeds?.data));
|
|
103
|
+
}, "embedQuery"),
|
|
104
|
+
close: /* @__PURE__ */ __name(async () => {
|
|
105
|
+
await Promise.all(sessions.map((session) => session.release()));
|
|
106
|
+
}, "close")
|
|
107
|
+
};
|
|
108
|
+
}, "openPictureEmbedder");
|
|
109
|
+
export {
|
|
110
|
+
openPictureEmbedder
|
|
111
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
catchCrashes,
|
|
5
|
+
errorObjectOf,
|
|
6
|
+
errorRecordOf,
|
|
7
|
+
exitCodeOfAnswer,
|
|
8
|
+
exitCodeOfError,
|
|
9
|
+
mcpErrorResult,
|
|
10
|
+
renderError,
|
|
11
|
+
retryOf
|
|
12
|
+
} from "./chunk-TOSCB4SO.js";
|
|
13
|
+
import "./chunk-MVA5HVKL.js";
|
|
14
|
+
import "./chunk-DB2XKHI4.js";
|
|
15
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
16
|
+
export {
|
|
17
|
+
catchCrashes,
|
|
18
|
+
errorObjectOf,
|
|
19
|
+
errorRecordOf,
|
|
20
|
+
exitCodeOfAnswer,
|
|
21
|
+
exitCodeOfError,
|
|
22
|
+
mcpErrorResult,
|
|
23
|
+
renderError,
|
|
24
|
+
retryOf
|
|
25
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
askSetupQuestions,
|
|
5
|
+
asksAtStart,
|
|
6
|
+
setupAtStart,
|
|
7
|
+
systemLanguage
|
|
8
|
+
} from "./chunk-SAKK2YRU.js";
|
|
9
|
+
import "./chunk-RR5MX5TM.js";
|
|
10
|
+
import "./chunk-CWXOXIWS.js";
|
|
11
|
+
import "./chunk-NUU4WZVL.js";
|
|
12
|
+
import "./chunk-C32AKHTY.js";
|
|
13
|
+
import "./chunk-TI46WQXQ.js";
|
|
14
|
+
import "./chunk-O3DYRCIT.js";
|
|
15
|
+
import "./chunk-HZRQLAHO.js";
|
|
16
|
+
import "./chunk-D72URWJE.js";
|
|
17
|
+
import "./chunk-65TWQ7BV.js";
|
|
18
|
+
import "./chunk-TBJYLC5K.js";
|
|
19
|
+
import "./chunk-TOSCB4SO.js";
|
|
20
|
+
import "./chunk-MVA5HVKL.js";
|
|
21
|
+
import "./chunk-Y5E2WNWB.js";
|
|
22
|
+
import "./chunk-DB2XKHI4.js";
|
|
23
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
24
|
+
export {
|
|
25
|
+
askSetupQuestions,
|
|
26
|
+
asksAtStart,
|
|
27
|
+
setupAtStart,
|
|
28
|
+
systemLanguage
|
|
29
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
firstScreen,
|
|
5
|
+
installHelp
|
|
6
|
+
} from "./chunk-NXERIDPJ.js";
|
|
7
|
+
import {
|
|
8
|
+
WIRECAT_TOOLS
|
|
9
|
+
} from "./chunk-WE4UFASG.js";
|
|
10
|
+
import "./chunk-NWHEHV3K.js";
|
|
11
|
+
import "./chunk-7ELMWE3P.js";
|
|
12
|
+
import "./chunk-PVKF24ZW.js";
|
|
13
|
+
import "./chunk-NUU4WZVL.js";
|
|
14
|
+
import "./chunk-2VGZRYEH.js";
|
|
15
|
+
import "./chunk-W53EJOFQ.js";
|
|
16
|
+
import "./chunk-LOBVOGOE.js";
|
|
17
|
+
import "./chunk-CLAN3FES.js";
|
|
18
|
+
import "./chunk-UUMUL4L3.js";
|
|
19
|
+
import "./chunk-XRREFEIW.js";
|
|
20
|
+
import "./chunk-TI46WQXQ.js";
|
|
21
|
+
import "./chunk-5GBUCHRU.js";
|
|
22
|
+
import "./chunk-EH6ZEJGT.js";
|
|
23
|
+
import "./chunk-2VGD63G6.js";
|
|
24
|
+
import "./chunk-QJW35N5V.js";
|
|
25
|
+
import "./chunk-IMJQRPLN.js";
|
|
26
|
+
import "./chunk-DSP36YHQ.js";
|
|
27
|
+
import "./chunk-5K7QLJMM.js";
|
|
28
|
+
import "./chunk-FPUGMDJV.js";
|
|
29
|
+
import "./chunk-65TWQ7BV.js";
|
|
30
|
+
import "./chunk-TBJYLC5K.js";
|
|
31
|
+
import "./chunk-TOSCB4SO.js";
|
|
32
|
+
import "./chunk-MVA5HVKL.js";
|
|
33
|
+
import "./chunk-Y5E2WNWB.js";
|
|
34
|
+
import "./chunk-DB2XKHI4.js";
|
|
35
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
36
|
+
export {
|
|
37
|
+
WIRECAT_TOOLS,
|
|
38
|
+
firstScreen,
|
|
39
|
+
installHelp
|
|
40
|
+
};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
3
|
+
const require = __bundleRequire(import.meta.url);
|
|
4
|
+
import {
|
|
5
|
+
DESKTOP
|
|
6
|
+
} from "./chunk-X7XUX7A4.js";
|
|
7
|
+
import "./chunk-H3TNVEQX.js";
|
|
8
|
+
import "./chunk-HC5ZWE5X.js";
|
|
9
|
+
import "./chunk-QGFX5MXL.js";
|
|
10
|
+
import "./chunk-EH6ZEJGT.js";
|
|
11
|
+
import {
|
|
12
|
+
installerOf
|
|
13
|
+
} from "./chunk-O3DYRCIT.js";
|
|
14
|
+
import "./chunk-2VGD63G6.js";
|
|
15
|
+
import "./chunk-5A6ZYNAQ.js";
|
|
16
|
+
import "./chunk-43EKCUBJ.js";
|
|
17
|
+
import "./chunk-HZRQLAHO.js";
|
|
18
|
+
import "./chunk-QJW35N5V.js";
|
|
19
|
+
import "./chunk-IMJQRPLN.js";
|
|
20
|
+
import "./chunk-DSP36YHQ.js";
|
|
21
|
+
import "./chunk-5K7QLJMM.js";
|
|
22
|
+
import "./chunk-FPUGMDJV.js";
|
|
23
|
+
import {
|
|
24
|
+
DESCRIBE_FLAG,
|
|
25
|
+
DISPATCH_FLAG,
|
|
26
|
+
PROGRAM_PREFIX,
|
|
27
|
+
SHIM_FORMAT,
|
|
28
|
+
describeAnswer,
|
|
29
|
+
exists,
|
|
30
|
+
fileState,
|
|
31
|
+
shimFiles,
|
|
32
|
+
writeShim
|
|
33
|
+
} from "./chunk-P5BHKKBI.js";
|
|
34
|
+
import "./chunk-DBEQI5YM.js";
|
|
35
|
+
import "./chunk-PPHBRESD.js";
|
|
36
|
+
import "./chunk-TBJYLC5K.js";
|
|
37
|
+
import {
|
|
38
|
+
catchCrashes
|
|
39
|
+
} from "./chunk-TOSCB4SO.js";
|
|
40
|
+
import "./chunk-MVA5HVKL.js";
|
|
41
|
+
import "./chunk-Y5E2WNWB.js";
|
|
42
|
+
import "./chunk-DB2XKHI4.js";
|
|
43
|
+
import {
|
|
44
|
+
__name
|
|
45
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
46
|
+
|
|
47
|
+
// dist/bin/hubspot.js
|
|
48
|
+
import { enableCompileCache } from "node:module";
|
|
49
|
+
|
|
50
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/start.js
|
|
51
|
+
import { createHash } from "node:crypto";
|
|
52
|
+
import { existsSync, readFileSync as readFileSync2, realpathSync } from "node:fs";
|
|
53
|
+
import { dirname as dirname2, join as join2 } from "node:path";
|
|
54
|
+
import { fileURLToPath } from "node:url";
|
|
55
|
+
|
|
56
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/launcher.js
|
|
57
|
+
import { readFileSync } from "node:fs";
|
|
58
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
59
|
+
var posix = /* @__PURE__ */ __name((path) => path.replaceAll("\\", "/"), "posix");
|
|
60
|
+
var pnpmHome = /* @__PURE__ */ __name((path, env) => {
|
|
61
|
+
const home = env.PNPM_HOME;
|
|
62
|
+
return home && path.startsWith(`${posix(home).replace(/\/+$/, "")}/`) ? home : void 0;
|
|
63
|
+
}, "pnpmHome");
|
|
64
|
+
var layoutFolders = /* @__PURE__ */ __name((script, env) => {
|
|
65
|
+
const path = posix(script);
|
|
66
|
+
const home = pnpmHome(path, env);
|
|
67
|
+
if (home)
|
|
68
|
+
return [join(home, "bin"), home];
|
|
69
|
+
switch (installerOf(script)) {
|
|
70
|
+
case "bun":
|
|
71
|
+
return [`${path.slice(0, path.indexOf("/install/global/node_modules/"))}/bin`];
|
|
72
|
+
case "npm": {
|
|
73
|
+
const root = path.slice(0, path.indexOf("/node_modules/"));
|
|
74
|
+
return [basename(root) === "lib" ? join(dirname(root), "bin") : root];
|
|
75
|
+
}
|
|
76
|
+
default:
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
}, "layoutFolders");
|
|
80
|
+
var binFolder = /* @__PURE__ */ __name(({ name, argv1, script, env, platform }) => {
|
|
81
|
+
if (!["npm", "pnpm", "bun"].includes(installerOf(script)) && !pnpmHome(posix(script), env))
|
|
82
|
+
return void 0;
|
|
83
|
+
const extensions = platform === "win32" ? [".cmd", ".exe"] : [""];
|
|
84
|
+
const candidates = [argv1 ? dirname(argv1) : void 0, ...layoutFolders(script, env)];
|
|
85
|
+
for (const dir of new Set(candidates)) {
|
|
86
|
+
if (dir === void 0 || basename(dir) === ".bin")
|
|
87
|
+
continue;
|
|
88
|
+
for (const extension of extensions) {
|
|
89
|
+
const program = `${PROGRAM_PREFIX}${name}${extension}`;
|
|
90
|
+
if (exists(join(dir, program)))
|
|
91
|
+
return { dir, program };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return void 0;
|
|
95
|
+
}, "binFolder");
|
|
96
|
+
var installed = /* @__PURE__ */ __name((dir, program) => {
|
|
97
|
+
if (!exists(join(dir, program)))
|
|
98
|
+
return false;
|
|
99
|
+
if (!program.toLowerCase().endsWith(".exe"))
|
|
100
|
+
return true;
|
|
101
|
+
let script;
|
|
102
|
+
try {
|
|
103
|
+
script = readFileSync(join(dir, `${program.slice(0, -4)}.bunx`)).toString("utf16le").split('"')[0] ?? "";
|
|
104
|
+
} catch {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
if (script === "" || exists(resolve(dir, script)))
|
|
108
|
+
return true;
|
|
109
|
+
const at = posix(script).lastIndexOf("/install/global/node_modules/");
|
|
110
|
+
return at < 0 || exists(join(dirname(dir), posix(script).slice(at + 1)));
|
|
111
|
+
}, "installed");
|
|
112
|
+
var NAME = "wcat";
|
|
113
|
+
var ensureLauncher = /* @__PURE__ */ __name(({ dir, program, platform }) => {
|
|
114
|
+
try {
|
|
115
|
+
if (!exists(join(dir, program)))
|
|
116
|
+
return "failed";
|
|
117
|
+
const mine = shimFiles("launcher", { dir, name: NAME, target: program, platform });
|
|
118
|
+
const states = mine.map((file) => fileState(file.path));
|
|
119
|
+
if (states.some((one) => one.state === "foreign"))
|
|
120
|
+
return "foreign";
|
|
121
|
+
const ours = states.flatMap((one) => one.state === "ours" ? [one] : []);
|
|
122
|
+
if (ours.some(({ mark }) => mark.format > SHIM_FORMAT))
|
|
123
|
+
return "newer";
|
|
124
|
+
if (ours.some(({ mark }) => mark.kind !== "launcher"))
|
|
125
|
+
return "foreign";
|
|
126
|
+
const current = ours.find(({ mark }) => installed(dir, mark.target))?.mark.target;
|
|
127
|
+
const wanted = shimFiles("launcher", { dir, name: NAME, target: current ?? program, platform });
|
|
128
|
+
const stale = wanted.filter((file, at) => {
|
|
129
|
+
const state = states[at];
|
|
130
|
+
return state?.state !== "ours" || state.text !== file.text;
|
|
131
|
+
});
|
|
132
|
+
if (stale.length === 0)
|
|
133
|
+
return "kept";
|
|
134
|
+
for (const file of stale)
|
|
135
|
+
writeShim(file);
|
|
136
|
+
return "written";
|
|
137
|
+
} catch {
|
|
138
|
+
return "failed";
|
|
139
|
+
}
|
|
140
|
+
}, "ensureLauncher");
|
|
141
|
+
|
|
142
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/start.js
|
|
143
|
+
var wcatStart = /* @__PURE__ */ __name(async (tool, io = {}) => {
|
|
144
|
+
const argv = io.argv ?? process.argv;
|
|
145
|
+
const env = io.env ?? process.env;
|
|
146
|
+
const platform = io.platform ?? process.platform;
|
|
147
|
+
const stdout = io.stdout ?? process.stdout;
|
|
148
|
+
const [first, ...rest] = argv.slice(2);
|
|
149
|
+
if (first === DESCRIBE_FLAG) {
|
|
150
|
+
stdout.write(`${JSON.stringify(describeAnswer(tool, shippedManifest(argv[1])))}
|
|
151
|
+
`);
|
|
152
|
+
return { code: 0 };
|
|
153
|
+
}
|
|
154
|
+
if (first === DISPATCH_FLAG) {
|
|
155
|
+
const { runWcat } = await import("./dispatch-KOISQ5QJ.js");
|
|
156
|
+
const code = await runWcat(rest, { env, platform, stdout, stderr: io.stderr ?? process.stderr, self: tool });
|
|
157
|
+
return { code };
|
|
158
|
+
}
|
|
159
|
+
const folder = binFolder({
|
|
160
|
+
name: tool.command,
|
|
161
|
+
argv1: argv[1],
|
|
162
|
+
script: io.script ?? fileURLToPath(new URL("wcat/start.js", import.meta.resolve("@wirecat/cli-base")).href),
|
|
163
|
+
env,
|
|
164
|
+
platform
|
|
165
|
+
});
|
|
166
|
+
return folder ? { launcher: ensureLauncher({ ...folder, platform }) } : {};
|
|
167
|
+
}, "wcatStart");
|
|
168
|
+
var shippedManifest = /* @__PURE__ */ __name((bin) => {
|
|
169
|
+
if (!bin)
|
|
170
|
+
return void 0;
|
|
171
|
+
try {
|
|
172
|
+
for (let dir = dirname2(realpathSync(bin)); ; dir = dirname2(dir)) {
|
|
173
|
+
if (existsSync(join2(dir, "package.json"))) {
|
|
174
|
+
const bytes = readFileSync2(join2(dir, "contracts", "wirecat.json"));
|
|
175
|
+
const { wcat_manifest: format, desktop } = JSON.parse(bytes.toString("utf8"));
|
|
176
|
+
if (format !== 2 || typeof desktop !== "object" || desktop === null)
|
|
177
|
+
return void 0;
|
|
178
|
+
return { desktop, sha256: createHash("sha256").update(bytes).digest("hex") };
|
|
179
|
+
}
|
|
180
|
+
if (dirname2(dir) === dir)
|
|
181
|
+
return void 0;
|
|
182
|
+
}
|
|
183
|
+
} catch {
|
|
184
|
+
return void 0;
|
|
185
|
+
}
|
|
186
|
+
}, "shippedManifest");
|
|
187
|
+
|
|
188
|
+
// dist/bin/hubspot.js
|
|
189
|
+
enableCompileCache();
|
|
190
|
+
var stopCatching = catchCrashes({ cli: DESKTOP.command, interactive: process.stdout.isTTY === true });
|
|
191
|
+
var wcat = await wcatStart(DESKTOP);
|
|
192
|
+
if (wcat.code !== void 0) {
|
|
193
|
+
process.exitCode = wcat.code;
|
|
194
|
+
} else {
|
|
195
|
+
const { run } = await import("./program-POG5GHUQ.js");
|
|
196
|
+
process.exitCode = await run(process.argv.slice(2));
|
|
197
|
+
}
|
|
198
|
+
stopCatching();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
appInstructions,
|
|
5
|
+
instructions
|
|
6
|
+
} from "./chunk-FKA7DOCK.js";
|
|
7
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
8
|
+
export {
|
|
9
|
+
appInstructions,
|
|
10
|
+
instructions
|
|
11
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
executableEnvironment,
|
|
5
|
+
executableOnPath
|
|
6
|
+
} from "./chunk-CWXOXIWS.js";
|
|
7
|
+
import {
|
|
8
|
+
require_cross_spawn
|
|
9
|
+
} from "./chunk-D72URWJE.js";
|
|
10
|
+
import {
|
|
11
|
+
__name,
|
|
12
|
+
__toESM
|
|
13
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
14
|
+
|
|
15
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/mcp/index.js
|
|
16
|
+
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
17
|
+
var realRun = /* @__PURE__ */ __name((file, args) => {
|
|
18
|
+
const result = import_cross_spawn.default.sync(executableOnPath(file, process.env), args, {
|
|
19
|
+
encoding: "utf8",
|
|
20
|
+
timeout: 1e4,
|
|
21
|
+
maxBuffer: 256e3,
|
|
22
|
+
env: executableEnvironment(process.env)
|
|
23
|
+
});
|
|
24
|
+
return { status: result.status, error: result.error, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
|
|
25
|
+
}, "realRun");
|
|
26
|
+
var executable = /* @__PURE__ */ __name((client) => client === "codex" ? "codex" : "claude", "executable");
|
|
27
|
+
var presentIn = /* @__PURE__ */ __name((client, name, run) => {
|
|
28
|
+
const state = lookUp(client, name, run);
|
|
29
|
+
if (state === "unavailable")
|
|
30
|
+
throw new Error(`${executable(client)} is not installed or could not be started`);
|
|
31
|
+
return state === "registered";
|
|
32
|
+
}, "presentIn");
|
|
33
|
+
var setupArguments = /* @__PURE__ */ __name((client, name, entry) => {
|
|
34
|
+
const variables = Object.entries(entry.env ?? {}).flatMap(([key, value]) => ["--env", `${key}=${value}`]);
|
|
35
|
+
if (client === "codex")
|
|
36
|
+
return ["mcp", "add", name, ...variables, "--", entry.command, ...entry.args];
|
|
37
|
+
return ["mcp", "add", "--scope", "user", name, ...variables, "--", entry.command, ...entry.args];
|
|
38
|
+
}, "setupArguments");
|
|
39
|
+
var checkName = /* @__PURE__ */ __name((name) => {
|
|
40
|
+
if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name))
|
|
41
|
+
throw new Error("the MCP name must be letters, digits, _ or -");
|
|
42
|
+
}, "checkName");
|
|
43
|
+
var lookUp = /* @__PURE__ */ __name((client, name, run) => {
|
|
44
|
+
const file = executable(client);
|
|
45
|
+
const existing = run(file, ["mcp", "get", name, ...client === "codex" ? ["--json"] : []]);
|
|
46
|
+
if (existing.error)
|
|
47
|
+
return "unavailable";
|
|
48
|
+
if (existing.status === 0)
|
|
49
|
+
return "registered";
|
|
50
|
+
if (!/No MCP server named/i.test(existing.stdout + existing.stderr)) {
|
|
51
|
+
throw new Error(`${file} could not check its MCP configuration`);
|
|
52
|
+
}
|
|
53
|
+
return "missing";
|
|
54
|
+
}, "lookUp");
|
|
55
|
+
var stdioEntryStatus = /* @__PURE__ */ __name((client, name, { run = realRun } = {}) => {
|
|
56
|
+
checkName(name);
|
|
57
|
+
return { client, name, state: lookUp(client, name, run) };
|
|
58
|
+
}, "stdioEntryStatus");
|
|
59
|
+
var removeArguments = /* @__PURE__ */ __name((client, name) => (
|
|
60
|
+
// Claude Code without a scope removes from whichever scope holds the name, which may be a project's own entry.
|
|
61
|
+
client === "codex" ? ["mcp", "remove", name] : ["mcp", "remove", "--scope", "user", name]
|
|
62
|
+
), "removeArguments");
|
|
63
|
+
var removeStdioEntry = /* @__PURE__ */ __name((client, name, { run = realRun } = {}) => {
|
|
64
|
+
checkName(name);
|
|
65
|
+
if (!presentIn(client, name, run))
|
|
66
|
+
return { client, name, removed: false };
|
|
67
|
+
const file = executable(client);
|
|
68
|
+
const removed = run(file, removeArguments(client, name));
|
|
69
|
+
if (removed.status !== 0 || removed.error)
|
|
70
|
+
throw new Error(`${file} could not remove ${name}`);
|
|
71
|
+
return { client, name, removed: true };
|
|
72
|
+
}, "removeStdioEntry");
|
|
73
|
+
var installStdioEntry = /* @__PURE__ */ __name((client, name, entry, { run = realRun } = {}) => {
|
|
74
|
+
checkName(name);
|
|
75
|
+
if (!entry.command || entry.args.some((arg) => arg.includes("\0")))
|
|
76
|
+
throw new Error("invalid MCP command");
|
|
77
|
+
const file = executable(client);
|
|
78
|
+
if (presentIn(client, name, run))
|
|
79
|
+
throw new Error(`${name} is already configured in ${file}; remove it there first`);
|
|
80
|
+
const args = setupArguments(client, name, entry);
|
|
81
|
+
const added = run(file, args);
|
|
82
|
+
if (added.status !== 0 || added.error)
|
|
83
|
+
throw new Error(`${file} could not add ${name}`);
|
|
84
|
+
return { client, name, command: [entry.command, ...entry.args] };
|
|
85
|
+
}, "installStdioEntry");
|
|
86
|
+
var probeStdio = /* @__PURE__ */ __name(async (entry, { timeoutMs = 1e4, start = /* @__PURE__ */ __name((file, args, env) => (0, import_cross_spawn.default)(executableOnPath(file, env), args, {
|
|
87
|
+
env: executableEnvironment(env),
|
|
88
|
+
stdio: "pipe"
|
|
89
|
+
}), "start") } = {}) => {
|
|
90
|
+
const child = start(entry.command, entry.args, { ...process.env, ...entry.env });
|
|
91
|
+
let buffer = "";
|
|
92
|
+
let timer;
|
|
93
|
+
const pending = /* @__PURE__ */ new Map();
|
|
94
|
+
const request = /* @__PURE__ */ __name((id, method, params) => new Promise((resolve, reject) => {
|
|
95
|
+
pending.set(id, { resolve, reject });
|
|
96
|
+
child.stdin.write(`${JSON.stringify({ jsonrpc: "2.0", id, method, params })}
|
|
97
|
+
`);
|
|
98
|
+
}), "request");
|
|
99
|
+
const fail = /* @__PURE__ */ __name((error) => {
|
|
100
|
+
for (const waiter of pending.values())
|
|
101
|
+
waiter.reject(error);
|
|
102
|
+
pending.clear();
|
|
103
|
+
}, "fail");
|
|
104
|
+
child.on("error", () => fail(new Error("the MCP server could not be started")));
|
|
105
|
+
child.on("exit", () => fail(new Error("the MCP server exited before answering")));
|
|
106
|
+
child.stdin.on("error", () => fail(new Error("the MCP server closed its input")));
|
|
107
|
+
child.stdout.setEncoding("utf8");
|
|
108
|
+
child.stdout.on("data", (chunk) => {
|
|
109
|
+
buffer += chunk;
|
|
110
|
+
if (buffer.length > 1e6)
|
|
111
|
+
return fail(new Error("the MCP server sent too much output"));
|
|
112
|
+
for (let newline = buffer.indexOf("\n"); newline !== -1; newline = buffer.indexOf("\n")) {
|
|
113
|
+
const line = buffer.slice(0, newline);
|
|
114
|
+
buffer = buffer.slice(newline + 1);
|
|
115
|
+
try {
|
|
116
|
+
const value = JSON.parse(line);
|
|
117
|
+
if (typeof value.id !== "number")
|
|
118
|
+
continue;
|
|
119
|
+
const waiter = pending.get(value.id);
|
|
120
|
+
if (!waiter)
|
|
121
|
+
continue;
|
|
122
|
+
pending.delete(value.id);
|
|
123
|
+
if (value.error)
|
|
124
|
+
waiter.reject(new Error("the MCP server rejected the handshake"));
|
|
125
|
+
else
|
|
126
|
+
waiter.resolve(value.result ?? {});
|
|
127
|
+
} catch {
|
|
128
|
+
fail(new Error("the MCP server sent invalid JSON"));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
try {
|
|
133
|
+
timer = setTimeout(() => fail(new Error("the MCP server did not answer in time")), timeoutMs);
|
|
134
|
+
await request(1, "initialize", {
|
|
135
|
+
protocolVersion: "2025-11-25",
|
|
136
|
+
capabilities: {},
|
|
137
|
+
clientInfo: { name: "cli-base-mcp-doctor", version: "1" }
|
|
138
|
+
});
|
|
139
|
+
child.stdin.write(`${JSON.stringify({ jsonrpc: "2.0", method: "notifications/initialized" })}
|
|
140
|
+
`);
|
|
141
|
+
const result = await request(2, "tools/list", {});
|
|
142
|
+
const tools = result.tools;
|
|
143
|
+
if (!Array.isArray(tools))
|
|
144
|
+
throw new Error("the MCP server returned no tool list");
|
|
145
|
+
const named = tools.filter((item) => item !== null && typeof item === "object" && "name" in item && typeof item.name === "string");
|
|
146
|
+
if (named.length !== tools.length)
|
|
147
|
+
throw new Error("the MCP server returned an invalid tool list");
|
|
148
|
+
return {
|
|
149
|
+
tools: named.map((item) => item.name),
|
|
150
|
+
potentialWrites: named.filter((item) => item.annotations?.readOnlyHint !== true).map((item) => item.name)
|
|
151
|
+
};
|
|
152
|
+
} finally {
|
|
153
|
+
if (timer)
|
|
154
|
+
clearTimeout(timer);
|
|
155
|
+
pending.clear();
|
|
156
|
+
child.stdin.end();
|
|
157
|
+
child.kill();
|
|
158
|
+
}
|
|
159
|
+
}, "probeStdio");
|
|
160
|
+
export {
|
|
161
|
+
installStdioEntry,
|
|
162
|
+
probeStdio,
|
|
163
|
+
removeArguments,
|
|
164
|
+
removeStdioEntry,
|
|
165
|
+
setupArguments,
|
|
166
|
+
stdioEntryStatus
|
|
167
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
searchMeetingsCombined
|
|
5
|
+
} from "./chunk-QU25DA5N.js";
|
|
6
|
+
import "./chunk-TKVL2C3B.js";
|
|
7
|
+
import "./chunk-2VGZRYEH.js";
|
|
8
|
+
import "./chunk-FTFV3HFW.js";
|
|
9
|
+
import "./chunk-TI46WQXQ.js";
|
|
10
|
+
import "./chunk-5GBUCHRU.js";
|
|
11
|
+
import "./chunk-43EKCUBJ.js";
|
|
12
|
+
import "./chunk-HZRQLAHO.js";
|
|
13
|
+
import "./chunk-DSP36YHQ.js";
|
|
14
|
+
import "./chunk-5K7QLJMM.js";
|
|
15
|
+
import "./chunk-FPUGMDJV.js";
|
|
16
|
+
import "./chunk-65TWQ7BV.js";
|
|
17
|
+
import "./chunk-TBJYLC5K.js";
|
|
18
|
+
import "./chunk-TOSCB4SO.js";
|
|
19
|
+
import "./chunk-MVA5HVKL.js";
|
|
20
|
+
import "./chunk-Y5E2WNWB.js";
|
|
21
|
+
import "./chunk-DB2XKHI4.js";
|
|
22
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
23
|
+
export {
|
|
24
|
+
searchMeetingsCombined
|
|
25
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
createMeetingRemoteModel,
|
|
5
|
+
meetingEmbeddingModel,
|
|
6
|
+
openMeetingEmbedder
|
|
7
|
+
} from "./chunk-FOZYMDRL.js";
|
|
8
|
+
import "./chunk-2VGZRYEH.js";
|
|
9
|
+
import "./chunk-SDQGB4KB.js";
|
|
10
|
+
import "./chunk-XRREFEIW.js";
|
|
11
|
+
import "./chunk-TI46WQXQ.js";
|
|
12
|
+
import "./chunk-E52JAS35.js";
|
|
13
|
+
import "./chunk-5GBUCHRU.js";
|
|
14
|
+
import "./chunk-65TWQ7BV.js";
|
|
15
|
+
import "./chunk-TBJYLC5K.js";
|
|
16
|
+
import "./chunk-TOSCB4SO.js";
|
|
17
|
+
import "./chunk-MVA5HVKL.js";
|
|
18
|
+
import "./chunk-Y5E2WNWB.js";
|
|
19
|
+
import "./chunk-DB2XKHI4.js";
|
|
20
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
21
|
+
export {
|
|
22
|
+
createMeetingRemoteModel,
|
|
23
|
+
meetingEmbeddingModel,
|
|
24
|
+
openMeetingEmbedder
|
|
25
|
+
};
|