@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.
Files changed (206) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/contracts/wirecat.json +1 -0
  3. package/dist/bin/attio.js +11 -11
  4. package/dist/bundle/attio.js +5 -166
  5. package/dist/bundle/{chunk-6E5QWCBK.js → chunk-OFEXB726.js} +2 -1
  6. package/dist/bundle/chunk-TQAECZFO.js +13 -0
  7. package/dist/bundle/{definitions-FODOIPM2.js → definitions-J73IBAHT.js} +1 -1
  8. package/dist/bundle/program-4R7RYWV3.js +6210 -0
  9. package/dist/bundle/{schemas-YGSTNU6F.js → schemas-G3HFAS45.js} +576 -29
  10. package/dist/commands/api.js +1 -2
  11. package/dist/commands/crm.js +12 -4
  12. package/dist/commands/schedule.js +1 -1
  13. package/dist/commands/session.js +1 -2
  14. package/dist/config.js +1 -2
  15. package/dist/context.js +1 -1
  16. package/dist/identity.js +1 -0
  17. package/dist/program.js +1 -2
  18. package/dist/version.js +1 -1
  19. package/package.json +3 -3
  20. package/dist/activities.d.ts +0 -4
  21. package/dist/activities.d.ts.map +0 -1
  22. package/dist/activities.js.map +0 -1
  23. package/dist/bin/attio.d.ts +0 -3
  24. package/dist/bin/attio.d.ts.map +0 -1
  25. package/dist/bin/attio.js.map +0 -1
  26. package/dist/bundle/agent-C3SZOGZS.js +0 -38
  27. package/dist/bundle/all-profiles-673VSTRG.js +0 -320
  28. package/dist/bundle/anthropic-V4RZS5XM.js +0 -91
  29. package/dist/bundle/app-server-CTEDPA5H.js +0 -249
  30. package/dist/bundle/bun-F4M4KCNA.js +0 -169
  31. package/dist/bundle/bun-sqlite-33JTNHCK.js +0 -76
  32. package/dist/bundle/chunk-2R2EX5I6.js +0 -54
  33. package/dist/bundle/chunk-5EH7S4RM.js +0 -362
  34. package/dist/bundle/chunk-5N2V6XO7.js +0 -119
  35. package/dist/bundle/chunk-5WY6RURV.js +0 -161
  36. package/dist/bundle/chunk-6V7ZUJI6.js +0 -4072
  37. package/dist/bundle/chunk-AOKAYQSJ.js +0 -2338
  38. package/dist/bundle/chunk-AQ5RIOUE.js +0 -633
  39. package/dist/bundle/chunk-B4DVW2BA.js +0 -185
  40. package/dist/bundle/chunk-C7JPYWYQ.js +0 -77
  41. package/dist/bundle/chunk-D72URWJE.js +0 -532
  42. package/dist/bundle/chunk-DBHZ7TQ7.js +0 -69828
  43. package/dist/bundle/chunk-DFDN6AUB.js +0 -21
  44. package/dist/bundle/chunk-DNCLQPOM.js +0 -7
  45. package/dist/bundle/chunk-DPV53EZC.js +0 -206
  46. package/dist/bundle/chunk-E2L4R6EI.js +0 -388
  47. package/dist/bundle/chunk-EDWRHVHD.js +0 -218
  48. package/dist/bundle/chunk-EH6ZEJGT.js +0 -932
  49. package/dist/bundle/chunk-EV6B3GHM.js +0 -323
  50. package/dist/bundle/chunk-FBWECICU.js +0 -259
  51. package/dist/bundle/chunk-FFER7KJI.js +0 -407
  52. package/dist/bundle/chunk-FTH6WGYO.js +0 -24
  53. package/dist/bundle/chunk-G3PK5BZB.js +0 -1222
  54. package/dist/bundle/chunk-G46PNDWL.js +0 -58
  55. package/dist/bundle/chunk-G6NY7LFB.js +0 -230
  56. package/dist/bundle/chunk-GLU36VKA.js +0 -52
  57. package/dist/bundle/chunk-GZ7WBU5Y.js +0 -18
  58. package/dist/bundle/chunk-HMYBAVIE.js +0 -86
  59. package/dist/bundle/chunk-HOJJPSLU.js +0 -288
  60. package/dist/bundle/chunk-HUAHLO6N.js +0 -29
  61. package/dist/bundle/chunk-ISQ23VKV.js +0 -123
  62. package/dist/bundle/chunk-J2LSOG3A.js +0 -12766
  63. package/dist/bundle/chunk-K5L77R7P.js +0 -66
  64. package/dist/bundle/chunk-KKRFVN4X.js +0 -1835
  65. package/dist/bundle/chunk-KLRCTMES.js +0 -100
  66. package/dist/bundle/chunk-KYRYD4CR.js +0 -38
  67. package/dist/bundle/chunk-L5QLKUQR.js +0 -794
  68. package/dist/bundle/chunk-MFSWMNSZ.js +0 -334
  69. package/dist/bundle/chunk-MYK2F5LD.js +0 -1251
  70. package/dist/bundle/chunk-NBNQLNVV.js +0 -388
  71. package/dist/bundle/chunk-O3DZDITT.js +0 -274
  72. package/dist/bundle/chunk-OEEWVKJX.js +0 -53
  73. package/dist/bundle/chunk-P5XYQZVW.js +0 -80
  74. package/dist/bundle/chunk-P6OJKJJS.js +0 -1197
  75. package/dist/bundle/chunk-P6S3ZRVW.js +0 -106
  76. package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
  77. package/dist/bundle/chunk-QBJRK733.js +0 -1068
  78. package/dist/bundle/chunk-QBYE26ZC.js +0 -131
  79. package/dist/bundle/chunk-QPPOIWPY.js +0 -1246
  80. package/dist/bundle/chunk-R2CEA7MK.js +0 -743
  81. package/dist/bundle/chunk-S4UUN6LD.js +0 -1410
  82. package/dist/bundle/chunk-S6JG4YUH.js +0 -72
  83. package/dist/bundle/chunk-SKUY7JDA.js +0 -164
  84. package/dist/bundle/chunk-T35IOBPJ.js +0 -1341
  85. package/dist/bundle/chunk-T3W4V4A6.js +0 -63
  86. package/dist/bundle/chunk-TB3LN5G2.js +0 -50
  87. package/dist/bundle/chunk-TCT5D2X2.js +0 -6848
  88. package/dist/bundle/chunk-TES7MB6I.js +0 -82
  89. package/dist/bundle/chunk-TXDR6YSF.js +0 -23
  90. package/dist/bundle/chunk-TY7NDMFY.js +0 -46
  91. package/dist/bundle/chunk-U7UTYALA.js +0 -353
  92. package/dist/bundle/chunk-UOWHMOU3.js +0 -188
  93. package/dist/bundle/chunk-UXDUWGX6.js +0 -2791
  94. package/dist/bundle/chunk-V5I3QHDU.js +0 -558
  95. package/dist/bundle/chunk-VCDIKCFE.js +0 -1007
  96. package/dist/bundle/chunk-VJHUMB7U.js +0 -338
  97. package/dist/bundle/chunk-W4KLHM2K.js +0 -95
  98. package/dist/bundle/chunk-W5LKEOGN.js +0 -142
  99. package/dist/bundle/chunk-WLDZWHSF.js +0 -170
  100. package/dist/bundle/chunk-WQEEYEWO.js +0 -3752
  101. package/dist/bundle/chunk-WRF6TY63.js +0 -1521
  102. package/dist/bundle/chunk-WXYOELRI.js +0 -108
  103. package/dist/bundle/chunk-WZBPUOWM.js +0 -76
  104. package/dist/bundle/chunk-XGNZD52X.js +0 -592
  105. package/dist/bundle/chunk-XQUUANA2.js +0 -24600
  106. package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
  107. package/dist/bundle/chunk-YQH4J6YZ.js +0 -358
  108. package/dist/bundle/chunk-Z7Y2I5YR.js +0 -44045
  109. package/dist/bundle/chunk-ZBCC7MBN.js +0 -9671
  110. package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
  111. package/dist/bundle/command-contract-ZL67KMYL.js +0 -37
  112. package/dist/bundle/command-server-entry-COR2VDRU.js +0 -166
  113. package/dist/bundle/decode-33SGRQM6.js +0 -297
  114. package/dist/bundle/dispatch-2FTOHA5D.js +0 -411
  115. package/dist/bundle/dist-EM7KLEG4.js +0 -7577
  116. package/dist/bundle/dist-PAKDDIBT.js +0 -191
  117. package/dist/bundle/echarts-QMAA7HH5.js +0 -42501
  118. package/dist/bundle/embed-W4ZBXPWD.js +0 -38
  119. package/dist/bundle/embedder-73CCZC52.js +0 -111
  120. package/dist/bundle/failure-OHIXWTR6.js +0 -25
  121. package/dist/bundle/first-run-MOSUMMVX.js +0 -28
  122. package/dist/bundle/first-screen-GUXBF3SL.js +0 -38
  123. package/dist/bundle/instructions-4H7UREH2.js +0 -11
  124. package/dist/bundle/mcp-5HFPWC3W.js +0 -167
  125. package/dist/bundle/meeting-combined-QMIZOBBJ.js +0 -24
  126. package/dist/bundle/meeting-model-2UYVGXD5.js +0 -25
  127. package/dist/bundle/meeting-semantic-LEJPUIN3.js +0 -22
  128. package/dist/bundle/node-KM3CUABH.js +0 -2340
  129. package/dist/bundle/node-P3PUHKYH.js +0 -176
  130. package/dist/bundle/node-TLZSIHIJ.js +0 -21
  131. package/dist/bundle/node-sqlite-UHPODTKB.js +0 -74
  132. package/dist/bundle/oauth-T3DWL7OV.js +0 -20
  133. package/dist/bundle/open-ODWX32PF.js +0 -23
  134. package/dist/bundle/openai-GSXXHKPX.js +0 -238
  135. package/dist/bundle/process-AFIXYXWL.js +0 -91
  136. package/dist/bundle/program-SXSUG335.js +0 -35250
  137. package/dist/bundle/prompt-GVTYTFK7.js +0 -17
  138. package/dist/bundle/recognize-XDSZEZP5.js +0 -26
  139. package/dist/bundle/remote-ZWZKMEY6.js +0 -31
  140. package/dist/bundle/rerank-OBZQ54NL.js +0 -52
  141. package/dist/bundle/serve-NY5MUTNW.js +0 -199
  142. package/dist/bundle/server-JK334V5Y.js +0 -212
  143. package/dist/bundle/server-VOPYQCUD.js +0 -79
  144. package/dist/bundle/sqlite-runtime-2NHF4S6G.js +0 -20
  145. package/dist/bundle/state-YGWZZWPM.js +0 -36
  146. package/dist/bundle/store-LRQUTFJR.js +0 -306
  147. package/dist/bundle/store-ND6KU4RI.js +0 -181
  148. package/dist/bundle/store-maintenance-command-GLYGQM2V.js +0 -66
  149. package/dist/bundle/surface-P53WLLXP.js +0 -65
  150. package/dist/commands/api.d.ts +0 -12
  151. package/dist/commands/api.d.ts.map +0 -1
  152. package/dist/commands/api.js.map +0 -1
  153. package/dist/commands/crm.d.ts +0 -7
  154. package/dist/commands/crm.d.ts.map +0 -1
  155. package/dist/commands/crm.js.map +0 -1
  156. package/dist/commands/schedule.d.ts +0 -3
  157. package/dist/commands/schedule.d.ts.map +0 -1
  158. package/dist/commands/schedule.js.map +0 -1
  159. package/dist/commands/session.d.ts +0 -8
  160. package/dist/commands/session.d.ts.map +0 -1
  161. package/dist/commands/session.js.map +0 -1
  162. package/dist/config.d.ts +0 -13
  163. package/dist/config.d.ts.map +0 -1
  164. package/dist/config.js.map +0 -1
  165. package/dist/context.d.ts +0 -37
  166. package/dist/context.d.ts.map +0 -1
  167. package/dist/context.js.map +0 -1
  168. package/dist/generated/definitions.d.ts +0 -3
  169. package/dist/generated/definitions.d.ts.map +0 -1
  170. package/dist/generated/definitions.js.map +0 -1
  171. package/dist/generated/manifest.d.ts +0 -6
  172. package/dist/generated/manifest.d.ts.map +0 -1
  173. package/dist/generated/manifest.js.map +0 -1
  174. package/dist/generated/schemas.d.ts +0 -383
  175. package/dist/generated/schemas.d.ts.map +0 -1
  176. package/dist/generated/schemas.js.map +0 -1
  177. package/dist/generated/types.d.ts +0 -10166
  178. package/dist/generated/types.d.ts.map +0 -1
  179. package/dist/generated/types.js.map +0 -1
  180. package/dist/generated/wirecat-config.d.ts +0 -15
  181. package/dist/generated/wirecat-config.d.ts.map +0 -1
  182. package/dist/generated/wirecat-config.js.map +0 -1
  183. package/dist/hooks.d.ts +0 -33
  184. package/dist/hooks.d.ts.map +0 -1
  185. package/dist/hooks.js.map +0 -1
  186. package/dist/identity.d.ts +0 -33
  187. package/dist/identity.d.ts.map +0 -1
  188. package/dist/identity.js.map +0 -1
  189. package/dist/index.d.ts +0 -3
  190. package/dist/index.d.ts.map +0 -1
  191. package/dist/index.js.map +0 -1
  192. package/dist/links.d.ts +0 -10
  193. package/dist/links.d.ts.map +0 -1
  194. package/dist/links.js.map +0 -1
  195. package/dist/meetings.d.ts +0 -57
  196. package/dist/meetings.d.ts.map +0 -1
  197. package/dist/meetings.js.map +0 -1
  198. package/dist/program.d.ts +0 -6
  199. package/dist/program.d.ts.map +0 -1
  200. package/dist/program.js.map +0 -1
  201. package/dist/version.d.ts +0 -2
  202. package/dist/version.d.ts.map +0 -1
  203. package/dist/version.js.map +0 -1
  204. package/dist/wcat.d.ts +0 -3
  205. package/dist/wcat.d.ts.map +0 -1
  206. package/dist/wcat.js.map +0 -1
@@ -1,249 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- PER_RUN,
5
- envelope
6
- } from "./chunk-L5QLKUQR.js";
7
- import {
8
- mcpUrlOf
9
- } from "./chunk-T35IOBPJ.js";
10
- import {
11
- skillResources
12
- } from "./chunk-E2L4R6EI.js";
13
- import {
14
- StdioServerTransport,
15
- answeredWire,
16
- serveStdio
17
- } from "./chunk-AQ5RIOUE.js";
18
- import "./chunk-GZ7WBU5Y.js";
19
- import "./chunk-MYK2F5LD.js";
20
- import "./chunk-U7UTYALA.js";
21
- import {
22
- runCommandForAgent,
23
- toolsFromCommands
24
- } from "./chunk-WQEEYEWO.js";
25
- import "./chunk-TB3LN5G2.js";
26
- import "./chunk-VJHUMB7U.js";
27
- import {
28
- appInstructions
29
- } from "./chunk-OEEWVKJX.js";
30
- import {
31
- answered,
32
- failed,
33
- registerCommands
34
- } from "./chunk-V5I3QHDU.js";
35
- import {
36
- agentJson
37
- } from "./chunk-G3PK5BZB.js";
38
- import "./chunk-Z7Y2I5YR.js";
39
- import "./chunk-FFER7KJI.js";
40
- import "./chunk-5N2V6XO7.js";
41
- import "./chunk-ISQ23VKV.js";
42
- import "./chunk-W5LKEOGN.js";
43
- import "./chunk-TY7NDMFY.js";
44
- import "./chunk-WXYOELRI.js";
45
- import "./chunk-R2CEA7MK.js";
46
- import "./chunk-HUAHLO6N.js";
47
- import {
48
- McpServer
49
- } from "./chunk-PL5P7UKW.js";
50
- import "./chunk-WZBPUOWM.js";
51
- import "./chunk-FBWECICU.js";
52
- import "./chunk-YQH4J6YZ.js";
53
- import "./chunk-WLDZWHSF.js";
54
- import {
55
- mcpHttpMarker
56
- } from "./chunk-5WY6RURV.js";
57
- import "./chunk-HMYBAVIE.js";
58
- import "./chunk-QBYE26ZC.js";
59
- import {
60
- DEFAULT_OUTPUT_BYTES,
61
- changesAuthorityAt,
62
- describeProgram,
63
- environmentOf,
64
- fetchesOnlyAt,
65
- judgedTargets,
66
- readOnlyLockOf,
67
- readsOverMcpAt,
68
- rootOf2 as rootOf
69
- } from "./chunk-J2LSOG3A.js";
70
- import "./chunk-5EH7S4RM.js";
71
- import "./chunk-GLU36VKA.js";
72
- import "./chunk-MFSWMNSZ.js";
73
- import "./chunk-T3W4V4A6.js";
74
- import "./chunk-TES7MB6I.js";
75
- import "./chunk-QBJRK733.js";
76
- import "./chunk-K5L77R7P.js";
77
- import "./chunk-DBHZ7TQ7.js";
78
- import "./chunk-P5XYQZVW.js";
79
- import "./chunk-KKRFVN4X.js";
80
- import "./chunk-AOKAYQSJ.js";
81
- import "./chunk-WRF6TY63.js";
82
- import "./chunk-SKUY7JDA.js";
83
- import "./chunk-XGNZD52X.js";
84
- import "./chunk-6V7ZUJI6.js";
85
- import "./chunk-DNCLQPOM.js";
86
- import "./chunk-B4DVW2BA.js";
87
- import "./chunk-NBNQLNVV.js";
88
- import "./chunk-P6OJKJJS.js";
89
- import "./chunk-VCDIKCFE.js";
90
- import "./chunk-O3DZDITT.js";
91
- import "./chunk-TXDR6YSF.js";
92
- import "./chunk-D72URWJE.js";
93
- import "./chunk-2R2EX5I6.js";
94
- import "./chunk-W4KLHM2K.js";
95
- import "./chunk-KYRYD4CR.js";
96
- import "./chunk-UXDUWGX6.js";
97
- import {
98
- mcpErrorResult
99
- } from "./chunk-QPPOIWPY.js";
100
- import "./chunk-S4UUN6LD.js";
101
- import "./chunk-Y5E2WNWB.js";
102
- import {
103
- CliError
104
- } from "./chunk-S6JG4YUH.js";
105
- import "./chunk-TCT5D2X2.js";
106
- import {
107
- __name
108
- } from "./chunk-ZVVMGPBJ.js";
109
-
110
- // 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/app-server.js
111
- var EXCLUDED = [["mcp"]];
112
- var aliasesOf = /* @__PURE__ */ __name((root, path) => {
113
- let at = root;
114
- for (const name of path)
115
- at = at?.commands.find((child) => child.name() === name);
116
- const aliases = at?.aliases() ?? [];
117
- return aliases.length > 0 ? { aliases } : {};
118
- }, "aliasesOf");
119
- var createAppServer = /* @__PURE__ */ __name((command, context, options) => {
120
- const { app } = options;
121
- const root = rootOf(command);
122
- const environment = environmentOf(command);
123
- if (!environment.runCommand)
124
- throw new Error("the MCP server runs inside run(), which hands it the program");
125
- const program = { run: environment.runCommand, commands: describeProgram(root) };
126
- const flags = command.optsWithGlobals();
127
- const overrides = flags.permission ?? [];
128
- const { settings } = context;
129
- const levels = /* @__PURE__ */ __name(() => options.resolveSettings(flags, { env: context.env }).permissions, "levels");
130
- const readOnly = /* @__PURE__ */ __name(() => readOnlyLockOf(app, context.env) !== void 0, "readOnly");
131
- const authority = changesAuthorityAt(root);
132
- const fetches = fetchesOnlyAt(root);
133
- const targets = judgedTargets(root);
134
- const passed = Object.fromEntries(Object.entries(environment).filter(([key]) => !PER_RUN.has(key)));
135
- const tools = toolsFromCommands(program.commands, {
136
- includeUnavailable: true,
137
- exclude: EXCLUDED,
138
- levels: settings.permissions,
139
- currentLevels: levels,
140
- readOnly: readOnly(),
141
- authority,
142
- fetchOnly: readsOverMcpAt(root),
143
- fetches,
144
- permissions: options.permissions
145
- });
146
- const availability = /* @__PURE__ */ __name((one) => () => {
147
- const permitted = one.availability?.() ?? { available: true };
148
- if (!permitted.available)
149
- return permitted;
150
- return options.availability?.(one.path, settings.profile) ?? permitted;
151
- }, "availability");
152
- const commands = Object.fromEntries(tools.map((one) => [
153
- one.command,
154
- {
155
- title: one.title,
156
- description: one.description,
157
- ...one.keywords ? { keywords: one.keywords } : {},
158
- ...aliasesOf(root, one.path),
159
- writes: one.writes,
160
- availability: availability(one),
161
- input: one.input,
162
- run: /* @__PURE__ */ __name(async (input, ctx) => {
163
- const own = options.availability?.(one.path, settings.profile);
164
- if (own && !own.available)
165
- return failed(new CliError("permission_error", `${one.command}: ${own.reason ?? "unavailable for this profile"}`, {
166
- ...own.permission ? { permission: own.permission } : {}
167
- }), app.errors);
168
- const traceparent = ctx?.mcpReq?._meta?.traceparent;
169
- const env = typeof traceparent === "string" ? { ...context.env, TRACEPARENT: traceparent } : context.env;
170
- const answer = await runCommandForAgent(program, one.path, input, {
171
- profile: settings.profile,
172
- readOnly: readOnly(),
173
- env,
174
- levels,
175
- overrides,
176
- authority,
177
- fetches,
178
- permissions: options.permissions,
179
- environment: passed
180
- });
181
- if ("error" in answer)
182
- return mcpErrorResult(JSON.parse(agentJson(answer.error)));
183
- try {
184
- return answered(envelope(one.command, answer.result), DEFAULT_OUTPUT_BYTES, targets);
185
- } catch (error) {
186
- return failed(error, app.errors);
187
- }
188
- }, "run")
189
- }
190
- ]));
191
- const skills = options.skill ? skillResources(app, options.skill) : [];
192
- const skill = skills[0];
193
- const build = /* @__PURE__ */ __name(() => {
194
- const server = new McpServer({ name: app.command, version: app.version }, {
195
- instructions: appInstructions({
196
- command: app.command,
197
- name: options.name,
198
- profile: settings.profile,
199
- untrusted: options.untrusted,
200
- ...skill ? { skill: skill.instruction } : {}
201
- })
202
- });
203
- registerCommands(server, app.command, commands, app.errors, void 0, app.messenger);
204
- for (const { uri, name, title, description, mimeType, read } of skills)
205
- server.registerResource(name, uri, { title, description, mimeType }, read);
206
- return server;
207
- }, "build");
208
- return { build, offered: Object.keys(commands) };
209
- }, "createAppServer");
210
- var serveAppOverStdio = /* @__PURE__ */ __name(async (command, context, options) => {
211
- const { build } = createAppServer(command, context, options);
212
- const { stdin, stdout, signal } = environmentOf(command);
213
- const own = stdin && stdout && stdin !== process.stdin;
214
- const wire = answeredWire(own ? stdin : process.stdin, own ? stdout : process.stdout);
215
- const handle = serveStdio(build, {
216
- transport: new StdioServerTransport(wire.input, wire.output),
217
- onerror: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onerror")
218
- });
219
- await wire.finished(own ? signal : void 0);
220
- wire.release();
221
- await handle.close();
222
- }, "serveAppOverStdio");
223
- var serveAppOverHttp = /* @__PURE__ */ __name(async (command, context, options, http) => {
224
- const { app } = options;
225
- const { build } = createAppServer(command, context, options);
226
- const { serveOverHttp } = await import("./serve-NY5MUTNW.js");
227
- const listening = await serveOverHttp(build, {
228
- ...http,
229
- appName: app.command,
230
- reaches: `your ${options.name}`,
231
- onCode: /* @__PURE__ */ __name((code, expires) => context.renderer.note(context.env[mcpHttpMarker(app.envPrefix)] === void 0 ? `login code for a new browser app: ${code} (until ${expires.toTimeString().slice(0, 5)}; a new one after each login)` : `a new login code for a browser app: \`${app.command} ${context.settings.profile} mcp server status\``), "onCode"),
232
- onError: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onError")
233
- }).catch((error) => {
234
- if (error.code === "EADDRINUSE")
235
- throw new CliError("configuration_error", `port ${http.port} is in use \u2014 pass another with --port`);
236
- throw error;
237
- });
238
- context.renderer.note(`serving on ${listening.url.href} \u2014 point your tunnel at it; connectors use ${mcpUrlOf(http.publicUrl).href}`);
239
- await new Promise((resolve) => {
240
- process.once("SIGINT", resolve);
241
- process.once("SIGTERM", resolve);
242
- });
243
- await listening.close();
244
- }, "serveAppOverHttp");
245
- export {
246
- createAppServer,
247
- serveAppOverHttp,
248
- serveAppOverStdio
249
- };
@@ -1,169 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- DefaultLogger,
5
- DrizzleQueryError,
6
- NoopLogger,
7
- SQLiteAsyncDatabase,
8
- SQLiteAsyncPreparedQuery,
9
- SQLiteAsyncSession,
10
- SQLiteAsyncTransaction,
11
- SQLiteDialect,
12
- booleanFromInteger,
13
- bufferFromBytes,
14
- castToText,
15
- dateFromStoredMilliseconds,
16
- dateFromStoredSeconds,
17
- entityKind,
18
- jitCompatCheck,
19
- refineSqliteCodecs,
20
- sql
21
- } from "./chunk-TCT5D2X2.js";
22
- import {
23
- __name
24
- } from "./chunk-ZVVMGPBJ.js";
25
-
26
- // 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/store/sqlite/drizzle/bun.js
27
- import { Database } from "bun:sqlite";
28
- var bunSQLiteCodecs = refineSqliteCodecs({
29
- "integer:boolean": { normalize: booleanFromInteger },
30
- "integer:timestamp": { normalize: dateFromStoredSeconds },
31
- "integer:timestamp_ms": { normalize: dateFromStoredMilliseconds },
32
- "text:json": { normalize: JSON.parse },
33
- blob: { normalize: bufferFromBytes },
34
- "blob:json": {
35
- cast: castToText,
36
- normalize: JSON.parse
37
- },
38
- "blob:bigint": {
39
- cast: castToText,
40
- normalize: BigInt
41
- },
42
- numeric: {
43
- cast: castToText,
44
- normalize: String
45
- },
46
- "numeric:number": { normalize: Number },
47
- "numeric:bigint": {
48
- cast: castToText,
49
- normalize: BigInt
50
- }
51
- });
52
- var SQLiteBunSession = class extends SQLiteAsyncSession {
53
- static {
54
- __name(this, "SQLiteBunSession");
55
- }
56
- client;
57
- relations;
58
- options;
59
- static [entityKind] = "SQLiteBunSession";
60
- logger;
61
- constructor(client, dialect, relations, options = {}) {
62
- super(dialect, "sync");
63
- this.client = client;
64
- this.relations = relations;
65
- this.options = options;
66
- this.logger = options.logger ?? new NoopLogger();
67
- }
68
- exec(query) {
69
- this.client.exec(query);
70
- }
71
- prepareQuery(query, mode, _prepare, executeMethod, mapper, queryMetadata) {
72
- let stmt;
73
- try {
74
- stmt = this.client.query(query.sql);
75
- } catch (e) {
76
- throw new DrizzleQueryError(query.sql, this.options.paramsInErrors ? query.params : void 0, e);
77
- }
78
- return new SQLiteAsyncPreparedQuery("sync", executeMethod, {
79
- all: /* @__PURE__ */ __name((params) => {
80
- if (mode === "arrays") return stmt.values(...params);
81
- return stmt.all(...params);
82
- }, "all"),
83
- get: /* @__PURE__ */ __name((params) => {
84
- if (mode === "arrays") return stmt.values(...params)[0];
85
- return stmt.get(...params);
86
- }, "get"),
87
- run: /* @__PURE__ */ __name((params) => {
88
- return stmt.run(...params);
89
- }, "run")
90
- }, query, mapper, mode, this.logger, void 0, queryMetadata, void 0, this.options.paramsInErrors);
91
- }
92
- transaction(transaction, config = {}) {
93
- const tx = new SQLiteBunTransaction("sync", this.dialect, this, this.relations);
94
- let result;
95
- const nativeTx = this.client.transaction(() => {
96
- result = transaction(tx);
97
- });
98
- if (config.behavior === "concurrent") throw new Error("Concurrent transactions are not supported by driver");
99
- nativeTx[config.behavior ?? "deferred"]();
100
- return result;
101
- }
102
- };
103
- var SQLiteBunTransaction = class SQLiteBunTransaction2 extends SQLiteAsyncTransaction {
104
- static {
105
- __name(this, "SQLiteBunTransaction2");
106
- }
107
- static [entityKind] = "SQLiteBunTransaction";
108
- transaction(transaction) {
109
- const savepointName = `sp${this.nestedIndex}`;
110
- const tx = new SQLiteBunTransaction2("sync", this.dialect, this.session, this._.relations, this.nestedIndex + 1);
111
- this.session.run(sql.raw(`savepoint ${savepointName}`));
112
- try {
113
- const result = transaction(tx);
114
- this.session.run(sql.raw(`release savepoint ${savepointName}`));
115
- return result;
116
- } catch (err) {
117
- try {
118
- this.session.run(sql.raw(`rollback to savepoint ${savepointName}`));
119
- } catch {
120
- }
121
- throw err;
122
- }
123
- }
124
- };
125
- var SQLiteBunDatabase = class extends SQLiteAsyncDatabase {
126
- static {
127
- __name(this, "SQLiteBunDatabase");
128
- }
129
- static [entityKind] = "SQLiteBunDatabase";
130
- };
131
- function construct(client, config = {}) {
132
- const dialect = new SQLiteDialect({
133
- codecs: config.codecs ?? bunSQLiteCodecs,
134
- useJitMappers: jitCompatCheck(config.jit)
135
- });
136
- let logger;
137
- if (config.logger === true) logger = new DefaultLogger();
138
- else if (config.logger !== false) logger = config.logger;
139
- const relations = config.relations ?? {};
140
- const db = new SQLiteBunDatabase("sync", dialect, new SQLiteBunSession(client, dialect, relations, {
141
- logger,
142
- paramsInErrors: config.paramsInErrors
143
- }), relations);
144
- db.$client = client;
145
- return db;
146
- }
147
- __name(construct, "construct");
148
- function drizzle(...params) {
149
- if (params[0] === void 0 || typeof params[0] === "string") return construct(params[0] === void 0 ? new Database() : new Database(params[0]), params[1]);
150
- const { connection, client, ...DrizzleSQLiteConfig } = params[0];
151
- if (client) return construct(client, DrizzleSQLiteConfig);
152
- if (typeof connection === "object") {
153
- const { source, ...opts } = connection;
154
- const options = Object.values(opts).filter((v) => v !== void 0).length ? opts : void 0;
155
- return construct(new Database(source, options), DrizzleSQLiteConfig);
156
- }
157
- return construct(new Database(connection), DrizzleSQLiteConfig);
158
- }
159
- __name(drizzle, "drizzle");
160
- (function(_drizzle) {
161
- function mock(config) {
162
- return construct({}, config);
163
- }
164
- __name(mock, "mock");
165
- _drizzle.mock = mock;
166
- })(drizzle || (drizzle = {}));
167
- export {
168
- drizzle
169
- };
@@ -1,76 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- loadVectorExtension,
5
- vectorExtension
6
- } from "./chunk-G46PNDWL.js";
7
- import {
8
- refuseOwnerStoreInTests
9
- } from "./chunk-2R2EX5I6.js";
10
- import "./chunk-UXDUWGX6.js";
11
- import "./chunk-QPPOIWPY.js";
12
- import "./chunk-S4UUN6LD.js";
13
- import {
14
- importFrom
15
- } from "./chunk-Y5E2WNWB.js";
16
- import "./chunk-S6JG4YUH.js";
17
- import {
18
- __name
19
- } from "./chunk-ZVVMGPBJ.js";
20
-
21
- // 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/store/drivers/bun-sqlite.js
22
- var customised = false;
23
- var ownLibrary = /* @__PURE__ */ __name(async () => {
24
- try {
25
- const { libraryFor } = await importFrom(new URL("store/drivers/bun-sqlite.js", import.meta.resolve("@wirecat/cli-core")).href, "@wirecat/cli-core-sqlite");
26
- return libraryFor();
27
- } catch {
28
- return void 0;
29
- }
30
- }, "ownLibrary");
31
- var bunDatabase = /* @__PURE__ */ __name(async () => {
32
- const specifier = "bun:sqlite";
33
- const { Database } = await importFrom(new URL("store/drivers/bun-sqlite.js", import.meta.resolve("@wirecat/cli-core")).href, specifier);
34
- if (process.platform === "darwin" && !customised) {
35
- customised = true;
36
- const library = await ownLibrary();
37
- if (library)
38
- Database.setCustomSQLite(library);
39
- }
40
- return Database;
41
- }, "bunDatabase");
42
- var openWithBunSqlite = /* @__PURE__ */ __name(async (path) => cacheOverBunSqlite(await bunClient(path)), "openWithBunSqlite");
43
- var bunClient = /* @__PURE__ */ __name(async (path, options) => {
44
- refuseOwnerStoreInTests(path);
45
- const Database = await bunDatabase();
46
- const extension = await vectorExtension();
47
- const client = options ? new Database(path, options) : new Database(path);
48
- try {
49
- loadVectorExtension(client, extension);
50
- return client;
51
- } catch (error) {
52
- client.close();
53
- throw error;
54
- }
55
- }, "bunClient");
56
- var cacheOverBunSqlite = /* @__PURE__ */ __name((database) => {
57
- return {
58
- exec: /* @__PURE__ */ __name((sql) => database.exec(sql), "exec"),
59
- prepare: /* @__PURE__ */ __name((sql) => {
60
- const statement = database.query(sql);
61
- return {
62
- run: /* @__PURE__ */ __name((...parameters) => ({ changes: Number(statement.run(...parameters).changes) }), "run"),
63
- // Bun answers null for no row; the seam promises undefined, and `!== undefined` checks rely on it.
64
- get: /* @__PURE__ */ __name((...parameters) => statement.get(...parameters) ?? void 0, "get"),
65
- all: /* @__PURE__ */ __name((...parameters) => statement.all(...parameters), "all")
66
- };
67
- }, "prepare"),
68
- close: /* @__PURE__ */ __name(() => database.close(), "close")
69
- };
70
- }, "cacheOverBunSqlite");
71
- export {
72
- bunClient,
73
- bunDatabase,
74
- cacheOverBunSqlite,
75
- openWithBunSqlite
76
- };
@@ -1,54 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- resolvePaths
5
- } from "./chunk-UXDUWGX6.js";
6
- import {
7
- __name
8
- } from "./chunk-ZVVMGPBJ.js";
9
-
10
- // 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/store/path.js
11
- import { realpathSync } from "node:fs";
12
- import { userInfo } from "node:os";
13
- import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
14
- var wirecatDirectory = /* @__PURE__ */ __name((env = process.env, platform) => resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env, ...platform ? { platform } : {} }).state, "wirecatDirectory");
15
- var storePath = /* @__PURE__ */ __name((env = process.env) => env.MESSAGING_STORE ?? join(wirecatDirectory(env), "wirecat.db"), "storePath");
16
- var accountHome = /* @__PURE__ */ __name(() => {
17
- try {
18
- return userInfo().homedir;
19
- } catch {
20
- return void 0;
21
- }
22
- }, "accountHome");
23
- var inOwnerFolder = /* @__PURE__ */ __name((file, home = accountHome()) => {
24
- if (!home || file === ":memory:")
25
- return false;
26
- const owner = wirecatDirectory({ HOME: home, USERPROFILE: home });
27
- const within = /* @__PURE__ */ __name((path, folder) => {
28
- const inside = relative(folder, path);
29
- return !(inside.startsWith("..") || isAbsolute(inside));
30
- }, "within");
31
- return within(resolve(file), owner) || within(settled(resolve(file)), settled(owner));
32
- }, "inOwnerFolder");
33
- var settled = /* @__PURE__ */ __name((path) => {
34
- try {
35
- return realpathSync(path);
36
- } catch {
37
- const parent = dirname(path);
38
- return parent === path ? path : join(settled(parent), basename(path));
39
- }
40
- }, "settled");
41
- var refuseOwnerStoreInTests = /* @__PURE__ */ __name((file, env = process.env, home = accountHome()) => {
42
- if (!env.VITEST || !inOwnerFolder(file, home))
43
- return;
44
- throw new Error(`a test tried to open ${file}, in the owner's real WireCat folder; give it a MESSAGING_STORE or HOME of its own`);
45
- }, "refuseOwnerStoreInTests");
46
-
47
- export {
48
- wirecatDirectory,
49
- storePath,
50
- accountHome,
51
- inOwnerFolder,
52
- settled,
53
- refuseOwnerStoreInTests
54
- };