pico-engine 1.9.4 → 1.10.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 +13 -5
- package/demos/bootstrap/README.md +12 -0
- package/demos/bootstrap/com.example.visitors.bootstrap.krl +101 -0
- package/demos/bootstrap/com.example.visitors.format.krl +25 -0
- package/demos/bootstrap/com.example.visitors.krl +228 -0
- package/demos/bootstrap/try-it.md +5 -0
- package/demos/child_tasks/README.md +12 -0
- package/demos/child_tasks/com.example.task_runner.bootstrap.krl +88 -0
- package/demos/child_tasks/com.example.task_runner.krl +139 -0
- package/demos/child_tasks/com.example.task_worker.krl +45 -0
- package/demos/child_tasks/try-it.md +5 -0
- package/demos/collection/README.md +13 -0
- package/demos/collection/com.example.collection.bootstrap.krl +148 -0
- package/demos/collection/com.example.collection.krl +95 -0
- package/demos/collection/com.example.collection.report.krl +93 -0
- package/demos/collection/com.example.collection.room.krl +101 -0
- package/demos/collection/try-it.md +6 -0
- package/demos/echo/README.md +11 -0
- package/demos/echo/com.example.echo.bootstrap.krl +84 -0
- package/demos/echo/com.example.echo.krl +73 -0
- package/demos/echo/try-it.md +5 -0
- package/demos/guard_rules/README.md +12 -0
- package/demos/guard_rules/com.example.archive.bootstrap.krl +98 -0
- package/demos/guard_rules/com.example.archive.krl +213 -0
- package/demos/guard_rules/com.example.archive_store.krl +36 -0
- package/demos/guard_rules/try-it.md +5 -0
- package/demos/json_query/README.md +11 -0
- package/demos/json_query/com.example.json_query.bootstrap.krl +84 -0
- package/demos/json_query/com.example.json_query.krl +162 -0
- package/demos/json_query/try-it.md +5 -0
- package/demos/kblog/README.md +14 -0
- package/demos/kblog/com.example.kblog.bootstrap.krl +135 -0
- package/demos/kblog/com.example.kblog.config.krl +50 -0
- package/demos/kblog/com.example.kblog.data.krl +75 -0
- package/demos/kblog/com.example.kblog.krl +184 -0
- package/demos/kblog/com.example.kblog.posting.krl +109 -0
- package/demos/kblog/try-it.md +6 -0
- package/demos/layered_rulesets/README.md +13 -0
- package/demos/layered_rulesets/com.example.invitations.bootstrap.krl +87 -0
- package/demos/layered_rulesets/com.example.invitations.krl +164 -0
- package/demos/layered_rulesets/com.example.invitations.short_links.krl +45 -0
- package/demos/layered_rulesets/com.example.invitations.welcome.krl +39 -0
- package/demos/layered_rulesets/try-it.md +5 -0
- package/demos/moving_picos/README.md +15 -0
- package/demos/moving_picos/io.picolabs.club_gear_demo.krl +650 -0
- package/demos/moving_picos/io.picolabs.ride_coordinator_demo.krl +331 -0
- package/demos/score_tracker/README.md +11 -0
- package/demos/score_tracker/com.example.score_tracker.bootstrap.krl +107 -0
- package/demos/score_tracker/com.example.score_tracker.krl +162 -0
- package/demos/score_tracker/try-it.md +5 -0
- package/demos/secrets/README.md +12 -0
- package/demos/secrets/com.example.hook_service.krl +120 -0
- package/demos/secrets/com.example.notifier.bootstrap.krl +130 -0
- package/demos/secrets/com.example.notifier.krl +138 -0
- package/demos/secrets/try-it.md +5 -0
- package/demos/try-it-order.json +1 -0
- package/demos/two_picos/README.md +12 -0
- package/demos/two_picos/com.example.two_picos.answerer.krl +125 -0
- package/demos/two_picos/com.example.two_picos.asker.krl +124 -0
- package/demos/two_picos/com.example.two_picos.bootstrap.krl +134 -0
- package/demos/two_picos/try-it.md +5 -0
- package/demos/xmlui/README.md +17 -0
- package/demos/xmlui/com.example.contacts.krl +132 -0
- package/demos/xmlui/com.example.fav_color.krl +39 -0
- package/demos/xmlui/com.example.guestbook.krl +61 -0
- package/demos/xmlui/com.example.hello.krl +19 -0
- package/demos/xmlui/com.example.temperature_sensors_view.krl +105 -0
- package/demos/xmlui/com.example.thermostat.bootstrap.krl +95 -0
- package/demos/xmlui/com.example.thermostat.krl +124 -0
- package/demos/xmlui/temperature_sensors.krl +56 -0
- package/demos/xmlui/try-it.md +5 -0
- package/dist/bundledKrl.js +97 -12
- package/dist/cli.js +7 -1
- package/dist/engineConfig.js +20 -1
- package/dist/identity/portableMove.js +5 -1
- package/dist/index.js +45 -12
- package/dist/internalAccess.js +110 -0
- package/dist/oauth/OAuthService.js +172 -10
- package/dist/oauth/acg.js +194 -24
- package/dist/oauth/cimd.js +381 -0
- package/dist/oauth/discovery.js +175 -0
- package/dist/runMcp.js +1 -1
- package/dist/server.js +210 -47
- package/dist/subtreeWrangler.js +8 -5
- package/dist/uiChannelPolicies.js +2 -0
- package/krl/io.picolabs.pds.krl +109 -21
- package/krl/io.picolabs.pico-engine-ui.krl +13 -7
- package/krl/io.picolabs.wrangler.krl +21 -9
- package/krl/io.picolabs.xmlui.krl +3 -2
- package/mcp/devResources.js +52 -0
- package/mcp/devTools.js +40 -9
- package/mcp/docs/CLAUDE.md +6 -4
- package/mcp/docs/cookbook/README.md +23 -0
- package/mcp/docs/cookbook/bootstrap/README.md +23 -0
- package/mcp/docs/cookbook/bootstrap/instructions.md +75 -0
- package/mcp/docs/cookbook/child_tasks/README.md +20 -0
- package/mcp/docs/cookbook/child_tasks/instructions.md +60 -0
- package/mcp/docs/cookbook/collection/README.md +21 -0
- package/mcp/docs/cookbook/collection/instructions.md +93 -0
- package/mcp/docs/cookbook/echo/README.md +19 -0
- package/mcp/docs/cookbook/echo/instructions.md +59 -0
- package/mcp/docs/cookbook/guard_rules/README.md +22 -0
- package/mcp/docs/cookbook/guard_rules/instructions.md +73 -0
- package/mcp/docs/cookbook/json_query/README.md +26 -0
- package/mcp/docs/cookbook/json_query/instructions.md +64 -0
- package/mcp/docs/cookbook/kblog/README.md +60 -0
- package/mcp/docs/cookbook/kblog/instructions.md +102 -0
- package/mcp/docs/cookbook/layered_rulesets/README.md +24 -0
- package/mcp/docs/cookbook/layered_rulesets/instructions.md +87 -0
- package/mcp/docs/cookbook/moving_picos/README.md +44 -0
- package/mcp/docs/cookbook/moving_picos/instructions.md +150 -0
- package/mcp/docs/cookbook/score_tracker/README.md +19 -0
- package/mcp/docs/cookbook/score_tracker/instructions.md +73 -0
- package/mcp/docs/cookbook/secrets/README.md +25 -0
- package/mcp/docs/cookbook/secrets/instructions.md +98 -0
- package/mcp/docs/cookbook/two_picos/README.md +20 -0
- package/mcp/docs/cookbook/two_picos/instructions.md +88 -0
- package/mcp/docs/cookbook/xmlui/README.md +23 -0
- package/mcp/docs/cookbook/xmlui/instructions.md +84 -0
- package/mcp/docs/developing/README.md +28 -0
- package/mcp/docs/developing/accepting-relationship-requests.md +65 -0
- package/mcp/docs/developing/arrays-and-maps.md +77 -0
- package/mcp/docs/developing/converting-time-formats.md +28 -0
- package/mcp/docs/developing/cookies-and-redirects.md +81 -0
- package/mcp/docs/developing/decoding-form-data.md +67 -0
- package/mcp/docs/developing/engine-log-files.md +34 -0
- package/mcp/docs/developing/event-loop.md +77 -0
- package/mcp/docs/developing/events-from-email.md +80 -0
- package/mcp/docs/developing/initializing-entity-variables.md +83 -0
- package/mcp/docs/developing/mcp-ai-tools.md +98 -0
- package/mcp/docs/developing/misconceptions.md +467 -0
- package/mcp/docs/developing/names-and-scope.md +44 -0
- package/mcp/docs/developing/postman.md +159 -0
- package/mcp/docs/developing/querying-another-pico.md +47 -0
- package/mcp/docs/developing/singleton-picos.md +36 -0
- package/mcp/docs/developing/tabular-data.md +67 -0
- package/mcp/docs/developing/tips.md +251 -0
- package/mcp/docs/developing/webhook-signatures.md +56 -0
- package/mcp/docs/developing/workflow.md +106 -0
- package/mcp/docs/exp/README.md +46 -0
- package/mcp/docs/exp/event.md +110 -0
- package/mcp/docs/exp/query.md +94 -0
- package/mcp/docs/lessons/README.md +59 -0
- package/mcp/docs/lessons/events-and-queries.md +247 -0
- package/mcp/docs/lessons/gossip.md +28 -0
- package/mcp/docs/lessons/modules-and-apis.md +270 -0
- package/mcp/docs/lessons/pico-based-systems.md +470 -0
- package/mcp/docs/lessons/pico-state.md +267 -0
- package/mcp/docs/lessons/pico-views.md +290 -0
- package/mcp/docs/lessons/quickstart.md +157 -0
- package/mcp/docs/lessons/relationships.md +530 -0
- package/mcp/docs/lessons/scatter-gather.md +362 -0
- package/mcp/docs/pico-engine.md +10 -5
- package/mcp/docs/pico-overview.md +3 -3
- package/mcp/docs/wrangler/README.md +47 -0
- package/mcp/docs/wrangler/channels.md +235 -0
- package/mcp/docs/wrangler/oauth.md +56 -0
- package/mcp/docs/wrangler/pds.md +423 -0
- package/mcp/docs/wrangler/portable-subtree.md +44 -0
- package/mcp/docs/wrangler/relationships.md +297 -0
- package/mcp/docs/wrangler/wrangler.md +253 -0
- package/mcp/docs/wrangler/xmlui.md +60 -0
- package/mcp/engineClient.js +57 -5
- package/mcp/mcpScopes.js +118 -0
- package/mcp/meshHttp.js +151 -45
- package/mcp/runStdio.js +2 -0
- package/mcp/subtreeTools.js +184 -0
- package/mcp/tryItTools.js +202 -0
- package/package.json +18 -9
- package/public/.DS_Store +0 -0
- package/public/pico-engine-ui.css +1 -1
- package/public/pico-engine-ui.js +26 -25
- package/src/bundledKrl.ts +118 -12
- package/src/cli.ts +8 -2
- package/src/engineConfig.ts +33 -2
- package/src/identity/portableMove.ts +6 -1
- package/src/index.ts +469 -422
- package/src/internalAccess.ts +127 -0
- package/src/oauth/OAuthService.ts +243 -11
- package/src/oauth/acg.ts +289 -25
- package/src/oauth/cimd.ts +508 -0
- package/src/oauth/discovery.ts +233 -0
- package/src/runMcp.ts +3 -1
- package/src/server.ts +266 -51
- package/src/subtreeWrangler.ts +17 -5
- package/src/uiChannelPolicies.ts +2 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { OAuthError } from "./errors";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MCP authorization discovery (1.10 §2).
|
|
5
|
+
*
|
|
6
|
+
* RFC 9728 protected-resource metadata, RFC 8414 authorization-server
|
|
7
|
+
* metadata, and the RFC 6750 challenge on `/mcp/:eci`. Scope names are the
|
|
8
|
+
* ones enforced on `/mcp/{eci}` and `/mcp/mesh/{eci}`.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const MCP_SCOPES = ["mesh:read", "mesh:act", "mesh:admin"] as const;
|
|
12
|
+
|
|
13
|
+
/** Scopes a channel MCP client holds when it does not ask for a narrower set. */
|
|
14
|
+
export const MCP_CHANNEL_SCOPE = "mesh:read mesh:act";
|
|
15
|
+
|
|
16
|
+
export function parseScopeList(scope: string | undefined): string[] {
|
|
17
|
+
return [...new Set(String(scope || "").split(/\s+/).filter(Boolean))];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Every name must be an advertised MCP scope. */
|
|
21
|
+
export function assertMcpScopes(scope: string): string {
|
|
22
|
+
const names = parseScopeList(scope);
|
|
23
|
+
if (names.length === 0) {
|
|
24
|
+
throw new OAuthError("Missing scope", "invalid_scope", 400);
|
|
25
|
+
}
|
|
26
|
+
for (const name of names) {
|
|
27
|
+
if (!(MCP_SCOPES as readonly string[]).includes(name)) {
|
|
28
|
+
throw new OAuthError(`Unknown scope: ${name}`, "invalid_scope", 400);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return names.join(" ");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function scopeIncludes(scope: string | undefined, required: string): boolean {
|
|
35
|
+
return parseScopeList(scope).includes(required);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const GRANT_TYPES_SUPPORTED = [
|
|
39
|
+
"authorization_code",
|
|
40
|
+
"refresh_token",
|
|
41
|
+
"client_credentials",
|
|
42
|
+
] as const;
|
|
43
|
+
|
|
44
|
+
export interface AuthorizationServerMetadata {
|
|
45
|
+
issuer: string;
|
|
46
|
+
authorization_endpoint: string;
|
|
47
|
+
token_endpoint: string;
|
|
48
|
+
response_types_supported: ["code"];
|
|
49
|
+
grant_types_supported: string[];
|
|
50
|
+
code_challenge_methods_supported: ["S256"];
|
|
51
|
+
scopes_supported: string[];
|
|
52
|
+
/**
|
|
53
|
+
* Public clients (CIMD, PKCE, no secret) use "none". A confidential app
|
|
54
|
+
* sends its secret in the token request body. RFC 8414 treats an omitted
|
|
55
|
+
* list as client_secret_basic, which makes Claude skip CIMD.
|
|
56
|
+
*/
|
|
57
|
+
token_endpoint_auth_methods_supported: ["none", "client_secret_post"];
|
|
58
|
+
/** A client_id that is an https URL is fetched as a Client ID Metadata Document. */
|
|
59
|
+
client_id_metadata_document_supported: true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ProtectedResourceMetadata {
|
|
63
|
+
resource: string;
|
|
64
|
+
authorization_servers: string[];
|
|
65
|
+
scopes_supported: string[];
|
|
66
|
+
bearer_methods_supported: ["header"];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type McpResourceSurface = "channel" | "mesh";
|
|
70
|
+
|
|
71
|
+
/** Configured public origin, else the request's own origin. No trailing slash. */
|
|
72
|
+
export function canonicalBaseUrl(
|
|
73
|
+
configured: string | undefined,
|
|
74
|
+
req?: { protocol?: string; get?(name: string): string | undefined }
|
|
75
|
+
): string {
|
|
76
|
+
const fromConfig = configured && configured.trim();
|
|
77
|
+
const raw =
|
|
78
|
+
fromConfig ||
|
|
79
|
+
(req && req.protocol
|
|
80
|
+
? `${req.protocol}://${(req.get && req.get("host")) || "localhost"}`
|
|
81
|
+
: "");
|
|
82
|
+
return raw.replace(/\/$/, "");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function authorizationServerMetadata(
|
|
86
|
+
baseUrl: string,
|
|
87
|
+
issuerUrl?: string
|
|
88
|
+
): AuthorizationServerMetadata {
|
|
89
|
+
const origin = canonicalBaseUrl(baseUrl);
|
|
90
|
+
const issuer = canonicalBaseUrl(issuerUrl || origin);
|
|
91
|
+
return {
|
|
92
|
+
issuer,
|
|
93
|
+
authorization_endpoint: `${origin}/oauth/authorize`,
|
|
94
|
+
token_endpoint: `${origin}/oauth/token`,
|
|
95
|
+
response_types_supported: ["code"],
|
|
96
|
+
grant_types_supported: [...GRANT_TYPES_SUPPORTED],
|
|
97
|
+
code_challenge_methods_supported: ["S256"],
|
|
98
|
+
scopes_supported: [...MCP_SCOPES],
|
|
99
|
+
token_endpoint_auth_methods_supported: ["none", "client_secret_post"],
|
|
100
|
+
client_id_metadata_document_supported: true,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function eciPath(eci: string): string {
|
|
105
|
+
return encodeURIComponent(eci);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Audience for Sky routes. A token for an MCP URL is not a Sky token. */
|
|
109
|
+
export function skyResourceUrl(baseUrl: string): string {
|
|
110
|
+
return `${canonicalBaseUrl(baseUrl)}/sky`;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** The MCP URL recorded on a token issued for that endpoint. */
|
|
114
|
+
export function mcpResourceUrl(
|
|
115
|
+
baseUrl: string,
|
|
116
|
+
eci: string,
|
|
117
|
+
surface: McpResourceSurface
|
|
118
|
+
): string {
|
|
119
|
+
const origin = canonicalBaseUrl(baseUrl);
|
|
120
|
+
const id = eciPath(eci);
|
|
121
|
+
return surface === "mesh" ? `${origin}/mcp/mesh/${id}` : `${origin}/mcp/${id}`;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** RFC 9728: insert `/.well-known/oauth-protected-resource` before the resource path. */
|
|
125
|
+
export function protectedResourceMetadataUrl(
|
|
126
|
+
baseUrl: string,
|
|
127
|
+
eci: string,
|
|
128
|
+
surface: McpResourceSurface
|
|
129
|
+
): string {
|
|
130
|
+
const origin = canonicalBaseUrl(baseUrl);
|
|
131
|
+
const id = eciPath(eci);
|
|
132
|
+
return surface === "mesh"
|
|
133
|
+
? `${origin}/.well-known/oauth-protected-resource/mcp/mesh/${id}`
|
|
134
|
+
: `${origin}/.well-known/oauth-protected-resource/mcp/${id}`;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function protectedResourceMetadata(
|
|
138
|
+
baseUrl: string,
|
|
139
|
+
eci: string,
|
|
140
|
+
surface: McpResourceSurface
|
|
141
|
+
): ProtectedResourceMetadata {
|
|
142
|
+
return {
|
|
143
|
+
resource: mcpResourceUrl(baseUrl, eci, surface),
|
|
144
|
+
authorization_servers: [canonicalBaseUrl(baseUrl)],
|
|
145
|
+
scopes_supported: [...MCP_SCOPES],
|
|
146
|
+
bearer_methods_supported: ["header"],
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function quoteAuthParam(value: string): string {
|
|
151
|
+
return `"${value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* `WWW-Authenticate` for a missing or rejected bearer token.
|
|
156
|
+
* `error` is set only when a token was presented and refused (RFC 6750).
|
|
157
|
+
*/
|
|
158
|
+
export function bearerChallengeHeader(
|
|
159
|
+
resourceMetadataUrl: string,
|
|
160
|
+
scope: string,
|
|
161
|
+
error?: "invalid_token" | "insufficient_scope"
|
|
162
|
+
): string {
|
|
163
|
+
const parts = [
|
|
164
|
+
`resource_metadata=${quoteAuthParam(resourceMetadataUrl)}`,
|
|
165
|
+
`scope=${quoteAuthParam(scope)}`,
|
|
166
|
+
];
|
|
167
|
+
if (error) {
|
|
168
|
+
parts.push(`error=${quoteAuthParam(error)}`);
|
|
169
|
+
}
|
|
170
|
+
return `Bearer ${parts.join(", ")}`;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export type ResourceTarget =
|
|
174
|
+
| { kind: "sky" }
|
|
175
|
+
| { kind: "mcp"; surface: McpResourceSurface; eci: string };
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* RFC 8707 resource indicator. The absolute URI must be this engine's Sky
|
|
179
|
+
* audience or one of its MCP URLs, with no query, fragment, or userinfo.
|
|
180
|
+
*/
|
|
181
|
+
export function classifyResource(baseUrl: string, resource: string): ResourceTarget {
|
|
182
|
+
const origin = canonicalBaseUrl(baseUrl);
|
|
183
|
+
if (!origin) {
|
|
184
|
+
throw new OAuthError("Engine base URL is not configured", "invalid_target", 400);
|
|
185
|
+
}
|
|
186
|
+
let url: URL;
|
|
187
|
+
try {
|
|
188
|
+
url = new URL(resource);
|
|
189
|
+
} catch {
|
|
190
|
+
throw new OAuthError("Invalid resource", "invalid_target", 400);
|
|
191
|
+
}
|
|
192
|
+
if (
|
|
193
|
+
url.origin !== origin ||
|
|
194
|
+
url.search ||
|
|
195
|
+
url.hash ||
|
|
196
|
+
url.username ||
|
|
197
|
+
url.password
|
|
198
|
+
) {
|
|
199
|
+
throw new OAuthError("Invalid resource", "invalid_target", 400);
|
|
200
|
+
}
|
|
201
|
+
if (url.pathname === "/sky") {
|
|
202
|
+
return { kind: "sky" };
|
|
203
|
+
}
|
|
204
|
+
const mesh = /^\/mcp\/mesh\/([^/]+)$/.exec(url.pathname);
|
|
205
|
+
if (mesh) {
|
|
206
|
+
return { kind: "mcp", surface: "mesh", eci: decodeResourceEci(mesh[1]) };
|
|
207
|
+
}
|
|
208
|
+
const channel = /^\/mcp\/([^/]+)$/.exec(url.pathname);
|
|
209
|
+
if (channel) {
|
|
210
|
+
return { kind: "mcp", surface: "channel", eci: decodeResourceEci(channel[1]) };
|
|
211
|
+
}
|
|
212
|
+
throw new OAuthError("Invalid resource", "invalid_target", 400);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export function canonicalResourceUrl(baseUrl: string, target: ResourceTarget): string {
|
|
216
|
+
if (target.kind === "sky") {
|
|
217
|
+
return skyResourceUrl(baseUrl);
|
|
218
|
+
}
|
|
219
|
+
return mcpResourceUrl(baseUrl, target.eci, target.surface);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function decodeResourceEci(segment: string): string {
|
|
223
|
+
let eci: string;
|
|
224
|
+
try {
|
|
225
|
+
eci = decodeURIComponent(segment);
|
|
226
|
+
} catch {
|
|
227
|
+
throw new OAuthError("Invalid resource", "invalid_target", 400);
|
|
228
|
+
}
|
|
229
|
+
if (!eci) {
|
|
230
|
+
throw new OAuthError("Invalid resource", "invalid_target", 400);
|
|
231
|
+
}
|
|
232
|
+
return eci;
|
|
233
|
+
}
|
package/src/runMcp.ts
CHANGED
|
@@ -19,7 +19,9 @@ export async function runMcpCli(argv: string[]): Promise<void> {
|
|
|
19
19
|
console.error("Usage: pico-engine mcp --stdio");
|
|
20
20
|
console.error("");
|
|
21
21
|
console.error("Connects to a running local engine (PICO_ENGINE_BASE_URL).");
|
|
22
|
-
console.error(
|
|
22
|
+
console.error(
|
|
23
|
+
"Reads $PICO_ENGINE_HOME/internal-token (written when the engine starts) or uses PICO_ENGINE_UI_ECI."
|
|
24
|
+
);
|
|
23
25
|
process.exit(1);
|
|
24
26
|
}
|
|
25
27
|
// JS (not tsc): avoids pulling MCP SDK types into the main compile.
|