@jini-ai/integrations 0.7.3-next.2 → 0.7.3-next.3

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.
Files changed (187) hide show
  1. package/README.md +1 -0
  2. package/dist/api-connections/bundled-client-namespace.d.ts +24 -0
  3. package/dist/api-connections/bundled-client-namespace.js +22 -0
  4. package/dist/api-connections/connect.d.ts +2 -10
  5. package/dist/api-connections/contribution.d.ts +71 -0
  6. package/dist/api-connections/contribution.js +69 -0
  7. package/dist/api-connections/form-delivery-connection.d.ts +68 -0
  8. package/dist/api-connections/form-delivery-connection.js +73 -0
  9. package/dist/api-connections/hosted-mcp/contracts.d.ts +4 -171
  10. package/dist/api-connections/hosted-mcp/index.d.ts +2 -0
  11. package/dist/api-connections/hosted-mcp/oauth-row-writes.d.ts +3 -1
  12. package/dist/api-connections/hosted-mcp/oauth-row-writes.js +6 -3
  13. package/dist/api-connections/hosted-mcp/shared-sign-in.d.ts +2 -1
  14. package/dist/api-connections/hosted-mcp/sign-in-configuration.js +1 -1
  15. package/dist/api-connections/hosted-mcp/sign-in-discovery.js +1 -1
  16. package/dist/api-connections/hosted-mcp/sign-in-flow.d.ts +9 -3
  17. package/dist/api-connections/hosted-mcp/sign-in-flow.js +6 -6
  18. package/dist/api-connections/hosted-mcp/sign-in-provider.d.ts +16 -4
  19. package/dist/api-connections/hosted-mcp/sign-in-provider.js +3 -3
  20. package/dist/api-connections/hosted-mcp/sign-in-status.d.ts +13 -2
  21. package/dist/api-connections/hosted-mcp/sign-in-status.js +17 -4
  22. package/dist/api-connections/hosted-mcp/sign-in.d.ts +1 -1
  23. package/dist/api-connections/hosted-mcp/sign-in.js +28 -30
  24. package/dist/api-connections/shared-api.d.ts +87 -0
  25. package/dist/api-connections/shared-api.js +135 -0
  26. package/dist/api-connections/shared-oauth-disconnect.d.ts +73 -0
  27. package/dist/api-connections/shared-oauth-disconnect.js +41 -0
  28. package/dist/api-connections/shared-owner.d.ts +107 -0
  29. package/dist/api-connections/shared-owner.js +79 -0
  30. package/dist/api-connections/vault-stores.d.ts +110 -0
  31. package/dist/api-connections/vault-stores.js +202 -0
  32. package/dist/credentialed-http/auth-schemes.d.ts +2 -9
  33. package/dist/credentialed-http/tools/index.d.ts +30 -0
  34. package/dist/credentialed-http/tools/index.js +19 -0
  35. package/dist/credentialed-http/tools/tool-registrations.js +0 -1
  36. package/dist/custom-credentials/agent-tools.d.ts +79 -0
  37. package/dist/custom-credentials/agent-tools.js +98 -0
  38. package/dist/custom-credentials/card-token.d.ts +15 -0
  39. package/dist/custom-credentials/card-token.js +35 -0
  40. package/dist/custom-credentials/credential-ports.d.ts +70 -0
  41. package/dist/custom-credentials/credential-ports.js +41 -0
  42. package/dist/custom-credentials/credential-recovery.d.ts +20 -0
  43. package/dist/custom-credentials/credential-recovery.js +22 -0
  44. package/dist/custom-credentials/credentialed-request.d.ts +83 -0
  45. package/dist/custom-credentials/credentialed-request.js +93 -0
  46. package/dist/custom-credentials/custom-credential-create-ui.d.ts +106 -0
  47. package/dist/custom-credentials/custom-credential-create-ui.js +136 -0
  48. package/dist/custom-credentials/custom-credential-set-token-ui.d.ts +84 -0
  49. package/dist/custom-credentials/custom-credential-set-token-ui.js +104 -0
  50. package/dist/custom-credentials/delete-request-confirmation-ui.d.ts +33 -0
  51. package/dist/custom-credentials/delete-request-confirmation-ui.js +35 -0
  52. package/dist/custom-credentials/provider-settings-card.d.ts +109 -0
  53. package/dist/custom-credentials/provider-settings-card.js +166 -0
  54. package/dist/custom-credentials/write-files-validation.d.ts +102 -0
  55. package/dist/custom-credentials/write-files-validation.js +202 -0
  56. package/dist/media-providers/catalog-projection.d.ts +29 -0
  57. package/dist/media-providers/catalog-projection.js +45 -0
  58. package/dist/media-providers/catalog.d.ts +6 -3
  59. package/dist/media-providers/catalog.js +4 -3
  60. package/dist/media-providers/configurable-catalog.d.ts +9 -0
  61. package/dist/media-providers/configurable-catalog.js +70 -0
  62. package/dist/media-providers/dispatch/builtin-vendors.js +0 -2
  63. package/dist/media-providers/dispatch/credentials.d.ts +4 -1
  64. package/dist/media-providers/dispatch/credentials.js +3 -2
  65. package/dist/media-providers/dispatch/engine.d.ts +1 -1
  66. package/dist/media-providers/dispatch/engine.js +17 -5
  67. package/dist/media-providers/dispatch/index.d.ts +3 -2
  68. package/dist/media-providers/dispatch/index.js +2 -2
  69. package/dist/media-providers/dispatch/media-provider-registry.d.ts +23 -4
  70. package/dist/media-providers/dispatch/media-provider-registry.js +26 -11
  71. package/dist/media-providers/dispatch/media-wire.d.ts +14 -0
  72. package/dist/media-providers/dispatch/media-wire.js +22 -0
  73. package/dist/media-providers/dispatch/node.d.ts +5 -0
  74. package/dist/media-providers/dispatch/node.js +5 -1
  75. package/dist/media-providers/dispatch/openai-compatible.d.ts +3 -1
  76. package/dist/media-providers/dispatch/openai-compatible.js +1 -1
  77. package/dist/media-providers/dispatch/operation-runtime.js +5 -4
  78. package/dist/media-providers/dispatch/outbound.d.ts +28 -3
  79. package/dist/media-providers/dispatch/outbound.js +10 -3
  80. package/dist/media-providers/dispatch/providers/custom-image.js +1 -1
  81. package/dist/media-providers/dispatch/providers/imagerouter.js +1 -1
  82. package/dist/media-providers/dispatch/providers/nanobanana.js +1 -1
  83. package/dist/media-providers/dispatch/providers/openrouter.js +1 -1
  84. package/dist/media-providers/dispatch/ssrf-guard.js +2 -2
  85. package/dist/media-providers/dispatch/types.d.ts +13 -4
  86. package/dist/media-providers/dispatch/vendor-adapter.js +2 -2
  87. package/dist/media-providers/index.d.ts +2 -0
  88. package/dist/media-providers/providers.d.ts +9 -5
  89. package/dist/media-providers/providers.js +9 -12
  90. package/dist/media-providers/sqlite-task-store.d.ts +4 -4
  91. package/dist/media-providers/task-store.d.ts +1 -1
  92. package/dist/media-providers/task-store.js +1 -1
  93. package/dist/media-providers/types.d.ts +0 -36
  94. package/dist/media-providers/ui-defaults.js +0 -4
  95. package/dist/react/admin-credentials/AdminByokKeyPanel.d.ts +130 -0
  96. package/dist/react/admin-credentials/AdminByokKeyPanel.js +115 -0
  97. package/dist/react/admin-credentials/byok-footer-status.d.ts +37 -0
  98. package/dist/react/admin-credentials/byok-footer-status.js +25 -0
  99. package/dist/react/credentials/OtherCredentialsSection.d.ts +36 -0
  100. package/dist/react/credentials/OtherCredentialsSection.hooks.d.ts +55 -0
  101. package/dist/react/credentials/OtherCredentialsSection.hooks.js +26 -0
  102. package/dist/react/credentials/OtherCredentialsSection.js +120 -0
  103. package/dist/react/credentials/access-token-forms.d.ts +219 -0
  104. package/dist/react/credentials/access-token-forms.js +114 -0
  105. package/dist/react/credentials/credential-copy.d.ts +17 -0
  106. package/dist/react/credentials/credential-copy.js +7 -0
  107. package/dist/react/credentials/other-credential-stores.d.ts +115 -0
  108. package/dist/react/credentials/other-credential-stores.js +76 -0
  109. package/dist/react/site-key/SiteKeyRecoveryCard.d.ts +16 -0
  110. package/dist/react/site-key/SiteKeyRecoveryCard.js +36 -0
  111. package/dist/react/site-key/SiteKeyTab.d.ts +100 -0
  112. package/dist/react/site-key/SiteKeyTab.js +127 -0
  113. package/dist/react/site-key/hooks/use-site-key-recovery.hooks.d.ts +77 -0
  114. package/dist/react/site-key/hooks/use-site-key-recovery.hooks.js +126 -0
  115. package/dist/react/site-key/hooks/use-site-key.hooks.d.ts +120 -0
  116. package/dist/react/site-key/hooks/use-site-key.hooks.js +95 -0
  117. package/dist/react/webhooks/IntegrationDeliveries.d.ts +41 -0
  118. package/dist/react/webhooks/IntegrationDeliveries.js +24 -0
  119. package/dist/react/webhooks/Integrations.d.ts +73 -0
  120. package/dist/react/webhooks/Integrations.js +97 -0
  121. package/dist/react/webhooks/hooks/use-integration-deliveries.hooks.d.ts +59 -0
  122. package/dist/react/webhooks/hooks/use-integration-deliveries.hooks.js +11 -0
  123. package/dist/react/webhooks/hooks/use-integrations.hooks.d.ts +119 -0
  124. package/dist/react/webhooks/hooks/use-integrations.hooks.js +129 -0
  125. package/dist/react/webhooks/rules.d.ts +118 -0
  126. package/dist/react/webhooks/rules.js +103 -0
  127. package/dist/saved-requests/execute.js +2 -3
  128. package/dist/saved-requests/types.d.ts +4 -1
  129. package/dist/secrets/index.d.ts +3 -0
  130. package/dist/secrets/index.js +3 -0
  131. package/dist/secrets/ports.d.ts +25 -0
  132. package/dist/secrets/ports.js +2 -0
  133. package/dist/secrets/types.d.ts +10 -0
  134. package/dist/secrets/types.js +2 -0
  135. package/dist/vendor-credentials/abort-guarded-repo.d.ts +14 -0
  136. package/dist/vendor-credentials/abort-guarded-repo.js +41 -0
  137. package/dist/vendor-credentials/project-scope.d.ts +43 -0
  138. package/dist/vendor-credentials/project-scope.js +32 -0
  139. package/dist/vendor-credentials/vault-adapter.d.ts +147 -0
  140. package/dist/vendor-credentials/vault-adapter.js +195 -0
  141. package/dist/web-screenshot/capture-files.d.ts +44 -0
  142. package/dist/web-screenshot/capture-files.js +62 -0
  143. package/dist/web-screenshot/capture-retention.d.ts +157 -0
  144. package/dist/web-screenshot/capture-retention.js +134 -0
  145. package/dist/web-screenshot/capture-root-file-lock.d.ts +20 -0
  146. package/dist/web-screenshot/capture-root-file-lock.js +15 -0
  147. package/dist/web-screenshot/desktop-page-capture.d.ts +37 -0
  148. package/dist/web-screenshot/desktop-page-capture.js +62 -0
  149. package/dist/web-screenshot/own-site-opener.d.ts +40 -0
  150. package/dist/web-screenshot/own-site-opener.js +27 -0
  151. package/dist/web-screenshot/screenshot-image.d.ts +11 -0
  152. package/dist/web-screenshot/screenshot-image.js +12 -0
  153. package/dist/web-screenshot/web-screenshot.d.ts +188 -0
  154. package/dist/web-screenshot/web-screenshot.js +329 -0
  155. package/dist/webhooks/delivery.d.ts +16 -0
  156. package/dist/webhooks/delivery.js +41 -1
  157. package/dist/webhooks/ports.d.ts +1 -29
  158. package/dist/webhooks/signing.keyring.d.ts +1 -1
  159. package/dist/webhooks/site/delivery.d.ts +60 -0
  160. package/dist/webhooks/site/delivery.js +45 -0
  161. package/dist/webhooks/site/http.memory.d.ts +51 -0
  162. package/dist/webhooks/site/http.memory.js +28 -0
  163. package/dist/webhooks/site/repo.memory.d.ts +136 -0
  164. package/dist/webhooks/site/repo.memory.js +215 -0
  165. package/dist/webhooks/site/seal-aad-invariant.d.ts +26 -0
  166. package/dist/webhooks/site/seal-aad-invariant.js +61 -0
  167. package/dist/webhooks/site/seal-aad-invariant.node.d.ts +42 -0
  168. package/dist/webhooks/site/seal-aad-invariant.node.js +52 -0
  169. package/dist/webhooks/site/signing.d.ts +28 -0
  170. package/dist/webhooks/site/signing.js +27 -0
  171. package/dist/webhooks/site/signing.keyring.d.ts +29 -0
  172. package/dist/webhooks/site/signing.keyring.js +30 -0
  173. package/dist/webhooks/site/subscriptions.d.ts +118 -0
  174. package/dist/webhooks/site/subscriptions.js +98 -0
  175. package/dist/webhooks/sql/index.d.ts +4 -0
  176. package/dist/webhooks/sql/index.js +2 -0
  177. package/dist/webhooks/sql/repo.rows.d.ts +47 -0
  178. package/dist/webhooks/sql/repo.rows.js +2 -0
  179. package/dist/webhooks/sql/webhook-repo.d.ts +152 -0
  180. package/dist/webhooks/sql/webhook-repo.js +308 -0
  181. package/dist/webhooks/subscriptions.d.ts +3 -1
  182. package/dist/webhooks/subscriptions.js +4 -1
  183. package/dist/webhooks/tools/tool-handlers.js +2 -1
  184. package/dist/webhooks/types.d.ts +6 -10
  185. package/package.json +517 -12
  186. package/dist/media-providers/dispatch/providers/grok.d.ts +0 -55
  187. package/dist/media-providers/dispatch/providers/grok.js +0 -116
@@ -0,0 +1,202 @@
1
+ import { VaultError } from "@jini-ai/core/contracts/vault";
2
+ import { createApiConnectionGenerationReader } from "./keys.js";
3
+ import { createVaultOAuthTokenStore } from "./token-store/vault-token-store.js";
4
+ import { deriveApiConnectionKey } from "./keys.js";
5
+ import { parseTokenPayload, buildTokenPayload } from "./token-store/record.js";
6
+ /**
7
+ * @file the host's storage for plugin-declared API connections, all in the existing secrets vault under
8
+ * the `api-connection` kind (migration 0020): the sealed token sets (Jini's vault token store), the
9
+ * connection records and the single-use sign-in attempts. The same kind also holds plugin settings
10
+ * rows (`plugin-state.ts`), so plugin state needs no new table or vault kind (no migration 0021).
11
+ *
12
+ * Why the vault for records and attempts too: the settings ledger is append-only and exportable,
13
+ * and an attempt carries a PKCE verifier that must never be exported or logged. Sealed vault rows
14
+ * give revision CAS (record writes) and a revision-checked delete (consume-once attempts) with no
15
+ * new table. Row ids are prefixed so they can never collide with a token row, whose id is the
16
+ * connection key itself.
17
+ */
18
+ const recordId = ({ key }, _optional = {}) => `record:${key}`;
19
+ // State is sealed inside the attempt only: row ids and labels are visible to vault listings.
20
+ const attemptId = ({ state, policy }, _optional = {}) => `attempt:${policy.hashState({ state })}`;
21
+ function isObject(value) {
22
+ return typeof value === "object" && value !== null && !Array.isArray(value);
23
+ }
24
+ const isConflict = ({ error }, _optional = {}) => error instanceof VaultError && error.code === "conflict";
25
+ async function sweepExpiredAttempts(required, vault, scope) {
26
+ const nowMs = required.clock.nowMs();
27
+ for (const row of await vault.list({ ...scope })) {
28
+ if (row.meta.credentialFormat !== required.policy.attemptFormat || row.meta.expiresAtMs > nowMs)
29
+ continue;
30
+ await vault.delete({ ...scope, id: row.id, expectedRevision: row.revision }).catch((error) => { if (!isConflict({ error }))
31
+ throw error; });
32
+ }
33
+ }
34
+ /**
35
+ * Connection records and attempts as sealed vault rows. `compareAndSet` maps the record revision to
36
+ * the vault revision (0 = create); `takeAttempt` deletes with the revision it read, so two callbacks
37
+ * racing on one state cannot both get the attempt.
38
+ * @complexity O(1) vault calls per operation; `putAttempt` also sweeps expired attempts, O(a) rows.
39
+ */
40
+ export function createApiConnectionVaultRecordStore(required, _optional = {}) {
41
+ const { policy } = required;
42
+ const scope = policy.scope({ workspaceId: required.workspaceId });
43
+ const { vault } = required;
44
+ const readPayload = async ({ id }, _optional = {}) => vault.get({ ...scope, id });
45
+ return {
46
+ async read({ key }) {
47
+ const found = await readPayload({ id: recordId({ key }) });
48
+ if (!found || !isObject(found.payload?.record))
49
+ return null;
50
+ const record = found.payload.record;
51
+ // A record sealed under another key (a copied or tampered row) is never served.
52
+ if (record.key !== key)
53
+ throw new VaultError({ code: "invalid-record" });
54
+ return { ...record, revision: found.summary.revision };
55
+ },
56
+ async compareAndSet({ key, expectedRevision, record }) {
57
+ if (record.key !== key)
58
+ throw new VaultError({ code: "invalid-record" });
59
+ try {
60
+ await vault.put({ ...scope, id: recordId({ key }), expectedRevision: expectedRevision === 0 ? null : expectedRevision, provider: null,
61
+ label: policy.recordLabel({ key }), meta: { credentialFormat: policy.recordFormat }, payload: { record: { ...record } } });
62
+ return true;
63
+ }
64
+ catch (error) {
65
+ if (isConflict({ error }))
66
+ return false;
67
+ throw error;
68
+ }
69
+ },
70
+ ...createVaultAttemptOperations({ required, vault, scope, policy, readPayload }),
71
+ };
72
+ }
73
+ /** Keep single-use sign-in attempts separate from revisioned connection records. */
74
+ function createVaultAttemptOperations({ required, vault, scope, policy, readPayload }) {
75
+ const readAttempt = async ({ state }, _optional = {}) => {
76
+ const found = await readPayload({ id: attemptId({ state, policy }) });
77
+ return found && isObject(found.payload?.attempt) ? { found, attempt: found.payload.attempt } : null;
78
+ };
79
+ return {
80
+ async putAttempt({ attempt }) {
81
+ await sweepExpiredAttempts(required, vault, scope);
82
+ await vault.put({ ...scope, id: attemptId({ state: attempt.state, policy }), expectedRevision: null, provider: null, label: policy.attemptLabel({ attempt }),
83
+ meta: { credentialFormat: policy.attemptFormat, expiresAtMs: Date.parse(attempt.expiresAt) }, payload: { attempt: { ...attempt } } });
84
+ },
85
+ async takeAttempt({ state }) {
86
+ const read = await readAttempt({ state });
87
+ if (!read)
88
+ return null;
89
+ const deleted = await vault.delete({ ...scope, id: attemptId({ state, policy }), expectedRevision: read.found.summary.revision })
90
+ .catch((error) => { if (isConflict({ error })) {
91
+ return false;
92
+ } throw error; });
93
+ return deleted ? read.attempt : null;
94
+ },
95
+ async peekAttempt({ state }) {
96
+ return (await readAttempt({ state }))?.attempt ?? null;
97
+ },
98
+ };
99
+ }
100
+ /**
101
+ * Jini's vault token store bound to one connection owner, fenced by the record store's generation.
102
+ * Sign-in and switch write through its fenced `install` (no lease); only the refresher's `persist`
103
+ * needs the refresh lease, so the host no longer wraps writes in one.
104
+ * @complexity O(1) setup.
105
+ */
106
+ export function createApiConnectionVaultTokenStore(required, _optional = {}) {
107
+ return createVaultOAuthTokenStore({
108
+ vault: required.vault, vaultScope: required.policy.scope({ workspaceId: required.owner.workspaceId }), owner: required.owner,
109
+ readGeneration: createApiConnectionGenerationReader({ records: required.records }), clock: required.clock,
110
+ isVaultConflict: error => isConflict({ error }),
111
+ });
112
+ }
113
+ /** Verify the durable record owns its original derived key before constructing a recipient key. */
114
+ function archiveConnection(row) {
115
+ const record = row.payload?.record;
116
+ if (!isObject(record))
117
+ throw new VaultError({ code: "invalid-record" });
118
+ const ids = [record.workspaceId, record.pluginId, record.connectionId];
119
+ if (ids.some(value => typeof value !== "string" || !value))
120
+ throw new VaultError({ code: "invalid-record" });
121
+ const connection = record;
122
+ if (deriveApiConnectionKey(connection) !== connection.key || row.id !== recordId({ key: connection.key }))
123
+ throw new VaultError({ code: "context" });
124
+ assertArchiveConnectionState(connection);
125
+ return connection;
126
+ }
127
+ /** Archive transport admits connected durable state only; no pending account switch is resumed. */
128
+ function assertArchiveConnectionState(connection) {
129
+ if (!Number.isSafeInteger(connection.generation) || connection.generation < 0 || !Array.isArray(connection.grantedScopes))
130
+ throw new VaultError({ code: "invalid-record" });
131
+ if (!connection.grantedScopes.every(scope => typeof scope === "string") || connection.status !== "connected")
132
+ throw new VaultError({ code: "invalid-record" });
133
+ }
134
+ /** Reuse the token owner's authenticated payload codec; enumerate only durable record fields. */
135
+ function reboundConnection(required) {
136
+ const connection = archiveConnection(required.row);
137
+ const tokenRow = required.rows.get(connection.key);
138
+ const payload = tokenRow?.payload, owner = payload?.owner;
139
+ if (!tokenRow || !isObject(owner) || typeof owner.clientId !== "string")
140
+ throw new VaultError({ code: "invalid-record" });
141
+ const sourceOwner = { workspaceId: connection.workspaceId, pluginId: connection.pluginId, connectionId: connection.connectionId, clientId: owner.clientId };
142
+ const parsed = parseTokenPayload({ payload, key: connection.key, owner: sourceOwner });
143
+ if (parsed.generation !== connection.generation || !parsed.tokens)
144
+ throw new VaultError({ code: "invalid-record" });
145
+ const key = deriveApiConnectionKey({ ...sourceOwner, workspaceId: required.workspaceId });
146
+ // Enumerate durable fields: staged account switches, actors, leases and source extensions die here.
147
+ const record = { key, workspaceId: required.workspaceId, pluginId: connection.pluginId, connectionId: connection.connectionId,
148
+ status: "connected", revision: 1, generation: connection.generation, account: connection.account, grantedScopes: [...connection.grantedScopes],
149
+ staged: null, revocationFailure: null, updatedAt: connection.updatedAt };
150
+ return [
151
+ { ...required.row, id: recordId({ key }), label: required.policy.recordLabel({ key }), payload: { record: record } },
152
+ { ...tokenRow, id: key, label: key, meta: { credentialFormat: "oauth-token-set", status: "active", leaseHolder: null, leaseExpiresAtMs: null },
153
+ payload: buildTokenPayload({ key, owner: { ...sourceOwner, workspaceId: required.workspaceId }, generation: parsed.generation, tokens: parsed.tokens }) },
154
+ ];
155
+ }
156
+ /** Transient attempts/switches are deliberate exclusions; orphan durable rows deserve a notice. */
157
+ function omittedApiRow(row, consumed, policy) {
158
+ const transient = row.id.endsWith("#staged") || row.meta.credentialFormat === policy.attemptFormat;
159
+ return !consumed.has(row.id) && !transient;
160
+ }
161
+ /** Mark both halves consumed. One failed pair gets one notice, even when both its record and tokens are unusable. */
162
+ function markApiPairConsumed(row, consumed) {
163
+ consumed.add(row.id);
164
+ const record = row.payload?.record;
165
+ if (isObject(record) && typeof record.key === "string")
166
+ consumed.add(record.key);
167
+ }
168
+ /** Transport only complete, connected record/token pairs using the live key/codec owners. Plugin
169
+ * settings have no workspace-derived identity. Pending sign-ins, shared references and staged tokens never travel.
170
+ * Unsupported durable connections are omitted with a count, never raw identifiers/provider text.
171
+ * @example const rebound = rebindApiConnectionArchive({ entries, workspaceId: recipientWorkspaceId });
172
+ * @complexity O(rows + token bytes) time/space, bounded by the archive's credential cap.
173
+ */
174
+ export function rebindApiConnectionArchive(required, _optional = {}) {
175
+ const { policy } = required;
176
+ const kind = policy.scope({ workspaceId: required.workspaceId }).kind;
177
+ const entries = required.entries.filter(row => row.kind !== kind);
178
+ const api = required.entries.filter(row => row.kind === kind && !policy.isOwnerReference({ id: row.id }));
179
+ const rows = new Map(api.map(row => [row.id, row]));
180
+ let omitted = 0;
181
+ const consumed = new Set();
182
+ for (const row of api) {
183
+ if (row.meta.credentialFormat === policy.pluginStateFormat && row.id.startsWith("plugin-state:")) {
184
+ entries.push(row);
185
+ consumed.add(row.id);
186
+ }
187
+ if (row.meta.credentialFormat !== policy.recordFormat)
188
+ continue;
189
+ try {
190
+ const pair = reboundConnection({ row, rows, workspaceId: required.workspaceId, policy });
191
+ entries.push(...pair);
192
+ markApiPairConsumed(row, consumed);
193
+ }
194
+ catch {
195
+ omitted++;
196
+ markApiPairConsumed(row, consumed);
197
+ }
198
+ }
199
+ omitted += api.filter(row => omittedApiRow(row, consumed, policy)).length;
200
+ return { entries, notices: omitted ? [policy.omittedNotice({ count: omitted })] : [] };
201
+ }
202
+ //# sourceMappingURL=vault-stores.js.map
@@ -1,16 +1,9 @@
1
- export interface CredentialSchemeRule {
2
- readonly id: string;
3
- readonly prefix: string;
4
- readonly scheme: string;
5
- }
1
+ import type { CredentialSchemeRule } from "@jini-ai/core/contracts/site/integrations-credentialed-http";
2
+ export type { CredentialSchemeRule, CredentialSchemeRegistry } from "@jini-ai/core/contracts/site/integrations-credentialed-http";
6
3
  export interface SelfDescribingTokenMatch {
7
4
  readonly scheme: string;
8
5
  readonly value: string;
9
6
  }
10
- export interface CredentialSchemeRegistry {
11
- readonly rules: readonly CredentialSchemeRule[];
12
- readonly refusals: readonly string[];
13
- }
14
7
  /** Match self-describing tokens in supplied rule order; no host or vendor inference. */
15
8
  export declare function detectSelfDescribingAuthScheme(required: {
16
9
  token: string;
@@ -4,4 +4,34 @@ export { createCredentialCopyRegistrations } from "./credential-copy-tool.js";
4
4
  export type { CredentialCopyRequired } from "./credential-copy-tool.js";
5
5
  export type * from "./credential-tool-host.js";
6
6
  export type * from "./credential-tool-operations.js";
7
+ /** Optional plugin catalogs enrich this feature's create form without owning its save path. */
8
+ export declare function loadCreateCredentialProviders({ routeDeps }: {
9
+ routeDeps: {
10
+ workspaceId: string;
11
+ loadDeployTargets?: (input: {
12
+ workspaceId: string;
13
+ }) => Promise<{
14
+ list(): readonly {
15
+ descriptor: {
16
+ id: string;
17
+ credential?: {
18
+ vendorId: string;
19
+ };
20
+ };
21
+ }[];
22
+ }>;
23
+ loadSourceControlProviders(input: {
24
+ workspaceId: string;
25
+ }): Promise<{
26
+ list(): readonly {
27
+ descriptor: {
28
+ id: string;
29
+ };
30
+ }[];
31
+ }>;
32
+ };
33
+ }, _options?: {}): Promise<{
34
+ id: string;
35
+ vendorId: string;
36
+ }[]>;
7
37
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,23 @@
1
+ import { orFallback } from '@jini-ai/core/errors/idioms';
1
2
  /** Credential tools over required host operations, vocabulary and card ports. */
2
3
  export { createCredentialSaveHandlers, createCredentialToolRegistrations } from "./tool-registrations.js";
3
4
  export { createCredentialCopyRegistrations } from "./credential-copy-tool.js";
5
+ /** Optional plugin catalogs enrich this feature's create form without owning its save path. */
6
+ export async function loadCreateCredentialProviders({ routeDeps }, _options = {}) {
7
+ const providers = [];
8
+ // Catalogs enrich a create-time prefill only. An unavailable plugin must not prevent saving
9
+ // an API key or erase explicitly supplied compatibility IDs.
10
+ await orFallback({ work: async () => {
11
+ for (const { descriptor } of (await routeDeps.loadDeployTargets?.({ workspaceId: routeDeps.workspaceId }))?.list() ?? []) {
12
+ if (descriptor.credential)
13
+ providers.push({ id: descriptor.id, vendorId: descriptor.credential.vendorId });
14
+ }
15
+ }, fallback: undefined, step: 'Read hosting credential choices' }); /* The API key form still works without hosting plugins. */
16
+ await orFallback({ work: async () => {
17
+ for (const { descriptor } of (await routeDeps.loadSourceControlProviders({ workspaceId: routeDeps.workspaceId })).list()) {
18
+ providers.push({ id: descriptor.id, vendorId: descriptor.id });
19
+ }
20
+ }, fallback: undefined, step: 'Read source-control credential choices' }); /* Source-control catalog enrichment is optional too. */
21
+ return providers;
22
+ }
4
23
  //# sourceMappingURL=index.js.map
@@ -383,7 +383,6 @@ async function saveCreateCard(required, _optional = {}) {
383
383
  category: submission.category,
384
384
  baseUrl: submission.baseUrl,
385
385
  ...(submission.additionalHosts === undefined ? {} : { additionalHosts: submission.additionalHosts }),
386
- ...(submission.scope ? { scope: submission.scope } : {}),
387
386
  connection: { token: operations.policy.cleanToken({ token: submission.token }), ...(submission.username !== undefined ? { username: submission.username } : {}) },
388
387
  });
389
388
  invalidate({ after: saved });
@@ -0,0 +1,79 @@
1
+ import type { AgentToolDefinition } from "@jini-ai/core";
2
+ /**
3
+ * @file Custom-credential read, verification, request, username and file-write tool catalog.
4
+ * The host's credential_save tool owns creation/rotation schemas; the host's tool registrations own
5
+ * the wiring and its authorization, human-input and write-freshness rationale.
6
+ *
7
+ * content_read.custom_credential returns saved labels, hosts, account identifiers and timestamps,
8
+ * using the non-decrypting store read model. CustomCredentialSummary cannot carry a token and
9
+ * listing must not depend on a working site key. Labels let callers reuse saved credentials
10
+ * without asking the human to retype identifiers the system already knows.
11
+ * verify and make_request return authDiagnostic for 401/403; set_username repairs the non-secret
12
+ * account identifier without accepting or touching a token. credential_save distinguishes new
13
+ * API rows from existing-label rotation and refuses duplicate-label creation.
14
+ *
15
+ * DELETE requests require human confirmation; GET/POST/PUT/PATCH and named file creation/editing
16
+ * run directly under the owner's policy. File writes use a validated provider plan and one atomic
17
+ * commit; see the host's tool registrations for the unchanged branch-freshness boundary.
18
+ * No schema here carries a token. credentialed-request.ts owns the saved-origin allowlist and
19
+ * server-side Authorization injection, so a caller-supplied URL cannot redirect a credential.
20
+ *
21
+ * Every tool name, permission and description sentence is a host input; this module owns only the
22
+ * input-schema shapes the credential handlers validate against.
23
+ */
24
+ /** The host's tool names, matching its handler ids and reviewed metadata. */
25
+ export interface CustomCredentialsAgentToolIds {
26
+ readonly list: string;
27
+ readonly verify: string;
28
+ readonly makeRequest: string;
29
+ readonly setUsername: string;
30
+ readonly writeFiles: string;
31
+ }
32
+ /** The host's model-facing sentences for each tool and input field. */
33
+ export interface CustomCredentialsAgentToolCopy {
34
+ /** The shared `label` field description every label-taking tool uses. */
35
+ readonly labelField: string;
36
+ readonly tools: {
37
+ readonly list: string;
38
+ readonly verify: string;
39
+ readonly makeRequest: string;
40
+ readonly setUsername: string;
41
+ readonly writeFiles: string;
42
+ };
43
+ readonly makeRequestFields: {
44
+ readonly method: string;
45
+ readonly url: string;
46
+ readonly headers: string;
47
+ readonly body: string;
48
+ };
49
+ readonly setUsernameFields: {
50
+ readonly username: string;
51
+ };
52
+ readonly writeFilesFields: {
53
+ readonly owner: string;
54
+ readonly repo: string;
55
+ readonly branch: string;
56
+ readonly commitMessage: string;
57
+ readonly path: string;
58
+ readonly content: string;
59
+ readonly files: string;
60
+ };
61
+ }
62
+ /**
63
+ * This domain's fixed agent-tool catalog, in the host's names, permissions and words.
64
+ *
65
+ * @param required.writeFilesLimits - The host's enforced write-files caps; `maxFiles` bounds `files`.
66
+ * @complexity O(1) — a fixed, statically-shaped list.
67
+ */
68
+ export declare function buildCustomCredentialsAgentToolCatalog(required: {
69
+ readonly ids: CustomCredentialsAgentToolIds;
70
+ readonly permissions: {
71
+ readonly read: string;
72
+ readonly write: string;
73
+ };
74
+ readonly copy: CustomCredentialsAgentToolCopy;
75
+ readonly writeFilesLimits: {
76
+ readonly maxFiles: number;
77
+ };
78
+ }, _optional?: Record<string, never>): AgentToolDefinition[];
79
+ //# sourceMappingURL=agent-tools.d.ts.map
@@ -0,0 +1,98 @@
1
+ /** No arguments — parameterless read tool. Same shape every other domain's own `NO_INPUT_SCHEMA`
2
+ * declares — declared locally rather than shared, per this codebase's "duplicate the tiny type,
3
+ * never share across features/files" convention. */
4
+ const LIST_SCHEMA = {
5
+ type: "object",
6
+ additionalProperties: false,
7
+ required: [],
8
+ properties: {},
9
+ };
10
+ function verifySchema({ copy }) {
11
+ return {
12
+ type: "object",
13
+ additionalProperties: false,
14
+ required: ["label"],
15
+ properties: {
16
+ label: { type: "string", description: copy.labelField },
17
+ },
18
+ };
19
+ }
20
+ function makeRequestSchema({ copy }) {
21
+ const fields = copy.makeRequestFields;
22
+ return {
23
+ type: "object",
24
+ additionalProperties: false,
25
+ required: ["label", "method", "url"],
26
+ properties: {
27
+ label: { type: "string", description: copy.labelField },
28
+ method: { type: "string", enum: ["GET", "POST", "PUT", "PATCH", "DELETE"], description: fields.method },
29
+ url: { type: "string", description: fields.url },
30
+ headers: { type: "object", additionalProperties: { type: "string" }, description: fields.headers },
31
+ body: { type: "string", description: fields.body },
32
+ },
33
+ };
34
+ }
35
+ function setUsernameSchema({ copy }) {
36
+ return {
37
+ type: "object",
38
+ additionalProperties: false,
39
+ required: ["label", "username"],
40
+ properties: {
41
+ label: { type: "string", description: copy.labelField },
42
+ username: { type: ["string", "null"], description: copy.setUsernameFields.username },
43
+ },
44
+ };
45
+ }
46
+ /** `custom_credential_write_files`'s entire input shape. `files.maxItems` is bound to the SAME
47
+ * `maxFiles` cap the host's write-files validation actually enforces, so the schema the
48
+ * model sees can never silently drift from the real cap. */
49
+ function writeFilesSchema({ copy, maxFiles }) {
50
+ const fields = copy.writeFilesFields;
51
+ return {
52
+ type: "object",
53
+ additionalProperties: false,
54
+ required: ["label", "owner", "repo", "branch", "commitMessage", "files"],
55
+ properties: {
56
+ label: { type: "string", description: copy.labelField },
57
+ owner: { type: "string", description: fields.owner },
58
+ repo: { type: "string", description: fields.repo },
59
+ branch: { type: "string", description: fields.branch },
60
+ commitMessage: { type: "string", description: fields.commitMessage },
61
+ files: {
62
+ type: "array",
63
+ minItems: 1,
64
+ maxItems: maxFiles,
65
+ items: {
66
+ type: "object",
67
+ additionalProperties: false,
68
+ required: ["path", "content"],
69
+ properties: {
70
+ path: { type: "string", description: fields.path },
71
+ content: { type: "string", description: fields.content },
72
+ },
73
+ },
74
+ description: fields.files,
75
+ },
76
+ },
77
+ };
78
+ }
79
+ /**
80
+ * This domain's fixed agent-tool catalog, in the host's names, permissions and words.
81
+ *
82
+ * @param required.writeFilesLimits - The host's enforced write-files caps; `maxFiles` bounds `files`.
83
+ * @complexity O(1) — a fixed, statically-shaped list.
84
+ */
85
+ export function buildCustomCredentialsAgentToolCatalog(required, _optional = {}) {
86
+ const { ids, permissions, copy } = required;
87
+ return [
88
+ { name: ids.list, description: copy.tools.list, sideEffects: "none", authorization: { permission: permissions.read }, inputSchema: LIST_SCHEMA },
89
+ { name: ids.verify, description: copy.tools.verify, sideEffects: "none", authorization: { permission: permissions.read }, inputSchema: verifySchema({ copy }) },
90
+ { name: ids.makeRequest, description: copy.tools.makeRequest, sideEffects: "mutates-durable-state", authorization: { permission: permissions.write }, inputSchema: makeRequestSchema({ copy }) },
91
+ { name: ids.setUsername, description: copy.tools.setUsername, sideEffects: "mutates-durable-state", authorization: { permission: permissions.write }, inputSchema: setUsernameSchema({ copy }) },
92
+ {
93
+ name: ids.writeFiles, description: copy.tools.writeFiles, sideEffects: "mutates-durable-state", authorization: { permission: permissions.write },
94
+ inputSchema: writeFilesSchema({ copy, maxFiles: required.writeFilesLimits.maxFiles }),
95
+ },
96
+ ];
97
+ }
98
+ //# sourceMappingURL=agent-tools.js.map
@@ -0,0 +1,15 @@
1
+ /** Shown instead of the store's byte-range rule when a cleaned token still has a non-visible-ASCII character. */
2
+ export declare const TOKEN_PASTE_AGAIN_MESSAGE = "The token has a space, line break or special character in it \u2014 paste it again.";
3
+ /**
4
+ * Strips leading and trailing whitespace and zero-width characters from a card-submitted token.
5
+ *
6
+ * @param required - The raw submitted token.
7
+ * @returns The token without edge junk; an all-junk token returns "" for the store's blank rule.
8
+ * @throws CustomCredentialValidationError with {@link TOKEN_PASTE_AGAIN_MESSAGE} when an interior
9
+ * character is outside visible ASCII. The message never quotes the token.
10
+ * @complexity O(n) in the token length.
11
+ */
12
+ export declare function cleanCardToken({ token }: {
13
+ token: string;
14
+ }, _optional?: {}): string;
15
+ //# sourceMappingURL=card-token.d.ts.map
@@ -0,0 +1,35 @@
1
+ import { CustomCredentialValidationError } from "../credentialed-http/sets/store.js";
2
+ /**
3
+ * @file The one place a token typed or pasted into a credential card is cleaned before the store
4
+ * validates it. Copying a key from a provider's dashboard often brings a trailing newline or space,
5
+ * and from some web pages an invisible zero-width character that `String.prototype.trim` keeps
6
+ * (2026-10-22: a pasted key was refused with the raw "visible ASCII (0x21–0x7E)" rule). Edge junk is
7
+ * dropped; the interior is never rewritten, so a real stray character still refuses, in words a
8
+ * person can act on.
9
+ */
10
+ /** Whitespace plus the zero-width characters (ZWSP, ZWNJ, ZWJ, word joiner, BOM) `trim` keeps. */
11
+ const EDGE_JUNK = /^[\s​-‍⁠]$/u;
12
+ /** Shown instead of the store's byte-range rule when a cleaned token still has a non-visible-ASCII character. */
13
+ export const TOKEN_PASTE_AGAIN_MESSAGE = "The token has a space, line break or special character in it — paste it again.";
14
+ /**
15
+ * Strips leading and trailing whitespace and zero-width characters from a card-submitted token.
16
+ *
17
+ * @param required - The raw submitted token.
18
+ * @returns The token without edge junk; an all-junk token returns "" for the store's blank rule.
19
+ * @throws CustomCredentialValidationError with {@link TOKEN_PASTE_AGAIN_MESSAGE} when an interior
20
+ * character is outside visible ASCII. The message never quotes the token.
21
+ * @complexity O(n) in the token length.
22
+ */
23
+ export function cleanCardToken({ token }, _optional = {}) {
24
+ let start = 0;
25
+ let end = token.length;
26
+ while (start < end && EDGE_JUNK.test(token[start]))
27
+ start++;
28
+ while (end > start && EDGE_JUNK.test(token[end - 1]))
29
+ end--;
30
+ const cleaned = token.slice(start, end);
31
+ if (/[^\x21-\x7e]/.test(cleaned))
32
+ throw new CustomCredentialValidationError(TOKEN_PASTE_AGAIN_MESSAGE);
33
+ return cleaned;
34
+ }
35
+ //# sourceMappingURL=card-token.js.map
@@ -0,0 +1,70 @@
1
+ /**
2
+ * @file The binding of the core credential request port over a host's EXISTING request functions
3
+ * (the source-control write port is bound separately). Nothing here reimplements a request; each method
4
+ * forwards to the same function the host's tool handlers call today, with the same dependencies, so
5
+ * audit, egress, diagnostic, not-found and remedy-wording policy stay exactly where they are.
6
+ */
7
+ import type { CredentialProbeInput, CredentialProbeStatus, CredentialVerification, CredentialedRequestErrorClass, CredentialedRequestOptional, CredentialedRequestPort, CredentialedRequestRequired, CredentialedRequestResult, CredentialedRequestTarget } from "@jini-ai/core/contracts/credentials";
8
+ /** The host's egress-refusal error class (the guarded HTTP client's refusal), injected so this package
9
+ * recognises and rebuilds the host's own class without importing the platform package. */
10
+ export interface EgressRefusedErrorClass {
11
+ new (details: {
12
+ message: string;
13
+ }, options: {
14
+ callerSafeMessage: string;
15
+ }): Error & {
16
+ readonly callerSafeMessage: string;
17
+ };
18
+ }
19
+ /** Classify by the classes the request adapter actually throws; the thrown object is returned as is.
20
+ * The egress rebuild is the one the host's tool registrations perform before schema decoration.
21
+ * @param required.error The thrown value to classify.
22
+ * @param required.EgressRefusedError The host's egress-refusal class, used for the `instanceof` check and the caller-safe rebuild.
23
+ * @complexity O(1) — at most four `instanceof` checks.
24
+ */
25
+ export declare function classifyCredentialedRequestError({ error, EgressRefusedError }: {
26
+ error: unknown;
27
+ EgressRefusedError: EgressRefusedErrorClass;
28
+ }, _optional?: {}): CredentialedRequestErrorClass;
29
+ /** The host's existing request functions, each taking the host's own dependency bag first. */
30
+ export interface CredentialedRequestHostOperations<Deps extends {
31
+ readonly repo: unknown;
32
+ readonly httpClient: unknown;
33
+ }> {
34
+ makeCredentialedRequest(deps: Deps, input: CredentialedRequestRequired & {
35
+ readonly headers: CredentialedRequestOptional["headers"] | undefined;
36
+ readonly body: CredentialedRequestOptional["body"] | undefined;
37
+ }): Promise<CredentialedRequestResult>;
38
+ resolveRequestTarget(deps: {
39
+ readonly repo: Deps["repo"];
40
+ }, input: {
41
+ readonly workspaceId: string;
42
+ readonly label: string;
43
+ readonly url: string;
44
+ }): Promise<CredentialedRequestTarget>;
45
+ verifyCustomCredential(deps: Deps, input: {
46
+ readonly workspaceId: string;
47
+ readonly label: string;
48
+ }): Promise<CredentialVerification>;
49
+ probeCredentialConnection(input: CredentialProbeInput, options: {
50
+ readonly httpClient: Deps["httpClient"];
51
+ }): Promise<CredentialProbeStatus>;
52
+ }
53
+ /** Bind the request port over the host's existing adapter and its composition-built dependencies.
54
+ * @param required.deps The SAME dependencies the host's tool handlers build (repo, sealer, guarded
55
+ * client, clock, audit, auth-scheme loader).
56
+ * @param required.operations The host's existing request functions those dependencies feed.
57
+ * @param required.EgressRefusedError The host's egress-refusal class, forwarded to `classifyError`.
58
+ * @returns A port whose every call is one call of the existing adapter function.
59
+ * @complexity O(1) to build; each method costs exactly what the forwarded function costs.
60
+ * @example const port = bindCredentialedRequestPort({ deps, operations, EgressRefusedError }); await port.verify({ workspaceId, label });
61
+ */
62
+ export declare function bindCredentialedRequestPort<Deps extends {
63
+ readonly repo: unknown;
64
+ readonly httpClient: unknown;
65
+ }>(required: {
66
+ deps: Deps;
67
+ operations: CredentialedRequestHostOperations<Deps>;
68
+ EgressRefusedError: EgressRefusedErrorClass;
69
+ }, _optional?: {}): CredentialedRequestPort;
70
+ //# sourceMappingURL=credential-ports.d.ts.map
@@ -0,0 +1,41 @@
1
+ import { CredentialedRequestTransportError, CredentialedRequestValidationError } from "../credentialed-http/credentialed-request.js";
2
+ import { CustomCredentialNotFoundError } from "../credentialed-http/sets/store.js";
3
+ /** Classify by the classes the request adapter actually throws; the thrown object is returned as is.
4
+ * The egress rebuild is the one the host's tool registrations perform before schema decoration.
5
+ * @param required.error The thrown value to classify.
6
+ * @param required.EgressRefusedError The host's egress-refusal class, used for the `instanceof` check and the caller-safe rebuild.
7
+ * @complexity O(1) — at most four `instanceof` checks.
8
+ */
9
+ export function classifyCredentialedRequestError({ error, EgressRefusedError }, _optional = {}) {
10
+ if (error instanceof EgressRefusedError) {
11
+ const callerSafeMessage = error.callerSafeMessage;
12
+ return { category: "egress-refused", error, callerSafeMessage, callerSafeError: new EgressRefusedError({ message: callerSafeMessage }, { callerSafeMessage }) };
13
+ }
14
+ if (error instanceof CredentialedRequestValidationError)
15
+ return { category: "validation", error, callerSafeMessage: error.message };
16
+ if (error instanceof CustomCredentialNotFoundError)
17
+ return { category: "not-found", error, callerSafeMessage: error.message };
18
+ if (error instanceof CredentialedRequestTransportError)
19
+ return { category: "transport", error };
20
+ return { category: "unknown", error };
21
+ }
22
+ /** Bind the request port over the host's existing adapter and its composition-built dependencies.
23
+ * @param required.deps The SAME dependencies the host's tool handlers build (repo, sealer, guarded
24
+ * client, clock, audit, auth-scheme loader).
25
+ * @param required.operations The host's existing request functions those dependencies feed.
26
+ * @param required.EgressRefusedError The host's egress-refusal class, forwarded to `classifyError`.
27
+ * @returns A port whose every call is one call of the existing adapter function.
28
+ * @complexity O(1) to build; each method costs exactly what the forwarded function costs.
29
+ * @example const port = bindCredentialedRequestPort({ deps, operations, EgressRefusedError }); await port.verify({ workspaceId, label });
30
+ */
31
+ export function bindCredentialedRequestPort(required, _optional = {}) {
32
+ const { deps, operations, EgressRefusedError } = required;
33
+ return {
34
+ request: (input, optional = {}) => operations.makeCredentialedRequest(deps, { ...input, headers: optional.headers, body: optional.body }),
35
+ resolveTarget: (input) => operations.resolveRequestTarget({ repo: deps.repo }, input),
36
+ verify: (input) => operations.verifyCustomCredential(deps, input),
37
+ probe: (input) => operations.probeCredentialConnection(input, { httpClient: deps.httpClient }),
38
+ classifyError: ({ error }) => classifyCredentialedRequestError({ error, EgressRefusedError }),
39
+ };
40
+ }
41
+ //# sourceMappingURL=credential-ports.js.map
@@ -0,0 +1,20 @@
1
+ import type { ToolFailureDiagnostic } from "@jini-ai/core/contracts/site/daemon-tool-recovery";
2
+ export interface CredentialSetupFailure {
3
+ executed: false;
4
+ credentialSetup: ToolFailureDiagnostic;
5
+ }
6
+ /** The host's credential-setup issuer (the daemon issuer bound to the host's credential-free-field
7
+ * and secret-redaction validation). Injected: the host owns that validation policy. */
8
+ export type IssueCredentialSetup = (required: {
9
+ setupToolId: string;
10
+ prefill: Readonly<Record<string, string | number | boolean | null>>;
11
+ }, optional?: Record<string, never>) => ToolFailureDiagnostic;
12
+ /** Preserve provider output, while offering the credential card the failing call can actually use. */
13
+ export declare function withCustomCredentialSetup<T>({ invoke, label, url, verification, issueCredentialSetup }: {
14
+ invoke: () => Promise<T>;
15
+ label: string;
16
+ url?: string;
17
+ verification?: boolean;
18
+ issueCredentialSetup: IssueCredentialSetup;
19
+ }, _optional?: {}): Promise<T | CredentialSetupFailure>;
20
+ //# sourceMappingURL=credential-recovery.d.ts.map