@jini-ai/integrations 0.6.17 → 0.7.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/CHANGELOG.md +42 -1
- package/dist/api-connections/access-token.js +4 -14
- package/dist/api-connections/account-actions.d.ts +6 -1
- package/dist/api-connections/attempt-state.d.ts +2 -2
- package/dist/api-connections/attempt-state.js +10 -11
- package/dist/api-connections/authorization.js +13 -20
- package/dist/api-connections/budgets.d.ts +91 -0
- package/dist/api-connections/budgets.js +87 -0
- package/dist/api-connections/byo-client.d.ts +38 -0
- package/dist/api-connections/byo-client.js +28 -0
- package/dist/api-connections/connect.d.ts +87 -0
- package/dist/api-connections/connect.js +143 -0
- package/dist/api-connections/declarations.d.ts +68 -0
- package/dist/api-connections/declarations.js +178 -0
- package/dist/api-connections/deps.d.ts +4 -1
- package/dist/api-connections/descriptor.d.ts +15 -0
- package/dist/api-connections/descriptor.js +1 -5
- package/dist/api-connections/finish-authorization.d.ts +1 -1
- package/dist/api-connections/hook-http.d.ts +20 -0
- package/dist/api-connections/hook-http.js +27 -0
- package/dist/api-connections/host-ports.d.ts +244 -0
- package/dist/api-connections/host-ports.js +2 -0
- package/dist/api-connections/host.d.ts +81 -0
- package/dist/api-connections/host.js +320 -0
- package/dist/api-connections/hosted-mcp/contracts.d.ts +291 -0
- package/dist/api-connections/hosted-mcp/contracts.js +2 -0
- package/dist/api-connections/hosted-mcp/index.d.ts +5 -0
- package/dist/api-connections/hosted-mcp/index.js +3 -0
- package/dist/api-connections/hosted-mcp/shared-sign-in.d.ts +167 -0
- package/dist/api-connections/hosted-mcp/shared-sign-in.js +293 -0
- package/dist/api-connections/hosted-mcp/sign-in.d.ts +25 -0
- package/dist/api-connections/hosted-mcp/sign-in.js +889 -0
- package/dist/api-connections/hosted-sign-in.d.ts +48 -0
- package/dist/api-connections/hosted-sign-in.js +51 -0
- package/dist/api-connections/index.d.ts +23 -1
- package/dist/api-connections/index.js +15 -0
- package/dist/api-connections/install-credential.d.ts +1 -1
- package/dist/api-connections/oauth-capabilities.d.ts +63 -0
- package/dist/api-connections/oauth-capabilities.js +2 -0
- package/dist/api-connections/ports.d.ts +1 -1
- package/dist/api-connections/request-checks.d.ts +11 -1
- package/dist/api-connections/request-checks.js +2 -3
- package/dist/api-connections/shared.d.ts +79 -0
- package/dist/api-connections/shared.js +106 -0
- package/dist/api-connections/token-store/record.d.ts +2 -2
- package/dist/api-connections/token-store/vault-token-store.d.ts +30 -4
- package/dist/api-connections/token-store/vault-token-store.js +1 -4
- package/dist/credentialed-http/sets/host.d.ts +146 -0
- package/dist/credentialed-http/sets/host.js +2 -0
- package/dist/credentialed-http/sets/index.d.ts +24 -0
- package/dist/credentialed-http/sets/index.js +24 -0
- package/dist/credentialed-http/sets/store.d.ts +193 -0
- package/dist/credentialed-http/sets/store.js +489 -0
- package/dist/credentialed-http/sets/vault-repo.d.ts +81 -0
- package/dist/credentialed-http/sets/vault-repo.js +147 -0
- package/dist/credentialed-http/tools/credential-copy-tool.d.ts +34 -0
- package/dist/credentialed-http/tools/credential-copy-tool.js +132 -0
- package/dist/credentialed-http/tools/credential-tool-host.d.ts +152 -0
- package/dist/credentialed-http/tools/credential-tool-host.js +2 -0
- package/dist/credentialed-http/tools/credential-tool-operations.d.ts +370 -0
- package/dist/credentialed-http/tools/credential-tool-operations.js +2 -0
- package/dist/credentialed-http/tools/index.d.ts +7 -0
- package/dist/credentialed-http/tools/index.js +4 -0
- package/dist/credentialed-http/tools/tool-registrations.d.ts +55 -0
- package/dist/credentialed-http/tools/tool-registrations.js +729 -0
- package/package.json +34 -11
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Consumer-only ports for credential tools. Implementations belong to the composing host.
|
|
3
|
+
*/
|
|
4
|
+
import type { ApprovalAnswer, ApprovalSteps, DerivedRiskByToolId, LegacyToolAuthorizeFn, SurfaceExchangeStore, ToolExecutionContext, ToolExecutionOptions, ToolHandler } from '@jini-ai/core';
|
|
5
|
+
import type { SecretCardForm, SurfaceDetail, SurfaceOutcomeSpec } from '@jini-ai/core/contracts/cards';
|
|
6
|
+
import type { CredentialAuthSchemeRule, CredentialSetConnectionInput, CredentialSetSummary, CredentialSetTokenHint, PluginCredentialCard } from '@jini-ai/core/contracts/credentials';
|
|
7
|
+
import type { VaultRepoPort } from '@jini-ai/core/contracts/vault';
|
|
8
|
+
import type { CallerSafeErrorRule, ModelFacingErrorRule } from '@jini-ai/core/model-facing-tool-errors';
|
|
9
|
+
/**
|
|
10
|
+
* Only the approval fields this consumer needs; no host server or UI implementation type.
|
|
11
|
+
*/
|
|
12
|
+
/** @agent-note The tool id must route the authenticated human answer to the SAME held call described by the resolved label, host and path. */
|
|
13
|
+
export interface CredentialApprovalDescription {
|
|
14
|
+
readonly toolId: string;
|
|
15
|
+
readonly errorCode: string;
|
|
16
|
+
readonly title: string;
|
|
17
|
+
readonly description?: string;
|
|
18
|
+
readonly details: readonly SurfaceDetail[];
|
|
19
|
+
readonly warning?: string;
|
|
20
|
+
readonly danger?: boolean;
|
|
21
|
+
readonly confirmLabel: string;
|
|
22
|
+
readonly cancelLabel?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Approval lifecycle and authenticated human transport, independently supplied by the host.
|
|
26
|
+
*/
|
|
27
|
+
/** @agent-note Freeze input, principal and run before awaits, accept only an explicit authenticated human answer, and recheck permission and abort before decrypting or sending. */
|
|
28
|
+
export interface CredentialApprovalPort {
|
|
29
|
+
handler<Prepared>(required: ApprovalSteps<Prepared, CredentialApprovalDescription>, optional?: Record<string, never>): ToolHandler;
|
|
30
|
+
askHuman(required: {
|
|
31
|
+
ctx: ToolExecutionContext;
|
|
32
|
+
description: CredentialApprovalDescription;
|
|
33
|
+
}, optional: ToolExecutionOptions): Promise<ApprovalAnswer>;
|
|
34
|
+
describeDelete(required: {
|
|
35
|
+
label: string;
|
|
36
|
+
host: string;
|
|
37
|
+
path: string;
|
|
38
|
+
}, optional?: Record<string, never>): CredentialApprovalDescription;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Display-only card declarations and human-submitted connection fields.
|
|
42
|
+
*/
|
|
43
|
+
/** @agent-note Treat absent or failed optional card loading as empty enrichment, while fixed destinations, field validation and owned labels remain authoritative. */
|
|
44
|
+
export interface CredentialPluginCardsPort {
|
|
45
|
+
load(required: {
|
|
46
|
+
workspaceId: string;
|
|
47
|
+
}, optional?: Record<string, never>): Promise<readonly PluginCredentialCard[]>;
|
|
48
|
+
find(required: {
|
|
49
|
+
workspaceId: string;
|
|
50
|
+
saveKind: PluginCredentialCard['saveKind'];
|
|
51
|
+
target: string;
|
|
52
|
+
}, optional?: Record<string, never>): Promise<PluginCredentialCard | undefined>;
|
|
53
|
+
readValues(required: {
|
|
54
|
+
card: PluginCredentialCard;
|
|
55
|
+
values: Readonly<Record<string, unknown>>;
|
|
56
|
+
}, optional?: Record<string, never>): {
|
|
57
|
+
label: string;
|
|
58
|
+
category: string;
|
|
59
|
+
baseUrl: string;
|
|
60
|
+
username?: string;
|
|
61
|
+
token: string;
|
|
62
|
+
additionalHosts?: readonly string[];
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Non-secret form protocol; field names are saved-card protocol, not product vocabulary.
|
|
67
|
+
*/
|
|
68
|
+
/** @agent-note Validate prefill as secret-free metadata before rendering; worksFor neither selects nor authorizes a credential. */
|
|
69
|
+
export interface CredentialCreatePrefill {
|
|
70
|
+
readonly label?: string;
|
|
71
|
+
readonly baseUrl?: string;
|
|
72
|
+
readonly category?: string;
|
|
73
|
+
readonly worksFor?: string[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Host card descriptions, usually provided by UI builders wired at composition.
|
|
77
|
+
*/
|
|
78
|
+
/** @agent-note Mask token fields without prefilling them, and send the outcome on the SAME URI only after the save completes. */
|
|
79
|
+
export interface CredentialCardFormsPort {
|
|
80
|
+
buildPlugin(required: {
|
|
81
|
+
card: PluginCredentialCard;
|
|
82
|
+
}, optional?: Record<string, never>): SecretCardForm;
|
|
83
|
+
applyPlugin(required: {
|
|
84
|
+
card?: PluginCredentialCard | undefined;
|
|
85
|
+
form: SecretCardForm;
|
|
86
|
+
}, optional?: Record<string, never>): SecretCardForm;
|
|
87
|
+
create(required: {
|
|
88
|
+
prefill: CredentialCreatePrefill;
|
|
89
|
+
providers: readonly {
|
|
90
|
+
id: string;
|
|
91
|
+
vendorId: string;
|
|
92
|
+
}[];
|
|
93
|
+
}, optional?: Record<string, never>): SecretCardForm;
|
|
94
|
+
createOutcome(required: {
|
|
95
|
+
label: string;
|
|
96
|
+
state: 'success' | 'failure';
|
|
97
|
+
message: string;
|
|
98
|
+
}, optional?: Record<string, never>): SurfaceOutcomeSpec;
|
|
99
|
+
rotate(required: {
|
|
100
|
+
label: string;
|
|
101
|
+
}, optional?: Record<string, never>): SecretCardForm;
|
|
102
|
+
rotateOutcome(required: {
|
|
103
|
+
label: string;
|
|
104
|
+
state: 'success' | 'failure';
|
|
105
|
+
message: string;
|
|
106
|
+
}, optional?: Record<string, never>): SurfaceOutcomeSpec;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Only the recovery facts this consumer returns. Additional host-issued fields remain intact.
|
|
110
|
+
*/
|
|
111
|
+
/** @agent-note Preserve the issued diagnostic object and its non-enumerable provenance rather than reconstructing it from public fields. */
|
|
112
|
+
export interface CredentialSetupDiagnostic {
|
|
113
|
+
readonly hint?: string;
|
|
114
|
+
readonly remedyToolId?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface CredentialToolSetupFailure {
|
|
117
|
+
readonly executed: false;
|
|
118
|
+
readonly credentialSetup: CredentialSetupDiagnostic;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Credential setup diagnostics retain the host's issuance and validation policy.
|
|
122
|
+
*/
|
|
123
|
+
/** @agent-note Only explicit invalid verification may offer replacement, because transport or unreachable failures never establish credential invalidity. */
|
|
124
|
+
export interface CredentialRecoveryPort {
|
|
125
|
+
withSetup<Result>(required: {
|
|
126
|
+
invoke: () => Promise<Result>;
|
|
127
|
+
label: string;
|
|
128
|
+
url?: string;
|
|
129
|
+
verification?: boolean;
|
|
130
|
+
}, optional?: Record<string, never>): Promise<Result | CredentialToolSetupFailure>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Read-only catalogs and publish compatibility invalidation, bound over the host's current objects.
|
|
134
|
+
*/
|
|
135
|
+
/** @agent-note Prepare invalidation from the attached registry before persistence and invoke its captured callback only after a successful save, without reloading or invalidating on failure. */
|
|
136
|
+
export interface CredentialPublishPort {
|
|
137
|
+
/** @agent-note Optional catalog failures must return empty enrichment without blocking a save or removing explicit worksFor ids. */
|
|
138
|
+
loadProviders(required: Record<string, never>, optional?: Record<string, never>): Promise<{
|
|
139
|
+
id: string;
|
|
140
|
+
vendorId: string;
|
|
141
|
+
}[]>;
|
|
142
|
+
prepareInvalidation(required: Record<string, never>, optional?: Record<string, never>): Promise<(required: {
|
|
143
|
+
after: CredentialSetSummary;
|
|
144
|
+
}) => void>;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Host locale and translated safe credential copy.
|
|
148
|
+
*/
|
|
149
|
+
/** @agent-note Translate only caller-safe text for the authenticated scope, and reserve token hints for human outcomes rather than model results. */
|
|
150
|
+
export interface CredentialLocalePort {
|
|
151
|
+
resolve(required: {
|
|
152
|
+
principalId: string;
|
|
153
|
+
}, optional?: Record<string, never>): Promise<string>;
|
|
154
|
+
text(required: {
|
|
155
|
+
id: 'blank' | 'saved';
|
|
156
|
+
locale: string;
|
|
157
|
+
}, optional?: Record<string, never>): string;
|
|
158
|
+
hint(required: {
|
|
159
|
+
hint: CredentialSetTokenHint | null | undefined;
|
|
160
|
+
locale: string;
|
|
161
|
+
}, optional?: Record<string, never>): string;
|
|
162
|
+
translate(required: {
|
|
163
|
+
message: string;
|
|
164
|
+
locale: string;
|
|
165
|
+
}, optional?: Record<string, never>): string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Host token, public-field, abort and duplicate-message policy.
|
|
169
|
+
*/
|
|
170
|
+
/** @agent-note guardRepo must preserve receiver, vault, CAS and transaction identity while guarding site and project writes after asynchronous sealing. */
|
|
171
|
+
export interface CredentialToolPolicy {
|
|
172
|
+
guardRepo<Repo extends {
|
|
173
|
+
readonly vault?: VaultRepoPort;
|
|
174
|
+
}>(required: {
|
|
175
|
+
store: Repo;
|
|
176
|
+
signal: AbortSignal;
|
|
177
|
+
}, optional?: Record<string, never>): Repo;
|
|
178
|
+
/** @agent-note Preserve token interior bytes and never reflect them in normalization errors. */
|
|
179
|
+
cleanToken(required: {
|
|
180
|
+
token: string;
|
|
181
|
+
}, optional?: Record<string, never>): string;
|
|
182
|
+
assertFreeField(required: {
|
|
183
|
+
value: string;
|
|
184
|
+
field: string;
|
|
185
|
+
}, optional?: Record<string, never>): void;
|
|
186
|
+
normalizeWorksFor(required: {
|
|
187
|
+
value: unknown;
|
|
188
|
+
}, optional?: Record<string, never>): string[];
|
|
189
|
+
readonly defaultCategory: string;
|
|
190
|
+
/** @agent-note Classify only trusted project-conflict errors whose messages are already safe to publish. */
|
|
191
|
+
isProjectConflict(required: {
|
|
192
|
+
error: Error;
|
|
193
|
+
}, optional?: Record<string, never>): boolean;
|
|
194
|
+
validateWriteFiles(required: {
|
|
195
|
+
branch: unknown;
|
|
196
|
+
commitMessage: unknown;
|
|
197
|
+
files: unknown;
|
|
198
|
+
}, optional?: Record<string, never>): CredentialWriteFilesRequest;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Validated file payload before provider-specific owner/repository validation.
|
|
202
|
+
*/
|
|
203
|
+
/** @agent-note Validate reserved paths, sizes and canonical input errors before permission or I/O, then preserve the exact file payload through provider planning and commit. */
|
|
204
|
+
export interface CredentialWriteFilesRequest {
|
|
205
|
+
readonly branch: string;
|
|
206
|
+
readonly commitMessage: string;
|
|
207
|
+
readonly files: readonly {
|
|
208
|
+
readonly path: string;
|
|
209
|
+
readonly content: string;
|
|
210
|
+
}[];
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Every sentence assembled by the handler closure; host callbacks own interpolated wording too.
|
|
214
|
+
*/
|
|
215
|
+
/** @agent-note Messages may name rejected keys or a secret-free display label but must never echo submitted secret values. */
|
|
216
|
+
export interface CredentialToolMessages {
|
|
217
|
+
readonly formSaveFailure: string;
|
|
218
|
+
readonly noCreateChannel: string;
|
|
219
|
+
readonly noRotateChannel: string;
|
|
220
|
+
readonly noDeleteChannel: string;
|
|
221
|
+
readonly runEnded: string;
|
|
222
|
+
readonly invalidWorksFor: string;
|
|
223
|
+
readonly unlabeled: string;
|
|
224
|
+
readonly missingUsername: string;
|
|
225
|
+
readonly invalidUsername: string;
|
|
226
|
+
readonly probeOriginMismatch: string;
|
|
227
|
+
unexpectedUsername(required: {
|
|
228
|
+
keys: readonly string[];
|
|
229
|
+
}, optional?: Record<string, never>): string;
|
|
230
|
+
unexpectedToken(required: {
|
|
231
|
+
keys: readonly string[];
|
|
232
|
+
}, optional?: Record<string, never>): string;
|
|
233
|
+
notFoundLabel(required: {
|
|
234
|
+
label: string;
|
|
235
|
+
}, optional?: Record<string, never>): string;
|
|
236
|
+
notFoundId(required: {
|
|
237
|
+
id: string;
|
|
238
|
+
}, optional?: Record<string, never>): string;
|
|
239
|
+
duplicateLabel(required: {
|
|
240
|
+
label: string;
|
|
241
|
+
}, optional?: Record<string, never>): string;
|
|
242
|
+
missingPluginCard(required: {
|
|
243
|
+
providerId: string;
|
|
244
|
+
}, optional?: Record<string, never>): string;
|
|
245
|
+
writeFailure(required: {
|
|
246
|
+
message: string;
|
|
247
|
+
}, optional?: Record<string, never>): string;
|
|
248
|
+
probeFailure(required: {
|
|
249
|
+
status: 'refused' | 'unavailable';
|
|
250
|
+
keyHint?: string | undefined;
|
|
251
|
+
replacing: boolean;
|
|
252
|
+
}, optional?: Record<string, never>): string;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Log-only observations, never model-facing diagnostics.
|
|
256
|
+
*/
|
|
257
|
+
/** @agent-note describeError returns class/code only, while trusted provider failure detail stays in server logs and never human or model messages. */
|
|
258
|
+
export interface CredentialToolDiagnostics {
|
|
259
|
+
describeError(required: {
|
|
260
|
+
error: unknown;
|
|
261
|
+
}, optional?: Record<string, never>): string;
|
|
262
|
+
createFailure(required: {
|
|
263
|
+
metadata: {
|
|
264
|
+
toolId: string;
|
|
265
|
+
exchangeId: string;
|
|
266
|
+
saved: false;
|
|
267
|
+
};
|
|
268
|
+
}, optional?: Record<string, never>): void;
|
|
269
|
+
rotateFailure(required: {
|
|
270
|
+
toolId: string;
|
|
271
|
+
exchangeId: string;
|
|
272
|
+
credentialId: string;
|
|
273
|
+
errorSummary: string;
|
|
274
|
+
}, optional?: Record<string, never>): void;
|
|
275
|
+
writeFailure(required: {
|
|
276
|
+
phase: 'plan' | 'commit';
|
|
277
|
+
failure: {
|
|
278
|
+
readonly code: string;
|
|
279
|
+
readonly logDetail?: string;
|
|
280
|
+
};
|
|
281
|
+
}, optional?: Record<string, never>): void;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* The already-extracted credential-set job, bound over the host's C1 policy and current store.
|
|
285
|
+
*/
|
|
286
|
+
/** @agent-note Bind the SAME repo, vault, transaction and abort guard as host routes, rechecking current grants and CAS when replacing a selected authorized row. */
|
|
287
|
+
export interface CredentialToolSetsPort {
|
|
288
|
+
list(required: Record<string, never>, optional?: Record<string, never>): Promise<CredentialSetSummary[]>;
|
|
289
|
+
describe(required: {
|
|
290
|
+
id: string;
|
|
291
|
+
}, optional?: Record<string, never>): Promise<CredentialSetSummary | null>;
|
|
292
|
+
byLabel(required: {
|
|
293
|
+
label: string;
|
|
294
|
+
}, optional?: Record<string, never>): Promise<CredentialSetSummary | null>;
|
|
295
|
+
resolve(required: {
|
|
296
|
+
label: string;
|
|
297
|
+
}, optional?: Record<string, never>): Promise<{
|
|
298
|
+
baseUrl: string;
|
|
299
|
+
connection: CredentialSetConnectionInput;
|
|
300
|
+
} | null>;
|
|
301
|
+
setUsername(required: {
|
|
302
|
+
id: string;
|
|
303
|
+
username: string | null;
|
|
304
|
+
}, optional?: Record<string, never>): Promise<CredentialSetSummary>;
|
|
305
|
+
replace(required: {
|
|
306
|
+
id: string;
|
|
307
|
+
connection: CredentialSetConnectionInput;
|
|
308
|
+
signal: AbortSignal;
|
|
309
|
+
principalId: string;
|
|
310
|
+
guardRepo: CredentialToolPolicy['guardRepo'];
|
|
311
|
+
}, optional?: Record<string, never>): Promise<CredentialSetSummary>;
|
|
312
|
+
create(required: {
|
|
313
|
+
label: string;
|
|
314
|
+
worksFor: unknown;
|
|
315
|
+
category: string;
|
|
316
|
+
baseUrl: string;
|
|
317
|
+
additionalHosts?: readonly string[];
|
|
318
|
+
scope?: 'site';
|
|
319
|
+
connection: CredentialSetConnectionInput;
|
|
320
|
+
signal: AbortSignal;
|
|
321
|
+
guardRepo: CredentialToolPolicy['guardRepo'];
|
|
322
|
+
}, optional?: Record<string, never>): Promise<CredentialSetSummary>;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Only authenticated scope, authorization and trusted scheme loading are consumed directly.
|
|
326
|
+
*/
|
|
327
|
+
/** @agent-note Workspace and principal scope must come from trusted host composition rather than model input or card answers. */
|
|
328
|
+
export interface CredentialToolActorDeps {
|
|
329
|
+
readonly authorize: LegacyToolAuthorizeFn;
|
|
330
|
+
readonly workspaceId: string;
|
|
331
|
+
loadAuthSchemes(required: {
|
|
332
|
+
workspaceId: string;
|
|
333
|
+
}, optional?: Record<string, never>): Promise<readonly CredentialAuthSchemeRule[]>;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Required consumer contract for the complete credential-tool seam.
|
|
337
|
+
*/
|
|
338
|
+
/** @agent-note operations.ids must agree with catalog, metadata, derived risk and answer routing over the SAME host stores and adapters. */
|
|
339
|
+
export interface CredentialToolOperations {
|
|
340
|
+
readonly sets: CredentialToolSetsPort;
|
|
341
|
+
readonly approval: CredentialApprovalPort;
|
|
342
|
+
readonly pluginCards: CredentialPluginCardsPort;
|
|
343
|
+
readonly credentialCardForms: CredentialCardFormsPort;
|
|
344
|
+
readonly recovery: CredentialRecoveryPort;
|
|
345
|
+
readonly publish: CredentialPublishPort;
|
|
346
|
+
readonly locale: CredentialLocalePort;
|
|
347
|
+
readonly policy: CredentialToolPolicy;
|
|
348
|
+
readonly messages: CredentialToolMessages;
|
|
349
|
+
readonly diagnostics: CredentialToolDiagnostics;
|
|
350
|
+
readonly ids: {
|
|
351
|
+
readonly list: string;
|
|
352
|
+
readonly verify: string;
|
|
353
|
+
readonly setUsername: string;
|
|
354
|
+
readonly makeRequest: string;
|
|
355
|
+
readonly writeFiles: string;
|
|
356
|
+
readonly save: string;
|
|
357
|
+
};
|
|
358
|
+
readonly derivedRisk: DerivedRiskByToolId;
|
|
359
|
+
/** @agent-note DELETE preflight validation uses CredentialedRequestValidationError exported by this package's credentialed-http entry, so include that class to surface its refusal. */
|
|
360
|
+
readonly modelFacingErrors: readonly ModelFacingErrorRule[];
|
|
361
|
+
readonly formErrors: readonly CallerSafeErrorRule[];
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Only the shared exchange store is consumed by these handlers.
|
|
365
|
+
*/
|
|
366
|
+
/** @agent-note This must be the SAME exchange store instance used by the answer and callback routes. */
|
|
367
|
+
export interface CredentialToolSurfaces {
|
|
368
|
+
readonly surfaceExchanges: SurfaceExchangeStore;
|
|
369
|
+
}
|
|
370
|
+
//# sourceMappingURL=credential-tool-operations.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Credential tools over required host operations, vocabulary and card ports. */
|
|
2
|
+
export { createCredentialSaveHandlers, createCredentialToolRegistrations } from "./tool-registrations.js";
|
|
3
|
+
export { createCredentialCopyRegistrations } from "./credential-copy-tool.js";
|
|
4
|
+
export type { CredentialCopyRequired } from "./credential-copy-tool.js";
|
|
5
|
+
export type * from "./credential-tool-host.js";
|
|
6
|
+
export type * from "./credential-tool-operations.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Credential tools over required host operations, vocabulary and card ports. */
|
|
2
|
+
export { createCredentialSaveHandlers, createCredentialToolRegistrations } from "./tool-registrations.js";
|
|
3
|
+
export { createCredentialCopyRegistrations } from "./credential-copy-tool.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Credential tool orchestration with host-supplied policy, adapters and cards.
|
|
3
|
+
*
|
|
4
|
+
* Requests can mutate an external provider, so the host's write permission gates them; DELETE
|
|
5
|
+
* additionally holds one call for human approval rather than requiring a second model call.
|
|
6
|
+
* Target resolution checks labels and saved hosts before the dialog without decrypting, and
|
|
7
|
+
* an approved DELETE decrypts and sends only after its human answer.
|
|
8
|
+
*
|
|
9
|
+
* Username updates accept only label and username, so an unconfirmed edit cannot carry a token;
|
|
10
|
+
* resolving the label to its row id never decrypts.
|
|
11
|
+
*
|
|
12
|
+
* Secret keystrokes travel browser -> answer route -> exchange -> parked handler -> sealed store,
|
|
13
|
+
* never through model input, results or audit values; absent surface delivery fails closed.
|
|
14
|
+
* The outcome replaces the same form URI after persistence, because delivery alone does not prove
|
|
15
|
+
* sealing succeeded.
|
|
16
|
+
*
|
|
17
|
+
* Rotation resolves its label before opening a card; creation has no existing row to resolve,
|
|
18
|
+
* so the store validates submitted fields and refuses duplicate labels rather than overwriting.
|
|
19
|
+
* File shape, path, size and provider target checks precede decryption; the same provider commits
|
|
20
|
+
* the exact read-only plan it prepared, with abort checked before the commit.
|
|
21
|
+
*/
|
|
22
|
+
import type { CredentialToolOperations, CredentialToolActorDeps, CredentialToolSurfaces } from "./credential-tool-operations.js";
|
|
23
|
+
import type { CustomCredentialToolHost, CustomCredentialSecretCards, CustomCredentialToolPorts } from "./credential-tool-host.js";
|
|
24
|
+
import type { ToolHandler, ToolRegistration } from "@jini-ai/core";
|
|
25
|
+
/**
|
|
26
|
+
* API-key cards with every consumed operation supplied by the composing host.
|
|
27
|
+
*
|
|
28
|
+
* @complexity O(1) wiring; each adapter performs the bounded operations documented on its ports.
|
|
29
|
+
*/
|
|
30
|
+
/** @agent-note create accepts optional label/baseUrl/category/worksFor, rotate requires label and pluginProvider requires provider, while secrets arrive only from human card values. */
|
|
31
|
+
export declare function createCredentialSaveHandlers({ routeDeps, surfaces, host, ports, cards, operations }: {
|
|
32
|
+
routeDeps: CredentialToolActorDeps;
|
|
33
|
+
surfaces: CredentialToolSurfaces;
|
|
34
|
+
host: CustomCredentialToolHost;
|
|
35
|
+
ports: Pick<CustomCredentialToolPorts, 'credentialedRequest'>;
|
|
36
|
+
cards: CustomCredentialSecretCards;
|
|
37
|
+
operations: CredentialToolOperations;
|
|
38
|
+
}, _optional?: {}): {
|
|
39
|
+
create: ToolHandler;
|
|
40
|
+
rotate: ToolHandler;
|
|
41
|
+
pluginProvider: ToolHandler;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Credential tool handlers over required host operations and core-only consumer contracts.
|
|
45
|
+
*
|
|
46
|
+
* @complexity O(t) wiring, plus the bounded costs of each named host operation.
|
|
47
|
+
*/
|
|
48
|
+
/** @agent-note operations.ids must exactly match catalog, metadata and risk names and the host answer routing. */
|
|
49
|
+
export declare function createCredentialToolRegistrations({ routeDeps, host, ports, operations }: {
|
|
50
|
+
routeDeps: CredentialToolActorDeps;
|
|
51
|
+
host: CustomCredentialToolHost;
|
|
52
|
+
ports: CustomCredentialToolPorts;
|
|
53
|
+
operations: CredentialToolOperations;
|
|
54
|
+
}, _optional?: {}): ToolRegistration[];
|
|
55
|
+
//# sourceMappingURL=tool-registrations.d.ts.map
|