@sapiom/mcp 0.5.0 → 0.6.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/dist/index.js
CHANGED
|
@@ -4,8 +4,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
4
4
|
import { resolveEnvironment } from "./credentials.js";
|
|
5
5
|
import { register as registerAuthenticate } from "./tools/authenticate.js";
|
|
6
6
|
import { register as registerStatus } from "./tools/status.js";
|
|
7
|
-
import { register as
|
|
8
|
-
import { register as registerApiKeys } from "./tools/api-keys.js";
|
|
7
|
+
import { register as registerOrchestrations } from "./tools/orchestrations.js";
|
|
9
8
|
async function main() {
|
|
10
9
|
// Resolve environment: SAPIOM_ENVIRONMENT env var > file > "production"
|
|
11
10
|
const env = await resolveEnvironment(process.env.SAPIOM_ENVIRONMENT);
|
|
@@ -13,18 +12,18 @@ async function main() {
|
|
|
13
12
|
console.error(`\u26a0 Using environment "${env.name}": app=${env.appURL} api=${env.apiURL}`);
|
|
14
13
|
}
|
|
15
14
|
const server = new McpServer({
|
|
16
|
-
|
|
15
|
+
// The local dev surface — distinct from the remote Sapiom capabilities MCP.
|
|
16
|
+
name: "sapiom-dev",
|
|
17
17
|
version: "0.1.0",
|
|
18
18
|
});
|
|
19
19
|
// Register all tools
|
|
20
20
|
registerAuthenticate(server, env);
|
|
21
21
|
registerStatus(server, env);
|
|
22
|
-
|
|
23
|
-
registerApiKeys(server, env);
|
|
22
|
+
registerOrchestrations(server, env);
|
|
24
23
|
// Connect via stdio transport
|
|
25
24
|
const transport = new StdioServerTransport();
|
|
26
25
|
await server.connect(transport);
|
|
27
|
-
console.error("Sapiom MCP server running on stdio");
|
|
26
|
+
console.error("Sapiom dev MCP server running on stdio");
|
|
28
27
|
}
|
|
29
28
|
main().catch((err) => {
|
|
30
29
|
console.error("Fatal error:", err);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,QAAQ,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,QAAQ,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,QAAQ,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,QAAQ,IAAI,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAE/E,KAAK,UAAU,IAAI;IACjB,wEAAwE;IACxE,MAAM,GAAG,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAErE,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,CACX,6BAA6B,GAAG,CAAC,IAAI,UAAU,GAAG,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,CAC9E,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,4EAA4E;QAC5E,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,qBAAqB;IACrB,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,sBAAsB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEpC,8BAA8B;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC1D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrations.d.ts","sourceRoot":"","sources":["../../src/tools/orchestrations.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAsBzE,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAgH9E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,mBAAmB,GAAG,IAAI,CAsU1E"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestration authoring tools. Thin wrappers over @sapiom/orchestration-core.
|
|
3
|
+
* Local tools (scaffold / check / run_local) need no network; networked tools
|
|
4
|
+
* (link / deploy / run / inspect / signal) build a client from the cached
|
|
5
|
+
* credential and the environment's API host.
|
|
6
|
+
*
|
|
7
|
+
* Results are returned as JSON text so the calling agent can parse them. In
|
|
8
|
+
* particular, `run_local` returns a per-step trace plus `unusedStubs` /
|
|
9
|
+
* `stubWarnings` that flag supplied stubs which didn't take effect.
|
|
10
|
+
*/
|
|
11
|
+
import { createRequire } from "node:module";
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import { check, createClient, deploy, inspect, inspectBuild, isExecutionTerminal, link, listExecutions, OrchestrationError, parseStubFile, requireConfig, run, runLocalFromDir, scaffold, signal, waitForExecution, writeConfig, } from "@sapiom/orchestration-core";
|
|
15
|
+
import { readCredentials } from "../credentials.js";
|
|
16
|
+
function ok(data) {
|
|
17
|
+
let text;
|
|
18
|
+
try {
|
|
19
|
+
text = JSON.stringify(data, null, 2);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
// A value in the result resisted serialization. Don't drop the whole
|
|
23
|
+
// payload (e.g. a run_local trace) on the floor — emit a sanitized version
|
|
24
|
+
// that keeps everything serializable and marks the node that failed, so the
|
|
25
|
+
// result stays actionable instead of surfacing as an opaque crash.
|
|
26
|
+
text = JSON.stringify({
|
|
27
|
+
_serializationError: err instanceof Error ? err.message : String(err),
|
|
28
|
+
data: sanitize(data),
|
|
29
|
+
}, null, 2);
|
|
30
|
+
}
|
|
31
|
+
return { content: [{ type: "text", text }] };
|
|
32
|
+
}
|
|
33
|
+
/** Best-effort deep copy that replaces any node which throws on access or
|
|
34
|
+
* serialization with a marker, so a single bad value can't sink the response. */
|
|
35
|
+
function sanitize(value, seen = new WeakSet()) {
|
|
36
|
+
if (value === null || typeof value !== "object")
|
|
37
|
+
return value;
|
|
38
|
+
if (seen.has(value))
|
|
39
|
+
return "[Circular]";
|
|
40
|
+
seen.add(value);
|
|
41
|
+
try {
|
|
42
|
+
if (Array.isArray(value))
|
|
43
|
+
return value.map((v) => sanitize(v, seen));
|
|
44
|
+
const out = {};
|
|
45
|
+
for (const key of Object.keys(value)) {
|
|
46
|
+
try {
|
|
47
|
+
out[key] = sanitize(value[key], seen);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
out[key] =
|
|
51
|
+
`[unserializable: ${err instanceof Error ? err.message : String(err)}]`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
return `[unserializable: ${err instanceof Error ? err.message : String(err)}]`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function fail(err) {
|
|
61
|
+
const structured = err instanceof OrchestrationError
|
|
62
|
+
? err.toStructured()
|
|
63
|
+
: {
|
|
64
|
+
code: "UNEXPECTED",
|
|
65
|
+
message: err instanceof Error ? err.message : String(err),
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
content: [
|
|
69
|
+
{
|
|
70
|
+
type: "text",
|
|
71
|
+
text: JSON.stringify({ error: structured }, null, 2),
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
isError: true,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Coerce a tool argument that may arrive as a JSON string (some MCP clients
|
|
79
|
+
* serialize object-valued args) back into a value. A non-JSON string is
|
|
80
|
+
* returned as-is (a legitimately string-valued input).
|
|
81
|
+
*/
|
|
82
|
+
function coerceJson(value) {
|
|
83
|
+
if (typeof value !== "string")
|
|
84
|
+
return value;
|
|
85
|
+
try {
|
|
86
|
+
return JSON.parse(value);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const nodeRequire = createRequire(import.meta.url);
|
|
93
|
+
/**
|
|
94
|
+
* Locate the bundled templates directory of @sapiom/orchestration-core. This
|
|
95
|
+
* ESM server has no `__dirname`, so the templates dir is resolved from the
|
|
96
|
+
* package's entry and passed to `scaffold` explicitly.
|
|
97
|
+
*/
|
|
98
|
+
function coreTemplatesDir() {
|
|
99
|
+
const entry = nodeRequire.resolve("@sapiom/orchestration-core");
|
|
100
|
+
return path.resolve(path.dirname(entry), "..", "..", "templates");
|
|
101
|
+
}
|
|
102
|
+
async function gatewayClient(env) {
|
|
103
|
+
const creds = await readCredentials(env.name);
|
|
104
|
+
if (!creds)
|
|
105
|
+
return null;
|
|
106
|
+
return createClient({ apiKey: creds.apiKey, host: env.apiURL });
|
|
107
|
+
}
|
|
108
|
+
const NOT_AUTHED = fail(new OrchestrationError({
|
|
109
|
+
code: "NOT_AUTHENTICATED",
|
|
110
|
+
message: "Not authenticated.",
|
|
111
|
+
hint: "Use the sapiom_authenticate tool first.",
|
|
112
|
+
}));
|
|
113
|
+
export function register(server, env) {
|
|
114
|
+
// ── Local tools (no network) ──────────────────────────────────────────────
|
|
115
|
+
server.tool("sapiom_dev_orchestrations_scaffold", "Scaffold a new Sapiom orchestration project into <dir>. Produces an npm-install-ready TypeScript project with a starter orchestration in index.ts. After scaffolding, the author writes step definitions and uses sapiom_dev_orchestrations_run_local to test them.", {
|
|
116
|
+
dir: z
|
|
117
|
+
.string()
|
|
118
|
+
.min(1)
|
|
119
|
+
.describe("Target directory for the new project (created if absent; must be empty)."),
|
|
120
|
+
template: z
|
|
121
|
+
.string()
|
|
122
|
+
.optional()
|
|
123
|
+
.describe("Template name. 'default' (a minimal two-step starter) or 'coding-pause' (the launch + pauseUntilSignal + resume pattern for a non-blocking coding-agent run). Defaults to 'default'."),
|
|
124
|
+
}, async ({ dir, template }) => {
|
|
125
|
+
try {
|
|
126
|
+
return ok(await scaffold({
|
|
127
|
+
targetDir: dir,
|
|
128
|
+
template,
|
|
129
|
+
templatesDir: coreTemplatesDir(),
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
return fail(err);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
server.tool("sapiom_dev_orchestrations_check", "Validate an orchestration locally: bundle index.ts, derive the manifest, and check the step graph. Offline and instant. Returns the orchestration name, step count, the manifest (which contains the full step graph for visualization), and any graph warnings.", {
|
|
137
|
+
dir: z
|
|
138
|
+
.string()
|
|
139
|
+
.optional()
|
|
140
|
+
.describe("Project directory (defaults to the current working directory)."),
|
|
141
|
+
}, async ({ dir }) => {
|
|
142
|
+
try {
|
|
143
|
+
return ok(await check({ sourceDir: dir ?? process.cwd() }));
|
|
144
|
+
}
|
|
145
|
+
catch (err) {
|
|
146
|
+
return fail(err);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
server.tool("sapiom_dev_orchestrations_run_local", [
|
|
150
|
+
"Execute an orchestration entirely on the local machine, running the author's actual step code with every ctx.sapiom.* capability call resolved from stubs (no real capability calls, no cost, instant).",
|
|
151
|
+
"Returns { outcome, output, steps[], unusedStubs[], stubWarnings[] }. outcome is 'completed' | 'failed' | 'paused' | 'running'. A paused dispatch (e.g. agent.coding.launch) is auto-resumed locally with its stub result, so the happy path runs end-to-end.",
|
|
152
|
+
"Returns `unusedStubs` (supplied stub keys that matched no call — a typo or wrong path form) and `stubWarnings` (a stub key matched but its value was the wrong shape for the capability). Check both: a green run with a non-empty unusedStubs/stubWarnings usually means your stub didn't take effect.",
|
|
153
|
+
"Stub shape: { version: 1, steps: { <stepName>: { <methodPath>: <response> } } }. The response is the value that call returns verbatim — e.g. `repositories.list` takes the array list() should return ([{ slug, cloneUrl }]), not a wrapped/sequence form. For a dispatched run, stub `agent.coding.run` (or `agent.coding.launch`) in the step that launches it; that value becomes both the run result and the payload the paused step resumes with — set status:'failed' there to exercise the failure branch.",
|
|
154
|
+
].join("\n"), {
|
|
155
|
+
dir: z
|
|
156
|
+
.string()
|
|
157
|
+
.optional()
|
|
158
|
+
.describe("Project directory (defaults to the current working directory)."),
|
|
159
|
+
input: z
|
|
160
|
+
.unknown()
|
|
161
|
+
.optional()
|
|
162
|
+
.describe("The workflow's entry-step input (any JSON value)."),
|
|
163
|
+
stubs: z
|
|
164
|
+
.unknown()
|
|
165
|
+
.optional()
|
|
166
|
+
.describe("Stub file object: { version, steps: { <step>: { <method.path>: <response> | [<response>] } } }."),
|
|
167
|
+
maxAttemptsPerStep: z
|
|
168
|
+
.number()
|
|
169
|
+
.int()
|
|
170
|
+
.positive()
|
|
171
|
+
.optional()
|
|
172
|
+
.describe("Retry cap per step (default 3)."),
|
|
173
|
+
}, async ({ dir, input, stubs, maxAttemptsPerStep }) => {
|
|
174
|
+
try {
|
|
175
|
+
const parsed = stubs === undefined ? undefined : parseStubFile(coerceJson(stubs));
|
|
176
|
+
return ok(await runLocalFromDir({
|
|
177
|
+
sourceDir: dir ?? process.cwd(),
|
|
178
|
+
input: coerceJson(input),
|
|
179
|
+
stubs: parsed,
|
|
180
|
+
maxAttemptsPerStep,
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
return fail(err);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
// ── Networked tools (require authentication) ───────────────────────────────
|
|
188
|
+
server.tool("sapiom_dev_orchestrations_link", "Resolve a hosted orchestration by name (or create it with create:true) and cache its id in the project's sapiom.json. Run this before deploy.", {
|
|
189
|
+
dir: z
|
|
190
|
+
.string()
|
|
191
|
+
.optional()
|
|
192
|
+
.describe("Project directory (defaults to the current working directory)."),
|
|
193
|
+
name: z
|
|
194
|
+
.string()
|
|
195
|
+
.optional()
|
|
196
|
+
.describe("Orchestration name (matches defineOrchestration({ name })). Defaults to the orchestration's name read from index.ts."),
|
|
197
|
+
create: z
|
|
198
|
+
.boolean()
|
|
199
|
+
.optional()
|
|
200
|
+
.describe("Create the orchestration if it does not exist."),
|
|
201
|
+
}, async ({ dir, name, create }) => {
|
|
202
|
+
const client = await gatewayClient(env);
|
|
203
|
+
if (!client)
|
|
204
|
+
return NOT_AUTHED;
|
|
205
|
+
try {
|
|
206
|
+
const projectDir = dir ?? process.cwd();
|
|
207
|
+
// Default the link name to the orchestration's own name (from index.ts)
|
|
208
|
+
// so the link matches what deploy ships — the directory name can drift
|
|
209
|
+
// from defineOrchestration({ name }).
|
|
210
|
+
let linkName = name;
|
|
211
|
+
if (!linkName) {
|
|
212
|
+
try {
|
|
213
|
+
linkName = (await check({ sourceDir: projectDir })).name;
|
|
214
|
+
}
|
|
215
|
+
catch {
|
|
216
|
+
// Couldn't read the manifest — fall through to the explicit error.
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (!linkName) {
|
|
220
|
+
return fail(new OrchestrationError({
|
|
221
|
+
code: "NAME_REQUIRED",
|
|
222
|
+
message: "No orchestration name to link.",
|
|
223
|
+
hint: "Pass name, or ensure index.ts bundles (run check) so the name can be read from defineOrchestration({ name }).",
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
226
|
+
const result = await link({ name: linkName, create }, client);
|
|
227
|
+
writeConfig(projectDir, {
|
|
228
|
+
definitionId: result.definitionId,
|
|
229
|
+
name: result.name,
|
|
230
|
+
});
|
|
231
|
+
return ok(result);
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
return fail(err);
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
server.tool("sapiom_dev_orchestrations_deploy", "Deploy the linked orchestration: push the current git commit, trigger a build, and wait for it to finish. The project must be linked (sapiom.json) and a git repo with at least one commit.", {
|
|
238
|
+
dir: z
|
|
239
|
+
.string()
|
|
240
|
+
.optional()
|
|
241
|
+
.describe("Project directory (defaults to the current working directory)."),
|
|
242
|
+
branch: z
|
|
243
|
+
.string()
|
|
244
|
+
.optional()
|
|
245
|
+
.describe("Branch to push to (default 'main')."),
|
|
246
|
+
}, async ({ dir, branch }) => {
|
|
247
|
+
const client = await gatewayClient(env);
|
|
248
|
+
if (!client)
|
|
249
|
+
return NOT_AUTHED;
|
|
250
|
+
try {
|
|
251
|
+
const projectDir = dir ?? process.cwd();
|
|
252
|
+
const cfg = requireConfig(projectDir);
|
|
253
|
+
return ok(await deploy({ projectDir, definitionId: cfg.definitionId, branch }, client));
|
|
254
|
+
}
|
|
255
|
+
catch (err) {
|
|
256
|
+
return fail(err);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
server.tool("sapiom_dev_orchestrations_run", "Start a real (cloud) execution of the linked orchestration. Use sapiom_dev_orchestrations_inspect to follow it.", {
|
|
260
|
+
dir: z
|
|
261
|
+
.string()
|
|
262
|
+
.optional()
|
|
263
|
+
.describe("Project directory (defaults to the current working directory)."),
|
|
264
|
+
input: z
|
|
265
|
+
.unknown()
|
|
266
|
+
.optional()
|
|
267
|
+
.describe("The workflow's entry-step input (any JSON value)."),
|
|
268
|
+
}, async ({ dir, input }) => {
|
|
269
|
+
const client = await gatewayClient(env);
|
|
270
|
+
if (!client)
|
|
271
|
+
return NOT_AUTHED;
|
|
272
|
+
try {
|
|
273
|
+
const cfg = requireConfig(dir ?? process.cwd());
|
|
274
|
+
return ok(await run({ definitionId: cfg.definitionId, input }, client));
|
|
275
|
+
}
|
|
276
|
+
catch (err) {
|
|
277
|
+
return fail(err);
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
server.tool("sapiom_dev_orchestrations_inspect", "Inspect a cloud execution (its steps and errors) by executionId, a build by buildRunId, or list recent executions when neither is given. On a failed step, pull its input here to reproduce the failure locally with run_local.\n\nReads are a fresh point-in-time snapshot. To wait for a still-running execution to finish, set wait:true (the tool polls until it settles or the wait window elapses) — do NOT sleep-and-poll this tool yourself. If a wait returns waiting:true, just call inspect again with wait:true.", {
|
|
281
|
+
dir: z
|
|
282
|
+
.string()
|
|
283
|
+
.optional()
|
|
284
|
+
.describe("Project directory (for build inspection, which needs the linked id)."),
|
|
285
|
+
executionId: z.string().optional().describe("Execution to inspect."),
|
|
286
|
+
buildRunId: z
|
|
287
|
+
.string()
|
|
288
|
+
.optional()
|
|
289
|
+
.describe("Build to inspect (requires a linked project)."),
|
|
290
|
+
wait: z
|
|
291
|
+
.boolean()
|
|
292
|
+
.optional()
|
|
293
|
+
.describe("When inspecting an executionId, block until it reaches a terminal state (or settles on a pause needing a signal) instead of returning the current snapshot. Lets the tool own the polling so you don't have to."),
|
|
294
|
+
maxWaitSeconds: z
|
|
295
|
+
.number()
|
|
296
|
+
.optional()
|
|
297
|
+
.describe("Max seconds to wait when wait:true (default 45, capped at 55). On timeout it returns the latest snapshot with waiting:true — call again to keep waiting."),
|
|
298
|
+
}, async ({ dir, executionId, buildRunId, wait, maxWaitSeconds }) => {
|
|
299
|
+
const client = await gatewayClient(env);
|
|
300
|
+
if (!client)
|
|
301
|
+
return NOT_AUTHED;
|
|
302
|
+
try {
|
|
303
|
+
if (buildRunId) {
|
|
304
|
+
const cfg = requireConfig(dir ?? process.cwd());
|
|
305
|
+
return ok(await inspectBuild({ definitionId: cfg.definitionId, buildRunId }, client));
|
|
306
|
+
}
|
|
307
|
+
if (executionId) {
|
|
308
|
+
if (wait) {
|
|
309
|
+
const maxWaitMs = Math.min(Math.max(maxWaitSeconds ?? 45, 1), 55) * 1000;
|
|
310
|
+
const { execution, reason, done } = await waitForExecution({ executionId, maxWaitMs }, client);
|
|
311
|
+
const hint = reason === "timeout"
|
|
312
|
+
? "Still running after the wait window — call inspect again with wait:true to keep waiting."
|
|
313
|
+
: reason === "needs-signal"
|
|
314
|
+
? `Paused on signal '${execution.pausedSignalName ?? "?"}' — deliver it with sapiom_dev_orchestrations_signal to resume.`
|
|
315
|
+
: undefined;
|
|
316
|
+
return ok({
|
|
317
|
+
execution,
|
|
318
|
+
done,
|
|
319
|
+
waiting: !done,
|
|
320
|
+
...(hint ? { hint } : {}),
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
const { execution } = await inspect({ executionId }, client);
|
|
324
|
+
// Self-correcting nudge: on a non-terminal snapshot, point at wait:true
|
|
325
|
+
// so a caller reaches for the tool's loop instead of polling by hand.
|
|
326
|
+
const hint = isExecutionTerminal(execution.status)
|
|
327
|
+
? undefined
|
|
328
|
+
: `Execution is '${execution.status}', not terminal — call inspect with wait:true to block until it finishes instead of polling manually.`;
|
|
329
|
+
return ok({ execution, ...(hint ? { hint } : {}) });
|
|
330
|
+
}
|
|
331
|
+
return ok(await listExecutions(client));
|
|
332
|
+
}
|
|
333
|
+
catch (err) {
|
|
334
|
+
return fail(err);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
server.tool("sapiom_dev_orchestrations_signal", "Resume a paused cloud execution by delivering a named signal (matched by name + correlationId).", {
|
|
338
|
+
executionId: z.string().describe("The paused execution."),
|
|
339
|
+
name: z.string().describe("Signal name to deliver."),
|
|
340
|
+
correlationId: z.string().describe("Signal correlation id."),
|
|
341
|
+
payload: z
|
|
342
|
+
.unknown()
|
|
343
|
+
.optional()
|
|
344
|
+
.describe("Signal payload (any JSON value)."),
|
|
345
|
+
}, async ({ executionId, name, correlationId, payload }) => {
|
|
346
|
+
const client = await gatewayClient(env);
|
|
347
|
+
if (!client)
|
|
348
|
+
return NOT_AUTHED;
|
|
349
|
+
try {
|
|
350
|
+
return ok(await signal({ executionId, name, correlationId, payload }, client));
|
|
351
|
+
}
|
|
352
|
+
catch (err) {
|
|
353
|
+
return fail(err);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=orchestrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrations.js","sourceRoot":"","sources":["../../src/tools/orchestrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,KAAK,EACL,YAAY,EACZ,MAAM,EAEN,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,IAAI,EACJ,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,GAAG,EACH,eAAe,EACf,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,WAAW,GAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAA4B,MAAM,mBAAmB,CAAC;AAO9E,SAAS,EAAE,CAAC,IAAa;IACvB,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,IAAI,GAA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wBAAwB,CAAC;QAC5D,OAAO,EAAE,CAAC;aACP,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,QAAQ,CAAC,kCAAkC,CAAC;KAChD,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,EAAE;QACtD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM;YAAE,OAAO,UAAU,CAAC;QAC/B,IAAI,CAAC;YACH,OAAO,EAAE,CACP,MAAM,MAAM,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,MAAM,CAAC,CACpE,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapiom/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Sapiom MCP server for Claude Code — browser-based authentication and API tools",
|
|
5
5
|
"mcpName": "io.github.sapiom/mcp",
|
|
6
6
|
"keywords": [
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
35
35
|
"zod": "^3.25.0",
|
|
36
36
|
"@sapiom/core": "0.5.0",
|
|
37
|
-
"@sapiom/fetch": "0.5.0"
|
|
37
|
+
"@sapiom/fetch": "0.5.0",
|
|
38
|
+
"@sapiom/orchestration-core": "^0.3.0"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@types/node": "^20.11.30",
|