@mcoda/agents 0.1.70 → 0.1.71

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.
@@ -1 +1 @@
1
- {"version":3,"file":"AgentService.d.ts","sourceRoot":"","sources":["../../src/AgentService/AgentService.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,EACL,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EAKpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAY7C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAsNhG,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,sBAAsB,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,qBAAa,YAAY;IAErB,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO;gBADP,IAAI,EAAE,gBAAgB,EACtB,OAAO,GAAE,mBAAwB;WAG9B,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC;IAKtC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAUhD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAIrE,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAInD,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAIpD,kBAAkB;YAMlB,kBAAkB;IA6BhC,OAAO,CAAC,kBAAk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AO,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;YAwP5F,mBAAmB;YAkBnB,uBAAuB;YAwBvB,mBAAmB;CAYlC"}
@@ -10,6 +10,7 @@ import { CodaliAdapter } from "../adapters/codali/CodaliAdapter.js";
10
10
  import { OllamaRemoteAdapter } from "../adapters/ollama/OllamaRemoteAdapter.js";
11
11
  import { OllamaCliAdapter } from "../adapters/ollama/OllamaCliAdapter.js";
12
12
  import { OpenAiAdapter } from "../adapters/openai/OpenAiAdapter.js";
13
+ import { MswarmWorkerAdapter } from "../adapters/mswarm/MswarmWorkerAdapter.js";
13
14
  import { OpenAiCliAdapter } from "../adapters/openai/OpenAiCliAdapter.js";
14
15
  import { ZhipuApiAdapter } from "../adapters/zhipu/ZhipuApiAdapter.js";
15
16
  import { QaAdapter } from "../adapters/qa/QaAdapter.js";
@@ -30,6 +31,7 @@ const SUPPORTED_ADAPTERS = new Set([
30
31
  "ollama-remote",
31
32
  "ollama-cli",
32
33
  "codali-cli",
34
+ "mswarm-worker",
33
35
  ]);
34
36
  const DEFAULT_JOB_PROMPT = "You are an mcoda agent that follows workspace runbooks and responds with actionable, concise output.";
35
37
  const DEFAULT_CHARACTER_PROMPT = "Write clearly, avoid hallucinations, cite assumptions, and prioritize risk mitigation for the user.";
@@ -76,6 +78,13 @@ const getManagedMswarmKind = (agent) => {
76
78
  selfHosted.managed === true) {
77
79
  return "self-hosted";
78
80
  }
81
+ const worker = record.mswarmWorker;
82
+ if (worker &&
83
+ typeof worker === "object" &&
84
+ !Array.isArray(worker) &&
85
+ worker.managed === true) {
86
+ return "worker";
87
+ }
79
88
  return undefined;
80
89
  };
81
90
  const isIoEnabled = () => {
@@ -288,12 +297,16 @@ export class AgentService {
288
297
  if (adapterType.endsWith("-api")) {
289
298
  if (hasSecret)
290
299
  return adapterType;
291
- const managedMswarmKind = adapterType === "openai-api" ? getManagedMswarmKind(agent) : undefined;
300
+ const managedMswarmKind = adapterType === "openai-api" || adapterType === "mswarm-worker"
301
+ ? getManagedMswarmKind(agent)
302
+ : undefined;
292
303
  if (managedMswarmKind) {
293
304
  const label = agent.slug ?? agent.id;
294
- const syncCommand = managedMswarmKind === "self-hosted"
295
- ? "mcoda self-hosted agent sync"
296
- : "mcoda cloud agent sync";
305
+ const syncCommand = managedMswarmKind === "worker"
306
+ ? "mcoda workers sync"
307
+ : managedMswarmKind === "self-hosted"
308
+ ? "mcoda self-hosted agent sync"
309
+ : "mcoda cloud agent sync";
297
310
  throw new Error(`AUTH_REQUIRED: Managed mswarm ${managedMswarmKind} agent ${label} is missing the synced API key; run \`mcoda config set mswarm-api-key <KEY>\` and \`${syncCommand}\`.`);
298
311
  }
299
312
  if (adapterType === "codex-api" || adapterType === "openai-api") {
@@ -322,6 +335,9 @@ export class AgentService {
322
335
  if (adapterType === "openai-api") {
323
336
  return new OpenAiAdapter(configWithAdapter);
324
337
  }
338
+ if (adapterType === "mswarm-worker") {
339
+ return new MswarmWorkerAdapter(configWithAdapter);
340
+ }
325
341
  if (adapterType === "zhipu-api") {
326
342
  return new ZhipuApiAdapter(configWithAdapter);
327
343
  }
@@ -0,0 +1,12 @@
1
+ import { AgentHealth } from "@mcoda/shared";
2
+ import { AdapterConfig, AgentAdapter, InvocationRequest, InvocationResult } from "../AdapterTypes.js";
3
+ export declare class MswarmWorkerAdapter implements AgentAdapter {
4
+ private readonly config;
5
+ private readonly worker;
6
+ private readonly runUrl;
7
+ constructor(config: AdapterConfig);
8
+ getCapabilities(): Promise<string[]>;
9
+ healthCheck(): Promise<AgentHealth>;
10
+ invoke(request: InvocationRequest): Promise<InvocationResult>;
11
+ }
12
+ //# sourceMappingURL=MswarmWorkerAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MswarmWorkerAdapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/mswarm/MswarmWorkerAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAsH5B,qBAAa,mBAAoB,YAAW,YAAY;IAI1C,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IACjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEH,MAAM,EAAE,aAAa;IAK5C,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAIpC,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IAsBnC,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;CA4DpE"}
@@ -0,0 +1,176 @@
1
+ const MAX_RESPONSE_DETAIL_CHARS = 500;
2
+ const SENSITIVE_METADATA_KEY = /(?:secret|token|api[_-]?key|encryption[_-]?key|repo[_-]?(?:id|key))/i;
3
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4
+ const resolveString = (value) => {
5
+ const raw = typeof value === "string" ? value.trim() : "";
6
+ return raw || undefined;
7
+ };
8
+ const resolveBoolean = (value) => typeof value === "boolean" ? value : undefined;
9
+ const readRecord = (record, key) => {
10
+ const value = record?.[key];
11
+ return isRecord(value) ? value : undefined;
12
+ };
13
+ const normalizeBaseUrl = (value) => value.replace(/\/+$/, "");
14
+ function resolveWorkerConfig(config) {
15
+ const anyConfig = config;
16
+ const agentConfig = config.agent
17
+ ?.config;
18
+ const worker = readRecord(anyConfig, "mswarmWorker") ?? readRecord(agentConfig, "mswarmWorker");
19
+ if (!worker || worker.managed !== true) {
20
+ throw new Error("mswarm-worker adapter requires a managed mswarmWorker config");
21
+ }
22
+ return worker;
23
+ }
24
+ function resolveRunUrl(config, worker) {
25
+ const explicit = resolveString(worker.apiRunUrl) ?? resolveString(worker.api_run_url);
26
+ if (explicit) {
27
+ return explicit;
28
+ }
29
+ const workerId = resolveString(worker.workerId) ??
30
+ resolveString(worker.worker_id) ??
31
+ resolveString(worker.remoteSlug);
32
+ if (!workerId) {
33
+ throw new Error("mswarm-worker adapter config is missing workerId");
34
+ }
35
+ const catalogBase = resolveString(worker.catalogBaseUrl) ??
36
+ resolveString(worker.catalog_base_url) ??
37
+ resolveString(config.baseUrl);
38
+ if (!catalogBase) {
39
+ throw new Error("mswarm-worker adapter config is missing catalogBaseUrl");
40
+ }
41
+ return `${normalizeBaseUrl(catalogBase)}/v1/swarm/workers/${encodeURIComponent(workerId)}/run`;
42
+ }
43
+ function parseWorkerOutput(payload) {
44
+ const direct = resolveString(payload.output);
45
+ if (direct !== undefined)
46
+ return direct;
47
+ const result = isRecord(payload.result) ? payload.result : {};
48
+ return resolveString(result.output) ?? JSON.stringify(payload);
49
+ }
50
+ const resolveIdempotencyKey = (metadata) => resolveString(metadata?.idempotencyKey) ??
51
+ resolveString(metadata?.idempotency_key) ??
52
+ resolveString(metadata?.runId) ??
53
+ resolveString(metadata?.run_id);
54
+ function sanitizeMetadataValue(value) {
55
+ if (Array.isArray(value)) {
56
+ return value.map((entry) => sanitizeMetadataValue(entry));
57
+ }
58
+ if (!isRecord(value)) {
59
+ return value;
60
+ }
61
+ const sanitized = {};
62
+ for (const [key, child] of Object.entries(value)) {
63
+ if (SENSITIVE_METADATA_KEY.test(key)) {
64
+ continue;
65
+ }
66
+ sanitized[key] = sanitizeMetadataValue(child);
67
+ }
68
+ return sanitized;
69
+ }
70
+ function buildResponseSummary(payload, result) {
71
+ const summary = {
72
+ runId: resolveString(payload.run_id) ?? resolveString(payload.runId),
73
+ requestId: resolveString(payload.request_id) ?? resolveString(payload.requestId),
74
+ status: resolveString(payload.status),
75
+ accepted: resolveBoolean(payload.accepted),
76
+ agent: sanitizeMetadataValue(payload.agent),
77
+ };
78
+ const resultMetadata = isRecord(result.runtime_metadata)
79
+ ? result.runtime_metadata
80
+ : isRecord(result.metadata)
81
+ ? result.metadata
82
+ : undefined;
83
+ if (resultMetadata) {
84
+ summary.resultMetadata = sanitizeMetadataValue(resultMetadata);
85
+ }
86
+ for (const [key, value] of Object.entries(summary)) {
87
+ if (value === undefined) {
88
+ delete summary[key];
89
+ }
90
+ }
91
+ return summary;
92
+ }
93
+ export class MswarmWorkerAdapter {
94
+ constructor(config) {
95
+ this.config = config;
96
+ this.worker = resolveWorkerConfig(config);
97
+ this.runUrl = resolveRunUrl(config, this.worker);
98
+ }
99
+ async getCapabilities() {
100
+ return this.config.capabilities ?? [];
101
+ }
102
+ async healthCheck() {
103
+ const configured = Boolean(this.config.apiKey);
104
+ const workerMetadata = readRecord(this.worker, "worker") ?? {};
105
+ const enabled = resolveBoolean(this.worker.enabled) ?? resolveBoolean(workerMetadata.enabled);
106
+ return {
107
+ agentId: this.config.agent.id,
108
+ status: configured && enabled !== false ? "healthy" : "unreachable",
109
+ lastCheckedAt: new Date().toISOString(),
110
+ details: {
111
+ source: "mswarm_worker",
112
+ workerId: resolveString(this.worker.workerId),
113
+ remoteSlug: resolveString(this.worker.remoteSlug),
114
+ reason: !configured
115
+ ? "missing_api_key"
116
+ : enabled === false
117
+ ? "worker_disabled"
118
+ : "catalog_metadata_only",
119
+ },
120
+ };
121
+ }
122
+ async invoke(request) {
123
+ if (!this.config.apiKey) {
124
+ throw new Error("AUTH_REQUIRED: Managed mswarm worker is missing the synced API key; run `mcoda config set mswarm-api-key <KEY>` and `mcoda workers sync`.");
125
+ }
126
+ const started = Date.now();
127
+ const response = await fetch(this.runUrl, {
128
+ method: "POST",
129
+ headers: {
130
+ "content-type": "application/json",
131
+ accept: "application/json",
132
+ "x-api-key": this.config.apiKey,
133
+ ...(resolveIdempotencyKey(request.metadata)
134
+ ? { "idempotency-key": resolveIdempotencyKey(request.metadata) }
135
+ : {}),
136
+ },
137
+ body: JSON.stringify({
138
+ text: request.input,
139
+ input: request.input,
140
+ metadata: request.metadata ?? {},
141
+ }),
142
+ });
143
+ const responseText = await response.text();
144
+ let payload = {};
145
+ if (responseText.trim()) {
146
+ try {
147
+ const parsed = JSON.parse(responseText);
148
+ payload = isRecord(parsed) ? parsed : { output: responseText };
149
+ }
150
+ catch {
151
+ payload = { output: responseText };
152
+ }
153
+ }
154
+ if (!response.ok) {
155
+ throw new Error(`mswarm_worker request failed (${response.status}): ${responseText.slice(0, MAX_RESPONSE_DETAIL_CHARS) || response.statusText}`);
156
+ }
157
+ const result = isRecord(payload.result) ? payload.result : {};
158
+ const responseSummary = buildResponseSummary(payload, result);
159
+ return {
160
+ output: parseWorkerOutput(payload),
161
+ adapter: "mswarm-worker",
162
+ model: resolveString(payload.model) ??
163
+ resolveString(result.model) ??
164
+ this.config.model,
165
+ metadata: {
166
+ mswarmWorker: {
167
+ runUrl: this.runUrl,
168
+ workerId: resolveString(this.worker.workerId),
169
+ remoteSlug: resolveString(this.worker.remoteSlug),
170
+ durationMs: Date.now() - started,
171
+ responseSummary,
172
+ },
173
+ },
174
+ };
175
+ }
176
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAiAdapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/openai/OpenAiAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAEjB,MAAM,oBAAoB,CAAC;AAsW5B,KAAK,YAAY,GAAG,aAAa,GAAG;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC,CAAC;AAEF,qBAAa,aAAc,YAAW,YAAY;IAMpC,OAAO,CAA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M;IAL1B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,SAAS,CAAsC;gBAEnC,MAAM,EAAE,YAAY;IAUlC,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAIpC,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IA6GnC,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAyC5D,YAAY,CAAC,OAAO,EAAE,iBAAiB,GAAG,cAAc,CAAC,gBAAgB,EAAE,IAAI,EAAE,OAAO,CAAC;IAyFhG,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,SAAS;IA4BjB,OAAO,CAAC,oBAAoB;CAU7B"}
@@ -91,7 +91,8 @@ const isManagedMswarmConfig = (config) => {
91
91
  const agentConfig = config.agent?.config;
92
92
  const cloud = readRecord(anyConfig, "mswarmCloud") ?? readRecord(agentConfig, "mswarmCloud");
93
93
  const selfHosted = readRecord(anyConfig, "mswarmSelfHosted") ?? readRecord(agentConfig, "mswarmSelfHosted");
94
- return cloud?.managed === true || selfHosted?.managed === true;
94
+ const worker = readRecord(anyConfig, "mswarmWorker") ?? readRecord(agentConfig, "mswarmWorker");
95
+ return cloud?.managed === true || selfHosted?.managed === true || worker?.managed === true;
95
96
  };
96
97
  const resolveDocdexContext = (config, metadata) => {
97
98
  if (!isManagedMswarmConfig(config))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcoda/agents",
3
- "version": "0.1.70",
3
+ "version": "0.1.71",
4
4
  "description": "Agent registry and capabilities for mcoda.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -30,8 +30,8 @@
30
30
  "access": "public"
31
31
  },
32
32
  "dependencies": {
33
- "@mcoda/shared": "0.1.70",
34
- "@mcoda/db": "0.1.70"
33
+ "@mcoda/shared": "0.1.71",
34
+ "@mcoda/db": "0.1.71"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "tsc -p tsconfig.json",