@mcoda/agent-setup 0.1.70 → 0.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -0
- package/dist/headless/catalog.d.ts +3 -0
- package/dist/headless/catalog.d.ts.map +1 -1
- package/dist/headless/catalog.js +26 -0
- package/dist/headless/normalization.d.ts.map +1 -1
- package/dist/headless/normalization.js +22 -7
- package/dist/react/index.d.ts +4 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +53 -17
- package/dist/server/cliRuntime.d.ts.map +1 -1
- package/dist/server/cliRuntime.js +26 -1
- package/dist/server/httpHandlers.d.ts.map +1 -1
- package/dist/server/httpHandlers.js +51 -0
- package/dist/server/inMemoryRuntime.d.ts +1 -0
- package/dist/server/inMemoryRuntime.d.ts.map +1 -1
- package/dist/server/inMemoryRuntime.js +32 -1
- package/dist/server/programmaticRuntime.d.ts +1 -0
- package/dist/server/programmaticRuntime.d.ts.map +1 -1
- package/dist/server/programmaticRuntime.js +115 -1
- package/dist/server/service.d.ts.map +1 -1
- package/dist/server/service.js +46 -3
- package/dist/server/settingsStore.d.ts.map +1 -1
- package/dist/server/settingsStore.js +2 -0
- package/dist/types.d.ts +39 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/styles/react.css +7 -1
package/README.md
CHANGED
|
@@ -15,6 +15,12 @@ a preinstalled or configured `mcoda` CLI/client tool. When an admin submits a
|
|
|
15
15
|
real mswarm API key through `configureMswarmApiKey()`, subsequent cloud and
|
|
16
16
|
self-hosted catalog reads use the real mswarm API via `MswarmApi`.
|
|
17
17
|
|
|
18
|
+
For user-scoped mswarm integrations, `configureMswarmApiKey()` can receive
|
|
19
|
+
non-secret connection metadata such as tenant ID, product slug, owner user ID,
|
|
20
|
+
feature key, and installation ID. The default runtime validates tenant,
|
|
21
|
+
product, and API-key identity against mswarm runtime usage limits when
|
|
22
|
+
available, then exposes the stored metadata as `snapshot.mswarmConnection`.
|
|
23
|
+
|
|
18
24
|
React consumers can use the packaged default stylesheet:
|
|
19
25
|
|
|
20
26
|
```ts
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EAGtB,MAAM,YAAY,CAAC;AAEpB,KAAK,SAAS,GAAG,CACf,KAAK,EAAE,MAAM,GAAG,GAAG,EACnB,IAAI,CAAC,EAAE;IACL,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,KACE,OAAO,CAAC;IACX,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EACX,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAChE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gCAAgC,GACtC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EAGtB,MAAM,YAAY,CAAC;AAEpB,KAAK,SAAS,GAAG,CACf,KAAK,EAAE,MAAM,GAAG,GAAG,EACnB,IAAI,CAAC,EAAE;IACL,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,KACE,OAAO,CAAC;IACX,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EACX,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAChE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gCAAgC,GACtC,qBAAqB,CAyFvB"}
|
package/dist/client.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { McodaAgentCatalogEntry, McodaSelfHostedServer } from "../types.js";
|
|
2
2
|
export declare function isCloudAgent(agent: McodaAgentCatalogEntry): boolean;
|
|
3
3
|
export declare function isSelfHostedAgent(agent: McodaAgentCatalogEntry): boolean;
|
|
4
|
+
export declare function isWorkerAgent(agent: McodaAgentCatalogEntry): boolean;
|
|
4
5
|
export declare function syncedCloudSlug(agent: McodaAgentCatalogEntry): string;
|
|
5
6
|
export declare function syncedSelfHostedSlug(agent: McodaAgentCatalogEntry): string;
|
|
7
|
+
export declare function syncedWorkerSlug(agent: McodaAgentCatalogEntry): string;
|
|
6
8
|
export declare function mergeCatalogEntries(local: McodaAgentCatalogEntry, catalog?: McodaAgentCatalogEntry): McodaAgentCatalogEntry;
|
|
7
9
|
export declare function buildCloudAgentOptions(localAgents: McodaAgentCatalogEntry[], cloudCatalogAgents: McodaAgentCatalogEntry[]): McodaAgentCatalogEntry[];
|
|
8
10
|
export declare function buildSelfHostedServerOptions(localAgents: McodaAgentCatalogEntry[], remoteAgents: McodaAgentCatalogEntry[]): McodaSelfHostedServer[];
|
|
11
|
+
export declare function buildWorkerAgentOptions(localAgents: McodaAgentCatalogEntry[], workerCatalogAgents: McodaAgentCatalogEntry[]): McodaAgentCatalogEntry[];
|
|
9
12
|
export declare function filterAgentOptions(agents: McodaAgentCatalogEntry[], query: string): McodaAgentCatalogEntry[];
|
|
10
13
|
export declare function resolveRunnableSelectionSlug(slug: string, localAgents: McodaAgentCatalogEntry[]): string;
|
|
11
14
|
export declare function getVirtualAgentWindow<T>(items: T[], input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/headless/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/headless/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAmBrB,wBAAgB,YAAY,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAMnE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAOxE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAMpE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAIrE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAA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FIX = "mswarm-cloud-";
|
|
2
2
|
const SELF_HOSTED_PREFIX = "mswarm-self-hosted-";
|
|
3
|
+
const WORKER_PREFIX = "mswarm-worker-";
|
|
3
4
|
const normalizeSlugPart = (value) => value
|
|
4
5
|
.trim()
|
|
5
6
|
.toLowerCase()
|
|
@@ -18,6 +19,11 @@ export function isSelfHostedAgent(agent) {
|
|
|
18
19
|
agent.slug.startsWith(SELF_HOSTED_PREFIX) ||
|
|
19
20
|
Boolean(agent.nodeId || agent.serverName || agent.serverId));
|
|
20
21
|
}
|
|
22
|
+
export function isWorkerAgent(agent) {
|
|
23
|
+
return (agent.source === "worker_catalog" ||
|
|
24
|
+
agent.managedKind === "worker" ||
|
|
25
|
+
agent.slug.startsWith(WORKER_PREFIX));
|
|
26
|
+
}
|
|
21
27
|
export function syncedCloudSlug(agent) {
|
|
22
28
|
if (agent.slug.startsWith(CLOUD_PREFIX))
|
|
23
29
|
return agent.slug;
|
|
@@ -30,6 +36,12 @@ export function syncedSelfHostedSlug(agent) {
|
|
|
30
36
|
const remote = agent.remoteSlug ?? agent.slug;
|
|
31
37
|
return `${SELF_HOSTED_PREFIX}${normalizeSlugPart(remote) || "agent"}`;
|
|
32
38
|
}
|
|
39
|
+
export function syncedWorkerSlug(agent) {
|
|
40
|
+
if (agent.slug.startsWith(WORKER_PREFIX))
|
|
41
|
+
return agent.slug;
|
|
42
|
+
const remote = (agent.remoteSlug ?? agent.slug).replace(/^worker_/i, "");
|
|
43
|
+
return `${WORKER_PREFIX}${normalizeSlugPart(remote) || "agent"}`;
|
|
44
|
+
}
|
|
33
45
|
export function mergeCatalogEntries(local, catalog) {
|
|
34
46
|
if (!catalog)
|
|
35
47
|
return local;
|
|
@@ -105,6 +117,17 @@ export function buildSelfHostedServerOptions(localAgents, remoteAgents) {
|
|
|
105
117
|
}))
|
|
106
118
|
.sort((left, right) => left.label.localeCompare(right.label));
|
|
107
119
|
}
|
|
120
|
+
export function buildWorkerAgentOptions(localAgents, workerCatalogAgents) {
|
|
121
|
+
const catalogByLocalSlug = new Map(workerCatalogAgents.map((agent) => [syncedWorkerSlug(agent), agent]));
|
|
122
|
+
const synced = localAgents
|
|
123
|
+
.filter(isWorkerAgent)
|
|
124
|
+
.map((agent) => mergeCatalogEntries(agent, catalogByLocalSlug.get(agent.slug)));
|
|
125
|
+
const localSlugs = new Set(synced.map((agent) => agent.slug));
|
|
126
|
+
const unsynced = workerCatalogAgents
|
|
127
|
+
.filter((agent) => !localSlugs.has(syncedWorkerSlug(agent)))
|
|
128
|
+
.map((agent) => ({ ...agent, synced: false }));
|
|
129
|
+
return sortAgents([...synced, ...unsynced]);
|
|
130
|
+
}
|
|
108
131
|
export function filterAgentOptions(agents, query) {
|
|
109
132
|
const terms = query
|
|
110
133
|
.trim()
|
|
@@ -150,6 +173,9 @@ export function resolveRunnableSelectionSlug(slug, localAgents) {
|
|
|
150
173
|
agent.slug === syncedSelfHostedSlug({ ...agent, slug: trimmed })) {
|
|
151
174
|
return true;
|
|
152
175
|
}
|
|
176
|
+
if (isWorkerAgent(agent) && agent.slug === syncedWorkerSlug({ ...agent, slug: trimmed })) {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
153
179
|
return false;
|
|
154
180
|
});
|
|
155
181
|
return candidate?.slug ?? trimmed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalization.d.ts","sourceRoot":"","sources":["../../src/headless/normalization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAwBrB,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE;IACR,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC,GACA,sBAAsB,
|
|
1
|
+
{"version":3,"file":"normalization.d.ts","sourceRoot":"","sources":["../../src/headless/normalization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAwBrB,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE;IACR,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC,GACA,sBAAsB,CA2HxB;AAED,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE;IACR,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC,GACA,sBAAsB,EAAE,CAO1B"}
|
|
@@ -13,16 +13,27 @@ export function normalizeAgentCatalogEntry(raw, fallback) {
|
|
|
13
13
|
const config = recordValue(record.config);
|
|
14
14
|
const mswarmCloud = recordValue(config?.mswarmCloud);
|
|
15
15
|
const mswarmSelfHosted = recordValue(config?.mswarmSelfHosted);
|
|
16
|
-
const
|
|
16
|
+
const mswarmWorker = recordValue(config?.mswarmWorker);
|
|
17
|
+
const sync = recordValue(record.sync) ??
|
|
18
|
+
recordValue(mswarmSelfHosted?.sync) ??
|
|
19
|
+
recordValue(mswarmWorker?.sync);
|
|
17
20
|
const managedKind = fallback.managedKind ??
|
|
18
|
-
(mswarmCloud
|
|
21
|
+
(mswarmCloud
|
|
22
|
+
? "cloud"
|
|
23
|
+
: mswarmSelfHosted
|
|
24
|
+
? "self_hosted"
|
|
25
|
+
: mswarmWorker
|
|
26
|
+
? "worker"
|
|
27
|
+
: null);
|
|
19
28
|
const remoteSlug = stringValue(record.remoteSlug) ??
|
|
20
29
|
stringValue(record.remote_slug) ??
|
|
21
30
|
stringValue(mswarmCloud?.remoteSlug) ??
|
|
22
|
-
stringValue(mswarmSelfHosted?.remoteSlug)
|
|
31
|
+
stringValue(mswarmSelfHosted?.remoteSlug) ??
|
|
32
|
+
stringValue(mswarmWorker?.remoteSlug);
|
|
23
33
|
const slug = stringValue(record.slug) ??
|
|
24
34
|
stringValue(record.agent_slug) ??
|
|
25
35
|
stringValue(mswarmSelfHosted?.agentSlug) ??
|
|
36
|
+
stringValue(mswarmWorker?.workerId) ??
|
|
26
37
|
remoteSlug ??
|
|
27
38
|
"agent";
|
|
28
39
|
const defaultModel = stringValue(record.defaultModel) ??
|
|
@@ -30,7 +41,8 @@ export function normalizeAgentCatalogEntry(raw, fallback) {
|
|
|
30
41
|
stringValue(record.defaultModelId) ??
|
|
31
42
|
stringValue(record.model_id) ??
|
|
32
43
|
stringValue(mswarmCloud?.modelId) ??
|
|
33
|
-
stringValue(mswarmSelfHosted?.modelId)
|
|
44
|
+
stringValue(mswarmSelfHosted?.modelId) ??
|
|
45
|
+
stringValue(mswarmWorker?.modelId);
|
|
34
46
|
const model = stringValue(record.model) ??
|
|
35
47
|
stringValue(record.modelId) ??
|
|
36
48
|
stringValue(record.model_id) ??
|
|
@@ -65,12 +77,15 @@ export function normalizeAgentCatalogEntry(raw, fallback) {
|
|
|
65
77
|
displayName: stringValue(record.displayName) ??
|
|
66
78
|
stringValue(record.display_name) ??
|
|
67
79
|
stringValue(mswarmCloud?.displayName) ??
|
|
68
|
-
stringValue(mswarmSelfHosted?.displayName)
|
|
80
|
+
stringValue(mswarmSelfHosted?.displayName) ??
|
|
81
|
+
stringValue(mswarmWorker?.displayName),
|
|
69
82
|
provider: stringValue(record.provider) ??
|
|
70
83
|
stringValue(mswarmCloud?.provider) ??
|
|
71
|
-
stringValue(mswarmSelfHosted?.provider)
|
|
84
|
+
stringValue(mswarmSelfHosted?.provider) ??
|
|
85
|
+
stringValue(mswarmWorker?.provider),
|
|
72
86
|
adapter: stringValue(record.adapter) ??
|
|
73
|
-
stringValue(mswarmSelfHosted?.adapter)
|
|
87
|
+
stringValue(mswarmSelfHosted?.adapter) ??
|
|
88
|
+
(mswarmWorker ? "mswarm-worker" : null),
|
|
74
89
|
model,
|
|
75
90
|
defaultModel,
|
|
76
91
|
healthStatus,
|
package/dist/react/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface McodaAgentSetupLabels {
|
|
|
14
14
|
saveAssignments: string;
|
|
15
15
|
cloud: string;
|
|
16
16
|
selfHosted: string;
|
|
17
|
+
workers: string;
|
|
17
18
|
}
|
|
18
19
|
export interface McodaAgentSetupComponentOverrides {
|
|
19
20
|
AgentCatalogSummary: typeof AgentCatalogSummary;
|
|
@@ -23,6 +24,7 @@ export interface McodaAgentSetupComponentOverrides {
|
|
|
23
24
|
SelfHostedServerSelect: typeof SelfHostedServerSelect;
|
|
24
25
|
AgentSearchSelect: typeof AgentSearchSelect;
|
|
25
26
|
}
|
|
27
|
+
type AgentAssignmentSource = "cloud" | "self_hosted" | "worker";
|
|
26
28
|
export declare function McodaAgentSetupPage(props: McodaAgentSetupPageProps): React.ReactElement;
|
|
27
29
|
export declare function AgentCatalogSummary(props: {
|
|
28
30
|
snapshot: McodaAgentSetupSnapshot;
|
|
@@ -46,9 +48,9 @@ export declare function StageAgentAssignments(props: {
|
|
|
46
48
|
onSaveAssignments: () => void;
|
|
47
49
|
}): React.ReactElement;
|
|
48
50
|
export declare function AgentSourceSelect(props: {
|
|
49
|
-
value:
|
|
51
|
+
value: AgentAssignmentSource;
|
|
50
52
|
labels?: Partial<McodaAgentSetupLabels>;
|
|
51
|
-
onChange: (value:
|
|
53
|
+
onChange: (value: AgentAssignmentSource) => void;
|
|
52
54
|
}): React.ReactElement;
|
|
53
55
|
export declare function SelfHostedServerSelect(props: {
|
|
54
56
|
servers: McodaSelfHostedServer[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAA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11
|
};
|
|
11
12
|
export function McodaAgentSetupPage(props) {
|
|
12
13
|
const labels = { ...DEFAULT_LABELS, ...(props.labels ?? {}) };
|
|
@@ -70,7 +71,7 @@ export function McodaAgentSetupPage(props) {
|
|
|
70
71
|
const next = await props.client.syncAgents();
|
|
71
72
|
setSnapshot(next);
|
|
72
73
|
setAssignments(next.assignments);
|
|
73
|
-
setStatusMessage("Cloud
|
|
74
|
+
setStatusMessage("Cloud, self-hosted, and Worker agent catalogs synced.");
|
|
74
75
|
}
|
|
75
76
|
catch (caught) {
|
|
76
77
|
setError(caught instanceof Error ? caught.message : String(caught));
|
|
@@ -96,7 +97,7 @@ export function McodaAgentSetupPage(props) {
|
|
|
96
97
|
setBusy(false);
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
|
-
return React.createElement("section", { className: joinClasses("mcoda-agent-setup", props.className) }, React.createElement("header", { className: "mcoda-agent-setup__header" }, React.createElement("div", { className: "mcoda-agent-setup__title-block" }, React.createElement("p", { className: "mcoda-agent-setup__eyebrow" }, "Runtime routing"), React.createElement("h1", null, props.title ?? "mcoda Agent Setup"), React.createElement("p", null, "Configure mswarm access and assign cloud
|
|
100
|
+
return React.createElement("section", { className: joinClasses("mcoda-agent-setup", props.className) }, React.createElement("header", { className: "mcoda-agent-setup__header" }, React.createElement("div", { className: "mcoda-agent-setup__title-block" }, React.createElement("p", { className: "mcoda-agent-setup__eyebrow" }, "Runtime routing"), React.createElement("h1", null, props.title ?? "mcoda Agent Setup"), React.createElement("p", null, "Configure mswarm access and assign cloud, self-hosted, or Worker mcoda targets to each runtime stage.")), React.createElement("button", {
|
|
100
101
|
type: "button",
|
|
101
102
|
className: "mcoda-agent-setup__button mcoda-agent-setup__button--secondary",
|
|
102
103
|
disabled: busy,
|
|
@@ -158,6 +159,10 @@ export function AgentCatalogSummary(props) {
|
|
|
158
159
|
label: "Self-hosted",
|
|
159
160
|
value: String(snapshot.catalog.selfHostedAgents.length),
|
|
160
161
|
detail: `${snapshot.catalog.selfHostedServers.length} servers`,
|
|
162
|
+
}), React.createElement(MetricCard, {
|
|
163
|
+
label: "Workers",
|
|
164
|
+
value: String(snapshot.catalog.workerAgents.length),
|
|
165
|
+
detail: "mswarm Worker catalog",
|
|
161
166
|
})), warningEntries.length
|
|
162
167
|
? React.createElement("ul", { className: "mcoda-agent-setup__warnings", "aria-label": "Catalog warnings" }, warningEntries.map(([key, value]) => React.createElement("li", { key }, `${key}: ${value}`)))
|
|
163
168
|
: null);
|
|
@@ -166,7 +171,7 @@ export function MswarmAccessCard(props) {
|
|
|
166
171
|
const labels = { ...DEFAULT_LABELS, ...(props.labels ?? {}) };
|
|
167
172
|
return React.createElement("section", { className: "mcoda-agent-setup__access" }, React.createElement("div", { className: "mcoda-agent-setup__card-heading" }, React.createElement("div", null, React.createElement("h2", null, "mswarm Access"), React.createElement("p", null, props.snapshot?.mswarmApiKeyConfigured
|
|
168
173
|
? "Replace the stored key or resync the catalog."
|
|
169
|
-
: "Add a key to load real cloud
|
|
174
|
+
: "Add a key to load real cloud, self-hosted, and Worker agents."))), React.createElement("label", { className: "mcoda-agent-setup__field" }, React.createElement("span", null, "API key"), React.createElement("input", {
|
|
170
175
|
type: "password",
|
|
171
176
|
value: props.apiKey,
|
|
172
177
|
autoComplete: "off",
|
|
@@ -200,6 +205,10 @@ export function StageAgentAssignments(props) {
|
|
|
200
205
|
const assignment = props.assignments[stage.stageKey];
|
|
201
206
|
if (!assignment)
|
|
202
207
|
continue;
|
|
208
|
+
if (props.snapshot.catalog.workerAgents.some((agent) => agent.slug === assignment)) {
|
|
209
|
+
nextSources[stage.stageKey] = "worker";
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
203
212
|
const selfHostedServer = props.snapshot.catalog.selfHostedServers.find((server) => server.agents.some((agent) => agent.slug === assignment));
|
|
204
213
|
if (selfHostedServer) {
|
|
205
214
|
nextSources[stage.stageKey] = "self_hosted";
|
|
@@ -212,7 +221,13 @@ export function StageAgentAssignments(props) {
|
|
|
212
221
|
}
|
|
213
222
|
setSources((current) => ({ ...current, ...nextSources }));
|
|
214
223
|
setServers((current) => ({ ...current, ...nextServers }));
|
|
215
|
-
}, [
|
|
224
|
+
}, [
|
|
225
|
+
props.assignments,
|
|
226
|
+
props.snapshot.catalog.cloudAgents,
|
|
227
|
+
props.snapshot.catalog.selfHostedServers,
|
|
228
|
+
props.snapshot.catalog.workerAgents,
|
|
229
|
+
props.stages,
|
|
230
|
+
]);
|
|
216
231
|
return React.createElement("section", { className: "mcoda-agent-setup__assignments" }, React.createElement("div", { className: "mcoda-agent-setup__card-heading" }, React.createElement("div", null, React.createElement("h2", null, "Stage Assignments"), React.createElement("p", null, "Select the agent that should run each app workflow stage.")), React.createElement("button", {
|
|
217
232
|
type: "button",
|
|
218
233
|
className: "mcoda-agent-setup__button mcoda-agent-setup__button--success",
|
|
@@ -221,15 +236,18 @@ export function StageAgentAssignments(props) {
|
|
|
221
236
|
}, labels.saveAssignments)), React.createElement("div", { className: "mcoda-agent-setup__stage-table-wrap" }, React.createElement("table", { className: "mcoda-agent-setup__stage-table" }, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", null, "Stage"), React.createElement("th", null, "Source"), React.createElement("th", null, "Self-hosted server"), React.createElement("th", null, "Agent"), React.createElement("th", null, "Status"))), React.createElement("tbody", null, props.stages.map((stage) => {
|
|
222
237
|
const selectedSlug = props.assignments[stage.stageKey] ?? "";
|
|
223
238
|
const source = sources[stage.stageKey] ??
|
|
224
|
-
(stage.preferredSource
|
|
239
|
+
defaultAssignmentSource(stage.preferredSource);
|
|
225
240
|
const serverId = servers[stage.stageKey];
|
|
226
241
|
const server = props.snapshot.catalog.selfHostedServers.find((candidate) => candidate.id === serverId) ?? props.snapshot.catalog.selfHostedServers[0];
|
|
227
242
|
const agents = source === "cloud"
|
|
228
243
|
? props.snapshot.catalog.cloudAgents
|
|
229
|
-
:
|
|
244
|
+
: source === "worker"
|
|
245
|
+
? props.snapshot.catalog.workerAgents
|
|
246
|
+
: server?.agents ?? [];
|
|
230
247
|
const allSelectableAgents = [
|
|
231
248
|
...props.snapshot.catalog.cloudAgents,
|
|
232
249
|
...props.snapshot.catalog.selfHostedServers.flatMap((candidate) => candidate.agents),
|
|
250
|
+
...props.snapshot.catalog.workerAgents,
|
|
233
251
|
];
|
|
234
252
|
const selectedAgent = allSelectableAgents.find((agent) => agent.slug === selectedSlug);
|
|
235
253
|
const agentSelectValue = agents.some((agent) => agent.slug === selectedSlug)
|
|
@@ -239,7 +257,9 @@ export function StageAgentAssignments(props) {
|
|
|
239
257
|
setSources((current) => ({ ...current, [stage.stageKey]: value }));
|
|
240
258
|
const nextSlug = value === "cloud"
|
|
241
259
|
? props.snapshot.catalog.cloudAgents[0]?.slug
|
|
242
|
-
:
|
|
260
|
+
: value === "worker"
|
|
261
|
+
? props.snapshot.catalog.workerAgents[0]?.slug
|
|
262
|
+
: firstSelfHostedAgentSlug(props.snapshot.catalog.selfHostedServers);
|
|
243
263
|
props.onAssignmentChange(stage.stageKey, nextSlug ?? null);
|
|
244
264
|
};
|
|
245
265
|
const onServerChange = (value) => {
|
|
@@ -259,7 +279,7 @@ export function StageAgentAssignments(props) {
|
|
|
259
279
|
value: server?.id ?? "",
|
|
260
280
|
onChange: onServerChange,
|
|
261
281
|
})
|
|
262
|
-
: React.createElement("span", { className: "mcoda-agent-setup__muted-pill" }, "Cloud catalog")), React.createElement("td", null, React.createElement(agentSelect, {
|
|
282
|
+
: React.createElement("span", { className: "mcoda-agent-setup__muted-pill" }, source === "worker" ? "Worker catalog" : "Cloud catalog")), React.createElement("td", null, React.createElement(agentSelect, {
|
|
263
283
|
agents,
|
|
264
284
|
value: agentSelectValue,
|
|
265
285
|
onChange: (slug) => props.onAssignmentChange(stage.stageKey, slug || null),
|
|
@@ -279,7 +299,11 @@ export function AgentSourceSelect(props) {
|
|
|
279
299
|
type: "button",
|
|
280
300
|
"aria-pressed": props.value === "self_hosted",
|
|
281
301
|
onClick: () => props.onChange("self_hosted"),
|
|
282
|
-
}, labels.selfHosted)
|
|
302
|
+
}, labels.selfHosted), React.createElement("button", {
|
|
303
|
+
type: "button",
|
|
304
|
+
"aria-pressed": props.value === "worker",
|
|
305
|
+
onClick: () => props.onChange("worker"),
|
|
306
|
+
}, labels.workers));
|
|
283
307
|
}
|
|
284
308
|
export function SelfHostedServerSelect(props) {
|
|
285
309
|
const [query, setQuery] = React.useState("");
|
|
@@ -464,20 +488,31 @@ function AgentStatusBadge(props) {
|
|
|
464
488
|
? "Cloud"
|
|
465
489
|
: kind === "self_hosted"
|
|
466
490
|
? "Self-hosted"
|
|
467
|
-
:
|
|
468
|
-
? "
|
|
469
|
-
: props.
|
|
470
|
-
? "
|
|
471
|
-
:
|
|
491
|
+
: kind === "worker"
|
|
492
|
+
? "Worker"
|
|
493
|
+
: props.agent
|
|
494
|
+
? "Local"
|
|
495
|
+
: props.slug
|
|
496
|
+
? "Missing"
|
|
497
|
+
: "Unset";
|
|
472
498
|
const className = kind === "cloud"
|
|
473
499
|
? "mcoda-agent-setup__badge mcoda-agent-setup__badge--info"
|
|
474
500
|
: kind === "self_hosted"
|
|
475
501
|
? "mcoda-agent-setup__badge mcoda-agent-setup__badge--success"
|
|
476
|
-
:
|
|
477
|
-
? "mcoda-agent-setup__badge"
|
|
478
|
-
:
|
|
502
|
+
: kind === "worker"
|
|
503
|
+
? "mcoda-agent-setup__badge mcoda-agent-setup__badge--worker"
|
|
504
|
+
: props.agent
|
|
505
|
+
? "mcoda-agent-setup__badge"
|
|
506
|
+
: "mcoda-agent-setup__badge mcoda-agent-setup__badge--warning";
|
|
479
507
|
return React.createElement("span", { className }, sourceLabel);
|
|
480
508
|
}
|
|
509
|
+
function defaultAssignmentSource(preferredSource) {
|
|
510
|
+
if (preferredSource === "self_hosted")
|
|
511
|
+
return "self_hosted";
|
|
512
|
+
if (preferredSource === "worker")
|
|
513
|
+
return "worker";
|
|
514
|
+
return "cloud";
|
|
515
|
+
}
|
|
481
516
|
function firstSelfHostedAgentSlug(servers) {
|
|
482
517
|
return servers.find((server) => server.agents.length > 0)?.agents[0]?.slug ?? null;
|
|
483
518
|
}
|
|
@@ -497,6 +532,7 @@ function prettySlug(slug) {
|
|
|
497
532
|
return slug
|
|
498
533
|
.replace(/^mswarm-cloud-/, "")
|
|
499
534
|
.replace(/^mswarm-self-hosted-/, "")
|
|
535
|
+
.replace(/^mswarm-worker-/, "")
|
|
500
536
|
.replace(/^mcoda-/, "")
|
|
501
537
|
.replace(/[-_]+/g, " ");
|
|
502
538
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliRuntime.d.ts","sourceRoot":"","sources":["../../src/server/cliRuntime.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CACX,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAC1C,OAAO,CAAC,OAAO,CAAC,CAAC;CACvB;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,GAAE,2BAAgC,GACtC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"cliRuntime.d.ts","sourceRoot":"","sources":["../../src/server/cliRuntime.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CACX,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAC1C,OAAO,CAAC,OAAO,CAAC,CAAC;CACvB;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,GAAE,2BAAgC,GACtC,mBAAmB,CAwIrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { normalizeAgentCatalogEntries } from "../headless/normalization.js";
|
|
3
|
-
import { isCloudAgent, isSelfHostedAgent } from "../headless/catalog.js";
|
|
3
|
+
import { isCloudAgent, isSelfHostedAgent, isWorkerAgent } from "../headless/catalog.js";
|
|
4
4
|
export function createCliMcodaRuntimeAdapter(input = {}) {
|
|
5
5
|
const command = input.command ?? "mcoda";
|
|
6
6
|
const run = input.runCommand ??
|
|
@@ -82,6 +82,31 @@ export function createCliMcodaRuntimeAdapter(input = {}) {
|
|
|
82
82
|
});
|
|
83
83
|
return (await listLocal(options)).filter(isSelfHostedAgent);
|
|
84
84
|
},
|
|
85
|
+
async listWorkerAgents(options) {
|
|
86
|
+
return runAgents([
|
|
87
|
+
"workers",
|
|
88
|
+
"list",
|
|
89
|
+
"--json",
|
|
90
|
+
...(options?.includeUnreachable ? ["--include-disabled"] : []),
|
|
91
|
+
], {
|
|
92
|
+
source: "worker_catalog",
|
|
93
|
+
synced: false,
|
|
94
|
+
managedKind: "worker",
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
async syncWorkerAgents(options) {
|
|
98
|
+
await run(command, [
|
|
99
|
+
"workers",
|
|
100
|
+
"sync",
|
|
101
|
+
"--prune",
|
|
102
|
+
"--json",
|
|
103
|
+
...(options?.includeUnreachable ? ["--include-disabled"] : []),
|
|
104
|
+
], {
|
|
105
|
+
cwd: input.cwd,
|
|
106
|
+
timeoutMs: input.timeoutMs,
|
|
107
|
+
});
|
|
108
|
+
return (await listLocal(options)).filter(isWorkerAgent);
|
|
109
|
+
},
|
|
85
110
|
listLocalAgents: listLocal,
|
|
86
111
|
};
|
|
87
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpHandlers.d.ts","sourceRoot":"","sources":["../../src/server/httpHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,
|
|
1
|
+
{"version":3,"file":"httpHandlers.d.ts","sourceRoot":"","sources":["../../src/server/httpHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,EAGvB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,2BAA2B;IAC1C,gBAAgB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC1E,gBAAgB,CACd,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,cAAc,CACZ,IAAI,CAAC,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,kBAAkB,CAChB,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,cAAc,CACZ,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,2BAA2B,CAAC,CAAC;CACzC;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,sBAAsB,GAC9B,2BAA2B,CA8E7B;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,sBAAsB,EAC/B,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,CAAC,OAAO,EAAE,0BAA0B,KAAK,OAAO,CAAC,2BAA2B,CAAC,CA8B/E"}
|
|
@@ -13,6 +13,7 @@ export function createMcodaAgentSetupHttpHandlers(service) {
|
|
|
13
13
|
reasonCode: stringValue(record.reason_code) ??
|
|
14
14
|
stringValue(record.reasonCode) ??
|
|
15
15
|
undefined,
|
|
16
|
+
connection: parseMswarmConnection(record.connection ?? record.mswarm_connection, record),
|
|
16
17
|
metadata: asOptionalRecord(record.metadata),
|
|
17
18
|
}, request));
|
|
18
19
|
},
|
|
@@ -115,6 +116,56 @@ function asOptionalRecord(value) {
|
|
|
115
116
|
const record = asRecord(value);
|
|
116
117
|
return Object.keys(record).length ? record : undefined;
|
|
117
118
|
}
|
|
119
|
+
function parseMswarmConnection(value, fallback = {}) {
|
|
120
|
+
const record = asRecord(value);
|
|
121
|
+
const connection = {
|
|
122
|
+
tenantId: stringValue(record.tenantId) ??
|
|
123
|
+
stringValue(record.tenant_id) ??
|
|
124
|
+
stringValue(fallback.tenantId) ??
|
|
125
|
+
stringValue(fallback.tenant_id),
|
|
126
|
+
productSlug: stringValue(record.productSlug) ??
|
|
127
|
+
stringValue(record.product_slug) ??
|
|
128
|
+
stringValue(fallback.productSlug) ??
|
|
129
|
+
stringValue(fallback.product_slug),
|
|
130
|
+
apiKeyId: stringValue(record.apiKeyId) ??
|
|
131
|
+
stringValue(record.api_key_id) ??
|
|
132
|
+
stringValue(fallback.apiKeyId) ??
|
|
133
|
+
stringValue(fallback.api_key_id),
|
|
134
|
+
ownerUserId: stringValue(record.ownerUserId) ??
|
|
135
|
+
stringValue(record.owner_user_id) ??
|
|
136
|
+
stringValue(fallback.ownerUserId) ??
|
|
137
|
+
stringValue(fallback.owner_user_id),
|
|
138
|
+
ownerKeycloakUserId: stringValue(record.ownerKeycloakUserId) ??
|
|
139
|
+
stringValue(record.owner_keycloak_user_id) ??
|
|
140
|
+
stringValue(fallback.ownerKeycloakUserId) ??
|
|
141
|
+
stringValue(fallback.owner_keycloak_user_id),
|
|
142
|
+
featureKey: stringValue(record.featureKey) ??
|
|
143
|
+
stringValue(record.feature_key) ??
|
|
144
|
+
stringValue(fallback.featureKey) ??
|
|
145
|
+
stringValue(fallback.feature_key),
|
|
146
|
+
installationId: stringValue(record.installationId) ??
|
|
147
|
+
stringValue(record.installation_id) ??
|
|
148
|
+
stringValue(fallback.installationId) ??
|
|
149
|
+
stringValue(fallback.installation_id),
|
|
150
|
+
installationStatus: stringValue(record.installationStatus) ??
|
|
151
|
+
stringValue(record.installation_status) ??
|
|
152
|
+
stringValue(fallback.installationStatus) ??
|
|
153
|
+
stringValue(fallback.installation_status),
|
|
154
|
+
validationMode: parseValidationMode(record.validationMode ??
|
|
155
|
+
record.validation_mode ??
|
|
156
|
+
fallback.validationMode ??
|
|
157
|
+
fallback.validation_mode),
|
|
158
|
+
};
|
|
159
|
+
return Object.values(connection).some((entry) => entry !== undefined)
|
|
160
|
+
? connection
|
|
161
|
+
: undefined;
|
|
162
|
+
}
|
|
163
|
+
function parseValidationMode(value) {
|
|
164
|
+
if (value === "auto" || value === "required" || value === "skip") {
|
|
165
|
+
return value;
|
|
166
|
+
}
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
118
169
|
function asStringNullRecord(value) {
|
|
119
170
|
const record = asRecord(value);
|
|
120
171
|
return Object.fromEntries(Object.entries(record).map(([key, entry]) => [
|
|
@@ -2,6 +2,7 @@ import type { McodaAgentCatalogEntry, McodaRuntimeAdapter } from "../types.js";
|
|
|
2
2
|
export interface InMemoryMcodaRuntimeAdapterInput {
|
|
3
3
|
cloudAgents?: McodaAgentCatalogEntry[];
|
|
4
4
|
selfHostedAgents?: McodaAgentCatalogEntry[];
|
|
5
|
+
workerAgents?: McodaAgentCatalogEntry[];
|
|
5
6
|
localAgents?: McodaAgentCatalogEntry[];
|
|
6
7
|
}
|
|
7
8
|
export declare function createInMemoryMcodaRuntimeAdapter(input?: InMemoryMcodaRuntimeAdapterInput): McodaRuntimeAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inMemoryRuntime.d.ts","sourceRoot":"","sources":["../../src/server/inMemoryRuntime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inMemoryRuntime.d.ts","sourceRoot":"","sources":["../../src/server/inMemoryRuntime.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,sBAAsB,EAKtB,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gCAAgC;IAC/C,WAAW,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACvC,gBAAgB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC5C,YAAY,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACxC,WAAW,CAAC,EAAE,sBAAsB,EAAE,CAAC;CACxC;AAED,wBAAgB,iCAAiC,CAC/C,KAAK,GAAE,gCAAqC,GAC3C,mBAAmB,CAkHrB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { syncedCloudSlug, syncedSelfHostedSlug, } from "../headless/catalog.js";
|
|
1
|
+
import { syncedCloudSlug, syncedSelfHostedSlug, syncedWorkerSlug, } from "../headless/catalog.js";
|
|
2
2
|
export function createInMemoryMcodaRuntimeAdapter(input = {}) {
|
|
3
3
|
let cloudAgents = input.cloudAgents?.map((agent) => ({ ...agent })) ?? [];
|
|
4
4
|
let selfHostedAgents = input.selfHostedAgents?.map((agent) => ({ ...agent })) ?? [];
|
|
5
|
+
let workerAgents = input.workerAgents?.map((agent) => ({ ...agent })) ?? [];
|
|
5
6
|
let localAgents = input.localAgents?.map((agent) => ({ ...agent })) ?? [];
|
|
6
7
|
let configuredApiKey = false;
|
|
7
8
|
const syncRemote = (remoteAgents, slugFor, managedKind) => {
|
|
@@ -44,6 +45,9 @@ export function createInMemoryMcodaRuntimeAdapter(input = {}) {
|
|
|
44
45
|
throw new Error("mswarm api key is required");
|
|
45
46
|
}
|
|
46
47
|
configuredApiKey = true;
|
|
48
|
+
return input.connection
|
|
49
|
+
? normalizeConnectionMetadata(input.connection)
|
|
50
|
+
: undefined;
|
|
47
51
|
},
|
|
48
52
|
async listCloudAgents(options) {
|
|
49
53
|
return filterProvider(cloudAgents, options).map((agent) => ({ ...agent }));
|
|
@@ -65,6 +69,15 @@ export function createInMemoryMcodaRuntimeAdapter(input = {}) {
|
|
|
65
69
|
}
|
|
66
70
|
return syncRemote(filterProvider(selfHostedAgents, options), syncedSelfHostedSlug, "self_hosted");
|
|
67
71
|
},
|
|
72
|
+
async listWorkerAgents(options) {
|
|
73
|
+
return filterProvider(workerAgents, options).map((agent) => ({ ...agent }));
|
|
74
|
+
},
|
|
75
|
+
async syncWorkerAgents(options) {
|
|
76
|
+
if (!configuredApiKey) {
|
|
77
|
+
throw new Error("mswarm api key is required");
|
|
78
|
+
}
|
|
79
|
+
return syncRemote(filterProvider(workerAgents, options), syncedWorkerSlug, "worker");
|
|
80
|
+
},
|
|
68
81
|
async listLocalAgents(options) {
|
|
69
82
|
return filterProvider(localAgents, options).map((agent) => ({ ...agent }));
|
|
70
83
|
},
|
|
@@ -87,3 +100,21 @@ export function createInMemoryMcodaRuntimeAdapter(input = {}) {
|
|
|
87
100
|
},
|
|
88
101
|
};
|
|
89
102
|
}
|
|
103
|
+
function normalizeConnectionMetadata(input) {
|
|
104
|
+
return {
|
|
105
|
+
tenantId: normalizeString(input.tenantId),
|
|
106
|
+
productSlug: normalizeString(input.productSlug),
|
|
107
|
+
apiKeyId: normalizeString(input.apiKeyId),
|
|
108
|
+
ownerUserId: normalizeString(input.ownerUserId),
|
|
109
|
+
ownerKeycloakUserId: normalizeString(input.ownerKeycloakUserId),
|
|
110
|
+
featureKey: normalizeString(input.featureKey),
|
|
111
|
+
installationId: normalizeString(input.installationId),
|
|
112
|
+
installationStatus: normalizeString(input.installationStatus),
|
|
113
|
+
validationStatus: "unverified",
|
|
114
|
+
validationErrors: [],
|
|
115
|
+
validatedAt: null,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function normalizeString(value) {
|
|
119
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
120
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"programmaticRuntime.d.ts","sourceRoot":"","sources":["../../src/server/programmaticRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"programmaticRuntime.d.ts","sourceRoot":"","sources":["../../src/server/programmaticRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAOlB,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAMV,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,oCAAoC;IACnD,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,yBAAyB,CAAC,EAAE,MAAM,CAAC;QACnC,qBAAqB,CAAC,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B;AAED,wBAAgB,qCAAqC,CACnD,KAAK,GAAE,oCAAyC,GAC/C,mBAAmB,CA4IrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentsApi, MswarmApi, MswarmConfigStore, } from "@mcoda/core";
|
|
2
2
|
import { normalizeAgentCatalogEntry } from "../headless/normalization.js";
|
|
3
|
-
import { isCloudAgent, isSelfHostedAgent } from "../headless/catalog.js";
|
|
3
|
+
import { isCloudAgent, isSelfHostedAgent, isWorkerAgent } from "../headless/catalog.js";
|
|
4
4
|
export function createProgrammaticMcodaRuntimeAdapter(input = {}) {
|
|
5
5
|
const createMswarmApi = async () => {
|
|
6
6
|
if (!input.store)
|
|
@@ -13,6 +13,7 @@ export function createProgrammaticMcodaRuntimeAdapter(input = {}) {
|
|
|
13
13
|
timeoutMs: input.mswarm?.timeoutMs ?? stored.timeoutMs,
|
|
14
14
|
agentSlugPrefix: input.mswarm?.agentSlugPrefix ?? stored.agentSlugPrefix,
|
|
15
15
|
selfHostedAgentSlugPrefix: input.mswarm?.selfHostedAgentSlugPrefix,
|
|
16
|
+
workerAgentSlugPrefix: input.mswarm?.workerAgentSlugPrefix,
|
|
16
17
|
});
|
|
17
18
|
};
|
|
18
19
|
const withMswarmApi = async (fn) => {
|
|
@@ -46,8 +47,10 @@ export function createProgrammaticMcodaRuntimeAdapter(input = {}) {
|
|
|
46
47
|
},
|
|
47
48
|
async configureMswarmApiKey(request) {
|
|
48
49
|
const store = input.store ?? new MswarmConfigStore();
|
|
50
|
+
const connection = await resolveMswarmConnectionMetadata(request.apiKey, request.connection, input.mswarm);
|
|
49
51
|
await store.saveApiKey(request.apiKey);
|
|
50
52
|
await MswarmApi.refreshManagedAgentAuth(request.apiKey);
|
|
53
|
+
return connection;
|
|
51
54
|
},
|
|
52
55
|
async listCloudAgents(options) {
|
|
53
56
|
return withMswarmApi(async (api) => {
|
|
@@ -77,6 +80,20 @@ export function createProgrammaticMcodaRuntimeAdapter(input = {}) {
|
|
|
77
80
|
await withMswarmApi((api) => api.syncSelfHostedAgents(toSelfHostedSyncOptions(options)));
|
|
78
81
|
return (await listLocal(options)).filter(isSelfHostedAgent);
|
|
79
82
|
},
|
|
83
|
+
async listWorkerAgents(options) {
|
|
84
|
+
return withMswarmApi(async (api) => {
|
|
85
|
+
const agents = await api.listAllWorkers(toWorkerOptions(options));
|
|
86
|
+
return agents.map((agent) => normalizeAgentCatalogEntry(agent, {
|
|
87
|
+
source: "worker_catalog",
|
|
88
|
+
synced: false,
|
|
89
|
+
managedKind: "worker",
|
|
90
|
+
}));
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
async syncWorkerAgents(options) {
|
|
94
|
+
await withMswarmApi((api) => api.syncWorkers(toWorkerSyncOptions(options)));
|
|
95
|
+
return (await listLocal(options)).filter(isWorkerAgent);
|
|
96
|
+
},
|
|
80
97
|
listLocalAgents: listLocal,
|
|
81
98
|
async testAgent(input) {
|
|
82
99
|
try {
|
|
@@ -110,6 +127,92 @@ function normalizeLocalAgent(agent) {
|
|
|
110
127
|
synced: true,
|
|
111
128
|
});
|
|
112
129
|
}
|
|
130
|
+
async function resolveMswarmConnectionMetadata(apiKey, input, options) {
|
|
131
|
+
const base = normalizeConnectionInput(input);
|
|
132
|
+
const validationMode = input?.validationMode ?? "auto";
|
|
133
|
+
if (validationMode === "skip") {
|
|
134
|
+
return base ? withValidation(base, "unverified", [], null) : undefined;
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
const api = await MswarmApi.create({ ...(options ?? {}), apiKey });
|
|
138
|
+
try {
|
|
139
|
+
const identity = await api.getRuntimeIdentity();
|
|
140
|
+
const connection = mergeRuntimeIdentity(base, identity);
|
|
141
|
+
const errors = validateConnection(base, identity);
|
|
142
|
+
if (errors.length) {
|
|
143
|
+
const message = errors.join("; ");
|
|
144
|
+
throw new Error(`mswarm connection mismatch: ${message}`);
|
|
145
|
+
}
|
|
146
|
+
return withValidation(connection, "verified", [], new Date().toISOString());
|
|
147
|
+
}
|
|
148
|
+
finally {
|
|
149
|
+
await api.close();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
154
|
+
if (validationMode === "required" || message.startsWith("mswarm connection mismatch:")) {
|
|
155
|
+
throw new Error(`mswarm connection validation failed: ${message}`);
|
|
156
|
+
}
|
|
157
|
+
return base
|
|
158
|
+
? withValidation(base, "unverified", [message], null)
|
|
159
|
+
: undefined;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function normalizeConnectionInput(input) {
|
|
163
|
+
if (!input)
|
|
164
|
+
return null;
|
|
165
|
+
const connection = {
|
|
166
|
+
tenantId: normalizeString(input.tenantId),
|
|
167
|
+
productSlug: normalizeString(input.productSlug),
|
|
168
|
+
apiKeyId: normalizeString(input.apiKeyId),
|
|
169
|
+
ownerUserId: normalizeString(input.ownerUserId),
|
|
170
|
+
ownerKeycloakUserId: normalizeString(input.ownerKeycloakUserId),
|
|
171
|
+
featureKey: normalizeString(input.featureKey),
|
|
172
|
+
installationId: normalizeString(input.installationId),
|
|
173
|
+
installationStatus: normalizeString(input.installationStatus),
|
|
174
|
+
};
|
|
175
|
+
return Object.values(connection).some((entry) => entry !== null)
|
|
176
|
+
? connection
|
|
177
|
+
: null;
|
|
178
|
+
}
|
|
179
|
+
function mergeRuntimeIdentity(base, identity) {
|
|
180
|
+
return {
|
|
181
|
+
tenantId: base?.tenantId ?? identity.tenantId,
|
|
182
|
+
productSlug: base?.productSlug ?? identity.productSlug,
|
|
183
|
+
apiKeyId: base?.apiKeyId ?? identity.apiKeyId,
|
|
184
|
+
ownerUserId: base?.ownerUserId ?? null,
|
|
185
|
+
ownerKeycloakUserId: base?.ownerKeycloakUserId ?? null,
|
|
186
|
+
featureKey: base?.featureKey ?? null,
|
|
187
|
+
installationId: base?.installationId ?? null,
|
|
188
|
+
installationStatus: base?.installationStatus ?? null,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function validateConnection(expected, actual) {
|
|
192
|
+
if (!expected)
|
|
193
|
+
return [];
|
|
194
|
+
const errors = [];
|
|
195
|
+
addMismatch(errors, "tenantId", expected.tenantId, actual.tenantId);
|
|
196
|
+
addMismatch(errors, "productSlug", expected.productSlug, actual.productSlug);
|
|
197
|
+
addMismatch(errors, "apiKeyId", expected.apiKeyId, actual.apiKeyId);
|
|
198
|
+
return errors;
|
|
199
|
+
}
|
|
200
|
+
function addMismatch(errors, field, expected, actual) {
|
|
201
|
+
if (expected && expected !== actual) {
|
|
202
|
+
errors.push(`${field} expected ${expected} but mswarm returned ${actual ?? "null"}`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function withValidation(connection, validationStatus, validationErrors, validatedAt) {
|
|
206
|
+
return {
|
|
207
|
+
...connection,
|
|
208
|
+
validationStatus,
|
|
209
|
+
validationErrors,
|
|
210
|
+
validatedAt,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function normalizeString(value) {
|
|
214
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
215
|
+
}
|
|
113
216
|
function toCloudOptions(options) {
|
|
114
217
|
return {
|
|
115
218
|
provider: options?.provider,
|
|
@@ -134,3 +237,14 @@ function toSelfHostedSyncOptions(options) {
|
|
|
134
237
|
pruneMissing: options?.pruneMissing ?? true,
|
|
135
238
|
};
|
|
136
239
|
}
|
|
240
|
+
function toWorkerOptions(options) {
|
|
241
|
+
return {
|
|
242
|
+
includeDisabled: options?.includeUnreachable ?? true,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function toWorkerSyncOptions(options) {
|
|
246
|
+
return {
|
|
247
|
+
includeDisabled: options?.includeUnreachable ?? true,
|
|
248
|
+
pruneMissing: options?.pruneMissing ?? true,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/server/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/server/service.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAGV,4BAA4B,EAC5B,sBAAsB,EAKvB,MAAM,aAAa,CAAC;AAIrB,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,4BAA4B,GACpC,sBAAsB,CA+MxB"}
|
package/dist/server/service.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defaultMcodaStageDefinitions } from "../defaultStages.js";
|
|
2
|
-
import { buildCloudAgentOptions, buildSelfHostedServerOptions, } from "../headless/catalog.js";
|
|
2
|
+
import { buildCloudAgentOptions, buildSelfHostedServerOptions, buildWorkerAgentOptions, } from "../headless/catalog.js";
|
|
3
3
|
import { createProgrammaticMcodaRuntimeAdapter } from "./programmaticRuntime.js";
|
|
4
4
|
const REMOTE_ATTEMPTS = 3;
|
|
5
5
|
export function createMcodaAgentSetupService(options) {
|
|
@@ -35,10 +35,11 @@ export function createMcodaAgentSetupService(options) {
|
|
|
35
35
|
const buildSnapshot = async (extraErrors = {}) => {
|
|
36
36
|
const settings = await options.settingsStore.load();
|
|
37
37
|
const errors = { ...extraErrors };
|
|
38
|
-
const [localAgents, cloudCatalogAgents, selfHostedCatalogAgents] = await Promise.all([
|
|
38
|
+
const [localAgents, cloudCatalogAgents, selfHostedCatalogAgents, workerCatalogAgents,] = await Promise.all([
|
|
39
39
|
capture(errors, "local_agents", () => runtime.listLocalAgents({ refreshHealth: true }), []),
|
|
40
40
|
captureRemote(errors, "cloud_agents", () => runtime.listCloudAgents(), []),
|
|
41
41
|
captureRemote(errors, "self_hosted_agents", () => runtime.listSelfHostedAgents({ includeUnreachable: true }), []),
|
|
42
|
+
captureRemote(errors, "worker_agents", () => runtime.listWorkerAgents(), []),
|
|
42
43
|
]);
|
|
43
44
|
const cloudAgents = errors.cloud_agents === undefined
|
|
44
45
|
? buildCloudAgentOptions(localAgents, cloudCatalogAgents)
|
|
@@ -46,10 +47,14 @@ export function createMcodaAgentSetupService(options) {
|
|
|
46
47
|
const selfHostedServers = errors.self_hosted_agents === undefined
|
|
47
48
|
? buildSelfHostedServerOptions(localAgents, selfHostedCatalogAgents)
|
|
48
49
|
: [];
|
|
50
|
+
const workerAgents = errors.worker_agents === undefined
|
|
51
|
+
? buildWorkerAgentOptions(localAgents, workerCatalogAgents)
|
|
52
|
+
: [];
|
|
49
53
|
const catalog = {
|
|
50
54
|
localAgents,
|
|
51
55
|
cloudAgents,
|
|
52
56
|
selfHostedAgents: selfHostedCatalogAgents,
|
|
57
|
+
workerAgents,
|
|
53
58
|
selfHostedServers,
|
|
54
59
|
errors,
|
|
55
60
|
generatedAt: new Date().toISOString(),
|
|
@@ -60,6 +65,7 @@ export function createMcodaAgentSetupService(options) {
|
|
|
60
65
|
mswarmApiKeyConfigured: settings.mswarmApiKeyConfigured,
|
|
61
66
|
mswarmApiKeyLast4: settings.mswarmApiKeyLast4,
|
|
62
67
|
mswarmConfiguredAt: settings.mswarmConfiguredAt,
|
|
68
|
+
mswarmConnection: settings.mswarmConnection ?? null,
|
|
63
69
|
stages,
|
|
64
70
|
assignments: {
|
|
65
71
|
...initialAssignments(stages),
|
|
@@ -81,12 +87,16 @@ export function createMcodaAgentSetupService(options) {
|
|
|
81
87
|
if (!apiKey) {
|
|
82
88
|
throw new Error("mswarm api key is required");
|
|
83
89
|
}
|
|
84
|
-
await runtime.configureMswarmApiKey(
|
|
90
|
+
const connection = await runtime.configureMswarmApiKey({
|
|
91
|
+
...input,
|
|
92
|
+
apiKey,
|
|
93
|
+
});
|
|
85
94
|
const configuredAt = new Date().toISOString();
|
|
86
95
|
await options.settingsStore.saveMswarmKeyMetadata({
|
|
87
96
|
configured: true,
|
|
88
97
|
last4: apiKey.slice(-4),
|
|
89
98
|
configuredAt,
|
|
99
|
+
connection: connection ?? fallbackMswarmConnection(input.connection),
|
|
90
100
|
actor: input.actor,
|
|
91
101
|
reasonCode: input.reasonCode,
|
|
92
102
|
});
|
|
@@ -132,6 +142,7 @@ export function createMcodaAgentSetupService(options) {
|
|
|
132
142
|
pruneMissing: true,
|
|
133
143
|
includeUnreachable: true,
|
|
134
144
|
}), []);
|
|
145
|
+
await captureRemote(errors, "worker_agent_sync", () => runtime.syncWorkerAgents({ pruneMissing: true }), []);
|
|
135
146
|
return errors;
|
|
136
147
|
}
|
|
137
148
|
}
|
|
@@ -141,6 +152,38 @@ function sleep(ms) {
|
|
|
141
152
|
function initialAssignments(stages) {
|
|
142
153
|
return Object.fromEntries(stages.map((stage) => [stage.stageKey, stage.defaultAgentSlug ?? null]));
|
|
143
154
|
}
|
|
155
|
+
function fallbackMswarmConnection(input) {
|
|
156
|
+
if (!input)
|
|
157
|
+
return null;
|
|
158
|
+
const connection = {
|
|
159
|
+
tenantId: normalizeString(input.tenantId),
|
|
160
|
+
productSlug: normalizeString(input.productSlug),
|
|
161
|
+
apiKeyId: normalizeString(input.apiKeyId),
|
|
162
|
+
ownerUserId: normalizeString(input.ownerUserId),
|
|
163
|
+
ownerKeycloakUserId: normalizeString(input.ownerKeycloakUserId),
|
|
164
|
+
featureKey: normalizeString(input.featureKey),
|
|
165
|
+
installationId: normalizeString(input.installationId),
|
|
166
|
+
installationStatus: normalizeString(input.installationStatus),
|
|
167
|
+
validationStatus: "unverified",
|
|
168
|
+
validationErrors: [],
|
|
169
|
+
validatedAt: null,
|
|
170
|
+
};
|
|
171
|
+
return [
|
|
172
|
+
connection.tenantId,
|
|
173
|
+
connection.productSlug,
|
|
174
|
+
connection.apiKeyId,
|
|
175
|
+
connection.ownerUserId,
|
|
176
|
+
connection.ownerKeycloakUserId,
|
|
177
|
+
connection.featureKey,
|
|
178
|
+
connection.installationId,
|
|
179
|
+
connection.installationStatus,
|
|
180
|
+
].some(Boolean)
|
|
181
|
+
? connection
|
|
182
|
+
: null;
|
|
183
|
+
}
|
|
184
|
+
function normalizeString(value) {
|
|
185
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
186
|
+
}
|
|
144
187
|
function validateAssignments(assignments, stages, localAgents) {
|
|
145
188
|
const stageByKey = new Map(stages.map((stage) => [stage.stageKey, stage]));
|
|
146
189
|
const validSlugs = new Set(localAgents.map((agent) => agent.slug));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settingsStore.d.ts","sourceRoot":"","sources":["../../src/server/settingsStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAErB,wBAAgB,qCAAqC,CACnD,OAAO,GAAE,OAAO,CAAC,0BAA0B,CAAM,GAChD,uBAAuB,
|
|
1
|
+
{"version":3,"file":"settingsStore.d.ts","sourceRoot":"","sources":["../../src/server/settingsStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAErB,wBAAgB,qCAAqC,CACnD,OAAO,GAAE,OAAO,CAAC,0BAA0B,CAAM,GAChD,uBAAuB,CAoCzB"}
|
|
@@ -4,6 +4,7 @@ export function createInMemoryMcodaAgentSettingsStore(initial = {}) {
|
|
|
4
4
|
mswarmApiKeyConfigured: initial.mswarmApiKeyConfigured ?? false,
|
|
5
5
|
mswarmApiKeyLast4: initial.mswarmApiKeyLast4 ?? null,
|
|
6
6
|
mswarmConfiguredAt: initial.mswarmConfiguredAt ?? null,
|
|
7
|
+
mswarmConnection: initial.mswarmConnection ?? null,
|
|
7
8
|
updatedAt: initial.updatedAt ?? null,
|
|
8
9
|
};
|
|
9
10
|
return {
|
|
@@ -20,6 +21,7 @@ export function createInMemoryMcodaAgentSettingsStore(initial = {}) {
|
|
|
20
21
|
mswarmApiKeyConfigured: input.configured,
|
|
21
22
|
mswarmApiKeyLast4: input.last4,
|
|
22
23
|
mswarmConfiguredAt: input.configuredAt,
|
|
24
|
+
mswarmConnection: input.connection ?? null,
|
|
23
25
|
updatedAt,
|
|
24
26
|
};
|
|
25
27
|
},
|
package/dist/types.d.ts
CHANGED
|
@@ -3,9 +3,35 @@ export interface McodaRuntimeInfo {
|
|
|
3
3
|
mode: McodaRuntimeMode;
|
|
4
4
|
requiresMcodaCli: boolean;
|
|
5
5
|
}
|
|
6
|
-
export type McodaAgentSource = "local_registry" | "cloud_catalog" | "self_hosted_catalog";
|
|
7
|
-
export type McodaAgentManagedKind = "cloud" | "self_hosted" | null;
|
|
8
|
-
export type McodaPreferredSource = "cloud" | "self_hosted" | "cloud_or_self_hosted" | null;
|
|
6
|
+
export type McodaAgentSource = "local_registry" | "cloud_catalog" | "self_hosted_catalog" | "worker_catalog";
|
|
7
|
+
export type McodaAgentManagedKind = "cloud" | "self_hosted" | "worker" | null;
|
|
8
|
+
export type McodaPreferredSource = "cloud" | "self_hosted" | "worker" | "cloud_or_self_hosted" | null;
|
|
9
|
+
export type McodaMswarmConnectionValidationMode = "auto" | "required" | "skip";
|
|
10
|
+
export type McodaMswarmConnectionValidationStatus = "unverified" | "verified" | "mismatch";
|
|
11
|
+
export interface McodaMswarmConnectionInput {
|
|
12
|
+
tenantId?: string | null;
|
|
13
|
+
productSlug?: string | null;
|
|
14
|
+
apiKeyId?: string | null;
|
|
15
|
+
ownerUserId?: string | null;
|
|
16
|
+
ownerKeycloakUserId?: string | null;
|
|
17
|
+
featureKey?: string | null;
|
|
18
|
+
installationId?: string | null;
|
|
19
|
+
installationStatus?: string | null;
|
|
20
|
+
validationMode?: McodaMswarmConnectionValidationMode;
|
|
21
|
+
}
|
|
22
|
+
export interface McodaMswarmConnectionMetadata {
|
|
23
|
+
tenantId: string | null;
|
|
24
|
+
productSlug: string | null;
|
|
25
|
+
apiKeyId: string | null;
|
|
26
|
+
ownerUserId: string | null;
|
|
27
|
+
ownerKeycloakUserId: string | null;
|
|
28
|
+
featureKey: string | null;
|
|
29
|
+
installationId: string | null;
|
|
30
|
+
installationStatus: string | null;
|
|
31
|
+
validationStatus: McodaMswarmConnectionValidationStatus;
|
|
32
|
+
validationErrors: string[];
|
|
33
|
+
validatedAt: string | null;
|
|
34
|
+
}
|
|
9
35
|
export interface McodaStageDefinition {
|
|
10
36
|
stageKey: string;
|
|
11
37
|
displayName: string;
|
|
@@ -57,6 +83,7 @@ export interface McodaAgentCatalog {
|
|
|
57
83
|
localAgents: McodaAgentCatalogEntry[];
|
|
58
84
|
cloudAgents: McodaAgentCatalogEntry[];
|
|
59
85
|
selfHostedAgents: McodaAgentCatalogEntry[];
|
|
86
|
+
workerAgents: McodaAgentCatalogEntry[];
|
|
60
87
|
selfHostedServers: McodaSelfHostedServer[];
|
|
61
88
|
errors: Record<string, string>;
|
|
62
89
|
generatedAt: string;
|
|
@@ -67,6 +94,7 @@ export interface McodaAgentSetupSnapshot {
|
|
|
67
94
|
mswarmApiKeyConfigured: boolean;
|
|
68
95
|
mswarmApiKeyLast4: string | null;
|
|
69
96
|
mswarmConfiguredAt: string | null;
|
|
97
|
+
mswarmConnection: McodaMswarmConnectionMetadata | null;
|
|
70
98
|
stages: McodaStageDefinition[];
|
|
71
99
|
assignments: Record<string, string | null>;
|
|
72
100
|
catalog: McodaAgentCatalog;
|
|
@@ -86,6 +114,7 @@ export interface McodaAgentSetupClient {
|
|
|
86
114
|
fetchSnapshot(): Promise<McodaAgentSetupSnapshot>;
|
|
87
115
|
configureMswarmApiKey(input: {
|
|
88
116
|
apiKey: string;
|
|
117
|
+
connection?: McodaMswarmConnectionInput;
|
|
89
118
|
reasonCode?: string;
|
|
90
119
|
metadata?: Record<string, unknown>;
|
|
91
120
|
}): Promise<McodaAgentSetupSnapshot>;
|
|
@@ -116,14 +145,17 @@ export interface McodaRuntimeAdapter {
|
|
|
116
145
|
runtime: McodaRuntimeInfo;
|
|
117
146
|
configureMswarmApiKey(input: {
|
|
118
147
|
apiKey: string;
|
|
148
|
+
connection?: McodaMswarmConnectionInput;
|
|
119
149
|
actor?: string;
|
|
120
150
|
reasonCode?: string;
|
|
121
151
|
metadata?: Record<string, unknown>;
|
|
122
|
-
}): Promise<void>;
|
|
152
|
+
}): Promise<McodaMswarmConnectionMetadata | void>;
|
|
123
153
|
listCloudAgents(input?: McodaAgentListInput): Promise<McodaAgentCatalogEntry[]>;
|
|
124
154
|
syncCloudAgents(input?: McodaAgentSyncInput): Promise<McodaAgentCatalogEntry[]>;
|
|
125
155
|
listSelfHostedAgents(input?: McodaAgentListInput): Promise<McodaAgentCatalogEntry[]>;
|
|
126
156
|
syncSelfHostedAgents(input?: McodaAgentSyncInput): Promise<McodaAgentCatalogEntry[]>;
|
|
157
|
+
listWorkerAgents(input?: McodaAgentListInput): Promise<McodaAgentCatalogEntry[]>;
|
|
158
|
+
syncWorkerAgents(input?: McodaAgentSyncInput): Promise<McodaAgentCatalogEntry[]>;
|
|
127
159
|
listLocalAgents(input?: McodaAgentListInput): Promise<McodaAgentCatalogEntry[]>;
|
|
128
160
|
testAgent?(input: {
|
|
129
161
|
slug: string;
|
|
@@ -136,6 +168,7 @@ export interface McodaAgentSettingsSnapshot {
|
|
|
136
168
|
mswarmApiKeyConfigured: boolean;
|
|
137
169
|
mswarmApiKeyLast4: string | null;
|
|
138
170
|
mswarmConfiguredAt: string | null;
|
|
171
|
+
mswarmConnection?: McodaMswarmConnectionMetadata | null;
|
|
139
172
|
updatedAt: string | null;
|
|
140
173
|
}
|
|
141
174
|
export interface McodaAgentSettingsStore {
|
|
@@ -144,6 +177,7 @@ export interface McodaAgentSettingsStore {
|
|
|
144
177
|
configured: boolean;
|
|
145
178
|
last4: string | null;
|
|
146
179
|
configuredAt: string;
|
|
180
|
+
connection?: McodaMswarmConnectionMetadata | null;
|
|
147
181
|
actor?: string;
|
|
148
182
|
reasonCode?: string;
|
|
149
183
|
}): Promise<void>;
|
|
@@ -171,6 +205,7 @@ export interface McodaAgentSetupService {
|
|
|
171
205
|
fetchSnapshot(request?: unknown): Promise<McodaAgentSetupSnapshot>;
|
|
172
206
|
configureMswarmApiKey(input: {
|
|
173
207
|
apiKey: string;
|
|
208
|
+
connection?: McodaMswarmConnectionInput;
|
|
174
209
|
actor?: string;
|
|
175
210
|
reasonCode?: string;
|
|
176
211
|
metadata?: Record<string, unknown>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,cAAc,GAAG,QAAQ,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,gBAAgB,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,MAAM,gBAAgB,GACxB,gBAAgB,GAChB,eAAe,GACf,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,M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,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,OAAO,CAAC;CACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcoda/agent-setup",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.72",
|
|
4
4
|
"description": "Turnkey mcoda/mswarm agent setup SDK for applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@mcoda/core": "0.1.
|
|
65
|
+
"@mcoda/core": "0.1.72"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": ">=18.2.0 || >=19.0.0",
|
package/styles/react.css
CHANGED
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
.mcoda-agent-setup__metric-grid {
|
|
179
179
|
display: grid;
|
|
180
180
|
gap: 12px;
|
|
181
|
-
grid-template-columns: repeat(
|
|
181
|
+
grid-template-columns: repeat(6, minmax(120px, 1fr));
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
.mcoda-agent-setup__metric {
|
|
@@ -255,6 +255,12 @@
|
|
|
255
255
|
color: #1d4ed8;
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
+
.mcoda-agent-setup__badge--worker {
|
|
259
|
+
background: #eef2ff;
|
|
260
|
+
border-color: #c7d2fe;
|
|
261
|
+
color: #3730a3;
|
|
262
|
+
}
|
|
263
|
+
|
|
258
264
|
.mcoda-agent-setup__warnings {
|
|
259
265
|
background: var(--mcoda-amber-soft);
|
|
260
266
|
border: 1px solid #fde68a;
|