@almadar/integrations 2.31.0 → 2.33.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
  };
@@ -1845,6 +1857,22 @@ type IntegrationName = keyof IntegrationContracts;
1845
1857
  * ```
1846
1858
  */
1847
1859
  type IntegrationActionName<K extends IntegrationName> = keyof IntegrationContracts[K] & string;
1860
+ /**
1861
+ * Every env var name declared anywhere in `serviceCredentials` — provider
1862
+ * secrets and the credential-store's own bootstrap keys alike. The single
1863
+ * source a forked verify/harness process scrubs from its env so it can never
1864
+ * see, and therefore never spend, a real credential (regardless of which
1865
+ * integration mode the fork ends up in).
1866
+ */
1867
+ declare function allCredentialEnvVars(): Set<string>;
1868
+ /**
1869
+ * Every declared PROVIDER credential env var — `allCredentialEnvVars()` minus
1870
+ * the store's own bootstrap keys. The store-first custody set (I-31):
1871
+ * `RuntimeIntegrationManager` strips these from the base env before merging
1872
+ * the store's decrypted values, so every resolution flows the exact store →
1873
+ * env → unconfigured path a deployed client app uses.
1874
+ */
1875
+ declare function declaredCredentialEnvVars(): Set<string>;
1848
1876
  /**
1849
1877
  * Declared side-effect-free "Test connection" probes, executed by the
1850
1878
  * `credentials.test` action through the normal factory path. Only services
@@ -1965,4 +1993,4 @@ declare class CredentialStore {
1965
1993
  remove(envVar: string): Promise<boolean>;
1966
1994
  }
1967
1995
 
1968
- export { type ArxivActions as A, type CLIActions as C, type DatabaseActions as D, type EmailActions as E, type GitHubActions as G, type HookDeclaration as H, type IconifyActions as I, type LLMIntegrationActions as L, type MLActions as M, type OAuthActions as O, type QueueActions as Q, type RedisActions as R, type StorageActions as S, type TwilioActions as T, type WebhookActions as W, type YouTubeActions as Y, CREDENTIAL_ENTITY_TYPE as a, CREDENTIAL_MASTER_KEY_ENV as b, type CredentialEntry as c, type CredentialPersistence as d, CredentialStore as e, type DatabaseDriver as f, type DatabaseQueryParamValue as g, type DatabaseQueryParams as h, type DatabaseQueryResult as i, type DatabaseRow as j, type DeepAgentActions as k, type DockerActions as l, type IntegrationActionName as m, type IntegrationContracts as n, type IntegrationName as o, type OtelActions as p, type StripeActions as q, type WikimediaActions as r, serviceHooks as s };
1996
+ export { type ArxivActions as A, type CLIActions as C, type DatabaseActions as D, type EmailActions as E, type GitHubActions as G, type HookDeclaration as H, type IconifyActions as I, type LLMIntegrationActions as L, type MLActions as M, type OAuthActions as O, type QueueActions as Q, type RedisActions as R, type StorageActions as S, type TwilioActions as T, type WebhookActions as W, type YouTubeActions as Y, CREDENTIAL_ENTITY_TYPE as a, CREDENTIAL_MASTER_KEY_ENV as b, type CredentialEntry as c, type CredentialPersistence as d, CredentialStore as e, type DatabaseDriver as f, type DatabaseQueryParamValue as g, type DatabaseQueryParams as h, type DatabaseQueryResult as i, type DatabaseRow as j, type DeepAgentActions as k, type DockerActions as l, type IntegrationActionName as m, type IntegrationContracts as n, type IntegrationName as o, type OtelActions as p, type StripeActions as q, type WikimediaActions as r, allCredentialEnvVars as s, declaredCredentialEnvVars as t, serviceHooks as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/integrations",
3
- "version": "2.31.0",
3
+ "version": "2.33.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.81.0",
37
- "@almadar/llm": "^2.48.0",
36
+ "@almadar/core": "^10.87.0",
37
+ "@almadar/llm": "^2.49.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",