@wirecat/notion-cli 0.4.0 → 0.6.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 +58 -0
- package/README.md +5 -0
- package/contracts/wirecat.json +55 -2
- package/dist/bin/notion.js +2 -2
- package/dist/bundle/agent-ILG6AH7S.js +42 -0
- package/dist/bundle/{all-profiles-4IONYZB6.js → all-profiles-AELHUTFU.js} +64 -21
- package/dist/bundle/{anthropic-OXF74J4P.js → anthropic-3CCYAGO3.js} +6 -6
- package/dist/bundle/{app-server-M2VF6ABM.js → app-server-DJ6P4NY4.js} +86 -65
- package/dist/bundle/{bun-DLA6QRLL.js → bun-2FLR4IV4.js} +2 -2
- package/dist/bundle/{bun-sqlite-F4BYLW3F.js → bun-sqlite-QB6CU6TH.js} +7 -7
- package/dist/bundle/chunk-2CMLY2X3.js +72 -0
- package/dist/bundle/{chunk-TZ2QJ53V.js → chunk-2XUV7HNE.js} +2 -2
- package/dist/bundle/{chunk-6JBLIQQN.js → chunk-2Z7UOXFC.js} +1 -1
- package/dist/bundle/{chunk-6GN7KU7X.js → chunk-3LMW7U7F.js} +22 -10
- package/dist/bundle/chunk-3MYN2RMG.js +398 -0
- package/dist/bundle/{chunk-YFWLHTNO.js → chunk-3UX4VJWD.js} +1 -1
- package/dist/bundle/chunk-4HP6KGBI.js +32 -0
- package/dist/bundle/{chunk-4KUJTSHG.js → chunk-4RFR4J2O.js} +2 -2
- package/dist/bundle/{chunk-OCDJ4FFA.js → chunk-4VXXOJ2F.js} +4 -4
- package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
- package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
- package/dist/bundle/{chunk-P3P6DA6K.js → chunk-5OJLUUOJ.js} +6 -6
- package/dist/bundle/{chunk-T5UNSFES.js → chunk-5XPHFV7H.js} +35 -12
- package/dist/bundle/{chunk-KL3P5TQK.js → chunk-6EJCI47L.js} +4 -4
- package/dist/bundle/chunk-6VPC5Z56.js +2145 -0
- package/dist/bundle/{chunk-IJMFG7HB.js → chunk-6YOMPW7Y.js} +10 -8
- package/dist/bundle/{chunk-7NF3V5L2.js → chunk-7JVKQ6NM.js} +4 -4
- package/dist/bundle/chunk-7L2XOKDZ.js +353 -0
- package/dist/bundle/{chunk-TXONV3HW.js → chunk-A42T4YX7.js} +3 -3
- package/dist/bundle/chunk-AE4VW4NB.js +50 -0
- package/dist/bundle/chunk-AV2ZJ4WX.js +7 -0
- package/dist/bundle/{chunk-L6H7PY4X.js → chunk-AZLDR36U.js} +3 -3
- package/dist/bundle/{chunk-TFNRCCGR.js → chunk-BAXNAOOL.js} +4 -4
- package/dist/bundle/{chunk-QX3TPFEX.js → chunk-BEV5LO4D.js} +110 -862
- package/dist/bundle/{chunk-UROEWCOG.js → chunk-BQBC2WIG.js} +1 -65
- package/dist/bundle/{chunk-NO2LIHWA.js → chunk-CFQQTDSA.js} +1 -1
- package/dist/bundle/chunk-CHPWBQUK.js +39 -0
- package/dist/bundle/chunk-CL3YNUCC.js +388 -0
- package/dist/bundle/{chunk-WHJWURZB.js → chunk-DGMTSDKB.js} +6 -6
- package/dist/bundle/{chunk-HTKSCSJU.js → chunk-DHVVXQEL.js} +4 -4
- package/dist/bundle/chunk-DIU2QJJF.js +785 -0
- package/dist/bundle/chunk-DQSOYH6N.js +20 -0
- package/dist/bundle/chunk-ECYOTDJM.js +14 -0
- package/dist/bundle/{chunk-Z53LYX4M.js → chunk-EHW45LLT.js} +3 -3
- package/dist/bundle/{chunk-XCTOCVMW.js → chunk-ERN53B3Z.js} +32 -24
- package/dist/bundle/{chunk-CDGZZNGY.js → chunk-ESZHGC4Q.js} +38 -8
- package/dist/bundle/{chunk-RMJMID5D.js → chunk-EZMG5QXB.js} +8 -8
- package/dist/bundle/chunk-F4BX7TH2.js +15 -0
- package/dist/bundle/{chunk-Y5LAJWR5.js → chunk-F5ZAN7OC.js} +1 -1
- package/dist/bundle/{chunk-2MHMKNWD.js → chunk-FMMYBVCH.js} +1 -1
- package/dist/bundle/{chunk-WZEEEQGC.js → chunk-FRB2L7OE.js} +3 -3
- package/dist/bundle/chunk-FV4WTZCU.js +561 -0
- package/dist/bundle/{chunk-BEPFGITI.js → chunk-G4ZU73SD.js} +101 -80
- package/dist/bundle/{chunk-5XP4KQ2F.js → chunk-GCAJW4SR.js} +1 -1
- package/dist/bundle/{chunk-FEMHUSGO.js → chunk-GPRJXJC7.js} +15 -1
- package/dist/bundle/chunk-GUIQJUJV.js +340 -0
- package/dist/bundle/{chunk-M2EEIYBU.js → chunk-HHEWTLAT.js} +2 -2
- package/dist/bundle/{chunk-LIQMUDIZ.js → chunk-HM6AMYHR.js} +2 -2
- package/dist/bundle/{chunk-TJCPTRYD.js → chunk-HOVHE3A3.js} +7 -7
- package/dist/bundle/{chunk-YAPDU3SV.js → chunk-HVXOA4FO.js} +1 -1
- package/dist/bundle/{chunk-D6RCRBDH.js → chunk-IJVTN5L3.js} +2 -2
- package/dist/bundle/{chunk-CIVXTBJY.js → chunk-IURYZSG3.js} +39 -52
- package/dist/bundle/chunk-JFSVAOA7.js +108 -0
- package/dist/bundle/{chunk-FSJHASRQ.js → chunk-JVESLS7B.js} +611 -572
- package/dist/bundle/chunk-K5IC4FZN.js +36 -0
- package/dist/bundle/chunk-KB35BVTG.js +30 -0
- package/dist/bundle/chunk-KGAUINBO.js +594 -0
- package/dist/bundle/{chunk-AYU5TFDU.js → chunk-KNCPBX5P.js} +85 -76
- package/dist/bundle/{chunk-GSNE7OB4.js → chunk-KZJQPJK5.js} +4 -4
- package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
- package/dist/bundle/{chunk-M6DGZ2O6.js → chunk-LC6WE6JS.js} +9 -9
- package/dist/bundle/{chunk-YGCI3DHS.js → chunk-LECMHK2F.js} +1 -1
- package/dist/bundle/chunk-LQVDFD65.js +72 -0
- package/dist/bundle/chunk-MEYYH47C.js +25 -0
- package/dist/bundle/chunk-NMQRSEZM.js +37 -0
- package/dist/bundle/{chunk-K5I64ZVI.js → chunk-NSR43UEW.js} +7 -64
- package/dist/bundle/{chunk-GK4GLPG2.js → chunk-OEQNP56V.js} +2 -100
- package/dist/bundle/{chunk-MGUEZYFA.js → chunk-OLAGFJDM.js} +13 -2143
- package/dist/bundle/{chunk-MRA62W5K.js → chunk-P27NDZQR.js} +255 -563
- package/dist/bundle/{chunk-GBFEEHQC.js → chunk-PHKED7AG.js} +8 -225
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-JODE2XED.js → chunk-Q7EIL6VU.js} +43 -33
- package/dist/bundle/{chunk-4TQVZXOV.js → chunk-QEJFBORC.js} +3 -3
- package/dist/bundle/{chunk-ZC6ZQQ55.js → chunk-QGGRFRMP.js} +65 -49
- package/dist/bundle/{chunk-JIRRF6BM.js → chunk-RD7BKTWV.js} +4 -4
- package/dist/bundle/chunk-RXU5T5NM.js +714 -0
- package/dist/bundle/{chunk-MVA5HVKL.js → chunk-S4UUN6LD.js} +18 -0
- package/dist/bundle/{chunk-7NGFGFE5.js → chunk-SAPP2LEH.js} +10 -10
- package/dist/bundle/{chunk-COH7OEER.js → chunk-SEAGUFBX.js} +12 -12
- package/dist/bundle/{chunk-5LBJNTEJ.js → chunk-STTO2MSY.js} +43 -64
- package/dist/bundle/{chunk-5UA2TYMI.js → chunk-T37TAXVL.js} +2 -2
- package/dist/bundle/{chunk-R6SDRSZK.js → chunk-T6XIBULH.js} +139 -571
- package/dist/bundle/chunk-TFT4FVRU.js +67 -0
- package/dist/bundle/chunk-TRYYWV7J.js +291 -0
- package/dist/bundle/{chunk-KFVDL2QS.js → chunk-UC7JLE6J.js} +1 -89
- package/dist/bundle/{chunk-SGBS5QCU.js → chunk-UOC52GCB.js} +4 -4
- package/dist/bundle/chunk-UPL474OW.js +94 -0
- package/dist/bundle/chunk-VH7526NL.js +80 -0
- package/dist/bundle/chunk-VNWF4I7E.js +34 -0
- package/dist/bundle/chunk-W2VQDIU5.js +221 -0
- package/dist/bundle/{chunk-EQPAZ33O.js → chunk-WAGADES3.js} +19 -19
- package/dist/bundle/{chunk-WU3XHGOB.js → chunk-WAU5LSHP.js} +81 -438
- package/dist/bundle/{chunk-FIHXADRF.js → chunk-WB2KSQIP.js} +4 -4
- package/dist/bundle/{chunk-OI5DWZJG.js → chunk-WGZH2M64.js} +3 -3
- package/dist/bundle/chunk-WVN2KTNS.js +52 -0
- package/dist/bundle/{chunk-UKE3CGHK.js → chunk-XYQVVW4R.js} +1 -1
- package/dist/bundle/{chunk-7NVPM55S.js → chunk-YDDI4QIT.js} +2203 -1808
- package/dist/bundle/chunk-YHWFF6DN.js +39 -0
- package/dist/bundle/{chunk-7YZPBAQX.js → chunk-YUDVRFXN.js} +1 -1
- package/dist/bundle/{chunk-EY6S7FV3.js → chunk-YXYZAWWW.js} +6 -6
- package/dist/bundle/{chunk-GCCPFKSU.js → chunk-YYQ5GKAI.js} +9532 -10735
- package/dist/bundle/chunk-ZDYEOE7L.js +2366 -0
- package/dist/bundle/command-contract-L2FASWD6.js +41 -0
- package/dist/bundle/{command-server-entry-2SORMVRM.js → command-server-entry-VUR6WL77.js} +30 -27
- package/dist/bundle/{decode-5O7IEFPN.js → decode-I64PF2RM.js} +6 -6
- package/dist/bundle/{definitions-M3U4UYHN.js → definitions-MB65223J.js} +72 -18
- package/dist/bundle/{dispatch-YHQX6FEJ.js → dispatch-JQBAZWCL.js} +8 -8
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-ARLMVQC7.js → echarts-YRRVLEX3.js} +2 -2
- package/dist/bundle/{embed-FUDUKQ3K.js → embed-BLXLKMK2.js} +7 -7
- package/dist/bundle/{embedder-HDRV7GX3.js → embedder-JYGF6R7I.js} +10 -10
- package/dist/bundle/{failure-JHXICWIL.js → failure-I6AAF5R5.js} +3 -3
- package/dist/bundle/first-run-YLDOZGY6.js +29 -0
- package/dist/bundle/first-screen-GZH3LMLZ.js +41 -0
- package/dist/bundle/hast-util-from-html-X2DCPS3T.js +10531 -0
- package/dist/bundle/hast-util-to-html-IIFHILP5.js +998 -0
- package/dist/bundle/hast-util-to-mdast-3CSMIWK2.js +2272 -0
- package/dist/bundle/{instructions-MEFIKCDI.js → instructions-AG7SRWTR.js} +1 -1
- package/dist/bundle/{mcp-VMS6PBCU.js → mcp-YGOAUNC3.js} +2 -2
- package/dist/bundle/{mdast-util-from-markdown-R66F4HZA.js → mdast-util-from-markdown-XCR5KW5S.js} +138 -195
- package/dist/bundle/{mdast-util-gfm-LN2ELINH.js → mdast-util-gfm-JO7PHUIB.js} +28 -357
- package/dist/bundle/mdast-util-to-hast-AYJV7KAE.js +879 -0
- package/dist/bundle/mdast-util-to-markdown-DOXGHRI7.js +1854 -0
- package/dist/bundle/meeting-combined-OFQSGKBG.js +25 -0
- package/dist/bundle/meeting-model-K6NSX3O5.js +27 -0
- package/dist/bundle/{meeting-semantic-R4CSLVRG.js → meeting-semantic-3DZPHM7L.js} +7 -7
- package/dist/bundle/{micromark-extension-gfm-5X7YT43T.js → micromark-extension-gfm-PQ7DWZM7.js} +12 -78
- package/dist/bundle/{node-MAQALPLA.js → node-GJQYN4FT.js} +2 -2
- package/dist/bundle/{node-sqlite-J7IJYNBO.js → node-sqlite-7VXIRQPH.js} +8 -8
- package/dist/bundle/notes-search-ACDOPTNH.js +64 -0
- package/dist/bundle/notion.js +14 -14
- package/dist/bundle/oauth-N67CH2TK.js +20 -0
- package/dist/bundle/{open-AB27MTGR.js → open-JGXVHIKO.js} +6 -6
- package/dist/bundle/{openai-D77MU5XV.js → openai-PFQJTF4H.js} +21 -18
- package/dist/bundle/{process-SIOWTRJ6.js → process-MEKCZMX3.js} +1 -1
- package/dist/bundle/{program-7K34KI27.js → program-DUJYLJH5.js} +6947 -6532
- package/dist/bundle/{prompt-W77YDHA6.js → prompt-FW44QDHD.js} +6 -6
- package/dist/bundle/{recognize-3JAXQQ36.js → recognize-62TDQ6A7.js} +5 -5
- package/dist/bundle/{remote-PSOJXCXO.js → remote-7ONFD7GG.js} +12 -11
- package/dist/bundle/{rerank-EE44ZTGL.js → rerank-YOHQQJS4.js} +8 -8
- package/dist/bundle/{schemas-LBYUMBC6.js → schemas-IIGJ7DOP.js} +39 -60
- package/dist/bundle/{serve-XJMGAMFW.js → serve-ZCXGT5RB.js} +11 -11
- package/dist/bundle/{server-ASU6CP5R.js → server-RQ74M637.js} +78 -56
- package/dist/bundle/server-XMZF57WM.js +90 -0
- package/dist/bundle/{services-PT4PA4J6.js → services-FWBRZ57M.js} +105 -90
- package/dist/bundle/{sqlite-runtime-YHXRTVXE.js → sqlite-runtime-ZZBNGV5L.js} +7 -7
- package/dist/bundle/{state-T6ZKFWGD.js → state-GDDFO62Y.js} +7 -7
- package/dist/bundle/{store-E5EE25FY.js → store-D2LRIWEI.js} +24 -20
- package/dist/bundle/{store-3MUCZEI3.js → store-KQCLR57N.js} +32 -18
- package/dist/bundle/store-maintenance-command-CK2MU5M6.js +77 -0
- package/dist/bundle/surface-K4TPIQW7.js +76 -0
- package/dist/commands/account.d.ts +3 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +22 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/api.d.ts +7 -2
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/api.js +19 -119
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/library.d.ts.map +1 -1
- package/dist/commands/library.js +16 -5
- package/dist/commands/library.js.map +1 -1
- package/dist/config.d.ts +11 -13
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +63 -54
- package/dist/config.js.map +1 -1
- package/dist/generated/definitions.d.ts.map +1 -1
- package/dist/generated/definitions.js +72 -18
- package/dist/generated/definitions.js.map +1 -1
- package/dist/generated/manifest.d.ts +4 -1
- package/dist/generated/manifest.d.ts.map +1 -1
- package/dist/generated/manifest.js +69 -0
- package/dist/generated/manifest.js.map +1 -1
- package/dist/generated/schemas.d.ts.map +1 -1
- package/dist/generated/schemas.js +32 -32
- package/dist/generated/schemas.js.map +1 -1
- package/dist/generated/types.d.ts +125 -25
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/knowledge.d.ts +1 -0
- package/dist/knowledge.d.ts.map +1 -1
- package/dist/knowledge.js +68 -2
- package/dist/knowledge.js.map +1 -1
- package/dist/library.d.ts +12 -1
- package/dist/library.d.ts.map +1 -1
- package/dist/library.js +35 -1
- package/dist/library.js.map +1 -1
- package/dist/notion/port.d.ts.map +1 -1
- package/dist/notion/port.js +1 -0
- package/dist/notion/port.js.map +1 -1
- package/dist/notion/reads.d.ts +13 -1
- package/dist/notion/reads.d.ts.map +1 -1
- package/dist/notion/reads.js +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +19 -2
- package/dist/program.js.map +1 -1
- package/dist/sync/files.d.ts +19 -0
- package/dist/sync/files.d.ts.map +1 -1
- package/dist/sync/files.js.map +1 -1
- package/dist/sync/source.d.ts +1 -1
- package/dist/sync/source.d.ts.map +1 -1
- package/dist/sync/source.js +60 -55
- package/dist/sync/source.js.map +1 -1
- package/dist/sync/users.d.ts +22 -0
- package/dist/sync/users.d.ts.map +1 -0
- package/dist/sync/users.js +111 -0
- package/dist/sync/users.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/dist/bundle/chunk-L62XTC7N.js +0 -726
- package/dist/bundle/chunk-SHTHNBHG.js +0 -2
- package/dist/bundle/command-contract-UBXS6NHI.js +0 -38
- package/dist/bundle/first-run-BGEFTXOE.js +0 -29
- package/dist/bundle/first-screen-F5F3VS6Y.js +0 -38
- package/dist/bundle/meeting-combined-HNSS3FQY.js +0 -24
- package/dist/bundle/meeting-model-REZVYGQW.js +0 -26
- package/dist/bundle/oauth-AMV4YGJD.js +0 -20
- package/dist/bundle/server-WSPQ5EOA.js +0 -72
- package/dist/bundle/store-maintenance-command-ZZ55BBBG.js +0 -63
|
@@ -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.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/cli/stdin-field.js
|
|
8
8
|
var fields = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
var readsStdin = /* @__PURE__ */ __name((command, field) => {
|
|
10
10
|
fields.set(command, field);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
CliError,
|
|
5
|
+
errorCodes
|
|
6
|
+
} from "./chunk-HM6AMYHR.js";
|
|
7
|
+
import {
|
|
8
|
+
__name
|
|
9
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
10
|
+
|
|
11
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/errors/failures.js
|
|
12
|
+
var isCliFailure = /* @__PURE__ */ __name((value) => value instanceof Error && value.name === "CliError" && errorCodes.includes(value.code), "isCliFailure");
|
|
13
|
+
var isCommanderFailure = /* @__PURE__ */ __name((value) => {
|
|
14
|
+
const { code, exitCode } = value ?? {};
|
|
15
|
+
return value instanceof Error && typeof code === "string" && code.startsWith("commander.") && typeof exitCode === "number";
|
|
16
|
+
}, "isCommanderFailure");
|
|
17
|
+
var USAGE_REASONS = {
|
|
18
|
+
"commander.unknownCommand": "usage.unknown-command",
|
|
19
|
+
"commander.unknownOption": "usage.unknown-option"
|
|
20
|
+
};
|
|
21
|
+
var usageReason = /* @__PURE__ */ __name((code) => USAGE_REASONS[code], "usageReason");
|
|
22
|
+
var failureKey = /* @__PURE__ */ __name((error) => isCliFailure(error) ? error.code : error instanceof Error ? error.name : "error", "failureKey");
|
|
23
|
+
var SQLITE_CORRUPT = 11;
|
|
24
|
+
var SQLITE_NOTADB = 26;
|
|
25
|
+
var DAMAGED_TEXT = /database disk image is malformed|file is not a database|fts5: corruption/i;
|
|
26
|
+
var sqliteCode = /* @__PURE__ */ __name((error) => {
|
|
27
|
+
const { errcode, errno, name } = error ?? {};
|
|
28
|
+
const code = typeof errcode === "number" ? errcode : name === "SQLiteError" && typeof errno === "number" ? errno : null;
|
|
29
|
+
return code === null ? void 0 : code & 255;
|
|
30
|
+
}, "sqliteCode");
|
|
31
|
+
var damageIn = /* @__PURE__ */ __name((error) => {
|
|
32
|
+
if (isCliFailure(error) || isCommanderFailure(error))
|
|
33
|
+
return void 0;
|
|
34
|
+
let at = error;
|
|
35
|
+
for (let depth = 0; depth < 5 && at instanceof Error; depth += 1) {
|
|
36
|
+
const code = sqliteCode(at);
|
|
37
|
+
if (code !== void 0 && [SQLITE_CORRUPT, SQLITE_NOTADB].includes(code) || DAMAGED_TEXT.test(at.message))
|
|
38
|
+
return at;
|
|
39
|
+
at = at.cause;
|
|
40
|
+
}
|
|
41
|
+
return void 0;
|
|
42
|
+
}, "damageIn");
|
|
43
|
+
var wrapping = /* @__PURE__ */ __name((error, original) => {
|
|
44
|
+
Object.defineProperty(error, "cause", { value: original, configurable: true, writable: true });
|
|
45
|
+
if (original instanceof Error && original.stack)
|
|
46
|
+
error.stack = original.stack;
|
|
47
|
+
return error;
|
|
48
|
+
}, "wrapping");
|
|
49
|
+
var storeDamaged = /* @__PURE__ */ __name((error, next) => damageIn(error) ? wrapping(new CliError("configuration_error", `the store file is damaged${next ? `; \`${next}\` says what is damaged and what to do` : ""}`, { reason: "store.damaged" }), error) : error, "storeDamaged");
|
|
50
|
+
var damagedFile = /* @__PURE__ */ __name(async (files, work) => {
|
|
51
|
+
try {
|
|
52
|
+
return await work();
|
|
53
|
+
} catch (error) {
|
|
54
|
+
if (!damageIn(error))
|
|
55
|
+
throw error;
|
|
56
|
+
throw wrapping(new CliError("validation_error", `${files.join(" or ")} is damaged or not a database`, {
|
|
57
|
+
reason: "store.file-damaged"
|
|
58
|
+
}), error);
|
|
59
|
+
}
|
|
60
|
+
}, "damagedFile");
|
|
61
|
+
var isStoreDamage = /* @__PURE__ */ __name((error) => damageIn(error) !== void 0, "isStoreDamage");
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
isCliFailure,
|
|
65
|
+
isCommanderFailure,
|
|
66
|
+
usageReason,
|
|
67
|
+
failureKey,
|
|
68
|
+
sqliteCode,
|
|
69
|
+
storeDamaged,
|
|
70
|
+
damagedFile,
|
|
71
|
+
isStoreDamage
|
|
72
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
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/ccount@2.0.1/node_modules/ccount/index.js
|
|
8
|
+
function ccount(value, character) {
|
|
9
|
+
const source = String(value);
|
|
10
|
+
if (typeof character !== "string") {
|
|
11
|
+
throw new TypeError("Expected character");
|
|
12
|
+
}
|
|
13
|
+
let count = 0;
|
|
14
|
+
let index = source.indexOf(character);
|
|
15
|
+
while (index !== -1) {
|
|
16
|
+
count++;
|
|
17
|
+
index = source.indexOf(character, index + character.length);
|
|
18
|
+
}
|
|
19
|
+
return count;
|
|
20
|
+
}
|
|
21
|
+
__name(ccount, "ccount");
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
ccount
|
|
25
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
convert
|
|
5
|
+
} from "./chunk-TRYYWV7J.js";
|
|
6
|
+
|
|
7
|
+
// node_modules/.pnpm/mdast-util-phrasing@4.1.0/node_modules/mdast-util-phrasing/lib/index.js
|
|
8
|
+
var phrasing = (
|
|
9
|
+
/** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */
|
|
10
|
+
convert([
|
|
11
|
+
"break",
|
|
12
|
+
"delete",
|
|
13
|
+
"emphasis",
|
|
14
|
+
// To do: next major: removed since footnotes were added to GFM.
|
|
15
|
+
"footnote",
|
|
16
|
+
"footnoteReference",
|
|
17
|
+
"image",
|
|
18
|
+
"imageReference",
|
|
19
|
+
"inlineCode",
|
|
20
|
+
// Enabled by `mdast-util-math`:
|
|
21
|
+
"inlineMath",
|
|
22
|
+
"link",
|
|
23
|
+
"linkReference",
|
|
24
|
+
// Enabled by `mdast-util-mdx`:
|
|
25
|
+
"mdxJsxTextElement",
|
|
26
|
+
// Enabled by `mdast-util-mdx`:
|
|
27
|
+
"mdxTextExpression",
|
|
28
|
+
"strong",
|
|
29
|
+
"text",
|
|
30
|
+
// Enabled by `mdast-util-directive`:
|
|
31
|
+
"textDirective"
|
|
32
|
+
])
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
phrasing
|
|
37
|
+
};
|
|
@@ -1,74 +1,23 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
onThisComputer
|
|
7
|
-
} from "./chunk-WZEEEQGC.js";
|
|
4
|
+
refuseModelAddress
|
|
5
|
+
} from "./chunk-2CMLY2X3.js";
|
|
8
6
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
writeSharedSection
|
|
12
|
-
} from "./chunk-TJCPTRYD.js";
|
|
7
|
+
onThisComputer
|
|
8
|
+
} from "./chunk-FRB2L7OE.js";
|
|
13
9
|
import {
|
|
14
10
|
unit
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
storePath
|
|
18
|
-
} from "./chunk-M2EEIYBU.js";
|
|
19
|
-
import {
|
|
20
|
-
boolean,
|
|
21
|
-
isoTimestamp,
|
|
22
|
-
pipe,
|
|
23
|
-
safeParse,
|
|
24
|
-
strictObject,
|
|
25
|
-
string
|
|
26
|
-
} from "./chunk-MVA5HVKL.js";
|
|
11
|
+
} from "./chunk-STTO2MSY.js";
|
|
27
12
|
import {
|
|
28
13
|
CliError
|
|
29
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HM6AMYHR.js";
|
|
30
15
|
import {
|
|
31
16
|
__name
|
|
32
17
|
} from "./chunk-ZVVMGPBJ.js";
|
|
33
18
|
|
|
34
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
|
|
35
20
|
import { setTimeout } from "node:timers/promises";
|
|
36
|
-
|
|
37
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.680.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_620ac9b386657c249f5c9038159a7caa/node_modules/@wirecat/cli-core/dist/models/local-only.js
|
|
38
|
-
var SECTION = "local_only";
|
|
39
|
-
var Setting = strictObject({
|
|
40
|
-
on: boolean(),
|
|
41
|
-
at: pipe(string(), isoTimestamp())
|
|
42
|
-
});
|
|
43
|
-
var pathOf = /* @__PURE__ */ __name((env) => sharedConfigPath(storePath(env), env), "pathOf");
|
|
44
|
-
var readLocalOnly = /* @__PURE__ */ __name((env) => {
|
|
45
|
-
const section = readSharedSection(pathOf(env), SECTION);
|
|
46
|
-
if (section === void 0 || section === null)
|
|
47
|
-
return void 0;
|
|
48
|
-
const checked = safeParse(Setting, section);
|
|
49
|
-
return checked.success ? checked.output : { on: true, at: (/* @__PURE__ */ new Date(0)).toISOString() };
|
|
50
|
-
}, "readLocalOnly");
|
|
51
|
-
var localOnly = /* @__PURE__ */ __name((env) => readLocalOnly(env)?.on === true, "localOnly");
|
|
52
|
-
var writeLocalOnly = /* @__PURE__ */ __name((env, on) => writeSharedSection(pathOf(env), SECTION, on ? { on: true, at: (/* @__PURE__ */ new Date()).toISOString() } : void 0), "writeLocalOnly");
|
|
53
|
-
var localOnlyRefusal = /* @__PURE__ */ __name((what, where) => new CliError("permission_error", `local only is on: ${what} would go to ${where}, which is not this computer; nothing was sent. Choose a model on this computer, or turn local only off with \`models local-only set off\``, { reason: "local-only.refused" }), "localOnlyRefusal");
|
|
54
|
-
var refuseOffComputer = /* @__PURE__ */ __name((env, address, what) => {
|
|
55
|
-
if (!onThisComputer(address) && localOnly(env))
|
|
56
|
-
throw localOnlyRefusal(what, hostOf(address));
|
|
57
|
-
}, "refuseOffComputer");
|
|
58
|
-
var hostOf = /* @__PURE__ */ __name((address) => {
|
|
59
|
-
try {
|
|
60
|
-
return new URL(address).host;
|
|
61
|
-
} catch {
|
|
62
|
-
return address;
|
|
63
|
-
}
|
|
64
|
-
}, "hostOf");
|
|
65
|
-
var refuseModelAddress = /* @__PURE__ */ __name((env, address, what) => {
|
|
66
|
-
if (!modelAddressAllowed(address))
|
|
67
|
-
throw new CliError("validation_error", PLAIN_HTTP_REFUSED, { reason: "model.address-refused" });
|
|
68
|
-
refuseOffComputer(env, address, what);
|
|
69
|
-
}, "refuseModelAddress");
|
|
70
|
-
|
|
71
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.680.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_620ac9b386657c249f5c9038159a7caa/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
|
|
72
21
|
var OPENAI_URL = "https://api.openai.com/v1";
|
|
73
22
|
var OPENAI_MODELS = {
|
|
74
23
|
"text-embedding-3-small": { dims: 1536, perMillion: 0.02 },
|
|
@@ -169,12 +118,6 @@ var errorCode = /* @__PURE__ */ __name(async (response) => {
|
|
|
169
118
|
}, "errorCode");
|
|
170
119
|
|
|
171
120
|
export {
|
|
172
|
-
readLocalOnly,
|
|
173
|
-
localOnly,
|
|
174
|
-
writeLocalOnly,
|
|
175
|
-
localOnlyRefusal,
|
|
176
|
-
refuseOffComputer,
|
|
177
|
-
refuseModelAddress,
|
|
178
121
|
OPENAI_URL,
|
|
179
122
|
OPENAI_MODELS,
|
|
180
123
|
DEFAULT_OPENAI_MODEL,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
CLIENT_INFO_META_KEY,
|
|
5
4
|
DEFAULT_MAX_SUBSCRIPTIONS,
|
|
6
5
|
McpServer,
|
|
7
6
|
ProtocolErrorCode,
|
|
@@ -24,12 +23,7 @@ import {
|
|
|
24
23
|
serverIdentityOf,
|
|
25
24
|
setNegotiatedProtocolVersion,
|
|
26
25
|
validateEnvelopeMeta
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import {
|
|
29
|
-
agentOf,
|
|
30
|
-
clientHash,
|
|
31
|
-
currentCaller
|
|
32
|
-
} from "./chunk-IJMFG7HB.js";
|
|
26
|
+
} from "./chunk-PL5P7UKW.js";
|
|
33
27
|
import {
|
|
34
28
|
__name
|
|
35
29
|
} from "./chunk-ZVVMGPBJ.js";
|
|
@@ -541,95 +535,7 @@ function toError(value) {
|
|
|
541
535
|
}
|
|
542
536
|
__name(toError, "toError");
|
|
543
537
|
|
|
544
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
545
|
-
var callingAgent = /* @__PURE__ */ __name((fallback, caller = currentCaller()) => {
|
|
546
|
-
const client = caller?.agent?.client?.name;
|
|
547
|
-
if (client && client !== "unknown")
|
|
548
|
-
return client;
|
|
549
|
-
const kind = caller?.agent?.kind;
|
|
550
|
-
return kind && kind !== "mcp-client" ? kind : fallback;
|
|
551
|
-
}, "callingAgent");
|
|
552
|
-
var CALLER_META_KEY = "wirecat.dev/caller";
|
|
553
|
-
var PROXY_CLIENT_NAME = "all-profiles";
|
|
554
|
-
var NAME = /^[\w .@()/+-]{1,64}$/;
|
|
555
|
-
var plain = /* @__PURE__ */ __name((value) => typeof value === "string" && NAME.test(value.trim()) ? value.trim() : void 0, "plain");
|
|
556
|
-
var clientFrom = /* @__PURE__ */ __name((value) => {
|
|
557
|
-
if (!value || typeof value !== "object")
|
|
558
|
-
return void 0;
|
|
559
|
-
const { name, version } = value;
|
|
560
|
-
const named = plain(name);
|
|
561
|
-
if (!named)
|
|
562
|
-
return void 0;
|
|
563
|
-
const versioned = plain(version);
|
|
564
|
-
return { name: named, ...versioned ? { version: versioned } : {} };
|
|
565
|
-
}, "clientFrom");
|
|
566
|
-
var callerOf = /* @__PURE__ */ __name((ctx, tool, source) => {
|
|
567
|
-
const meta = ctx?.mcpReq?._meta;
|
|
568
|
-
const requestId = ctx?.mcpReq?.id;
|
|
569
|
-
const initialized = source.client?.();
|
|
570
|
-
const proxied = initialized?.name === PROXY_CLIENT_NAME && !ctx?.http ? passedOn(meta?.[CALLER_META_KEY], tool) : void 0;
|
|
571
|
-
if (proxied)
|
|
572
|
-
return proxied;
|
|
573
|
-
const client = clientFrom(meta?.[CLIENT_INFO_META_KEY]) ?? clientFrom(initialized);
|
|
574
|
-
const mcp = /* @__PURE__ */ __name((connection) => ({
|
|
575
|
-
tool,
|
|
576
|
-
...requestId === void 0 ? {} : { request_id: String(requestId) },
|
|
577
|
-
...connection ? { connection_id: connection } : {}
|
|
578
|
-
}), "mcp");
|
|
579
|
-
const auth = ctx?.http?.authInfo;
|
|
580
|
-
if (auth) {
|
|
581
|
-
const registered = plain(auth.extra?.clientName);
|
|
582
|
-
return {
|
|
583
|
-
via: "mcp-http",
|
|
584
|
-
agent: {
|
|
585
|
-
kind: "mcp-client",
|
|
586
|
-
session_id: ctx?.sessionId ?? null,
|
|
587
|
-
client: {
|
|
588
|
-
name: registered ?? client?.name ?? "unknown",
|
|
589
|
-
...client?.version ? { version: client.version } : {},
|
|
590
|
-
id: clientHash(auth.clientId)
|
|
591
|
-
}
|
|
592
|
-
},
|
|
593
|
-
mcp: mcp(ctx?.sessionId)
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
const agent = agentOf(source.env) ?? { kind: "mcp-client", session_id: null };
|
|
597
|
-
return { via: "mcp-stdio", agent: { ...agent, ...client ? { client } : {} }, mcp: mcp(source.connectionId) };
|
|
598
|
-
}, "callerOf");
|
|
599
|
-
var passedOn = /* @__PURE__ */ __name((value, tool) => {
|
|
600
|
-
if (!value || typeof value !== "object")
|
|
601
|
-
return void 0;
|
|
602
|
-
const { via, agent, mcp } = value;
|
|
603
|
-
if (via !== "mcp-stdio" && via !== "mcp-http")
|
|
604
|
-
return void 0;
|
|
605
|
-
const a = agent && typeof agent === "object" ? agent : void 0;
|
|
606
|
-
const kind = plain(a?.kind);
|
|
607
|
-
const session = typeof a?.session_id === "string" && /^[A-Za-z0-9._:-]{1,128}$/.test(a.session_id) ? a.session_id : null;
|
|
608
|
-
const client = clientFrom(a?.client);
|
|
609
|
-
const id = a?.client && typeof a.client === "object" ? a.client.id : void 0;
|
|
610
|
-
const m = mcp && typeof mcp === "object" ? mcp : {};
|
|
611
|
-
const request = plain(m.request_id);
|
|
612
|
-
const connection = typeof m.connection_id === "string" && /^[\w-]{1,128}$/.test(m.connection_id) ? m.connection_id : void 0;
|
|
613
|
-
return {
|
|
614
|
-
via,
|
|
615
|
-
...kind ? {
|
|
616
|
-
agent: {
|
|
617
|
-
kind,
|
|
618
|
-
session_id: session,
|
|
619
|
-
...a?.from_chat === true ? { from_chat: true } : {},
|
|
620
|
-
...client ? { client: { ...client, ...typeof id === "string" && /^[0-9a-f]{8}$/.test(id) ? { id } : {} } } : {}
|
|
621
|
-
}
|
|
622
|
-
} : {},
|
|
623
|
-
mcp: {
|
|
624
|
-
tool,
|
|
625
|
-
...request ? { request_id: request } : {},
|
|
626
|
-
...connection ? { connection_id: connection } : {},
|
|
627
|
-
proxied: true
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
}, "passedOn");
|
|
631
|
-
|
|
632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.680.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_620ac9b386657c249f5c9038159a7caa/node_modules/@wirecat/cli-core/dist/mcp/stdio-wire.js
|
|
538
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/mcp/stdio-wire.js
|
|
633
539
|
import { PassThrough, Writable } from "node:stream";
|
|
634
540
|
var lineReader = /* @__PURE__ */ __name((onMessage) => {
|
|
635
541
|
let rest = "";
|
|
@@ -723,9 +629,5 @@ var answeredWire = /* @__PURE__ */ __name((source, sink) => {
|
|
|
723
629
|
export {
|
|
724
630
|
StdioServerTransport,
|
|
725
631
|
serveStdio,
|
|
726
|
-
callingAgent,
|
|
727
|
-
CALLER_META_KEY,
|
|
728
|
-
PROXY_CLIENT_NAME,
|
|
729
|
-
callerOf,
|
|
730
632
|
answeredWire
|
|
731
633
|
};
|