@jini-ai/integrations 0.6.12 → 0.6.15-rc.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.13
4
+
5
+ ### Patch Changes
6
+
7
+ - 506196f: BREAKING (host composition): two native effects are now injected by the host instead of loaded from a sibling
8
+ domain (guard L1 / SI-domain clean-up). No default is provided because a default would reintroduce exactly
9
+ that edge.
10
+
11
+ - `@jini-ai/vibecoding` node: `openFileTreeProject` (and the node store/paths inputs) require
12
+ `filesystem: ProjectFilesystemPort` (`createReader`, `withFileLock`, `writeFileAtomicAsync`,
13
+ `writeJsonFileAtomicAsync`). Bind the existing `@jini-ai/platform` implementations in the host's composition root (see the `ProjectFilesystemPort` doc example).
14
+ Hosts that only use `@jini-ai/vibecoding/html*` are unaffected.
15
+ - `@jini-ai/integrations` saved requests: `SavedRequestDeps` requires `executeCredentialedRequest`;
16
+ pass `makeCredentialedRequest` from `@jini-ai/integrations/credentialed-http` so auditing and redaction stay bound
17
+ to that owner.
18
+
19
+ - Updated dependencies [7479159]
20
+ - Updated dependencies [c31264d]
21
+ - Updated dependencies [0728914]
22
+ - Updated dependencies [6ecbdb2]
23
+ - Updated dependencies [63bacc5]
24
+ - @jini-ai/core@0.6.13
25
+
3
26
  ## 0.6.12
4
27
 
5
28
  ### Patch Changes
@@ -0,0 +1,5 @@
1
+ import { IntegrationError } from "../argument-error.js";
2
+ /** Shared refusal identity lets composed callers classify validation without loading the executor. */
3
+ export declare class CredentialedRequestValidationError extends IntegrationError {
4
+ }
5
+ //# sourceMappingURL=credentialed-request-errors.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { IntegrationError } from "../argument-error.js";
2
+ // Request validation is distinct from validation of stored credentials, which belongs to the resolver.
3
+ /** Shared refusal identity lets composed callers classify validation without loading the executor. */
4
+ export class CredentialedRequestValidationError extends IntegrationError {
5
+ }
6
+ //# sourceMappingURL=credentialed-request-errors.js.map
@@ -7,13 +7,12 @@
7
7
  * does not introduce a second approval ceremony or expose decrypted credentials to the caller.
8
8
  */
9
9
  import { IntegrationError } from "../argument-error.js";
10
+ export { CredentialedRequestValidationError } from "../contracts/credentialed-request-errors.js";
10
11
  import { type Clock, type HttpClientPort, type UUID } from "@jini-ai/core/primitives";
11
12
  import type { CredentialConnection, CredentialResolverPort, CredentialSchemeRegistryPort, CredentialedRequestErrorPolicyPort } from "./ports.js";
12
13
  import { type CredentialSchemeRule } from "./auth-schemes.js";
13
14
  export declare class CredentialNotFoundError extends IntegrationError {
14
15
  }
15
- export declare class CredentialedRequestValidationError extends IntegrationError {
16
- }
17
16
  export declare class CredentialedRequestTransportError extends IntegrationError {
18
17
  }
19
18
  /** Resolve self-describing, Basic, then Bearer precedence for trusted outbound-request executors.
@@ -7,6 +7,8 @@
7
7
  * does not introduce a second approval ceremony or expose decrypted credentials to the caller.
8
8
  */
9
9
  import { IntegrationError } from "../argument-error.js";
10
+ import { CredentialedRequestValidationError } from "../contracts/credentialed-request-errors.js";
11
+ export { CredentialedRequestValidationError } from "../contracts/credentialed-request-errors.js";
10
12
  import { nowIso } from "@jini-ai/core/primitives";
11
13
  import { detectSelfDescribingAuthScheme } from "./auth-schemes.js";
12
14
  import { redactJsonResponseBody, redactResponseHeaders, resolveRedactedResponseBody } from "./response-redaction.js";
@@ -17,9 +19,6 @@ export class CredentialNotFoundError extends IntegrationError {
17
19
  function allowedOriginsFor(record) {
18
20
  return [...new Set([new URL(record.baseUrl).origin, ...record.additionalHosts])];
19
21
  }
20
- // Request validation is distinct from validation of stored credentials, which belongs to the resolver.
21
- export class CredentialedRequestValidationError extends IntegrationError {
22
- }
23
22
  // An answered HTTP error is still a normal response. A host-recognized egress refusal retains its
24
23
  // identity, so callers can distinguish a fixable target rejection from a DNS/timeout failure.
25
24
  export class CredentialedRequestTransportError extends IntegrationError {
@@ -1,5 +1,5 @@
1
1
  import { createHttpClient } from "@jini-ai/platform/http/guarded";
2
- import { CredentialedRequestValidationError, makeCredentialedRequest } from "../credentialed-http/credentialed-request.js";
2
+ import { CredentialedRequestValidationError } from "../contracts/credentialed-request-errors.js";
3
3
  import { prepareSavedRequestDefinition } from "./definition.js";
4
4
  import { projectSavedRequestResponse } from "./projection.js";
5
5
  import { requireCondition, SavedRequestError, snapshot } from "./validation.js";
@@ -20,7 +20,7 @@ export async function executeSavedRequest({ deps, workspaceId, definition: raw,
20
20
  options.signal?.throwIfAborted();
21
21
  const credential = await resolveCredential({ deps, workspaceId, definition });
22
22
  options.signal?.throwIfAborted();
23
- const response = await makeCredentialedRequest({
23
+ const response = await deps.executeCredentialedRequest({
24
24
  deps: {
25
25
  resolver: { describe: async () => credential, resolve: async () => credential },
26
26
  schemeRegistry: deps.schemeRegistry, audit: deps.audit, clock: deps.clock,
@@ -1,4 +1,4 @@
1
- import type { CredentialedRequestAuditPort } from "../credentialed-http/credentialed-request.js";
1
+ import type { CredentialedRequestAuditPort, makeCredentialedRequest } from "../credentialed-http/credentialed-request.js";
2
2
  import type { CredentialSchemeRegistryPort, ResolvedCredential } from "../credentialed-http/ports.js";
3
3
  import type { DnsResolver, GuardedClock, PinnedHttpTransport } from "@jini-ai/platform/http/guarded";
4
4
  /** Persisted data only. Identity, policy, consent and quotas belong to the calling host. */
@@ -38,8 +38,11 @@ export interface SavedRequestCredentialResolverPort {
38
38
  }) | null>;
39
39
  }
40
40
  /** All effects are injected. The interpreter constructs the existing guard, so callers cannot
41
- * accidentally supply an HTTP client with redirects or development bypasses enabled. */
41
+ * accidentally supply an HTTP client with redirects or development bypasses enabled. The trusted
42
+ * executor port must bind the credentialed-http owner so auditing and redaction stay intact. */
42
43
  export interface SavedRequestDeps {
44
+ /** Composition binds the credential owner's executor; the interpreter never loads that domain. */
45
+ readonly executeCredentialedRequest: typeof makeCredentialedRequest;
43
46
  readonly credentials: SavedRequestCredentialResolverPort;
44
47
  readonly schemeRegistry: CredentialSchemeRegistryPort;
45
48
  readonly audit: CredentialedRequestAuditPort;
@@ -60,14 +60,14 @@ export async function enqueueDelivery(required, _optional = {}) {
60
60
  deliveredAt: null,
61
61
  deadAt: null,
62
62
  };
63
- const envelope = {
64
- deliveryId: record.id,
65
- eventId: event.id,
66
- topic: event.name,
67
- workspaceId: event.workspaceId,
68
- occurredAt: event.occurredAt,
69
- data: event.payload,
70
- };
63
+ const envelope = publicWebhookEnvelope({ envelope: {
64
+ deliveryId: record.id,
65
+ eventId: event.id,
66
+ topic: event.name,
67
+ workspaceId: event.workspaceId,
68
+ occurredAt: event.occurredAt,
69
+ data: event.payload,
70
+ } });
71
71
  // A durable adapter must co-persist the envelope in the same insert as the row, closing the
72
72
  // crash gap before the following save. That save remains the real write for memory adapters;
73
73
  // for an adapter with co-persistence it only repeats the same envelope harmlessly.
@@ -77,6 +77,14 @@ export async function enqueueDelivery(required, _optional = {}) {
77
77
  }
78
78
  return { enqueued };
79
79
  }
80
+ /** Consent proof and import provenance are private CMS metadata, never webhook data.
81
+ * Preserve the public form payload and leave the immutable source envelope untouched. O(fields). */
82
+ function publicWebhookEnvelope({ envelope }, _options = {}) {
83
+ if (envelope.topic !== 'form.submission.received')
84
+ return envelope;
85
+ const { analyticsProvenance: _proof, deliveryMode: _mode, ...data } = envelope.data;
86
+ return { ...envelope, data };
87
+ }
80
88
  /**
81
89
  * The port has no event-specific lookup, so this guard scans prior subscription deliveries:
82
90
  * O(matching subscriptions * their delivery history). Production storage needs an atomic unique
@@ -199,7 +207,8 @@ async function attemptOneDelivery(row, deps) {
199
207
  if (!storedEnvelope) {
200
208
  return { ok: false, error: `no envelope recorded for delivery '${row.id}'`, responseStatus: null };
201
209
  }
202
- const envelope = await runBeforeDispatchHooks(deps.hooks, { subscription, envelope: storedEnvelope });
210
+ // Older queued events and hooks also pass this boundary before signing/sending.
211
+ const envelope = publicWebhookEnvelope({ envelope: await runBeforeDispatchHooks(deps.hooks, { subscription, envelope: storedEnvelope }) });
203
212
  const rawBody = JSON.stringify(envelope);
204
213
  const timestampSeconds = Math.floor(Date.parse(nowIso({ clock: deps.clock })) / 1000);
205
214
  const signatureHeader = await deps.signer.signForSubscription({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/integrations",
3
- "version": "0.6.12",
3
+ "version": "0.6.15-rc.1",
4
4
  "description": "Third-party vendor integrations and outbound services, each independently importable: media generation, credentialed HTTP and webhooks.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -103,13 +103,13 @@
103
103
  "registry": "https://registry.npmjs.org"
104
104
  },
105
105
  "dependencies": {
106
- "@jini-ai/core": "^0.6.12"
106
+ "@jini-ai/core": "^0.6.15-rc.1"
107
107
  },
108
108
  "peerDependencies": {
109
- "@jini-ai/db": "^0.6.10",
109
+ "@jini-ai/db": "^0.6.15-rc.1",
110
110
  "better-sqlite3": "^13.0.0",
111
- "@jini-ai/platform": "^0.6.10",
112
- "@jini-ai/oauth": "^0.6.10",
111
+ "@jini-ai/platform": "^0.6.15-rc.1",
112
+ "@jini-ai/oauth": "^0.6.15-rc.1",
113
113
  "@cfworker/json-schema": "^4.1.1"
114
114
  },
115
115
  "peerDependenciesMeta": {
@@ -134,11 +134,11 @@
134
134
  "better-sqlite3": "^13.0.0",
135
135
  "@vitest/coverage-v8": "^2.1.9",
136
136
  "@cfworker/json-schema": "^4.1.1",
137
- "@jini-ai/db": "^0.6.12",
138
- "@jini-ai/core": "0.6.12",
139
- "@jini-ai/agent-plugins": "0.6.12",
140
- "@jini-ai/oauth": "0.6.12",
141
- "@jini-ai/platform": "0.6.12"
137
+ "@jini-ai/core": "0.6.15-rc.1",
138
+ "@jini-ai/platform": "0.6.15-rc.1",
139
+ "@jini-ai/oauth": "0.6.15-rc.1",
140
+ "@jini-ai/agent-plugins": "0.6.15-rc.1",
141
+ "@jini-ai/db": "^0.6.15-rc.1"
142
142
  },
143
143
  "scripts": {
144
144
  "build": "tsc -p tsconfig.json",