@talajs/mcp 0.0.0-stage → 0.2.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/LICENSE +202 -0
- package/README.md +54 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +35 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +222 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/format.d.ts +10 -0
- package/dist/tools/format.d.ts.map +1 -0
- package/dist/tools/format.js +29 -0
- package/dist/tools/format.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +7 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/read.d.ts +3 -0
- package/dist/tools/read.d.ts.map +1 -0
- package/dist/tools/read.js +366 -0
- package/dist/tools/read.js.map +1 -0
- package/dist/tools/types.d.ts +60 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +21 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/well-known.d.ts +17 -0
- package/dist/well-known.d.ts.map +1 -0
- package/dist/well-known.js +46 -0
- package/dist/well-known.js.map +1 -0
- package/package.json +64 -3
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { localTime, money, today } from './format.js';
|
|
3
|
+
import { defineTool, READ, ToolError } from './types.js';
|
|
4
|
+
const Id = z.uuid();
|
|
5
|
+
const Search = z.string().trim().min(1).max(100);
|
|
6
|
+
const Cursor = z.uuid().describe('`nextCursor` from the previous result, for the next page');
|
|
7
|
+
const Limit = z.number().int().min(1).max(100).default(25);
|
|
8
|
+
const LocalDate = z.iso.date().describe("A date in the store's time zone, YYYY-MM-DD");
|
|
9
|
+
const STORE_HINT = 'Optional when the business has one store; otherwise pass a store id from get_business_overview.';
|
|
10
|
+
function storeOf(ctx, storeId) {
|
|
11
|
+
if (storeId) {
|
|
12
|
+
const store = ctx.stores.find((s) => s.id === storeId);
|
|
13
|
+
if (!store)
|
|
14
|
+
throw new ToolError('not_found', 'Unknown store, or not one you can access');
|
|
15
|
+
return store;
|
|
16
|
+
}
|
|
17
|
+
if (ctx.stores.length === 1)
|
|
18
|
+
return ctx.stores[0];
|
|
19
|
+
throw new ToolError('store_required', `Which store? ${ctx.stores.map((s) => `${s.name} (${s.id})`).join(', ') || 'There are none yet.'}`);
|
|
20
|
+
}
|
|
21
|
+
const page = (p, map) => ({
|
|
22
|
+
results: p.data.map(map),
|
|
23
|
+
nextCursor: p.nextCursor,
|
|
24
|
+
});
|
|
25
|
+
const variantOut = (v) => ({
|
|
26
|
+
id: v.id,
|
|
27
|
+
name: v.name,
|
|
28
|
+
price: money(v.priceMinor, v.currency),
|
|
29
|
+
sku: v.sku,
|
|
30
|
+
stockLevelId: v.stockLevelId,
|
|
31
|
+
});
|
|
32
|
+
const groupOut = (g) => ({
|
|
33
|
+
id: g.id,
|
|
34
|
+
name: g.name,
|
|
35
|
+
minSelect: g.minSelect,
|
|
36
|
+
maxSelect: g.maxSelect,
|
|
37
|
+
options: g.modifiers.map((m) => ({
|
|
38
|
+
id: m.id,
|
|
39
|
+
name: m.name,
|
|
40
|
+
priceDeltaMinor: m.priceDeltaMinor,
|
|
41
|
+
stockLevelId: m.stockLevelId,
|
|
42
|
+
})),
|
|
43
|
+
});
|
|
44
|
+
const STOCK_NOTE = 'Counts move with manual adjustments and with sales of variants or modifier options linked to this stock level, one unit per item sold. Tala has no recipes yet, so ingredients used in amounts (grams of beans, ml of milk) only change when counted by hand.';
|
|
45
|
+
export const readTools = [
|
|
46
|
+
defineTool({
|
|
47
|
+
name: 'get_business_overview',
|
|
48
|
+
title: 'Business overview',
|
|
49
|
+
description: 'The business, its stores (currency, time zone, whether prices include tax) and tax rates, and your role. Call this first to learn store ids and time zones.',
|
|
50
|
+
scope: READ,
|
|
51
|
+
role: 'STAFF',
|
|
52
|
+
readOnly: true,
|
|
53
|
+
input: z.object({}),
|
|
54
|
+
async run(ctx) {
|
|
55
|
+
const [tenant, stores, taxRates] = await Promise.all([
|
|
56
|
+
ctx.get(''),
|
|
57
|
+
ctx.get('/stores', { limit: 100 }),
|
|
58
|
+
ctx.get('/tax-rates', {
|
|
59
|
+
limit: 100,
|
|
60
|
+
}),
|
|
61
|
+
]);
|
|
62
|
+
return {
|
|
63
|
+
business: { id: tenant.id, name: tenant.name, currency: tenant.defaultCurrency },
|
|
64
|
+
yourRole: ctx.role,
|
|
65
|
+
canWrite: ctx.scopes.includes('tala:write'),
|
|
66
|
+
stores: stores.data.map((s) => ({
|
|
67
|
+
id: s.id,
|
|
68
|
+
name: s.name,
|
|
69
|
+
currency: s.currency,
|
|
70
|
+
timezone: s.timezone,
|
|
71
|
+
pricesIncludeTax: s.pricesIncludeTax,
|
|
72
|
+
today: today(s.timezone),
|
|
73
|
+
})),
|
|
74
|
+
taxRates: taxRates.data.map((t) => ({ id: t.id, name: t.name, percent: t.rateBps / 100 })),
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
defineTool({
|
|
79
|
+
name: 'list_categories',
|
|
80
|
+
title: 'List categories',
|
|
81
|
+
description: 'Menu categories, optionally filtered by name.',
|
|
82
|
+
scope: READ,
|
|
83
|
+
role: 'STAFF',
|
|
84
|
+
readOnly: true,
|
|
85
|
+
input: z.object({ q: Search.optional(), cursor: Cursor.optional(), limit: Limit }),
|
|
86
|
+
async run(ctx, input) {
|
|
87
|
+
const p = await ctx.get('/categories', input);
|
|
88
|
+
return page(p, (c) => ({ id: c.id, name: c.name, parentId: c.parentId }));
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
defineTool({
|
|
92
|
+
name: 'list_items',
|
|
93
|
+
title: 'List menu items',
|
|
94
|
+
description: 'Menu items with their variants (sizes) and prices. Search by name with `q` (case-insensitive, partial), or filter by category.',
|
|
95
|
+
scope: READ,
|
|
96
|
+
role: 'STAFF',
|
|
97
|
+
readOnly: true,
|
|
98
|
+
input: z.object({
|
|
99
|
+
q: Search.optional(),
|
|
100
|
+
categoryId: Id.optional(),
|
|
101
|
+
cursor: Cursor.optional(),
|
|
102
|
+
limit: Limit,
|
|
103
|
+
}),
|
|
104
|
+
async run(ctx, input) {
|
|
105
|
+
const p = await ctx.get('/items', input);
|
|
106
|
+
return page(p, (i) => ({
|
|
107
|
+
id: i.id,
|
|
108
|
+
name: i.name,
|
|
109
|
+
variants: i.variants.map(variantOut),
|
|
110
|
+
modifierGroupIds: i.modifierGroupIds,
|
|
111
|
+
}));
|
|
112
|
+
},
|
|
113
|
+
}),
|
|
114
|
+
defineTool({
|
|
115
|
+
name: 'get_item',
|
|
116
|
+
title: 'Get a menu item',
|
|
117
|
+
description: 'One menu item with variants, prices, categories, and its modifier groups with every option and price change.',
|
|
118
|
+
scope: READ,
|
|
119
|
+
role: 'STAFF',
|
|
120
|
+
readOnly: true,
|
|
121
|
+
input: z.object({ id: Id }),
|
|
122
|
+
async run(ctx, { id }) {
|
|
123
|
+
const item = await ctx.get(`/items/${id}`);
|
|
124
|
+
const groups = await Promise.all(item.modifierGroupIds.map((g) => ctx.get(`/modifier-groups/${g}`)));
|
|
125
|
+
return {
|
|
126
|
+
id: item.id,
|
|
127
|
+
name: item.name,
|
|
128
|
+
description: item.description,
|
|
129
|
+
taxRateId: item.taxRateId,
|
|
130
|
+
categoryIds: item.categoryIds,
|
|
131
|
+
variants: item.variants.map(variantOut),
|
|
132
|
+
modifierGroups: groups.map(groupOut),
|
|
133
|
+
currency: ctx.currency,
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
}),
|
|
137
|
+
defineTool({
|
|
138
|
+
name: 'list_modifier_groups',
|
|
139
|
+
title: 'List modifier groups',
|
|
140
|
+
description: 'Modifier groups (e.g. milk choice, extra shots) with their options and price changes in minor units. Search by name with `q`.',
|
|
141
|
+
scope: READ,
|
|
142
|
+
role: 'STAFF',
|
|
143
|
+
readOnly: true,
|
|
144
|
+
input: z.object({ q: Search.optional(), cursor: Cursor.optional(), limit: Limit }),
|
|
145
|
+
async run(ctx, input) {
|
|
146
|
+
return page(await ctx.get('/modifier-groups', input), groupOut);
|
|
147
|
+
},
|
|
148
|
+
}),
|
|
149
|
+
defineTool({
|
|
150
|
+
name: 'get_modifier_group',
|
|
151
|
+
title: 'Get a modifier group',
|
|
152
|
+
description: 'One modifier group with its options, and the menu items it is attached to. Pair with modifier_usage to judge whether the options suit how customers order.',
|
|
153
|
+
scope: READ,
|
|
154
|
+
role: 'STAFF',
|
|
155
|
+
readOnly: true,
|
|
156
|
+
input: z.object({ id: Id }),
|
|
157
|
+
async run(ctx, { id }) {
|
|
158
|
+
const group = await ctx.get(`/modifier-groups/${id}`);
|
|
159
|
+
const items = [];
|
|
160
|
+
let cursor;
|
|
161
|
+
do {
|
|
162
|
+
const p = await ctx.get('/items', { limit: 200, cursor });
|
|
163
|
+
for (const i of p.data)
|
|
164
|
+
if (i.modifierGroupIds.includes(id))
|
|
165
|
+
items.push({ id: i.id, name: i.name });
|
|
166
|
+
cursor = p.nextCursor ?? undefined;
|
|
167
|
+
} while (cursor && items.length < 200);
|
|
168
|
+
return { ...groupOut(group), currency: ctx.currency, usedBy: items };
|
|
169
|
+
},
|
|
170
|
+
}),
|
|
171
|
+
defineTool({
|
|
172
|
+
name: 'list_stock_levels',
|
|
173
|
+
title: 'List stock levels',
|
|
174
|
+
description: `Inventory counts per store. Search by name with \`q\`: "espresso" finds "Espresso beans (Bourbon)". ${STOCK_NOTE}`,
|
|
175
|
+
scope: READ,
|
|
176
|
+
role: 'STAFF',
|
|
177
|
+
readOnly: true,
|
|
178
|
+
input: z.object({
|
|
179
|
+
q: Search.optional(),
|
|
180
|
+
storeId: Id.optional(),
|
|
181
|
+
cursor: Cursor.optional(),
|
|
182
|
+
limit: Limit,
|
|
183
|
+
}),
|
|
184
|
+
async run(ctx, input) {
|
|
185
|
+
const p = await ctx.get('/stock-levels', input);
|
|
186
|
+
return page(p, (s) => ({
|
|
187
|
+
id: s.id,
|
|
188
|
+
name: s.name,
|
|
189
|
+
storeId: s.storeId,
|
|
190
|
+
onHand: s.onHand,
|
|
191
|
+
unit: s.unit,
|
|
192
|
+
trackStrictly: s.trackStrictly,
|
|
193
|
+
}));
|
|
194
|
+
},
|
|
195
|
+
}),
|
|
196
|
+
defineTool({
|
|
197
|
+
name: 'get_stock_level',
|
|
198
|
+
title: 'Get a stock level',
|
|
199
|
+
description: `One stock level with its recent movements (sales, adjustments, recounts). ${STOCK_NOTE}`,
|
|
200
|
+
scope: READ,
|
|
201
|
+
role: 'STAFF',
|
|
202
|
+
readOnly: true,
|
|
203
|
+
input: z.object({ id: Id }),
|
|
204
|
+
async run(ctx, { id }) {
|
|
205
|
+
const level = await ctx.get(`/stock-levels/${id}`);
|
|
206
|
+
const movements = await ctx.get(`/stock-levels/${id}/movements`, {
|
|
207
|
+
limit: 20,
|
|
208
|
+
});
|
|
209
|
+
const tz = ctx.stores.find((s) => s.id === level.storeId)?.timezone ?? 'UTC';
|
|
210
|
+
return {
|
|
211
|
+
id: level.id,
|
|
212
|
+
name: level.name,
|
|
213
|
+
storeId: level.storeId,
|
|
214
|
+
onHand: level.onHand,
|
|
215
|
+
unit: level.unit,
|
|
216
|
+
trackStrictly: level.trackStrictly,
|
|
217
|
+
lastCounted: localTime(level.updatedAt, tz),
|
|
218
|
+
recentMovements: movements.data.map((m) => ({
|
|
219
|
+
delta: m.delta,
|
|
220
|
+
reason: m.reason,
|
|
221
|
+
note: m.note,
|
|
222
|
+
at: localTime(m.createdAt, tz),
|
|
223
|
+
})),
|
|
224
|
+
note: STOCK_NOTE,
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
}),
|
|
228
|
+
defineTool({
|
|
229
|
+
name: 'sales_summary',
|
|
230
|
+
title: 'Sales summary',
|
|
231
|
+
description: `Completed sales between two dates (inclusive, store time zone): totals plus rows by day, by item, or by payment method. At most 366 days. ${STORE_HINT}`,
|
|
232
|
+
scope: READ,
|
|
233
|
+
role: 'STAFF',
|
|
234
|
+
readOnly: true,
|
|
235
|
+
input: z.object({
|
|
236
|
+
storeId: Id.optional(),
|
|
237
|
+
from: LocalDate,
|
|
238
|
+
to: LocalDate,
|
|
239
|
+
groupBy: z.enum(['day', 'item', 'payment_method']).default('day'),
|
|
240
|
+
}),
|
|
241
|
+
async run(ctx, input) {
|
|
242
|
+
const store = storeOf(ctx, input.storeId);
|
|
243
|
+
const r = await ctx.get('/reports/sales', { ...input, storeId: store.id });
|
|
244
|
+
const m = (minor) => money(minor, r.currency);
|
|
245
|
+
return {
|
|
246
|
+
store: { id: store.id, name: store.name, timezone: r.timezone },
|
|
247
|
+
from: r.from,
|
|
248
|
+
to: r.to,
|
|
249
|
+
totals: {
|
|
250
|
+
orders: r.totals.orders,
|
|
251
|
+
subtotal: m(r.totals.subtotalMinor),
|
|
252
|
+
discounts: m(r.totals.discountMinor),
|
|
253
|
+
tax: m(r.totals.taxMinor),
|
|
254
|
+
total: m(r.totals.totalMinor),
|
|
255
|
+
tips: m(r.totals.tipMinor),
|
|
256
|
+
refunded: m(r.totals.refundedMinor),
|
|
257
|
+
},
|
|
258
|
+
groupBy: r.groupBy,
|
|
259
|
+
rows: r.rows.map(({ amountMinor, tipMinor, ...row }) => ({
|
|
260
|
+
...row,
|
|
261
|
+
amount: m(amountMinor),
|
|
262
|
+
...(tipMinor === undefined ? {} : { tips: m(tipMinor) }),
|
|
263
|
+
})),
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
}),
|
|
267
|
+
defineTool({
|
|
268
|
+
name: 'modifier_usage',
|
|
269
|
+
title: 'Modifier usage',
|
|
270
|
+
description: `How often each modifier option was chosen, per item, between two dates (store time zone), from real sales: units sold, count and share per option, and (with modifierGroupId) the group's options never chosen. Use it to judge whether a modifier group is set up well. ${STORE_HINT}`,
|
|
271
|
+
scope: READ,
|
|
272
|
+
role: 'STAFF',
|
|
273
|
+
readOnly: true,
|
|
274
|
+
input: z.object({
|
|
275
|
+
storeId: Id.optional(),
|
|
276
|
+
from: LocalDate,
|
|
277
|
+
to: LocalDate,
|
|
278
|
+
modifierGroupId: Id.optional(),
|
|
279
|
+
}),
|
|
280
|
+
async run(ctx, input) {
|
|
281
|
+
const store = storeOf(ctx, input.storeId);
|
|
282
|
+
const r = await ctx.get('/reports/modifier-usage', {
|
|
283
|
+
...input,
|
|
284
|
+
storeId: store.id,
|
|
285
|
+
});
|
|
286
|
+
return { store: { id: store.id, name: store.name, timezone: store.timezone }, ...r };
|
|
287
|
+
},
|
|
288
|
+
}),
|
|
289
|
+
defineTool({
|
|
290
|
+
name: 'list_orders',
|
|
291
|
+
title: 'List orders',
|
|
292
|
+
description: 'Recent orders and open tabs, newest first, with totals and status. Filter by store, status (OPEN, COMPLETED, VOIDED) or tabs only.',
|
|
293
|
+
scope: READ,
|
|
294
|
+
role: 'STAFF',
|
|
295
|
+
readOnly: true,
|
|
296
|
+
input: z.object({
|
|
297
|
+
storeId: Id.optional(),
|
|
298
|
+
status: z.enum(['OPEN', 'COMPLETED', 'VOIDED']).optional(),
|
|
299
|
+
isTab: z.boolean().optional(),
|
|
300
|
+
cursor: Cursor.optional(),
|
|
301
|
+
limit: Limit,
|
|
302
|
+
}),
|
|
303
|
+
async run(ctx, input) {
|
|
304
|
+
const p = await ctx.get('/orders', input);
|
|
305
|
+
return page(p, (o) => {
|
|
306
|
+
const tz = ctx.stores.find((s) => s.id === o.storeId)?.timezone ?? 'UTC';
|
|
307
|
+
return {
|
|
308
|
+
id: o.id,
|
|
309
|
+
number: o.number,
|
|
310
|
+
storeId: o.storeId,
|
|
311
|
+
status: o.status,
|
|
312
|
+
tab: o.isTab ? o.tabName : null,
|
|
313
|
+
total: money(o.totalMinor, o.currency),
|
|
314
|
+
openedAt: localTime(o.openedAt, tz),
|
|
315
|
+
completedAt: localTime(o.completedAt, tz),
|
|
316
|
+
};
|
|
317
|
+
});
|
|
318
|
+
},
|
|
319
|
+
}),
|
|
320
|
+
defineTool({
|
|
321
|
+
name: 'get_order',
|
|
322
|
+
title: 'Get an order',
|
|
323
|
+
description: 'One order with its lines, modifiers, payments and refunds.',
|
|
324
|
+
scope: READ,
|
|
325
|
+
role: 'STAFF',
|
|
326
|
+
readOnly: true,
|
|
327
|
+
input: z.object({ id: Id }),
|
|
328
|
+
async run(ctx, { id }) {
|
|
329
|
+
const o = await ctx.get(`/orders/${id}`);
|
|
330
|
+
const tz = ctx.stores.find((s) => s.id === o.storeId)?.timezone ?? 'UTC';
|
|
331
|
+
const m = (minor) => money(minor, o.currency);
|
|
332
|
+
return {
|
|
333
|
+
id: o.id,
|
|
334
|
+
number: o.number,
|
|
335
|
+
storeId: o.storeId,
|
|
336
|
+
status: o.status,
|
|
337
|
+
tab: o.isTab ? o.tabName : null,
|
|
338
|
+
note: o.note,
|
|
339
|
+
openedAt: localTime(o.openedAt, tz),
|
|
340
|
+
completedAt: localTime(o.completedAt, tz),
|
|
341
|
+
totals: {
|
|
342
|
+
subtotal: m(o.subtotalMinor),
|
|
343
|
+
discount: m(o.discountMinor),
|
|
344
|
+
tax: m(o.taxMinor),
|
|
345
|
+
total: m(o.totalMinor),
|
|
346
|
+
tip: m(o.tipMinor),
|
|
347
|
+
},
|
|
348
|
+
lines: o.lines.map((l) => ({
|
|
349
|
+
item: l.variantName ? `${l.itemName} (${l.variantName})` : l.itemName,
|
|
350
|
+
quantity: l.quantity,
|
|
351
|
+
modifiers: l.modifiers.map((x) => x.name),
|
|
352
|
+
total: m(l.lineTotalMinor),
|
|
353
|
+
voided: l.voidedAt !== null,
|
|
354
|
+
})),
|
|
355
|
+
payments: o.payments.map((p) => ({
|
|
356
|
+
method: p.method,
|
|
357
|
+
status: p.status,
|
|
358
|
+
amount: m(p.amountMinor),
|
|
359
|
+
tip: m(p.tipMinor),
|
|
360
|
+
})),
|
|
361
|
+
refunds: o.refunds.map((r) => ({ amount: m(r.amountMinor), status: r.status })),
|
|
362
|
+
};
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;iBACnB;gBACD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBACzB,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ;oBACrE,QAAQ,EAAE,CAAC,CAAC,QAAQ;oBACpB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;oBACzC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;oBAC1B,MAAM,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI;iBAC5B,CAAC,CAAC;gBACH,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBAC/B,MAAM,EAAE,CAAC,CAAC,MAAM;oBAChB,MAAM,EAAE,CAAC,CAAC,MAAM;oBAChB,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;oBACxB,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;iBACnB,CAAC,CAAC;gBACH,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;aAChF,CAAA;QACH,CAAC;KACF,CAAC;CACH,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { MemberRole } from '@talajs/contracts';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
export declare const READ = "tala:read";
|
|
4
|
+
export declare const WRITE = "tala:write";
|
|
5
|
+
export type Scope = typeof READ | typeof WRITE;
|
|
6
|
+
export interface Query {
|
|
7
|
+
[key: string]: string | number | boolean | undefined | null;
|
|
8
|
+
}
|
|
9
|
+
/** A failed API call, with the API's error code and message (never secrets). */
|
|
10
|
+
export declare class ToolError extends Error {
|
|
11
|
+
readonly code: string;
|
|
12
|
+
readonly status: number;
|
|
13
|
+
constructor(code: string, message: string, status?: number);
|
|
14
|
+
}
|
|
15
|
+
export interface StoreInfo {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
currency: string;
|
|
19
|
+
timezone: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* What a tool may use: the Tala REST API, called as the person (their role, their stores, their
|
|
23
|
+
* business), plus a little context. Tools never touch the database directly, so they can't reach
|
|
24
|
+
* anything the person couldn't reach in the admin.
|
|
25
|
+
*/
|
|
26
|
+
export interface ToolContext {
|
|
27
|
+
tenantId: string;
|
|
28
|
+
tenantName: string;
|
|
29
|
+
currency: string;
|
|
30
|
+
role: MemberRole;
|
|
31
|
+
scopes: readonly string[];
|
|
32
|
+
/** Stores the person can work in. */
|
|
33
|
+
stores: StoreInfo[];
|
|
34
|
+
/** Tenant-relative API calls, e.g. `get('/items', { q: 'latte' })`. */
|
|
35
|
+
get<T>(path: string, query?: Query): Promise<T>;
|
|
36
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
37
|
+
patch<T>(path: string, body: unknown): Promise<T>;
|
|
38
|
+
del<T>(path: string): Promise<T>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A tool, independent of MCP: the admin's future chat panel can list and run the same tools.
|
|
42
|
+
* `role` and `scope` are checked before `run`; the API checks again on every call it makes.
|
|
43
|
+
*/
|
|
44
|
+
export interface TalaTool<I extends z.ZodObject = z.ZodObject> {
|
|
45
|
+
name: string;
|
|
46
|
+
title: string;
|
|
47
|
+
/** For the model: what it does and when to use it. */
|
|
48
|
+
description: string;
|
|
49
|
+
scope: Scope;
|
|
50
|
+
role: MemberRole;
|
|
51
|
+
input: I;
|
|
52
|
+
readOnly: boolean;
|
|
53
|
+
/** Changes data (only `apply_proposal`); clients that honour hints ask the person first. */
|
|
54
|
+
destructive?: boolean;
|
|
55
|
+
run(ctx: ToolContext, input: z.output<I>): Promise<unknown>;
|
|
56
|
+
}
|
|
57
|
+
/** Tools this person may use with these scopes. */
|
|
58
|
+
export declare function toolsFor(tools: readonly TalaTool[], role: MemberRole, scopes: readonly string[]): TalaTool<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>[];
|
|
59
|
+
export declare const defineTool: <I extends z.ZodObject>(tool: TalaTool<I>) => TalaTool;
|
|
60
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,eAAO,MAAM,IAAI,cAAc,CAAA;AAC/B,eAAO,MAAM,KAAK,eAAe,CAAA;AACjC,MAAM,MAAM,KAAK,GAAG,OAAO,IAAI,GAAG,OAAO,KAAK,CAAA;AAE9C,MAAM,WAAW,KAAK;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAA;CAC5D;AAED,gFAAgF;AAChF,qBAAa,SAAU,SAAQ,KAAK;IAEhC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAErB,QAAQ,CAAC,MAAM;IAHjB,YACW,IAAI,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACN,MAAM,SAAM,EAGtB;CACF;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB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C5D;AAID,mDAAmD;AACnD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,iEAI/F;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,CAAC,CAAC,SAAS,QAAQ,QAAQ,CAAC,CAAC,CAAC,KAAwB,QAAQ,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const READ = 'tala:read';
|
|
2
|
+
export const WRITE = 'tala:write';
|
|
3
|
+
/** A failed API call, with the API's error code and message (never secrets). */
|
|
4
|
+
export class ToolError extends Error {
|
|
5
|
+
code;
|
|
6
|
+
status;
|
|
7
|
+
constructor(code, message, status = 400) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.code = code;
|
|
10
|
+
this.status = status;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const RANK = { STAFF: 1, MANAGER: 2, OWNER: 3 };
|
|
14
|
+
/** Tools this person may use with these scopes. */
|
|
15
|
+
export function toolsFor(tools, role, scopes) {
|
|
16
|
+
const write = scopes.includes(WRITE);
|
|
17
|
+
const read = write || scopes.includes(READ);
|
|
18
|
+
return tools.filter((t) => RANK[role] >= RANK[t.role] && (t.scope === WRITE ? write : read));
|
|
19
|
+
}
|
|
20
|
+
export const defineTool = (tool) => tool;
|
|
21
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAA;AAC/B,MAAM,CAAC,MAAM,KAAK,GAAG,YAAY,CAAA;AAOjC,gFAAgF;AAChF,MAAM,OAAO,SAAU,SAAQ,KAAK;IAEvB,IAAI;IAEJ,MAAM;IAHjB,YACW,IAAY,EACrB,OAAe,EACN,MAAM,GAAG,GAAG;QAErB,KAAK,CAAC,OAAO,CAAC,CAAA;oBAJL,IAAI;sBAEJ,MAAM;IAGjB,CAAC;CACF;AA+CD,MAAM,IAAI,GAA+B,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;AAE3E,mDAAmD;AACnD,MAAM,UAAU,QAAQ,CAAC,KAA0B,EAAE,IAAgB,EAAE,MAAyB;IAC9F,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IACpC,MAAM,IAAI,GAAG,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC3C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;AAC9F,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CAAwB,IAAiB,EAAE,EAAE,CAAC,IAA2B,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type TalaAuth } from '@talajs/auth';
|
|
2
|
+
/** RFC 9728: where clients find the metadata for a resource URL (path-suffixed form). */
|
|
3
|
+
export declare const protectedResourceMetadataUrl: (resource: string) => string;
|
|
4
|
+
/**
|
|
5
|
+
* Discovery documents for MCP clients, served from the origin root. Mount it at
|
|
6
|
+
* `/.well-known/*`; it answers only the paths below and returns 404 for anything else, so you
|
|
7
|
+
* can fall through to your own `.well-known` files:
|
|
8
|
+
*
|
|
9
|
+
* - `/.well-known/oauth-protected-resource/<mcp path>` and `/.well-known/oauth-protected-resource`
|
|
10
|
+
* (RFC 9728), naming the MCP URL and its authorization server;
|
|
11
|
+
* - `/.well-known/oauth-authorization-server/<auth path>`, plus the root form when the issuer
|
|
12
|
+
* has no path (RFC 8414), and `/.well-known/openid-configuration/<auth path>`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function talaWellKnown<E>({ auth }: {
|
|
15
|
+
auth: TalaAuth<E>;
|
|
16
|
+
}): (request: Request, env: E) => Promise<Response>;
|
|
17
|
+
//# sourceMappingURL=well-known.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"well-known.d.ts","sourceRoot":"","sources":["../src/well-known.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAA;AAM1D,yFAAyF;AACzF,eAAO,MAAM,4BAA4B,aAAc,MAAM,WAG5D,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;CAAE,aACrB,OAAO,OAAO,CAAC,KAAG,OAAO,CAAC,QAAQ,CAAC,CA6B7E"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { OAUTH_SCOPES } from '@talajs/auth';
|
|
2
|
+
const PRM = '/.well-known/oauth-protected-resource';
|
|
3
|
+
const ASM = '/.well-known/oauth-authorization-server';
|
|
4
|
+
const OIDC = '/.well-known/openid-configuration';
|
|
5
|
+
/** RFC 9728: where clients find the metadata for a resource URL (path-suffixed form). */
|
|
6
|
+
export const protectedResourceMetadataUrl = (resource) => {
|
|
7
|
+
const url = new URL(resource);
|
|
8
|
+
return `${url.origin}${PRM}${url.pathname === '/' ? '' : url.pathname}`;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Discovery documents for MCP clients, served from the origin root. Mount it at
|
|
12
|
+
* `/.well-known/*`; it answers only the paths below and returns 404 for anything else, so you
|
|
13
|
+
* can fall through to your own `.well-known` files:
|
|
14
|
+
*
|
|
15
|
+
* - `/.well-known/oauth-protected-resource/<mcp path>` and `/.well-known/oauth-protected-resource`
|
|
16
|
+
* (RFC 9728), naming the MCP URL and its authorization server;
|
|
17
|
+
* - `/.well-known/oauth-authorization-server/<auth path>`, plus the root form when the issuer
|
|
18
|
+
* has no path (RFC 8414), and `/.well-known/openid-configuration/<auth path>`.
|
|
19
|
+
*/
|
|
20
|
+
export function talaWellKnown({ auth }) {
|
|
21
|
+
return async function wellKnown(request, env) {
|
|
22
|
+
const settings = auth.oauth(env);
|
|
23
|
+
if (!settings || request.method !== 'GET')
|
|
24
|
+
return new Response('Not found', { status: 404 });
|
|
25
|
+
const path = new URL(request.url).pathname.replace(/\/$/, '');
|
|
26
|
+
const resource = new URL(settings.resource);
|
|
27
|
+
const issuer = new URL(auth.baseURL(env).replace(/\/$/, ''));
|
|
28
|
+
const issuerPath = issuer.pathname === '/' ? '' : issuer.pathname;
|
|
29
|
+
if (path === `${PRM}${resource.pathname}` || path === PRM) {
|
|
30
|
+
return Response.json({
|
|
31
|
+
resource: settings.resource,
|
|
32
|
+
authorization_servers: [issuer.href],
|
|
33
|
+
scopes_supported: [...OAUTH_SCOPES],
|
|
34
|
+
bearer_methods_supported: ['header'],
|
|
35
|
+
resource_name: 'Tala',
|
|
36
|
+
}, { headers: { 'cache-control': 'public, max-age=300' } });
|
|
37
|
+
}
|
|
38
|
+
const forward = (wellKnownPath) => auth.handler(new Request(`${issuer.href}${wellKnownPath}`, { headers: { accept: 'application/json' } }), env);
|
|
39
|
+
if (path === `${ASM}${issuerPath}` || (path === ASM && !issuerPath))
|
|
40
|
+
return forward(ASM);
|
|
41
|
+
if (path === `${OIDC}${issuerPath}`)
|
|
42
|
+
return forward(OIDC);
|
|
43
|
+
return new Response('Not found', { status: 404 });
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=well-known.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"well-known.js","sourceRoot":"","sources":["../src/well-known.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiB,MAA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MCP server for Tala: merchants manage their business from Claude and other MCP clients.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"homepage": "https://github.com/NovaDovaDao/talajs/tree/main/packages/mcp#readme",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/NovaDovaDao/talajs/issues"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"mcp",
|
|
12
|
+
"model-context-protocol",
|
|
13
|
+
"claude",
|
|
14
|
+
"oauth",
|
|
15
|
+
"cloudflare-workers",
|
|
16
|
+
"pos",
|
|
17
|
+
"commerce"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/NovaDovaDao/talajs.git",
|
|
23
|
+
"directory": "packages/mcp"
|
|
24
|
+
},
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"default": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./tools": {
|
|
32
|
+
"types": "./dist/tools/index.d.ts",
|
|
33
|
+
"default": "./dist/tools/index.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist"
|
|
38
|
+
],
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@cfworker/json-schema": "4.1.6",
|
|
41
|
+
"@modelcontextprotocol/sdk": "1.32.2",
|
|
42
|
+
"zod": "^4.6.7",
|
|
43
|
+
"@talajs/api": "0.2.0",
|
|
44
|
+
"@talajs/contracts": "0.2.0",
|
|
45
|
+
"@talajs/db": "0.2.0",
|
|
46
|
+
"@talajs/auth": "0.2.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@cloudflare/vitest-plugin": "1.8.2",
|
|
50
|
+
"@cloudflare/workers-types": "^5.20261118.1",
|
|
51
|
+
"@types/pg": "^8.23.1",
|
|
52
|
+
"hono": "^4.13.18",
|
|
53
|
+
"pg": "^8.23.1",
|
|
54
|
+
"wrangler": "4.162.0"
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=22"
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsc -p tsconfig.build.json",
|
|
64
|
+
"typecheck": "tsc --noEmit",
|
|
65
|
+
"test": "vitest run"
|
|
66
|
+
}
|
|
6
67
|
}
|