@kosuke-ai/cli 1.0.1-next.4 → 1.0.1-next.6
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/README.md +104 -0
- package/dist/commands/mcp.js +85 -0
- package/dist/generated/commands/index.js +43 -39
- package/dist/generated/commands/sessions/artifacts-get.js +20 -0
- package/dist/generated/commands/sessions/artifacts-list.js +19 -0
- package/dist/generated/tools/deploy/cancel.js +20 -0
- package/dist/generated/tools/deploy/messages.js +20 -0
- package/dist/generated/tools/deploy/run.js +52 -0
- package/dist/generated/tools/index.js +138 -0
- package/dist/generated/tools/preview/get.js +24 -0
- package/dist/generated/tools/preview/health.js +24 -0
- package/dist/generated/tools/preview/reset.js +23 -0
- package/dist/generated/tools/preview/share-create.js +24 -0
- package/dist/generated/tools/preview/share-delete.js +24 -0
- package/dist/generated/tools/preview/share-get.js +24 -0
- package/dist/generated/tools/preview/shared-artifact.js +25 -0
- package/dist/generated/tools/preview/shared.js +20 -0
- package/dist/generated/tools/projects/create.js +26 -0
- package/dist/generated/tools/projects/delete.js +20 -0
- package/dist/generated/tools/projects/env-vars-add.js +50 -0
- package/dist/generated/tools/projects/env-vars-remove.js +31 -0
- package/dist/generated/tools/projects/get.js +20 -0
- package/dist/generated/tools/projects/list.js +12 -0
- package/dist/generated/tools/projects/services-add.js +111 -0
- package/dist/generated/tools/projects/services-list.js +20 -0
- package/dist/generated/tools/projects/services-remove.js +25 -0
- package/dist/generated/tools/projects/services-update.js +104 -0
- package/dist/generated/tools/projects/settings-get.js +20 -0
- package/dist/generated/tools/projects/settings-import.js +208 -0
- package/dist/generated/tools/projects/settings-update.js +72 -0
- package/dist/generated/tools/projects/skills.js +32 -0
- package/dist/generated/tools/projects/update.js +24 -0
- package/dist/generated/tools/sessions/activate.js +25 -0
- package/dist/generated/tools/sessions/artifacts-get.js +30 -0
- package/dist/generated/tools/sessions/artifacts-list.js +25 -0
- package/dist/generated/tools/sessions/checklist-generate.js +25 -0
- package/dist/generated/tools/sessions/checklist-get.js +25 -0
- package/dist/generated/tools/sessions/comments-add.js +53 -0
- package/dist/generated/tools/sessions/comments-delete.js +30 -0
- package/dist/generated/tools/sessions/comments-list.js +25 -0
- package/dist/generated/tools/sessions/comments-update.js +62 -0
- package/dist/generated/tools/sessions/create.js +69 -0
- package/dist/generated/tools/sessions/delete.js +25 -0
- package/dist/generated/tools/sessions/diff-files.js +25 -0
- package/dist/generated/tools/sessions/diff-patch.js +64 -0
- package/dist/generated/tools/sessions/edit-prompt.js +69 -0
- package/dist/generated/tools/sessions/files-get.js +30 -0
- package/dist/generated/tools/sessions/files-list.js +25 -0
- package/dist/generated/tools/sessions/files-write.js +37 -0
- package/dist/generated/tools/sessions/get.js +25 -0
- package/dist/generated/tools/sessions/git-commit-message.js +25 -0
- package/dist/generated/tools/sessions/git-commit.js +29 -0
- package/dist/generated/tools/sessions/git-push.js +25 -0
- package/dist/generated/tools/sessions/git-state.js +25 -0
- package/dist/generated/tools/sessions/jobs-cancel.js +30 -0
- package/dist/generated/tools/sessions/jobs-get.js +30 -0
- package/dist/generated/tools/sessions/list.js +56 -0
- package/dist/generated/tools/sessions/messages.js +25 -0
- package/dist/generated/tools/sessions/search.js +17 -0
- package/dist/generated/tools/sessions/send.js +137 -0
- package/dist/generated/tools/sessions/update.js +63 -0
- package/dist/generated/tools/workspaces/access-status.js +28 -0
- package/dist/generated/tools/workspaces/ai-provider-get.js +20 -0
- package/dist/generated/tools/workspaces/ai-provider-remove.js +39 -0
- package/dist/generated/tools/workspaces/ai-provider-set.js +106 -0
- package/dist/generated/tools/workspaces/credits.js +20 -0
- package/dist/generated/tools/workspaces/get.js +20 -0
- package/dist/generated/tools/workspaces/getting-started-get.js +20 -0
- package/dist/generated/tools/workspaces/getting-started-update.js +27 -0
- package/dist/generated/tools/workspaces/list.js +12 -0
- package/dist/generated/tools/workspaces/members.js +24 -0
- package/dist/generated/tools/workspaces/sandbox-limit.js +20 -0
- package/dist/generated/tools/workspaces/stop-sandboxes.js +31 -0
- package/dist/generated/tools/workspaces/usage.js +28 -0
- package/dist/program.js +4 -2
- package/dist/runtime/mcp-attachments.js +110 -0
- package/dist/runtime/mcp-composite-support.js +49 -0
- package/dist/runtime/mcp-composite.js +309 -0
- package/dist/runtime/mcp-guard.js +74 -0
- package/dist/runtime/mcp-invoke.js +123 -0
- package/dist/runtime/mcp-open-pr.js +83 -0
- package/dist/runtime/mcp-redact.js +31 -0
- package/dist/runtime/mcp-server.js +219 -0
- package/dist/runtime/mcp-tool.js +6 -0
- package/openapi.json +134 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -62,3 +62,107 @@ into `src/generated/`: request types (openapi-typescript) and one descriptor per
|
|
|
62
62
|
operation, which the hand-written runtime turns into commands. `npm run check`
|
|
63
63
|
regenerates and fails on any difference, so the tree is only ever what the
|
|
64
64
|
document says.
|
|
65
|
+
|
|
66
|
+
## MCP server
|
|
67
|
+
|
|
68
|
+
The same package serves the platform to an MCP client: `kosuke mcp serve` runs on
|
|
69
|
+
your machine as a child process of Claude, Cursor or Codex, speaks MCP over
|
|
70
|
+
stdio, and talks to app.kosuke.ai with the token above. There is nothing to
|
|
71
|
+
deploy. One block in the client's config is the whole install:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"kosuke": {
|
|
77
|
+
"command": "npx",
|
|
78
|
+
"args": ["-y", "@kosuke-ai/cli", "mcp", "serve"],
|
|
79
|
+
"env": { "KOSUKE_API_KEY": "kosuke_..." }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`KOSUKE_API_URL` in the same `env` points it at another deployment. `kosuke mcp
|
|
86
|
+
tools` prints the tool list as JSON without starting a server.
|
|
87
|
+
|
|
88
|
+
Attachments are read from disk, and the model picks the path, so the server
|
|
89
|
+
only reads under one directory: the working directory it was started in, or
|
|
90
|
+
`KOSUKE_MCP_ATTACHMENT_ROOT` / `--attachment-root`. Set it to the project you
|
|
91
|
+
are working on. A path outside the root, a symlink that leads out of it, and
|
|
92
|
+
any hidden path under it (`.ssh`, `.aws`, `.config`, `.env`) are refused
|
|
93
|
+
before anything is read.
|
|
94
|
+
|
|
95
|
+
### Tools
|
|
96
|
+
|
|
97
|
+
Every operation of the API is a tool, generated from the same descriptors as
|
|
98
|
+
the commands: `kosuke sessions send` is the tool `sessions_send`, path params
|
|
99
|
+
and request fields are its arguments, and the API's own description is the
|
|
100
|
+
tool's. A body that is not a flat object (`projects_env_vars_add`,
|
|
101
|
+
`workspaces_ai_provider_set`) is one `body` argument with the real schema. The
|
|
102
|
+
four operations that take files accept `attachments: [{ "path": "..." }]`, paths
|
|
103
|
+
on the machine the server runs on, like `--attach`, confined to the attachment
|
|
104
|
+
root above.
|
|
105
|
+
|
|
106
|
+
On top, three hand-written tools for the arcs that otherwise make an agent
|
|
107
|
+
plumb ids by hand. They only ever call the generated tools:
|
|
108
|
+
|
|
109
|
+
| Tool | What it does |
|
|
110
|
+
| -------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
111
|
+
| `ship` | Create a chat session from a prompt and start its first turn, or start a backlog session. Returns the job to watch. |
|
|
112
|
+
| `watch` | Poll a chat job, or the deploy, until it settles, with progress on the way. Returns the last assistant message. |
|
|
113
|
+
| `submit` | Send the `open-pr` skill to a session so it opens, or updates, its pull request. Returns the job to watch. |
|
|
114
|
+
|
|
115
|
+
### Toolsets
|
|
116
|
+
|
|
117
|
+
Seventy-odd tools on every turn is more than a model chooses between well, so
|
|
118
|
+
they are grouped by the spec's own tags. All are on by default; load a subset
|
|
119
|
+
with `--toolsets` (or `KOSUKE_MCP_TOOLSETS`) in the `args`/`env` above.
|
|
120
|
+
`kosuke mcp tools` prints the current list; the counts here are as of this
|
|
121
|
+
version of the document:
|
|
122
|
+
|
|
123
|
+
| Toolset | Tools | Covers |
|
|
124
|
+
| ------------ | ----: | ---------------------------------------------------------------------------------------------- |
|
|
125
|
+
| `sessions` | 29 | Chat sessions: create, send, jobs, messages, files, diff, comments, git, checklist, artifacts. |
|
|
126
|
+
| `projects` | 15 | Projects and their settings: services, environment variables, import, skills. |
|
|
127
|
+
| `workspaces` | 13 | Workspaces: members, usage, credits, AI provider, sandboxes. |
|
|
128
|
+
| `preview` | 8 | Preview URLs, health, reset, share links and shared artifacts. |
|
|
129
|
+
| `deploy` | 3 | Run, cancel and read the agentic deploy. |
|
|
130
|
+
| `composite` | 3 | `ship`, `watch`, `submit`. |
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
"args": ["-y", "@kosuke-ai/cli", "mcp", "serve", "--toolsets", "sessions,composite"]
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`--read-only` keeps only the tools that read: the GET operations and `watch`,
|
|
137
|
+
minus the three reads that wake a paused sandbox and so start billing
|
|
138
|
+
(`preview_get`, `preview_shared`, `sessions_files_get`). The same rule sets
|
|
139
|
+
each tool's `readOnlyHint`, the signal a client uses to run a call without
|
|
140
|
+
asking.
|
|
141
|
+
|
|
142
|
+
### Safeguards
|
|
143
|
+
|
|
144
|
+
Tool arguments and results end up in the agent's transcript, so the server
|
|
145
|
+
enforces these rather than asking:
|
|
146
|
+
|
|
147
|
+
- A provider key (`anthropicApiKey`, `bedrockApiKey`, `openaiApiKey`) or an
|
|
148
|
+
environment variable marked `isSecret` in an argument is refused before any
|
|
149
|
+
request is made, so the server never knowingly forwards a declared secret.
|
|
150
|
+
It cannot stop a value the caller does not declare: whatever a model puts
|
|
151
|
+
in an argument is in the transcript already. Set secrets in Settings or with
|
|
152
|
+
the CLI.
|
|
153
|
+
- Free text is never refused, but an argument that looks like it quotes a
|
|
154
|
+
credential comes back with a `warnings` entry on the result.
|
|
155
|
+
- Attachments come only from the attachment root, never from a hidden path.
|
|
156
|
+
- Environment values marked secret (`envVars[].value` where `isSecret`) and the
|
|
157
|
+
`sentryDsn` field of a project are redacted from every result. Prose that
|
|
158
|
+
quotes such a value, in a chat message for instance, is returned as the
|
|
159
|
+
platform sent it.
|
|
160
|
+
- A preview share link is a credential. Only `preview_share_get` and
|
|
161
|
+
`preview_share_create` return one, and their descriptions say so.
|
|
162
|
+
- Admin, webhook, billing, browser-auth, key-management and preview auth-token
|
|
163
|
+
routes are not in the document, so no tool, composite or generated, can reach
|
|
164
|
+
them.
|
|
165
|
+
|
|
166
|
+
A remote HTTP transport (a one-click connector rather than a local process) is
|
|
167
|
+
a separate piece of work; this server is shaped so it can be added without
|
|
168
|
+
changing the tools.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { UsageError } from '../runtime/invoke.js';
|
|
3
|
+
import { defaultAttachmentPolicy } from '../runtime/mcp-attachments.js';
|
|
4
|
+
import { ALL_TOOLSETS, availableToolsets, selectTools, serveStdio, toolListing, } from '../runtime/mcp-server.js';
|
|
5
|
+
export function attachMcpCommands(root, runtime, deps = {}) {
|
|
6
|
+
const { env = process.env, fetch, stdout = (line) => process.stdout.write(line + '\n'), stderr = (line) => process.stderr.write(line + '\n'), exit = (code) => {
|
|
7
|
+
process.exitCode = code;
|
|
8
|
+
}, serve = serveStdio, } = deps;
|
|
9
|
+
const mcp = root
|
|
10
|
+
.command('mcp')
|
|
11
|
+
.description('Serve the platform to an MCP client such as Claude, Cursor or Codex.');
|
|
12
|
+
const toolsetHelp = `Comma-separated toolsets to expose: ${[ALL_TOOLSETS, ...availableToolsets()].join(', ')}. ` +
|
|
13
|
+
`Default all, or KOSUKE_MCP_TOOLSETS.`;
|
|
14
|
+
const selection = (flags) => ({
|
|
15
|
+
toolsets: parseToolsets(flags.toolsets ?? env.KOSUKE_MCP_TOOLSETS),
|
|
16
|
+
readOnly: flags.readOnly === true,
|
|
17
|
+
});
|
|
18
|
+
const attachmentRootHelp = 'Directory attachments may come from; nothing outside it is read. ' +
|
|
19
|
+
'Default: the working directory, or KOSUKE_MCP_ATTACHMENT_ROOT.';
|
|
20
|
+
mcp
|
|
21
|
+
.command('serve')
|
|
22
|
+
.description('Start the MCP server on stdio. Uses the same auth token as every other command.')
|
|
23
|
+
.option('--toolsets <names>', toolsetHelp)
|
|
24
|
+
.option('--read-only', 'Expose only the tools that read.')
|
|
25
|
+
.option('--attachment-root <path>', attachmentRootHelp)
|
|
26
|
+
.action(async (flags) => {
|
|
27
|
+
const { apiKey, apiUrl } = runtime.credentials();
|
|
28
|
+
if (!apiKey) {
|
|
29
|
+
stderr('No auth token. Set KOSUKE_API_KEY in the MCP client config, pass --api-key, or run ' +
|
|
30
|
+
'`kosuke auth login`. Create one in Settings on the platform.');
|
|
31
|
+
exit(1);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
await serve({
|
|
36
|
+
apiUrl,
|
|
37
|
+
apiKey,
|
|
38
|
+
...selection(flags),
|
|
39
|
+
attachments: flags.attachmentRoot
|
|
40
|
+
? { root: resolve(flags.attachmentRoot) }
|
|
41
|
+
: defaultAttachmentPolicy(env),
|
|
42
|
+
...(fetch ? { fetch } : {}),
|
|
43
|
+
log: stderr,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (!(error instanceof UsageError))
|
|
48
|
+
throw error;
|
|
49
|
+
stderr(error.message);
|
|
50
|
+
exit(1);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
mcp
|
|
54
|
+
.command('tools')
|
|
55
|
+
.description('Print the tools the server would expose, as JSON, without starting it.')
|
|
56
|
+
.option('--toolsets <names>', toolsetHelp)
|
|
57
|
+
.option('--read-only', 'Only the tools that read.')
|
|
58
|
+
.action((flags) => {
|
|
59
|
+
try {
|
|
60
|
+
stdout(JSON.stringify(selectTools(selection(flags)).map(toolListing), null, 2));
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (!(error instanceof UsageError))
|
|
64
|
+
throw error;
|
|
65
|
+
stderr(error.message);
|
|
66
|
+
exit(1);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Absent means every toolset; given but naming none is refused, since a typo
|
|
72
|
+
* in KOSUKE_MCP_TOOLSETS must not quietly serve everything.
|
|
73
|
+
*/
|
|
74
|
+
function parseToolsets(value) {
|
|
75
|
+
if (value === undefined)
|
|
76
|
+
return [];
|
|
77
|
+
const names = value
|
|
78
|
+
.split(',')
|
|
79
|
+
.map((name) => name.trim())
|
|
80
|
+
.filter(Boolean);
|
|
81
|
+
if (!names.length) {
|
|
82
|
+
throw new UsageError(`--toolsets (or KOSUKE_MCP_TOOLSETS) names no toolset; use all, or a comma-separated list.`);
|
|
83
|
+
}
|
|
84
|
+
return names;
|
|
85
|
+
}
|
|
@@ -25,45 +25,47 @@ import { operation as o23 } from './projects/settings-update.js';
|
|
|
25
25
|
import { operation as o24 } from './projects/skills.js';
|
|
26
26
|
import { operation as o25 } from './projects/update.js';
|
|
27
27
|
import { operation as o26 } from './sessions/activate.js';
|
|
28
|
-
import { operation as o27 } from './sessions/
|
|
29
|
-
import { operation as o28 } from './sessions/
|
|
30
|
-
import { operation as o29 } from './sessions/
|
|
31
|
-
import { operation as o30 } from './sessions/
|
|
32
|
-
import { operation as o31 } from './sessions/comments-
|
|
33
|
-
import { operation as o32 } from './sessions/comments-
|
|
34
|
-
import { operation as o33 } from './sessions/
|
|
35
|
-
import { operation as o34 } from './sessions/
|
|
36
|
-
import { operation as o35 } from './sessions/
|
|
37
|
-
import { operation as o36 } from './sessions/
|
|
38
|
-
import { operation as o37 } from './sessions/
|
|
39
|
-
import { operation as o38 } from './sessions/
|
|
40
|
-
import { operation as o39 } from './sessions/
|
|
41
|
-
import { operation as o40 } from './sessions/files-
|
|
42
|
-
import { operation as o41 } from './sessions/
|
|
43
|
-
import { operation as o42 } from './sessions/
|
|
44
|
-
import { operation as o43 } from './sessions/
|
|
45
|
-
import { operation as o44 } from './sessions/git-
|
|
46
|
-
import { operation as o45 } from './sessions/git-
|
|
47
|
-
import { operation as o46 } from './sessions/
|
|
48
|
-
import { operation as o47 } from './sessions/
|
|
49
|
-
import { operation as o48 } from './sessions/
|
|
50
|
-
import { operation as o49 } from './sessions/
|
|
51
|
-
import { operation as o50 } from './sessions/
|
|
52
|
-
import { operation as o51 } from './sessions/
|
|
53
|
-
import { operation as o52 } from './sessions/
|
|
54
|
-
import { operation as o53 } from './
|
|
55
|
-
import { operation as o54 } from './
|
|
56
|
-
import { operation as o55 } from './workspaces/
|
|
57
|
-
import { operation as o56 } from './workspaces/ai-provider-
|
|
58
|
-
import { operation as o57 } from './workspaces/
|
|
59
|
-
import { operation as o58 } from './workspaces/
|
|
60
|
-
import { operation as o59 } from './workspaces/
|
|
61
|
-
import { operation as o60 } from './workspaces/
|
|
62
|
-
import { operation as o61 } from './workspaces/
|
|
63
|
-
import { operation as o62 } from './workspaces/
|
|
64
|
-
import { operation as o63 } from './workspaces/
|
|
65
|
-
import { operation as o64 } from './workspaces/
|
|
66
|
-
import { operation as o65 } from './workspaces/
|
|
28
|
+
import { operation as o27 } from './sessions/artifacts-get.js';
|
|
29
|
+
import { operation as o28 } from './sessions/artifacts-list.js';
|
|
30
|
+
import { operation as o29 } from './sessions/checklist-generate.js';
|
|
31
|
+
import { operation as o30 } from './sessions/checklist-get.js';
|
|
32
|
+
import { operation as o31 } from './sessions/comments-add.js';
|
|
33
|
+
import { operation as o32 } from './sessions/comments-delete.js';
|
|
34
|
+
import { operation as o33 } from './sessions/comments-list.js';
|
|
35
|
+
import { operation as o34 } from './sessions/comments-update.js';
|
|
36
|
+
import { operation as o35 } from './sessions/create.js';
|
|
37
|
+
import { operation as o36 } from './sessions/delete.js';
|
|
38
|
+
import { operation as o37 } from './sessions/diff-files.js';
|
|
39
|
+
import { operation as o38 } from './sessions/diff-patch.js';
|
|
40
|
+
import { operation as o39 } from './sessions/edit-prompt.js';
|
|
41
|
+
import { operation as o40 } from './sessions/files-get.js';
|
|
42
|
+
import { operation as o41 } from './sessions/files-list.js';
|
|
43
|
+
import { operation as o42 } from './sessions/files-write.js';
|
|
44
|
+
import { operation as o43 } from './sessions/get.js';
|
|
45
|
+
import { operation as o44 } from './sessions/git-commit.js';
|
|
46
|
+
import { operation as o45 } from './sessions/git-commit-message.js';
|
|
47
|
+
import { operation as o46 } from './sessions/git-push.js';
|
|
48
|
+
import { operation as o47 } from './sessions/git-state.js';
|
|
49
|
+
import { operation as o48 } from './sessions/jobs-cancel.js';
|
|
50
|
+
import { operation as o49 } from './sessions/jobs-get.js';
|
|
51
|
+
import { operation as o50 } from './sessions/list.js';
|
|
52
|
+
import { operation as o51 } from './sessions/messages.js';
|
|
53
|
+
import { operation as o52 } from './sessions/search.js';
|
|
54
|
+
import { operation as o53 } from './sessions/send.js';
|
|
55
|
+
import { operation as o54 } from './sessions/update.js';
|
|
56
|
+
import { operation as o55 } from './workspaces/access-status.js';
|
|
57
|
+
import { operation as o56 } from './workspaces/ai-provider-get.js';
|
|
58
|
+
import { operation as o57 } from './workspaces/ai-provider-remove.js';
|
|
59
|
+
import { operation as o58 } from './workspaces/ai-provider-set.js';
|
|
60
|
+
import { operation as o59 } from './workspaces/credits.js';
|
|
61
|
+
import { operation as o60 } from './workspaces/get.js';
|
|
62
|
+
import { operation as o61 } from './workspaces/getting-started-get.js';
|
|
63
|
+
import { operation as o62 } from './workspaces/getting-started-update.js';
|
|
64
|
+
import { operation as o63 } from './workspaces/list.js';
|
|
65
|
+
import { operation as o64 } from './workspaces/members.js';
|
|
66
|
+
import { operation as o65 } from './workspaces/sandbox-limit.js';
|
|
67
|
+
import { operation as o66 } from './workspaces/stop-sandboxes.js';
|
|
68
|
+
import { operation as o67 } from './workspaces/usage.js';
|
|
67
69
|
export const operations = [
|
|
68
70
|
o0,
|
|
69
71
|
o1,
|
|
@@ -131,4 +133,6 @@ export const operations = [
|
|
|
131
133
|
o63,
|
|
132
134
|
o64,
|
|
133
135
|
o65,
|
|
136
|
+
o66,
|
|
137
|
+
o67,
|
|
134
138
|
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "get",
|
|
3
|
+
"path": "/api/projects/{projectId}/chat-sessions/{sessionId}/artifacts/{artifactId}",
|
|
4
|
+
"command": [
|
|
5
|
+
"sessions",
|
|
6
|
+
"artifacts",
|
|
7
|
+
"get"
|
|
8
|
+
],
|
|
9
|
+
"summary": "Read one artifact of the session: a markdown or html one carries its body, an image or a video a presigned url, its media type and its size.",
|
|
10
|
+
"pathParams": [
|
|
11
|
+
"projectId",
|
|
12
|
+
"sessionId",
|
|
13
|
+
"artifactId"
|
|
14
|
+
],
|
|
15
|
+
"query": [],
|
|
16
|
+
"body": null,
|
|
17
|
+
"multipart": null,
|
|
18
|
+
"attachments": false,
|
|
19
|
+
"anonymous": false
|
|
20
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "get",
|
|
3
|
+
"path": "/api/projects/{projectId}/chat-sessions/{sessionId}/artifacts",
|
|
4
|
+
"command": [
|
|
5
|
+
"sessions",
|
|
6
|
+
"artifacts",
|
|
7
|
+
"list"
|
|
8
|
+
],
|
|
9
|
+
"summary": "List the session's artifacts, most recently changed first. Rows only: a body or a file url comes from reading one.",
|
|
10
|
+
"pathParams": [
|
|
11
|
+
"projectId",
|
|
12
|
+
"sessionId"
|
|
13
|
+
],
|
|
14
|
+
"query": [],
|
|
15
|
+
"body": null,
|
|
16
|
+
"multipart": null,
|
|
17
|
+
"attachments": false,
|
|
18
|
+
"anonymous": false
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { operation } from '../../commands/deploy/cancel.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
"name": "deploy_cancel",
|
|
4
|
+
"toolset": "deploy",
|
|
5
|
+
"description": "Stop the running deploy. Steers queued behind it are discarded and listed.",
|
|
6
|
+
"inputSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"projectId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Project id."
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"required": [
|
|
15
|
+
"projectId"
|
|
16
|
+
],
|
|
17
|
+
"additionalProperties": false
|
|
18
|
+
},
|
|
19
|
+
operation,
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { operation } from '../../commands/deploy/messages.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
"name": "deploy_messages",
|
|
4
|
+
"toolset": "deploy",
|
|
5
|
+
"description": "Read the deploy conversation and the current deploy status.",
|
|
6
|
+
"inputSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"projectId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Project id."
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"required": [
|
|
15
|
+
"projectId"
|
|
16
|
+
],
|
|
17
|
+
"additionalProperties": false
|
|
18
|
+
},
|
|
19
|
+
operation,
|
|
20
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { operation } from '../../commands/deploy/run.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
"name": "deploy_run",
|
|
4
|
+
"toolset": "deploy",
|
|
5
|
+
"description": "Start a deploy (empty JSON body), continue the current one with userResponse, or steer a running one with steerTargetDeployJobId. Attachments ride along as multipart, where the message is called content.",
|
|
6
|
+
"inputSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"projectId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Project id."
|
|
12
|
+
},
|
|
13
|
+
"userResponse": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"steerTargetDeployJobId": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"freshDeploy": {
|
|
20
|
+
"type": "boolean"
|
|
21
|
+
},
|
|
22
|
+
"content": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "The message for the deploy agent."
|
|
25
|
+
},
|
|
26
|
+
"attachments": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"maxItems": 10,
|
|
29
|
+
"description": "Files to attach, at most 10 of 10 MiB each. Each is a path on this machine; the request is sent as multipart when any are given.",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"properties": {
|
|
33
|
+
"path": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Path of a file to attach."
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"required": [
|
|
39
|
+
"path"
|
|
40
|
+
],
|
|
41
|
+
"additionalProperties": false
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": [
|
|
46
|
+
"projectId",
|
|
47
|
+
"content"
|
|
48
|
+
],
|
|
49
|
+
"additionalProperties": false
|
|
50
|
+
},
|
|
51
|
+
operation,
|
|
52
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { tool as t0 } from './deploy/cancel.js';
|
|
2
|
+
import { tool as t1 } from './deploy/messages.js';
|
|
3
|
+
import { tool as t2 } from './deploy/run.js';
|
|
4
|
+
import { tool as t3 } from './preview/get.js';
|
|
5
|
+
import { tool as t4 } from './preview/health.js';
|
|
6
|
+
import { tool as t5 } from './preview/reset.js';
|
|
7
|
+
import { tool as t6 } from './preview/share-create.js';
|
|
8
|
+
import { tool as t7 } from './preview/share-delete.js';
|
|
9
|
+
import { tool as t8 } from './preview/share-get.js';
|
|
10
|
+
import { tool as t9 } from './preview/shared.js';
|
|
11
|
+
import { tool as t10 } from './preview/shared-artifact.js';
|
|
12
|
+
import { tool as t11 } from './projects/create.js';
|
|
13
|
+
import { tool as t12 } from './projects/delete.js';
|
|
14
|
+
import { tool as t13 } from './projects/env-vars-add.js';
|
|
15
|
+
import { tool as t14 } from './projects/env-vars-remove.js';
|
|
16
|
+
import { tool as t15 } from './projects/get.js';
|
|
17
|
+
import { tool as t16 } from './projects/list.js';
|
|
18
|
+
import { tool as t17 } from './projects/services-add.js';
|
|
19
|
+
import { tool as t18 } from './projects/services-list.js';
|
|
20
|
+
import { tool as t19 } from './projects/services-remove.js';
|
|
21
|
+
import { tool as t20 } from './projects/services-update.js';
|
|
22
|
+
import { tool as t21 } from './projects/settings-get.js';
|
|
23
|
+
import { tool as t22 } from './projects/settings-import.js';
|
|
24
|
+
import { tool as t23 } from './projects/settings-update.js';
|
|
25
|
+
import { tool as t24 } from './projects/skills.js';
|
|
26
|
+
import { tool as t25 } from './projects/update.js';
|
|
27
|
+
import { tool as t26 } from './sessions/activate.js';
|
|
28
|
+
import { tool as t27 } from './sessions/artifacts-get.js';
|
|
29
|
+
import { tool as t28 } from './sessions/artifacts-list.js';
|
|
30
|
+
import { tool as t29 } from './sessions/checklist-generate.js';
|
|
31
|
+
import { tool as t30 } from './sessions/checklist-get.js';
|
|
32
|
+
import { tool as t31 } from './sessions/comments-add.js';
|
|
33
|
+
import { tool as t32 } from './sessions/comments-delete.js';
|
|
34
|
+
import { tool as t33 } from './sessions/comments-list.js';
|
|
35
|
+
import { tool as t34 } from './sessions/comments-update.js';
|
|
36
|
+
import { tool as t35 } from './sessions/create.js';
|
|
37
|
+
import { tool as t36 } from './sessions/delete.js';
|
|
38
|
+
import { tool as t37 } from './sessions/diff-files.js';
|
|
39
|
+
import { tool as t38 } from './sessions/diff-patch.js';
|
|
40
|
+
import { tool as t39 } from './sessions/edit-prompt.js';
|
|
41
|
+
import { tool as t40 } from './sessions/files-get.js';
|
|
42
|
+
import { tool as t41 } from './sessions/files-list.js';
|
|
43
|
+
import { tool as t42 } from './sessions/files-write.js';
|
|
44
|
+
import { tool as t43 } from './sessions/get.js';
|
|
45
|
+
import { tool as t44 } from './sessions/git-commit.js';
|
|
46
|
+
import { tool as t45 } from './sessions/git-commit-message.js';
|
|
47
|
+
import { tool as t46 } from './sessions/git-push.js';
|
|
48
|
+
import { tool as t47 } from './sessions/git-state.js';
|
|
49
|
+
import { tool as t48 } from './sessions/jobs-cancel.js';
|
|
50
|
+
import { tool as t49 } from './sessions/jobs-get.js';
|
|
51
|
+
import { tool as t50 } from './sessions/list.js';
|
|
52
|
+
import { tool as t51 } from './sessions/messages.js';
|
|
53
|
+
import { tool as t52 } from './sessions/search.js';
|
|
54
|
+
import { tool as t53 } from './sessions/send.js';
|
|
55
|
+
import { tool as t54 } from './sessions/update.js';
|
|
56
|
+
import { tool as t55 } from './workspaces/access-status.js';
|
|
57
|
+
import { tool as t56 } from './workspaces/ai-provider-get.js';
|
|
58
|
+
import { tool as t57 } from './workspaces/ai-provider-remove.js';
|
|
59
|
+
import { tool as t58 } from './workspaces/ai-provider-set.js';
|
|
60
|
+
import { tool as t59 } from './workspaces/credits.js';
|
|
61
|
+
import { tool as t60 } from './workspaces/get.js';
|
|
62
|
+
import { tool as t61 } from './workspaces/getting-started-get.js';
|
|
63
|
+
import { tool as t62 } from './workspaces/getting-started-update.js';
|
|
64
|
+
import { tool as t63 } from './workspaces/list.js';
|
|
65
|
+
import { tool as t64 } from './workspaces/members.js';
|
|
66
|
+
import { tool as t65 } from './workspaces/sandbox-limit.js';
|
|
67
|
+
import { tool as t66 } from './workspaces/stop-sandboxes.js';
|
|
68
|
+
import { tool as t67 } from './workspaces/usage.js';
|
|
69
|
+
export const tools = [
|
|
70
|
+
t0,
|
|
71
|
+
t1,
|
|
72
|
+
t2,
|
|
73
|
+
t3,
|
|
74
|
+
t4,
|
|
75
|
+
t5,
|
|
76
|
+
t6,
|
|
77
|
+
t7,
|
|
78
|
+
t8,
|
|
79
|
+
t9,
|
|
80
|
+
t10,
|
|
81
|
+
t11,
|
|
82
|
+
t12,
|
|
83
|
+
t13,
|
|
84
|
+
t14,
|
|
85
|
+
t15,
|
|
86
|
+
t16,
|
|
87
|
+
t17,
|
|
88
|
+
t18,
|
|
89
|
+
t19,
|
|
90
|
+
t20,
|
|
91
|
+
t21,
|
|
92
|
+
t22,
|
|
93
|
+
t23,
|
|
94
|
+
t24,
|
|
95
|
+
t25,
|
|
96
|
+
t26,
|
|
97
|
+
t27,
|
|
98
|
+
t28,
|
|
99
|
+
t29,
|
|
100
|
+
t30,
|
|
101
|
+
t31,
|
|
102
|
+
t32,
|
|
103
|
+
t33,
|
|
104
|
+
t34,
|
|
105
|
+
t35,
|
|
106
|
+
t36,
|
|
107
|
+
t37,
|
|
108
|
+
t38,
|
|
109
|
+
t39,
|
|
110
|
+
t40,
|
|
111
|
+
t41,
|
|
112
|
+
t42,
|
|
113
|
+
t43,
|
|
114
|
+
t44,
|
|
115
|
+
t45,
|
|
116
|
+
t46,
|
|
117
|
+
t47,
|
|
118
|
+
t48,
|
|
119
|
+
t49,
|
|
120
|
+
t50,
|
|
121
|
+
t51,
|
|
122
|
+
t52,
|
|
123
|
+
t53,
|
|
124
|
+
t54,
|
|
125
|
+
t55,
|
|
126
|
+
t56,
|
|
127
|
+
t57,
|
|
128
|
+
t58,
|
|
129
|
+
t59,
|
|
130
|
+
t60,
|
|
131
|
+
t61,
|
|
132
|
+
t62,
|
|
133
|
+
t63,
|
|
134
|
+
t64,
|
|
135
|
+
t65,
|
|
136
|
+
t66,
|
|
137
|
+
t67,
|
|
138
|
+
];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { operation } from '../../commands/preview/get.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
"name": "preview_get",
|
|
4
|
+
"toolset": "preview",
|
|
5
|
+
"description": "Read the preview URLs of the project's main sandbox, or of one chat session's.",
|
|
6
|
+
"inputSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"projectId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Project id."
|
|
12
|
+
},
|
|
13
|
+
"sessionId": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "A chat session's preview instead of the project's main one."
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"projectId"
|
|
20
|
+
],
|
|
21
|
+
"additionalProperties": false
|
|
22
|
+
},
|
|
23
|
+
operation,
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { operation } from '../../commands/preview/health.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
"name": "preview_health",
|
|
4
|
+
"toolset": "preview",
|
|
5
|
+
"description": "Read the health of every service behind a preview.",
|
|
6
|
+
"inputSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"projectId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Project id."
|
|
12
|
+
},
|
|
13
|
+
"sessionId": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "A chat session's preview instead of the project's main one."
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"projectId"
|
|
20
|
+
],
|
|
21
|
+
"additionalProperties": false
|
|
22
|
+
},
|
|
23
|
+
operation,
|
|
24
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { operation } from '../../commands/preview/reset.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
"name": "preview_reset",
|
|
4
|
+
"toolset": "preview",
|
|
5
|
+
"description": "Queue a rebuild of a preview sandbox from scratch.",
|
|
6
|
+
"inputSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"projectId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Project id."
|
|
12
|
+
},
|
|
13
|
+
"sessionId": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": [
|
|
18
|
+
"projectId"
|
|
19
|
+
],
|
|
20
|
+
"additionalProperties": false
|
|
21
|
+
},
|
|
22
|
+
operation,
|
|
23
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { operation } from '../../commands/preview/share-create.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
"name": "preview_share_create",
|
|
4
|
+
"toolset": "preview",
|
|
5
|
+
"description": "Create the public share link of a preview. The body sessionId wins over the query one. Returns the share link itself, which is a credential: anyone holding it can open the preview.",
|
|
6
|
+
"inputSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"projectId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Project id."
|
|
12
|
+
},
|
|
13
|
+
"sessionId": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "A chat session's preview instead of the project's main one."
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"projectId"
|
|
20
|
+
],
|
|
21
|
+
"additionalProperties": false
|
|
22
|
+
},
|
|
23
|
+
operation,
|
|
24
|
+
};
|