@sapiom/mcp 0.5.0 → 0.5.1
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;AAoBzE,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAgH9E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,mBAAmB,GAAG,IAAI,CAwQ1E"}
|
|
@@ -0,0 +1,308 @@
|
|
|
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, link, listExecutions, OrchestrationError, parseStubFile, requireConfig, run, runLocalFromDir, scaffold, signal, 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. Defaults to the directory name."),
|
|
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
|
+
const result = await link({ name: name ?? "", create }, client);
|
|
208
|
+
writeConfig(projectDir, {
|
|
209
|
+
definitionId: result.definitionId,
|
|
210
|
+
name: result.name,
|
|
211
|
+
});
|
|
212
|
+
return ok(result);
|
|
213
|
+
}
|
|
214
|
+
catch (err) {
|
|
215
|
+
return fail(err);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
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.", {
|
|
219
|
+
dir: z
|
|
220
|
+
.string()
|
|
221
|
+
.optional()
|
|
222
|
+
.describe("Project directory (defaults to the current working directory)."),
|
|
223
|
+
branch: z
|
|
224
|
+
.string()
|
|
225
|
+
.optional()
|
|
226
|
+
.describe("Branch to push to (default 'main')."),
|
|
227
|
+
}, async ({ dir, branch }) => {
|
|
228
|
+
const client = await gatewayClient(env);
|
|
229
|
+
if (!client)
|
|
230
|
+
return NOT_AUTHED;
|
|
231
|
+
try {
|
|
232
|
+
const projectDir = dir ?? process.cwd();
|
|
233
|
+
const cfg = requireConfig(projectDir);
|
|
234
|
+
return ok(await deploy({ projectDir, definitionId: cfg.definitionId, branch }, client));
|
|
235
|
+
}
|
|
236
|
+
catch (err) {
|
|
237
|
+
return fail(err);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
server.tool("sapiom_dev_orchestrations_run", "Start a real (cloud) execution of the linked orchestration. Use sapiom_dev_orchestrations_inspect to follow it.", {
|
|
241
|
+
dir: z
|
|
242
|
+
.string()
|
|
243
|
+
.optional()
|
|
244
|
+
.describe("Project directory (defaults to the current working directory)."),
|
|
245
|
+
input: z
|
|
246
|
+
.unknown()
|
|
247
|
+
.optional()
|
|
248
|
+
.describe("The workflow's entry-step input (any JSON value)."),
|
|
249
|
+
}, async ({ dir, input }) => {
|
|
250
|
+
const client = await gatewayClient(env);
|
|
251
|
+
if (!client)
|
|
252
|
+
return NOT_AUTHED;
|
|
253
|
+
try {
|
|
254
|
+
const cfg = requireConfig(dir ?? process.cwd());
|
|
255
|
+
return ok(await run({ definitionId: cfg.definitionId, input }, client));
|
|
256
|
+
}
|
|
257
|
+
catch (err) {
|
|
258
|
+
return fail(err);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
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.", {
|
|
262
|
+
dir: z
|
|
263
|
+
.string()
|
|
264
|
+
.optional()
|
|
265
|
+
.describe("Project directory (for build inspection, which needs the linked id)."),
|
|
266
|
+
executionId: z.string().optional().describe("Execution to inspect."),
|
|
267
|
+
buildRunId: z
|
|
268
|
+
.string()
|
|
269
|
+
.optional()
|
|
270
|
+
.describe("Build to inspect (requires a linked project)."),
|
|
271
|
+
}, async ({ dir, executionId, buildRunId }) => {
|
|
272
|
+
const client = await gatewayClient(env);
|
|
273
|
+
if (!client)
|
|
274
|
+
return NOT_AUTHED;
|
|
275
|
+
try {
|
|
276
|
+
if (buildRunId) {
|
|
277
|
+
const cfg = requireConfig(dir ?? process.cwd());
|
|
278
|
+
return ok(await inspectBuild({ definitionId: cfg.definitionId, buildRunId }, client));
|
|
279
|
+
}
|
|
280
|
+
if (executionId)
|
|
281
|
+
return ok(await inspect({ executionId }, client));
|
|
282
|
+
return ok(await listExecutions(client));
|
|
283
|
+
}
|
|
284
|
+
catch (err) {
|
|
285
|
+
return fail(err);
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
server.tool("sapiom_dev_orchestrations_signal", "Resume a paused cloud execution by delivering a named signal (matched by name + correlationId).", {
|
|
289
|
+
executionId: z.string().describe("The paused execution."),
|
|
290
|
+
name: z.string().describe("Signal name to deliver."),
|
|
291
|
+
correlationId: z.string().describe("Signal correlation id."),
|
|
292
|
+
payload: z
|
|
293
|
+
.unknown()
|
|
294
|
+
.optional()
|
|
295
|
+
.describe("Signal payload (any JSON value)."),
|
|
296
|
+
}, async ({ executionId, name, correlationId, payload }) => {
|
|
297
|
+
const client = await gatewayClient(env);
|
|
298
|
+
if (!client)
|
|
299
|
+
return NOT_AUTHED;
|
|
300
|
+
try {
|
|
301
|
+
return ok(await signal({ executionId, name, correlationId, payload }, client));
|
|
302
|
+
}
|
|
303
|
+
catch (err) {
|
|
304
|
+
return fail(err);
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
//# 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,IAAI,EACJ,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,GAAG,EACH,eAAe,EACf,QAAQ,EACR,MAAM,EACN,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,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,qEAAqE;QACrE,2EAA2E;QAC3E,4EAA4E;QAC5E,mEAAmE;QACnE,IAAI,GAAG,IAAI,CAAC,SAAS,CACnB;YACE,mBAAmB,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;YACrE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;SACrB,EACD,IAAI,EACJ,CAAC,CACF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AACxD,CAAC;AAED;kFACk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uB,CAAC;QACzD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QACpD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,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.5.
|
|
3
|
+
"version": "0.5.1",
|
|
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.2.0"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@types/node": "^20.11.30",
|