@runeya/runeya 2.0.145 → 2.0.146
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/agent/index.js +26 -21
- package/agent/index.js.map +1 -1
- package/agent-manager-R7BPQO6D.js +11 -0
- package/{chat-XYCHMTFE.js → chat-LPML22J5.js} +8 -7
- package/{chunk-NCO4OOYT.js → chunk-4LJQIQMN.js} +2 -2
- package/chunk-6IBPK6UE.js +1063 -0
- package/chunk-6IBPK6UE.js.map +1 -0
- package/{chunk-QF56Z6LI.js → chunk-KV4GJKXU.js} +3 -3
- package/{chunk-FE53XX4M.js → chunk-NPMSBYXC.js} +3 -3
- package/{chunk-ONVAH65J.js → chunk-SEPAURTQ.js} +283 -1266
- package/chunk-SEPAURTQ.js.map +1 -0
- package/{chunk-Q4RPY3VW.js → chunk-UD42LACH.js} +25 -11
- package/{chunk-Q4RPY3VW.js.map → chunk-UD42LACH.js.map} +1 -1
- package/{chunk-KS7A5CTW.js → chunk-VPSQJOSN.js} +12 -2
- package/{chunk-KS7A5CTW.js.map → chunk-VPSQJOSN.js.map} +1 -1
- package/{companion-HBYSY2D5.js → companion-W3UMZWGH.js} +5 -5
- package/external-NMKQPROK.js +387 -0
- package/external-NMKQPROK.js.map +1 -0
- package/index.js +15 -6
- package/index.js.map +1 -1
- package/{install-gate-JAEK4BDZ.js → install-gate-PVMGJDWE.js} +2 -2
- package/mcp-server/external.d.ts +44 -0
- package/mcp-server/external.js +2679 -0
- package/mcp-server/external.js.map +1 -0
- package/mcp-server/index.js +135 -39
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/launch.d.ts +19 -1
- package/mcp-server/launch.js +20 -0
- package/mcp-server/launch.js.map +1 -1
- package/package.json +1 -1
- package/settings-manager-XPLBO35P.js +10 -0
- package/{src-IODFUZ7A.js → src-LEDGW5KP.js} +951 -499
- package/src-LEDGW5KP.js.map +1 -0
- package/{vault-resolver-PN3TYCLJ.js → vault-resolver-E7KPKA5C.js} +2 -2
- package/web/assets/{AgentScalarChatInterface.vue-npQgDxeP.js → AgentScalarChatInterface.vue-BYszptaB.js} +1 -1
- package/web/assets/{AgentTerminalPage-BTH3yCS2.js → AgentTerminalPage-C3TJ1NL9.js} +1 -1
- package/web/assets/{AiChatModals-It9jnB26.js → AiChatModals-D3scRE3S.js} +1 -1
- package/web/assets/{AppLayout-BTg2CADo.js → AppLayout-BMQUjPKe.js} +1 -1
- package/web/assets/{AuditPage-2PKKGLZs.js → AuditPage-CKcExBws.js} +1 -1
- package/web/assets/{CloudAccountPage-CHL61gLe.js → CloudAccountPage-B6oPg0BZ.js} +1 -1
- package/web/assets/{CloudMessagingPage-cgKnABPH.js → CloudMessagingPage-C5fwVe-F.js} +1 -1
- package/web/assets/{DashboardPage-CRntTMKY.js → DashboardPage-9RV7sx3e.js} +1 -1
- package/web/assets/{DirectoryPickerDialog-DCyhT3-W.js → DirectoryPickerDialog-C06BXyfJ.js} +1 -1
- package/web/assets/{EnvironmentForm-C96PFWRE.js → EnvironmentForm-CAvDoira.js} +1 -1
- package/web/assets/{EnvironmentFormPage-ChorAd63.js → EnvironmentFormPage-BmAxhN-m.js} +1 -1
- package/web/assets/{EnvironmentListPage-Dw9ziaI8.js → EnvironmentListPage-B8uATPBI.js} +1 -1
- package/web/assets/{KanbanBoardPage-BZHbEj-q.js → KanbanBoardPage-CQsOkRUf.js} +3 -3
- package/web/assets/{KanbanListPage-B0jlfKqs.js → KanbanListPage-CWZqkjD6.js} +1 -1
- package/web/assets/{LaunchProjectPage-BVs1JwbV.js → LaunchProjectPage-saSmC7Pr.js} +1 -1
- package/web/assets/{LaunchServicesPage-PBYJly9N.js → LaunchServicesPage-BkKyLMEz.js} +1 -1
- package/web/assets/{LaunchShell-CGNYr-do.js → LaunchShell-DUrSunB4.js} +1 -1
- package/web/assets/{LogViewer-BDObx29F.js → LogViewer-CZBYkH9J.js} +1 -1
- package/web/assets/{OrgKeyPrompt-BbcwiwGw.js → OrgKeyPrompt-DzQ7pwbs.js} +1 -1
- package/web/assets/{ProcessControls-DY0HTKde.js → ProcessControls-BEeoNlNV.js} +1 -1
- package/web/assets/{ProcessDetailPage-BZ9kIQqn.js → ProcessDetailPage-CQgu5uKm.js} +1 -1
- package/web/assets/{ProjectCreateDialog-C1wVDPcK.js → ProjectCreateDialog-BolrhRD-.js} +1 -1
- package/web/assets/{ProjectLocationGate-bUd_tFpI.js → ProjectLocationGate-DhMVdIjN.js} +1 -1
- package/web/assets/{ProjectPublishDialog-APUS1WEN.js → ProjectPublishDialog-DsZNWrfz.js} +1 -1
- package/web/assets/{RandomJobTestPage-BFNC827R.js → RandomJobTestPage-BUS2Ty6-.js} +1 -1
- package/web/assets/{ScenarioEditorPage-DFVsMVu5.js → ScenarioEditorPage-MIAGh2us.js} +1 -1
- package/web/assets/{SendToChatDialog-QHIkxNio.js → SendToChatDialog-BxWsyv29.js} +1 -1
- package/web/assets/{ServiceControlsBar-_UQXb6g0.js → ServiceControlsBar-DqDPAZt7.js} +1 -1
- package/web/assets/{ServiceDetailPage-DGIXgHwR.js → ServiceDetailPage-hkSAzZ-l.js} +1 -1
- package/web/assets/{ServiceFormPage-RliAfS3_.js → ServiceFormPage-DXqhqXg8.js} +1 -1
- package/web/assets/SettingsPage-4pKUgKPm.css +1 -0
- package/web/assets/SettingsPage-DS2YhMIM.js +2086 -0
- package/web/assets/{UnlockPage-17EgfpJs.js → UnlockPage-s8SgVcKk.js} +1 -1
- package/web/assets/{VaultMigrationPage-DeMxpXXJ.js → VaultMigrationPage-s0b44MDM.js} +1 -1
- package/web/assets/{VersionBadge-DBquJl76.js → VersionBadge-BmArk24p.js} +1 -1
- package/web/assets/{WikiPage-GtwpJPqf.js → WikiPage-DADu8WUA.js} +1 -1
- package/web/assets/{WikiView-BqaqxMxW.js → WikiView-DtGwIt_Q.js} +1 -1
- package/web/assets/{add-scalar-classes-DhSSqZ5l.js → add-scalar-classes-dWEWPlFD.js} +1 -1
- package/web/assets/{agent.store-Co44dMZf.js → agent.store-CKLAkF9a.js} +1 -1
- package/web/assets/{auth-Bk1GP5sB.js → auth-Cg9BWTfK.js} +2 -2
- package/web/assets/{cloud-chat.store-CadB14dZ.js → cloud-chat.store-b-BHGz7I.js} +1 -1
- package/web/assets/{cloud-client-0zD_NI6q.js → cloud-client-D_zCiW0s.js} +2 -2
- package/web/assets/{cloud-session-Cjw54Y--.js → cloud-session-DOaDpZTy.js} +2 -2
- package/web/assets/{editor.store-DmM6ZlTm.js → editor.store-DCAZSeVG.js} +1 -1
- package/web/assets/i18n-D0afQEGs.js +1 -0
- package/web/assets/{index-B9DJf2V0.js → index-D8VRbyoP.js} +36 -36
- package/web/assets/index-DsezNbSM.css +1 -0
- package/web/assets/{modal-UK8xRSnh.js → modal-qYgTMkYb.js} +1 -1
- package/web/assets/{project-launch.store-B5nhdGdh.js → project-launch.store-y7JBMNiE.js} +1 -1
- package/web/assets/{project.store-Bm2JWNbd.js → project.store-DGJr0Qr9.js} +1 -1
- package/web/assets/{scenario.store-88w6P6s2.js → scenario.store-YWHL2_wu.js} +3 -3
- package/web/assets/{service.store-XS50iGKo.js → service.store-5jWsJxPx.js} +1 -1
- package/web/assets/{settings-scope-CKPq86HZ.js → settings-scope-Bv7QGPrt.js} +1 -1
- package/web/assets/{settings.store-BCJ0LJQA.js → settings.store-bEsB7oKb.js} +1 -1
- package/web/assets/{src-DBipSD56.js → src-C-D_y7ou.js} +1 -1
- package/web/assets/{src-Cgix2VOi.js → src-Dnwk6NpV.js} +2 -2
- package/web/assets/{src-BDZKZr9n.css → src-g1DRo8xZ.css} +1 -1
- package/web/assets/{trpc-CfuFkKgp.js → trpc-Drabzwpd.js} +3 -3
- package/web/assets/{useCloudOrg-J8DAnocE.js → useCloudOrg-BAQEtFPl.js} +1 -1
- package/web/assets/{useEnvVarAutocomplete-C6zOXYqi.js → useEnvVarAutocomplete-BqGTODUv.js} +1 -1
- package/web/assets/{useProjectCatalog-BB5IR6o8.js → useProjectCatalog-yocjIKt6.js} +1 -1
- package/web/assets/{useProjectCloudOrg-BnlKts7x.js → useProjectCloudOrg-CEN9-_OA.js} +1 -1
- package/web/assets/{useServiceUrlHost-hKbKtPMu.js → useServiceUrlHost-BuoPEXZX.js} +1 -1
- package/web/assets/{vue-draggable-plus-D5ni4jMk.js → vue-draggable-plus-DX4rTBiu.js} +1 -1
- package/web/index.html +17 -17
- package/agent-manager-THV3LJOF.js +0 -11
- package/chunk-ONVAH65J.js.map +0 -1
- package/settings-manager-QVQRJO6V.js +0 -10
- package/src-IODFUZ7A.js.map +0 -1
- package/web/assets/SettingsPage-BSSHxxjM.js +0 -2086
- package/web/assets/SettingsPage-W8YszhUL.css +0 -1
- package/web/assets/i18n-8FjeJaKW.js +0 -1
- package/web/assets/index-teBqdnuv.css +0 -1
- /package/{agent-manager-THV3LJOF.js.map → agent-manager-R7BPQO6D.js.map} +0 -0
- /package/{chat-XYCHMTFE.js.map → chat-LPML22J5.js.map} +0 -0
- /package/{chunk-NCO4OOYT.js.map → chunk-4LJQIQMN.js.map} +0 -0
- /package/{chunk-QF56Z6LI.js.map → chunk-KV4GJKXU.js.map} +0 -0
- /package/{chunk-FE53XX4M.js.map → chunk-NPMSBYXC.js.map} +0 -0
- /package/{companion-HBYSY2D5.js.map → companion-W3UMZWGH.js.map} +0 -0
- /package/{install-gate-JAEK4BDZ.js.map → install-gate-PVMGJDWE.js.map} +0 -0
- /package/{settings-manager-QVQRJO6V.js.map → settings-manager-XPLBO35P.js.map} +0 -0
- /package/{vault-resolver-PN3TYCLJ.js.map → vault-resolver-E7KPKA5C.js.map} +0 -0
package/mcp-server/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
-
import { z as
|
|
5
|
+
import { z as z26 } from "zod";
|
|
7
6
|
|
|
8
7
|
// src/session-token.ts
|
|
9
8
|
var RETRY_DELAY_MS = 1e3;
|
|
@@ -74,6 +73,10 @@ function startSessionToken(initial, baseUrl, fetchImpl = fetch) {
|
|
|
74
73
|
};
|
|
75
74
|
}
|
|
76
75
|
|
|
76
|
+
// src/server.ts
|
|
77
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
78
|
+
import { z as z25 } from "zod";
|
|
79
|
+
|
|
77
80
|
// ../ai-capabilities/dist/index.js
|
|
78
81
|
import { z as z23 } from "zod";
|
|
79
82
|
|
|
@@ -1406,21 +1409,21 @@ import { z as z24 } from "zod";
|
|
|
1406
1409
|
import { z as z32 } from "zod";
|
|
1407
1410
|
function toList(raw) {
|
|
1408
1411
|
if (!raw) return [];
|
|
1409
|
-
const
|
|
1410
|
-
if (
|
|
1412
|
+
const text2 = raw.trim();
|
|
1413
|
+
if (text2.startsWith("[")) {
|
|
1411
1414
|
try {
|
|
1412
|
-
const parsed = JSON.parse(
|
|
1415
|
+
const parsed = JSON.parse(text2);
|
|
1413
1416
|
if (Array.isArray(parsed)) return parsed.map((v) => String(v).trim()).filter(Boolean);
|
|
1414
1417
|
} catch {
|
|
1415
1418
|
}
|
|
1416
1419
|
}
|
|
1417
|
-
return
|
|
1420
|
+
return text2.split(",").map((v) => v.trim().replace(/^["'[]+|["'\]]+$/g, "")).filter(Boolean);
|
|
1418
1421
|
}
|
|
1419
1422
|
function clearable(raw, parse, key) {
|
|
1420
1423
|
if (raw === void 0) return {};
|
|
1421
|
-
const
|
|
1422
|
-
if (!
|
|
1423
|
-
return { [key]: parse(
|
|
1424
|
+
const text2 = String(raw).trim();
|
|
1425
|
+
if (!text2 || text2 === "null") return { [key]: null };
|
|
1426
|
+
return { [key]: parse(text2) };
|
|
1424
1427
|
}
|
|
1425
1428
|
function gitTarget(p) {
|
|
1426
1429
|
return {
|
|
@@ -1444,11 +1447,11 @@ function parseTyped(name, schema, raw) {
|
|
|
1444
1447
|
let result = raw.trim() === "null" ? schema.safeParse(null) : schema.safeParse(raw);
|
|
1445
1448
|
if (!result.success && raw.trim() === "null") result = schema.safeParse(raw);
|
|
1446
1449
|
if (!result.success) {
|
|
1447
|
-
const
|
|
1448
|
-
const json = listItem(
|
|
1449
|
-
if (json !==
|
|
1450
|
-
if (!result.success && !/^[[{]/.test(
|
|
1451
|
-
const list = schema.safeParse(toList(
|
|
1450
|
+
const text2 = raw.trim();
|
|
1451
|
+
const json = listItem(text2);
|
|
1452
|
+
if (json !== text2) result = schema.safeParse(json);
|
|
1453
|
+
if (!result.success && !/^[[{]/.test(text2)) {
|
|
1454
|
+
const list = schema.safeParse(toList(text2).map(listItem));
|
|
1452
1455
|
if (list.success) result = list;
|
|
1453
1456
|
}
|
|
1454
1457
|
}
|
|
@@ -1536,9 +1539,14 @@ var RUNEYA_CAPABILITIES = [
|
|
|
1536
1539
|
method: "GET",
|
|
1537
1540
|
params: [
|
|
1538
1541
|
{ name: "projectId", description: "Restrict to this project, from list_projects. Omit to list every service on the machine.", required: false },
|
|
1539
|
-
{ name: "orgId", description: "
|
|
1542
|
+
{ name: "orgId", description: "With projectId: its organization, needed only when the same project id exists in several. Alone: list the services of this whole organization.", required: false }
|
|
1540
1543
|
],
|
|
1541
|
-
|
|
1544
|
+
// `orgId` seul est une portée à part entière, que `service.list` sait filtrer :
|
|
1545
|
+
// l'omettre rendait toute la machine.
|
|
1546
|
+
buildInput: (p) => {
|
|
1547
|
+
if (p.projectId) return { projectId: p.projectId, ...p.orgId ? { orgId: p.orgId } : {} };
|
|
1548
|
+
return p.orgId ? { orgId: p.orgId } : void 0;
|
|
1549
|
+
}
|
|
1542
1550
|
},
|
|
1543
1551
|
{
|
|
1544
1552
|
name: "get_service_status",
|
|
@@ -1839,6 +1847,24 @@ var RUNEYA_CAPABILITIES = [
|
|
|
1839
1847
|
],
|
|
1840
1848
|
buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId })
|
|
1841
1849
|
},
|
|
1850
|
+
{
|
|
1851
|
+
name: "kanban_get_card_context",
|
|
1852
|
+
description: "Load the working context of a kanban card: the card, the board's columns, the team's guidelines for the board and the expected ending (move the card if needed, then comment). Call it first when the user asks you to work on a card, then follow it. It is the context a session started from the card in Runeya receives.",
|
|
1853
|
+
route: "kanban.cardContext",
|
|
1854
|
+
method: "GET",
|
|
1855
|
+
params: [
|
|
1856
|
+
{ name: "boardId", description: "The kanban board ID", required: true },
|
|
1857
|
+
{ name: "cardId", description: "The card ID", required: true },
|
|
1858
|
+
{ name: "projectId", description: "The project the work happens in, named in the context. Optional.", required: false },
|
|
1859
|
+
{ name: "orgId", description: "Its organization. Optional.", required: false }
|
|
1860
|
+
],
|
|
1861
|
+
buildInput: (p) => ({
|
|
1862
|
+
boardId: p.boardId,
|
|
1863
|
+
cardId: p.cardId,
|
|
1864
|
+
...p.projectId ? { projectId: p.projectId } : {},
|
|
1865
|
+
...p.orgId ? { orgId: p.orgId } : {}
|
|
1866
|
+
})
|
|
1867
|
+
},
|
|
1842
1868
|
{
|
|
1843
1869
|
name: "kanban_update_card",
|
|
1844
1870
|
description: "Update an existing kanban card. Only the fields you pass are changed; passing null to priority, color or deadline clears it. Prefer this over creating a second card when something needs correcting.",
|
|
@@ -2351,6 +2377,90 @@ function applyProjectAnchor(cap, params, anchor) {
|
|
|
2351
2377
|
return anchored;
|
|
2352
2378
|
}
|
|
2353
2379
|
|
|
2380
|
+
// src/server.ts
|
|
2381
|
+
function needsAnchor(cap, params) {
|
|
2382
|
+
const accepts = (name) => cap.params.some((p) => p.name === name);
|
|
2383
|
+
if (params["orgId"] || params["organizationId"]) return false;
|
|
2384
|
+
if (accepts("projectId")) return !params["projectId"];
|
|
2385
|
+
return ["orgId", "organizationId"].some((name) => accepts(name) && !params[name]);
|
|
2386
|
+
}
|
|
2387
|
+
var RETRY = /* @__PURE__ */ Symbol("retry");
|
|
2388
|
+
function text(value) {
|
|
2389
|
+
return { content: [{ type: "text", text: typeof value === "string" ? value : JSON.stringify(value, null, 2) }] };
|
|
2390
|
+
}
|
|
2391
|
+
function error(err) {
|
|
2392
|
+
return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true };
|
|
2393
|
+
}
|
|
2394
|
+
function createRuneyaMcpServer(opts) {
|
|
2395
|
+
const server2 = new McpServer({ name: "runeya", version: "1.0.0" });
|
|
2396
|
+
async function callCapability(cap, input) {
|
|
2397
|
+
const rawParams = toRawParams(input, cap);
|
|
2398
|
+
const raw = rawParams["authToken"];
|
|
2399
|
+
const explicit = raw && !raw.startsWith("$") && !opts.sessionToken.isInitial(raw) ? raw : null;
|
|
2400
|
+
const call = async () => {
|
|
2401
|
+
const target = await opts.target(input);
|
|
2402
|
+
const authToken = explicit ?? (target.authToken || opts.sessionToken.current() || opts.internalToken || void 0);
|
|
2403
|
+
if (!authToken) throw new Error("No auth token available");
|
|
2404
|
+
const anchor = target.projectAnchor && needsAnchor(cap, rawParams) ? await target.projectAnchor() : opts.projectAnchor;
|
|
2405
|
+
const params = applyProjectAnchor(cap, rawParams, anchor);
|
|
2406
|
+
try {
|
|
2407
|
+
return await runCapability(cap, target.baseUrl, params, authToken);
|
|
2408
|
+
} catch (err) {
|
|
2409
|
+
if (!explicit && target.forgetToken && /UNAUTHORIZED/.test(err.message)) {
|
|
2410
|
+
target.forgetToken();
|
|
2411
|
+
return RETRY;
|
|
2412
|
+
}
|
|
2413
|
+
throw err;
|
|
2414
|
+
}
|
|
2415
|
+
};
|
|
2416
|
+
let result = await call();
|
|
2417
|
+
if (result === RETRY) result = await call();
|
|
2418
|
+
if (result === RETRY) throw new Error("Runeya refuse le jeton de ce client, m\xEAme renouvel\xE9.");
|
|
2419
|
+
return result;
|
|
2420
|
+
}
|
|
2421
|
+
for (const cap of RUNEYA_CAPABILITIES) {
|
|
2422
|
+
server2.tool(cap.name, cap.description, { ...buildMcpShape(cap), ...opts.extraShape }, async (input) => {
|
|
2423
|
+
try {
|
|
2424
|
+
return text(await callCapability(cap, input));
|
|
2425
|
+
} catch (err) {
|
|
2426
|
+
return error(err);
|
|
2427
|
+
}
|
|
2428
|
+
});
|
|
2429
|
+
}
|
|
2430
|
+
registerWorkOnCardPrompt(server2, (input) => callCapability(CARD_CONTEXT, input), opts.extraShape !== void 0);
|
|
2431
|
+
return server2;
|
|
2432
|
+
}
|
|
2433
|
+
var CARD_CONTEXT = RUNEYA_CAPABILITIES.find((c) => c.name === "kanban_get_card_context");
|
|
2434
|
+
function registerWorkOnCardPrompt(server2, cardContext, withInstance) {
|
|
2435
|
+
const args = {
|
|
2436
|
+
boardId: z25.string().max(128).describe("The kanban board ID"),
|
|
2437
|
+
cardId: z25.string().max(128).describe("The card ID"),
|
|
2438
|
+
...withInstance ? { runeyaInstance: z25.string().max(16).optional().describe("pid of the Runeya instance, when several are running") } : {}
|
|
2439
|
+
};
|
|
2440
|
+
server2.prompt(
|
|
2441
|
+
"work_on_card",
|
|
2442
|
+
"Work on a Runeya kanban card: loads the card, the board guidelines and the expected ending.",
|
|
2443
|
+
args,
|
|
2444
|
+
async (input) => {
|
|
2445
|
+
const { boardId, cardId, runeyaInstance } = input;
|
|
2446
|
+
const pid = runeyaInstance ? Number(runeyaInstance) : void 0;
|
|
2447
|
+
const { context } = await cardContext({ boardId, cardId, ...pid ? { runeyaInstance: pid } : {} });
|
|
2448
|
+
return {
|
|
2449
|
+
description: `Carte ${cardId}`,
|
|
2450
|
+
messages: [{
|
|
2451
|
+
role: "user",
|
|
2452
|
+
content: {
|
|
2453
|
+
type: "text",
|
|
2454
|
+
text: `Je veux travailler sur cette carte du kanban Runeya. Voici son contexte, tel que Runeya le donne \xE0 une session lanc\xE9e depuis la carte : suis ces consignes, en particulier la fin attendue (d\xE9placer la carte si besoin, puis la commenter).
|
|
2455
|
+
|
|
2456
|
+
${context}`
|
|
2457
|
+
}
|
|
2458
|
+
}]
|
|
2459
|
+
};
|
|
2460
|
+
}
|
|
2461
|
+
);
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2354
2464
|
// src/index.ts
|
|
2355
2465
|
var BASE_URL = process.env["RUNEYA_BASE_URL"] ?? "http://localhost:4000";
|
|
2356
2466
|
var CONVERSATION_ID = process.env["RUNEYA_CONVERSATION_ID"] ?? "";
|
|
@@ -2361,31 +2471,17 @@ var PROJECT_ANCHOR = {
|
|
|
2361
2471
|
projectId: process.env["RUNEYA_PROJECT_ID"] || void 0,
|
|
2362
2472
|
orgId: process.env["RUNEYA_ORG_ID"] || void 0
|
|
2363
2473
|
};
|
|
2364
|
-
var server =
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
const explicit = raw && !raw.startsWith("$") && !sessionToken.isInitial(raw) ? raw : null;
|
|
2371
|
-
const authToken = explicit ?? (sessionToken.current() || INTERNAL_TOKEN || void 0);
|
|
2372
|
-
if (!authToken) throw new Error("No auth token available");
|
|
2373
|
-
const params = applyProjectAnchor(cap, rawParams, PROJECT_ANCHOR);
|
|
2374
|
-
const result = await runCapability(cap, BASE_URL, params, authToken);
|
|
2375
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
2376
|
-
} catch (err) {
|
|
2377
|
-
return {
|
|
2378
|
-
content: [{ type: "text", text: `Error: ${err.message}` }],
|
|
2379
|
-
isError: true
|
|
2380
|
-
};
|
|
2381
|
-
}
|
|
2382
|
-
});
|
|
2383
|
-
}
|
|
2474
|
+
var server = createRuneyaMcpServer({
|
|
2475
|
+
target: () => Promise.resolve({ baseUrl: BASE_URL }),
|
|
2476
|
+
sessionToken,
|
|
2477
|
+
internalToken: INTERNAL_TOKEN,
|
|
2478
|
+
projectAnchor: PROJECT_ANCHOR
|
|
2479
|
+
});
|
|
2384
2480
|
if (CONVERSATION_ID && INTERNAL_TOKEN) {
|
|
2385
2481
|
server.tool(
|
|
2386
2482
|
"ask_user",
|
|
2387
2483
|
"Ask the user a question and wait for their reply. Use this when you need clarification or input from the user to proceed.",
|
|
2388
|
-
{ question:
|
|
2484
|
+
{ question: z26.string().describe("The question to ask the user") },
|
|
2389
2485
|
async ({ question }) => {
|
|
2390
2486
|
try {
|
|
2391
2487
|
const res = await fetch(`${BASE_URL}/api/trpc/scenario.requestInput`, {
|
|
@@ -2400,8 +2496,8 @@ if (CONVERSATION_ID && INTERNAL_TOKEN) {
|
|
|
2400
2496
|
});
|
|
2401
2497
|
const json = await res.json();
|
|
2402
2498
|
const result = json["result"]?.["data"] ?? json;
|
|
2403
|
-
const
|
|
2404
|
-
return { content: [{ type: "text", text }] };
|
|
2499
|
+
const text2 = typeof result === "string" ? result : JSON.stringify(result);
|
|
2500
|
+
return { content: [{ type: "text", text: text2 }] };
|
|
2405
2501
|
} catch (err) {
|
|
2406
2502
|
return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true };
|
|
2407
2503
|
}
|