@t4h.framework/cli 0.0.0-experimental-2f9c297 → 0.0.0-experimental-20261019200538

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/bin/bin.js +1 -20
  3. package/dist/bin/bin.js.map +1 -1
  4. package/dist/commands/ai/ai-bootstrap.js +51 -185
  5. package/dist/commands/ai/ai-bootstrap.js.map +1 -1
  6. package/dist/commands/build/build.js +2 -6
  7. package/dist/commands/build/build.js.map +1 -1
  8. package/dist/commands/dev/dev.js +1 -8
  9. package/dist/commands/dev/dev.js.map +1 -1
  10. package/dist/commands/publish/publish.js +0 -1
  11. package/dist/commands/publish/publish.js.map +1 -1
  12. package/package.json +3 -12
  13. package/LICENSE +0 -21
  14. package/dist/commands/ai/ai-hook.js +0 -84
  15. package/dist/commands/ai/ai-hook.js.map +0 -1
  16. package/dist/commands/ai/tools/agent-instructions.js +0 -75
  17. package/dist/commands/ai/tools/agent-instructions.js.map +0 -1
  18. package/dist/commands/ai/tools/agent-settings.js +0 -61
  19. package/dist/commands/ai/tools/agent-settings.js.map +0 -1
  20. package/dist/commands/ai/tools/assets-lock.js +0 -34
  21. package/dist/commands/ai/tools/assets-lock.js.map +0 -1
  22. package/dist/commands/check/check.js +0 -185
  23. package/dist/commands/check/check.js.map +0 -1
  24. package/dist/commands/mcp/mcp-server.js +0 -235
  25. package/dist/commands/mcp/mcp-server.js.map +0 -1
  26. package/dist/commands/mcp/mcp-tools.js +0 -283
  27. package/dist/commands/mcp/mcp-tools.js.map +0 -1
  28. package/dist/commands/mcp/mcp.js +0 -71
  29. package/dist/commands/mcp/mcp.js.map +0 -1
  30. package/dist/commands/runtime/runtime.js +0 -143
  31. package/dist/commands/runtime/runtime.js.map +0 -1
  32. package/dist/commands/workflows/workflows.js +0 -166
  33. package/dist/commands/workflows/workflows.js.map +0 -1
  34. package/dist/tools/debug-log-option.js +0 -13
  35. package/dist/tools/debug-log-option.js.map +0 -1
  36. package/dist/tools/dev-server-client.js +0 -261
  37. package/dist/tools/dev-server-client.js.map +0 -1
  38. package/dist/tools/load-dev.js +0 -23
  39. package/dist/tools/load-dev.js.map +0 -1
  40. package/dist/tools/project-package.js +0 -67
  41. package/dist/tools/project-package.js.map +0 -1
  42. package/dist/tools/project-scripts.js +0 -53
  43. package/dist/tools/project-scripts.js.map +0 -1
@@ -1,235 +0,0 @@
1
- import readline from 'node:readline';
2
- /** MCP revisions this server speaks, newest first. */
3
- export const MCP_PROTOCOL_VERSIONS = [
4
- '2025-11-25',
5
- '2025-06-18',
6
- '2025-03-26',
7
- '2024-11-05',
8
- ];
9
- export const JSON_RPC_ERROR = {
10
- parseError: -32700,
11
- invalidRequest: -32600,
12
- methodNotFound: -32601,
13
- invalidParams: -32602,
14
- internalError: -32603,
15
- };
16
- /** A JSON-RPC error answered as is, e.g. invalid params. */
17
- export class JsonRpcError extends Error {
18
- code;
19
- data;
20
- name = 'JsonRpcError';
21
- constructor(code, message, data) {
22
- super(message);
23
- this.code = code;
24
- this.data = data;
25
- }
26
- }
27
- const toText = (value) => typeof value === 'string' ? value : JSON.stringify(value, null, 2);
28
- /** `{ message, status?, details? }` of any error, for the agent to act on. */
29
- export function toToolError(error) {
30
- if (!(error instanceof Error))
31
- return { error: { message: String(error) } };
32
- const { status, details } = error;
33
- return {
34
- error: {
35
- message: error.message,
36
- ...(status !== undefined && status !== null ? { status } : {}),
37
- ...(details !== undefined && details !== null ? { details } : {}),
38
- },
39
- };
40
- }
41
- const isObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
42
- const JSON_TYPES = {
43
- string: value => typeof value === 'string',
44
- boolean: value => typeof value === 'boolean',
45
- number: value => typeof value === 'number' && Number.isFinite(value),
46
- integer: value => Number.isInteger(value),
47
- object: isObject,
48
- array: Array.isArray,
49
- };
50
- /** Checks the required and top-level typed properties of the arguments. */
51
- export function checkToolArguments(schema, args) {
52
- const problems = [];
53
- const properties = (schema.properties ?? {});
54
- for (const name of (schema.required ?? []))
55
- if (args[name] === undefined)
56
- problems.push(`${name} is required`);
57
- for (const [name, value] of Object.entries(args)) {
58
- const property = properties[name];
59
- if (value === undefined)
60
- continue;
61
- if (!property) {
62
- if (schema.additionalProperties === false)
63
- problems.push(`${name} is not a known argument`);
64
- continue;
65
- }
66
- if (property.type && !JSON_TYPES[property.type]?.(value))
67
- problems.push(`${name} must be of type ${property.type}`);
68
- else if (property.enum && !property.enum.includes(value))
69
- problems.push(`${name} must be one of ${property.enum.join(', ')}`);
70
- }
71
- return problems;
72
- }
73
- /**
74
- * The Model Context Protocol over JSON-RPC 2.0: lifecycle, ping and tools.
75
- * Transport-free, so tests hand it messages directly.
76
- */
77
- export class McpServer {
78
- options;
79
- tools;
80
- constructor(options) {
81
- this.options = options;
82
- this.tools = new Map(options.tools.map(tool => [tool.name, tool]));
83
- }
84
- /** Answers one message (or batch); `null` for notifications and responses. */
85
- async handle(message) {
86
- if (Array.isArray(message)) {
87
- if (!message.length)
88
- return this.error(null, JSON_RPC_ERROR.invalidRequest, 'Empty batch');
89
- const responses = (await Promise.all(message.map(item => this.handleOne(item)))).filter(response => response !== null);
90
- return responses.length ? responses : null;
91
- }
92
- return this.handleOne(message);
93
- }
94
- /** Parses one line of the stdio transport and answers it. */
95
- async handleLine(line) {
96
- let message;
97
- try {
98
- message = JSON.parse(line);
99
- }
100
- catch (error) {
101
- return this.error(null, JSON_RPC_ERROR.parseError, `Parse error: ${error.message}`);
102
- }
103
- return this.handle(message);
104
- }
105
- /**
106
- * Newline-delimited JSON on `input` / `output` (the MCP stdio transport).
107
- * Requests are answered as they finish, so `ping` is not stuck behind a
108
- * long tool call. Resolves when `input` ends.
109
- */
110
- async serve(input, output) {
111
- const lines = readline.createInterface({ input, crlfDelay: Infinity });
112
- const pending = new Set();
113
- for await (const line of lines) {
114
- if (!line.trim())
115
- continue;
116
- const answer = this.handleLine(line)
117
- .then(response => {
118
- if (response !== null)
119
- output.write(`${JSON.stringify(response)}\n`);
120
- })
121
- .catch(error => this.options.log?.(`[mcp] ${String(error)}`))
122
- .finally(() => pending.delete(answer));
123
- pending.add(answer);
124
- }
125
- await Promise.all(pending);
126
- }
127
- async handleOne(message) {
128
- if (!isObject(message))
129
- return this.error(null, JSON_RPC_ERROR.invalidRequest, 'Invalid Request: not an object');
130
- const { jsonrpc, id, method, params } = message;
131
- const isRequest = id !== undefined;
132
- // A response to a request of ours: the server sends none, so drop it.
133
- if (method === undefined && ('result' in message || 'error' in message))
134
- return null;
135
- if (jsonrpc !== '2.0' ||
136
- typeof method !== 'string' ||
137
- (isRequest && typeof id !== 'string' && typeof id !== 'number'))
138
- return this.error(typeof id === 'string' || typeof id === 'number' ? id : null, JSON_RPC_ERROR.invalidRequest, 'Invalid Request');
139
- if (!isRequest) {
140
- // `notifications/initialized`, `notifications/cancelled`, …: nothing to do.
141
- return null;
142
- }
143
- const requestId = id;
144
- try {
145
- return {
146
- jsonrpc: '2.0',
147
- id: requestId,
148
- result: await this.dispatch(method, params),
149
- };
150
- }
151
- catch (error) {
152
- if (error instanceof JsonRpcError)
153
- return this.error(requestId, error.code, error.message, error.data);
154
- this.options.log?.(`[mcp] ${method} failed: ${error instanceof Error ? (error.stack ?? error.message) : String(error)}`);
155
- return this.error(requestId, JSON_RPC_ERROR.internalError, error instanceof Error ? error.message : String(error));
156
- }
157
- }
158
- dispatch(method, params) {
159
- switch (method) {
160
- case 'initialize':
161
- return this.initialize(params);
162
- case 'ping':
163
- return {};
164
- case 'tools/list':
165
- return {
166
- tools: [...this.tools.values()].map(({ name, description, inputSchema }) => ({
167
- name,
168
- description,
169
- inputSchema,
170
- })),
171
- };
172
- case 'tools/call':
173
- return this.callTool(params);
174
- default:
175
- throw new JsonRpcError(JSON_RPC_ERROR.methodNotFound, `Method not found: ${method}`);
176
- }
177
- }
178
- initialize(params) {
179
- const requested = isObject(params) ? params.protocolVersion : undefined;
180
- const protocolVersion = MCP_PROTOCOL_VERSIONS.find(version => version === requested);
181
- return {
182
- protocolVersion: protocolVersion ?? MCP_PROTOCOL_VERSIONS[0],
183
- capabilities: { tools: { listChanged: false } },
184
- serverInfo: { name: this.options.name, version: this.options.version },
185
- ...(this.options.instructions
186
- ? { instructions: this.options.instructions }
187
- : {}),
188
- };
189
- }
190
- async callTool(params) {
191
- if (!isObject(params) || typeof params.name !== 'string')
192
- throw new JsonRpcError(JSON_RPC_ERROR.invalidParams, 'tools/call needs params.name');
193
- const tool = this.tools.get(params.name);
194
- if (!tool)
195
- throw new JsonRpcError(JSON_RPC_ERROR.invalidParams, `Unknown tool: ${params.name}`, { tools: [...this.tools.keys()] });
196
- const args = params.arguments ?? {};
197
- if (!isObject(args))
198
- throw new JsonRpcError(JSON_RPC_ERROR.invalidParams, 'tools/call params.arguments must be an object');
199
- // Bad arguments are a tool error, so the agent reads them and retries.
200
- const problems = checkToolArguments(tool.inputSchema, args);
201
- if (problems.length)
202
- return {
203
- content: [
204
- {
205
- type: 'text',
206
- text: toText({
207
- error: {
208
- message: `Invalid arguments for ${tool.name}: ${problems.join('; ')}`,
209
- },
210
- }),
211
- },
212
- ],
213
- isError: true,
214
- };
215
- try {
216
- return {
217
- content: [{ type: 'text', text: toText(await tool.call(args)) }],
218
- };
219
- }
220
- catch (error) {
221
- return {
222
- content: [{ type: 'text', text: toText(toToolError(error)) }],
223
- isError: true,
224
- };
225
- }
226
- }
227
- error(id, code, message, data) {
228
- return {
229
- jsonrpc: '2.0',
230
- id,
231
- error: { code, message, ...(data !== undefined ? { data } : {}) },
232
- };
233
- }
234
- }
235
- //# sourceMappingURL=mcp-server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../../src/commands/mcp/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AAGpC,sDAAsD;AACtD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ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AO,EAAE,KAAK;YACd,EAAE;YACF,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;SAClE,CAAA;IACH,CAAC;CACF"}
@@ -1,283 +0,0 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import { DEV_SERVER_PAGE_LIMIT, findDevServer, isWaitingActivity, readDevRun, runOnDevServer, traceDevRun, } from '../../tools/dev-server-client.js';
4
- import { loadDev } from '../../tools/load-dev.js';
5
- import { DEFAULT_WORKFLOW_RUN_TIMEOUT_IN_MS, WorkflowsError, } from '../workflows/workflows.js';
6
- const NO_DEV_SERVER_MESSAGE = 'No dev server is running for this project; start it with `framework dev` (in another terminal or in the background) and retry';
7
- const DEFAULT_LIST_LIMIT = 20;
8
- const limitSchema = (what) => ({
9
- type: 'integer',
10
- minimum: 1,
11
- maximum: DEV_SERVER_PAGE_LIMIT,
12
- description: `How many ${what} to return, newest first (default ${DEFAULT_LIST_LIMIT}, max ${DEV_SERVER_PAGE_LIMIT})`,
13
- });
14
- const toRealPath = (dir) => {
15
- try {
16
- return fs.realpathSync(dir);
17
- }
18
- catch {
19
- return path.resolve(dir);
20
- }
21
- };
22
- /** Builds and runs one headless app at a time: they share the build dir. */
23
- function createHeadlessRunner({ projectDir, entrypoint, readEnv, }) {
24
- let queue = Promise.resolve();
25
- return (use) => {
26
- const next = queue.then(async () => {
27
- const { HeadlessApp } = await loadDev(projectDir, ['HeadlessApp']);
28
- const app = await HeadlessApp.up({ entrypoint, env: readEnv() });
29
- try {
30
- return await use(app);
31
- }
32
- finally {
33
- await app.down().catch(() => { });
34
- }
35
- });
36
- queue = next.catch(() => { });
37
- return next;
38
- };
39
- }
40
- export function createMcpTools(context) {
41
- const { projectDir } = context;
42
- const lookUpDevServer = context.findDevServer ?? findDevServer;
43
- const withHeadlessApp = createHeadlessRunner(context);
44
- const requireDevServer = async () => {
45
- const server = await lookUpDevServer(projectDir);
46
- if (!server)
47
- throw new WorkflowsError(NO_DEV_SERVER_MESSAGE, undefined, null);
48
- return server;
49
- };
50
- /** The manifest workflows, from the dev server when it runs. */
51
- const readWorkflows = async () => {
52
- const server = await lookUpDevServer(projectDir);
53
- if (server)
54
- return {
55
- source: 'dev',
56
- workflows: (await server.client.manifest()).workflows,
57
- };
58
- return withHeadlessApp(async (app) => ({
59
- source: 'headless',
60
- workflows: app.workflows,
61
- }));
62
- };
63
- return [
64
- {
65
- name: 'list_workflows',
66
- description: 'List the workflows of the app (id and description). Reads the running dev server, else builds the project headless (slower).',
67
- inputSchema: { type: 'object', properties: {} },
68
- async call() {
69
- const { source, workflows } = await readWorkflows();
70
- return {
71
- source,
72
- workflows: workflows.map(({ id, description }) => ({
73
- id,
74
- description,
75
- })),
76
- };
77
- },
78
- },
79
- {
80
- name: 'describe_workflow',
81
- description: 'Describe one workflow: its description and the JSON Schema its input must match. Call it before run_workflow to build a valid input.',
82
- inputSchema: {
83
- type: 'object',
84
- properties: {
85
- workflow: { type: 'string', description: 'Workflow id' },
86
- },
87
- required: ['workflow'],
88
- },
89
- async call({ workflow: workflowId }) {
90
- const { source, workflows } = await readWorkflows();
91
- const workflow = workflows.find(({ id }) => id === workflowId);
92
- if (!workflow)
93
- throw new WorkflowsError(`Workflow not found: ${workflowId}`, 404, {
94
- workflows: workflows.map(({ id }) => id),
95
- });
96
- return { source, workflow };
97
- },
98
- },
99
- {
100
- name: 'run_workflow',
101
- description: [
102
- 'Start a workflow run and (by default) wait until it settles or timeoutMs elapses.',
103
- 'mode "dev" runs on the running `framework dev`: the run, its sleeping activities and child runs survive the call, so you can follow it with get_run, list_waiting_activities and advance_activity.',
104
- 'mode "headless" builds the project and runs it in a throwaway runtime that stops when the call returns (sleeping children are killed).',
105
- 'Default: dev if a dev server is running, else headless.',
106
- 'Returns { mode, run: { id, status: running|fulfilled|rejected, input, output }, timedOut, waiting: async activities still pending, trace? }.',
107
- ].join(' '),
108
- inputSchema: {
109
- type: 'object',
110
- properties: {
111
- workflow: { type: 'string', description: 'Workflow id' },
112
- input: {
113
- description: 'Workflow input (any JSON), validated against the workflow schema (see describe_workflow)',
114
- },
115
- mode: {
116
- type: 'string',
117
- enum: ['dev', 'headless'],
118
- description: 'Where to run (default: dev if running, else headless)',
119
- },
120
- wait: {
121
- type: 'boolean',
122
- description: 'Wait for the run to settle (default true). false returns right after the start; dev mode only',
123
- },
124
- timeoutMs: {
125
- type: 'integer',
126
- minimum: 0,
127
- description: `Stop waiting after this many ms (default ${DEFAULT_WORKFLOW_RUN_TIMEOUT_IN_MS}); in dev mode the run keeps going`,
128
- },
129
- trace: {
130
- type: 'boolean',
131
- description: 'Add the activities (input/output), logs and child runs to the result',
132
- },
133
- },
134
- required: ['workflow'],
135
- },
136
- async call({ workflow, input, mode, wait = true, timeoutMs, trace }) {
137
- const workflowId = workflow;
138
- const server = await lookUpDevServer(projectDir);
139
- const runMode = mode ??
140
- (server ? 'dev' : 'headless');
141
- const options = {
142
- timeoutInMs: timeoutMs ??
143
- DEFAULT_WORKFLOW_RUN_TIMEOUT_IN_MS,
144
- trace: trace === true,
145
- };
146
- if (runMode === 'headless') {
147
- if (wait === false)
148
- throw new WorkflowsError('wait: false needs mode "dev": a headless runtime stops when the call returns', 400, null);
149
- return {
150
- mode: runMode,
151
- ...(await withHeadlessApp(app => app.run(workflowId, input, options))),
152
- };
153
- }
154
- if (!server)
155
- throw new WorkflowsError(NO_DEV_SERVER_MESSAGE, undefined, null);
156
- if (wait === false) {
157
- const { id } = await server.client.startRun(workflowId, input);
158
- const { run, waiting, trace: runTrace, } = await readDevRun(server.client, id, { trace: options.trace });
159
- return { mode: runMode, run, waiting, trace: runTrace };
160
- }
161
- return {
162
- mode: runMode,
163
- ...(await runOnDevServer(server.client, workflowId, input, options)),
164
- };
165
- },
166
- },
167
- {
168
- name: 'get_run',
169
- description: 'Read a run of the dev server: status, input, output, the activities in the order they ran, the async activities still waiting, and the logs. trace adds each activity input/output and the child runs.',
170
- inputSchema: {
171
- type: 'object',
172
- properties: {
173
- runId: { type: 'string', description: 'Run id' },
174
- trace: {
175
- type: 'boolean',
176
- description: 'Add each activity input/output and the child runs (larger result)',
177
- },
178
- },
179
- required: ['runId'],
180
- },
181
- async call({ runId, trace }) {
182
- const { client } = await requireDevServer();
183
- const id = runId;
184
- const run = await client.findRun(id);
185
- const activities = await client.findAllActivities(id);
186
- if (trace === true)
187
- return {
188
- run,
189
- waiting: activities.filter(isWaitingActivity),
190
- ...(await traceDevRun(client, id, activities)),
191
- };
192
- return {
193
- run,
194
- activities,
195
- waiting: activities.filter(isWaitingActivity),
196
- logs: await client.findAllLogs(id),
197
- };
198
- },
199
- },
200
- {
201
- name: 'list_runs',
202
- description: 'List the runs of the dev server, newest first (id, workflow, status, dates). Filter by workflow id.',
203
- inputSchema: {
204
- type: 'object',
205
- properties: {
206
- workflow: {
207
- type: 'string',
208
- description: 'Only runs of this workflow id',
209
- },
210
- limit: limitSchema('runs'),
211
- },
212
- },
213
- async call({ workflow, limit }) {
214
- const { client } = await requireDevServer();
215
- return client.findRuns({
216
- workflow: workflow,
217
- limit: limit ?? DEFAULT_LIST_LIMIT,
218
- });
219
- },
220
- },
221
- {
222
- name: 'list_waiting_activities',
223
- description: 'List the async activities of the dev server still waiting (SleepActivity, webhook/callback, external event), newest run first: activity id, run id, workflow, type, the schema of the output it expects and timeoutAt (when a sleep would wake). Pass an id to advance_activity to fast-forward it.',
224
- inputSchema: {
225
- type: 'object',
226
- properties: { limit: limitSchema('activities') },
227
- },
228
- async call({ limit }) {
229
- const { client } = await requireDevServer();
230
- return client.findWaitingActivities({
231
- limit: limit ?? DEFAULT_LIST_LIMIT,
232
- });
233
- },
234
- },
235
- {
236
- name: 'advance_activity',
237
- description: 'Time travel on the dev server: resolve a waiting async activity now instead of waiting for its timer, callback or event. Advancing a SleepActivity wakes the run at the date it was waiting for, by the run own clock, so a cadence jumps to its next step. For callback/event activities, output is the payload they would have received (match the schema from list_waiting_activities). The run then continues asynchronously: follow it with get_run.',
238
- inputSchema: {
239
- type: 'object',
240
- properties: {
241
- activityId: {
242
- type: 'string',
243
- description: 'Activity id, from list_waiting_activities or get_run',
244
- },
245
- output: {
246
- description: 'Payload the activity resolves with (omit for SleepActivity)',
247
- },
248
- },
249
- required: ['activityId'],
250
- },
251
- async call({ activityId, output }) {
252
- const { client } = await requireDevServer();
253
- return client.advanceActivity(activityId, output);
254
- },
255
- },
256
- {
257
- name: 'runtime_status',
258
- description: 'Show the runtimes of this project running on the machine (dev server and headless) with their queue (workers, jobs queued/in flight) and the number of runs running, plus the dev server URL. Use it to check whether `framework dev` is up or a runtime is stuck.',
259
- inputSchema: { type: 'object', properties: {} },
260
- async call() {
261
- const { listRuntimes, requestRuntimeStatus } = await loadDev(projectDir, ['listRuntimes', 'requestRuntimeStatus']);
262
- const target = toRealPath(projectDir);
263
- const runtimes = (await listRuntimes()).filter((runtime) => runtime.projectDir !== null &&
264
- toRealPath(runtime.projectDir) === target);
265
- const server = await lookUpDevServer(projectDir);
266
- return {
267
- projectDir,
268
- devServer: server
269
- ? { url: server.url, pid: server.runtime.pid }
270
- : null,
271
- runtimes: await Promise.all(runtimes.map(runtime => requestRuntimeStatus(runtime).catch((error) => ({
272
- runtime,
273
- error: error instanceof Error ? error.message : String(error),
274
- })))),
275
- ...(server
276
- ? {}
277
- : { hint: 'Start the dev server with `framework dev`' }),
278
- };
279
- },
280
- },
281
- ];
282
- }
283
- //# sourceMappingURL=mcp-tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-tools.js","sourceRoot":"","sources":["../../../src/commands/mcp/mcp-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAK5B,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,WAAW,GAEZ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AAG,UAAU,CAAC,UAAU,CAAC,CAAA;gBAErC,MAAM,QAAQ,GAAG,CAAC,MAAM,YAAY,EAAE,CAAC,CAAC,MAAM,CAC5C,CAAC,OAAoB,EAAE,EAAE,CACvB,OAAO,CAAC,UAAU,KAAK,IAAI;oBAC3B,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,MAAM,CAC5C,CAAA;gBAED,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,CAAA;gBAEhD,OAAO;oBACL,UAAU;oBACV,SAAS,EAAE,MAAM;wBACf,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE;wBAC9C,CAAC,CAAC,IAAI;oBACR,QAAQ,EAAE,MAAM,OAAO,CAAC,GAAG,CACzB,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CACrB,oBAAoB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC;wBACvD,OAAO;wBACP,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBAC9D,CAAC,CAAC,CACJ,CACF;oBACD,GAAG,CAAC,MAAM;wBACR,CAAC,CAAC,EAAE;wBACJ,CAAC,CAAC,EAAE,IAAI,EAAE,2CAA2C,EAAE,CAAC;iBAC3D,CAAA;YACH,CAAC;SACF;KACF,CAAA;AACH,CAAC"}
@@ -1,71 +0,0 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import { parseEnv } from 'node:util';
4
- import { Command, Option } from 'commander';
5
- import { McpServer } from './mcp-server.js';
6
- import { createMcpTools } from './mcp-tools.js';
7
- export const MCP_SERVER_INSTRUCTIONS = [
8
- 'Runs and inspects the workflows of a T4H Framework project.',
9
- 'Start with list_workflows, then describe_workflow for the input schema, then run_workflow.',
10
- 'With `framework dev` running, runs live on the dev server: follow them with get_run / list_runs, and fast-forward sleeps with list_waiting_activities + advance_activity.',
11
- 'Without it, run_workflow builds and runs the project headless, and the dev-only tools ask you to start `framework dev`.',
12
- ].join(' ');
13
- function readCliVersion() {
14
- try {
15
- return JSON.parse(fs.readFileSync(new URL('../../../package.json', import.meta.url), 'utf8')).version;
16
- }
17
- catch {
18
- return '0.0.0';
19
- }
20
- }
21
- /**
22
- * stdout carries the protocol only: anything else written there (the app,
23
- * a build, a stray `console.log`) goes to stderr instead.
24
- */
25
- function takeStdout() {
26
- const write = process.stdout.write.bind(process.stdout);
27
- process.stdout.write = process.stderr.write.bind(process.stderr);
28
- return chunk => write(chunk);
29
- }
30
- export const mcpCommand = new Command('mcp')
31
- .description('Serve the workflows of the project to AI agents over MCP (stdio): list, describe and run workflows, read runs, fast-forward sleeps')
32
- .addOption(new Option('--project <dir>', 'The project directory')
33
- .default(process.cwd(), 'the current directory')
34
- .argParser(value => path.resolve(process.cwd(), value)))
35
- .addOption(new Option('--entrypoint <entrypoint path>', 'The entrypoint package json path (default: <project>/package.json)').argParser(value => path.resolve(process.cwd(), value)))
36
- .addOption(new Option('-e, --env <envs..>', 'The env secrets of headless runs (NAME=value)')
37
- .argParser((value, previous) => {
38
- const index = value.indexOf('=');
39
- if (index < 1)
40
- throw new Error('Invalid secret format');
41
- return { ...previous, [value.slice(0, index)]: value.slice(index + 1) };
42
- })
43
- .default({}))
44
- .addOption(new Option('--env-file-if-exists <file-path>', 'Load the variables of headless runs from a .env file if it exists').argParser(value => path.resolve(process.cwd(), value)))
45
- .action(async (options) => {
46
- const write = takeStdout();
47
- const entrypoint = options.entrypoint ?? path.join(options.project, 'package.json');
48
- const server = new McpServer({
49
- name: 'framework',
50
- version: readCliVersion(),
51
- instructions: MCP_SERVER_INSTRUCTIONS,
52
- tools: createMcpTools({
53
- projectDir: path.dirname(entrypoint),
54
- entrypoint,
55
- readEnv: () => ({
56
- ...(options.envFileIfExists &&
57
- fs.existsSync(options.envFileIfExists)
58
- ? parseEnv(fs.readFileSync(options.envFileIfExists, 'utf8'))
59
- : {}),
60
- ...options.env,
61
- }),
62
- }),
63
- log: message => process.stderr.write(`${message}\n`),
64
- });
65
- process.once('SIGINT', () => process.exit(130));
66
- process.once('SIGTERM', () => process.exit(143));
67
- await server.serve(process.stdin, { write });
68
- // The client closed stdin: the session is over.
69
- process.exit(0);
70
- });
71
- //# sourceMappingURL=mcp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/commands/mcp/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAS/C,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,6DAA6D;IAC7D,4FAA4F;IAC5F,2KAA2K;IAC3K,yHAAyH;CAC1H,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAEX,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CACf,EAAE,CAAC,YAAY,CACb,IAAI,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EACjD,MAAM,CACP,CACF,CAAC,OAAO,CAAA;IACX,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAA;IAChB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,UAAU;IACjB,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA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