@mediamonks/canopy-cli 0.7.30 → 0.7.32
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/{ai-fAvjdjVX.mjs → ai-DHLnyqfq.mjs} +2 -1
- package/dist/{ui-CeupNHNa.mjs → api-C4rMhE7i.mjs} +1 -122
- package/dist/{db-KTLn8J1u.mjs → db-BB6O6085.mjs} +3 -2
- package/dist/{deploy-CBf44bvG.mjs → deploy-Ka2lHkyy.mjs} +114 -2
- package/dist/{dev-JlzMZJow.mjs → dev-CkhBnSlv.mjs} +13 -6
- package/dist/dev-MoHHjQh1.mjs +2 -0
- package/dist/dev-server-file-Dk9pk4AR.mjs +54 -0
- package/dist/{dev-worker-DjJGSUGj.mjs → dev-worker-CaCsGBkn.mjs} +34 -2
- package/dist/docs/agent-tools.md +212 -0
- package/dist/docs/cli-mcp.md +88 -0
- package/dist/docs/developers-agents-and-ai.md +8 -0
- package/dist/docs/index.json +15 -0
- package/dist/docs/sdk-mcp.md +222 -0
- package/dist/{docs-Dg0UJugG.mjs → docs-CtNH5kbN.mjs} +2 -2
- package/dist/{egress-Cn9zDfDT.mjs → egress-If_Gsx_M.mjs} +2 -1
- package/dist/{feedback-Dvb6CdlP.mjs → feedback-_L3vqktY.mjs} +3 -2
- package/dist/index.mjs +32 -29
- package/dist/{local-BA_TPWpN.mjs → local-DAYCNUyz.mjs} +3 -3
- package/dist/{login-MX0xq8UE.mjs → login-B-m-i8uu.mjs} +1 -1
- package/dist/{logs-D5RWqsWl.mjs → logs-DQQOawOG.mjs} +2 -1
- package/dist/mcp-RcN17Z2v.mjs +457 -0
- package/dist/{migrations-C8yRPJIX.mjs → migrations-Czlcddyz.mjs} +1 -1
- package/dist/{open-BJgd0R61.mjs → open-DcaQKi1v.mjs} +1 -1
- package/dist/{package-CnS450Yc.mjs → package-YGjjin4p.mjs} +1 -1
- package/dist/{projects-BG7Injpb.mjs → projects-CN2YhCZn.mjs} +2 -1
- package/dist/{schedule-CLuksxSM.mjs → schedule-C5lMf3ny.mjs} +2 -1
- package/dist/{secrets-Bl3uOx4l.mjs → secrets-BSEjZnxg.mjs} +2 -1
- package/dist/skill/canopy/SKILL.md +7 -0
- package/dist/{skill-CuES7kPj.mjs → skill-CM7R-4Bq.mjs} +2 -2
- package/dist/{src-C7zPhbxi.mjs → src-BkACMkol.mjs} +15 -1
- package/dist/{staging-D06zobnf.mjs → staging-BZVty57b.mjs} +2 -1
- package/dist/templates/spa/package.json +1 -1
- package/dist/templates/worker/package.json +1 -1
- package/dist/templates/worker/worker/index.ts +17 -0
- package/dist/{token-C_PFNqcv.mjs → token-HHlUR0CF.mjs} +2 -1
- package/dist/ui-C_jSc1Kz.mjs +123 -0
- package/dist/{upgrade-C8YdSKKd.mjs → upgrade-ChcSZW8i.mjs} +2 -2
- package/dist/{usage-CV7TjTO8.mjs → usage-CUYrWxv0.mjs} +2 -1
- package/package.json +5 -2
- package/dist/dev-DGCu9MjB.mjs +0 -2
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: canopy mcp
|
|
3
|
+
description: Let AI agents use a project's backend as MCP tools — check access, print client config, and run the stdio server.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`canopy mcp` connects AI agents (Claude Code, Claude Desktop, Cursor, any MCP
|
|
7
|
+
client) to a project's tools. The agent always acts as you. See
|
|
8
|
+
[Agent tools](https://docs.canopy.website/guides/agent-tools) for how a project offers tools.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
canopy mcp add [slug] [--channel staging]
|
|
14
|
+
canopy mcp serve [slug] [--channel staging] [--local]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## canopy mcp add
|
|
18
|
+
|
|
19
|
+
Checks that you're signed in and may open the project, reports how many tools
|
|
20
|
+
it serves, and prints configuration for your client: a `claude mcp add` line
|
|
21
|
+
for Claude Code, and an `mcpServers` JSON block for Claude Desktop, Cursor and
|
|
22
|
+
others. It writes nothing; copy what you need.
|
|
23
|
+
|
|
24
|
+
The printed command names the site (`--profile`) and, for staging, the
|
|
25
|
+
channel, so it keeps working whatever your default site is. It contains no
|
|
26
|
+
credentials.
|
|
27
|
+
|
|
28
|
+
## canopy mcp serve
|
|
29
|
+
|
|
30
|
+
The MCP server your client starts. It talks MCP on stdin/stdout and writes
|
|
31
|
+
nothing else there, so everything it has to say goes to stderr, where clients
|
|
32
|
+
show it as the server's log.
|
|
33
|
+
|
|
34
|
+
It uses your `canopy login`: it exchanges it for short-lived credentials for
|
|
35
|
+
this one project, keeps them in memory, and renews them as needed. If you're
|
|
36
|
+
not signed in, it exits with a message telling you to run `canopy login`.
|
|
37
|
+
|
|
38
|
+
Only the project's tools reach the agent, and the tool list stays current: a
|
|
39
|
+
redeploy with new tools reaches a running session without restarting
|
|
40
|
+
anything.
|
|
41
|
+
|
|
42
|
+
## Arguments & flags
|
|
43
|
+
|
|
44
|
+
- `slug` — the project. Defaults to the `canopy.json` in the current directory.
|
|
45
|
+
- `--channel <live|staging>` — which channel's backend to use. Default `live`.
|
|
46
|
+
- `--local` (serve only) — use the tools of the `canopy dev` running in the
|
|
47
|
+
current directory instead of the deployed project.
|
|
48
|
+
- `--profile <id>` — which Canopy site, as for every command.
|
|
49
|
+
|
|
50
|
+
## Examples
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
canopy mcp add notes
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Check you can use `notes` and print its client configuration.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
claude mcp add canopy-notes -- canopy mcp serve notes --profile main
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Add `notes` to Claude Code (the line `canopy mcp add` printed).
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
claude mcp add notes-staging -- canopy mcp serve notes --channel staging --profile main
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Try the staging channel's tools before promoting them.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
claude mcp add notes-local -- canopy mcp serve --local
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
While developing: the tools from your working tree, served by `canopy dev`.
|
|
75
|
+
|
|
76
|
+
## When it can't connect
|
|
77
|
+
|
|
78
|
+
`canopy mcp add` and `canopy mcp serve` say what's wrong in plain words. The
|
|
79
|
+
usual cases:
|
|
80
|
+
|
|
81
|
+
- **Not signed in** — run `canopy login`.
|
|
82
|
+
- **Limited to its collaborators** — ask the owner to add you.
|
|
83
|
+
- **No backend, or serves no tools** — the project has no `worker/`, or it
|
|
84
|
+
doesn't mount any tools yet.
|
|
85
|
+
- **Redeploy required** — the backend was deployed before tools existed. Run
|
|
86
|
+
`canopy deploy`.
|
|
87
|
+
- **Invalid tool definitions** — two tools share a name, or a schema is wrong.
|
|
88
|
+
The message names the tool.
|
|
@@ -64,6 +64,14 @@ already knows the rules:
|
|
|
64
64
|
use `canopy dev --local` for an offline sandbox where writes never reach
|
|
65
65
|
the platform.
|
|
66
66
|
|
|
67
|
+
## Give agents your project's tools
|
|
68
|
+
|
|
69
|
+
The other way round: your project can offer its backend to agents as MCP
|
|
70
|
+
tools, so a colleague's Claude Code or Cursor can call it (as them) without
|
|
71
|
+
opening the app. Wrap the routes you already have with `mountMcpTools`, deploy,
|
|
72
|
+
and people connect with `canopy mcp add <slug>`. See
|
|
73
|
+
[Agent tools](https://docs.canopy.website/guides/agent-tools).
|
|
74
|
+
|
|
67
75
|
## Prompts that work
|
|
68
76
|
|
|
69
77
|
With the skill installed, these are safe, copy-pasteable asks — each maps to
|
package/dist/docs/index.json
CHANGED
|
@@ -67,6 +67,11 @@
|
|
|
67
67
|
"title": "CI and deploy tokens",
|
|
68
68
|
"summary": "Push-to-main deploys using a project-scoped deploy token."
|
|
69
69
|
},
|
|
70
|
+
{
|
|
71
|
+
"slug": "agent-tools",
|
|
72
|
+
"title": "Agent tools (MCP)",
|
|
73
|
+
"summary": "Let AI agents like Claude Code and Cursor use your project's backend as tools — as the person running them."
|
|
74
|
+
},
|
|
70
75
|
{
|
|
71
76
|
"slug": "porting-nextjs",
|
|
72
77
|
"title": "Porting a Next.js app",
|
|
@@ -286,6 +291,11 @@
|
|
|
286
291
|
"title": "canopy feedback",
|
|
287
292
|
"summary": "Read and triage a project's feedback inbox, or file a bug/feedback report — against a project or against Canopy itself."
|
|
288
293
|
},
|
|
294
|
+
{
|
|
295
|
+
"slug": "cli-mcp",
|
|
296
|
+
"title": "canopy mcp",
|
|
297
|
+
"summary": "Let AI agents use a project's backend as MCP tools — check access, print client config, and run the stdio server."
|
|
298
|
+
},
|
|
289
299
|
{
|
|
290
300
|
"slug": "cli-open",
|
|
291
301
|
"title": "canopy open",
|
|
@@ -353,6 +363,11 @@
|
|
|
353
363
|
"title": "Realtime",
|
|
354
364
|
"summary": "Live updates between the people using your app — subscribe to a topic, publish to it, no backend needed."
|
|
355
365
|
},
|
|
366
|
+
{
|
|
367
|
+
"slug": "sdk-mcp",
|
|
368
|
+
"title": "Agent tools (MCP)",
|
|
369
|
+
"summary": "\"@mediamonks/canopy/mcp — serve your backend's tools to AI agents: mountMcpTools, createMcpToolsHandler, MCP_PATH and mcpCaller.\""
|
|
370
|
+
},
|
|
356
371
|
{
|
|
357
372
|
"slug": "sdk-google",
|
|
358
373
|
"title": "Google",
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Agent tools (MCP)
|
|
3
|
+
description: "@mediamonks/canopy/mcp — serve your backend's tools to AI agents: mountMcpTools, createMcpToolsHandler, MCP_PATH and mcpCaller."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`@mediamonks/canopy/mcp` turns your backend into a set of MCP tools that AI
|
|
7
|
+
agents call through `canopy mcp serve`, always as the signed-in Monk running
|
|
8
|
+
them. It is a separate entry of the SDK, for backend code only: browser
|
|
9
|
+
bundles never include it.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { createMcpToolsHandler, MCP_PATH, mcpCaller, mountMcpTools } from "@mediamonks/canopy/mcp";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
For the why and the how-to, read the [Agent tools guide](https://docs.canopy.website/guides/agent-tools).
|
|
16
|
+
This page lists the exports and what they accept.
|
|
17
|
+
|
|
18
|
+
## mountMcpTools(app, tools, options?)
|
|
19
|
+
|
|
20
|
+
Serves `tools` at `MCP_PATH` on a Hono app. Route tools run this same app's
|
|
21
|
+
routes.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { mountMcpTools } from "@mediamonks/canopy/mcp";
|
|
25
|
+
import { z } from "zod";
|
|
26
|
+
|
|
27
|
+
mountMcpTools(app, [
|
|
28
|
+
{
|
|
29
|
+
name: "list_notes",
|
|
30
|
+
description: "List the current user's notes, newest first",
|
|
31
|
+
route: "GET /api/notes",
|
|
32
|
+
annotations: { readOnlyHint: true },
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "summarise",
|
|
36
|
+
description: "Summarise a note",
|
|
37
|
+
inputSchema: z.object({ id: z.string() }),
|
|
38
|
+
handler: async ({ id }, ctx) => summarise(ctx.env, id),
|
|
39
|
+
},
|
|
40
|
+
]);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- `app` — your Hono app, or anything with `all(path, handler)` and
|
|
44
|
+
`fetch(request, env, ctx)`.
|
|
45
|
+
- `tools` — a list of [tool definitions](#tool-definitions) and
|
|
46
|
+
[AI SDK tool sets](#vercel-ai-sdk-tool-sets), mixed.
|
|
47
|
+
- `options` — optional `{ name?, version? }`: the server name and version MCP
|
|
48
|
+
clients see. The name defaults to your project's slug.
|
|
49
|
+
|
|
50
|
+
## createMcpToolsHandler(tools, options?)
|
|
51
|
+
|
|
52
|
+
The same thing without Hono: returns a handler you route `MCP_PATH` to
|
|
53
|
+
yourself.
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { createMcpToolsHandler, MCP_PATH } from "@mediamonks/canopy/mcp";
|
|
57
|
+
|
|
58
|
+
const tools = createMcpToolsHandler(myTools, { app });
|
|
59
|
+
|
|
60
|
+
export default {
|
|
61
|
+
fetch(request, env, ctx) {
|
|
62
|
+
if (new URL(request.url).pathname === MCP_PATH) return tools(request, env, ctx);
|
|
63
|
+
return app.fetch(request, env, ctx);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Returns** `(request, env?, executionCtx?) => Promise<Response>`. Pass the
|
|
69
|
+
backend's `env` so handlers and route tools see `env.USER`, `env.CANOPY` and
|
|
70
|
+
your secrets.
|
|
71
|
+
|
|
72
|
+
**Options:** `{ app?, name?, version? }`. `app` is required when the list has
|
|
73
|
+
route tools: they run its routes.
|
|
74
|
+
|
|
75
|
+
Each request gets a fresh, stateless MCP server built on the official
|
|
76
|
+
`@modelcontextprotocol/server`. It speaks both the current MCP protocol and
|
|
77
|
+
the 2025 revision, so older clients work too.
|
|
78
|
+
|
|
79
|
+
## Tool definitions
|
|
80
|
+
|
|
81
|
+
A tool is an object in the MCP specification's shape, plus either a `handler`
|
|
82
|
+
or a `route`:
|
|
83
|
+
|
|
84
|
+
| Field | Type | |
|
|
85
|
+
| -------------- | ------------------------------ | ------------------------------------------------------------------------------------- |
|
|
86
|
+
| `name` | `string` | Required. Unique; letters, digits, `_`, `-` and `.`, at most 128. |
|
|
87
|
+
| `description` | `string` | What it does and when to use it. The agent reads this. |
|
|
88
|
+
| `title` | `string` | A display name. |
|
|
89
|
+
| `inputSchema` | JSON Schema or Standard Schema | The arguments. Defaults to "no arguments". |
|
|
90
|
+
| `outputSchema` | JSON Schema or Standard Schema | Shape of the structured result, if you want clients to rely on it. |
|
|
91
|
+
| `annotations` | `McpToolAnnotations` | Hints: `readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`, `title`. |
|
|
92
|
+
| `handler` | `(args, ctx) => unknown` | Runs the tool. |
|
|
93
|
+
| `route` | `"<METHOD> /path"` | Runs one of your routes instead. |
|
|
94
|
+
|
|
95
|
+
**Schemas** can be plain JSON Schema or any schema that implements Standard
|
|
96
|
+
Schema with JSON Schema output: Zod 4, Valibot (with `toStandardJsonSchema`),
|
|
97
|
+
ArkType. Arguments are validated against `inputSchema` before your handler or
|
|
98
|
+
route runs. Invalid arguments come back to the agent as an error naming the
|
|
99
|
+
field.
|
|
100
|
+
|
|
101
|
+
**Annotations** matter to agents. Mark tools that change nothing with
|
|
102
|
+
`readOnlyHint: true`. Unmarked tools are treated as possibly destructive, and
|
|
103
|
+
clients usually ask the user before calling them.
|
|
104
|
+
|
|
105
|
+
### Handler tools
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
{
|
|
109
|
+
name: "add_comment",
|
|
110
|
+
inputSchema: z.object({ noteId: z.string(), text: z.string().max(2000) }),
|
|
111
|
+
handler: async ({ noteId, text }, ctx) => {
|
|
112
|
+
const env = ctx.env as Env; // your backend's Env type
|
|
113
|
+
const canopy = createCanopy({ fetch: env.CANOPY.fetch.bind(env.CANOPY) });
|
|
114
|
+
return canopy.db.collection("comments").insert({ noteId, text, by: ctx.user?.email });
|
|
115
|
+
},
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
What the handler returns becomes the result:
|
|
120
|
+
|
|
121
|
+
- an object — sent as structured content, with a JSON text copy;
|
|
122
|
+
- a string — sent as text;
|
|
123
|
+
- an MCP `CallToolResult` (`{ content, structuredContent?, isError? }`) —
|
|
124
|
+
sent as is;
|
|
125
|
+
- nothing — an empty result.
|
|
126
|
+
|
|
127
|
+
Throw to report a failure. The agent gets a tool error with your message.
|
|
128
|
+
|
|
129
|
+
**`ctx`** (`McpToolContext`):
|
|
130
|
+
|
|
131
|
+
- `user` — the signed-in Monk (`{ sub, email, name }`), or `null`.
|
|
132
|
+
- `agent` — `true` when an AI agent made the call through `canopy mcp`.
|
|
133
|
+
- `toolCallId` — this call's id, for logs.
|
|
134
|
+
- `signal` — an `AbortSignal`, aborted when the agent cancels.
|
|
135
|
+
- `request` — the HTTP request the call arrived on, without platform
|
|
136
|
+
credentials.
|
|
137
|
+
- `env` — your backend's env, as routes get it. Typed `unknown`: cast it to
|
|
138
|
+
your `Env`.
|
|
139
|
+
|
|
140
|
+
`canopy.*` calls from a handler act as the user, as they would for that
|
|
141
|
+
person's browser.
|
|
142
|
+
|
|
143
|
+
### Route tools
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
{ name: "get_note", route: "GET /api/notes/:id", inputSchema: z.object({ id: z.string() }) }
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The route runs in-process, with the same `env` and identity:
|
|
150
|
+
|
|
151
|
+
- `:name` segments of the path are filled from the argument of that name. A
|
|
152
|
+
missing one is a tool error.
|
|
153
|
+
- `GET` and `DELETE`: the other arguments become the query string (arrays
|
|
154
|
+
repeat the key, objects are sent as JSON).
|
|
155
|
+
- `POST`, `PUT`, `PATCH`: the other arguments become a JSON body.
|
|
156
|
+
- A 2xx JSON response becomes the result (structured when it's an object).
|
|
157
|
+
Other 2xx bodies become text.
|
|
158
|
+
- Any other status becomes a tool error: `HTTP 403: {"error":"not_owner"}`.
|
|
159
|
+
|
|
160
|
+
### Vercel AI SDK tool sets
|
|
161
|
+
|
|
162
|
+
Put a tool set in the list as it is. Each key becomes a tool name:
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
import { tool } from "ai";
|
|
166
|
+
|
|
167
|
+
const aiTools = {
|
|
168
|
+
weather: tool({
|
|
169
|
+
description: "Weather in a city",
|
|
170
|
+
inputSchema: z.object({ city: z.string() }),
|
|
171
|
+
execute: async ({ city }) => ({ city, tempC: 21 }),
|
|
172
|
+
}),
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
mountMcpTools(app, [...myTools, aiTools]);
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
`execute` gets the arguments and `{ toolCallId, abortSignal, messages: [] }`.
|
|
179
|
+
Tools without `execute` are skipped. If the result is a stream, its last value
|
|
180
|
+
is the answer.
|
|
181
|
+
|
|
182
|
+
## MCP_PATH
|
|
183
|
+
|
|
184
|
+
`"/__canopy/mcp"` — the one path on your backend that agents reach. Mount your
|
|
185
|
+
own MCP server there if you don't use `mountMcpTools`. It must answer on that
|
|
186
|
+
single URL with MCP's streamable HTTP transport.
|
|
187
|
+
|
|
188
|
+
## mcpCaller(request, env?)
|
|
189
|
+
|
|
190
|
+
Who is calling, in any route or in your own MCP server:
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
app.get("/api/notes", (c) => {
|
|
194
|
+
const { user, agent } = mcpCaller(c.req.raw, c.env);
|
|
195
|
+
// agent is true for a tools call that ran this route
|
|
196
|
+
});
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Returns** `McpCaller`: `{ user: McpUser | null, agent: boolean }`.
|
|
200
|
+
`user` comes from `env.USER`. Without `env`, it falls back to the identity the
|
|
201
|
+
platform attached to the request.
|
|
202
|
+
|
|
203
|
+
## When the tool list is wrong
|
|
204
|
+
|
|
205
|
+
The list is checked on the first request. A duplicate or invalid name, a tool
|
|
206
|
+
with neither or both of `handler` and `route`, a route tool without `app`, or
|
|
207
|
+
a schema that can't describe itself as JSON Schema makes the tools endpoint
|
|
208
|
+
answer `500 invalid_tools`, naming the tool. `canopy mcp add` shows that
|
|
209
|
+
message. The rest of your backend keeps working.
|
|
210
|
+
|
|
211
|
+
## Limits
|
|
212
|
+
|
|
213
|
+
`canopy mcp serve` holds back tools whose description is over 2,048
|
|
214
|
+
characters or whose input schema is over 16 KB, shows at most 64 tools, turns
|
|
215
|
+
results over 512 KB into an error, and stops a call after 60 seconds.
|
|
216
|
+
|
|
217
|
+
## Types
|
|
218
|
+
|
|
219
|
+
All exported from `@mediamonks/canopy/mcp`: `McpTool`, `McpHandlerTool`,
|
|
220
|
+
`McpRouteTool`, `McpToolAnnotations`, `McpToolContext`, `McpToolsInput`,
|
|
221
|
+
`McpToolsOptions`, `McpCaller`, `McpUser`, `AiSdkToolSet`, `ToolSchema`,
|
|
222
|
+
`JsonSchema`, `StandardSchemaLike`, `FetchApp`, `HttpMethod`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as version } from "./package-
|
|
1
|
+
import { t as version } from "./package-YGjjin4p.mjs";
|
|
2
2
|
import { n as siteConfig } from "./site-DM2J10CB.mjs";
|
|
3
3
|
import { i as latestKnownVersion, r as compareSemver } from "./version-check-CcsA1QjI.mjs";
|
|
4
|
-
import { r as reportErrors } from "./ui-
|
|
4
|
+
import { r as reportErrors } from "./ui-C_jSc1Kz.mjs";
|
|
5
5
|
import { defineCommand } from "citty";
|
|
6
6
|
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { homedir } from "node:os";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { a as projectDirArgs, c as resolveProject } from "./site-DM2J10CB.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { i as apiRequest, o as withContext } from "./api-C4rMhE7i.mjs";
|
|
3
|
+
import { a as unwrap, i as requireTty, r as reportErrors, t as formatDateTime } from "./ui-C_jSc1Kz.mjs";
|
|
3
4
|
import { defineCommand } from "citty";
|
|
4
5
|
import * as p from "@clack/prompts";
|
|
5
6
|
//#region src/egress.ts
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { t as version } from "./package-
|
|
1
|
+
import { t as version } from "./package-YGjjin4p.mjs";
|
|
2
2
|
import { a as projectDirArgs, c as resolveProject, d as tryResolveProject, n as siteConfig, u as tryReadCanopyJson } from "./site-DM2J10CB.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { a as apiUpload, i as apiRequest, r as apiDownload } from "./api-C4rMhE7i.mjs";
|
|
4
|
+
import { r as reportErrors, t as formatDateTime } from "./ui-C_jSc1Kz.mjs";
|
|
4
5
|
import { defineCommand } from "citty";
|
|
5
6
|
import { basename, extname, join } from "node:path";
|
|
6
7
|
import { readFile, writeFile } from "node:fs/promises";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as version } from "./package-
|
|
2
|
+
import { t as version } from "./package-YGjjin4p.mjs";
|
|
3
3
|
import { r as siteHeaderLine, t as setInvocationProfile } from "./site-DM2J10CB.mjs";
|
|
4
4
|
import { a as notifyOfUpdate, o as runRefresh } from "./version-check-CcsA1QjI.mjs";
|
|
5
5
|
import { defineCommand, runMain } from "citty";
|
|
@@ -18,6 +18,7 @@ import { defineCommand, runMain } from "citty";
|
|
|
18
18
|
* logs [--follow] read the project's worker logs [phase 2]
|
|
19
19
|
* usage AI spend + storage for a project [phase 1]
|
|
20
20
|
* ai models the site's AI models and auto/* aliases
|
|
21
|
+
* mcp add|serve a project's tools for AI agents (docs/49)
|
|
21
22
|
* open open the deployed project / dashboard [phase 1]
|
|
22
23
|
*/
|
|
23
24
|
if (process.env["CANOPY_UPDATE_REFRESH"] === "1") {
|
|
@@ -61,36 +62,38 @@ const main = defineCommand({
|
|
|
61
62
|
description: "canopy — create and deploy vibecoded projects"
|
|
62
63
|
},
|
|
63
64
|
subCommands: {
|
|
64
|
-
login: () => import("./login-
|
|
65
|
-
whoami: () => import("./login-
|
|
66
|
-
logout: () => import("./login-
|
|
67
|
-
create: () => import("./projects-
|
|
68
|
-
init: () => import("./projects-
|
|
69
|
-
projects: () => import("./projects-
|
|
70
|
-
delete: () => import("./projects-
|
|
71
|
-
dev: () => import("./dev-
|
|
72
|
-
deploy: () => import("./deploy-
|
|
73
|
-
promote: () => import("./deploy-
|
|
74
|
-
staging: () => import("./staging-
|
|
75
|
-
rollback: () => import("./deploy-
|
|
76
|
-
download: () => import("./deploy-
|
|
77
|
-
token: () => import("./token-
|
|
78
|
-
egress: () => import("./egress-
|
|
79
|
-
secrets: () => import("./secrets-
|
|
80
|
-
schedule: () => import("./schedule-
|
|
81
|
-
feedback: () => import("./feedback-
|
|
82
|
-
db: () => import("./db-
|
|
83
|
-
usage: () => import("./usage-
|
|
84
|
-
ai: () => import("./ai-
|
|
85
|
-
open: () => import("./open-
|
|
86
|
-
docs: () => import("./docs-
|
|
87
|
-
skill: () => import("./skill-
|
|
88
|
-
upgrade: () => import("./upgrade-
|
|
89
|
-
logs: () => import("./logs-
|
|
65
|
+
login: () => import("./login-B-m-i8uu.mjs").then((m) => m.loginCommand),
|
|
66
|
+
whoami: () => import("./login-B-m-i8uu.mjs").then((m) => m.whoamiCommand),
|
|
67
|
+
logout: () => import("./login-B-m-i8uu.mjs").then((m) => m.logoutCommand),
|
|
68
|
+
create: () => import("./projects-CN2YhCZn.mjs").then((m) => m.createCommand),
|
|
69
|
+
init: () => import("./projects-CN2YhCZn.mjs").then((m) => m.initCommand),
|
|
70
|
+
projects: () => import("./projects-CN2YhCZn.mjs").then((m) => m.projectsCommand),
|
|
71
|
+
delete: () => import("./projects-CN2YhCZn.mjs").then((m) => m.deleteCommand),
|
|
72
|
+
dev: () => import("./dev-MoHHjQh1.mjs").then((m) => m.devCommand),
|
|
73
|
+
deploy: () => import("./deploy-Ka2lHkyy.mjs").then((m) => m.deployCommand),
|
|
74
|
+
promote: () => import("./deploy-Ka2lHkyy.mjs").then((m) => m.promoteCommand),
|
|
75
|
+
staging: () => import("./staging-BZVty57b.mjs").then((m) => m.stagingCommand),
|
|
76
|
+
rollback: () => import("./deploy-Ka2lHkyy.mjs").then((m) => m.rollbackCommand),
|
|
77
|
+
download: () => import("./deploy-Ka2lHkyy.mjs").then((m) => m.downloadCommand),
|
|
78
|
+
token: () => import("./token-HHlUR0CF.mjs").then((m) => m.tokenCommand),
|
|
79
|
+
egress: () => import("./egress-If_Gsx_M.mjs").then((m) => m.egressCommand),
|
|
80
|
+
secrets: () => import("./secrets-BSEjZnxg.mjs").then((m) => m.secretsCommand),
|
|
81
|
+
schedule: () => import("./schedule-C5lMf3ny.mjs").then((m) => m.scheduleCommand),
|
|
82
|
+
feedback: () => import("./feedback-_L3vqktY.mjs").then((m) => m.feedbackCommand),
|
|
83
|
+
db: () => import("./db-BB6O6085.mjs").then((m) => m.dbCommand),
|
|
84
|
+
usage: () => import("./usage-CUYrWxv0.mjs").then((m) => m.usageCommand),
|
|
85
|
+
ai: () => import("./ai-DHLnyqfq.mjs").then((m) => m.aiCommand),
|
|
86
|
+
open: () => import("./open-DcaQKi1v.mjs").then((m) => m.openCommand),
|
|
87
|
+
docs: () => import("./docs-CtNH5kbN.mjs").then((m) => m.docsCommand),
|
|
88
|
+
skill: () => import("./skill-CM7R-4Bq.mjs").then((m) => m.skillCommand),
|
|
89
|
+
upgrade: () => import("./upgrade-ChcSZW8i.mjs").then((m) => m.upgradeCommand),
|
|
90
|
+
logs: () => import("./logs-DQQOawOG.mjs").then((m) => m.logsCommand),
|
|
91
|
+
mcp: () => import("./mcp-RcN17Z2v.mjs").then((m) => m.mcpCommand)
|
|
90
92
|
}
|
|
91
93
|
});
|
|
92
|
-
|
|
93
|
-
if (process.argv[2]
|
|
94
|
+
const quiet = process.argv[2] === "mcp" && process.argv[3] === "serve";
|
|
95
|
+
if (process.argv[2] !== "upgrade" && !quiet) notifyOfUpdate(version);
|
|
96
|
+
if (!quiet && process.argv[2] && process.argv[2] !== "--help" && process.argv[2] !== "-h") console.error(siteHeaderLine(version));
|
|
94
97
|
await runMain(main);
|
|
95
98
|
//#endregion
|
|
96
99
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { i as rewriteApiPath } from "./dev-
|
|
1
|
+
import { n as apiDataRequest } from "./api-C4rMhE7i.mjs";
|
|
2
|
+
import { a as dbRouter, i as realtimeRouter, o as META_COLUMNS, s as blobRouter } from "./src-BkACMkol.mjs";
|
|
3
|
+
import { i as rewriteApiPath } from "./dev-CkhBnSlv.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { dirname, join, relative, sep } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as writeConfigFile, f as clearAllProfileTokens, g as upsertProfileAuth, h as setActiveProfile, m as readConfigFile, n as siteConfig, p as listBakedProfiles, v as getBakedProfile, y as isProfileId } from "./site-DM2J10CB.mjs";
|
|
2
|
-
import { n as openBrowser, r as reportErrors } from "./ui-
|
|
2
|
+
import { n as openBrowser, r as reportErrors } from "./ui-C_jSc1Kz.mjs";
|
|
3
3
|
import { defineCommand } from "citty";
|
|
4
4
|
import { hostname } from "node:os";
|
|
5
5
|
import * as p from "@clack/prompts";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { c as resolveProject, o as projectFlagArgs } from "./site-DM2J10CB.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { i as apiRequest, o as withContext } from "./api-C4rMhE7i.mjs";
|
|
3
|
+
import { r as reportErrors } from "./ui-C_jSc1Kz.mjs";
|
|
3
4
|
import { defineCommand } from "citty";
|
|
4
5
|
//#region src/logs.ts
|
|
5
6
|
/**
|