@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.
@@ -1,4 +1,4 @@
1
- import { ServiceParamsValue, ServiceParams, EntityRow } from '@almadar/core';
1
+ import { ServiceParamsValue, ServiceParams, EventPayload, EntityRow } from '@almadar/core';
2
2
  import { f as IntegrationParamValue, g as IntegrationParams } from './BaseIntegration-BYlbMFlf.js';
3
3
 
4
4
  /** Scalar value admissible as a SQL bind parameter. */
@@ -1080,8 +1080,8 @@ type StorageActions = {
1080
1080
  acl?: 'public' | 'private';
1081
1081
  /** Reject the upload if the file-form payload's declared size exceeds this many bytes. */
1082
1082
  maxSize?: number;
1083
- /** Arbitrary metadata stored alongside the object (in-memory backend only). */
1084
- metadata?: IntegrationParams;
1083
+ /** Object metadata stored alongside the content (S3-compatible object stores carry metadata as string headers — never structured values). */
1084
+ metadata?: Record<string, string>;
1085
1085
  };
1086
1086
  result: {
1087
1087
  key: string;
@@ -1133,7 +1133,7 @@ type StorageActions = {
1133
1133
  content: string;
1134
1134
  contentType: string;
1135
1135
  size: number;
1136
- metadata: IntegrationParams;
1136
+ metadata: Record<string, string>;
1137
1137
  };
1138
1138
  };
1139
1139
  /** List object keys in a bucket, optionally prefix-filtered, one page at a time. */
@@ -1189,13 +1189,26 @@ type StorageActions = {
1189
1189
  };
1190
1190
  };
1191
1191
  };
1192
+ /** A queued job as stored/returned by the in-memory queue. Extends
1193
+ * `EventPayload` so it flows through a `ServiceAction.result` (bus-payload-
1194
+ * shaped) without a boundary cast, the same reason `JsonSchemaDefinition`
1195
+ * extends `ServiceParams` above. */
1196
+ interface QueueJob extends EventPayload {
1197
+ id: string;
1198
+ /** Whatever `enqueue` was given — the caller declares its own shape.
1199
+ * @shapedBy payload */
1200
+ payload: ServiceParams;
1201
+ enqueuedAt: number;
1202
+ priority: number;
1203
+ }
1192
1204
  type QueueActions = {
1193
1205
  /** Add a job to an in-memory job queue, ordered by priority (higher first) among ready jobs. */
1194
1206
  enqueue: {
1195
1207
  params: {
1196
1208
  /** Queue name. */
1197
1209
  queue: string;
1198
- /** Arbitrary job payload. */
1210
+ /** Job payload — the caller declares its own shape.
1211
+ * @shapedBy payload */
1199
1212
  payload: ServiceParams;
1200
1213
  /** Delay before the job becomes eligible for dequeue, in milliseconds. */
1201
1214
  delay?: number;
@@ -1214,12 +1227,7 @@ type QueueActions = {
1214
1227
  queue: string;
1215
1228
  };
1216
1229
  result: {
1217
- job: {
1218
- id: string;
1219
- payload: ServiceParams;
1220
- enqueuedAt: number;
1221
- priority: number;
1222
- } | null;
1230
+ job: QueueJob | null;
1223
1231
  };
1224
1232
  };
1225
1233
  /** Look up a job's current status by id. */
@@ -1230,12 +1238,7 @@ type QueueActions = {
1230
1238
  };
1231
1239
  result: {
1232
1240
  status: 'pending' | 'processing' | 'completed' | 'failed';
1233
- job: {
1234
- id: string;
1235
- payload: ServiceParams;
1236
- enqueuedAt: number;
1237
- priority: number;
1238
- } | null;
1241
+ job: QueueJob | null;
1239
1242
  };
1240
1243
  };
1241
1244
  /** Mark a 'processing' job completed and store its result; no-op (returns false) if the job isn't in 'processing' state. */
@@ -1243,7 +1246,8 @@ type QueueActions = {
1243
1246
  params: {
1244
1247
  /** Job id. */
1245
1248
  jobId: string;
1246
- /** Result payload to attach to the job. */
1249
+ /** Result payload to attach to the job — the caller declares its own shape (not necessarily the same shape as the job's `payload`).
1250
+ * @shapedBy result */
1247
1251
  result?: ServiceParams;
1248
1252
  };
1249
1253
  result: {
@@ -1293,6 +1297,8 @@ type RedisActions = {
1293
1297
  key: string;
1294
1298
  };
1295
1299
  result: {
1300
+ /** Whatever `set` stored under this key — the caller declares its shape.
1301
+ * @shapedBy value */
1296
1302
  value: ServiceParams;
1297
1303
  };
1298
1304
  };
@@ -1301,7 +1307,8 @@ type RedisActions = {
1301
1307
  params: {
1302
1308
  /** Cache key. */
1303
1309
  key: string;
1304
- /** Value to store. */
1310
+ /** Value to store — the caller declares its own shape.
1311
+ * @shapedBy value */
1305
1312
  value: ServiceParams;
1306
1313
  /** Time-to-live in seconds; omit for no expiry. */
1307
1314
  ttl?: number;
@@ -1374,7 +1381,8 @@ type RedisActions = {
1374
1381
  params: {
1375
1382
  /** Channel name. */
1376
1383
  channel: string;
1377
- /** Message payload. */
1384
+ /** Message payload — the caller declares its own shape.
1385
+ * @shapedBy message */
1378
1386
  message: ServiceParams;
1379
1387
  };
1380
1388
  result: {
@@ -1541,8 +1549,8 @@ type OtelActions = {
1541
1549
  params: {
1542
1550
  /** Span name. */
1543
1551
  name: string;
1544
- /** Key-value attributes attached to the span. */
1545
- attributes?: IntegrationParams;
1552
+ /** Key-value attributes attached to the span (OTel attribute values are scalar). */
1553
+ attributes?: Record<string, string | number | boolean>;
1546
1554
  /** Existing trace id to attach this span to; a new one is generated when omitted. */
1547
1555
  traceId?: string;
1548
1556
  };
@@ -1570,8 +1578,8 @@ type OtelActions = {
1570
1578
  spanId: string;
1571
1579
  /** Event name. */
1572
1580
  name: string;
1573
- /** Key-value attributes attached to the event. */
1574
- attributes?: IntegrationParams;
1581
+ /** Key-value attributes attached to the event (OTel attribute values are scalar). */
1582
+ attributes?: Record<string, string | number | boolean>;
1575
1583
  };
1576
1584
  result: {
1577
1585
  added: boolean;
@@ -1586,8 +1594,8 @@ type OtelActions = {
1586
1594
  value: number;
1587
1595
  /** Aggregation kind; defaults to 'counter'. */
1588
1596
  type?: 'counter' | 'gauge' | 'histogram';
1589
- /** Key-value labels attached to the metric (replaces prior labels on the same name). */
1590
- labels?: IntegrationParams;
1597
+ /** Key-value labels attached to the metric (replaces prior labels on the same name; OTel label values are scalar). */
1598
+ labels?: Record<string, string | number | boolean>;
1591
1599
  };
1592
1600
  result: {
1593
1601
  recorded: boolean;
@@ -1646,7 +1654,8 @@ type DeepAgentActions = {
1646
1654
  threadId?: string;
1647
1655
  /** Named skill to invoke for this message. */
1648
1656
  skill?: string;
1649
- /** Extra context passed through to the agent. */
1657
+ /** Extra context passed through to the agent — the caller declares its own shape.
1658
+ * @shapedBy context */
1650
1659
  context?: IntegrationParams;
1651
1660
  };
1652
1661
  result: {
@@ -1715,6 +1724,9 @@ type DatabaseActions = {
1715
1724
  params?: DatabaseQueryParamValue[];
1716
1725
  };
1717
1726
  result: {
1727
+ /** One row per matched record, keyed by column name — the shape follows
1728
+ * the caller's own `sql` SELECT list, which no param's TYPE can express.
1729
+ * @shapedBy rows */
1718
1730
  rows: DatabaseRow[];
1719
1731
  rowCount: number;
1720
1732
  };
@@ -1790,6 +1802,45 @@ type ArxivActions = {
1790
1802
  };
1791
1803
  };
1792
1804
  };
1805
+ type RiggerActions = {
1806
+ /** Liveness probe of the local rigger service. */
1807
+ health: {
1808
+ params: Record<string, never>;
1809
+ result: {
1810
+ ok: boolean;
1811
+ };
1812
+ };
1813
+ /** Build a rigged mesh bundle from a source image via the local rigger service. */
1814
+ buildMesh: {
1815
+ params: {
1816
+ /** Path to the source image. */
1817
+ imagePath: string;
1818
+ /** Rig type to build (e.g. 'humanoid', 'quadruped'). */
1819
+ rig: string;
1820
+ };
1821
+ result: {
1822
+ bundlePath: string;
1823
+ boneCount: number;
1824
+ vertexCount: number;
1825
+ triangleCount: number;
1826
+ clips: string[];
1827
+ };
1828
+ };
1829
+ /** Render a rigged mesh bundle to output files via the local rigger service. */
1830
+ render: {
1831
+ params: {
1832
+ /** Path to the source image. */
1833
+ imagePath: string;
1834
+ /** Rig type. */
1835
+ rig: string;
1836
+ /** Render preset name. */
1837
+ preset: string;
1838
+ /** Output directory for rendered files. */
1839
+ outDir: string;
1840
+ };
1841
+ result: Record<string, string>;
1842
+ };
1843
+ };
1793
1844
  /**
1794
1845
  * Maps each integration name (as used in `registerIntegration`) to its action
1795
1846
  * map type. Use with `ServiceContract<IntegrationContracts[K]>` to get a fully
@@ -1832,6 +1883,7 @@ type IntegrationContracts = {
1832
1883
  wikimedia: WikimediaActions;
1833
1884
  iconify: IconifyActions;
1834
1885
  arxiv: ArxivActions;
1886
+ rigger: RiggerActions;
1835
1887
  };
1836
1888
  /** Integration name literal union. */
1837
1889
  type IntegrationName = keyof IntegrationContracts;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/integrations",
3
- "version": "2.32.0",
3
+ "version": "2.34.0",
4
4
  "description": "External service integrations for Almadar applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -33,8 +33,8 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@almadar/core": "^10.83.0",
37
- "@almadar/llm": "^2.48.0",
36
+ "@almadar/core": "^10.90.0",
37
+ "@almadar/llm": "^2.51.0",
38
38
  "@almadar/logger": "^1.12.0",
39
39
  "@aws-sdk/client-s3": "^3.700.0",
40
40
  "@aws-sdk/s3-request-presigner": "^3.700.0",
@@ -50,7 +50,7 @@
50
50
  "zod": "^3.23.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@almadar/eslint-plugin": "^2.17.0",
53
+ "@almadar/eslint-plugin": "^2.18.0",
54
54
  "@types/node": "^20.0.0",
55
55
  "@types/pg": "^8.11.10",
56
56
  "@types/web-push": "^3.6.4",