@rebasepro/mcp 0.25.1 → 0.26.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/README.md +22 -5
- package/dist/cloud-tools.d.ts +115 -0
- package/dist/cloud-tools.js +396 -0
- package/dist/cloud-tools.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.js +478 -19
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -85,6 +85,19 @@ export declare function autoDiscoverLocal(project: ProjectConfig, devState?: Ret
|
|
|
85
85
|
* changed since the load.
|
|
86
86
|
*/
|
|
87
87
|
export declare function childProcessEnv(env?: NodeJS.ProcessEnv, startupDotenv?: ReadonlyMap<string, string>): NodeJS.ProcessEnv;
|
|
88
|
+
/**
|
|
89
|
+
* The app's key from the environment: `REBASE_API_TOKEN`, and nothing else.
|
|
90
|
+
*
|
|
91
|
+
* `REBASE_TOKEN` used to stand in for it. It is the CLI's control-plane token
|
|
92
|
+
* — a deploy token on the person's real projects — and the app this server
|
|
93
|
+
* talks to may be a cloud tenant running agent-written code (`rebase cloud
|
|
94
|
+
* init --claim` points `REBASE_BASE_URL` at one), so a control-plane
|
|
95
|
+
* credential sent there is a credential handed to that code. It is no longer
|
|
96
|
+
* sent to the app. It still reaches the CLI the cloud tools spawn, which sends
|
|
97
|
+
* it only to the control plane. Said once per process when it is the only
|
|
98
|
+
* token set, since setups that relied on the alias stop authenticating.
|
|
99
|
+
*/
|
|
100
|
+
export declare function envAppToken(env?: NodeJS.ProcessEnv, note?: (message: string) => void): string | undefined;
|
|
88
101
|
/**
|
|
89
102
|
* The env vars that describe a `default` project, or `null` when the client
|
|
90
103
|
* declared none of them.
|
|
@@ -119,6 +132,23 @@ export declare const DEFAULT_BASE_URL = "http://localhost:3001";
|
|
|
119
132
|
* auditable at a glance and a new tool now arrives protected.
|
|
120
133
|
*/
|
|
121
134
|
export declare const READ_ONLY_TOOLS: Set<string>;
|
|
135
|
+
/**
|
|
136
|
+
* Rebase Cloud tools that act on the control plane: provisioning a project, and
|
|
137
|
+
* changing the linked one with a deploy, a variable or a rollback.
|
|
138
|
+
*
|
|
139
|
+
* Not gated, and not because they are harmless — each one changes a
|
|
140
|
+
* production project. The gate asks whether the app's `baseUrl` or the CLI's
|
|
141
|
+
* `DATABASE_URL` is local, and these use neither: they spawn `rebase cloud`,
|
|
142
|
+
* which acts on the project `.rebase/cloud.json` links, with the credential the
|
|
143
|
+
* CLI resolves (`REBASE_TOKEN`, the token `init --claim` stored, or the
|
|
144
|
+
* person's login) and the control plane's own permission checks. Gating them
|
|
145
|
+
* on `baseUrl` would test a value they never read — and after
|
|
146
|
+
* `rebase_cloud_provision` points `REBASE_BASE_URL` at the new project,
|
|
147
|
+
* would refuse the very deploy that journey needs. The accident the gate
|
|
148
|
+
* exists for — an agent that thinks it is local — cannot happen to a tool
|
|
149
|
+
* whose name says "cloud".
|
|
150
|
+
*/
|
|
151
|
+
export declare const CLOUD_CONTROL_PLANE_TOOLS: Set<string>;
|
|
122
152
|
/**
|
|
123
153
|
* Tools whose effect lands on this machine only — the local registry, local
|
|
124
154
|
* source files, a local child process. They have no remote target to classify,
|
|
@@ -259,8 +289,51 @@ interface ToolDef {
|
|
|
259
289
|
type: "object";
|
|
260
290
|
properties: Record<string, unknown>;
|
|
261
291
|
required?: string[];
|
|
292
|
+
additionalProperties?: boolean;
|
|
262
293
|
};
|
|
263
294
|
}
|
|
295
|
+
/** What `rebase cloud init --claim --json` prints, the fields this tool hands on. */
|
|
296
|
+
export interface CloudProvisionResult {
|
|
297
|
+
projectUrl: string;
|
|
298
|
+
adminUrl: string | null;
|
|
299
|
+
claimUrl: string;
|
|
300
|
+
expiresAt: string;
|
|
301
|
+
slug: string;
|
|
302
|
+
deployed: boolean;
|
|
303
|
+
/** Whether REBASE_API_TOKEN, a key minted on the app, was written into .env. The key itself is never printed. */
|
|
304
|
+
apiTokenInEnv: boolean;
|
|
305
|
+
}
|
|
306
|
+
/** The arguments `rebase_cloud_provision` passes to the CLI, validated. Throws on a value argv must not carry. */
|
|
307
|
+
export declare function cloudProvisionArgv(args: {
|
|
308
|
+
name?: unknown;
|
|
309
|
+
deploy?: unknown;
|
|
310
|
+
}): string[];
|
|
311
|
+
/** The code of a refusal `rebase cloud init --claim --json` printed (`{ error: { code, … } }`), or null. */
|
|
312
|
+
export declare function cloudProvisionRefusalCode(stdout: string): string | null;
|
|
313
|
+
/**
|
|
314
|
+
* The way forward after a provision refusal this server recognises by its
|
|
315
|
+
* code, or null. Written here, so it is trusted text; the refusal's own message
|
|
316
|
+
* stays fenced as untrusted data beside it.
|
|
317
|
+
*
|
|
318
|
+
* A control plane that has not switched provisioning on answers
|
|
319
|
+
* `not_configured`. The tool stays listed — whether provisioning is on is the
|
|
320
|
+
* control plane's to say, and it can change — so the refusal has to carry the
|
|
321
|
+
* way forward on its own.
|
|
322
|
+
*/
|
|
323
|
+
export declare function cloudProvisionRefusalNext(code: string): string | null;
|
|
324
|
+
/** Read the CLI's one JSON result, keeping only fields of the expected shape. Null when it printed none. */
|
|
325
|
+
export declare function parseCloudProvisionResult(stdout: string): CloudProvisionResult | null;
|
|
326
|
+
/**
|
|
327
|
+
* The validated CLI call a cloud tool makes, from its arguments: what the
|
|
328
|
+
* dispatcher runs, and what the schema-against-handler test drives. Throws a
|
|
329
|
+
* `ToolArgumentError` before anything is spawned.
|
|
330
|
+
*/
|
|
331
|
+
export declare function parseCloudToolArgs(name: string, args: unknown): {
|
|
332
|
+
argv: string[];
|
|
333
|
+
stdin?: string;
|
|
334
|
+
secrets: string[];
|
|
335
|
+
tailLines: number;
|
|
336
|
+
};
|
|
264
337
|
export declare const ALL_TOOLS: ToolDef[];
|
|
265
338
|
/** The last `count` lines of a blob of output, without its trailing blank. */
|
|
266
339
|
export declare function lastLines(text: string, count: number): string;
|