@mcoda/mswarm 0.1.108 → 0.1.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codali-executor.d.ts.map +1 -1
- package/dist/codali-executor.js +17 -3
- package/dist/codali-executor.js.map +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +55 -2
- package/dist/runtime.js.map +1 -1
- package/dist/vendor/codali/agents/AgentInventory.d.ts +56 -0
- package/dist/vendor/codali/agents/AgentInventory.d.ts.map +1 -0
- package/dist/vendor/codali/agents/AgentInventory.js +131 -0
- package/dist/vendor/codali/agents/RoleResolution.d.ts +49 -0
- package/dist/vendor/codali/agents/RoleResolution.d.ts.map +1 -0
- package/dist/vendor/codali/agents/RoleResolution.js +166 -0
- package/dist/vendor/codali/api/ChatCompletionsAdapter.d.ts +76 -0
- package/dist/vendor/codali/api/ChatCompletionsAdapter.d.ts.map +1 -0
- package/dist/vendor/codali/api/ChatCompletionsAdapter.js +54 -0
- package/dist/vendor/codali/api/CodaliApi.d.ts +78 -0
- package/dist/vendor/codali/api/CodaliApi.d.ts.map +1 -0
- package/dist/vendor/codali/api/CodaliApi.js +273 -0
- package/dist/vendor/codali/api/CodaliServer.d.ts +42 -0
- package/dist/vendor/codali/api/CodaliServer.d.ts.map +1 -0
- package/dist/vendor/codali/api/CodaliServer.js +118 -0
- package/dist/vendor/codali/cli/AskCommand.d.ts +66 -0
- package/dist/vendor/codali/cli/AskCommand.d.ts.map +1 -0
- package/dist/vendor/codali/cli/AskCommand.js +536 -0
- package/dist/vendor/codali/cli/AuthCommand.d.ts +19 -0
- package/dist/vendor/codali/cli/AuthCommand.d.ts.map +1 -0
- package/dist/vendor/codali/cli/AuthCommand.js +161 -0
- package/dist/vendor/codali/cli/ServeCommand.d.ts +5 -0
- package/dist/vendor/codali/cli/ServeCommand.d.ts.map +1 -0
- package/dist/vendor/codali/cli/ServeCommand.js +87 -0
- package/dist/vendor/codali/cli/ToolsCommand.d.ts +22 -0
- package/dist/vendor/codali/cli/ToolsCommand.d.ts.map +1 -0
- package/dist/vendor/codali/cli/ToolsCommand.js +208 -0
- package/dist/vendor/codali/cli.d.ts.map +1 -1
- package/dist/vendor/codali/cli.js +29 -1
- package/dist/vendor/codali/connectors/http/HttpToolDefinition.d.ts +74 -0
- package/dist/vendor/codali/connectors/http/HttpToolDefinition.d.ts.map +1 -0
- package/dist/vendor/codali/connectors/http/HttpToolDefinition.js +190 -0
- package/dist/vendor/codali/connectors/http/HttpToolSource.d.ts +18 -0
- package/dist/vendor/codali/connectors/http/HttpToolSource.d.ts.map +1 -0
- package/dist/vendor/codali/connectors/http/HttpToolSource.js +29 -0
- package/dist/vendor/codali/connectors/mcp/McpClient.d.ts +132 -0
- package/dist/vendor/codali/connectors/mcp/McpClient.d.ts.map +1 -0
- package/dist/vendor/codali/connectors/mcp/McpClient.js +215 -0
- package/dist/vendor/codali/connectors/mcp/McpServerRegistry.d.ts +75 -0
- package/dist/vendor/codali/connectors/mcp/McpServerRegistry.d.ts.map +1 -0
- package/dist/vendor/codali/connectors/mcp/McpServerRegistry.js +180 -0
- package/dist/vendor/codali/connectors/mcp/McpToolAdapter.d.ts +48 -0
- package/dist/vendor/codali/connectors/mcp/McpToolAdapter.d.ts.map +1 -0
- package/dist/vendor/codali/connectors/mcp/McpToolAdapter.js +101 -0
- package/dist/vendor/codali/connectors/mcp/McpToolSource.d.ts +27 -0
- package/dist/vendor/codali/connectors/mcp/McpToolSource.d.ts.map +1 -0
- package/dist/vendor/codali/connectors/mcp/McpToolSource.js +33 -0
- package/dist/vendor/codali/connectors/media/ImageGenerationTool.d.ts +43 -0
- package/dist/vendor/codali/connectors/media/ImageGenerationTool.d.ts.map +1 -0
- package/dist/vendor/codali/connectors/media/ImageGenerationTool.js +122 -0
- package/dist/vendor/codali/connectors/oauth/DeviceCodeAuth.d.ts +74 -0
- package/dist/vendor/codali/connectors/oauth/DeviceCodeAuth.d.ts.map +1 -0
- package/dist/vendor/codali/connectors/oauth/DeviceCodeAuth.js +153 -0
- package/dist/vendor/codali/docdex/DocdexClient.d.ts +2 -0
- package/dist/vendor/codali/docdex/DocdexClient.d.ts.map +1 -1
- package/dist/vendor/codali/docdex/DocdexClient.js +4 -0
- package/dist/vendor/codali/gateway/CodaliGateway.d.ts +51 -3
- package/dist/vendor/codali/gateway/CodaliGateway.d.ts.map +1 -1
- package/dist/vendor/codali/gateway/CodaliGateway.js +241 -3
- package/dist/vendor/codali/gateway/CodaliGatewayTypes.d.ts +34 -0
- package/dist/vendor/codali/gateway/CodaliGatewayTypes.d.ts.map +1 -1
- package/dist/vendor/codali/gateway/EvidenceNormalizer.d.ts.map +1 -1
- package/dist/vendor/codali/gateway/EvidenceNormalizer.js +98 -1
- package/dist/vendor/codali/gateway/Finalizer.d.ts +50 -0
- package/dist/vendor/codali/gateway/Finalizer.d.ts.map +1 -0
- package/dist/vendor/codali/gateway/Finalizer.js +79 -0
- package/dist/vendor/codali/gateway/GatewayPlanner.d.ts +13 -0
- package/dist/vendor/codali/gateway/GatewayPlanner.d.ts.map +1 -1
- package/dist/vendor/codali/gateway/GatewayPlanner.js +81 -16
- package/dist/vendor/codali/gateway/GatewayStateMachine.d.ts.map +1 -1
- package/dist/vendor/codali/gateway/GatewayStateMachine.js +6 -0
- package/dist/vendor/codali/gateway/GatewayTracer.d.ts +93 -0
- package/dist/vendor/codali/gateway/GatewayTracer.d.ts.map +1 -0
- package/dist/vendor/codali/gateway/GatewayTracer.js +214 -0
- package/dist/vendor/codali/gateway/LocalGatewayProvider.d.ts +59 -0
- package/dist/vendor/codali/gateway/LocalGatewayProvider.d.ts.map +1 -0
- package/dist/vendor/codali/gateway/LocalGatewayProvider.js +195 -0
- package/dist/vendor/codali/gateway/LocalGatewayTaskRunner.d.ts +79 -0
- package/dist/vendor/codali/gateway/LocalGatewayTaskRunner.d.ts.map +1 -0
- package/dist/vendor/codali/gateway/LocalGatewayTaskRunner.js +361 -0
- package/dist/vendor/codali/gateway/RelevanceJudge.d.ts +25 -0
- package/dist/vendor/codali/gateway/RelevanceJudge.d.ts.map +1 -0
- package/dist/vendor/codali/gateway/RelevanceJudge.js +124 -0
- package/dist/vendor/codali/gateway/ResponseSchema.d.ts +32 -0
- package/dist/vendor/codali/gateway/ResponseSchema.d.ts.map +1 -0
- package/dist/vendor/codali/gateway/ResponseSchema.js +120 -0
- package/dist/vendor/codali/gateway/TemporalContext.d.ts +36 -0
- package/dist/vendor/codali/gateway/TemporalContext.d.ts.map +1 -0
- package/dist/vendor/codali/gateway/TemporalContext.js +115 -0
- package/dist/vendor/codali/gateway/ToolCapabilityCompiler.d.ts +5 -0
- package/dist/vendor/codali/gateway/ToolCapabilityCompiler.d.ts.map +1 -1
- package/dist/vendor/codali/gateway/ToolCapabilityCompiler.js +27 -2
- package/dist/vendor/codali/gateway/ToolDescriptorSource.d.ts +6 -0
- package/dist/vendor/codali/gateway/ToolDescriptorSource.d.ts.map +1 -0
- package/dist/vendor/codali/gateway/ToolDescriptorSource.js +30 -0
- package/dist/vendor/codali/gateway/ToolExposure.d.ts +36 -0
- package/dist/vendor/codali/gateway/ToolExposure.d.ts.map +1 -0
- package/dist/vendor/codali/gateway/ToolExposure.js +154 -0
- package/dist/vendor/codali/index.d.ts +57 -0
- package/dist/vendor/codali/index.d.ts.map +1 -1
- package/dist/vendor/codali/index.js +45 -0
- package/dist/vendor/codali/providers/ClaudeCliProvider.d.ts +2 -0
- package/dist/vendor/codali/providers/ClaudeCliProvider.d.ts.map +1 -1
- package/dist/vendor/codali/providers/ClaudeCliProvider.js +2 -0
- package/dist/vendor/codali/providers/CodexCliProvider.d.ts +2 -0
- package/dist/vendor/codali/providers/CodexCliProvider.d.ts.map +1 -1
- package/dist/vendor/codali/providers/CodexCliProvider.js +2 -0
- package/dist/vendor/codali/providers/MswarmWorkerProvider.d.ts +2 -0
- package/dist/vendor/codali/providers/MswarmWorkerProvider.d.ts.map +1 -1
- package/dist/vendor/codali/providers/MswarmWorkerProvider.js +2 -0
- package/dist/vendor/codali/providers/OllamaRemoteProvider.d.ts +2 -0
- package/dist/vendor/codali/providers/OllamaRemoteProvider.d.ts.map +1 -1
- package/dist/vendor/codali/providers/OllamaRemoteProvider.js +2 -0
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.d.ts +2 -0
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.d.ts.map +1 -1
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.js +2 -0
- package/dist/vendor/codali/providers/ProviderTypes.d.ts +13 -0
- package/dist/vendor/codali/providers/ProviderTypes.d.ts.map +1 -1
- package/dist/vendor/codali/providers/ProviderTypes.js +1 -1
- package/dist/vendor/codali/runcontext/CredentialFile.d.ts +12 -0
- package/dist/vendor/codali/runcontext/CredentialFile.d.ts.map +1 -0
- package/dist/vendor/codali/runcontext/CredentialFile.js +81 -0
- package/dist/vendor/codali/runcontext/RunContextResolver.d.ts +126 -0
- package/dist/vendor/codali/runcontext/RunContextResolver.d.ts.map +1 -0
- package/dist/vendor/codali/runcontext/RunContextResolver.js +389 -0
- package/dist/vendor/codali/storage/CodaliDatasetPrivacyEngine.d.ts +1 -1
- package/dist/vendor/codali/storage/CodaliDatasetPrivacyEngine.d.ts.map +1 -1
- package/dist/vendor/codali/storage/CodaliDatasetPrivacyEngine.js +12 -0
- package/dist/vendor/codali/tools/ToolRegistry.d.ts +14 -1
- package/dist/vendor/codali/tools/ToolRegistry.d.ts.map +1 -1
- package/dist/vendor/codali/tools/ToolRegistry.js +38 -1
- package/dist/vendor/codali/tools/ToolTypes.d.ts +35 -0
- package/dist/vendor/codali/tools/ToolTypes.d.ts.map +1 -1
- package/dist/vendor/codali/tools/ToolTypes.js +21 -0
- package/dist/vendor/codali/tools/TruncateResult.d.ts +29 -0
- package/dist/vendor/codali/tools/TruncateResult.d.ts.map +1 -0
- package/dist/vendor/codali/tools/TruncateResult.js +91 -0
- package/dist/vendor/codali/tools/diff/DiffTool.d.ts.map +1 -1
- package/dist/vendor/codali/tools/diff/DiffTool.js +2 -0
- package/dist/vendor/codali/tools/docdex/DocdexTools.d.ts +21 -1
- package/dist/vendor/codali/tools/docdex/DocdexTools.d.ts.map +1 -1
- package/dist/vendor/codali/tools/docdex/DocdexTools.js +151 -17
- package/dist/vendor/codali/tools/filesystem/FileTools.d.ts.map +1 -1
- package/dist/vendor/codali/tools/filesystem/FileTools.js +8 -0
- package/dist/vendor/codali/tools/search/SearchTool.d.ts.map +1 -1
- package/dist/vendor/codali/tools/search/SearchTool.js +3 -1
- package/dist/vendor/codali/tools/shell/ShellTool.d.ts.map +1 -1
- package/dist/vendor/codali/tools/shell/ShellTool.js +2 -0
- package/package.json +3 -3
- package/scripts/stable-diffusion-cpp-auth-guard.py +475 -0
- package/scripts/stable-diffusion-cpp-openai-server.py +44 -0
package/dist/runtime.js
CHANGED
|
@@ -2282,6 +2282,41 @@ function mcodaAgentDefaultModel(agent) {
|
|
|
2282
2282
|
optionalText(agent.models?.find((model) => model.isDefault === true || model.is_default === true)?.model_name) ||
|
|
2283
2283
|
null);
|
|
2284
2284
|
}
|
|
2285
|
+
/**
|
|
2286
|
+
* The agent's base URL, but only when it names a runner on this machine.
|
|
2287
|
+
*
|
|
2288
|
+
* The catalogue publishes a mirror of each self-hosted agent back to the node,
|
|
2289
|
+
* and that mirror's base URL is the gateway. Serving a job from it sends the
|
|
2290
|
+
* request back out instead of to the model running here, so a loopback address
|
|
2291
|
+
* is what distinguishes the real runner from its reflection.
|
|
2292
|
+
*/
|
|
2293
|
+
function mcodaAgentLocalRunnerBaseUrl(agent) {
|
|
2294
|
+
const config = isRecord(agent.config) ? agent.config : {};
|
|
2295
|
+
const localRunner = isRecord(config.localRunner) ? config.localRunner : {};
|
|
2296
|
+
const baseUrl = readConfigString({ ...localRunner, ...config }, [
|
|
2297
|
+
"baseUrl",
|
|
2298
|
+
"base_url",
|
|
2299
|
+
"endpoint",
|
|
2300
|
+
"apiBaseUrl",
|
|
2301
|
+
"api_base_url"
|
|
2302
|
+
]);
|
|
2303
|
+
if (!baseUrl) {
|
|
2304
|
+
return null;
|
|
2305
|
+
}
|
|
2306
|
+
let host;
|
|
2307
|
+
try {
|
|
2308
|
+
host = new URL(baseUrl).hostname.toLowerCase();
|
|
2309
|
+
}
|
|
2310
|
+
catch {
|
|
2311
|
+
return null;
|
|
2312
|
+
}
|
|
2313
|
+
const isLoopback = host === "localhost" ||
|
|
2314
|
+
host === "::1" ||
|
|
2315
|
+
host === "0.0.0.0" ||
|
|
2316
|
+
host.endsWith(".localhost") ||
|
|
2317
|
+
/^127\./.test(host);
|
|
2318
|
+
return isLoopback ? baseUrl : null;
|
|
2319
|
+
}
|
|
2285
2320
|
function resolveCodaliProviderForAgent(agent) {
|
|
2286
2321
|
const adapter = optionalText(agent.adapter);
|
|
2287
2322
|
if (isLocalOpenAiCompatibleAdapter(adapter)) {
|
|
@@ -4825,7 +4860,16 @@ export class SelfHostedNodeRuntime {
|
|
|
4825
4860
|
async executeOpenAiToolPassthrough(job, agent) {
|
|
4826
4861
|
const baseUrl = optionalText(agent.baseUrl);
|
|
4827
4862
|
if (!baseUrl) {
|
|
4828
|
-
|
|
4863
|
+
/*
|
|
4864
|
+
* Name the agent. "agent has no local runner base URL" alone cannot be
|
|
4865
|
+
* acted on: a node holds several entries per model - the local runner and
|
|
4866
|
+
* the gateway's mirror of it - and this says nothing about which one was
|
|
4867
|
+
* resolved or whether it carried a config at all.
|
|
4868
|
+
*/
|
|
4869
|
+
throw new SelfHostedPreStartJobError("selected_agent_unavailable", `agent has no local runner base URL for OpenAI tool pass-through ` +
|
|
4870
|
+
`(slug=${optionalText(agent.slug) || "?"} adapter=${optionalText(agent.adapter) || "?"} ` +
|
|
4871
|
+
`runnerKind=${optionalText(agent.runnerKind) || "?"} ` +
|
|
4872
|
+
`localRunner=${agent.localRunner ? "yes" : "no"} model=${optionalText(agent.model) || "?"})`);
|
|
4829
4873
|
}
|
|
4830
4874
|
const headers = { "content-type": "application/json" };
|
|
4831
4875
|
const bearer = agent.authMode === "bearer"
|
|
@@ -5218,7 +5262,7 @@ export class SelfHostedNodeRuntime {
|
|
|
5218
5262
|
}
|
|
5219
5263
|
const rawAgents = await this.mcoda.listRawAgents();
|
|
5220
5264
|
const strictSelectedAgent = selectedSourceAgentSlug || selectedAgentSlug;
|
|
5221
|
-
const
|
|
5265
|
+
const matches = rawAgents.filter((entry) => {
|
|
5222
5266
|
const slug = optionalText(entry.slug);
|
|
5223
5267
|
if (strictSelectedAgent) {
|
|
5224
5268
|
return slug === strictSelectedAgent;
|
|
@@ -5226,6 +5270,15 @@ export class SelfHostedNodeRuntime {
|
|
|
5226
5270
|
const defaultModel = mcodaAgentDefaultModel(entry);
|
|
5227
5271
|
return slug === selected || defaultModel === selected;
|
|
5228
5272
|
});
|
|
5273
|
+
/*
|
|
5274
|
+
* A node carries two entries for the same model: the local runner, and the
|
|
5275
|
+
* gateway mirror that the catalogue publishes back to it. The mirror's base
|
|
5276
|
+
* URL is the gateway itself, so serving a job from it sends the request back
|
|
5277
|
+
* out to the gateway instead of to the model sitting on this machine - which
|
|
5278
|
+
* is why OpenAI tool pass-through reported having no local runner to call.
|
|
5279
|
+
* Take the entry that actually points at a runner here.
|
|
5280
|
+
*/
|
|
5281
|
+
const agent = matches.find((entry) => Boolean(mcodaAgentLocalRunnerBaseUrl(entry))) ?? matches[0];
|
|
5229
5282
|
if (!agent) {
|
|
5230
5283
|
throw new SelfHostedPreStartJobError("selected_agent_unavailable", `selected local mcoda agent ${selected} is not available on this node`);
|
|
5231
5284
|
}
|