@voyant-travel/mice 0.14.0 → 0.16.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/dist/mcp-runtime.d.ts +2 -0
- package/dist/mcp-runtime.js +17 -0
- package/dist/tools.d.ts +293 -0
- package/dist/tools.js +124 -0
- package/dist/voyant.js +80 -0
- package/package.json +21 -10
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineToolContextContribution } from "@voyant-travel/tools";
|
|
2
|
+
import { miceService } from "./service.js";
|
|
3
|
+
export * from "./tools.js";
|
|
4
|
+
export const voyantToolContextContribution = defineToolContextContribution({
|
|
5
|
+
context: ["mice"],
|
|
6
|
+
contribute: ({ context }) => {
|
|
7
|
+
const db = context.db;
|
|
8
|
+
return {
|
|
9
|
+
mice: {
|
|
10
|
+
listPrograms: (query) => miceService.listPrograms(db, query),
|
|
11
|
+
getProgram: (id) => miceService.getProgram(db, id),
|
|
12
|
+
createProgram: (input) => miceService.createProgram(db, input),
|
|
13
|
+
updateProgram: ({ id, ...input }) => miceService.updateProgram(db, id, input),
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
});
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/** Module-owned Tools for the MICE program lifecycle. */
|
|
2
|
+
import { type ToolContext } from "@voyant-travel/tools";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { createProgramSchema, programListQuerySchema } from "./validation.js";
|
|
5
|
+
declare const updateProgramToolSchema: z.ZodIntersection<z.ZodObject<{
|
|
6
|
+
name: z.ZodOptional<z.ZodString>;
|
|
7
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
8
|
+
other: "other";
|
|
9
|
+
meeting: "meeting";
|
|
10
|
+
incentive: "incentive";
|
|
11
|
+
conference: "conference";
|
|
12
|
+
exhibition: "exhibition";
|
|
13
|
+
}>>;
|
|
14
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
lead: "lead";
|
|
16
|
+
planning: "planning";
|
|
17
|
+
contracted: "contracted";
|
|
18
|
+
operating: "operating";
|
|
19
|
+
completed: "completed";
|
|
20
|
+
cancelled: "cancelled";
|
|
21
|
+
}>>;
|
|
22
|
+
organizationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
primaryContactPersonId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
accountManagerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
destination: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
startDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
endDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
estimatedPax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
30
|
+
confirmedPax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
31
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
budgetAmountCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
33
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
+
id: z.ZodString;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
type ProgramListQuery = z.infer<typeof programListQuerySchema>;
|
|
37
|
+
type CreateProgramInput = z.infer<typeof createProgramSchema>;
|
|
38
|
+
type UpdateProgramInput = z.infer<typeof updateProgramToolSchema>;
|
|
39
|
+
export interface MiceToolServices {
|
|
40
|
+
listPrograms(query: ProgramListQuery): Promise<unknown>;
|
|
41
|
+
getProgram(id: string): Promise<unknown>;
|
|
42
|
+
createProgram(input: CreateProgramInput): Promise<unknown>;
|
|
43
|
+
updateProgram(input: UpdateProgramInput): Promise<unknown>;
|
|
44
|
+
}
|
|
45
|
+
export type MiceToolContext = ToolContext & {
|
|
46
|
+
mice?: MiceToolServices;
|
|
47
|
+
};
|
|
48
|
+
export declare const listMiceProgramsTool: import("@voyant-travel/tools").ToolDefinition<{
|
|
49
|
+
limit: number;
|
|
50
|
+
offset: number;
|
|
51
|
+
status?: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled" | undefined;
|
|
52
|
+
type?: "other" | "meeting" | "incentive" | "conference" | "exhibition" | undefined;
|
|
53
|
+
organizationId?: string | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
data: {
|
|
56
|
+
id: string;
|
|
57
|
+
organizationId: string | null;
|
|
58
|
+
primaryContactPersonId: string | null;
|
|
59
|
+
accountManagerId: string | null;
|
|
60
|
+
name: string;
|
|
61
|
+
code: string | null;
|
|
62
|
+
type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
|
|
63
|
+
status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
|
|
64
|
+
destination: string | null;
|
|
65
|
+
startDate: string | null;
|
|
66
|
+
endDate: string | null;
|
|
67
|
+
estimatedPax: number | null;
|
|
68
|
+
confirmedPax: number | null;
|
|
69
|
+
currency: string | null;
|
|
70
|
+
budgetAmountCents: number | null;
|
|
71
|
+
metadata: Record<string, unknown> | null;
|
|
72
|
+
createdAt: string;
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
}[];
|
|
75
|
+
limit: number;
|
|
76
|
+
offset: number;
|
|
77
|
+
}, MiceToolContext>;
|
|
78
|
+
export declare const getMiceProgramTool: import("@voyant-travel/tools").ToolDefinition<{
|
|
79
|
+
id: string;
|
|
80
|
+
}, {
|
|
81
|
+
id: string;
|
|
82
|
+
organizationId: string | null;
|
|
83
|
+
primaryContactPersonId: string | null;
|
|
84
|
+
accountManagerId: string | null;
|
|
85
|
+
name: string;
|
|
86
|
+
code: string | null;
|
|
87
|
+
type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
|
|
88
|
+
status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
|
|
89
|
+
destination: string | null;
|
|
90
|
+
startDate: string | null;
|
|
91
|
+
endDate: string | null;
|
|
92
|
+
estimatedPax: number | null;
|
|
93
|
+
confirmedPax: number | null;
|
|
94
|
+
currency: string | null;
|
|
95
|
+
budgetAmountCents: number | null;
|
|
96
|
+
metadata: Record<string, unknown> | null;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
updatedAt: string;
|
|
99
|
+
} | null, MiceToolContext>;
|
|
100
|
+
export declare const createMiceProgramTool: import("@voyant-travel/tools").ToolDefinition<{
|
|
101
|
+
type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
|
|
102
|
+
status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
|
|
103
|
+
name: string;
|
|
104
|
+
organizationId?: string | undefined;
|
|
105
|
+
primaryContactPersonId?: string | undefined;
|
|
106
|
+
accountManagerId?: string | undefined;
|
|
107
|
+
code?: string | undefined;
|
|
108
|
+
destination?: string | undefined;
|
|
109
|
+
startDate?: string | undefined;
|
|
110
|
+
endDate?: string | undefined;
|
|
111
|
+
estimatedPax?: number | undefined;
|
|
112
|
+
confirmedPax?: number | undefined;
|
|
113
|
+
currency?: string | undefined;
|
|
114
|
+
budgetAmountCents?: number | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
id: string;
|
|
117
|
+
organizationId: string | null;
|
|
118
|
+
primaryContactPersonId: string | null;
|
|
119
|
+
accountManagerId: string | null;
|
|
120
|
+
name: string;
|
|
121
|
+
code: string | null;
|
|
122
|
+
type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
|
|
123
|
+
status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
|
|
124
|
+
destination: string | null;
|
|
125
|
+
startDate: string | null;
|
|
126
|
+
endDate: string | null;
|
|
127
|
+
estimatedPax: number | null;
|
|
128
|
+
confirmedPax: number | null;
|
|
129
|
+
currency: string | null;
|
|
130
|
+
budgetAmountCents: number | null;
|
|
131
|
+
metadata: Record<string, unknown> | null;
|
|
132
|
+
createdAt: string;
|
|
133
|
+
updatedAt: string;
|
|
134
|
+
}, MiceToolContext>;
|
|
135
|
+
export declare const updateMiceProgramTool: import("@voyant-travel/tools").ToolDefinition<{
|
|
136
|
+
name?: string | undefined;
|
|
137
|
+
type?: "other" | "meeting" | "incentive" | "conference" | "exhibition" | undefined;
|
|
138
|
+
status?: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled" | undefined;
|
|
139
|
+
organizationId?: string | null | undefined;
|
|
140
|
+
primaryContactPersonId?: string | null | undefined;
|
|
141
|
+
accountManagerId?: string | null | undefined;
|
|
142
|
+
code?: string | null | undefined;
|
|
143
|
+
destination?: string | null | undefined;
|
|
144
|
+
startDate?: string | null | undefined;
|
|
145
|
+
endDate?: string | null | undefined;
|
|
146
|
+
estimatedPax?: number | null | undefined;
|
|
147
|
+
confirmedPax?: number | null | undefined;
|
|
148
|
+
currency?: string | null | undefined;
|
|
149
|
+
budgetAmountCents?: number | null | undefined;
|
|
150
|
+
} & {
|
|
151
|
+
id: string;
|
|
152
|
+
}, {
|
|
153
|
+
id: string;
|
|
154
|
+
organizationId: string | null;
|
|
155
|
+
primaryContactPersonId: string | null;
|
|
156
|
+
accountManagerId: string | null;
|
|
157
|
+
name: string;
|
|
158
|
+
code: string | null;
|
|
159
|
+
type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
|
|
160
|
+
status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
|
|
161
|
+
destination: string | null;
|
|
162
|
+
startDate: string | null;
|
|
163
|
+
endDate: string | null;
|
|
164
|
+
estimatedPax: number | null;
|
|
165
|
+
confirmedPax: number | null;
|
|
166
|
+
currency: string | null;
|
|
167
|
+
budgetAmountCents: number | null;
|
|
168
|
+
metadata: Record<string, unknown> | null;
|
|
169
|
+
createdAt: string;
|
|
170
|
+
updatedAt: string;
|
|
171
|
+
} | null, MiceToolContext>;
|
|
172
|
+
export declare const miceTools: readonly [import("@voyant-travel/tools").ToolDefinition<{
|
|
173
|
+
limit: number;
|
|
174
|
+
offset: number;
|
|
175
|
+
status?: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled" | undefined;
|
|
176
|
+
type?: "other" | "meeting" | "incentive" | "conference" | "exhibition" | undefined;
|
|
177
|
+
organizationId?: string | undefined;
|
|
178
|
+
}, {
|
|
179
|
+
data: {
|
|
180
|
+
id: string;
|
|
181
|
+
organizationId: string | null;
|
|
182
|
+
primaryContactPersonId: string | null;
|
|
183
|
+
accountManagerId: string | null;
|
|
184
|
+
name: string;
|
|
185
|
+
code: string | null;
|
|
186
|
+
type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
|
|
187
|
+
status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
|
|
188
|
+
destination: string | null;
|
|
189
|
+
startDate: string | null;
|
|
190
|
+
endDate: string | null;
|
|
191
|
+
estimatedPax: number | null;
|
|
192
|
+
confirmedPax: number | null;
|
|
193
|
+
currency: string | null;
|
|
194
|
+
budgetAmountCents: number | null;
|
|
195
|
+
metadata: Record<string, unknown> | null;
|
|
196
|
+
createdAt: string;
|
|
197
|
+
updatedAt: string;
|
|
198
|
+
}[];
|
|
199
|
+
limit: number;
|
|
200
|
+
offset: number;
|
|
201
|
+
}, MiceToolContext>, import("@voyant-travel/tools").ToolDefinition<{
|
|
202
|
+
id: string;
|
|
203
|
+
}, {
|
|
204
|
+
id: string;
|
|
205
|
+
organizationId: string | null;
|
|
206
|
+
primaryContactPersonId: string | null;
|
|
207
|
+
accountManagerId: string | null;
|
|
208
|
+
name: string;
|
|
209
|
+
code: string | null;
|
|
210
|
+
type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
|
|
211
|
+
status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
|
|
212
|
+
destination: string | null;
|
|
213
|
+
startDate: string | null;
|
|
214
|
+
endDate: string | null;
|
|
215
|
+
estimatedPax: number | null;
|
|
216
|
+
confirmedPax: number | null;
|
|
217
|
+
currency: string | null;
|
|
218
|
+
budgetAmountCents: number | null;
|
|
219
|
+
metadata: Record<string, unknown> | null;
|
|
220
|
+
createdAt: string;
|
|
221
|
+
updatedAt: string;
|
|
222
|
+
} | null, MiceToolContext>, import("@voyant-travel/tools").ToolDefinition<{
|
|
223
|
+
type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
|
|
224
|
+
status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
|
|
225
|
+
name: string;
|
|
226
|
+
organizationId?: string | undefined;
|
|
227
|
+
primaryContactPersonId?: string | undefined;
|
|
228
|
+
accountManagerId?: string | undefined;
|
|
229
|
+
code?: string | undefined;
|
|
230
|
+
destination?: string | undefined;
|
|
231
|
+
startDate?: string | undefined;
|
|
232
|
+
endDate?: string | undefined;
|
|
233
|
+
estimatedPax?: number | undefined;
|
|
234
|
+
confirmedPax?: number | undefined;
|
|
235
|
+
currency?: string | undefined;
|
|
236
|
+
budgetAmountCents?: number | undefined;
|
|
237
|
+
}, {
|
|
238
|
+
id: string;
|
|
239
|
+
organizationId: string | null;
|
|
240
|
+
primaryContactPersonId: string | null;
|
|
241
|
+
accountManagerId: string | null;
|
|
242
|
+
name: string;
|
|
243
|
+
code: string | null;
|
|
244
|
+
type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
|
|
245
|
+
status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
|
|
246
|
+
destination: string | null;
|
|
247
|
+
startDate: string | null;
|
|
248
|
+
endDate: string | null;
|
|
249
|
+
estimatedPax: number | null;
|
|
250
|
+
confirmedPax: number | null;
|
|
251
|
+
currency: string | null;
|
|
252
|
+
budgetAmountCents: number | null;
|
|
253
|
+
metadata: Record<string, unknown> | null;
|
|
254
|
+
createdAt: string;
|
|
255
|
+
updatedAt: string;
|
|
256
|
+
}, MiceToolContext>, import("@voyant-travel/tools").ToolDefinition<{
|
|
257
|
+
name?: string | undefined;
|
|
258
|
+
type?: "other" | "meeting" | "incentive" | "conference" | "exhibition" | undefined;
|
|
259
|
+
status?: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled" | undefined;
|
|
260
|
+
organizationId?: string | null | undefined;
|
|
261
|
+
primaryContactPersonId?: string | null | undefined;
|
|
262
|
+
accountManagerId?: string | null | undefined;
|
|
263
|
+
code?: string | null | undefined;
|
|
264
|
+
destination?: string | null | undefined;
|
|
265
|
+
startDate?: string | null | undefined;
|
|
266
|
+
endDate?: string | null | undefined;
|
|
267
|
+
estimatedPax?: number | null | undefined;
|
|
268
|
+
confirmedPax?: number | null | undefined;
|
|
269
|
+
currency?: string | null | undefined;
|
|
270
|
+
budgetAmountCents?: number | null | undefined;
|
|
271
|
+
} & {
|
|
272
|
+
id: string;
|
|
273
|
+
}, {
|
|
274
|
+
id: string;
|
|
275
|
+
organizationId: string | null;
|
|
276
|
+
primaryContactPersonId: string | null;
|
|
277
|
+
accountManagerId: string | null;
|
|
278
|
+
name: string;
|
|
279
|
+
code: string | null;
|
|
280
|
+
type: "other" | "meeting" | "incentive" | "conference" | "exhibition";
|
|
281
|
+
status: "lead" | "planning" | "contracted" | "operating" | "completed" | "cancelled";
|
|
282
|
+
destination: string | null;
|
|
283
|
+
startDate: string | null;
|
|
284
|
+
endDate: string | null;
|
|
285
|
+
estimatedPax: number | null;
|
|
286
|
+
confirmedPax: number | null;
|
|
287
|
+
currency: string | null;
|
|
288
|
+
budgetAmountCents: number | null;
|
|
289
|
+
metadata: Record<string, unknown> | null;
|
|
290
|
+
createdAt: string;
|
|
291
|
+
updatedAt: string;
|
|
292
|
+
} | null, MiceToolContext>];
|
|
293
|
+
export {};
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/** Module-owned Tools for the MICE program lifecycle. */
|
|
2
|
+
import { defineTool, READ_ONLY_RISK, requireService } from "@voyant-travel/tools";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { createProgramSchema, programListQuerySchema, programStatusSchema, programTypeSchema, updateProgramSchema, } from "./validation.js";
|
|
5
|
+
const OWNER = "@voyant-travel/mice";
|
|
6
|
+
const STAFF_AUDIENCE = { source: "grant", allowed: ["staff"] };
|
|
7
|
+
const READ_METADATA = {
|
|
8
|
+
owner: OWNER,
|
|
9
|
+
capabilityVersion: "v1",
|
|
10
|
+
requiredScopes: ["mice:read"],
|
|
11
|
+
audience: STAFF_AUDIENCE,
|
|
12
|
+
tier: "read",
|
|
13
|
+
riskPolicy: READ_ONLY_RISK,
|
|
14
|
+
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
15
|
+
};
|
|
16
|
+
const WRITE_METADATA = {
|
|
17
|
+
owner: OWNER,
|
|
18
|
+
capabilityVersion: "v1",
|
|
19
|
+
requiredScopes: ["mice:write"],
|
|
20
|
+
audience: STAFF_AUDIENCE,
|
|
21
|
+
tier: "write",
|
|
22
|
+
riskPolicy: {
|
|
23
|
+
destructive: false,
|
|
24
|
+
reversible: true,
|
|
25
|
+
dryRunSupported: false,
|
|
26
|
+
confirmationRequired: false,
|
|
27
|
+
sideEffects: ["data-write"],
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
const idArgsSchema = z.object({ id: z.string().min(1) });
|
|
31
|
+
const programValueSchema = z.object({
|
|
32
|
+
id: z.string(),
|
|
33
|
+
organizationId: z.string().nullable(),
|
|
34
|
+
primaryContactPersonId: z.string().nullable(),
|
|
35
|
+
accountManagerId: z.string().nullable(),
|
|
36
|
+
name: z.string(),
|
|
37
|
+
code: z.string().nullable(),
|
|
38
|
+
type: programTypeSchema,
|
|
39
|
+
status: programStatusSchema,
|
|
40
|
+
destination: z.string().nullable(),
|
|
41
|
+
startDate: z.string().nullable(),
|
|
42
|
+
endDate: z.string().nullable(),
|
|
43
|
+
estimatedPax: z.number().int().nullable(),
|
|
44
|
+
confirmedPax: z.number().int().nullable(),
|
|
45
|
+
currency: z.string().nullable(),
|
|
46
|
+
budgetAmountCents: z.number().int().nullable(),
|
|
47
|
+
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
48
|
+
createdAt: z.string().datetime(),
|
|
49
|
+
updatedAt: z.string().datetime(),
|
|
50
|
+
});
|
|
51
|
+
const programListValueSchema = z.object({
|
|
52
|
+
data: z.array(programValueSchema),
|
|
53
|
+
limit: z.number().int(),
|
|
54
|
+
offset: z.number().int(),
|
|
55
|
+
});
|
|
56
|
+
const updateProgramToolSchema = updateProgramSchema.and(idArgsSchema);
|
|
57
|
+
function mice(ctx) {
|
|
58
|
+
return requireService(ctx.mice, "mice");
|
|
59
|
+
}
|
|
60
|
+
export const listMiceProgramsTool = defineTool({
|
|
61
|
+
...READ_METADATA,
|
|
62
|
+
capabilityId: `${OWNER}#tool.list-programs`,
|
|
63
|
+
name: "list_mice_programs",
|
|
64
|
+
description: "List staff-visible meetings, incentives, conferences, and exhibition programs.",
|
|
65
|
+
inputSchema: programListQuerySchema,
|
|
66
|
+
outputSchema: programListValueSchema,
|
|
67
|
+
async handler(query, ctx) {
|
|
68
|
+
return parseJsonResult(programListValueSchema, await mice(ctx).listPrograms(query));
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
export const getMiceProgramTool = defineTool({
|
|
72
|
+
...READ_METADATA,
|
|
73
|
+
capabilityId: `${OWNER}#tool.get-program`,
|
|
74
|
+
name: "get_mice_program",
|
|
75
|
+
description: "Read one MICE program, including buyer, dates, attendance, and budget fields.",
|
|
76
|
+
inputSchema: idArgsSchema,
|
|
77
|
+
outputSchema: programValueSchema.nullable(),
|
|
78
|
+
async handler({ id }, ctx) {
|
|
79
|
+
return parseJsonResult(programValueSchema.nullable(), await mice(ctx).getProgram(id));
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
export const createMiceProgramTool = defineTool({
|
|
83
|
+
...WRITE_METADATA,
|
|
84
|
+
capabilityId: `${OWNER}#tool.create-program`,
|
|
85
|
+
name: "create_mice_program",
|
|
86
|
+
description: "Create a MICE program with validated dates, lifecycle status, and budget data.",
|
|
87
|
+
inputSchema: createProgramSchema,
|
|
88
|
+
outputSchema: programValueSchema,
|
|
89
|
+
async handler(input, ctx) {
|
|
90
|
+
return parseJsonResult(programValueSchema, await mice(ctx).createProgram(input));
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
export const updateMiceProgramTool = defineTool({
|
|
94
|
+
...WRITE_METADATA,
|
|
95
|
+
capabilityId: `${OWNER}#tool.update-program`,
|
|
96
|
+
name: "update_mice_program",
|
|
97
|
+
description: "Update a MICE program's ownership, dates, lifecycle, attendance, or budget.",
|
|
98
|
+
inputSchema: updateProgramToolSchema,
|
|
99
|
+
outputSchema: programValueSchema.nullable(),
|
|
100
|
+
annotations: { idempotentHint: true },
|
|
101
|
+
async handler(input, ctx) {
|
|
102
|
+
return parseJsonResult(programValueSchema.nullable(), await mice(ctx).updateProgram(input));
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
export const miceTools = [
|
|
106
|
+
listMiceProgramsTool,
|
|
107
|
+
getMiceProgramTool,
|
|
108
|
+
createMiceProgramTool,
|
|
109
|
+
updateMiceProgramTool,
|
|
110
|
+
];
|
|
111
|
+
function parseJsonResult(schema, value) {
|
|
112
|
+
return schema.parse(toJsonValue(value));
|
|
113
|
+
}
|
|
114
|
+
function toJsonValue(value) {
|
|
115
|
+
if (value instanceof Date)
|
|
116
|
+
return value.toISOString();
|
|
117
|
+
if (Array.isArray(value))
|
|
118
|
+
return value.map(toJsonValue);
|
|
119
|
+
if (typeof value !== "object" || value === null)
|
|
120
|
+
return value;
|
|
121
|
+
return Object.fromEntries(Object.entries(value)
|
|
122
|
+
.map(([key, nested]) => [key, toJsonValue(nested)])
|
|
123
|
+
.filter(([, nested]) => nested !== undefined));
|
|
124
|
+
}
|
package/dist/voyant.js
CHANGED
|
@@ -148,6 +148,86 @@ export const miceVoyantModule = defineModule({
|
|
|
148
148
|
},
|
|
149
149
|
],
|
|
150
150
|
},
|
|
151
|
+
tools: [
|
|
152
|
+
{
|
|
153
|
+
id: "@voyant-travel/mice#tool.list-programs",
|
|
154
|
+
name: "list_mice_programs",
|
|
155
|
+
runtime: { entry: "@voyant-travel/mice/tools", export: "listMiceProgramsTool" },
|
|
156
|
+
requiredScopes: ["mice:read"],
|
|
157
|
+
context: ["mice"],
|
|
158
|
+
risk: "low",
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: "@voyant-travel/mice#tool.get-program",
|
|
162
|
+
name: "get_mice_program",
|
|
163
|
+
runtime: { entry: "@voyant-travel/mice/tools", export: "getMiceProgramTool" },
|
|
164
|
+
requiredScopes: ["mice:read"],
|
|
165
|
+
context: ["mice"],
|
|
166
|
+
risk: "low",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: "@voyant-travel/mice#tool.create-program",
|
|
170
|
+
name: "create_mice_program",
|
|
171
|
+
runtime: { entry: "@voyant-travel/mice/tools", export: "createMiceProgramTool" },
|
|
172
|
+
requiredScopes: ["mice:write"],
|
|
173
|
+
context: ["mice"],
|
|
174
|
+
risk: "medium",
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
id: "@voyant-travel/mice#tool.update-program",
|
|
178
|
+
name: "update_mice_program",
|
|
179
|
+
runtime: { entry: "@voyant-travel/mice/tools", export: "updateMiceProgramTool" },
|
|
180
|
+
requiredScopes: ["mice:write"],
|
|
181
|
+
context: ["mice"],
|
|
182
|
+
risk: "medium",
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
actions: [
|
|
186
|
+
{
|
|
187
|
+
id: "@voyant-travel/mice#action.list-programs",
|
|
188
|
+
version: "v1",
|
|
189
|
+
kind: "read",
|
|
190
|
+
targetType: "mice-program",
|
|
191
|
+
requiredScopes: ["mice:read"],
|
|
192
|
+
risk: "low",
|
|
193
|
+
ledger: "optional",
|
|
194
|
+
from: { tools: ["@voyant-travel/mice#tool.list-programs"] },
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: "@voyant-travel/mice#action.get-program",
|
|
198
|
+
version: "v1",
|
|
199
|
+
kind: "read",
|
|
200
|
+
targetType: "mice-program",
|
|
201
|
+
requiredScopes: ["mice:read"],
|
|
202
|
+
risk: "low",
|
|
203
|
+
ledger: "optional",
|
|
204
|
+
from: { tools: ["@voyant-travel/mice#tool.get-program"] },
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: "@voyant-travel/mice#action.create-program",
|
|
208
|
+
version: "v1",
|
|
209
|
+
kind: "execute",
|
|
210
|
+
targetType: "mice-program",
|
|
211
|
+
requiredScopes: ["mice:write"],
|
|
212
|
+
risk: "medium",
|
|
213
|
+
ledger: "required",
|
|
214
|
+
approval: "never",
|
|
215
|
+
reversible: true,
|
|
216
|
+
from: { tools: ["@voyant-travel/mice#tool.create-program"] },
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
id: "@voyant-travel/mice#action.update-program",
|
|
220
|
+
version: "v1",
|
|
221
|
+
kind: "execute",
|
|
222
|
+
targetType: "mice-program",
|
|
223
|
+
requiredScopes: ["mice:write"],
|
|
224
|
+
risk: "medium",
|
|
225
|
+
ledger: "required",
|
|
226
|
+
approval: "never",
|
|
227
|
+
reversible: true,
|
|
228
|
+
from: { tools: ["@voyant-travel/mice#tool.update-program"] },
|
|
229
|
+
},
|
|
230
|
+
],
|
|
151
231
|
events: [
|
|
152
232
|
{
|
|
153
233
|
id: "@voyant-travel/mice#event.rfp-awarded",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/mice",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -44,6 +44,16 @@
|
|
|
44
44
|
"import": "./dist/runtime-contributor.js",
|
|
45
45
|
"default": "./dist/runtime-contributor.js"
|
|
46
46
|
},
|
|
47
|
+
"./tools": {
|
|
48
|
+
"types": "./dist/tools.d.ts",
|
|
49
|
+
"import": "./dist/tools.js",
|
|
50
|
+
"default": "./dist/tools.js"
|
|
51
|
+
},
|
|
52
|
+
"./mcp-runtime": {
|
|
53
|
+
"types": "./dist/mcp-runtime.d.ts",
|
|
54
|
+
"import": "./dist/mcp-runtime.js",
|
|
55
|
+
"default": "./dist/mcp-runtime.js"
|
|
56
|
+
},
|
|
47
57
|
"./voyant": {
|
|
48
58
|
"types": "./dist/voyant.d.ts",
|
|
49
59
|
"import": "./dist/voyant.js",
|
|
@@ -57,17 +67,18 @@
|
|
|
57
67
|
"drizzle-orm": "^0.45.2",
|
|
58
68
|
"hono": "^4.12.27",
|
|
59
69
|
"zod": "^4.4.3",
|
|
60
|
-
"@voyant-travel/
|
|
61
|
-
"@voyant-travel/
|
|
62
|
-
"@voyant-travel/
|
|
63
|
-
"@voyant-travel/
|
|
64
|
-
"@voyant-travel/
|
|
70
|
+
"@voyant-travel/core": "^0.124.0",
|
|
71
|
+
"@voyant-travel/db": "^0.114.7",
|
|
72
|
+
"@voyant-travel/hono": "^0.127.1",
|
|
73
|
+
"@voyant-travel/tools": "^0.3.0",
|
|
74
|
+
"@voyant-travel/operations": "^0.7.0",
|
|
75
|
+
"@voyant-travel/accommodations": "^0.120.0"
|
|
65
76
|
},
|
|
66
77
|
"peerDependencies": {
|
|
67
|
-
"@voyant-travel/bookings": "^0.
|
|
68
|
-
"@voyant-travel/
|
|
69
|
-
"@voyant-travel/
|
|
70
|
-
"@voyant-travel/
|
|
78
|
+
"@voyant-travel/bookings": "^0.160.0",
|
|
79
|
+
"@voyant-travel/relationships": "^0.126.0",
|
|
80
|
+
"@voyant-travel/quotes": "^0.129.0",
|
|
81
|
+
"@voyant-travel/distribution": "^0.150.0"
|
|
71
82
|
},
|
|
72
83
|
"devDependencies": {
|
|
73
84
|
"drizzle-kit": "^0.31.10",
|