@wirecat/attio-cli 0.9.0 → 0.11.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 +23 -0
- package/contracts/wirecat.json +1 -0
- package/dist/bin/attio.js +11 -11
- package/dist/bundle/attio.js +5 -166
- package/dist/bundle/{chunk-6E5QWCBK.js → chunk-OFEXB726.js} +2 -1
- package/dist/bundle/chunk-TQAECZFO.js +13 -0
- package/dist/bundle/{definitions-FODOIPM2.js → definitions-J73IBAHT.js} +1 -1
- package/dist/bundle/program-4R7RYWV3.js +6210 -0
- package/dist/bundle/{schemas-YGSTNU6F.js → schemas-G3HFAS45.js} +576 -29
- package/dist/commands/api.js +1 -2
- package/dist/commands/crm.js +12 -4
- package/dist/commands/schedule.js +1 -1
- package/dist/commands/session.js +1 -2
- package/dist/config.js +1 -2
- package/dist/context.js +1 -1
- package/dist/identity.js +1 -0
- package/dist/program.js +1 -2
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/activities.d.ts +0 -4
- package/dist/activities.d.ts.map +0 -1
- package/dist/activities.js.map +0 -1
- package/dist/bin/attio.d.ts +0 -3
- package/dist/bin/attio.d.ts.map +0 -1
- package/dist/bin/attio.js.map +0 -1
- package/dist/bundle/agent-C3SZOGZS.js +0 -38
- package/dist/bundle/all-profiles-673VSTRG.js +0 -320
- package/dist/bundle/anthropic-V4RZS5XM.js +0 -91
- package/dist/bundle/app-server-CTEDPA5H.js +0 -249
- package/dist/bundle/bun-F4M4KCNA.js +0 -169
- package/dist/bundle/bun-sqlite-33JTNHCK.js +0 -76
- package/dist/bundle/chunk-2R2EX5I6.js +0 -54
- package/dist/bundle/chunk-5EH7S4RM.js +0 -362
- package/dist/bundle/chunk-5N2V6XO7.js +0 -119
- package/dist/bundle/chunk-5WY6RURV.js +0 -161
- package/dist/bundle/chunk-6V7ZUJI6.js +0 -4072
- package/dist/bundle/chunk-AOKAYQSJ.js +0 -2338
- package/dist/bundle/chunk-AQ5RIOUE.js +0 -633
- package/dist/bundle/chunk-B4DVW2BA.js +0 -185
- package/dist/bundle/chunk-C7JPYWYQ.js +0 -77
- package/dist/bundle/chunk-D72URWJE.js +0 -532
- package/dist/bundle/chunk-DBHZ7TQ7.js +0 -69828
- package/dist/bundle/chunk-DFDN6AUB.js +0 -21
- package/dist/bundle/chunk-DNCLQPOM.js +0 -7
- package/dist/bundle/chunk-DPV53EZC.js +0 -206
- package/dist/bundle/chunk-E2L4R6EI.js +0 -388
- package/dist/bundle/chunk-EDWRHVHD.js +0 -218
- package/dist/bundle/chunk-EH6ZEJGT.js +0 -932
- package/dist/bundle/chunk-EV6B3GHM.js +0 -323
- package/dist/bundle/chunk-FBWECICU.js +0 -259
- package/dist/bundle/chunk-FFER7KJI.js +0 -407
- package/dist/bundle/chunk-FTH6WGYO.js +0 -24
- package/dist/bundle/chunk-G3PK5BZB.js +0 -1222
- package/dist/bundle/chunk-G46PNDWL.js +0 -58
- package/dist/bundle/chunk-G6NY7LFB.js +0 -230
- package/dist/bundle/chunk-GLU36VKA.js +0 -52
- package/dist/bundle/chunk-GZ7WBU5Y.js +0 -18
- package/dist/bundle/chunk-HMYBAVIE.js +0 -86
- package/dist/bundle/chunk-HOJJPSLU.js +0 -288
- package/dist/bundle/chunk-HUAHLO6N.js +0 -29
- package/dist/bundle/chunk-ISQ23VKV.js +0 -123
- package/dist/bundle/chunk-J2LSOG3A.js +0 -12766
- package/dist/bundle/chunk-K5L77R7P.js +0 -66
- package/dist/bundle/chunk-KKRFVN4X.js +0 -1835
- package/dist/bundle/chunk-KLRCTMES.js +0 -100
- package/dist/bundle/chunk-KYRYD4CR.js +0 -38
- package/dist/bundle/chunk-L5QLKUQR.js +0 -794
- package/dist/bundle/chunk-MFSWMNSZ.js +0 -334
- package/dist/bundle/chunk-MYK2F5LD.js +0 -1251
- package/dist/bundle/chunk-NBNQLNVV.js +0 -388
- package/dist/bundle/chunk-O3DZDITT.js +0 -274
- package/dist/bundle/chunk-OEEWVKJX.js +0 -53
- package/dist/bundle/chunk-P5XYQZVW.js +0 -80
- package/dist/bundle/chunk-P6OJKJJS.js +0 -1197
- package/dist/bundle/chunk-P6S3ZRVW.js +0 -106
- package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
- package/dist/bundle/chunk-QBJRK733.js +0 -1068
- package/dist/bundle/chunk-QBYE26ZC.js +0 -131
- package/dist/bundle/chunk-QPPOIWPY.js +0 -1246
- package/dist/bundle/chunk-R2CEA7MK.js +0 -743
- package/dist/bundle/chunk-S4UUN6LD.js +0 -1410
- package/dist/bundle/chunk-S6JG4YUH.js +0 -72
- package/dist/bundle/chunk-SKUY7JDA.js +0 -164
- package/dist/bundle/chunk-T35IOBPJ.js +0 -1341
- package/dist/bundle/chunk-T3W4V4A6.js +0 -63
- package/dist/bundle/chunk-TB3LN5G2.js +0 -50
- package/dist/bundle/chunk-TCT5D2X2.js +0 -6848
- package/dist/bundle/chunk-TES7MB6I.js +0 -82
- package/dist/bundle/chunk-TXDR6YSF.js +0 -23
- package/dist/bundle/chunk-TY7NDMFY.js +0 -46
- package/dist/bundle/chunk-U7UTYALA.js +0 -353
- package/dist/bundle/chunk-UOWHMOU3.js +0 -188
- package/dist/bundle/chunk-UXDUWGX6.js +0 -2791
- package/dist/bundle/chunk-V5I3QHDU.js +0 -558
- package/dist/bundle/chunk-VCDIKCFE.js +0 -1007
- package/dist/bundle/chunk-VJHUMB7U.js +0 -338
- package/dist/bundle/chunk-W4KLHM2K.js +0 -95
- package/dist/bundle/chunk-W5LKEOGN.js +0 -142
- package/dist/bundle/chunk-WLDZWHSF.js +0 -170
- package/dist/bundle/chunk-WQEEYEWO.js +0 -3752
- package/dist/bundle/chunk-WRF6TY63.js +0 -1521
- package/dist/bundle/chunk-WXYOELRI.js +0 -108
- package/dist/bundle/chunk-WZBPUOWM.js +0 -76
- package/dist/bundle/chunk-XGNZD52X.js +0 -592
- package/dist/bundle/chunk-XQUUANA2.js +0 -24600
- package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
- package/dist/bundle/chunk-YQH4J6YZ.js +0 -358
- package/dist/bundle/chunk-Z7Y2I5YR.js +0 -44045
- package/dist/bundle/chunk-ZBCC7MBN.js +0 -9671
- package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
- package/dist/bundle/command-contract-ZL67KMYL.js +0 -37
- package/dist/bundle/command-server-entry-COR2VDRU.js +0 -166
- package/dist/bundle/decode-33SGRQM6.js +0 -297
- package/dist/bundle/dispatch-2FTOHA5D.js +0 -411
- package/dist/bundle/dist-EM7KLEG4.js +0 -7577
- package/dist/bundle/dist-PAKDDIBT.js +0 -191
- package/dist/bundle/echarts-QMAA7HH5.js +0 -42501
- package/dist/bundle/embed-W4ZBXPWD.js +0 -38
- package/dist/bundle/embedder-73CCZC52.js +0 -111
- package/dist/bundle/failure-OHIXWTR6.js +0 -25
- package/dist/bundle/first-run-MOSUMMVX.js +0 -28
- package/dist/bundle/first-screen-GUXBF3SL.js +0 -38
- package/dist/bundle/instructions-4H7UREH2.js +0 -11
- package/dist/bundle/mcp-5HFPWC3W.js +0 -167
- package/dist/bundle/meeting-combined-QMIZOBBJ.js +0 -24
- package/dist/bundle/meeting-model-2UYVGXD5.js +0 -25
- package/dist/bundle/meeting-semantic-LEJPUIN3.js +0 -22
- package/dist/bundle/node-KM3CUABH.js +0 -2340
- package/dist/bundle/node-P3PUHKYH.js +0 -176
- package/dist/bundle/node-TLZSIHIJ.js +0 -21
- package/dist/bundle/node-sqlite-UHPODTKB.js +0 -74
- package/dist/bundle/oauth-T3DWL7OV.js +0 -20
- package/dist/bundle/open-ODWX32PF.js +0 -23
- package/dist/bundle/openai-GSXXHKPX.js +0 -238
- package/dist/bundle/process-AFIXYXWL.js +0 -91
- package/dist/bundle/program-SXSUG335.js +0 -35250
- package/dist/bundle/prompt-GVTYTFK7.js +0 -17
- package/dist/bundle/recognize-XDSZEZP5.js +0 -26
- package/dist/bundle/remote-ZWZKMEY6.js +0 -31
- package/dist/bundle/rerank-OBZQ54NL.js +0 -52
- package/dist/bundle/serve-NY5MUTNW.js +0 -199
- package/dist/bundle/server-JK334V5Y.js +0 -212
- package/dist/bundle/server-VOPYQCUD.js +0 -79
- package/dist/bundle/sqlite-runtime-2NHF4S6G.js +0 -20
- package/dist/bundle/state-YGWZZWPM.js +0 -36
- package/dist/bundle/store-LRQUTFJR.js +0 -306
- package/dist/bundle/store-ND6KU4RI.js +0 -181
- package/dist/bundle/store-maintenance-command-GLYGQM2V.js +0 -66
- package/dist/bundle/surface-P53WLLXP.js +0 -65
- package/dist/commands/api.d.ts +0 -12
- package/dist/commands/api.d.ts.map +0 -1
- package/dist/commands/api.js.map +0 -1
- package/dist/commands/crm.d.ts +0 -7
- package/dist/commands/crm.d.ts.map +0 -1
- package/dist/commands/crm.js.map +0 -1
- package/dist/commands/schedule.d.ts +0 -3
- package/dist/commands/schedule.d.ts.map +0 -1
- package/dist/commands/schedule.js.map +0 -1
- package/dist/commands/session.d.ts +0 -8
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js.map +0 -1
- package/dist/config.d.ts +0 -13
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/context.d.ts +0 -37
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/generated/definitions.d.ts +0 -3
- package/dist/generated/definitions.d.ts.map +0 -1
- package/dist/generated/definitions.js.map +0 -1
- package/dist/generated/manifest.d.ts +0 -6
- package/dist/generated/manifest.d.ts.map +0 -1
- package/dist/generated/manifest.js.map +0 -1
- package/dist/generated/schemas.d.ts +0 -383
- package/dist/generated/schemas.d.ts.map +0 -1
- package/dist/generated/schemas.js.map +0 -1
- package/dist/generated/types.d.ts +0 -10166
- package/dist/generated/types.d.ts.map +0 -1
- package/dist/generated/types.js.map +0 -1
- package/dist/generated/wirecat-config.d.ts +0 -15
- package/dist/generated/wirecat-config.d.ts.map +0 -1
- package/dist/generated/wirecat-config.js.map +0 -1
- package/dist/hooks.d.ts +0 -33
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/identity.d.ts +0 -33
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/links.d.ts +0 -10
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js.map +0 -1
- package/dist/meetings.d.ts +0 -57
- package/dist/meetings.d.ts.map +0 -1
- package/dist/meetings.js.map +0 -1
- package/dist/program.d.ts +0 -6
- package/dist/program.d.ts.map +0 -1
- package/dist/program.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/wcat.d.ts +0 -3
- package/dist/wcat.d.ts.map +0 -1
- package/dist/wcat.js.map +0 -1
package/dist/config.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { commandPermissions, serviceApiOperations, serviceApiPermissions, settingsFor, } from "@wirecat/cli-core
|
|
2
|
-
import { CRM_WRITE_DEFAULTS, CRM_WRITE_KEYS, crmAlsoChecks, crmManifestActivityKeys, crmManifestWriteKeys, } from "@wirecat/cli-core/crm";
|
|
1
|
+
import { CRM_WRITE_DEFAULTS, CRM_WRITE_KEYS, commandPermissions, crmAlsoChecks, crmManifestActivityKeys, crmManifestWriteKeys, serviceApiOperations, serviceApiPermissions, settingsFor, } from "@wirecat/cli-core";
|
|
3
2
|
import { ACTIVITIES } from "./activities.js";
|
|
4
3
|
import * as manifest from "./generated/manifest.js";
|
|
5
4
|
import { SOURCE } from "./generated/wirecat-config.js";
|
package/dist/context.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { baseContext, environmentOf, ProfileTokenStore, refuseOffline, } from "@wirecat/cli-core
|
|
1
|
+
import { baseContext, environmentOf, ProfileTokenStore, refuseOffline, } from "@wirecat/cli-core";
|
|
2
2
|
import { API, configuration } from "./config.js";
|
|
3
3
|
import { IDENTITY } from "./identity.js";
|
|
4
4
|
// Attio allows 100 reads and 25 writes a second (docs.attio.com/rest-api/guides/rate-limiting); half of the writes.
|
package/dist/identity.js
CHANGED
|
@@ -20,6 +20,7 @@ export const DESKTOP = {
|
|
|
20
20
|
hosts: ["api.attio.com", "app.attio.com"],
|
|
21
21
|
tagline: "Attio deals, people and companies for your agent",
|
|
22
22
|
syncs: "your deals and their clients",
|
|
23
|
+
mcpPort: 8759,
|
|
23
24
|
signIn: {
|
|
24
25
|
gives: "Lets your agent read your Attio deals, people and companies and call the Attio API.",
|
|
25
26
|
asks: "An access token: in Attio, Workspace settings → Developers → New access token, with read access to records, " +
|
package/dist/program.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { resolvePaths } from "@wirecat/cli-base";
|
|
3
|
-
import { appDoctorCommand, appMcpCommand, commandsCommand, configCommand, createProgram as createSharedProgram, outputFor, ProfileTokenStore, run as runShared, runsCommand, skillCommand, upgradeCommand, } from "@wirecat/cli-core
|
|
4
|
-
import { appUpdate } from "@wirecat/cli-core/update";
|
|
3
|
+
import { appDoctorCommand, appMcpCommand, appUpdate, commandsCommand, configCommand, createProgram as createSharedProgram, outputFor, ProfileTokenStore, run as runShared, runsCommand, skillCommand, upgradeCommand, } from "@wirecat/cli-core";
|
|
5
4
|
import { apiCommand } from "./commands/api.js";
|
|
6
5
|
import { crmCommands } from "./commands/crm.js";
|
|
7
6
|
import { scheduleCommand } from "./commands/schedule.js";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.11.0";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/attio-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Attio CRM: deals, people and companies for you and your AI agent",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"source:check": "node --experimental-strip-types scripts/source-check.ts"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@wirecat/cli-base": "1.0
|
|
65
|
-
"@wirecat/cli-core": "2.0
|
|
64
|
+
"@wirecat/cli-base": "2.1.0",
|
|
65
|
+
"@wirecat/cli-core": "3.2.0",
|
|
66
66
|
"commander": "15.0.0",
|
|
67
67
|
"valibot": "1.5.0"
|
|
68
68
|
},
|
package/dist/activities.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CrmManifestActivities } from "@wirecat/cli-core/crm";
|
|
2
|
-
/** Notes and tasks, written as `src/hooks.ts` reads them back, so a sync keeps each under the same id. */
|
|
3
|
-
export declare const ACTIVITIES: CrmManifestActivities;
|
|
4
|
-
//# sourceMappingURL=activities.d.ts.map
|
package/dist/activities.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"activities.d.ts","sourceRoot":"","sources":["../src/activities.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAyClE,0GAA0G;AAC1G,eAAO,MAAM,UAAU,EAAE,qBAoDxB,CAAA"}
|
package/dist/activities.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"activities.js","sourceRoot":"","sources":["../src/activities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,OAAO,EAAa,YAAY,EAAa,YAAY,EAAE,MAAM,YAAY,CAAA;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,M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M,IAAI,QAAQ,CAAC,kBAAkB,EAAE,wEAAwE,EAAE;gBAC/G,MAAM,EAAE,eAAe;gBACvB,IAAI,EAAE,KAAK;aACZ,CAAC,CAAA;QACJ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;QACjG,OAAO,YAAY,CAAE,MAAyB,CAAC,IAAI,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;IAC7E,CAAC;CACF,CAAA"}
|
package/dist/bin/attio.d.ts
DELETED
package/dist/bin/attio.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attio.d.ts","sourceRoot":"","sources":["../../src/bin/attio.ts"],"names":[],"mappings":""}
|
package/dist/bin/attio.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attio.js","sourceRoot":"","sources":["../../src/bin/attio.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,kBAAkB,EAAE,CAAA;AACpB,oGAAoG;AACpG,MAAM,YAAY,GAAG,YAAY,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC,CAAA;AACvG,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;AACrC,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;IAC5B,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC;KAAM,CAAC;IACN,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAA;IAC7C,OAAO,CAAC,QAAQ,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AACrD,CAAC;AACD,YAAY,EAAE,CAAA"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
runCommandForAgent,
|
|
5
|
-
toolsFromCommands
|
|
6
|
-
} from "./chunk-WQEEYEWO.js";
|
|
7
|
-
import "./chunk-TB3LN5G2.js";
|
|
8
|
-
import "./chunk-VJHUMB7U.js";
|
|
9
|
-
import "./chunk-WXYOELRI.js";
|
|
10
|
-
import "./chunk-R2CEA7MK.js";
|
|
11
|
-
import "./chunk-HUAHLO6N.js";
|
|
12
|
-
import "./chunk-PL5P7UKW.js";
|
|
13
|
-
import "./chunk-J2LSOG3A.js";
|
|
14
|
-
import "./chunk-5EH7S4RM.js";
|
|
15
|
-
import "./chunk-GLU36VKA.js";
|
|
16
|
-
import "./chunk-MFSWMNSZ.js";
|
|
17
|
-
import "./chunk-T3W4V4A6.js";
|
|
18
|
-
import "./chunk-K5L77R7P.js";
|
|
19
|
-
import "./chunk-P5XYQZVW.js";
|
|
20
|
-
import "./chunk-WRF6TY63.js";
|
|
21
|
-
import "./chunk-SKUY7JDA.js";
|
|
22
|
-
import "./chunk-XGNZD52X.js";
|
|
23
|
-
import "./chunk-6V7ZUJI6.js";
|
|
24
|
-
import "./chunk-DNCLQPOM.js";
|
|
25
|
-
import "./chunk-NBNQLNVV.js";
|
|
26
|
-
import "./chunk-P6OJKJJS.js";
|
|
27
|
-
import "./chunk-O3DZDITT.js";
|
|
28
|
-
import "./chunk-2R2EX5I6.js";
|
|
29
|
-
import "./chunk-UXDUWGX6.js";
|
|
30
|
-
import "./chunk-QPPOIWPY.js";
|
|
31
|
-
import "./chunk-S4UUN6LD.js";
|
|
32
|
-
import "./chunk-Y5E2WNWB.js";
|
|
33
|
-
import "./chunk-S6JG4YUH.js";
|
|
34
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
35
|
-
export {
|
|
36
|
-
runCommandForAgent,
|
|
37
|
-
toolsFromCommands
|
|
38
|
-
};
|
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
StdioServerTransport,
|
|
5
|
-
answeredWire,
|
|
6
|
-
serveStdio
|
|
7
|
-
} from "./chunk-AQ5RIOUE.js";
|
|
8
|
-
import {
|
|
9
|
-
CALLER_META_KEY,
|
|
10
|
-
PROXY_CLIENT_NAME,
|
|
11
|
-
callerOf
|
|
12
|
-
} from "./chunk-WXYOELRI.js";
|
|
13
|
-
import {
|
|
14
|
-
InMemoryTransport,
|
|
15
|
-
McpServer
|
|
16
|
-
} from "./chunk-PL5P7UKW.js";
|
|
17
|
-
import "./chunk-5EH7S4RM.js";
|
|
18
|
-
import "./chunk-SKUY7JDA.js";
|
|
19
|
-
import "./chunk-DNCLQPOM.js";
|
|
20
|
-
import "./chunk-UXDUWGX6.js";
|
|
21
|
-
import {
|
|
22
|
-
errorObjectOf,
|
|
23
|
-
mcpErrorResult
|
|
24
|
-
} from "./chunk-QPPOIWPY.js";
|
|
25
|
-
import "./chunk-S4UUN6LD.js";
|
|
26
|
-
import "./chunk-Y5E2WNWB.js";
|
|
27
|
-
import {
|
|
28
|
-
CliError
|
|
29
|
-
} from "./chunk-S6JG4YUH.js";
|
|
30
|
-
import {
|
|
31
|
-
__name
|
|
32
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
33
|
-
|
|
34
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/mcp/all-profiles.js
|
|
35
|
-
import { spawn } from "node:child_process";
|
|
36
|
-
import { randomUUID } from "node:crypto";
|
|
37
|
-
var PROTOCOL = "2025-06-18";
|
|
38
|
-
var START_MS = 3e4;
|
|
39
|
-
var CHILD_IDLE_MS = 10 * 60 * 1e3;
|
|
40
|
-
var startChild = /* @__PURE__ */ __name((spec, note, onExit) => {
|
|
41
|
-
const child = spawn(spec.command, spec.args, { env: spec.env, stdio: "pipe" });
|
|
42
|
-
const pending = /* @__PURE__ */ new Map();
|
|
43
|
-
let next = 1;
|
|
44
|
-
let buffer = "";
|
|
45
|
-
let gone;
|
|
46
|
-
const fail = /* @__PURE__ */ __name((error) => {
|
|
47
|
-
gone ??= error;
|
|
48
|
-
for (const waiter of pending.values())
|
|
49
|
-
waiter.reject(error);
|
|
50
|
-
pending.clear();
|
|
51
|
-
}, "fail");
|
|
52
|
-
child.on("error", () => fail(new Error("the profile's MCP server could not be started")));
|
|
53
|
-
child.on("exit", () => {
|
|
54
|
-
fail(new Error("the profile's MCP server stopped"));
|
|
55
|
-
onExit();
|
|
56
|
-
});
|
|
57
|
-
child.stdin.on("error", () => fail(new Error("the profile's MCP server closed its input")));
|
|
58
|
-
child.stderr.setEncoding("utf8");
|
|
59
|
-
let errors = "";
|
|
60
|
-
child.stderr.on("data", (chunk) => {
|
|
61
|
-
const lines = (errors + chunk).split("\n");
|
|
62
|
-
errors = lines.pop() ?? "";
|
|
63
|
-
for (const line of lines)
|
|
64
|
-
if (line.trim())
|
|
65
|
-
note(line);
|
|
66
|
-
});
|
|
67
|
-
child.stdout.setEncoding("utf8");
|
|
68
|
-
child.stdout.on("data", (chunk) => {
|
|
69
|
-
buffer += chunk;
|
|
70
|
-
for (let at = buffer.indexOf("\n"); at !== -1; at = buffer.indexOf("\n")) {
|
|
71
|
-
const line = buffer.slice(0, at);
|
|
72
|
-
buffer = buffer.slice(at + 1);
|
|
73
|
-
let message;
|
|
74
|
-
try {
|
|
75
|
-
message = JSON.parse(line);
|
|
76
|
-
} catch {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
if (message.method !== void 0 && message.id !== void 0) {
|
|
80
|
-
send({ id: message.id, error: { code: -32601, message: "not offered through the all-profiles server" } });
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
if (typeof message.id !== "number")
|
|
84
|
-
continue;
|
|
85
|
-
const waiter = pending.get(message.id);
|
|
86
|
-
if (!waiter)
|
|
87
|
-
continue;
|
|
88
|
-
pending.delete(message.id);
|
|
89
|
-
if (message.error)
|
|
90
|
-
waiter.reject(new Error(message.error.message ?? "the profile's MCP server refused"));
|
|
91
|
-
else
|
|
92
|
-
waiter.resolve(message.result ?? {});
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
const send = /* @__PURE__ */ __name((message) => child.stdin.write(`${JSON.stringify({ jsonrpc: "2.0", ...message })}
|
|
96
|
-
`), "send");
|
|
97
|
-
const request = /* @__PURE__ */ __name((method, params) => new Promise((resolve, reject) => {
|
|
98
|
-
if (gone)
|
|
99
|
-
return reject(gone);
|
|
100
|
-
const id = next++;
|
|
101
|
-
pending.set(id, { resolve, reject });
|
|
102
|
-
send({ id, method, params });
|
|
103
|
-
}), "request");
|
|
104
|
-
const close = /* @__PURE__ */ __name(() => new Promise((resolve) => {
|
|
105
|
-
if (child.exitCode !== null || child.signalCode !== null)
|
|
106
|
-
return resolve();
|
|
107
|
-
child.once("exit", () => resolve());
|
|
108
|
-
child.stdin.end();
|
|
109
|
-
}), "close");
|
|
110
|
-
const timer = setTimeout(() => fail(new Error("the profile's MCP server did not answer in time")), START_MS);
|
|
111
|
-
return request("initialize", {
|
|
112
|
-
protocolVersion: PROTOCOL,
|
|
113
|
-
capabilities: {},
|
|
114
|
-
clientInfo: { name: PROXY_CLIENT_NAME, version: "1" }
|
|
115
|
-
}).then(() => {
|
|
116
|
-
send({ method: "notifications/initialized" });
|
|
117
|
-
return { request, close };
|
|
118
|
-
}).catch(async (error) => {
|
|
119
|
-
await close();
|
|
120
|
-
throw error;
|
|
121
|
-
}).finally(() => clearTimeout(timer));
|
|
122
|
-
}, "startChild");
|
|
123
|
-
var pool = /* @__PURE__ */ __name((options) => {
|
|
124
|
-
const idleMs = options.idleMs ?? CHILD_IDLE_MS;
|
|
125
|
-
const note = options.note ?? (() => {
|
|
126
|
-
});
|
|
127
|
-
const running = /* @__PURE__ */ new Map();
|
|
128
|
-
const forget = /* @__PURE__ */ __name((profile, child) => {
|
|
129
|
-
const one = running.get(profile);
|
|
130
|
-
if (one?.child !== child)
|
|
131
|
-
return;
|
|
132
|
-
clearTimeout(one.timer);
|
|
133
|
-
running.delete(profile);
|
|
134
|
-
}, "forget");
|
|
135
|
-
const use = /* @__PURE__ */ __name(async (profile, work) => {
|
|
136
|
-
let one = running.get(profile);
|
|
137
|
-
if (!one) {
|
|
138
|
-
const child = startChild(options.child(profile), (line) => note(`${profile}: ${line}`), () => forget(profile, child));
|
|
139
|
-
child.catch(() => forget(profile, child));
|
|
140
|
-
one = { child };
|
|
141
|
-
running.set(profile, one);
|
|
142
|
-
}
|
|
143
|
-
clearTimeout(one.timer);
|
|
144
|
-
const entry = one;
|
|
145
|
-
try {
|
|
146
|
-
return await work(await entry.child);
|
|
147
|
-
} finally {
|
|
148
|
-
if (running.get(profile) === entry) {
|
|
149
|
-
entry.timer = setTimeout(() => {
|
|
150
|
-
forget(profile, entry.child);
|
|
151
|
-
void entry.child.then((child) => child.close()).catch(() => void 0);
|
|
152
|
-
}, idleMs);
|
|
153
|
-
entry.timer.unref();
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}, "use");
|
|
157
|
-
const close = /* @__PURE__ */ __name(async () => {
|
|
158
|
-
const all = [...running.values()];
|
|
159
|
-
running.clear();
|
|
160
|
-
for (const one of all)
|
|
161
|
-
clearTimeout(one.timer);
|
|
162
|
-
await Promise.all(all.map((one) => one.child.then((child) => child.close()).catch(() => void 0)));
|
|
163
|
-
}, "close");
|
|
164
|
-
return { use, close };
|
|
165
|
-
}, "pool");
|
|
166
|
-
var withProfile = /* @__PURE__ */ __name((tool, profiles, name, signedIn = () => true) => {
|
|
167
|
-
const schema = tool.inputSchema;
|
|
168
|
-
const out = profiles.filter((profile) => !signedIn(profile));
|
|
169
|
-
const states = out.length === 0 ? "" : ` Signed in: ${profiles.filter(signedIn).join(", ") || "none"} \xB7 Not signed in: ${out.join(", ")}.`;
|
|
170
|
-
return {
|
|
171
|
-
...tool,
|
|
172
|
-
inputSchema: {
|
|
173
|
-
...tool.inputSchema,
|
|
174
|
-
properties: {
|
|
175
|
-
profile: profiles.length === 0 ? (
|
|
176
|
-
// An empty enum matches nothing, and a directory that checks the schema refuses the tool.
|
|
177
|
-
{
|
|
178
|
-
type: "string",
|
|
179
|
-
description: `Which ${name} account, by its profile. None is set up on this computer yet.`
|
|
180
|
-
}
|
|
181
|
-
) : {
|
|
182
|
-
type: "string",
|
|
183
|
-
enum: [...profiles],
|
|
184
|
-
oneOf: profiles.map((one) => ({ const: one, title: signedIn(one) ? one : `${one} \u2014 not signed in` })),
|
|
185
|
-
description: `Which ${name} account, by its profile. If the owner did not name one, ask which \u2014 never guess.${states}`
|
|
186
|
-
},
|
|
187
|
-
...schema.properties
|
|
188
|
-
},
|
|
189
|
-
required: ["profile", ...(schema.required ?? []).filter((field) => field !== "profile")]
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
}, "withProfile");
|
|
193
|
-
var refusal = /* @__PURE__ */ __name((code, text, details) => mcpErrorResult(errorObjectOf(new CliError(code, text, details), { effects: { remote: "none", local: "none" } })), "refusal");
|
|
194
|
-
var allProfilesServer = /* @__PURE__ */ __name((options) => {
|
|
195
|
-
const children = pool(options);
|
|
196
|
-
let listed;
|
|
197
|
-
const tools = /* @__PURE__ */ __name((profiles) => {
|
|
198
|
-
listed ??= children.use(profiles.find(signedIn) ?? profiles[0], (child) => child.request("tools/list", {})).then((answer) => answer.tools ?? []);
|
|
199
|
-
listed.catch(() => {
|
|
200
|
-
listed = void 0;
|
|
201
|
-
});
|
|
202
|
-
return listed;
|
|
203
|
-
}, "tools");
|
|
204
|
-
const signedIn = /* @__PURE__ */ __name((profile) => options.signedIn?.(profile) ?? true, "signedIn");
|
|
205
|
-
const build = /* @__PURE__ */ __name(() => {
|
|
206
|
-
const profiles = [...options.profiles()].sort();
|
|
207
|
-
const server = new McpServer({ name: options.command, version: options.version }, {
|
|
208
|
-
capabilities: { tools: {} },
|
|
209
|
-
// Read per session, as the profiles are: clients cut the instructions short, so this line comes first.
|
|
210
|
-
instructions: profiles.length === 0 && options.setup ? `${options.setup.charAt(0).toUpperCase()}${options.setup.slice(1)}.
|
|
211
|
-
${options.instructions}` : options.instructions
|
|
212
|
-
});
|
|
213
|
-
server.server.setRequestHandler("tools/list", async () => ({
|
|
214
|
-
tools: (profiles.length === 0 ? await options.catalogue?.() ?? [] : await tools(profiles)).map((one) => withProfile(one, profiles, options.name, signedIn))
|
|
215
|
-
}));
|
|
216
|
-
const callers = {
|
|
217
|
-
env: options.env ?? process.env,
|
|
218
|
-
client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"),
|
|
219
|
-
connectionId: randomUUID()
|
|
220
|
-
};
|
|
221
|
-
server.server.setRequestHandler("tools/call", async (request, ctx) => {
|
|
222
|
-
const { name, arguments: given = {}, _meta } = request.params;
|
|
223
|
-
const { profile, ...rest } = given;
|
|
224
|
-
if (profiles.length === 0)
|
|
225
|
-
return refusal("configuration_error", options.setup ?? `no ${options.command} profile on this computer yet.`);
|
|
226
|
-
if (typeof profile !== "string" || !profiles.includes(profile))
|
|
227
|
-
return refusal("validation_error", `${name} needs "profile", one of: ${profiles.join(", ")}. If the owner did not say which account, ask.`);
|
|
228
|
-
if (!signedIn(profile))
|
|
229
|
-
return refusal("authentication_error", options.signIn?.(profile) ?? `profile ${profile} is not signed in.`);
|
|
230
|
-
try {
|
|
231
|
-
return await children.use(profile, (child) => (
|
|
232
|
-
// Children are shared by every session, so each call names its own caller.
|
|
233
|
-
child.request("tools/call", {
|
|
234
|
-
name,
|
|
235
|
-
arguments: rest,
|
|
236
|
-
_meta: { ..._meta, [CALLER_META_KEY]: callerOf(ctx, name, callers) }
|
|
237
|
-
})
|
|
238
|
-
));
|
|
239
|
-
} catch (error) {
|
|
240
|
-
return refusal("outcome_unknown", `profile ${profile}: ${error instanceof Error ? error.message : String(error)}`);
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
return server;
|
|
244
|
-
}, "build");
|
|
245
|
-
return { build, close: /* @__PURE__ */ __name(() => children.close(), "close") };
|
|
246
|
-
}, "allProfilesServer");
|
|
247
|
-
var listedTools = /* @__PURE__ */ __name(async (server) => {
|
|
248
|
-
const [own, other] = InMemoryTransport.createLinkedPair();
|
|
249
|
-
const answers = /* @__PURE__ */ new Map();
|
|
250
|
-
other.onmessage = (message) => {
|
|
251
|
-
const { id, result, error } = message;
|
|
252
|
-
if (typeof id === "number")
|
|
253
|
-
answers.get(id)?.(result, error);
|
|
254
|
-
};
|
|
255
|
-
const ask = /* @__PURE__ */ __name((id, method, params) => new Promise((resolve, reject) => {
|
|
256
|
-
answers.set(id, (result, error) => error || !result ? reject(new Error(error?.message ?? `${method} had no answer`)) : resolve(result));
|
|
257
|
-
void other.send({ jsonrpc: "2.0", id, method, params });
|
|
258
|
-
}), "ask");
|
|
259
|
-
await server.connect(own);
|
|
260
|
-
try {
|
|
261
|
-
await ask(1, "initialize", {
|
|
262
|
-
protocolVersion: PROTOCOL,
|
|
263
|
-
capabilities: {},
|
|
264
|
-
clientInfo: { name: PROXY_CLIENT_NAME, version: "1" }
|
|
265
|
-
});
|
|
266
|
-
await other.send({ jsonrpc: "2.0", method: "notifications/initialized" });
|
|
267
|
-
const answer = await ask(2, "tools/list", {});
|
|
268
|
-
if (!Array.isArray(answer.tools))
|
|
269
|
-
throw new Error("the catalogue server listed no tools");
|
|
270
|
-
return answer.tools;
|
|
271
|
-
} finally {
|
|
272
|
-
await server.close();
|
|
273
|
-
}
|
|
274
|
-
}, "listedTools");
|
|
275
|
-
var serveAllProfilesOverStdio = /* @__PURE__ */ __name(async (options, io = {}) => {
|
|
276
|
-
const { build, close } = allProfilesServer(options);
|
|
277
|
-
const own = io.stdin !== void 0 && io.stdin !== process.stdin;
|
|
278
|
-
const wire = answeredWire(io.stdin ?? process.stdin, io.stdout ?? process.stdout);
|
|
279
|
-
const handle = serveStdio(build, {
|
|
280
|
-
transport: new StdioServerTransport(wire.input, wire.output),
|
|
281
|
-
onerror: /* @__PURE__ */ __name((error) => options.note?.(`mcp: ${error.message}`), "onerror")
|
|
282
|
-
});
|
|
283
|
-
await wire.finished(own ? io.signal : void 0);
|
|
284
|
-
try {
|
|
285
|
-
wire.release();
|
|
286
|
-
await handle.close();
|
|
287
|
-
} finally {
|
|
288
|
-
await close();
|
|
289
|
-
}
|
|
290
|
-
}, "serveAllProfilesOverStdio");
|
|
291
|
-
var serveAllProfilesOverHttp = /* @__PURE__ */ __name(async (options, http) => {
|
|
292
|
-
const { build, close } = allProfilesServer(options);
|
|
293
|
-
const { serveOverHttp } = await import("./serve-NY5MUTNW.js");
|
|
294
|
-
const listening = await serveOverHttp(build, {
|
|
295
|
-
...http,
|
|
296
|
-
appName: options.command,
|
|
297
|
-
onError: /* @__PURE__ */ __name((error) => options.note?.(`mcp: ${error.message}`), "onError")
|
|
298
|
-
}).catch(async (error) => {
|
|
299
|
-
await close();
|
|
300
|
-
throw error;
|
|
301
|
-
});
|
|
302
|
-
return {
|
|
303
|
-
url: listening.url,
|
|
304
|
-
close: /* @__PURE__ */ __name(async () => {
|
|
305
|
-
try {
|
|
306
|
-
await listening.close();
|
|
307
|
-
} finally {
|
|
308
|
-
await close();
|
|
309
|
-
}
|
|
310
|
-
}, "close")
|
|
311
|
-
};
|
|
312
|
-
}, "serveAllProfilesOverHttp");
|
|
313
|
-
export {
|
|
314
|
-
CHILD_IDLE_MS,
|
|
315
|
-
allProfilesServer,
|
|
316
|
-
listedTools,
|
|
317
|
-
serveAllProfilesOverHttp,
|
|
318
|
-
serveAllProfilesOverStdio,
|
|
319
|
-
withProfile
|
|
320
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
EmptyAnswer,
|
|
5
|
-
checkedOptions,
|
|
6
|
-
messagesFor,
|
|
7
|
-
systemFor
|
|
8
|
-
} from "./chunk-WZBPUOWM.js";
|
|
9
|
-
import {
|
|
10
|
-
Anthropic
|
|
11
|
-
} from "./chunk-XQUUANA2.js";
|
|
12
|
-
import "./chunk-UXDUWGX6.js";
|
|
13
|
-
import "./chunk-QPPOIWPY.js";
|
|
14
|
-
import {
|
|
15
|
-
array,
|
|
16
|
-
literal,
|
|
17
|
-
optional,
|
|
18
|
-
picklist,
|
|
19
|
-
record,
|
|
20
|
-
strictObject,
|
|
21
|
-
string,
|
|
22
|
-
unknown
|
|
23
|
-
} from "./chunk-S4UUN6LD.js";
|
|
24
|
-
import "./chunk-Y5E2WNWB.js";
|
|
25
|
-
import "./chunk-S6JG4YUH.js";
|
|
26
|
-
import {
|
|
27
|
-
__name
|
|
28
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
29
|
-
|
|
30
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/models/anthropic.js
|
|
31
|
-
var options = strictObject({
|
|
32
|
-
stop_sequences: optional(array(string())),
|
|
33
|
-
thinking: optional(strictObject({ type: picklist(["disabled", "adaptive"]) })),
|
|
34
|
-
output_config: optional(strictObject({
|
|
35
|
-
effort: optional(picklist(["low", "medium", "high"])),
|
|
36
|
-
format: optional(strictObject({ type: literal("json_schema"), schema: record(string(), unknown()) }))
|
|
37
|
-
}))
|
|
38
|
-
});
|
|
39
|
-
var anthropic = {
|
|
40
|
-
images: true,
|
|
41
|
-
baseUrl: "https://api.anthropic.com",
|
|
42
|
-
validate: /* @__PURE__ */ __name((given) => checkedOptions("anthropic", options, given), "validate"),
|
|
43
|
-
complete: /* @__PURE__ */ __name(async (target, request, checked, apiKey, fetcher) => {
|
|
44
|
-
const client = new Anthropic({
|
|
45
|
-
apiKey: apiKey ?? "",
|
|
46
|
-
authToken: null,
|
|
47
|
-
fetch: /* @__PURE__ */ __name((input, init) => fetcher(input, { ...init, redirect: "error" }), "fetch"),
|
|
48
|
-
baseURL: target.baseUrl,
|
|
49
|
-
maxRetries: 0,
|
|
50
|
-
logLevel: "off",
|
|
51
|
-
timeout: 12e4
|
|
52
|
-
});
|
|
53
|
-
const response = await client.messages.stream({
|
|
54
|
-
...checked,
|
|
55
|
-
model: target.model,
|
|
56
|
-
system: systemFor(request),
|
|
57
|
-
messages: [
|
|
58
|
-
...messagesFor(request),
|
|
59
|
-
...request.images === void 0 ? [] : [
|
|
60
|
-
{
|
|
61
|
-
role: "user",
|
|
62
|
-
content: [
|
|
63
|
-
{ type: "text", text: request.prompt },
|
|
64
|
-
...request.images.map((image) => ({
|
|
65
|
-
type: "image",
|
|
66
|
-
source: { type: "base64", media_type: image.mimeType, data: image.data }
|
|
67
|
-
}))
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
],
|
|
72
|
-
max_tokens: request.maxTokens
|
|
73
|
-
}).finalMessage();
|
|
74
|
-
if (response.stop_reason !== "end_turn")
|
|
75
|
-
throw new Error("incomplete response");
|
|
76
|
-
const text = response.content.filter((block) => block.type === "text").map((block) => block.text).join("");
|
|
77
|
-
if (text.trim() === "")
|
|
78
|
-
throw new EmptyAnswer();
|
|
79
|
-
return {
|
|
80
|
-
text,
|
|
81
|
-
usage: {
|
|
82
|
-
input: response.usage.input_tokens + (response.usage.cache_creation_input_tokens ?? 0) + (response.usage.cache_read_input_tokens ?? 0),
|
|
83
|
-
output: response.usage.output_tokens
|
|
84
|
-
},
|
|
85
|
-
tokens: response.usage.input_tokens + response.usage.output_tokens + (response.usage.cache_creation_input_tokens ?? 0) + (response.usage.cache_read_input_tokens ?? 0)
|
|
86
|
-
};
|
|
87
|
-
}, "complete")
|
|
88
|
-
};
|
|
89
|
-
export {
|
|
90
|
-
anthropic
|
|
91
|
-
};
|