@almadar/integrations 2.35.0 → 2.36.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { e as IntegrationLogger, c as IntegrationErrorCode, a as IntegrationConfig, B as BaseIntegration, d as IntegrationFactory, g as IntegrationParams, h as IntegrationResult, I as IntegrationCallContext } from './BaseIntegration-BYlbMFlf.js';
|
|
2
2
|
export { b as IntegrationError, f as IntegrationParamValue, U as UnknownActionError, V as ValidationError, i as ValidationResult, j as getIntegrationFactory, r as resetIntegrationFactory, v as validateParams } from './BaseIntegration-BYlbMFlf.js';
|
|
3
|
-
import { e as CredentialStore, d as CredentialPersistence, H as HookDeclaration } from './store-
|
|
4
|
-
export { A as ArxivActions, C as CLIActions, a as CREDENTIAL_ENTITY_TYPE, b as CREDENTIAL_MASTER_KEY_ENV, c as CredentialEntry, D as DatabaseActions, f as DatabaseDriver, g as DatabaseQueryParamValue, h as DatabaseQueryParams, i as DatabaseQueryResult, j as DatabaseRow, k as DeepAgentActions, l as DockerActions, E as EmailActions, G as GitHubActions, I as IconifyActions, m as IntegrationActionName, n as IntegrationContracts, o as IntegrationName, L as LLMIntegrationActions, M as MLActions, O as OAuthActions, p as OtelActions, Q as QueueActions, R as RedisActions, S as StorageActions, q as StripeActions, T as TwilioActions, W as WebhookActions, r as WikimediaActions, Y as YouTubeActions, s as allCredentialEnvVars, t as declaredCredentialEnvVars, u as serviceHooks } from './store-
|
|
3
|
+
import { e as CredentialStore, d as CredentialPersistence, H as HookDeclaration } from './store-OiFX0Tkn.js';
|
|
4
|
+
export { A as ArxivActions, C as CLIActions, a as CREDENTIAL_ENTITY_TYPE, b as CREDENTIAL_MASTER_KEY_ENV, c as CredentialEntry, D as DatabaseActions, f as DatabaseDriver, g as DatabaseQueryParamValue, h as DatabaseQueryParams, i as DatabaseQueryResult, j as DatabaseRow, k as DeepAgentActions, l as DockerActions, E as EmailActions, G as GitHubActions, I as IconifyActions, m as IntegrationActionName, n as IntegrationContracts, o as IntegrationName, L as LLMIntegrationActions, M as MLActions, O as OAuthActions, p as OtelActions, Q as QueueActions, R as RedisActions, S as StorageActions, q as StripeActions, T as TwilioActions, W as WebhookActions, r as WikimediaActions, Y as YouTubeActions, s as allCredentialEnvVars, t as declaredCredentialEnvVars, u as serviceHooks } from './store-OiFX0Tkn.js';
|
|
5
5
|
import { LogMeta, EntityRow, EventPayload } from '@almadar/core';
|
|
6
6
|
export { GitHubIntegration } from './integrations/github/index.js';
|
|
7
7
|
|
|
@@ -1034,6 +1034,8 @@ declare class RiggerIntegration extends BaseIntegration {
|
|
|
1034
1034
|
private loadRig;
|
|
1035
1035
|
private saveRig;
|
|
1036
1036
|
private ownership;
|
|
1037
|
+
private buildLayers;
|
|
1038
|
+
private pose;
|
|
1037
1039
|
private generate;
|
|
1038
1040
|
}
|
|
1039
1041
|
|
package/dist/index.js
CHANGED
|
@@ -5838,6 +5838,18 @@ registerIntegration("arxiv", ArxivIntegration);
|
|
|
5838
5838
|
var DEFAULT_BASE_URL = "http://127.0.0.1:8181";
|
|
5839
5839
|
var DEFAULT_TIMEOUT_MS5 = 3e4;
|
|
5840
5840
|
var DEFAULT_GENERATE_TIMEOUT_MS = 6e5;
|
|
5841
|
+
var GENERATE_MODELS = ["z-image-turbo", "kontext"];
|
|
5842
|
+
function generateParamErrors(params) {
|
|
5843
|
+
const errors = [];
|
|
5844
|
+
const model = params.model;
|
|
5845
|
+
if (typeof model !== "string" || !GENERATE_MODELS.includes(model)) {
|
|
5846
|
+
errors.push(`model must be one of ${GENERATE_MODELS.join(", ")}`);
|
|
5847
|
+
}
|
|
5848
|
+
if (model === "kontext" && (typeof params.sourcePath !== "string" || params.sourcePath === "")) {
|
|
5849
|
+
errors.push("sourcePath is required when model is kontext");
|
|
5850
|
+
}
|
|
5851
|
+
return errors;
|
|
5852
|
+
}
|
|
5841
5853
|
async function riggerError(path, response) {
|
|
5842
5854
|
let detail = "";
|
|
5843
5855
|
try {
|
|
@@ -5871,6 +5883,21 @@ var RiggerIntegration = class extends BaseIntegration {
|
|
|
5871
5883
|
metadata: this.createMetadata(action, 0)
|
|
5872
5884
|
};
|
|
5873
5885
|
}
|
|
5886
|
+
if (action === "generate") {
|
|
5887
|
+
const invalid = generateParamErrors(params);
|
|
5888
|
+
if (invalid.length > 0) {
|
|
5889
|
+
return {
|
|
5890
|
+
success: false,
|
|
5891
|
+
error: {
|
|
5892
|
+
name: "IntegrationError",
|
|
5893
|
+
message: "Validation failed",
|
|
5894
|
+
code: "VALIDATION_ERROR",
|
|
5895
|
+
details: invalid
|
|
5896
|
+
},
|
|
5897
|
+
metadata: this.createMetadata(action, 0)
|
|
5898
|
+
};
|
|
5899
|
+
}
|
|
5900
|
+
}
|
|
5874
5901
|
const startTime = Date.now();
|
|
5875
5902
|
try {
|
|
5876
5903
|
let data;
|
|
@@ -5896,6 +5923,12 @@ var RiggerIntegration = class extends BaseIntegration {
|
|
|
5896
5923
|
case "ownership":
|
|
5897
5924
|
data = await this.executeWithRetry(() => this.ownership(params));
|
|
5898
5925
|
break;
|
|
5926
|
+
case "buildLayers":
|
|
5927
|
+
data = await this.executeWithRetry(() => this.buildLayers(params));
|
|
5928
|
+
break;
|
|
5929
|
+
case "pose":
|
|
5930
|
+
data = await this.executeWithRetry(() => this.pose(params));
|
|
5931
|
+
break;
|
|
5899
5932
|
case "generate":
|
|
5900
5933
|
data = await this.executeWithRetry(() => this.generate(params));
|
|
5901
5934
|
break;
|
|
@@ -5991,6 +6024,32 @@ var RiggerIntegration = class extends BaseIntegration {
|
|
|
5991
6024
|
}
|
|
5992
6025
|
return await response.json();
|
|
5993
6026
|
}
|
|
6027
|
+
async buildLayers(params) {
|
|
6028
|
+
const { imagePath, rig, outDir } = params;
|
|
6029
|
+
const response = await fetch(`${this.baseUrl}/layers`, {
|
|
6030
|
+
method: "POST",
|
|
6031
|
+
headers: { "Content-Type": "application/json" },
|
|
6032
|
+
body: JSON.stringify({ imagePath, rig, outDir }),
|
|
6033
|
+
signal: AbortSignal.timeout(this.timeoutMs)
|
|
6034
|
+
});
|
|
6035
|
+
if (!response.ok) {
|
|
6036
|
+
throw await riggerError("/layers", response);
|
|
6037
|
+
}
|
|
6038
|
+
return await response.json();
|
|
6039
|
+
}
|
|
6040
|
+
async pose(params) {
|
|
6041
|
+
const { imagePath, rig, roles, preset, overrides } = params;
|
|
6042
|
+
const response = await fetch(`${this.baseUrl}/pose`, {
|
|
6043
|
+
method: "POST",
|
|
6044
|
+
headers: { "Content-Type": "application/json" },
|
|
6045
|
+
body: JSON.stringify({ imagePath, rig, roles, preset, overrides }),
|
|
6046
|
+
signal: AbortSignal.timeout(this.timeoutMs)
|
|
6047
|
+
});
|
|
6048
|
+
if (!response.ok) {
|
|
6049
|
+
throw await riggerError("/pose", response);
|
|
6050
|
+
}
|
|
6051
|
+
return await response.json();
|
|
6052
|
+
}
|
|
5994
6053
|
async generate(params) {
|
|
5995
6054
|
const { model, prompt, seed, size, steps, sourcePath, outDir } = params;
|
|
5996
6055
|
const response = await fetch(`${this.baseUrl}/generate`, {
|