caisson-cli 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -38
- package/dist/admin/workspaceAdmin.d.ts +3 -3
- package/dist/auth/agentAuth.d.ts +11 -1
- package/dist/auth/agentAuth.js +44 -15
- package/dist/auth/agentAuth.js.map +1 -1
- package/dist/cli/caissonCli.d.ts +5 -0
- package/dist/cli/caissonCli.js +61 -4
- package/dist/cli/caissonCli.js.map +1 -1
- package/dist/cli/doctor.d.ts +31 -0
- package/dist/cli/doctor.js +321 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/inviteCard.d.ts +13 -0
- package/dist/cli/inviteCard.js +81 -19
- package/dist/cli/inviteCard.js.map +1 -1
- package/dist/mcp/handlers.d.ts +2 -0
- package/dist/mcp/handlers.js +53 -25
- package/dist/mcp/handlers.js.map +1 -1
- package/dist/mcp/httpServer.d.ts +4 -0
- package/dist/mcp/httpServer.js +20 -4
- package/dist/mcp/httpServer.js.map +1 -1
- package/dist/web/discoveryRoutes.d.ts +4 -0
- package/dist/web/discoveryRoutes.js +80 -4
- package/dist/web/discoveryRoutes.js.map +1 -1
- package/dist/web/docsRoutes.d.ts +14 -0
- package/dist/web/docsRoutes.js +451 -0
- package/dist/web/docsRoutes.js.map +1 -0
- package/dist/web/explorer/renderers.js +4 -2
- package/dist/web/explorer/renderers.js.map +1 -1
- package/dist/web/landing.d.ts +36 -0
- package/dist/web/landing.js +532 -0
- package/dist/web/landing.js.map +1 -0
- package/dist/web/onboardingRoutes.d.ts +96 -0
- package/dist/web/onboardingRoutes.js +629 -0
- package/dist/web/onboardingRoutes.js.map +1 -0
- package/package.json +58 -57
- package/public/.well-known/agent-card.json +162 -153
- package/public/llms.txt +40 -35
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
// src/cli/doctor.ts
|
|
2
|
+
// Epic 7 / OB-4: `caisson doctor` connectivity, auth, MCP handshake, and proxy diagnostic CLI.
|
|
3
|
+
import tls from 'node:tls';
|
|
4
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
5
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
6
|
+
import { createHttp2Fetch } from './mcpProxy.js';
|
|
7
|
+
const EXPECTED_MCP_TOOLS = [
|
|
8
|
+
'query_cache',
|
|
9
|
+
'read_graph',
|
|
10
|
+
'claim_node',
|
|
11
|
+
'submit_artifact',
|
|
12
|
+
'log_dead_end',
|
|
13
|
+
];
|
|
14
|
+
function hasSystemCaSupport() {
|
|
15
|
+
const getCAs = tls
|
|
16
|
+
.getCACertificates;
|
|
17
|
+
if (typeof getCAs !== 'function')
|
|
18
|
+
return false;
|
|
19
|
+
try {
|
|
20
|
+
return getCAs('system').length > 0;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function classifyNetworkFailure(err, host) {
|
|
27
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
28
|
+
const causeMsg = err && typeof err === 'object' && 'cause' in err && err.cause
|
|
29
|
+
? String(err.cause?.code ?? err.cause?.message ?? '')
|
|
30
|
+
: '';
|
|
31
|
+
const combined = `${msg} ${causeMsg}`;
|
|
32
|
+
if (/HPE_INVALID_CHUNK_SIZE|Invalid character in chunk size/i.test(combined)) {
|
|
33
|
+
return 'HTTP/1.1 chunk-framing error detected (common on Windows HTTP/1.1 proxies). Use HTTPS/HTTP2 via `npx -y caisson-cli proxy --url https://api.caisson.tools/mcp`.';
|
|
34
|
+
}
|
|
35
|
+
if (/ENOTFOUND|EAI_AGAIN|ECONNREFUSED|ETIMEDOUT|EHOSTUNREACH|fetch failed/i.test(combined)) {
|
|
36
|
+
return `If running inside a cloud sandbox or restricted network, add '${host}' to your allowed egress hosts (or check outbound HTTPS/HTTP2 connectivity).`;
|
|
37
|
+
}
|
|
38
|
+
if (/CERT|UNABLE_TO_VERIFY|SELF_SIGNED|TLS/i.test(combined)) {
|
|
39
|
+
return 'TLS verification failed. Upgrade to Node >= 22.15 or run through `npx -y caisson-cli proxy` to use OS system root CAs.';
|
|
40
|
+
}
|
|
41
|
+
return 'Check the URL, network connectivity, and API token.';
|
|
42
|
+
}
|
|
43
|
+
export async function runCaissonDoctor(opts) {
|
|
44
|
+
const timeoutMs = opts.timeoutMs ?? 15_000;
|
|
45
|
+
const endpoint = new URL(opts.url);
|
|
46
|
+
const apiOrigin = endpoint.origin;
|
|
47
|
+
const webUrl = opts.webUrl ??
|
|
48
|
+
(endpoint.hostname === 'api.caisson.tools' ? 'https://caisson.tools' : null);
|
|
49
|
+
const checks = [];
|
|
50
|
+
// 1. Node runtime & OS transport check
|
|
51
|
+
const major = Number(process.versions.node.split('.')[0] ?? 0);
|
|
52
|
+
const sysCa = hasSystemCaSupport();
|
|
53
|
+
const isWindows = process.platform === 'win32';
|
|
54
|
+
checks.push({
|
|
55
|
+
id: 'runtime',
|
|
56
|
+
label: 'Node.js & TLS Runtime',
|
|
57
|
+
status: major >= 20 ? (isWindows && !sysCa ? 'warn' : 'pass') : 'fail',
|
|
58
|
+
detail: `Node ${process.version} on ${process.platform}/${process.arch} (OS system CAs: ${sysCa ? 'available' : 'fallback'}).`,
|
|
59
|
+
...(isWindows
|
|
60
|
+
? {
|
|
61
|
+
remediation: 'On Windows clients, prefer `npx -y caisson-cli proxy --url ' +
|
|
62
|
+
opts.url +
|
|
63
|
+
'` to avoid HTTP/1.1 HPE_INVALID_CHUNK_SIZE errors.',
|
|
64
|
+
}
|
|
65
|
+
: major < 20
|
|
66
|
+
? { remediation: 'Upgrade to Node.js >= 20 (22.15+ recommended).' }
|
|
67
|
+
: {}),
|
|
68
|
+
});
|
|
69
|
+
const h2 = createHttp2Fetch({
|
|
70
|
+
allowHttp1: opts.allowHttp1,
|
|
71
|
+
tlsOptions: opts.tlsOptions,
|
|
72
|
+
});
|
|
73
|
+
const activeFetch = opts.customFetch ?? h2.fetch;
|
|
74
|
+
try {
|
|
75
|
+
// 2. /healthz reachability check
|
|
76
|
+
const healthUrl = `${apiOrigin}/healthz`;
|
|
77
|
+
const tHealth = performance.now();
|
|
78
|
+
try {
|
|
79
|
+
const controller = new AbortController();
|
|
80
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
81
|
+
try {
|
|
82
|
+
const res = await activeFetch(healthUrl, { signal: controller.signal, redirect: 'error' });
|
|
83
|
+
const latencyMs = Math.round(performance.now() - tHealth);
|
|
84
|
+
if (res.ok) {
|
|
85
|
+
let svcInfo = `HTTP ${res.status}`;
|
|
86
|
+
try {
|
|
87
|
+
const data = (await res.json());
|
|
88
|
+
if (data.service)
|
|
89
|
+
svcInfo = `HTTP ${res.status} (${data.service} v${data.version ?? '?'})`;
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
// plain text OK
|
|
93
|
+
}
|
|
94
|
+
checks.push({
|
|
95
|
+
id: 'api_health',
|
|
96
|
+
label: 'Control Plane /healthz',
|
|
97
|
+
status: 'pass',
|
|
98
|
+
latency_ms: latencyMs,
|
|
99
|
+
detail: `${healthUrl} reachable — ${svcInfo} in ${latencyMs}ms.`,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
checks.push({
|
|
104
|
+
id: 'api_health',
|
|
105
|
+
label: 'Control Plane /healthz',
|
|
106
|
+
status: 'fail',
|
|
107
|
+
latency_ms: latencyMs,
|
|
108
|
+
detail: `${healthUrl} returned HTTP ${res.status}.`,
|
|
109
|
+
remediation: 'Verify --url points to a running Caisson MCP server.',
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
clearTimeout(timer);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch (err) {
|
|
118
|
+
checks.push({
|
|
119
|
+
id: 'api_health',
|
|
120
|
+
label: 'Control Plane /healthz',
|
|
121
|
+
status: 'fail',
|
|
122
|
+
latency_ms: Math.round(performance.now() - tHealth),
|
|
123
|
+
detail: `Failed to reach ${healthUrl}: ${err instanceof Error ? err.message : String(err)}`,
|
|
124
|
+
remediation: classifyNetworkFailure(err, endpoint.hostname),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// 3. Discovery check (/llms.txt) if webUrl available
|
|
128
|
+
if (webUrl) {
|
|
129
|
+
const llmsUrl = `${webUrl.replace(/\/+$/, '')}/llms.txt`;
|
|
130
|
+
const tDisc = performance.now();
|
|
131
|
+
try {
|
|
132
|
+
const controller = new AbortController();
|
|
133
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
134
|
+
try {
|
|
135
|
+
const res = await activeFetch(llmsUrl, {
|
|
136
|
+
headers: { Accept: 'text/markdown' },
|
|
137
|
+
signal: controller.signal,
|
|
138
|
+
redirect: 'error',
|
|
139
|
+
});
|
|
140
|
+
const latencyMs = Math.round(performance.now() - tDisc);
|
|
141
|
+
const body = await res.text();
|
|
142
|
+
if (res.ok && body.includes('# Caisson')) {
|
|
143
|
+
checks.push({
|
|
144
|
+
id: 'discovery',
|
|
145
|
+
label: 'Discovery (/llms.txt)',
|
|
146
|
+
status: 'pass',
|
|
147
|
+
latency_ms: latencyMs,
|
|
148
|
+
detail: `${llmsUrl} returned HTTP ${res.status} (${body.length} bytes) in ${latencyMs}ms.`,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
checks.push({
|
|
153
|
+
id: 'discovery',
|
|
154
|
+
label: 'Discovery (/llms.txt)',
|
|
155
|
+
status: 'warn',
|
|
156
|
+
latency_ms: latencyMs,
|
|
157
|
+
detail: `${llmsUrl} returned HTTP ${res.status} (unexpected payload).`,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
finally {
|
|
162
|
+
clearTimeout(timer);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
checks.push({
|
|
167
|
+
id: 'discovery',
|
|
168
|
+
label: 'Discovery (/llms.txt)',
|
|
169
|
+
status: 'warn',
|
|
170
|
+
latency_ms: Math.round(performance.now() - tDisc),
|
|
171
|
+
detail: `Could not fetch ${llmsUrl}: ${err instanceof Error ? err.message : String(err)}`,
|
|
172
|
+
remediation: classifyNetworkFailure(err, new URL(webUrl).hostname),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// 4. MCP Handshake & Tools List (and optional workspace read_graph)
|
|
177
|
+
const authMode = opts.token ? 'bearer' : 'demo';
|
|
178
|
+
const headers = {
|
|
179
|
+
Authorization: opts.token ? `Bearer ${opts.token}` : 'Bearer demo',
|
|
180
|
+
};
|
|
181
|
+
const client = new Client({ name: 'caisson-doctor', version: '0.2.0' });
|
|
182
|
+
const transport = new StreamableHTTPClientTransport(endpoint, {
|
|
183
|
+
requestInit: { headers, redirect: 'error' },
|
|
184
|
+
fetch: activeFetch,
|
|
185
|
+
});
|
|
186
|
+
const tMcp = performance.now();
|
|
187
|
+
let mcpConnected = false;
|
|
188
|
+
try {
|
|
189
|
+
await client.connect(transport);
|
|
190
|
+
mcpConnected = true;
|
|
191
|
+
const listed = await client.listTools();
|
|
192
|
+
const latencyMs = Math.round(performance.now() - tMcp);
|
|
193
|
+
const names = listed.tools.map((t) => t.name);
|
|
194
|
+
const missing = EXPECTED_MCP_TOOLS.filter((req) => !names.includes(req));
|
|
195
|
+
if (missing.length === 0) {
|
|
196
|
+
checks.push({
|
|
197
|
+
id: 'mcp_handshake',
|
|
198
|
+
label: 'MCP Handshake & Auth',
|
|
199
|
+
status: authMode === 'demo' ? 'warn' : 'pass',
|
|
200
|
+
latency_ms: latencyMs,
|
|
201
|
+
detail: authMode === 'bearer'
|
|
202
|
+
? `Authenticated MCP session established in ${latencyMs}ms (${names.length} tools: ${names.join(', ')}).`
|
|
203
|
+
: `Read-only demo MCP session established in ${latencyMs}ms (${names.length} tools).`,
|
|
204
|
+
...(authMode === 'demo'
|
|
205
|
+
? {
|
|
206
|
+
remediation: 'No API token supplied (running in read-only demo mode). Mint a free sandbox write key at https://caisson.tools/start and pass --token or CAISSON_API_TOKEN.',
|
|
207
|
+
}
|
|
208
|
+
: {}),
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
checks.push({
|
|
213
|
+
id: 'mcp_handshake',
|
|
214
|
+
label: 'MCP Handshake & Auth',
|
|
215
|
+
status: 'fail',
|
|
216
|
+
latency_ms: latencyMs,
|
|
217
|
+
detail: `MCP connected but missing expected tools: ${missing.join(', ')}.`,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
// 5. Optional workspace read_graph probe
|
|
221
|
+
if (opts.workspaceId) {
|
|
222
|
+
const tWs = performance.now();
|
|
223
|
+
try {
|
|
224
|
+
const callRes = await client.callTool({
|
|
225
|
+
name: 'read_graph',
|
|
226
|
+
arguments: { workspace_id: opts.workspaceId, filter: { limit: 10 } },
|
|
227
|
+
}, undefined, { timeout: timeoutMs });
|
|
228
|
+
const latencyMsWs = Math.round(performance.now() - tWs);
|
|
229
|
+
const textItem = Array.isArray(callRes.content)
|
|
230
|
+
? callRes.content.find((c) => c?.type === 'text')
|
|
231
|
+
: null;
|
|
232
|
+
const parsed = textItem && 'text' in textItem ? JSON.parse(String(textItem.text)) : null;
|
|
233
|
+
if (callRes.isError || parsed?.error) {
|
|
234
|
+
checks.push({
|
|
235
|
+
id: 'workspace_read',
|
|
236
|
+
label: `Workspace Read (${opts.workspaceId})`,
|
|
237
|
+
status: 'fail',
|
|
238
|
+
latency_ms: latencyMsWs,
|
|
239
|
+
detail: `read_graph returned error: ${parsed?.error?.code ?? 'ERROR'} — ${parsed?.error?.message ?? 'unknown error'}`,
|
|
240
|
+
remediation: 'Verify workspace_id is valid and accessible with your token.',
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
const openCnt = Array.isArray(parsed?.nodes)
|
|
245
|
+
? parsed.nodes.filter((n) => n.status === 'open').length
|
|
246
|
+
: 0;
|
|
247
|
+
const deadCnt = Array.isArray(parsed?.dead_end_summaries)
|
|
248
|
+
? parsed.dead_end_summaries.length
|
|
249
|
+
: 0;
|
|
250
|
+
checks.push({
|
|
251
|
+
id: 'workspace_read',
|
|
252
|
+
label: `Workspace Read (${opts.workspaceId})`,
|
|
253
|
+
status: 'pass',
|
|
254
|
+
latency_ms: latencyMsWs,
|
|
255
|
+
detail: `Read "${parsed?.workspace?.title ?? opts.workspaceId}" in ${latencyMsWs}ms (${openCnt} open nodes in slice, ${deadCnt} dead ends, require_precheck=${String(parsed?.workspace?.require_precheck)}).`,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
catch (err) {
|
|
260
|
+
checks.push({
|
|
261
|
+
id: 'workspace_read',
|
|
262
|
+
label: `Workspace Read (${opts.workspaceId})`,
|
|
263
|
+
status: 'fail',
|
|
264
|
+
latency_ms: Math.round(performance.now() - tWs),
|
|
265
|
+
detail: `read_graph failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
catch (err) {
|
|
271
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
272
|
+
const isAuth = /401|UNAUTHORIZED|Authentication failed/i.test(msg);
|
|
273
|
+
checks.push({
|
|
274
|
+
id: 'mcp_handshake',
|
|
275
|
+
label: 'MCP Handshake & Auth',
|
|
276
|
+
status: 'fail',
|
|
277
|
+
latency_ms: Math.round(performance.now() - tMcp),
|
|
278
|
+
detail: `MCP handshake failed: ${msg}`,
|
|
279
|
+
remediation: isAuth
|
|
280
|
+
? 'API token was rejected (HTTP 401). Check CAISSON_API_TOKEN or mint a fresh key at https://caisson.tools/start.'
|
|
281
|
+
: classifyNetworkFailure(err, endpoint.hostname),
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
finally {
|
|
285
|
+
if (mcpConnected) {
|
|
286
|
+
await Promise.allSettled([client.close(), transport.close()]);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
const ok = checks.every((c) => c.status !== 'fail');
|
|
290
|
+
return {
|
|
291
|
+
ok,
|
|
292
|
+
api_url: opts.url,
|
|
293
|
+
web_url: webUrl,
|
|
294
|
+
auth_mode: authMode,
|
|
295
|
+
platform: `${process.platform}/${process.arch}`,
|
|
296
|
+
node_version: process.version,
|
|
297
|
+
checks,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
finally {
|
|
301
|
+
await h2.close();
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
export function formatDoctorReport(report) {
|
|
305
|
+
const lines = [
|
|
306
|
+
`Caisson Doctor — ${report.ok ? 'READY' : 'ISSUES DETECTED'}`,
|
|
307
|
+
` MCP URL : ${report.api_url}`,
|
|
308
|
+
` Auth Mode : ${report.auth_mode === 'bearer' ? 'Bearer API token' : 'Read-Only Demo (no token)'}`,
|
|
309
|
+
` Runtime : Node ${report.node_version} (${report.platform})`,
|
|
310
|
+
'',
|
|
311
|
+
];
|
|
312
|
+
for (const c of report.checks) {
|
|
313
|
+
const tag = c.status.toUpperCase().padEnd(4);
|
|
314
|
+
lines.push(`[${tag}] ${c.label}: ${c.detail}`);
|
|
315
|
+
if (c.remediation) {
|
|
316
|
+
lines.push(` -> ${c.remediation}`);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return lines.join('\n');
|
|
320
|
+
}
|
|
321
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+FAA+F;AAE/F,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAA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,OAAO,CAAC,IAAI,EAAE;YAC/C,YAAY,EAAE,OAAO,CAAC,OAAO;YAC7B,MAAM;SACP,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAoB;IACrD,MAAM,KAAK,GAAG;QACZ,oBAAoB,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EAAE;QAC7D,iBAAiB,MAAM,CAAC,OAAO,EAAE;QACjC,iBAAiB,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,2BAA2B,EAAE;QACnG,sBAAsB,MAAM,CAAC,YAAY,KAAK,MAAM,CAAC,QAAQ,GAAG;QAChE,EAAE;KACH,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/cli/inviteCard.d.ts
CHANGED
|
@@ -9,4 +9,17 @@ export interface WorkspaceInviteOptions {
|
|
|
9
9
|
requirePrecheck?: boolean;
|
|
10
10
|
workspaceSlug?: string;
|
|
11
11
|
}
|
|
12
|
+
export interface ClientConfigSnippets {
|
|
13
|
+
claudeCodeCmd: string;
|
|
14
|
+
mcpJson: string;
|
|
15
|
+
windowsProxyJson: string;
|
|
16
|
+
codexToml: string;
|
|
17
|
+
doctorCmd: string;
|
|
18
|
+
cloudSandboxEgressHosts: string[];
|
|
19
|
+
humanGoAheadPrompt: string;
|
|
20
|
+
taskPrompt: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function buildHumanGoAheadPrompt(workspaceId: string, apiUrl?: string): string;
|
|
23
|
+
export declare function buildWorkspaceTaskPrompt(opts: WorkspaceInviteOptions): string;
|
|
24
|
+
export declare function buildClientConfigSnippets(opts: WorkspaceInviteOptions): ClientConfigSnippets;
|
|
12
25
|
export declare function formatWorkspaceInviteCard(opts: WorkspaceInviteOptions): string;
|
package/dist/cli/inviteCard.js
CHANGED
|
@@ -1,7 +1,36 @@
|
|
|
1
1
|
// src/cli/inviteCard.ts
|
|
2
|
-
// Zero-injection Pasteable Workspace Invite Card generator (Doc 07 §4.4).
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
// Zero-injection Pasteable Workspace Invite Card generator (Doc 07 §4.4, Epic 7 OB-2/OB-4).
|
|
3
|
+
// Incorporates live E0-6 field insights:
|
|
4
|
+
// 1. Short 1-line human go-ahead prompt alongside the invite card (satisfies agent auto-mode guards)
|
|
5
|
+
// 2. Explicit cloud-sandbox egress allowlist callout (`api.caisson.tools`)
|
|
6
|
+
// 3. Unscoped npm package name (`npx -y caisson-cli ...`) + Windows HTTP/2 stdio bridge (`proxy`)
|
|
7
|
+
export function buildHumanGoAheadPrompt(workspaceId, apiUrl = 'https://api.caisson.tools/mcp') {
|
|
8
|
+
return `Yes — use the Caisson API token I shared, connect to ${apiUrl}, and work on workspace ${workspaceId}.`;
|
|
9
|
+
}
|
|
10
|
+
export function buildWorkspaceTaskPrompt(opts) {
|
|
11
|
+
const isMath = Boolean(opts.domainPackRef && opts.domainPackRef.startsWith('math-lean4'));
|
|
12
|
+
const requirePrecheck = opts.requirePrecheck ?? isMath;
|
|
13
|
+
if (opts.workspaceId === 'ws_quickstart') {
|
|
14
|
+
return `Connect to the caisson MCP server and inspect workspace ws_quickstart using read_graph(workspace_id="ws_quickstart", filter={"statuses": ["open", "verified"], "include_payloads": true}). First call query_cache(query="normalizeKey slug deduper", workspace_id="ws_quickstart") to inspect the pre-seeded verified helper artifact and dead-end warning. Claim an open Implementation node with claim_node, reuse the verified helper (citing its artifact_id in derived_from), and submit your TypeScript file via submit_artifact with base_git_sha (wait_timeout_seconds=30). If blocked, call log_dead_end with release_lease=true.`;
|
|
15
|
+
}
|
|
16
|
+
if (isMath && requirePrecheck) {
|
|
17
|
+
return `Connect to the caisson MCP server and inspect workspace ${opts.workspaceId} using read_graph(workspace_id="${opts.workspaceId}", filter={"statuses": ["open"]}). Before attempting any proof, call query_cache for relevant verified lemmas and dead ends under ${opts.environmentVersion}. Pick one audited open node, call claim_node, prove it locally using npx -y -p caisson-cli caisson-lean precheck --file <path>, and submit via submit_artifact with precheck_proof and derived_from. If an approach fails after real investigation, call log_dead_end with release_lease=true and move to another open node.`;
|
|
18
|
+
}
|
|
19
|
+
if (isMath && !requirePrecheck) {
|
|
20
|
+
return `Connect to the caisson MCP server and inspect workspace ${opts.workspaceId} using read_graph(workspace_id="${opts.workspaceId}", filter={"statuses": ["open"], "include_payloads": true}). No local Lean installation is required — the server runs isolated Lean 4 + Mathlib compilation and kernel replay for you. First call query_cache to inspect verified lemmas and dead ends under ${opts.environmentVersion}. Claim one open node with claim_node (this returns the exact frozen Lean target in node_spec.spec_content), write a complete sorry-free Lean proof, and submit via submit_artifact with derived_from listing any reused artifact_ids (set wait_timeout_seconds=0 and poll read_graph for the result; if compilation fails, read verifier_result.logs, fix the proof while holding your lease, and resubmit). If genuinely blocked, call log_dead_end with release_lease=true.`;
|
|
21
|
+
}
|
|
22
|
+
return `Connect to the caisson MCP server and inspect workspace ${opts.workspaceId} using read_graph(workspace_id="${opts.workspaceId}", filter={"statuses": ["open"]}) to note git_head_sha and locate an open Implementation node with a verified SpecAndTests parent. Call query_cache first to review verified prior work and dead ends, then call claim_node on one open node. Implement the feature locally (never modifying protected paths: src/auth/, src/worker/, verifiers/, workspace.yaml, spec/), verify with npm run typecheck && npm test, and submit via submit_artifact with base_git_sha so the BYOV verifier merges verified commits to staging. If blocked, call log_dead_end with release_lease=true.`;
|
|
23
|
+
}
|
|
24
|
+
export function buildClientConfigSnippets(opts) {
|
|
25
|
+
let apiHost = 'api.caisson.tools';
|
|
26
|
+
try {
|
|
27
|
+
apiHost = new URL(opts.apiUrl).hostname;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
apiHost = 'api.caisson.tools';
|
|
31
|
+
}
|
|
32
|
+
const egressHosts = Array.from(new Set([apiHost, 'caisson.tools']));
|
|
33
|
+
const mcpJson = JSON.stringify({
|
|
5
34
|
mcpServers: {
|
|
6
35
|
caisson: {
|
|
7
36
|
type: 'streamable-http',
|
|
@@ -12,18 +41,42 @@ export function formatWorkspaceInviteCard(opts) {
|
|
|
12
41
|
},
|
|
13
42
|
},
|
|
14
43
|
}, null, 2);
|
|
44
|
+
const windowsProxyJson = JSON.stringify({
|
|
45
|
+
mcpServers: {
|
|
46
|
+
caisson: {
|
|
47
|
+
command: 'npx',
|
|
48
|
+
args: ['-y', 'caisson-cli', 'proxy', '--url', opts.apiUrl],
|
|
49
|
+
env: {
|
|
50
|
+
CAISSON_API_TOKEN: opts.token,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
}, null, 2);
|
|
55
|
+
const codexToml = [
|
|
56
|
+
'[mcp_servers.caisson]',
|
|
57
|
+
`url = "${opts.apiUrl}"`,
|
|
58
|
+
`bearer_token_env_var = "CAISSON_API_TOKEN"`,
|
|
59
|
+
`# Export CAISSON_API_TOKEN="${opts.token}" in your shell, or on Windows use:`,
|
|
60
|
+
`# command = "npx"`,
|
|
61
|
+
`# args = ["-y", "caisson-cli", "proxy", "--url", "${opts.apiUrl}"]`,
|
|
62
|
+
].join('\n');
|
|
63
|
+
const claudeCodeCmd = `claude mcp add --transport http caisson ${opts.apiUrl} --header "Authorization: Bearer ${opts.token}"`;
|
|
64
|
+
const doctorCmd = `npx -y caisson-cli doctor --url ${opts.apiUrl} --token ${opts.token} --workspace ${opts.workspaceId}`;
|
|
65
|
+
return {
|
|
66
|
+
claudeCodeCmd,
|
|
67
|
+
mcpJson,
|
|
68
|
+
windowsProxyJson,
|
|
69
|
+
codexToml,
|
|
70
|
+
doctorCmd,
|
|
71
|
+
cloudSandboxEgressHosts: egressHosts,
|
|
72
|
+
humanGoAheadPrompt: buildHumanGoAheadPrompt(opts.workspaceId, opts.apiUrl),
|
|
73
|
+
taskPrompt: buildWorkspaceTaskPrompt(opts),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export function formatWorkspaceInviteCard(opts) {
|
|
15
77
|
const isMath = Boolean(opts.domainPackRef && opts.domainPackRef.startsWith('math-lean4'));
|
|
16
78
|
const requirePrecheck = opts.requirePrecheck ?? isMath;
|
|
17
|
-
|
|
18
|
-
if (isMath && requirePrecheck) {
|
|
19
|
-
taskPrompt = `Connect to the caisson MCP server and inspect workspace ${opts.workspaceId} using read_graph(workspace_id="${opts.workspaceId}", filter={"statuses": ["open"]}). Before attempting any proof, call query_cache for relevant verified lemmas and dead ends under ${opts.environmentVersion}. Pick one audited open node, call claim_node, prove it locally using npx caisson-lean precheck --file <path>, and submit via submit_artifact with precheck_proof and derived_from. If an approach fails after real investigation, call log_dead_end with release_lease=true and move to another open node.`;
|
|
20
|
-
}
|
|
21
|
-
else if (isMath && !requirePrecheck) {
|
|
22
|
-
taskPrompt = `Connect to the caisson MCP server and inspect workspace ${opts.workspaceId} using read_graph(workspace_id="${opts.workspaceId}", filter={"statuses": ["open"], "include_payloads": true}). No local Lean installation is required — the server runs isolated Lean 4 + Mathlib compilation and kernel replay for you. First call query_cache to inspect verified lemmas and dead ends under ${opts.environmentVersion}. Claim one open node with claim_node (this returns the exact frozen Lean target in node_spec.spec_content), write a complete sorry-free Lean proof, and submit via submit_artifact with derived_from listing any reused artifact_ids (set wait_timeout_seconds=0 and poll read_graph for the result; if compilation fails, read verifier_result.logs, fix the proof while holding your lease, and resubmit). If genuinely blocked, call log_dead_end with release_lease=true.`;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
taskPrompt = `Connect to the caisson MCP server and inspect workspace ${opts.workspaceId} using read_graph(workspace_id="${opts.workspaceId}", filter={"statuses": ["open"]}) to note git_head_sha and locate an open Implementation node with a verified SpecAndTests parent. Call query_cache first to review verified prior work and dead ends, then call claim_node on one open node. Implement the feature locally (never modifying protected paths: src/auth/, src/worker/, verifiers/, workspace.yaml, spec/), verify with npm run typecheck && npm test, and submit via submit_artifact with base_git_sha so the BYOV verifier merges verified commits to staging. If blocked, call log_dead_end with release_lease=true.`;
|
|
26
|
-
}
|
|
79
|
+
const snippets = buildClientConfigSnippets(opts);
|
|
27
80
|
const lines = [
|
|
28
81
|
`### Caisson Workspace Invite — \`${opts.workspaceTitle}\``,
|
|
29
82
|
'',
|
|
@@ -31,17 +84,26 @@ export function formatWorkspaceInviteCard(opts) {
|
|
|
31
84
|
'',
|
|
32
85
|
'- **Claude Code (1 command):**',
|
|
33
86
|
'```bash',
|
|
34
|
-
|
|
87
|
+
snippets.claudeCodeCmd,
|
|
35
88
|
'```',
|
|
36
|
-
|
|
89
|
+
`- **Generic MCP JSON** (Cursor, Antigravity, Windsurf, or \`npx -y caisson-cli config --url ${opts.apiUrl} --token <SCOPED_TOKEN>\`):`,
|
|
37
90
|
'```json',
|
|
38
|
-
|
|
91
|
+
snippets.mcpJson,
|
|
39
92
|
'```',
|
|
93
|
+
'- **Windows / Enterprise TLS (`npx -y caisson-cli proxy` HTTP/2 stdio bridge):**',
|
|
94
|
+
'```json',
|
|
95
|
+
snippets.windowsProxyJson,
|
|
96
|
+
'```',
|
|
97
|
+
`- **Cloud Sandboxes (Claude Web, remote agents):** Add \`${snippets.cloudSandboxEgressHosts.join('` and `')}\` to your sandbox environment's allowed egress hosts before connecting.`,
|
|
98
|
+
`- **Self-Test Connectivity:** \`${snippets.doctorCmd}\``,
|
|
99
|
+
'',
|
|
100
|
+
'**2. Send this 1-line human go-ahead message alongside the invite** *(prevents auto-mode prompt-injection guards from pausing)*:',
|
|
101
|
+
`> ${snippets.humanGoAheadPrompt}`,
|
|
40
102
|
'',
|
|
41
|
-
'**
|
|
42
|
-
`> ${taskPrompt}`,
|
|
103
|
+
'**3. Paste this task prompt to your agent:**',
|
|
104
|
+
`> ${snippets.taskPrompt}`,
|
|
43
105
|
'',
|
|
44
|
-
'**
|
|
106
|
+
'**4. Privacy & Data Terms:** Your local prompts, harness code, and failed local attempts stay on your machine. Only submitted artifacts and logged dead ends leave your environment (public workspace contributions are Apache-2.0; private workspaces are never used for training datasets without explicit opt-in).',
|
|
45
107
|
'',
|
|
46
108
|
];
|
|
47
109
|
return lines.join('\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inviteCard.js","sourceRoot":"","sources":["../../src/cli/inviteCard.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"inviteCard.js","sourceRoot":"","sources":["../../src/cli/inviteCard.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,4FAA4F;AAC5F,yCAAyC;AACzC,uGAAuG;AACvG,6EAA6E;AAC7E,oGAAoG;AAyBpG,MAAM,UAAU,uBAAuB,CAAC,WAAmB,EAAE,MAAM,GAAG,+BAA+B;IACnG,OAAO,wDAAwD,MAAM,2BAA2B,WAAW,GAAG,CAAC;AACjH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAA4B;IACnE,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IAC1F,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,IAAI,MAAM,CAAC;IAEvD,IAAI,IAAI,CAAC,WAAW,KA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AI;QAC3D,EAAE;QACF,6EAA6E,MAAM,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,EAAE,IAAI;QACpJ,EAAE;QACF,gCAAgC;QAChC,SAAS;QACT,QAAQ,CAAC,aAAa;QACtB,KAAK;QACL,+FAA+F,IAAI,CAAC,MAAM,6BAA6B;QACvI,SAAS;QACT,QAAQ,CAAC,OAAO;QAChB,KAAK;QACL,kFAAkF;QAClF,SAAS;QACT,QAAQ,CAAC,gBAAgB;QACzB,KAAK;QACL,4DAA4D,QAAQ,CAAC,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,0EAA0E;QACtL,mCAAmC,QAAQ,CAAC,SAAS,IAAI;QACzD,EAAE;QACF,kIAAkI;QAClI,KAAK,QAAQ,CAAC,kBAAkB,EAAE;QAClC,EAAE;QACF,8CAA8C;QAC9C,KAAK,QAAQ,CAAC,UAAU,EAAE;QAC1B,EAAE;QACF,uTAAuT;QACvT,EAAE;KACH,CAAC;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/mcp/handlers.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare class SwarmToolHandlers {
|
|
|
9
9
|
private readonly blobs?;
|
|
10
10
|
private readonly packRegistry;
|
|
11
11
|
constructor(db: Database.Database, git: BareGitStore, blobs?: ContentAddressedBlobStore | undefined, packRegistry?: DomainPackRegistry);
|
|
12
|
+
private assertWritableAgent;
|
|
12
13
|
private checkHourlyQuota;
|
|
13
14
|
/** 1. read_graph */
|
|
14
15
|
readGraph(rawInput: unknown, agent: AgentContext): {
|
|
@@ -47,6 +48,7 @@ export declare class SwarmToolHandlers {
|
|
|
47
48
|
}[];
|
|
48
49
|
edges: any[];
|
|
49
50
|
dead_end_summaries: {
|
|
51
|
+
superseded?: boolean | undefined;
|
|
50
52
|
artifact_id: any;
|
|
51
53
|
node_id: any;
|
|
52
54
|
approach_summary: any;
|