@wirecat/hubspot-cli 0.2.0 → 0.3.1
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 +27 -0
- package/README.md +2 -2
- package/contracts/wirecat.json +40 -2
- package/dist/bin/hubspot.js +2 -2
- package/dist/bundle/agent-A7ARC3QB.js +40 -0
- package/dist/bundle/{all-profiles-64JAUYW4.js → all-profiles-6452VSJB.js} +64 -22
- package/dist/bundle/{anthropic-VJOS4OUM.js → anthropic-VQUOVYOW.js} +6 -6
- package/dist/bundle/{app-server-GXV2OFML.js → app-server-EQZUP4H4.js} +79 -68
- package/dist/bundle/{bun-M3J2QTR3.js → bun-AJPJ4ZUN.js} +2 -2
- package/dist/bundle/{bun-sqlite-IX3XYA5F.js → bun-sqlite-AGXGSF6D.js} +7 -7
- package/dist/bundle/{chunk-N2XADGL4.js → chunk-2A64XS22.js} +4 -4
- package/dist/bundle/{chunk-Q2OLOMHL.js → chunk-2HYGCLKN.js} +93 -565
- package/dist/bundle/{chunk-FOZYMDRL.js → chunk-2NCO4E4T.js} +6 -6
- package/dist/bundle/{chunk-FBCCBCFH.js → chunk-2PRVWEJC.js} +3 -3
- package/dist/bundle/{chunk-LOBVOGOE.js → chunk-3DIXAEGH.js} +4 -4
- package/dist/bundle/{chunk-O3DYRCIT.js → chunk-3I2FGNWO.js} +1 -1
- package/dist/bundle/{chunk-65TWQ7BV.js → chunk-3PEKYGZ3.js} +2 -2
- package/dist/bundle/{chunk-DRWWJLI6.js → chunk-3R4KRNUZ.js} +8 -8
- package/dist/bundle/{chunk-2VGD63G6.js → chunk-3TEFE6YU.js} +7 -7
- package/dist/bundle/{chunk-TI46WQXQ.js → chunk-4DNHXRCJ.js} +7 -7
- package/dist/bundle/{chunk-QU25DA5N.js → chunk-5AYKCKSE.js} +11 -11
- package/dist/bundle/{chunk-CWXOXIWS.js → chunk-5K3FGXZH.js} +1 -1
- package/dist/bundle/{chunk-24ERVFJP.js → chunk-5YNAVVCW.js} +3 -3
- package/dist/bundle/{chunk-URX6YDUL.js → chunk-5ZV7REBE.js} +75 -66
- package/dist/bundle/{chunk-TLKEPUAV.js → chunk-6MFP47XC.js} +60 -50
- package/dist/bundle/{chunk-36ITRDYY.js → chunk-7LQRXVQ3.js} +783 -482
- package/dist/bundle/{chunk-E5WLE7BM.js → chunk-7NZT7Y55.js} +1 -1
- package/dist/bundle/{chunk-C32AKHTY.js → chunk-7UEL65GQ.js} +35 -12
- package/dist/bundle/chunk-7VHBS5BJ.js +108 -0
- package/dist/bundle/{chunk-O55RWNSH.js → chunk-A6UFH3QU.js} +4 -4
- package/dist/bundle/{chunk-WE4UFASG.js → chunk-ABXVU5O4.js} +8 -1
- package/dist/bundle/{chunk-4W6BMH45.js → chunk-AF7DANIR.js} +2 -100
- package/dist/bundle/{chunk-2VGZRYEH.js → chunk-ARTJLL7W.js} +6 -6
- package/dist/bundle/chunk-AVUMH42T.js +194 -0
- package/dist/bundle/{chunk-MFNMKHML.js → chunk-AWOJYRQW.js} +1024 -1639
- package/dist/bundle/chunk-B2W3C4N6.js +338 -0
- package/dist/bundle/{chunk-FKA7DOCK.js → chunk-B3EH22CO.js} +1 -1
- package/dist/bundle/{chunk-E52JAS35.js → chunk-BAUK2MD5.js} +6 -6
- package/dist/bundle/{chunk-LXZ66MCH.js → chunk-BHZUPOQY.js} +35 -29
- package/dist/bundle/{chunk-JLDBMEKZ.js → chunk-BN22EKQQ.js} +2 -2
- package/dist/bundle/{chunk-DB2XKHI4.js → chunk-BUGROVF3.js} +2 -2
- package/dist/bundle/{chunk-DSP36YHQ.js → chunk-CBCEMFCF.js} +2 -2
- package/dist/bundle/{chunk-HZRQLAHO.js → chunk-DQB5JMTY.js} +1 -1
- package/dist/bundle/{chunk-FPUGMDJV.js → chunk-DSRXCLPO.js} +1 -1
- package/dist/bundle/{chunk-UUMUL4L3.js → chunk-DW23LM47.js} +2 -2
- package/dist/bundle/{chunk-VOH7S5M4.js → chunk-E4FAMU2S.js} +3230 -3116
- package/dist/bundle/{chunk-TKVL2C3B.js → chunk-E4X7JAFC.js} +3 -3
- package/dist/bundle/{chunk-NUU4WZVL.js → chunk-EE4JSYGZ.js} +3 -3
- package/dist/bundle/{chunk-NWHEHV3K.js → chunk-EMOVVERN.js} +5 -5
- package/dist/bundle/{chunk-PVKF24ZW.js → chunk-FIVD4HM4.js} +8 -8
- package/dist/bundle/{chunk-QJW35N5V.js → chunk-GC6FLHZF.js} +12 -12
- package/dist/bundle/{chunk-TP7GDWVF.js → chunk-GRFICQTZ.js} +1 -1
- package/dist/bundle/{chunk-GPYCBYX5.js → chunk-GZZR5U3K.js} +12 -12
- package/dist/bundle/{chunk-X2M6NIQG.js → chunk-HPZRUY6S.js} +1 -1
- package/dist/bundle/{chunk-CLAN3FES.js → chunk-IBTMK5KD.js} +54 -34
- package/dist/bundle/{chunk-5A6ZYNAQ.js → chunk-IQ2XZ62J.js} +18 -18
- package/dist/bundle/{chunk-DBEQI5YM.js → chunk-ITGNDZRR.js} +3 -3
- package/dist/bundle/{chunk-W53EJOFQ.js → chunk-IXZLMFPO.js} +1 -1
- package/dist/bundle/{chunk-TOSCB4SO.js → chunk-J5P5VSRG.js} +16 -10
- package/dist/bundle/{chunk-RMIYKDUL.js → chunk-JK2SNLU5.js} +17 -17
- package/dist/bundle/{chunk-43EKCUBJ.js → chunk-JP2HJXFO.js} +3 -3
- package/dist/bundle/{chunk-DFCHHR5M.js → chunk-JUKAIXKY.js} +1 -1
- package/dist/bundle/{chunk-3WLYWRGG.js → chunk-K4X5ZHI2.js} +19 -17
- package/dist/bundle/{chunk-5GBUCHRU.js → chunk-KO4VR5NK.js} +4 -4
- package/dist/bundle/{chunk-PPHBRESD.js → chunk-KVXEEKBB.js} +2 -2
- package/dist/bundle/{chunk-SDQGB4KB.js → chunk-L433IDOX.js} +9 -9
- package/dist/bundle/chunk-LA3YU4K7.js +40 -0
- package/dist/bundle/{chunk-ECEZOLOD.js → chunk-LKSNISYV.js} +4 -4
- package/dist/bundle/{chunk-5K7QLJMM.js → chunk-LT5KE44Q.js} +226 -226
- package/dist/bundle/{chunk-YMCY7VRE.js → chunk-LTVYGXWT.js} +7 -7
- package/dist/bundle/chunk-M763RNWP.js +733 -0
- package/dist/bundle/{chunk-IMJQRPLN.js → chunk-NNMU2TDU.js} +1 -1
- package/dist/bundle/chunk-NTQBS2JL.js +52 -0
- package/dist/bundle/{chunk-HCAZV5NP.js → chunk-NZGI74GS.js} +6 -6
- package/dist/bundle/{chunk-W7HM2VGO.js → chunk-O3VM5PTJ.js} +1 -1
- package/dist/bundle/chunk-ODPU3II6.js +353 -0
- package/dist/bundle/chunk-OJIJVOOA.js +561 -0
- package/dist/bundle/{chunk-7ELMWE3P.js → chunk-PHXOL5HZ.js} +176 -160
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-B3MANLNK.js → chunk-PLRUUXK7.js} +19 -233
- package/dist/bundle/{chunk-RR5MX5TM.js → chunk-PMP37KLR.js} +4 -4
- package/dist/bundle/{chunk-FTFV3HFW.js → chunk-Q27QAB4X.js} +9 -9
- package/dist/bundle/{chunk-2QZK5BEP.js → chunk-RVWGFD32.js} +30 -15
- package/dist/bundle/{chunk-MVA5HVKL.js → chunk-S4UUN6LD.js} +18 -0
- package/dist/bundle/{chunk-QGFX5MXL.js → chunk-SEELWPRD.js} +9 -9
- package/dist/bundle/{chunk-HC5ZWE5X.js → chunk-TIHDBKA7.js} +2 -2
- package/dist/bundle/{chunk-NHHJHXMQ.js → chunk-U6XA3OOM.js} +2 -2
- package/dist/bundle/{chunk-IJADZW42.js → chunk-VNPC274V.js} +3 -3
- package/dist/bundle/{chunk-NXERIDPJ.js → chunk-VQEAZXTV.js} +7 -7
- package/dist/bundle/{chunk-P5BHKKBI.js → chunk-VW5F6FK3.js} +4 -4
- package/dist/bundle/{chunk-XRREFEIW.js → chunk-WCQW4GYO.js} +7 -7
- package/dist/bundle/{chunk-H3TNVEQX.js → chunk-WGBVRDY3.js} +29 -4
- package/dist/bundle/chunk-WRCKE5ND.js +80 -0
- package/dist/bundle/{chunk-TBJYLC5K.js → chunk-X5S5KUSU.js} +75 -75
- package/dist/bundle/{chunk-2UOJ7DLZ.js → chunk-XLDQTDF6.js} +3 -3
- package/dist/bundle/{chunk-Z73OL5HV.js → chunk-Z6ZQVYIE.js} +3 -3
- package/dist/bundle/command-contract-R2FGN7CQ.js +40 -0
- package/dist/bundle/{command-server-entry-DJKVVZCQ.js → command-server-entry-GJSMDSNE.js} +29 -29
- package/dist/bundle/{decode-FC65Y4IV.js → decode-6PLXHVHW.js} +6 -6
- package/dist/bundle/{dispatch-KOISQ5QJ.js → dispatch-TAQ7635E.js} +8 -8
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-FVTUDXDU.js → echarts-UZ7QLRE2.js} +2 -2
- package/dist/bundle/{embed-VNBZFPYH.js → embed-AWLL4EBF.js} +7 -7
- package/dist/bundle/{embedder-6U4NOFRO.js → embedder-MM225YJ6.js} +10 -10
- package/dist/bundle/{failure-FZ6VYKEQ.js → failure-MR2XVHFP.js} +3 -3
- package/dist/bundle/first-run-KCZVNFJ7.js +29 -0
- package/dist/bundle/first-screen-SCDV7TXT.js +40 -0
- package/dist/bundle/hubspot.js +26 -26
- package/dist/bundle/{instructions-HET7BCYK.js → instructions-ZJ7U3QUE.js} +1 -1
- package/dist/bundle/{mcp-RGNRW77S.js → mcp-CNV7F2XZ.js} +2 -2
- package/dist/bundle/meeting-combined-EL5XZIJ5.js +25 -0
- package/dist/bundle/meeting-model-OYXB2NOE.js +25 -0
- package/dist/bundle/{meeting-semantic-JY3OGCBS.js → meeting-semantic-S3DBB7XD.js} +7 -7
- package/dist/bundle/{node-CXZIFHZC.js → node-HGCZGZ4R.js} +2 -2
- package/dist/bundle/{node-sqlite-P3O7XN7Q.js → node-sqlite-RKYSRKEB.js} +8 -8
- package/dist/bundle/oauth-PYDCAQ7Y.js +20 -0
- package/dist/bundle/{open-F4P6YV54.js → open-UCDSQUN2.js} +6 -6
- package/dist/bundle/{openai-4AICLIK3.js → openai-Y4F5ZC7O.js} +16 -16
- package/dist/bundle/{process-5RUXWGYS.js → process-P7FB7YO7.js} +1 -1
- package/dist/bundle/{program-XA4C44Z4.js → program-O2A5L4S4.js} +683 -242
- package/dist/bundle/{prompt-NFMDVBZ4.js → prompt-E5TKZ37Q.js} +6 -6
- package/dist/bundle/{recognize-DKN3RY4V.js → recognize-5NYPTSLT.js} +5 -5
- package/dist/bundle/{remote-6QHAGQWY.js → remote-U4LUAHF2.js} +10 -10
- package/dist/bundle/{rerank-M4KHEHUZ.js → rerank-AJAVKK5L.js} +8 -8
- package/dist/bundle/{schemas-JRL3DLMP.js → schemas-QLQ2K6DL.js} +7 -33
- package/dist/bundle/{serve-DNU43ND6.js → serve-4UJ3R5IP.js} +11 -11
- package/dist/bundle/{server-ATG5KY7K.js → server-DUKWJUKD.js} +73 -61
- package/dist/bundle/server-UQVV2PPX.js +86 -0
- package/dist/bundle/{source-54HR4IWG.js → source-FCQDXCAD.js} +334 -78
- package/dist/bundle/{sqlite-runtime-EMQAC63N.js → sqlite-runtime-KLEA4XAU.js} +7 -7
- package/dist/bundle/{state-T45CX7VY.js → state-COGSYMVH.js} +7 -7
- package/dist/bundle/{store-6TZ2FCVA.js → store-BJXCSP26.js} +25 -24
- package/dist/bundle/store-CHH3G3SL.js +32 -0
- package/dist/bundle/{store-6LCEVBAZ.js → store-V5UMSWK4.js} +27 -22
- package/dist/bundle/store-maintenance-command-DQUBBWMD.js +73 -0
- package/dist/bundle/surface-IGBQUYE5.js +72 -0
- package/dist/bundle/writer-AQSEPEEN.js +86 -0
- package/dist/commands/session.js +2 -2
- package/dist/commands/session.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -5
- package/dist/config.js.map +1 -1
- package/dist/crm/activities.d.ts.map +1 -1
- package/dist/crm/activities.js +3 -13
- package/dist/crm/activities.js.map +1 -1
- package/dist/crm/records.d.ts +6 -0
- package/dist/crm/records.d.ts.map +1 -1
- package/dist/crm/records.js +6 -0
- package/dist/crm/records.js.map +1 -1
- package/dist/crm/source.d.ts +0 -6
- package/dist/crm/source.d.ts.map +1 -1
- package/dist/crm/source.js +1 -7
- package/dist/crm/source.js.map +1 -1
- package/dist/generated/manifest.d.ts.map +1 -1
- package/dist/generated/manifest.js +0 -115
- package/dist/generated/manifest.js.map +1 -1
- package/dist/generated/types.d.ts +160 -0
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/hubspot/transport.js +1 -1
- package/dist/hubspot/transport.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/command-contract-C6CBFXZF.js +0 -40
- package/dist/bundle/first-run-UWAFSINQ.js +0 -29
- package/dist/bundle/first-screen-RTVMGHAE.js +0 -40
- package/dist/bundle/meeting-combined-L5AGBPYX.js +0 -25
- package/dist/bundle/meeting-model-NTB4RK3F.js +0 -25
- package/dist/bundle/oauth-HNCY4B2S.js +0 -20
- package/dist/bundle/server-VNWVVH7A.js +0 -77
- package/dist/bundle/store-DXWYNVVB.js +0 -32
- package/dist/bundle/store-maintenance-command-J57HCJYY.js +0 -68
- package/dist/bundle/writer-NLLI5YRM.js +0 -79
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/runs/secrets.js
|
|
8
8
|
var SECRET_WORDS = /* @__PURE__ */ new Set([
|
|
9
9
|
"authorization",
|
|
10
10
|
"cookie",
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
changesMessenger
|
|
5
|
+
} from "./chunk-PHXOL5HZ.js";
|
|
6
|
+
import {
|
|
7
|
+
AUTHORITY_KEY,
|
|
8
|
+
BOT_API_KEY,
|
|
9
|
+
authorityAllowed,
|
|
10
|
+
botApiAllowed,
|
|
11
|
+
isBotApi,
|
|
12
|
+
keyForCommand,
|
|
13
|
+
levelFor,
|
|
14
|
+
readKeysForCommand
|
|
15
|
+
} from "./chunk-3TEFE6YU.js";
|
|
16
|
+
import {
|
|
17
|
+
writes
|
|
18
|
+
} from "./chunk-J5P5VSRG.js";
|
|
19
|
+
import {
|
|
20
|
+
__name
|
|
21
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
22
|
+
|
|
23
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/cli/command-availability.js
|
|
24
|
+
var commandAvailability = /* @__PURE__ */ __name((info, levels, keyOf, authority, readOnly = false, mcp = true, declared, fetches) => {
|
|
25
|
+
const declaredKey = declared?.keyOf(info.path);
|
|
26
|
+
const key = declared ? declaredKey : keyOf?.(info.path) ?? keyForCommand(info.path);
|
|
27
|
+
const { level } = key ? levelFor(levels, key, declared?.defaults) : { level: "allow" };
|
|
28
|
+
const judged = { ...key ? { permission: key } : {}, level };
|
|
29
|
+
const blocked = /* @__PURE__ */ __name((reason, permission) => ({
|
|
30
|
+
available: false,
|
|
31
|
+
reason,
|
|
32
|
+
...judged,
|
|
33
|
+
...permission && permission !== judged.permission ? { permission, level: levelFor(levels, permission).level } : {}
|
|
34
|
+
}), "blocked");
|
|
35
|
+
const declaredChange = Boolean(declaredKey) && (info.effects === void 0 || info.effects.remote === "write");
|
|
36
|
+
if (readOnly && (changesMessenger(info) || declaredChange || authority?.(info.path)))
|
|
37
|
+
return blocked("the read-only lock blocks this change");
|
|
38
|
+
if (mcp && authority?.(info.path) && !authorityAllowed(levels))
|
|
39
|
+
return blocked(`the profile keeps ${AUTHORITY_KEY} off`, AUTHORITY_KEY);
|
|
40
|
+
if (mcp && isBotApi(info.path) && !botApiAllowed(levels))
|
|
41
|
+
return blocked(`the profile requires ${BOT_API_KEY}: allow`, BOT_API_KEY);
|
|
42
|
+
if (level === "deny")
|
|
43
|
+
return blocked(`the profile denies ${key}`);
|
|
44
|
+
if (level === "readonly" && writes(info.effects) && fetches?.(info.path) !== true)
|
|
45
|
+
return blocked(`${key} is readonly in this profile`);
|
|
46
|
+
const denied = (declared ? [] : readKeysForCommand(info.path)).find((read) => levelFor(levels, read).level === "deny");
|
|
47
|
+
return denied ? blocked(`the profile denies ${denied}`, denied) : { available: true, ...judged };
|
|
48
|
+
}, "commandAvailability");
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
commandAvailability
|
|
52
|
+
};
|
|
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
PRAGMAS
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JUKAIXKY.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BUGROVF3.js";
|
|
9
9
|
import {
|
|
10
10
|
__name
|
|
11
11
|
} from "./chunk-ZVVMGPBJ.js";
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/store/sqlite-warning.js
|
|
14
14
|
var SQLITE_WARNING = "SQLite is an experimental feature";
|
|
15
15
|
var quieted = /* @__PURE__ */ new WeakSet();
|
|
16
16
|
var quietSqliteWarning = /* @__PURE__ */ __name((host = process) => {
|
|
@@ -31,7 +31,7 @@ var isSqliteWarning = /* @__PURE__ */ __name((warning, options) => {
|
|
|
31
31
|
return name === "ExperimentalWarning" && message.startsWith(SQLITE_WARNING);
|
|
32
32
|
}, "isSqliteWarning");
|
|
33
33
|
|
|
34
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/store/open.js
|
|
35
35
|
var openCache = /* @__PURE__ */ __name(async (path) => {
|
|
36
36
|
const database = await openFile(path);
|
|
37
37
|
try {
|
|
@@ -44,12 +44,12 @@ var openCache = /* @__PURE__ */ __name(async (path) => {
|
|
|
44
44
|
}, "openCache");
|
|
45
45
|
var openFile = /* @__PURE__ */ __name((path) => "Bun" in globalThis ? openUnderBun(path) : openUnderNode(path), "openFile");
|
|
46
46
|
var openUnderBun = /* @__PURE__ */ __name(async (path) => {
|
|
47
|
-
const { openWithBunSqlite } = await import("./bun-sqlite-
|
|
47
|
+
const { openWithBunSqlite } = await import("./bun-sqlite-AGXGSF6D.js");
|
|
48
48
|
return await openWithBunSqlite(path);
|
|
49
49
|
}, "openUnderBun");
|
|
50
50
|
var openUnderNode = /* @__PURE__ */ __name(async (path) => {
|
|
51
51
|
quietSqliteWarning();
|
|
52
|
-
const { openWithNodeSqlite } = await import("./node-sqlite-
|
|
52
|
+
const { openWithNodeSqlite } = await import("./node-sqlite-RKYSRKEB.js");
|
|
53
53
|
return openWithNodeSqlite(path);
|
|
54
54
|
}, "openUnderNode");
|
|
55
55
|
var runtime = /* @__PURE__ */ __name(() => {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/mcp/bot/instructions.js
|
|
8
8
|
var botInstructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => [
|
|
9
9
|
`The owner's ${name} bot "${profile}", through the official Bot API \u2014 not the owner's personal account. What it writes, people see as the bot.`,
|
|
10
10
|
"Use these tools to read the chats this bot is in, find a message or a person, and \u2014 when the profile allows \u2014 write as the bot.",
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
AUDIT_MIN_SCORE
|
|
5
|
+
} from "./chunk-E4FAMU2S.js";
|
|
6
|
+
import {
|
|
7
|
+
LIST_QUERY_GUIDE,
|
|
8
|
+
nativeTerms
|
|
9
|
+
} from "./chunk-M763RNWP.js";
|
|
10
|
+
import {
|
|
11
|
+
DEFAULT_CONFIG,
|
|
12
|
+
environmentOf,
|
|
13
|
+
itemOf,
|
|
14
|
+
listOf,
|
|
15
|
+
nextStep,
|
|
16
|
+
renderAnswer,
|
|
17
|
+
snakeKeys,
|
|
18
|
+
withAgentLevels
|
|
19
|
+
} from "./chunk-PHXOL5HZ.js";
|
|
20
|
+
import {
|
|
21
|
+
formatReference
|
|
22
|
+
} from "./chunk-GC6FLHZF.js";
|
|
23
|
+
import {
|
|
24
|
+
queryError
|
|
25
|
+
} from "./chunk-LT5KE44Q.js";
|
|
26
|
+
import {
|
|
27
|
+
CliError
|
|
28
|
+
} from "./chunk-BUGROVF3.js";
|
|
29
|
+
import {
|
|
30
|
+
__name
|
|
31
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
32
|
+
|
|
33
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/cli/paging.js
|
|
34
|
+
var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
35
|
+
if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
|
|
36
|
+
throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
|
|
37
|
+
return Number(value);
|
|
38
|
+
}, "positiveCount");
|
|
39
|
+
var configuredLimit = /* @__PURE__ */ __name((command, most = Number.POSITIVE_INFINITY) => {
|
|
40
|
+
const { resolveSettings, env } = environmentOf(command);
|
|
41
|
+
const { limit: _typed, ...flags } = command.optsWithGlobals();
|
|
42
|
+
const configured = resolveSettings?.(flags, { needsProfile: false, ...env ? { env } : {} }).limit ?? DEFAULT_CONFIG.defaults.limit;
|
|
43
|
+
return Math.min(configured, most);
|
|
44
|
+
}, "configuredLimit");
|
|
45
|
+
var withPaging = /* @__PURE__ */ __name((command) => command.option("--limit <n>", "how many to show", positiveCount("--limit")).option("--page <n>", "which page, starting at 1", positiveCount("--page")).option("--all", "every row, no paging"), "withPaging");
|
|
46
|
+
var window = /* @__PURE__ */ __name(({ limit, page, all }) => all ? { offset: 0 } : { limit, offset: (page - 1) * limit }, "window");
|
|
47
|
+
var pagingOf = /* @__PURE__ */ __name((command) => {
|
|
48
|
+
const environment = environmentOf(command);
|
|
49
|
+
const flags = command.optsWithGlobals();
|
|
50
|
+
if (!environment.resolveSettings)
|
|
51
|
+
return { limit: flags.limit ?? DEFAULT_CONFIG.defaults.limit, page: flags.page ?? 1 };
|
|
52
|
+
const { limit, page } = environment.resolveSettings(withAgentLevels(command, command.optsWithGlobals()), {
|
|
53
|
+
env: environment.env ?? process.env,
|
|
54
|
+
needsProfile: false,
|
|
55
|
+
readOnly: true
|
|
56
|
+
});
|
|
57
|
+
return { limit: limit ?? DEFAULT_CONFIG.defaults.limit, page: page ?? 1 };
|
|
58
|
+
}, "pagingOf");
|
|
59
|
+
|
|
60
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
|
|
61
|
+
var defined = /* @__PURE__ */ __name((record) => Object.fromEntries(Object.entries(record).filter(([, value]) => value !== void 0)), "defined");
|
|
62
|
+
var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
|
|
63
|
+
var settingsOf = /* @__PURE__ */ __name((settings) => defined({
|
|
64
|
+
all_can_pin: settings.allCanPin,
|
|
65
|
+
only_admins_add: settings.onlyAdminsAdd,
|
|
66
|
+
only_admins_call: settings.onlyAdminsCall,
|
|
67
|
+
only_owner_edits_info: settings.onlyOwnerEditsInfo,
|
|
68
|
+
members_see_link: settings.membersSeeLink,
|
|
69
|
+
join_approval: settings.joinApproval,
|
|
70
|
+
only_admins_send: settings.onlyAdminsSend,
|
|
71
|
+
only_admins_edit_info: settings.onlyAdminsEditInfo,
|
|
72
|
+
disappearing_seconds: settings.disappearingSeconds
|
|
73
|
+
}), "settingsOf");
|
|
74
|
+
var chatAnswer = /* @__PURE__ */ __name((account, chat) => defined({
|
|
75
|
+
ref: chatRef(account, chat.id),
|
|
76
|
+
id: chat.id,
|
|
77
|
+
title: chat.title,
|
|
78
|
+
kind: chat.kind,
|
|
79
|
+
unread_count: chat.unreadCount,
|
|
80
|
+
unread_mentions: chat.unreadMentions,
|
|
81
|
+
last_message_at: chat.lastMessageAt,
|
|
82
|
+
participants_count: chat.participantsCount,
|
|
83
|
+
muted: chat.muted,
|
|
84
|
+
muted_until: chat.mutedUntil ?? void 0,
|
|
85
|
+
archived: chat.archived,
|
|
86
|
+
marked_unread: chat.markedUnread,
|
|
87
|
+
membership_state: chat.membershipState,
|
|
88
|
+
parent_chat_id: chat.parentChatId ?? void 0,
|
|
89
|
+
scope: chat.scope,
|
|
90
|
+
provider_metadata: chat.providerMetadata,
|
|
91
|
+
description: chat.description,
|
|
92
|
+
invite_link: chat.link,
|
|
93
|
+
settings: chat.settings ? settingsOf(chat.settings) : void 0,
|
|
94
|
+
members: chat.members?.map(memberAnswer)
|
|
95
|
+
}), "chatAnswer");
|
|
96
|
+
var memberAnswer = /* @__PURE__ */ __name((member) => {
|
|
97
|
+
const group = member;
|
|
98
|
+
return defined({
|
|
99
|
+
id: member.id,
|
|
100
|
+
name: member.name,
|
|
101
|
+
username: member.username,
|
|
102
|
+
role: group.role,
|
|
103
|
+
last_seen_at: group.lastSeenAt,
|
|
104
|
+
registered_at: group.registeredAt,
|
|
105
|
+
joined_at: group.joinedAt,
|
|
106
|
+
invited_by: group.invitedBy,
|
|
107
|
+
is_bot: group.isBot,
|
|
108
|
+
deleted: group.deleted,
|
|
109
|
+
flagged: group.flagged,
|
|
110
|
+
has_photo: group.hasPhoto,
|
|
111
|
+
score: group.score,
|
|
112
|
+
reasons: group.reasons,
|
|
113
|
+
check: group.check ? snakeKeys(group.check) : void 0
|
|
114
|
+
});
|
|
115
|
+
}, "memberAnswer");
|
|
116
|
+
var contactRef = /* @__PURE__ */ __name((provider, id) => formatReference({ type: "contact", provider, id }), "contactRef");
|
|
117
|
+
var contactAnswer = /* @__PURE__ */ __name((account, contact) => {
|
|
118
|
+
const card = contact;
|
|
119
|
+
return defined({
|
|
120
|
+
ref: contactRef(account.provider, contact.id),
|
|
121
|
+
id: contact.id,
|
|
122
|
+
name: contact.name,
|
|
123
|
+
username: contact.username,
|
|
124
|
+
alias: contact.alias,
|
|
125
|
+
display_name: contact.displayName,
|
|
126
|
+
description: contact.description,
|
|
127
|
+
last_messaged_at: contact.lastMessagedAt,
|
|
128
|
+
chats: card.chats?.map((chat) => ({
|
|
129
|
+
ref: chatRef(account, chat.id),
|
|
130
|
+
id: chat.id,
|
|
131
|
+
title: chat.title,
|
|
132
|
+
kind: chat.kind,
|
|
133
|
+
last_message_at: chat.lastMessageAt
|
|
134
|
+
})),
|
|
135
|
+
notes: card.notes?.map(({ id, text, revision, createdAt, updatedAt }) => ({
|
|
136
|
+
id,
|
|
137
|
+
text,
|
|
138
|
+
revision,
|
|
139
|
+
created_at: createdAt,
|
|
140
|
+
updated_at: updatedAt
|
|
141
|
+
}))
|
|
142
|
+
});
|
|
143
|
+
}, "contactAnswer");
|
|
144
|
+
var contactShown = /* @__PURE__ */ __name((account, card, profile) => {
|
|
145
|
+
const { id: _id, name: _name, bio, chats, ...facts } = profile;
|
|
146
|
+
const listed = new Map(card.chats.map((chat) => [chat.id, chat]));
|
|
147
|
+
const active = new Set(chats.map(({ id }) => id));
|
|
148
|
+
const shared = [
|
|
149
|
+
...chats.map((chat) => ({
|
|
150
|
+
ref: chatRef(account, chat.id),
|
|
151
|
+
id: chat.id,
|
|
152
|
+
title: chat.title,
|
|
153
|
+
kind: chat.kind,
|
|
154
|
+
last_message_at: listed.get(chat.id)?.lastMessageAt ?? chat.lastAt,
|
|
155
|
+
their_messages: chat.theirMessages,
|
|
156
|
+
first_at: chat.firstAt,
|
|
157
|
+
last_at: chat.lastAt,
|
|
158
|
+
complete: chat.complete
|
|
159
|
+
})),
|
|
160
|
+
...card.chats.filter(({ id }) => !active.has(id)).map((chat) => ({
|
|
161
|
+
ref: chatRef(account, chat.id),
|
|
162
|
+
id: chat.id,
|
|
163
|
+
title: chat.title,
|
|
164
|
+
kind: chat.kind,
|
|
165
|
+
last_message_at: chat.lastMessageAt
|
|
166
|
+
}))
|
|
167
|
+
];
|
|
168
|
+
const answer = contactAnswer(account, card);
|
|
169
|
+
return {
|
|
170
|
+
...answer,
|
|
171
|
+
...snakeKeys(facts),
|
|
172
|
+
description: answer.description ?? bio,
|
|
173
|
+
chats: shared
|
|
174
|
+
};
|
|
175
|
+
}, "contactShown");
|
|
176
|
+
var chatEventAnswer = /* @__PURE__ */ __name((chatId, event) => defined({
|
|
177
|
+
chat_id: chatId,
|
|
178
|
+
time: event.timestamp,
|
|
179
|
+
type: event.event,
|
|
180
|
+
message_id: event.messageId,
|
|
181
|
+
by: event.by,
|
|
182
|
+
people: event.people,
|
|
183
|
+
title: event.title
|
|
184
|
+
}), "chatEventAnswer");
|
|
185
|
+
var HISTORY_TYPES = { joined: "join", left: "leave", changed: "profile" };
|
|
186
|
+
var memberEventAnswer = /* @__PURE__ */ __name((chatId, event) => defined({
|
|
187
|
+
chat_id: chatId,
|
|
188
|
+
time: event.at,
|
|
189
|
+
type: HISTORY_TYPES[event.event],
|
|
190
|
+
by: event.invitedBy === void 0 ? void 0 : { id: event.invitedBy, name: null },
|
|
191
|
+
people: [{ id: event.id, name: event.name, username: event.username }],
|
|
192
|
+
before: event.before ? { name: event.before.name, username: event.before.username } : void 0
|
|
193
|
+
}), "memberEventAnswer");
|
|
194
|
+
var inviteLinkAnswer = /* @__PURE__ */ __name((link) => defined({
|
|
195
|
+
link: link.link,
|
|
196
|
+
approval: link.approval,
|
|
197
|
+
expires_at: link.expiresAt,
|
|
198
|
+
max_uses: link.maxUses,
|
|
199
|
+
primary: link.primary,
|
|
200
|
+
revoked: link.revoked,
|
|
201
|
+
pending_count: link.pending,
|
|
202
|
+
joined_count: link.joined
|
|
203
|
+
}), "inviteLinkAnswer");
|
|
204
|
+
var joinRequestAnswer = /* @__PURE__ */ __name((request) => defined({
|
|
205
|
+
person_id: request.person.id,
|
|
206
|
+
name: request.person.name,
|
|
207
|
+
username: request.person.username,
|
|
208
|
+
requested_at: request.requestedAt,
|
|
209
|
+
about: request.about
|
|
210
|
+
}), "joinRequestAnswer");
|
|
211
|
+
var pollVoteAnswer = /* @__PURE__ */ __name((vote) => ({
|
|
212
|
+
person_id: vote.person.id,
|
|
213
|
+
name: vote.person.name,
|
|
214
|
+
username: vote.person.username,
|
|
215
|
+
answers: vote.answers,
|
|
216
|
+
voted_at: vote.votedAt
|
|
217
|
+
}), "pollVoteAnswer");
|
|
218
|
+
var reactorAnswer = /* @__PURE__ */ __name((reactor) => ({
|
|
219
|
+
person: { id: reactor.person.id, name: reactor.person.name, username: reactor.person.username },
|
|
220
|
+
reaction: reactor.reaction,
|
|
221
|
+
reacted_at: reactor.reactedAt
|
|
222
|
+
}), "reactorAnswer");
|
|
223
|
+
var topicAnswer = /* @__PURE__ */ __name((topic) => defined({
|
|
224
|
+
id: topic.id,
|
|
225
|
+
title: topic.title,
|
|
226
|
+
closed: topic.closed,
|
|
227
|
+
pinned: topic.pinned,
|
|
228
|
+
hidden: topic.hidden,
|
|
229
|
+
unread_count: topic.unreadCount,
|
|
230
|
+
last_message_at: topic.lastMessageAt,
|
|
231
|
+
created_at: topic.createdAt,
|
|
232
|
+
untrusted: ["title"]
|
|
233
|
+
}), "topicAnswer");
|
|
234
|
+
var folderAnswer = /* @__PURE__ */ __name((folder) => {
|
|
235
|
+
const shown = "chats" in folder ? folder : void 0;
|
|
236
|
+
const listed = shown ? void 0 : folder;
|
|
237
|
+
return defined({
|
|
238
|
+
id: folder.id,
|
|
239
|
+
title: folder.title,
|
|
240
|
+
chat_ids: listed ? listed.chatIds : shown?.chats.map((chat) => chat.id) ?? [],
|
|
241
|
+
emoji: folder.emoji,
|
|
242
|
+
include: folder.include,
|
|
243
|
+
skip: folder.skip,
|
|
244
|
+
excluded_chat_ids: listed?.excludedChatIds ?? shown?.excluded.map((chat) => chat.id),
|
|
245
|
+
pinned_chat_ids: listed?.pinnedChatIds ?? shown?.pinned.map((chat) => chat.id),
|
|
246
|
+
chats: shown?.chats,
|
|
247
|
+
pinned_chats: shown?.pinned,
|
|
248
|
+
excluded_chats: shown?.excluded
|
|
249
|
+
});
|
|
250
|
+
}, "folderAnswer");
|
|
251
|
+
var lines = /* @__PURE__ */ __name((line) => (body) => (body.items ?? (body.item === void 0 ? [] : [body.item])).map((item) => `${line(item).trimEnd()}
|
|
252
|
+
`).join(""), "lines");
|
|
253
|
+
var pageOf = /* @__PURE__ */ __name(({ limit, page, all }, { items, hasMore }) => all ? { limit: Math.max(1, items.length), has_more: false, page: 1 } : { limit, has_more: hasMore, page }, "pageOf");
|
|
254
|
+
var wholeList = /* @__PURE__ */ __name((command, items, extra = {}) => listOf(command, { items, limit: Math.max(1, items.length), has_more: false, ...extra }), "wholeList");
|
|
255
|
+
var chatShown = /* @__PURE__ */ __name((account, card) => {
|
|
256
|
+
const listed = card.members?.length;
|
|
257
|
+
const short = listed !== void 0 && card.participantsCount !== null && listed < card.participantsCount;
|
|
258
|
+
return itemOf(chatAnswer(account, card), short ? {
|
|
259
|
+
missing: [
|
|
260
|
+
{
|
|
261
|
+
field: "members",
|
|
262
|
+
why: `${listed} listed; the chat reports ${card.participantsCount} \u2014 the list may omit your account or be partial`,
|
|
263
|
+
step: "chats.members"
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
next: [nextStep("chats.members", { args: { chat: card.id } })]
|
|
267
|
+
} : {});
|
|
268
|
+
}, "chatShown");
|
|
269
|
+
var scoreFloor = /* @__PURE__ */ __name((ast) => {
|
|
270
|
+
const term = nativeTerms(ast, "chats members check").get("score");
|
|
271
|
+
if (!term)
|
|
272
|
+
return AUDIT_MIN_SCORE;
|
|
273
|
+
const upper = term.operator === "range" ? term.upper ?? "*" : term.value;
|
|
274
|
+
if (term.operator !== "range" || upper !== "*")
|
|
275
|
+
queryError("query.unsupported-operator", term.span, "score takes a lower bound: score>=3", {
|
|
276
|
+
command: "chats members check",
|
|
277
|
+
guide: LIST_QUERY_GUIDE
|
|
278
|
+
});
|
|
279
|
+
const floor = Number(term.value);
|
|
280
|
+
return Math.ceil(term.lower_inclusive === false ? floor + 1 : floor);
|
|
281
|
+
}, "scoreFloor");
|
|
282
|
+
var auditAnswer = /* @__PURE__ */ __name((audit) => wholeList("chats members check", audit.items.map(memberAnswer), {
|
|
283
|
+
...audit.more ? { meta: { truncated: true } } : {},
|
|
284
|
+
...audit.completeness && audit.completeness.state !== "complete" ? {
|
|
285
|
+
missing: [
|
|
286
|
+
{
|
|
287
|
+
field: "reasons",
|
|
288
|
+
why: "never_wrote counts only stored messages, and the store does not hold the chat whole",
|
|
289
|
+
...audit.fetch ? { step: "messages.sync" } : {}
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
...audit.fetch ? { next: [nextStep("messages.sync", { args: { chat: audit.chatId } })] } : {}
|
|
293
|
+
} : {}
|
|
294
|
+
}), "auditAnswer");
|
|
295
|
+
var renderItem = /* @__PURE__ */ __name((command, output, value, next = []) => renderAnswer(command, output, itemOf(snakeKeys(value), { next })), "renderItem");
|
|
296
|
+
var withPage = /* @__PURE__ */ __name((command) => command.option("--limit <n>", "how many to show", positiveCount("--limit")).option("--page <n>", "which page, starting at 1", positiveCount("--page")), "withPage");
|
|
297
|
+
var documentLinkAnswer = /* @__PURE__ */ __name(({ url, documentId, title, inStore, locator, sentAt, sender }) => ({
|
|
298
|
+
url,
|
|
299
|
+
document_id: documentId,
|
|
300
|
+
title,
|
|
301
|
+
in_store: inStore,
|
|
302
|
+
ref: locator,
|
|
303
|
+
sent_at: sentAt,
|
|
304
|
+
sender
|
|
305
|
+
}), "documentLinkAnswer");
|
|
306
|
+
var accountAnswer = /* @__PURE__ */ __name((provider, { id, name, username, phone }) => ({
|
|
307
|
+
provider,
|
|
308
|
+
id,
|
|
309
|
+
name,
|
|
310
|
+
username,
|
|
311
|
+
...phone === void 0 ? {} : { phone }
|
|
312
|
+
}), "accountAnswer");
|
|
313
|
+
var sessionAnswer = /* @__PURE__ */ __name(({ current, client, device, location, lastActiveAt, createdAt }) => ({
|
|
314
|
+
current,
|
|
315
|
+
client,
|
|
316
|
+
device,
|
|
317
|
+
location,
|
|
318
|
+
last_active_at: lastActiveAt,
|
|
319
|
+
...createdAt === void 0 ? {} : { created_at: createdAt }
|
|
320
|
+
}), "sessionAnswer");
|
|
321
|
+
|
|
322
|
+
export {
|
|
323
|
+
positiveCount,
|
|
324
|
+
configuredLimit,
|
|
325
|
+
withPaging,
|
|
326
|
+
window,
|
|
327
|
+
pagingOf,
|
|
328
|
+
chatRef,
|
|
329
|
+
chatAnswer,
|
|
330
|
+
memberAnswer,
|
|
331
|
+
contactRef,
|
|
332
|
+
contactAnswer,
|
|
333
|
+
contactShown,
|
|
334
|
+
chatEventAnswer,
|
|
335
|
+
memberEventAnswer,
|
|
336
|
+
inviteLinkAnswer,
|
|
337
|
+
joinRequestAnswer,
|
|
338
|
+
pollVoteAnswer,
|
|
339
|
+
reactorAnswer,
|
|
340
|
+
topicAnswer,
|
|
341
|
+
folderAnswer,
|
|
342
|
+
lines,
|
|
343
|
+
pageOf,
|
|
344
|
+
wholeList,
|
|
345
|
+
chatShown,
|
|
346
|
+
scoreFloor,
|
|
347
|
+
auditAnswer,
|
|
348
|
+
renderItem,
|
|
349
|
+
withPage,
|
|
350
|
+
documentLinkAnswer,
|
|
351
|
+
accountAnswer,
|
|
352
|
+
sessionAnswer
|
|
353
|
+
};
|