@almadar/integrations 2.32.0 → 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +13 -3
- package/dist/index.js +89 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +94 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/{store-C03XILaI.d.ts → store-DaPuMedl.d.ts} +79 -27
- package/package.json +4 -4
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as IntegrationParams, I as IntegrationCallContext, d as IntegrationFactory } from '../BaseIntegration-BYlbMFlf.js';
|
|
2
|
-
import { o as IntegrationName, m as IntegrationActionName, n as IntegrationContracts, e as CredentialStore } from '../store-
|
|
2
|
+
import { o as IntegrationName, m as IntegrationActionName, n as IntegrationContracts, e as CredentialStore } from '../store-DaPuMedl.js';
|
|
3
3
|
import '@almadar/core';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/runtime/index.js
CHANGED
|
@@ -159,6 +159,10 @@ var serviceCredentials = {
|
|
|
159
159
|
],
|
|
160
160
|
arxiv: [
|
|
161
161
|
{ envVar: "ARXIV_TIMEOUT_MS", required: false, description: "Per-request timeout (ms)" }
|
|
162
|
+
],
|
|
163
|
+
rigger: [
|
|
164
|
+
{ envVar: "RIGGER_BASE_URL", required: false, description: "Local rigger service base URL (default http://127.0.0.1:8181)" },
|
|
165
|
+
{ envVar: "RIGGER_TIMEOUT_MS", required: false, description: "Per-request timeout (ms)" }
|
|
162
166
|
]
|
|
163
167
|
};
|
|
164
168
|
function allCredentialEnvVars() {
|
|
@@ -5340,6 +5344,90 @@ var ArxivIntegration = class extends BaseIntegration {
|
|
|
5340
5344
|
};
|
|
5341
5345
|
registerIntegration("arxiv", ArxivIntegration);
|
|
5342
5346
|
|
|
5347
|
+
// src/integrations/rigger/index.ts
|
|
5348
|
+
var DEFAULT_BASE_URL = "http://127.0.0.1:8181";
|
|
5349
|
+
var DEFAULT_TIMEOUT_MS5 = 3e4;
|
|
5350
|
+
var RiggerIntegration = class extends BaseIntegration {
|
|
5351
|
+
constructor(config) {
|
|
5352
|
+
super(config);
|
|
5353
|
+
this.baseUrl = config.env.RIGGER_BASE_URL || DEFAULT_BASE_URL;
|
|
5354
|
+
this.timeoutMs = Number(config.env.RIGGER_TIMEOUT_MS) || DEFAULT_TIMEOUT_MS5;
|
|
5355
|
+
this.logger.info("Rigger integration initialized", { baseUrl: this.baseUrl });
|
|
5356
|
+
}
|
|
5357
|
+
async execute(action, params) {
|
|
5358
|
+
const validation = this.validateParams(action, params);
|
|
5359
|
+
if (!validation.valid) {
|
|
5360
|
+
return {
|
|
5361
|
+
success: false,
|
|
5362
|
+
error: {
|
|
5363
|
+
name: "IntegrationError",
|
|
5364
|
+
message: "Validation failed",
|
|
5365
|
+
code: "VALIDATION_ERROR",
|
|
5366
|
+
details: validation.errors
|
|
5367
|
+
},
|
|
5368
|
+
metadata: this.createMetadata(action, 0)
|
|
5369
|
+
};
|
|
5370
|
+
}
|
|
5371
|
+
const startTime = Date.now();
|
|
5372
|
+
try {
|
|
5373
|
+
let data;
|
|
5374
|
+
switch (action) {
|
|
5375
|
+
case "health":
|
|
5376
|
+
data = await this.health();
|
|
5377
|
+
break;
|
|
5378
|
+
case "buildMesh":
|
|
5379
|
+
data = await this.executeWithRetry(() => this.buildMesh(params));
|
|
5380
|
+
break;
|
|
5381
|
+
case "render":
|
|
5382
|
+
data = await this.executeWithRetry(() => this.render(params));
|
|
5383
|
+
break;
|
|
5384
|
+
default:
|
|
5385
|
+
throw new UnknownActionError(this.config.name, action);
|
|
5386
|
+
}
|
|
5387
|
+
return {
|
|
5388
|
+
success: true,
|
|
5389
|
+
data,
|
|
5390
|
+
metadata: this.createMetadata(action, Date.now() - startTime)
|
|
5391
|
+
};
|
|
5392
|
+
} catch (error) {
|
|
5393
|
+
return this.handleError(action, error);
|
|
5394
|
+
}
|
|
5395
|
+
}
|
|
5396
|
+
async health() {
|
|
5397
|
+
const response = await fetch(`${this.baseUrl}/health`, {
|
|
5398
|
+
signal: AbortSignal.timeout(this.timeoutMs)
|
|
5399
|
+
});
|
|
5400
|
+
return { ok: response.ok };
|
|
5401
|
+
}
|
|
5402
|
+
async buildMesh(params) {
|
|
5403
|
+
const { imagePath, rig } = params;
|
|
5404
|
+
const response = await fetch(`${this.baseUrl}/mesh/build`, {
|
|
5405
|
+
method: "POST",
|
|
5406
|
+
headers: { "Content-Type": "application/json" },
|
|
5407
|
+
body: JSON.stringify({ imagePath, rig }),
|
|
5408
|
+
signal: AbortSignal.timeout(this.timeoutMs)
|
|
5409
|
+
});
|
|
5410
|
+
if (!response.ok) {
|
|
5411
|
+
throw new Error(`Rigger /mesh/build returned ${response.status}`);
|
|
5412
|
+
}
|
|
5413
|
+
return await response.json();
|
|
5414
|
+
}
|
|
5415
|
+
async render(params) {
|
|
5416
|
+
const { imagePath, rig, preset, outDir } = params;
|
|
5417
|
+
const response = await fetch(`${this.baseUrl}/render`, {
|
|
5418
|
+
method: "POST",
|
|
5419
|
+
headers: { "Content-Type": "application/json" },
|
|
5420
|
+
body: JSON.stringify({ imagePath, rig, preset, outDir }),
|
|
5421
|
+
signal: AbortSignal.timeout(this.timeoutMs)
|
|
5422
|
+
});
|
|
5423
|
+
if (!response.ok) {
|
|
5424
|
+
throw new Error(`Rigger /render returned ${response.status}`);
|
|
5425
|
+
}
|
|
5426
|
+
return response.json();
|
|
5427
|
+
}
|
|
5428
|
+
};
|
|
5429
|
+
registerIntegration("rigger", RiggerIntegration);
|
|
5430
|
+
|
|
5343
5431
|
// src/mocks/MockIntegration.ts
|
|
5344
5432
|
var MockIntegration = class extends BaseIntegration {
|
|
5345
5433
|
constructor(config) {
|
|
@@ -5667,6 +5755,12 @@ var RuntimeIntegrationManager = class {
|
|
|
5667
5755
|
WEBHOOK_TIMEOUT_MS: env.WEBHOOK_TIMEOUT_MS || ""
|
|
5668
5756
|
}
|
|
5669
5757
|
});
|
|
5758
|
+
this.factory.configure("rigger", {
|
|
5759
|
+
env: {
|
|
5760
|
+
RIGGER_BASE_URL: env.RIGGER_BASE_URL || "",
|
|
5761
|
+
RIGGER_TIMEOUT_MS: env.RIGGER_TIMEOUT_MS || ""
|
|
5762
|
+
}
|
|
5763
|
+
});
|
|
5670
5764
|
const llmEnv = {};
|
|
5671
5765
|
for (const k of ["ANTHROPIC_API_KEY", "OPENAI_API_KEY", "DEEPSEEK_API_KEY", "KIMI_API_KEY", "OPEN_ROUTER_API_KEY"]) {
|
|
5672
5766
|
if (env[k]) llmEnv[k] = env[k];
|