@gavana.ai/cli 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/CHANGELOG.md +54 -0
- package/LICENSE.md +7 -0
- package/README.md +237 -0
- package/bin/craftboard.mjs +5 -0
- package/bin/gavana.mjs +5 -0
- package/guides/connections.md +35 -0
- package/guides/examples-common-mistakes.md +29 -0
- package/guides/existing-canvases.md +19 -0
- package/guides/generated-assets.md +29 -0
- package/guides/getting-started.md +26 -0
- package/guides/notes-text-sections.md +44 -0
- package/guides/paid-action-safety.md +22 -0
- package/guides/prompt-lists.md +20 -0
- package/guides/sections-layout.md +43 -0
- package/guides/validation-recovery.md +33 -0
- package/package.json +44 -0
- package/src/canvas-agent-guide.mjs +133 -0
- package/src/canvas-agent-validation.mjs +554 -0
- package/src/canvas-layout.mjs +287 -0
- package/src/capabilities.mjs +61 -0
- package/src/client.mjs +1141 -0
- package/src/commands.mjs +259 -0
- package/src/config.mjs +197 -0
- package/src/guide-sources.mjs +86 -0
- package/src/runner.mjs +1968 -0
- package/src/tools/action_get.mjs +16 -0
- package/src/tools/action_list.mjs +21 -0
- package/src/tools/action_run.mjs +60 -0
- package/src/tools/agent_canvas_get.mjs +15 -0
- package/src/tools/asset_get.mjs +16 -0
- package/src/tools/asset_list.mjs +17 -0
- package/src/tools/asset_upload.mjs +24 -0
- package/src/tools/campaign_cancel.mjs +16 -0
- package/src/tools/campaign_get.mjs +16 -0
- package/src/tools/campaign_plan.mjs +31 -0
- package/src/tools/campaign_review.mjs +24 -0
- package/src/tools/campaign_start.mjs +19 -0
- package/src/tools/canvas_apply_batch.mjs +35 -0
- package/src/tools/canvas_create.mjs +15 -0
- package/src/tools/canvas_get.mjs +16 -0
- package/src/tools/canvas_list.mjs +17 -0
- package/src/tools/canvas_render.mjs +34 -0
- package/src/tools/canvas_validate.mjs +34 -0
- package/src/tools/connection_create.mjs +38 -0
- package/src/tools/connection_delete.mjs +31 -0
- package/src/tools/definitions.mjs +111 -0
- package/src/tools/guide_get.mjs +16 -0
- package/src/tools/guide_search.mjs +16 -0
- package/src/tools/helpers.mjs +66 -0
- package/src/tools/image_edit.mjs +8 -0
- package/src/tools/image_generate.mjs +8 -0
- package/src/tools/image_tool.mjs +56 -0
- package/src/tools/image_variations.mjs +8 -0
- package/src/tools/job_cancel.mjs +16 -0
- package/src/tools/job_get.mjs +17 -0
- package/src/tools/job_wait.mjs +18 -0
- package/src/tools/model_get.mjs +16 -0
- package/src/tools/model_list.mjs +23 -0
- package/src/tools/node_create.mjs +36 -0
- package/src/tools/node_delete.mjs +31 -0
- package/src/tools/node_get.mjs +16 -0
- package/src/tools/node_move.mjs +37 -0
- package/src/tools/node_resize.mjs +37 -0
- package/src/tools/node_update.mjs +36 -0
- package/src/tools/progress.mjs +101 -0
- package/src/tools/provider_list.mjs +17 -0
- package/src/tools/recipe_fork.mjs +32 -0
- package/src/tools/recipe_get.mjs +19 -0
- package/src/tools/recipe_run.mjs +61 -0
- package/src/tools/recipe_search.mjs +17 -0
- package/src/tools/registry.mjs +550 -0
- package/src/tools/run_cancel.mjs +16 -0
- package/src/tools/run_get.mjs +17 -0
- package/src/tools/run_wait.mjs +18 -0
- package/src/tools/schemas.mjs +165 -0
- package/src/tools/video_generate.mjs +37 -0
- package/src/version.mjs +12 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Tool definition: recipe_run
|
|
2
|
+
//
|
|
3
|
+
// Registered through ./definitions.mjs. ./registry.mjs is the catalog that says
|
|
4
|
+
// this tool exists and on which surfaces; this file is what it does.
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { canvasReference, imageDestination, modelReference, nodeReference, rawModelId, recipeReference, revisionFields } from "./schemas.mjs";
|
|
7
|
+
import { withProgress } from "./progress.mjs";
|
|
8
|
+
|
|
9
|
+
export function defineRecipeRun(client) {
|
|
10
|
+
return {
|
|
11
|
+
title: "Run a Recipe explicitly",
|
|
12
|
+
description: "Start one approved Recipe or connected private Recipe instance as a durable asynchronous Run. This is the only Recipe operation that executes text or image work.",
|
|
13
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
14
|
+
inputSchema: z.object({
|
|
15
|
+
recipeId: recipeReference,
|
|
16
|
+
canvasId: canvasReference.optional(),
|
|
17
|
+
destination: imageDestination.optional(),
|
|
18
|
+
canvasTitle: z.string().min(1).max(160).optional(),
|
|
19
|
+
version: z.string().min(1).max(80).optional(),
|
|
20
|
+
instanceNodeId: nodeReference.optional().describe("Optional private Recipe instance already connected on the destination canvas."),
|
|
21
|
+
inputs: z
|
|
22
|
+
.record(z.string().min(1).max(8_000))
|
|
23
|
+
.refine((value) => Object.keys(value).length <= 16, "A Recipe run accepts at most 16 typed inputs.")
|
|
24
|
+
.default({})
|
|
25
|
+
.describe("Map each Recipe input key to a node:, asset:, or plain text value."),
|
|
26
|
+
model: z.union([modelReference, rawModelId]).optional(),
|
|
27
|
+
size: z.string().max(80).optional(),
|
|
28
|
+
quality: z.string().max(80).optional(),
|
|
29
|
+
...revisionFields,
|
|
30
|
+
wait: z.boolean().default(true),
|
|
31
|
+
timeoutSeconds: z.number().min(1).max(3_600).default(900),
|
|
32
|
+
}),
|
|
33
|
+
handler: async (input, extra) => {
|
|
34
|
+
const destination = input.destination || input.canvasId;
|
|
35
|
+
if (!destination) throw Object.assign(new Error("Input validation error: Provide destination or canvasId."), { code: "invalid_recipe_input" });
|
|
36
|
+
if (destination === "new-canvas" && !input.canvasTitle) throw Object.assign(new Error("Input validation error: new-canvas requires canvasTitle."), { code: "invalid_recipe_input" });
|
|
37
|
+
if (!Object.keys(input.inputs).length && !input.instanceNodeId) {
|
|
38
|
+
throw Object.assign(new Error("Input validation error: Provide typed inputs or an already connected instanceNodeId."), { code: "invalid_recipe_input" });
|
|
39
|
+
}
|
|
40
|
+
const canvasResult = await client.resolveCanvasDestination(destination, {
|
|
41
|
+
idempotencyKey: input.idempotencyKey,
|
|
42
|
+
title: input.canvasTitle,
|
|
43
|
+
});
|
|
44
|
+
const queued = await client.startRecipeRun(input.recipeId, {
|
|
45
|
+
canvasId: canvasResult.canvas.handle,
|
|
46
|
+
baseRevision: input.baseRevision || canvasResult.canvas.revision,
|
|
47
|
+
idempotencyKey: input.idempotencyKey,
|
|
48
|
+
...(input.version ? { version: input.version } : {}),
|
|
49
|
+
...(input.instanceNodeId ? { instanceNodeId: input.instanceNodeId } : {}),
|
|
50
|
+
...(Object.keys(input.inputs).length ? { inputs: input.inputs } : {}),
|
|
51
|
+
...(input.model ? { model: input.model } : {}),
|
|
52
|
+
...(input.size ? { size: input.size } : {}),
|
|
53
|
+
...(input.quality ? { quality: input.quality } : {}),
|
|
54
|
+
});
|
|
55
|
+
const destinationResult = { requested: destination, canvasId: canvasResult.canvas.handle };
|
|
56
|
+
if (input.wait === false) return { ...queued, destination: destinationResult };
|
|
57
|
+
const result = await client.waitForRun(queued.run || queued.handle || queued.id, withProgress({ timeoutMs: input.timeoutSeconds * 1000 }, extra));
|
|
58
|
+
return { ...result, destination: destinationResult };
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Tool definition: recipe_search
|
|
2
|
+
//
|
|
3
|
+
// Registered through ./definitions.mjs. ./registry.mjs is the catalog that says
|
|
4
|
+
// this tool exists and on which surfaces; this file is what it does.
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { listOptions } from "./helpers.mjs";
|
|
7
|
+
import { listCursor, listLimit } from "./schemas.mjs";
|
|
8
|
+
|
|
9
|
+
export function defineRecipeSearch(client) {
|
|
10
|
+
return {
|
|
11
|
+
title: "Search Recipe Library",
|
|
12
|
+
description: "Search approved reusable visual Recipes. Discovery is read-only and does not create canvas blocks or image jobs.",
|
|
13
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
14
|
+
inputSchema: z.object({ query: z.string().max(240).default(""), limit: listLimit(100), cursor: listCursor }),
|
|
15
|
+
handler: ({ query, limit, cursor }) => client.searchRecipes(query, listOptions(limit, cursor)),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
// The single catalog both MCP servers are views of.
|
|
2
|
+
//
|
|
3
|
+
// Before this module the hosted server (src/lib/chatgpt-mcp.ts) and the local stdio
|
|
4
|
+
// server (scripts/gavana-agent-mcp.mjs) each hand-maintained their own tool list, in
|
|
5
|
+
// different naming conventions, with nothing to stop them drifting. Every entry here
|
|
6
|
+
// is the canonical noun_verb name; a hosted verb-object name survives as
|
|
7
|
+
// `hostedAlias` and stays callable, because @gavana.ai/mcp@0.1.1 is published and
|
|
8
|
+
// those names are a compatibility contract.
|
|
9
|
+
//
|
|
10
|
+
// Generated once from the live catalogs of both servers, then maintained by hand.
|
|
11
|
+
// scripts/canvas-agent-tool-registry.test.ts asserts each server's advertised
|
|
12
|
+
// catalog still matches this file, so drift fails the build rather than shipping.
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {object} GavanaToolDefinition
|
|
16
|
+
* @property {string} name Canonical noun_verb name.
|
|
17
|
+
* @property {string} toolset Gating group (see GAVANA_MCP_TOOLSETS).
|
|
18
|
+
* @property {("local"|"hosted")[]} surfaces Which servers advertise it.
|
|
19
|
+
* @property {string} [hostedAlias] Deprecated verb-object name the hosted server still accepts.
|
|
20
|
+
* @property {string[]} [scopes] OAuth scopes the hosted surface requires.
|
|
21
|
+
* @property {boolean} [embedImage] Hosted surface inlines an image into the result.
|
|
22
|
+
* @property {boolean} [legacyCampaign] Deprecated campaign tool, hidden unless explicitly enabled.
|
|
23
|
+
* @property {boolean} [readOnlySurface] Advertised on the read-only surface.
|
|
24
|
+
* @property {false} [hermesDefault] Excluded from the Hermes default selection.
|
|
25
|
+
* Hermes enables a safe subset out of the box: destructive deletes and cancels,
|
|
26
|
+
* the filesystem-reading asset_upload, and the deprecated campaign_* tools are
|
|
27
|
+
* opt-in via `hermes mcp configure gavana`.
|
|
28
|
+
* @property {object|null} annotations MCP tool annotations.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/** @type {readonly GavanaToolDefinition[]} */
|
|
32
|
+
export const GAVANA_TOOL_REGISTRY = Object.freeze([
|
|
33
|
+
{
|
|
34
|
+
name: "action_get",
|
|
35
|
+
toolset: "actions",
|
|
36
|
+
surfaces: ["local"],
|
|
37
|
+
readOnlySurface: true,
|
|
38
|
+
localOrder: 33,
|
|
39
|
+
annotations: {"readOnlyHint":true,"openWorldHint":false},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "action_list",
|
|
43
|
+
toolset: "actions",
|
|
44
|
+
surfaces: ["local"],
|
|
45
|
+
readOnlySurface: true,
|
|
46
|
+
localOrder: 32,
|
|
47
|
+
annotations: {"readOnlyHint":true,"openWorldHint":false},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "action_run",
|
|
51
|
+
toolset: "actions",
|
|
52
|
+
surfaces: ["local"],
|
|
53
|
+
localOrder: 34,
|
|
54
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "agent_canvas_get",
|
|
58
|
+
toolset: "canvas",
|
|
59
|
+
surfaces: ["local"],
|
|
60
|
+
localOrder: 16,
|
|
61
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "asset_get",
|
|
65
|
+
toolset: "assets",
|
|
66
|
+
surfaces: ["local"],
|
|
67
|
+
readOnlySurface: true,
|
|
68
|
+
localOrder: 27,
|
|
69
|
+
annotations: {"readOnlyHint":true,"openWorldHint":false},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "asset_list",
|
|
73
|
+
toolset: "assets",
|
|
74
|
+
surfaces: ["local"],
|
|
75
|
+
readOnlySurface: true,
|
|
76
|
+
localOrder: 26,
|
|
77
|
+
annotations: {"readOnlyHint":true,"openWorldHint":false},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "asset_upload",
|
|
81
|
+
toolset: "assets",
|
|
82
|
+
surfaces: ["local"],
|
|
83
|
+
localOrder: 28,
|
|
84
|
+
hermesDefault: false,
|
|
85
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":false},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "campaign_cancel",
|
|
89
|
+
toolset: "campaigns",
|
|
90
|
+
surfaces: ["local"],
|
|
91
|
+
legacyCampaign: true,
|
|
92
|
+
localOrder: 10,
|
|
93
|
+
hermesDefault: false,
|
|
94
|
+
annotations: {"readOnlyHint":false,"destructiveHint":true,"idempotentHint":true,"openWorldHint":false},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "campaign_get",
|
|
98
|
+
toolset: "campaigns",
|
|
99
|
+
surfaces: ["local"],
|
|
100
|
+
legacyCampaign: true,
|
|
101
|
+
localOrder: 8,
|
|
102
|
+
hermesDefault: false,
|
|
103
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "campaign_plan",
|
|
107
|
+
toolset: "campaigns",
|
|
108
|
+
surfaces: ["local"],
|
|
109
|
+
legacyCampaign: true,
|
|
110
|
+
localOrder: 6,
|
|
111
|
+
hermesDefault: false,
|
|
112
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "campaign_review",
|
|
116
|
+
toolset: "campaigns",
|
|
117
|
+
surfaces: ["local"],
|
|
118
|
+
legacyCampaign: true,
|
|
119
|
+
localOrder: 9,
|
|
120
|
+
hermesDefault: false,
|
|
121
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "campaign_start",
|
|
125
|
+
toolset: "campaigns",
|
|
126
|
+
surfaces: ["local"],
|
|
127
|
+
legacyCampaign: true,
|
|
128
|
+
localOrder: 7,
|
|
129
|
+
hermesDefault: false,
|
|
130
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "canvas_apply_batch",
|
|
134
|
+
toolset: "canvas",
|
|
135
|
+
surfaces: ["hosted","local"],
|
|
136
|
+
scopes: ["canvas:read","canvas:write"],
|
|
137
|
+
hostedOrder: 5,
|
|
138
|
+
hostedReadOnly: false,
|
|
139
|
+
hostedToolset: "canvas",
|
|
140
|
+
localOrder: 17,
|
|
141
|
+
annotations: {"readOnlyHint":false,"destructiveHint":true,"idempotentHint":true,"openWorldHint":false},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "canvas_create",
|
|
145
|
+
toolset: "canvas",
|
|
146
|
+
surfaces: ["local"],
|
|
147
|
+
localOrder: 15,
|
|
148
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":false},
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "canvas_get",
|
|
152
|
+
toolset: "canvas",
|
|
153
|
+
surfaces: ["hosted","local"],
|
|
154
|
+
scopes: ["canvas:read"],
|
|
155
|
+
readOnlySurface: true,
|
|
156
|
+
hostedOrder: 3,
|
|
157
|
+
hostedReadOnly: true,
|
|
158
|
+
hostedToolset: "canvas",
|
|
159
|
+
localOrder: 12,
|
|
160
|
+
annotations: {"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "canvas_image_get",
|
|
164
|
+
toolset: "canvas",
|
|
165
|
+
surfaces: ["hosted"],
|
|
166
|
+
hostedAlias: "get_canvas_image",
|
|
167
|
+
scopes: ["canvas:read"],
|
|
168
|
+
readOnlySurface: true,
|
|
169
|
+
hostedOrder: 6,
|
|
170
|
+
hostedReadOnly: true,
|
|
171
|
+
hostedToolset: "assets",
|
|
172
|
+
embedImage: true,
|
|
173
|
+
annotations: {"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "canvas_image_save",
|
|
177
|
+
toolset: "canvas",
|
|
178
|
+
surfaces: ["hosted"],
|
|
179
|
+
hostedAlias: "save_image_to_canvas",
|
|
180
|
+
scopes: ["canvas:read","canvas:write","asset:read","image:generate"],
|
|
181
|
+
hostedOrder: 8,
|
|
182
|
+
hostedReadOnly: false,
|
|
183
|
+
hostedToolset: "assets",
|
|
184
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "canvas_list",
|
|
188
|
+
toolset: "canvas",
|
|
189
|
+
surfaces: ["hosted","local"],
|
|
190
|
+
scopes: ["canvas:read"],
|
|
191
|
+
readOnlySurface: true,
|
|
192
|
+
hostedOrder: 2,
|
|
193
|
+
hostedReadOnly: true,
|
|
194
|
+
hostedToolset: "canvas",
|
|
195
|
+
localOrder: 11,
|
|
196
|
+
annotations: {"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: "canvas_open",
|
|
200
|
+
toolset: "canvas",
|
|
201
|
+
surfaces: ["hosted"],
|
|
202
|
+
hostedAlias: "open_canvas",
|
|
203
|
+
scopes: ["canvas:read"],
|
|
204
|
+
readOnlySurface: true,
|
|
205
|
+
hostedOrder: 7,
|
|
206
|
+
hostedReadOnly: true,
|
|
207
|
+
hostedToolset: "canvas",
|
|
208
|
+
annotations: {"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "canvas_render",
|
|
212
|
+
toolset: "canvas",
|
|
213
|
+
surfaces: ["local"],
|
|
214
|
+
readOnlySurface: true,
|
|
215
|
+
localOrder: 14,
|
|
216
|
+
annotations: {"readOnlyHint":true,"openWorldHint":false},
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: "canvas_validate",
|
|
220
|
+
toolset: "canvas",
|
|
221
|
+
surfaces: ["hosted","local"],
|
|
222
|
+
scopes: ["canvas:read"],
|
|
223
|
+
readOnlySurface: true,
|
|
224
|
+
hostedOrder: 4,
|
|
225
|
+
hostedReadOnly: true,
|
|
226
|
+
hostedToolset: "canvas",
|
|
227
|
+
localOrder: 13,
|
|
228
|
+
annotations: {"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: "canvas_workflow_create",
|
|
232
|
+
toolset: "canvas",
|
|
233
|
+
surfaces: ["hosted"],
|
|
234
|
+
hostedAlias: "create_canvas_workflow",
|
|
235
|
+
scopes: ["canvas:read","canvas:write"],
|
|
236
|
+
hostedOrder: 10,
|
|
237
|
+
hostedReadOnly: false,
|
|
238
|
+
hostedToolset: "recipes",
|
|
239
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "canvas_workflow_run",
|
|
243
|
+
toolset: "canvas",
|
|
244
|
+
surfaces: ["hosted"],
|
|
245
|
+
hostedAlias: "run_canvas_workflow",
|
|
246
|
+
scopes: ["canvas:read","canvas:write","asset:read","image:generate","job:manage"],
|
|
247
|
+
hostedOrder: 11,
|
|
248
|
+
paid: true,
|
|
249
|
+
hostedReadOnly: false,
|
|
250
|
+
hostedToolset: "recipes",
|
|
251
|
+
embedImage: true,
|
|
252
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: "canvas_workflow_run_get",
|
|
256
|
+
toolset: "canvas",
|
|
257
|
+
surfaces: ["hosted"],
|
|
258
|
+
hostedAlias: "get_canvas_workflow_run",
|
|
259
|
+
scopes: ["canvas:read","job:manage"],
|
|
260
|
+
hostedOrder: 12,
|
|
261
|
+
hostedReadOnly: false,
|
|
262
|
+
hostedToolset: "runs",
|
|
263
|
+
embedImage: true,
|
|
264
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: "connection_create",
|
|
268
|
+
toolset: "canvas",
|
|
269
|
+
surfaces: ["local"],
|
|
270
|
+
localOrder: 24,
|
|
271
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "connection_delete",
|
|
275
|
+
toolset: "canvas",
|
|
276
|
+
surfaces: ["local"],
|
|
277
|
+
localOrder: 25,
|
|
278
|
+
hermesDefault: false,
|
|
279
|
+
annotations: {"readOnlyHint":false,"destructiveHint":true,"idempotentHint":true,"openWorldHint":false},
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: "guide_get",
|
|
283
|
+
toolset: "canvas",
|
|
284
|
+
surfaces: ["hosted","local"],
|
|
285
|
+
scopes: [],
|
|
286
|
+
readOnlySurface: true,
|
|
287
|
+
hostedOrder: 1,
|
|
288
|
+
hostedReadOnly: true,
|
|
289
|
+
hostedToolset: "canvas",
|
|
290
|
+
localOrder: 1,
|
|
291
|
+
annotations: {"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: "guide_search",
|
|
295
|
+
toolset: "canvas",
|
|
296
|
+
surfaces: ["hosted","local"],
|
|
297
|
+
scopes: [],
|
|
298
|
+
readOnlySurface: true,
|
|
299
|
+
hostedOrder: 0,
|
|
300
|
+
hostedReadOnly: true,
|
|
301
|
+
hostedToolset: "canvas",
|
|
302
|
+
localOrder: 0,
|
|
303
|
+
annotations: {"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: "image_edit",
|
|
307
|
+
toolset: "images",
|
|
308
|
+
surfaces: ["local"],
|
|
309
|
+
localOrder: 36,
|
|
310
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: "image_generate",
|
|
314
|
+
toolset: "images",
|
|
315
|
+
surfaces: ["hosted","local"],
|
|
316
|
+
hostedAlias: "generate_image_in_canvas",
|
|
317
|
+
scopes: ["canvas:read","canvas:write","asset:read","image:generate","job:manage"],
|
|
318
|
+
hostedOrder: 13,
|
|
319
|
+
paid: true,
|
|
320
|
+
hostedReadOnly: false,
|
|
321
|
+
hostedToolset: "images",
|
|
322
|
+
localOrder: 35,
|
|
323
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: "image_variations",
|
|
327
|
+
toolset: "images",
|
|
328
|
+
surfaces: ["local"],
|
|
329
|
+
localOrder: 37,
|
|
330
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: "job_cancel",
|
|
334
|
+
toolset: "runs",
|
|
335
|
+
surfaces: ["local"],
|
|
336
|
+
localOrder: 41,
|
|
337
|
+
hermesDefault: false,
|
|
338
|
+
annotations: {"readOnlyHint":false,"destructiveHint":true,"idempotentHint":true,"openWorldHint":false},
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: "job_get",
|
|
342
|
+
toolset: "runs",
|
|
343
|
+
surfaces: ["local"],
|
|
344
|
+
localOrder: 39,
|
|
345
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
name: "job_wait",
|
|
349
|
+
toolset: "runs",
|
|
350
|
+
surfaces: ["local"],
|
|
351
|
+
localOrder: 40,
|
|
352
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
name: "model_get",
|
|
356
|
+
toolset: "models",
|
|
357
|
+
surfaces: ["local"],
|
|
358
|
+
readOnlySurface: true,
|
|
359
|
+
localOrder: 31,
|
|
360
|
+
annotations: {"readOnlyHint":true,"openWorldHint":false},
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
name: "model_list",
|
|
364
|
+
toolset: "models",
|
|
365
|
+
surfaces: ["local"],
|
|
366
|
+
readOnlySurface: true,
|
|
367
|
+
localOrder: 30,
|
|
368
|
+
annotations: {"readOnlyHint":true,"openWorldHint":false},
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
name: "node_create",
|
|
372
|
+
toolset: "canvas",
|
|
373
|
+
surfaces: ["local"],
|
|
374
|
+
localOrder: 19,
|
|
375
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
name: "node_delete",
|
|
379
|
+
toolset: "canvas",
|
|
380
|
+
surfaces: ["local"],
|
|
381
|
+
localOrder: 23,
|
|
382
|
+
hermesDefault: false,
|
|
383
|
+
annotations: {"readOnlyHint":false,"destructiveHint":true,"idempotentHint":true,"openWorldHint":false},
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: "node_get",
|
|
387
|
+
toolset: "canvas",
|
|
388
|
+
surfaces: ["local"],
|
|
389
|
+
readOnlySurface: true,
|
|
390
|
+
localOrder: 18,
|
|
391
|
+
annotations: {"readOnlyHint":true,"openWorldHint":false},
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: "node_move",
|
|
395
|
+
toolset: "canvas",
|
|
396
|
+
surfaces: ["local"],
|
|
397
|
+
localOrder: 21,
|
|
398
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
name: "node_resize",
|
|
402
|
+
toolset: "canvas",
|
|
403
|
+
surfaces: ["local"],
|
|
404
|
+
localOrder: 22,
|
|
405
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
name: "node_update",
|
|
409
|
+
toolset: "canvas",
|
|
410
|
+
surfaces: ["local"],
|
|
411
|
+
localOrder: 20,
|
|
412
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: "product_reference_pack_import",
|
|
416
|
+
toolset: "assets",
|
|
417
|
+
surfaces: ["hosted"],
|
|
418
|
+
hostedAlias: "import_product_reference_pack",
|
|
419
|
+
scopes: ["canvas:read","canvas:write","asset:read"],
|
|
420
|
+
hostedOrder: 9,
|
|
421
|
+
hostedReadOnly: false,
|
|
422
|
+
hostedToolset: "assets",
|
|
423
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: "provider_list",
|
|
427
|
+
toolset: "models",
|
|
428
|
+
surfaces: ["local"],
|
|
429
|
+
readOnlySurface: true,
|
|
430
|
+
localOrder: 29,
|
|
431
|
+
annotations: {"readOnlyHint":true,"openWorldHint":false},
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
name: "recipe_fork",
|
|
435
|
+
toolset: "recipes",
|
|
436
|
+
surfaces: ["local"],
|
|
437
|
+
localOrder: 4,
|
|
438
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: "recipe_get",
|
|
442
|
+
toolset: "recipes",
|
|
443
|
+
surfaces: ["local"],
|
|
444
|
+
readOnlySurface: true,
|
|
445
|
+
localOrder: 3,
|
|
446
|
+
annotations: {"readOnlyHint":true,"openWorldHint":false},
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
name: "recipe_run",
|
|
450
|
+
toolset: "recipes",
|
|
451
|
+
surfaces: ["local"],
|
|
452
|
+
localOrder: 5,
|
|
453
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
name: "recipe_search",
|
|
457
|
+
toolset: "recipes",
|
|
458
|
+
surfaces: ["local"],
|
|
459
|
+
readOnlySurface: true,
|
|
460
|
+
localOrder: 2,
|
|
461
|
+
annotations: {"readOnlyHint":true,"openWorldHint":false},
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: "run_cancel",
|
|
465
|
+
toolset: "runs",
|
|
466
|
+
surfaces: ["local"],
|
|
467
|
+
localOrder: 44,
|
|
468
|
+
hermesDefault: false,
|
|
469
|
+
annotations: {"readOnlyHint":false,"destructiveHint":true,"idempotentHint":true,"openWorldHint":false},
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "run_get",
|
|
473
|
+
toolset: "runs",
|
|
474
|
+
surfaces: ["local"],
|
|
475
|
+
localOrder: 42,
|
|
476
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
name: "run_wait",
|
|
480
|
+
toolset: "runs",
|
|
481
|
+
surfaces: ["local"],
|
|
482
|
+
localOrder: 43,
|
|
483
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
name: "video_generate",
|
|
487
|
+
toolset: "videos",
|
|
488
|
+
surfaces: ["hosted","local"],
|
|
489
|
+
hostedAlias: "generate_video",
|
|
490
|
+
scopes: ["canvas:read","asset:read","video:generate","job:manage"],
|
|
491
|
+
hostedOrder: 15,
|
|
492
|
+
paid: true,
|
|
493
|
+
hostedReadOnly: false,
|
|
494
|
+
hostedToolset: "videos",
|
|
495
|
+
localOrder: 38,
|
|
496
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: "video_job_get",
|
|
500
|
+
toolset: "videos",
|
|
501
|
+
surfaces: ["hosted"],
|
|
502
|
+
hostedAlias: "get_video_job",
|
|
503
|
+
scopes: ["job:manage"],
|
|
504
|
+
hostedOrder: 16,
|
|
505
|
+
hostedReadOnly: false,
|
|
506
|
+
hostedToolset: "runs",
|
|
507
|
+
annotations: {"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
name: "video_model_find",
|
|
511
|
+
toolset: "videos",
|
|
512
|
+
surfaces: ["hosted"],
|
|
513
|
+
hostedAlias: "find_video_models",
|
|
514
|
+
scopes: ["video:generate"],
|
|
515
|
+
hostedOrder: 14,
|
|
516
|
+
hostedReadOnly: true,
|
|
517
|
+
hostedToolset: "models",
|
|
518
|
+
annotations: {"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},
|
|
519
|
+
},
|
|
520
|
+
]);
|
|
521
|
+
|
|
522
|
+
/** Canonical name for a tool name or deprecated hosted alias. */
|
|
523
|
+
export function gavanaCanonicalToolName(name) {
|
|
524
|
+
const value = String(name || "");
|
|
525
|
+
if (GAVANA_TOOL_REGISTRY.some((tool) => tool.name === value)) return value;
|
|
526
|
+
return GAVANA_TOOL_REGISTRY.find((tool) => tool.hostedAlias === value)?.name;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/** Every deprecated hosted alias, as alias -> canonical. */
|
|
530
|
+
export const GAVANA_TOOL_ALIASES = Object.freeze(
|
|
531
|
+
Object.fromEntries(GAVANA_TOOL_REGISTRY.filter((tool) => tool.hostedAlias).map((tool) => [tool.hostedAlias, tool.name])),
|
|
532
|
+
);
|
|
533
|
+
|
|
534
|
+
/** Tools Hermes enables by default: every local tool except the opt-in ones. */
|
|
535
|
+
export function gavanaHermesDefaultTools() {
|
|
536
|
+
return GAVANA_TOOL_REGISTRY.filter((tool) => tool.surfaces.includes("local") && tool.hermesDefault !== false);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/** Tools a surface advertises. Campaign tools stay hidden unless explicitly included. */
|
|
540
|
+
export function gavanaToolsForSurface(surface, { includeLegacyCampaign = false, readOnly = false } = {}) {
|
|
541
|
+
// Advertised order is observable to clients and asserted by the server tests, so
|
|
542
|
+
// each surface keeps the order it shipped with rather than falling out of the
|
|
543
|
+
// registry's alphabetical layout.
|
|
544
|
+
const key = surface === "hosted" ? "hostedOrder" : "localOrder";
|
|
545
|
+
return GAVANA_TOOL_REGISTRY.filter(
|
|
546
|
+
(tool) => tool.surfaces.includes(surface) && (includeLegacyCampaign || !tool.legacyCampaign) && (!readOnly || tool.readOnlySurface),
|
|
547
|
+
)
|
|
548
|
+
.slice()
|
|
549
|
+
.sort((left, right) => (left[key] ?? 0) - (right[key] ?? 0));
|
|
550
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Tool definition: run_cancel
|
|
2
|
+
//
|
|
3
|
+
// Registered through ./definitions.mjs. ./registry.mjs is the catalog that says
|
|
4
|
+
// this tool exists and on which surfaces; this file is what it does.
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { runReference } from "./schemas.mjs";
|
|
7
|
+
|
|
8
|
+
export function defineRunCancel(client) {
|
|
9
|
+
return {
|
|
10
|
+
title: "Cancel a shared Run",
|
|
11
|
+
description: "Cancel queued or running Recipe, image, or Action work. Use only after explicit user intent.",
|
|
12
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
13
|
+
inputSchema: z.object({ runId: runReference }),
|
|
14
|
+
handler: ({ runId }) => client.cancelRun(runId),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Tool definition: run_get
|
|
2
|
+
//
|
|
3
|
+
// Registered through ./definitions.mjs. ./registry.mjs is the catalog that says
|
|
4
|
+
// this tool exists and on which surfaces; this file is what it does.
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { runReference } from "./schemas.mjs";
|
|
7
|
+
|
|
8
|
+
export function defineRunGet(client) {
|
|
9
|
+
return {
|
|
10
|
+
title: "Read a shared Run",
|
|
11
|
+
description: "Read or resume Recipe, image, or Action work through one shared Run resource.",
|
|
12
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
13
|
+
inputSchema: z.object({ runId: runReference }),
|
|
14
|
+
markdown: true,
|
|
15
|
+
handler: ({ runId }) => client.getRun(runId),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Tool definition: run_wait
|
|
2
|
+
//
|
|
3
|
+
// Registered through ./definitions.mjs. ./registry.mjs is the catalog that says
|
|
4
|
+
// this tool exists and on which surfaces; this file is what it does.
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { runReference } from "./schemas.mjs";
|
|
7
|
+
import { withProgress } from "./progress.mjs";
|
|
8
|
+
|
|
9
|
+
export function defineRunWait(client) {
|
|
10
|
+
return {
|
|
11
|
+
title: "Wait for a shared Run",
|
|
12
|
+
description: "Wait for a Recipe, image, or Action Run to reach a terminal state and return its durable outputs.",
|
|
13
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
14
|
+
inputSchema: z.object({ runId: runReference, timeoutSeconds: z.number().min(1).max(3_600).default(900) }),
|
|
15
|
+
markdown: true,
|
|
16
|
+
handler: ({ runId, timeoutSeconds }, extra) => client.waitForRun(runId, withProgress({ timeoutMs: timeoutSeconds * 1000 }, extra)),
|
|
17
|
+
};
|
|
18
|
+
}
|