@topline-build/harness-mcp 0.9.17 → 0.9.18
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 +4 -0
- package/dist/build-secret-source.d.ts +23 -0
- package/dist/build-secret-source.js +119 -0
- package/dist/build-session-tools.js +11 -2
- package/dist/index.d.ts +28 -1
- package/dist/index.js +45 -1
- package/docs/generated/build-mcp-manifest.json +166 -3
- package/docs/generated/build-mcp-reference.md +176 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable customer-visible Build MCP changes are recorded here. A source change is not a published package or customer release.
|
|
4
4
|
|
|
5
|
+
## 0.9.18 - 2026-11-18
|
|
6
|
+
|
|
7
|
+
- `platform_request_build_secret` asks a person for a key the app needs. Without `source`, Topline posts a request card in the session's build thread and the tool returns the thread link and what to tell the person. With `source` (`{fromEnv: "VAR"}` or `{fromFile: ".env", key: "VAR"}`, a dotenv file inside the workspace), this helper reads the value on this computer and uploads it to `PUT /api/v1/secrets/{name}` with the build session's own sign-in; the tool returns only `provided`. The value never appears in the result, progress or errors, and a missing variable returns `source_not_found:<VAR>` before Topline is called. Needs a Topline server that offers the tool.
|
|
8
|
+
|
|
5
9
|
## 0.9.17 - 2026-11-16
|
|
6
10
|
|
|
7
11
|
- `platform_inspect_artifact_app`, when this computer is signed in, sends the bundle to Topline's preflight (`POST /api/harness/artifact-apps/preflight-bundle`). It runs the build's own local validation, such as `undeclared_package_import` for `react`, `esbuild` or `@aws-sdk/*`, and the manifest rules Topline applies on save, such as `tables[].operations` needing at least one operation. Each problem is listed under `problems`. `serverChecks` says whether the preflight ran (`passed`, `failed`, or `skipped:<reason>`), and `serverManifestValidationRequired` is false once it has. It never opens a browser sign-in.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build secret requests, local source (Topline design 2026-11-18 §2b): when the person says a key
|
|
3
|
+
* is already on their machine, this helper reads it here and uploads it straight to Topline. The
|
|
4
|
+
* value never appears in a tool result, progress message, log line or error. Only the variable
|
|
5
|
+
* name is ever reported back.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MAX_LOCAL_SECRET_BYTES = 65536;
|
|
8
|
+
export type LocalSecretSource = {
|
|
9
|
+
fromEnv: string;
|
|
10
|
+
} | {
|
|
11
|
+
fromFile: string;
|
|
12
|
+
key: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class LocalSecretSourceError extends Error {
|
|
15
|
+
readonly code: string;
|
|
16
|
+
readonly variable?: string | undefined;
|
|
17
|
+
constructor(code: string, variable?: string | undefined);
|
|
18
|
+
}
|
|
19
|
+
export declare function parseLocalSecretSource(value: unknown): LocalSecretSource;
|
|
20
|
+
/** Parses dotenv text: KEY=value, optional `export`, quotes, `#` comments; a double-quoted value may span lines. */
|
|
21
|
+
export declare function parseDotenv(text: string): Map<string, string>;
|
|
22
|
+
/** Reads the value on this machine. Throws source_not_found naming the variable, never a value. */
|
|
23
|
+
export declare function readLocalSecretValue(workspaceRoot: string, source: LocalSecretSource, env?: NodeJS.ProcessEnv): Promise<string>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { lstat, readFile, realpath } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Build secret requests, local source (Topline design 2026-11-18 §2b): when the person says a key
|
|
5
|
+
* is already on their machine, this helper reads it here and uploads it straight to Topline. The
|
|
6
|
+
* value never appears in a tool result, progress message, log line or error. Only the variable
|
|
7
|
+
* name is ever reported back.
|
|
8
|
+
*/
|
|
9
|
+
export const MAX_LOCAL_SECRET_BYTES = 65_536;
|
|
10
|
+
const MAX_DOTENV_FILE_BYTES = 1024 * 1024;
|
|
11
|
+
const VARIABLE = /^[A-Za-z_][A-Za-z0-9_.-]{0,127}$/;
|
|
12
|
+
export class LocalSecretSourceError extends Error {
|
|
13
|
+
code;
|
|
14
|
+
variable;
|
|
15
|
+
constructor(code, variable) {
|
|
16
|
+
// The variable name only, never a value.
|
|
17
|
+
super(variable ? `${code}:${variable}` : code);
|
|
18
|
+
this.code = code;
|
|
19
|
+
this.variable = variable;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function parseLocalSecretSource(value) {
|
|
23
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
24
|
+
throw new LocalSecretSourceError("source_invalid");
|
|
25
|
+
const record = value;
|
|
26
|
+
const keys = Object.keys(record).sort().join(",");
|
|
27
|
+
if (keys === "fromEnv" && typeof record.fromEnv === "string" && VARIABLE.test(record.fromEnv))
|
|
28
|
+
return { fromEnv: record.fromEnv };
|
|
29
|
+
if (keys === "fromFile,key" && typeof record.fromFile === "string" && record.fromFile.trim() && typeof record.key === "string" && VARIABLE.test(record.key)) {
|
|
30
|
+
return { fromFile: record.fromFile, key: record.key };
|
|
31
|
+
}
|
|
32
|
+
throw new LocalSecretSourceError("source_invalid");
|
|
33
|
+
}
|
|
34
|
+
/** Parses dotenv text: KEY=value, optional `export`, quotes, `#` comments; a double-quoted value may span lines. */
|
|
35
|
+
export function parseDotenv(text) {
|
|
36
|
+
const values = new Map();
|
|
37
|
+
const source = text.replace(/^/, "").replace(/\r\n?/g, "\n");
|
|
38
|
+
const line = /^[ \t]*(?:export[ \t]+)?([A-Za-z_][A-Za-z0-9_.-]*)[ \t]*=[ \t]*/gm;
|
|
39
|
+
let match;
|
|
40
|
+
while ((match = line.exec(source))) {
|
|
41
|
+
const name = match[1];
|
|
42
|
+
let at = line.lastIndex;
|
|
43
|
+
let value;
|
|
44
|
+
const quote = source[at];
|
|
45
|
+
if (quote === "\"" || quote === "'" || quote === "`") {
|
|
46
|
+
let end = at + 1;
|
|
47
|
+
while (end < source.length && (source[end] !== quote || (quote === "\"" && source[end - 1] === "\\" && source[end - 2] !== "\\")))
|
|
48
|
+
end++;
|
|
49
|
+
// An unterminated quote is not a value: the key reads as missing (source_not_found), never as the rest of the file.
|
|
50
|
+
if (end >= source.length)
|
|
51
|
+
break;
|
|
52
|
+
value = source.slice(at + 1, end);
|
|
53
|
+
if (quote === "\"")
|
|
54
|
+
value = value.replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, "\t").replace(/\\"/g, "\"").replace(/\\\\/g, "\\");
|
|
55
|
+
at = end + 1;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const newline = source.indexOf("\n", at);
|
|
59
|
+
const raw = source.slice(at, newline === -1 ? source.length : newline);
|
|
60
|
+
value = raw.replace(/[ \t]+#.*$/, "").trim();
|
|
61
|
+
at = newline === -1 ? source.length : newline;
|
|
62
|
+
}
|
|
63
|
+
values.set(name, value);
|
|
64
|
+
const rest = source.indexOf("\n", at);
|
|
65
|
+
line.lastIndex = rest === -1 ? source.length : rest + 1;
|
|
66
|
+
}
|
|
67
|
+
return values;
|
|
68
|
+
}
|
|
69
|
+
async function insideWorkspace(workspaceRoot, file) {
|
|
70
|
+
const root = await realpath(path.resolve(workspaceRoot));
|
|
71
|
+
const resolved = path.resolve(root, file);
|
|
72
|
+
const relative = path.relative(root, resolved);
|
|
73
|
+
if (!relative || relative.startsWith("..") || path.isAbsolute(relative))
|
|
74
|
+
throw new LocalSecretSourceError("source_file_outside_workspace");
|
|
75
|
+
let stat;
|
|
76
|
+
try {
|
|
77
|
+
stat = await lstat(resolved);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
throw new LocalSecretSourceError("source_file_not_found");
|
|
81
|
+
}
|
|
82
|
+
if (stat.isSymbolicLink() || !stat.isFile())
|
|
83
|
+
throw new LocalSecretSourceError("source_file_not_found");
|
|
84
|
+
const real = await realpath(resolved);
|
|
85
|
+
const realRelative = path.relative(root, real);
|
|
86
|
+
if (!realRelative || realRelative.startsWith("..") || path.isAbsolute(realRelative))
|
|
87
|
+
throw new LocalSecretSourceError("source_file_outside_workspace");
|
|
88
|
+
if (stat.size > MAX_DOTENV_FILE_BYTES)
|
|
89
|
+
throw new LocalSecretSourceError("source_file_too_large");
|
|
90
|
+
// Read the file that was checked, not a path a rename could repoint afterwards.
|
|
91
|
+
return real;
|
|
92
|
+
}
|
|
93
|
+
/** Reads the value on this machine. Throws source_not_found naming the variable, never a value. */
|
|
94
|
+
export async function readLocalSecretValue(workspaceRoot, source, env = process.env) {
|
|
95
|
+
let value;
|
|
96
|
+
let variable;
|
|
97
|
+
if ("fromEnv" in source) {
|
|
98
|
+
variable = source.fromEnv;
|
|
99
|
+
value = env[source.fromEnv];
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
variable = source.key;
|
|
103
|
+
const file = await insideWorkspace(workspaceRoot, source.fromFile);
|
|
104
|
+
const bytes = await readFile(file);
|
|
105
|
+
let text;
|
|
106
|
+
try {
|
|
107
|
+
text = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
throw new LocalSecretSourceError("source_not_utf8", variable);
|
|
111
|
+
}
|
|
112
|
+
value = parseDotenv(text).get(source.key);
|
|
113
|
+
}
|
|
114
|
+
if (value === undefined || value.trim() === "")
|
|
115
|
+
throw new LocalSecretSourceError("source_not_found", variable);
|
|
116
|
+
if (Buffer.byteLength(value, "utf8") > MAX_LOCAL_SECRET_BYTES)
|
|
117
|
+
throw new LocalSecretSourceError("source_value_too_large", variable);
|
|
118
|
+
return value;
|
|
119
|
+
}
|
|
@@ -34,7 +34,16 @@ export function externalBuildHelperTools(annotate) {
|
|
|
34
34
|
tool("platform_materialize_assets", "Download exactly selected approved files into a new local directory. Verify each authenticated transfer's hash and size; source and attachment budgets remain separate.", {
|
|
35
35
|
...session, assetIds: { type: "array", minItems: 1, maxItems: 50, uniqueItems: true, items: id }, targetDir: { type: "string", minLength: 1 }
|
|
36
36
|
}, ["sessionId", "assetIds", "targetDir"]),
|
|
37
|
-
tool("
|
|
37
|
+
tool("platform_request_build_secret", "Ask a person for a named key this app needs (an API key, webhook URL or token) without ever seeing it. Check platform_list_build_secrets first and never ask twice. Without source, Topline posts a request card in the session's build thread and returns pending with threadUrl and instructions: tell the person to open threadUrl, find the card titled with your label, and paste the value there or pick a saved key. Never ask them to paste it into your chat. Pass source only when the person says the key is already on this machine: {fromEnv: \"VAR\"} reads an environment variable, {fromFile: \".env\", key: \"VAR\"} reads a dotenv file inside the workspace. This helper reads the value here and uploads it to Topline itself; you get back only provided. Never search files for keys on your own.", {
|
|
38
|
+
...session, idempotencyKey: requestKey,
|
|
39
|
+
name: { type: "string", pattern: "^[a-z][a-z0-9_]{0,30}$" }, label: { type: "string", minLength: 1, maxLength: 200 },
|
|
40
|
+
reason: { type: "string", minLength: 3, maxLength: 300 }, hint: { type: "string", maxLength: 300 },
|
|
41
|
+
source: { oneOf: [
|
|
42
|
+
{ type: "object", additionalProperties: false, properties: { fromEnv: { type: "string", minLength: 1, maxLength: 128 } }, required: ["fromEnv"] },
|
|
43
|
+
{ type: "object", additionalProperties: false, properties: { fromFile: { type: "string", minLength: 1 }, key: { type: "string", minLength: 1, maxLength: 128 } }, required: ["fromFile", "key"] }
|
|
44
|
+
] }
|
|
45
|
+
}, ["sessionId", "idempotencyKey", "name", "label", "reason"]),
|
|
46
|
+
tool("platform_list_build_secrets", "Read this session's keys: approved references to bind exactly by name, secretArn and suggestedEnv, the build thread's requests (pending, provided, declined or expired) and a plain nextStep. Read live, so a key provided after the session started counts. Values are never retrieved. Removing a key does not prove deployed runtime revocation.", session, ["sessionId"], true),
|
|
38
47
|
tool("platform_add_acceptance_check", "Add a required acceptance check bound to this build session and deployed revision. A semantic control query requires separate Build data-verification consent.", {
|
|
39
48
|
...mutation, description: { type: "string", minLength: 3, maxLength: 1000 }
|
|
40
49
|
}, [...Object.keys(mutation), "description"]),
|
|
@@ -69,7 +78,7 @@ export const EXTERNAL_BUILD_FORWARD_TOOLS = new Set([
|
|
|
69
78
|
*/
|
|
70
79
|
export const EXTERNAL_BUILD_SESSION_TOOLS = new Set([
|
|
71
80
|
...[...EXTERNAL_BUILD_FORWARD_TOOLS].filter((name) => name !== "platform_capability_status"),
|
|
72
|
-
"platform_checkout_artifact_app", "platform_materialize_assets"
|
|
81
|
+
"platform_checkout_artifact_app", "platform_materialize_assets", "platform_request_build_secret"
|
|
73
82
|
]);
|
|
74
83
|
/** Session tools that only call the hosted tool of the same name, so they can take its input schema. */
|
|
75
84
|
export const EXTERNAL_BUILD_SESSION_FORWARD_TOOLS = new Set([...EXTERNAL_BUILD_SESSION_TOOLS].filter((name) => EXTERNAL_BUILD_FORWARD_TOOLS.has(name)));
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ type ToolProgressReporter = (progress: number, message: string) => void | Promis
|
|
|
42
42
|
export type McpSurface = "build" | "topline" | "harness";
|
|
43
43
|
export declare const DEFAULT_MCP_PROTOCOL_VERSION = "2025-11-25";
|
|
44
44
|
export declare const BUILD_MCP_SERVER_NAME = "topline-build-stdio";
|
|
45
|
-
export declare const HARNESS_MCP_VERSION = "0.9.
|
|
45
|
+
export declare const HARNESS_MCP_VERSION = "0.9.18";
|
|
46
46
|
export declare const DEFAULT_OAUTH_SCOPES: readonly string[];
|
|
47
47
|
/** The Topline server's scopes: Build and Workspace. Consent shows what the seat allows. */
|
|
48
48
|
export declare const TOPLINE_OAUTH_SCOPES: readonly string[];
|
|
@@ -118,6 +118,33 @@ export declare function checkoutArtifactApp(opts: HarnessMcpStdioOptions, input:
|
|
|
118
118
|
fileCount: number;
|
|
119
119
|
byteCount: number;
|
|
120
120
|
}>;
|
|
121
|
+
/**
|
|
122
|
+
* platform_request_build_secret with `source` (Topline design 2026-11-18 §2b). Reads the value on
|
|
123
|
+
* this machine first (a missing variable fails before Topline is called), asks Topline for the
|
|
124
|
+
* request and its upload path, then PUTs the value to /api/v1/secrets with this session's own
|
|
125
|
+
* token. The result, progress and errors carry names only.
|
|
126
|
+
*/
|
|
127
|
+
export declare function requestBuildSecretFromSource(opts: HarnessMcpStdioOptions, input: Record<string, unknown>, env?: NodeJS.ProcessEnv): Promise<{
|
|
128
|
+
ok: boolean;
|
|
129
|
+
requestId: string | null;
|
|
130
|
+
status: string;
|
|
131
|
+
name: string;
|
|
132
|
+
alreadyProvided: boolean;
|
|
133
|
+
} | {
|
|
134
|
+
declineNote?: string | undefined;
|
|
135
|
+
ok: boolean;
|
|
136
|
+
requestId: string | null;
|
|
137
|
+
status: string;
|
|
138
|
+
name: string;
|
|
139
|
+
alreadyProvided?: undefined;
|
|
140
|
+
} | {
|
|
141
|
+
threadUrl?: string | undefined;
|
|
142
|
+
ok: boolean;
|
|
143
|
+
requestId: string;
|
|
144
|
+
status: string;
|
|
145
|
+
name: string;
|
|
146
|
+
alreadyProvided?: undefined;
|
|
147
|
+
}>;
|
|
121
148
|
export declare function materializeBuildAssets(opts: HarnessMcpStdioOptions, input: Record<string, unknown>): Promise<{
|
|
122
149
|
ok: boolean;
|
|
123
150
|
sessionId: string;
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { AsyncLocalStorage } from "node:async_hooks";
|
|
|
7
7
|
import os from "node:os";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { gzipSync } from "node:zlib";
|
|
10
|
+
import { parseLocalSecretSource, readLocalSecretValue } from "./build-secret-source.js";
|
|
10
11
|
import { externalBuildHelperTools, EXTERNAL_BUILD_FORWARD_TOOLS, EXTERNAL_BUILD_SESSION_FORWARD_TOOLS, EXTERNAL_BUILD_SESSION_TOOLS } from "./build-session-tools.js";
|
|
11
12
|
import { domainHelperTools, DOMAIN_FORWARD_TOOLS, DOMAIN_ERROR_CODES } from "./domain-tools.js";
|
|
12
13
|
import { ARTIFACT_STARTER_IDS, artifactStarterAppRoutes, artifactStarterRecipe, artifactStarterSource, artifactStarterTemplateSource, findArtifactStarter } from "./artifact-starters.js";
|
|
@@ -19,7 +20,7 @@ const MCP_SURFACES = ["build", "topline", "harness"];
|
|
|
19
20
|
export const DEFAULT_MCP_PROTOCOL_VERSION = "2025-11-25";
|
|
20
21
|
const DEFAULT_TIMEOUT_MS = 120_000;
|
|
21
22
|
export const BUILD_MCP_SERVER_NAME = "topline-build-stdio";
|
|
22
|
-
export const HARNESS_MCP_VERSION = "0.9.
|
|
23
|
+
export const HARNESS_MCP_VERSION = "0.9.18";
|
|
23
24
|
export const DEFAULT_OAUTH_SCOPES = Object.freeze(["harness:artifact:read", "harness:artifact:write", "harness:artifact:deploy", "harness:artifact:delete"]);
|
|
24
25
|
/** The Topline server's scopes: Build and Workspace. Consent shows what the seat allows. */
|
|
25
26
|
export const TOPLINE_OAUTH_SCOPES = Object.freeze([
|
|
@@ -856,6 +857,11 @@ export async function callHarnessTool(opts, name, args, hooks) {
|
|
|
856
857
|
case "platform_materialize_assets":
|
|
857
858
|
result = toolResult(await materializeBuildAssets(opts, input));
|
|
858
859
|
break;
|
|
860
|
+
case "platform_request_build_secret":
|
|
861
|
+
if (!servesBuild(opts))
|
|
862
|
+
throw new Error("external_session_requires_build_surface");
|
|
863
|
+
result = toolResult(input.source === undefined ? await callHostedBuildTool(opts, name, input) : await requestBuildSecretFromSource(opts, input));
|
|
864
|
+
break;
|
|
859
865
|
case "platform_submit_design_system_draft":
|
|
860
866
|
result = toolResult(await submitDesignSystemDraft(opts, input));
|
|
861
867
|
break;
|
|
@@ -1124,6 +1130,44 @@ export async function checkoutArtifactApp(opts, input) {
|
|
|
1124
1130
|
await rm(staging, { recursive: true, force: true });
|
|
1125
1131
|
}
|
|
1126
1132
|
}
|
|
1133
|
+
/**
|
|
1134
|
+
* platform_request_build_secret with `source` (Topline design 2026-11-18 §2b). Reads the value on
|
|
1135
|
+
* this machine first (a missing variable fails before Topline is called), asks Topline for the
|
|
1136
|
+
* request and its upload path, then PUTs the value to /api/v1/secrets with this session's own
|
|
1137
|
+
* token. The result, progress and errors carry names only.
|
|
1138
|
+
*/
|
|
1139
|
+
export async function requestBuildSecretFromSource(opts, input, env = process.env) {
|
|
1140
|
+
const { source: rawSource, ...hostedInput } = input;
|
|
1141
|
+
const source = parseLocalSecretSource(rawSource);
|
|
1142
|
+
const sessionId = stringArg(input, "sessionId");
|
|
1143
|
+
let value = await readLocalSecretValue(opts.workspaceRoot, source, env);
|
|
1144
|
+
try {
|
|
1145
|
+
const hosted = asRecord(await callHostedBuildTool(opts, "platform_request_build_secret", { ...hostedInput, localUpload: true }));
|
|
1146
|
+
const name = stringValue(hosted.name, "name");
|
|
1147
|
+
if (hosted.status === "provided")
|
|
1148
|
+
return { ok: true, requestId: typeof hosted.requestId === "string" ? hosted.requestId : null, status: "provided", name, alreadyProvided: true };
|
|
1149
|
+
// A retried key that was declined or expired: report it, upload nothing.
|
|
1150
|
+
if (hosted.status === "declined" || hosted.status === "expired") {
|
|
1151
|
+
return { ok: true, requestId: typeof hosted.requestId === "string" ? hosted.requestId : null, status: hosted.status, name,
|
|
1152
|
+
...(typeof hosted.declineNote === "string" ? { declineNote: hosted.declineNote } : {}) };
|
|
1153
|
+
}
|
|
1154
|
+
const requestId = stringValue(hosted.requestId, "requestId");
|
|
1155
|
+
const upload = asRecord(hosted.upload);
|
|
1156
|
+
const uploadPath = stringValue(upload.path, "upload.path");
|
|
1157
|
+
if (!/^\/api\/v1\/secrets\/[a-z][a-z0-9_]{0,62}$/.test(uploadPath) || !/^[0-9a-f-]{36}$/i.test(requestId))
|
|
1158
|
+
throw new Error("build_secret_upload_invalid");
|
|
1159
|
+
const headers = await jsonHeaders(opts);
|
|
1160
|
+
await fetchJson(opts, `${platformBaseUrl(opts)}${uploadPath}`, {
|
|
1161
|
+
method: "PUT",
|
|
1162
|
+
headers: { ...headers, "x-topline-build-session": sessionId, "x-topline-build-secret-request": requestId },
|
|
1163
|
+
body: JSON.stringify({ value })
|
|
1164
|
+
});
|
|
1165
|
+
return { ok: true, requestId, status: "provided", name, ...(typeof hosted.threadUrl === "string" ? { threadUrl: hosted.threadUrl } : {}) };
|
|
1166
|
+
}
|
|
1167
|
+
finally {
|
|
1168
|
+
value = null;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1127
1171
|
export async function materializeBuildAssets(opts, input) {
|
|
1128
1172
|
const target = await newBuildInputTarget(opts, input);
|
|
1129
1173
|
const sessionId = stringArg(input, "sessionId");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": {
|
|
4
4
|
"name": "@topline-build/harness-mcp",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.18",
|
|
6
6
|
"bin": {
|
|
7
7
|
"topline-mcp": "dist/cli.js"
|
|
8
8
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"defaultVersion": "2025-11-25",
|
|
13
13
|
"server": {
|
|
14
14
|
"name": "topline-build-stdio",
|
|
15
|
-
"version": "0.9.
|
|
15
|
+
"version": "0.9.18"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"generatedFrom": {
|
|
@@ -4602,9 +4602,172 @@
|
|
|
4602
4602
|
}
|
|
4603
4603
|
]
|
|
4604
4604
|
},
|
|
4605
|
+
{
|
|
4606
|
+
"name": "platform_request_build_secret",
|
|
4607
|
+
"description": "Ask a person for a named key this app needs (an API key, webhook URL or token) without ever seeing it. Check platform_list_build_secrets first and never ask twice. Without source, Topline posts a request card in the session's build thread and returns pending with threadUrl and instructions: tell the person to open threadUrl, find the card titled with your label, and paste the value there or pick a saved key. Never ask them to paste it into your chat. Pass source only when the person says the key is already on this machine: {fromEnv: \"VAR\"} reads an environment variable, {fromFile: \".env\", key: \"VAR\"} reads a dotenv file inside the workspace. This helper reads the value here and uploads it to Topline itself; you get back only provided. Never search files for keys on your own.",
|
|
4608
|
+
"annotations": {
|
|
4609
|
+
"title": "Platform Request Build Secret",
|
|
4610
|
+
"readOnlyHint": false,
|
|
4611
|
+
"destructiveHint": false,
|
|
4612
|
+
"idempotentHint": true,
|
|
4613
|
+
"openWorldHint": true
|
|
4614
|
+
},
|
|
4615
|
+
"inputSchema": {
|
|
4616
|
+
"type": "object",
|
|
4617
|
+
"additionalProperties": false,
|
|
4618
|
+
"properties": {
|
|
4619
|
+
"sessionId": {
|
|
4620
|
+
"type": "string",
|
|
4621
|
+
"format": "uuid"
|
|
4622
|
+
},
|
|
4623
|
+
"idempotencyKey": {
|
|
4624
|
+
"type": "string",
|
|
4625
|
+
"minLength": 1,
|
|
4626
|
+
"maxLength": 128,
|
|
4627
|
+
"pattern": "^[A-Za-z0-9._:-]+$"
|
|
4628
|
+
},
|
|
4629
|
+
"name": {
|
|
4630
|
+
"type": "string",
|
|
4631
|
+
"pattern": "^[a-z][a-z0-9_]{0,30}$"
|
|
4632
|
+
},
|
|
4633
|
+
"label": {
|
|
4634
|
+
"type": "string",
|
|
4635
|
+
"minLength": 1,
|
|
4636
|
+
"maxLength": 200
|
|
4637
|
+
},
|
|
4638
|
+
"reason": {
|
|
4639
|
+
"type": "string",
|
|
4640
|
+
"minLength": 3,
|
|
4641
|
+
"maxLength": 300
|
|
4642
|
+
},
|
|
4643
|
+
"hint": {
|
|
4644
|
+
"type": "string",
|
|
4645
|
+
"maxLength": 300
|
|
4646
|
+
},
|
|
4647
|
+
"source": {
|
|
4648
|
+
"oneOf": [
|
|
4649
|
+
{
|
|
4650
|
+
"type": "object",
|
|
4651
|
+
"additionalProperties": false,
|
|
4652
|
+
"properties": {
|
|
4653
|
+
"fromEnv": {
|
|
4654
|
+
"type": "string",
|
|
4655
|
+
"minLength": 1,
|
|
4656
|
+
"maxLength": 128
|
|
4657
|
+
}
|
|
4658
|
+
},
|
|
4659
|
+
"required": [
|
|
4660
|
+
"fromEnv"
|
|
4661
|
+
]
|
|
4662
|
+
},
|
|
4663
|
+
{
|
|
4664
|
+
"type": "object",
|
|
4665
|
+
"additionalProperties": false,
|
|
4666
|
+
"properties": {
|
|
4667
|
+
"fromFile": {
|
|
4668
|
+
"type": "string",
|
|
4669
|
+
"minLength": 1
|
|
4670
|
+
},
|
|
4671
|
+
"key": {
|
|
4672
|
+
"type": "string",
|
|
4673
|
+
"minLength": 1,
|
|
4674
|
+
"maxLength": 128
|
|
4675
|
+
}
|
|
4676
|
+
},
|
|
4677
|
+
"required": [
|
|
4678
|
+
"fromFile",
|
|
4679
|
+
"key"
|
|
4680
|
+
]
|
|
4681
|
+
}
|
|
4682
|
+
]
|
|
4683
|
+
}
|
|
4684
|
+
},
|
|
4685
|
+
"required": [
|
|
4686
|
+
"sessionId",
|
|
4687
|
+
"idempotencyKey",
|
|
4688
|
+
"name",
|
|
4689
|
+
"label",
|
|
4690
|
+
"reason"
|
|
4691
|
+
]
|
|
4692
|
+
},
|
|
4693
|
+
"outputSchema": {
|
|
4694
|
+
"type": "object",
|
|
4695
|
+
"oneOf": [
|
|
4696
|
+
{
|
|
4697
|
+
"type": "object",
|
|
4698
|
+
"properties": {
|
|
4699
|
+
"ok": {
|
|
4700
|
+
"const": true
|
|
4701
|
+
}
|
|
4702
|
+
}
|
|
4703
|
+
},
|
|
4704
|
+
{
|
|
4705
|
+
"type": "object",
|
|
4706
|
+
"properties": {
|
|
4707
|
+
"ok": {
|
|
4708
|
+
"const": false
|
|
4709
|
+
},
|
|
4710
|
+
"error": {
|
|
4711
|
+
"type": "object",
|
|
4712
|
+
"properties": {
|
|
4713
|
+
"code": {
|
|
4714
|
+
"type": "string"
|
|
4715
|
+
},
|
|
4716
|
+
"message": {
|
|
4717
|
+
"type": "string"
|
|
4718
|
+
},
|
|
4719
|
+
"retryable": {
|
|
4720
|
+
"type": "boolean"
|
|
4721
|
+
},
|
|
4722
|
+
"recoveryAction": {
|
|
4723
|
+
"type": "string"
|
|
4724
|
+
},
|
|
4725
|
+
"signInUrl": {
|
|
4726
|
+
"type": "string"
|
|
4727
|
+
},
|
|
4728
|
+
"currentSourceHash": {
|
|
4729
|
+
"type": "string"
|
|
4730
|
+
},
|
|
4731
|
+
"pendingOperationId": {
|
|
4732
|
+
"type": "string"
|
|
4733
|
+
},
|
|
4734
|
+
"pendingKind": {
|
|
4735
|
+
"type": "string"
|
|
4736
|
+
}
|
|
4737
|
+
},
|
|
4738
|
+
"required": [
|
|
4739
|
+
"code",
|
|
4740
|
+
"message",
|
|
4741
|
+
"retryable",
|
|
4742
|
+
"recoveryAction"
|
|
4743
|
+
],
|
|
4744
|
+
"additionalProperties": false
|
|
4745
|
+
}
|
|
4746
|
+
},
|
|
4747
|
+
"required": [
|
|
4748
|
+
"ok",
|
|
4749
|
+
"error"
|
|
4750
|
+
],
|
|
4751
|
+
"additionalProperties": false
|
|
4752
|
+
}
|
|
4753
|
+
]
|
|
4754
|
+
},
|
|
4755
|
+
"examples": [
|
|
4756
|
+
{
|
|
4757
|
+
"request": {
|
|
4758
|
+
"sessionId": "00000000-0000-4000-8000-000000000001",
|
|
4759
|
+
"idempotencyKey": "example-request",
|
|
4760
|
+
"name": "slack_webhook_url",
|
|
4761
|
+
"label": "<label>",
|
|
4762
|
+
"reason": "<reason>"
|
|
4763
|
+
},
|
|
4764
|
+
"success": {}
|
|
4765
|
+
}
|
|
4766
|
+
]
|
|
4767
|
+
},
|
|
4605
4768
|
{
|
|
4606
4769
|
"name": "platform_list_build_secrets",
|
|
4607
|
-
"description": "Read
|
|
4770
|
+
"description": "Read this session's keys: approved references to bind exactly by name, secretArn and suggestedEnv, the build thread's requests (pending, provided, declined or expired) and a plain nextStep. Read live, so a key provided after the session started counts. Values are never retrieved. Removing a key does not prove deployed runtime revocation.",
|
|
4608
4771
|
"annotations": {
|
|
4609
4772
|
"title": "Platform List Build Secrets",
|
|
4610
4773
|
"readOnlyHint": true,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Generated from `src/index.ts#BUILD_MCP_TOOLS`. Do not edit this file by hand.
|
|
4
4
|
|
|
5
|
-
Package: `@topline-build/harness-mcp@0.9.
|
|
5
|
+
Package: `@topline-build/harness-mcp@0.9.18`
|
|
6
6
|
Transport: `stdio`
|
|
7
7
|
Default protocol: `2025-11-25`
|
|
8
8
|
Canonical guide: https://topline.build/docs/build-mcp-guide
|
|
@@ -4544,9 +4544,183 @@ Output schema:
|
|
|
4544
4544
|
}
|
|
4545
4545
|
```
|
|
4546
4546
|
|
|
4547
|
+
### `platform_request_build_secret`
|
|
4548
|
+
|
|
4549
|
+
Ask a person for a named key this app needs (an API key, webhook URL or token) without ever seeing it. Check platform_list_build_secrets first and never ask twice. Without source, Topline posts a request card in the session's build thread and returns pending with threadUrl and instructions: tell the person to open threadUrl, find the card titled with your label, and paste the value there or pick a saved key. Never ask them to paste it into your chat. Pass source only when the person says the key is already on this machine: {fromEnv: "VAR"} reads an environment variable, {fromFile: ".env", key: "VAR"} reads a dotenv file inside the workspace. This helper reads the value here and uploads it to Topline itself; you get back only provided. Never search files for keys on your own.
|
|
4550
|
+
|
|
4551
|
+
Safety: read-only=false, destructive=false, idempotent=true, open-world=true.
|
|
4552
|
+
|
|
4553
|
+
Example request:
|
|
4554
|
+
|
|
4555
|
+
```json
|
|
4556
|
+
{
|
|
4557
|
+
"sessionId": "00000000-0000-4000-8000-000000000001",
|
|
4558
|
+
"idempotencyKey": "example-request",
|
|
4559
|
+
"name": "slack_webhook_url",
|
|
4560
|
+
"label": "<label>",
|
|
4561
|
+
"reason": "<reason>"
|
|
4562
|
+
}
|
|
4563
|
+
```
|
|
4564
|
+
|
|
4565
|
+
Example success:
|
|
4566
|
+
|
|
4567
|
+
```json
|
|
4568
|
+
{}
|
|
4569
|
+
```
|
|
4570
|
+
|
|
4571
|
+
Input schema:
|
|
4572
|
+
|
|
4573
|
+
```json
|
|
4574
|
+
{
|
|
4575
|
+
"type": "object",
|
|
4576
|
+
"additionalProperties": false,
|
|
4577
|
+
"properties": {
|
|
4578
|
+
"sessionId": {
|
|
4579
|
+
"type": "string",
|
|
4580
|
+
"format": "uuid"
|
|
4581
|
+
},
|
|
4582
|
+
"idempotencyKey": {
|
|
4583
|
+
"type": "string",
|
|
4584
|
+
"minLength": 1,
|
|
4585
|
+
"maxLength": 128,
|
|
4586
|
+
"pattern": "^[A-Za-z0-9._:-]+$"
|
|
4587
|
+
},
|
|
4588
|
+
"name": {
|
|
4589
|
+
"type": "string",
|
|
4590
|
+
"pattern": "^[a-z][a-z0-9_]{0,30}$"
|
|
4591
|
+
},
|
|
4592
|
+
"label": {
|
|
4593
|
+
"type": "string",
|
|
4594
|
+
"minLength": 1,
|
|
4595
|
+
"maxLength": 200
|
|
4596
|
+
},
|
|
4597
|
+
"reason": {
|
|
4598
|
+
"type": "string",
|
|
4599
|
+
"minLength": 3,
|
|
4600
|
+
"maxLength": 300
|
|
4601
|
+
},
|
|
4602
|
+
"hint": {
|
|
4603
|
+
"type": "string",
|
|
4604
|
+
"maxLength": 300
|
|
4605
|
+
},
|
|
4606
|
+
"source": {
|
|
4607
|
+
"oneOf": [
|
|
4608
|
+
{
|
|
4609
|
+
"type": "object",
|
|
4610
|
+
"additionalProperties": false,
|
|
4611
|
+
"properties": {
|
|
4612
|
+
"fromEnv": {
|
|
4613
|
+
"type": "string",
|
|
4614
|
+
"minLength": 1,
|
|
4615
|
+
"maxLength": 128
|
|
4616
|
+
}
|
|
4617
|
+
},
|
|
4618
|
+
"required": [
|
|
4619
|
+
"fromEnv"
|
|
4620
|
+
]
|
|
4621
|
+
},
|
|
4622
|
+
{
|
|
4623
|
+
"type": "object",
|
|
4624
|
+
"additionalProperties": false,
|
|
4625
|
+
"properties": {
|
|
4626
|
+
"fromFile": {
|
|
4627
|
+
"type": "string",
|
|
4628
|
+
"minLength": 1
|
|
4629
|
+
},
|
|
4630
|
+
"key": {
|
|
4631
|
+
"type": "string",
|
|
4632
|
+
"minLength": 1,
|
|
4633
|
+
"maxLength": 128
|
|
4634
|
+
}
|
|
4635
|
+
},
|
|
4636
|
+
"required": [
|
|
4637
|
+
"fromFile",
|
|
4638
|
+
"key"
|
|
4639
|
+
]
|
|
4640
|
+
}
|
|
4641
|
+
]
|
|
4642
|
+
}
|
|
4643
|
+
},
|
|
4644
|
+
"required": [
|
|
4645
|
+
"sessionId",
|
|
4646
|
+
"idempotencyKey",
|
|
4647
|
+
"name",
|
|
4648
|
+
"label",
|
|
4649
|
+
"reason"
|
|
4650
|
+
]
|
|
4651
|
+
}
|
|
4652
|
+
```
|
|
4653
|
+
|
|
4654
|
+
Output schema:
|
|
4655
|
+
|
|
4656
|
+
```json
|
|
4657
|
+
{
|
|
4658
|
+
"type": "object",
|
|
4659
|
+
"oneOf": [
|
|
4660
|
+
{
|
|
4661
|
+
"type": "object",
|
|
4662
|
+
"properties": {
|
|
4663
|
+
"ok": {
|
|
4664
|
+
"const": true
|
|
4665
|
+
}
|
|
4666
|
+
}
|
|
4667
|
+
},
|
|
4668
|
+
{
|
|
4669
|
+
"type": "object",
|
|
4670
|
+
"properties": {
|
|
4671
|
+
"ok": {
|
|
4672
|
+
"const": false
|
|
4673
|
+
},
|
|
4674
|
+
"error": {
|
|
4675
|
+
"type": "object",
|
|
4676
|
+
"properties": {
|
|
4677
|
+
"code": {
|
|
4678
|
+
"type": "string"
|
|
4679
|
+
},
|
|
4680
|
+
"message": {
|
|
4681
|
+
"type": "string"
|
|
4682
|
+
},
|
|
4683
|
+
"retryable": {
|
|
4684
|
+
"type": "boolean"
|
|
4685
|
+
},
|
|
4686
|
+
"recoveryAction": {
|
|
4687
|
+
"type": "string"
|
|
4688
|
+
},
|
|
4689
|
+
"signInUrl": {
|
|
4690
|
+
"type": "string"
|
|
4691
|
+
},
|
|
4692
|
+
"currentSourceHash": {
|
|
4693
|
+
"type": "string"
|
|
4694
|
+
},
|
|
4695
|
+
"pendingOperationId": {
|
|
4696
|
+
"type": "string"
|
|
4697
|
+
},
|
|
4698
|
+
"pendingKind": {
|
|
4699
|
+
"type": "string"
|
|
4700
|
+
}
|
|
4701
|
+
},
|
|
4702
|
+
"required": [
|
|
4703
|
+
"code",
|
|
4704
|
+
"message",
|
|
4705
|
+
"retryable",
|
|
4706
|
+
"recoveryAction"
|
|
4707
|
+
],
|
|
4708
|
+
"additionalProperties": false
|
|
4709
|
+
}
|
|
4710
|
+
},
|
|
4711
|
+
"required": [
|
|
4712
|
+
"ok",
|
|
4713
|
+
"error"
|
|
4714
|
+
],
|
|
4715
|
+
"additionalProperties": false
|
|
4716
|
+
}
|
|
4717
|
+
]
|
|
4718
|
+
}
|
|
4719
|
+
```
|
|
4720
|
+
|
|
4547
4721
|
### `platform_list_build_secrets`
|
|
4548
4722
|
|
|
4549
|
-
Read
|
|
4723
|
+
Read this session's keys: approved references to bind exactly by name, secretArn and suggestedEnv, the build thread's requests (pending, provided, declined or expired) and a plain nextStep. Read live, so a key provided after the session started counts. Values are never retrieved. Removing a key does not prove deployed runtime revocation.
|
|
4550
4724
|
|
|
4551
4725
|
Safety: read-only=true, destructive=false, idempotent=true, open-world=true.
|
|
4552
4726
|
|