@nuanu-ai/agentbrowse 0.2.46 → 0.2.48
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/README.md +69 -10
- package/dist/agentpay-gateway.d.ts +9 -0
- package/dist/agentpay-gateway.d.ts.map +1 -1
- package/dist/agentpay-gateway.js +30 -0
- package/dist/agentpay-stagehand-llm.d.ts.map +1 -1
- package/dist/agentpay-stagehand-llm.js +9 -1
- package/dist/command-api-tracing.d.ts +19 -0
- package/dist/command-api-tracing.d.ts.map +1 -0
- package/dist/command-api-tracing.js +137 -0
- package/dist/commands/act.d.ts.map +1 -1
- package/dist/commands/act.js +822 -670
- package/dist/commands/act.test-harness.d.ts +6 -0
- package/dist/commands/act.test-harness.d.ts.map +1 -1
- package/dist/commands/act.test-harness.js +44 -1
- package/dist/commands/action-acceptance.d.ts.map +1 -1
- package/dist/commands/action-acceptance.js +115 -0
- package/dist/commands/captcha-solve.d.ts.map +1 -1
- package/dist/commands/captcha-solve.js +83 -16
- package/dist/commands/click-action-executor.d.ts +0 -1
- package/dist/commands/click-action-executor.d.ts.map +1 -1
- package/dist/commands/click-action-executor.js +31 -77
- package/dist/commands/close.d.ts +3 -3
- package/dist/commands/close.d.ts.map +1 -1
- package/dist/commands/close.js +178 -0
- package/dist/commands/descriptor-validation.d.ts.map +1 -1
- package/dist/commands/descriptor-validation.js +75 -57
- package/dist/commands/end-session.d.ts +25 -0
- package/dist/commands/end-session.d.ts.map +1 -0
- package/dist/commands/end-session.js +161 -0
- package/dist/commands/extract-stagehand-executor.js +1 -1
- package/dist/commands/extract.d.ts.map +1 -1
- package/dist/commands/extract.js +339 -202
- package/dist/commands/fill-secret.d.ts +3 -3
- package/dist/commands/fill-secret.d.ts.map +1 -1
- package/dist/commands/fill-secret.js +419 -234
- package/dist/commands/get-secrets-catalog.d.ts.map +1 -1
- package/dist/commands/get-secrets-catalog.js +66 -5
- package/dist/commands/interaction-kernel.d.ts +46 -0
- package/dist/commands/interaction-kernel.d.ts.map +1 -0
- package/dist/commands/interaction-kernel.js +215 -0
- package/dist/commands/launch.d.ts +0 -2
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +109 -17
- package/dist/commands/navigate.d.ts.map +1 -1
- package/dist/commands/navigate.js +188 -45
- package/dist/commands/observe-accessibility.d.ts.map +1 -1
- package/dist/commands/observe-accessibility.js +50 -39
- package/dist/commands/observe-dom-label-contract.d.ts.map +1 -1
- package/dist/commands/observe-dom-label-contract.js +5 -0
- package/dist/commands/observe-inventory.d.ts +13 -0
- package/dist/commands/observe-inventory.d.ts.map +1 -1
- package/dist/commands/observe-inventory.js +320 -65
- package/dist/commands/observe-persistence.d.ts.map +1 -1
- package/dist/commands/observe-persistence.js +3 -0
- package/dist/commands/observe-projection.d.ts +1 -0
- package/dist/commands/observe-projection.d.ts.map +1 -1
- package/dist/commands/observe-projection.js +7 -2
- package/dist/commands/observe-protected.d.ts +1 -0
- package/dist/commands/observe-protected.d.ts.map +1 -1
- package/dist/commands/observe-protected.js +9 -4
- package/dist/commands/observe-semantics.d.ts.map +1 -1
- package/dist/commands/observe-semantics.js +5 -2
- package/dist/commands/observe-stagehand.d.ts +1 -0
- package/dist/commands/observe-stagehand.d.ts.map +1 -1
- package/dist/commands/observe-stagehand.js +2 -0
- package/dist/commands/observe.d.ts +2 -0
- package/dist/commands/observe.d.ts.map +1 -1
- package/dist/commands/observe.js +387 -203
- package/dist/commands/observe.test-harness.d.ts +8 -0
- package/dist/commands/observe.test-harness.d.ts.map +1 -1
- package/dist/commands/observe.test-harness.js +48 -1
- package/dist/commands/poll-secret.d.ts +6 -0
- package/dist/commands/poll-secret.d.ts.map +1 -0
- package/dist/commands/poll-secret.js +159 -0
- package/dist/commands/request-secret.d.ts +6 -0
- package/dist/commands/request-secret.d.ts.map +1 -0
- package/dist/commands/request-secret.js +284 -0
- package/dist/commands/screenshot.d.ts.map +1 -1
- package/dist/commands/screenshot.js +172 -7
- package/dist/commands/select-action-executor.d.ts.map +1 -1
- package/dist/commands/semantic-observe.d.ts +4 -0
- package/dist/commands/semantic-observe.d.ts.map +1 -1
- package/dist/commands/semantic-observe.js +388 -17
- package/dist/commands/start-session.d.ts +31 -0
- package/dist/commands/start-session.d.ts.map +1 -0
- package/dist/commands/start-session.js +347 -0
- package/dist/commands/status.d.ts +2 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +166 -144
- package/dist/control-semantics.d.ts +1 -0
- package/dist/control-semantics.d.ts.map +1 -1
- package/dist/control-semantics.js +51 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +144 -45
- package/dist/otel-exporter.d.ts +58 -0
- package/dist/otel-exporter.d.ts.map +1 -0
- package/dist/otel-exporter.js +263 -0
- package/dist/otel-projector.d.ts +75 -0
- package/dist/otel-projector.d.ts.map +1 -0
- package/dist/otel-projector.js +409 -0
- package/dist/owned-browser.d.ts +1 -1
- package/dist/owned-browser.d.ts.map +1 -1
- package/dist/owned-browser.js +13 -1
- package/dist/owned-process.d.ts +2 -0
- package/dist/owned-process.d.ts.map +1 -1
- package/dist/owned-process.js +7 -3
- package/dist/playwright-runtime.d.ts +1 -1
- package/dist/playwright-runtime.d.ts.map +1 -1
- package/dist/playwright-runtime.js +8 -8
- package/dist/run-observability.d.ts +25 -0
- package/dist/run-observability.d.ts.map +1 -0
- package/dist/run-observability.js +115 -0
- package/dist/run-store.d.ts +274 -0
- package/dist/run-store.d.ts.map +1 -0
- package/dist/run-store.js +631 -0
- package/dist/runtime-metrics.d.ts +27 -0
- package/dist/runtime-metrics.d.ts.map +1 -0
- package/dist/runtime-metrics.js +66 -0
- package/dist/runtime-page-state.d.ts +11 -0
- package/dist/runtime-page-state.d.ts.map +1 -0
- package/dist/runtime-page-state.js +62 -0
- package/dist/runtime-protected-state.d.ts +16 -0
- package/dist/runtime-protected-state.d.ts.map +1 -0
- package/dist/runtime-protected-state.js +157 -0
- package/dist/runtime-state.d.ts +10 -44
- package/dist/runtime-state.d.ts.map +1 -1
- package/dist/runtime-state.js +57 -222
- package/dist/secrets/backend.d.ts +65 -16
- package/dist/secrets/backend.d.ts.map +1 -1
- package/dist/secrets/backend.js +135 -95
- package/dist/secrets/catalog-sync.d.ts.map +1 -1
- package/dist/secrets/catalog-sync.js +4 -1
- package/dist/secrets/form-matcher.d.ts +5 -5
- package/dist/secrets/form-matcher.d.ts.map +1 -1
- package/dist/secrets/form-matcher.js +292 -164
- package/dist/secrets/intent-output.d.ts +6 -10
- package/dist/secrets/intent-output.d.ts.map +1 -1
- package/dist/secrets/intent-output.js +4 -58
- package/dist/secrets/mock-agentpay-cabinet.d.ts +38 -27
- package/dist/secrets/mock-agentpay-cabinet.d.ts.map +1 -1
- package/dist/secrets/mock-agentpay-cabinet.js +177 -111
- package/dist/secrets/protected-artifact-guard.d.ts +2 -2
- package/dist/secrets/protected-artifact-guard.d.ts.map +1 -1
- package/dist/secrets/protected-artifact-guard.js +2 -2
- package/dist/secrets/protected-bindings.d.ts +1 -1
- package/dist/secrets/protected-bindings.d.ts.map +1 -1
- package/dist/secrets/protected-bindings.js +6 -0
- package/dist/secrets/protected-field-semantics.d.ts +9 -0
- package/dist/secrets/protected-field-semantics.d.ts.map +1 -0
- package/dist/secrets/protected-field-semantics.js +154 -0
- package/dist/secrets/protected-field-values.d.ts.map +1 -1
- package/dist/secrets/protected-field-values.js +3 -3
- package/dist/secrets/protected-fill.d.ts +1 -1
- package/dist/secrets/protected-fill.d.ts.map +1 -1
- package/dist/secrets/protected-fill.js +45 -149
- package/dist/secrets/protected-value-adapters.d.ts +2 -1
- package/dist/secrets/protected-value-adapters.d.ts.map +1 -1
- package/dist/secrets/protected-value-adapters.js +80 -1
- package/dist/secrets/request-output.d.ts +11 -0
- package/dist/secrets/request-output.d.ts.map +1 -0
- package/dist/secrets/request-output.js +75 -0
- package/dist/secrets/types.d.ts +15 -9
- package/dist/secrets/types.d.ts.map +1 -1
- package/dist/secrets/types.js +3 -0
- package/dist/session-event-exporter.d.ts +36 -0
- package/dist/session-event-exporter.d.ts.map +1 -0
- package/dist/session-event-exporter.js +428 -0
- package/dist/session.d.ts +16 -7
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +150 -23
- package/dist/sessions-backend.d.ts +354 -0
- package/dist/sessions-backend.d.ts.map +1 -0
- package/dist/sessions-backend.js +126 -0
- package/dist/solver/browser-launcher.d.ts +1 -1
- package/dist/solver/browser-launcher.d.ts.map +1 -1
- package/dist/solver/browser-launcher.js +39 -13
- package/dist/solver/captcha-solver.d.ts.map +1 -1
- package/dist/solver/captcha-solver.js +8 -1
- package/dist/solver/types.d.ts +1 -0
- package/dist/solver/types.d.ts.map +1 -1
- package/dist/workflow-session-completion.d.ts +33 -0
- package/dist/workflow-session-completion.d.ts.map +1 -0
- package/dist/workflow-session-completion.js +156 -0
- package/package.json +9 -1
- package/dist/commands/create-intent.d.ts +0 -6
- package/dist/commands/create-intent.d.ts.map +0 -1
- package/dist/commands/create-intent.js +0 -75
- package/dist/commands/poll-intent.d.ts +0 -6
- package/dist/commands/poll-intent.d.ts.map +0 -1
- package/dist/commands/poll-intent.js +0 -57
|
@@ -1,64 +1,10 @@
|
|
|
1
|
+
import { describeSecretRequestStatus, serializeSecretRequest, serializeSecretRequestContext, } from './request-output.js';
|
|
1
2
|
export function serializeSecretIntent(snapshot) {
|
|
2
|
-
return
|
|
3
|
-
intentId: snapshot.intentId,
|
|
4
|
-
fillRef: snapshot.fillRef,
|
|
5
|
-
storedSecretRef: snapshot.storedSecretRef,
|
|
6
|
-
status: snapshot.status,
|
|
7
|
-
...(snapshot.approvalChannel ? { approvalChannel: snapshot.approvalChannel } : {}),
|
|
8
|
-
createdAt: snapshot.createdAt,
|
|
9
|
-
...(snapshot.expiresAt ? { expiresAt: snapshot.expiresAt } : {}),
|
|
10
|
-
...(snapshot.approvedAt ? { approvedAt: snapshot.approvedAt } : {}),
|
|
11
|
-
...(snapshot.completedAt ? { completedAt: snapshot.completedAt } : {}),
|
|
12
|
-
};
|
|
3
|
+
return serializeSecretRequest(snapshot);
|
|
13
4
|
}
|
|
14
5
|
export function serializeSecretIntentContext(snapshot) {
|
|
15
|
-
return
|
|
16
|
-
storedSecretRef: snapshot.storedSecretRef,
|
|
17
|
-
...(snapshot.approvalChannel ? { approvalChannel: snapshot.approvalChannel } : {}),
|
|
18
|
-
createdAt: snapshot.createdAt,
|
|
19
|
-
...(snapshot.expiresAt ? { expiresAt: snapshot.expiresAt } : {}),
|
|
20
|
-
...(snapshot.approvedAt ? { approvedAt: snapshot.approvedAt } : {}),
|
|
21
|
-
...(snapshot.completedAt ? { completedAt: snapshot.completedAt } : {}),
|
|
22
|
-
};
|
|
6
|
+
return serializeSecretRequestContext(snapshot);
|
|
23
7
|
}
|
|
24
8
|
export function describeSecretIntentStatus(status) {
|
|
25
|
-
|
|
26
|
-
case 'pending':
|
|
27
|
-
case 'checking':
|
|
28
|
-
case 'notify':
|
|
29
|
-
case 'confirmation':
|
|
30
|
-
return {
|
|
31
|
-
outcomeType: 'approval_pending',
|
|
32
|
-
message: 'Protected intent is waiting for user approval.',
|
|
33
|
-
reason: 'AgentPay Cabinet has not approved this intent yet.',
|
|
34
|
-
nextAction: 'wait-for-approval',
|
|
35
|
-
};
|
|
36
|
-
case 'approved':
|
|
37
|
-
return {
|
|
38
|
-
message: 'Protected intent is approved and waiting for one-time delivery polling.',
|
|
39
|
-
reason: 'AgentPay approved this protected request, but AgentBrowse must poll again to receive the one-time secret payload.',
|
|
40
|
-
nextAction: 'poll-intent',
|
|
41
|
-
};
|
|
42
|
-
case 'denied':
|
|
43
|
-
return {
|
|
44
|
-
outcomeType: 'approval_denied',
|
|
45
|
-
message: 'Protected intent was denied and cannot be used.',
|
|
46
|
-
reason: 'AgentPay Cabinet reports that the user denied this protected action.',
|
|
47
|
-
nextAction: 'ask-user',
|
|
48
|
-
};
|
|
49
|
-
case 'timed_out':
|
|
50
|
-
return {
|
|
51
|
-
outcomeType: 'intent_expired',
|
|
52
|
-
message: 'Protected intent is no longer usable.',
|
|
53
|
-
reason: 'AgentPay Cabinet reports that this intent timed out before it could be used.',
|
|
54
|
-
nextAction: 'ask-user',
|
|
55
|
-
};
|
|
56
|
-
case 'completed':
|
|
57
|
-
return {
|
|
58
|
-
outcomeType: 'intent_expired',
|
|
59
|
-
message: 'Protected intent is no longer reusable.',
|
|
60
|
-
reason: 'AgentPay reports that this intent already completed, so any further protected action requires a new intent.',
|
|
61
|
-
nextAction: 'ask-user',
|
|
62
|
-
};
|
|
63
|
-
}
|
|
9
|
+
return describeSecretRequestStatus(status, 'secret_read');
|
|
64
10
|
}
|
|
@@ -1,42 +1,53 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import type { SecretRequestSnapshot, StoredSecretKind } from './types.js';
|
|
2
|
+
import type { ClaimSecretRequestResult, CreateSecretRequestResult, SecretRequestHintField, SecretRequestPollResult } from './backend.js';
|
|
3
|
+
type MockClaimRecord = {
|
|
4
|
+
claimId: string;
|
|
5
|
+
issuedAt: string;
|
|
6
|
+
};
|
|
7
|
+
export interface MockSecretRequestRecord extends SecretRequestSnapshot {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
purpose: string;
|
|
10
|
+
fields: SecretRequestHintField[];
|
|
11
|
+
claims: MockClaimRecord[];
|
|
12
|
+
approvedAt?: string;
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
type MockSecretRequestStore = {
|
|
15
|
+
version: 2;
|
|
16
|
+
nextRequest: number;
|
|
17
|
+
requests: Record<string, MockSecretRequestRecord>;
|
|
18
|
+
};
|
|
19
|
+
type RequestLifecycleOptions = {
|
|
14
20
|
now?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface
|
|
21
|
+
};
|
|
22
|
+
export interface CreateMockSecretRequestInput extends RequestLifecycleOptions {
|
|
23
|
+
sessionId: string;
|
|
24
|
+
clientRequestId: string;
|
|
17
25
|
fillRef: string;
|
|
18
|
-
|
|
26
|
+
purpose: string;
|
|
27
|
+
merchantName?: string;
|
|
19
28
|
host: string;
|
|
20
29
|
pageRef: string;
|
|
21
30
|
scopeRef?: string;
|
|
31
|
+
storedSecretRef?: string;
|
|
32
|
+
kind?: StoredSecretKind;
|
|
33
|
+
fields: SecretRequestHintField[];
|
|
22
34
|
expiresAt?: string;
|
|
23
35
|
}
|
|
24
|
-
export interface
|
|
25
|
-
intent: MockSecretIntentRecord;
|
|
26
|
-
reused: boolean;
|
|
36
|
+
export interface CreateMockSecretRequestResult extends CreateSecretRequestResult {
|
|
27
37
|
}
|
|
28
|
-
declare function readMockStore():
|
|
38
|
+
declare function readMockStore(): MockSecretRequestStore;
|
|
29
39
|
declare function defaultExpiry(createdAt: string): string;
|
|
30
|
-
declare function
|
|
31
|
-
export declare function
|
|
32
|
-
export declare function
|
|
33
|
-
export declare function
|
|
34
|
-
export declare function
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
export declare function createOrReuseMockSecretRequest(input: CreateMockSecretRequestInput): CreateMockSecretRequestResult;
|
|
41
|
+
export declare function getMockSecretRequest(sessionId: string, requestId: string, options?: RequestLifecycleOptions): SecretRequestPollResult | null;
|
|
42
|
+
export declare function approveMockSecretRequest(requestId: string, options?: RequestLifecycleOptions): MockSecretRequestRecord;
|
|
43
|
+
export declare function denyMockSecretRequest(requestId: string, options?: RequestLifecycleOptions): MockSecretRequestRecord;
|
|
44
|
+
export declare function claimMockSecretRequest(sessionId: string, requestId: string, claimId: string, options: RequestLifecycleOptions & {
|
|
45
|
+
resolveValues: (storedSecretRef: string) => Record<string, string> | null;
|
|
46
|
+
}): ClaimSecretRequestResult;
|
|
47
|
+
export declare function resetMockSecretRequestStore(): void;
|
|
48
|
+
export declare function getMockSecretRequestRecord(requestId: string, options?: RequestLifecycleOptions): MockSecretRequestRecord | null;
|
|
37
49
|
export declare const __testMockCabinet: {
|
|
38
50
|
defaultExpiry: typeof defaultExpiry;
|
|
39
|
-
progressIntentStatus: typeof progressIntentStatus;
|
|
40
51
|
readMockStore: typeof readMockStore;
|
|
41
52
|
};
|
|
42
53
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-agentpay-cabinet.d.ts","sourceRoot":"","sources":["../../src/secrets/mock-agentpay-cabinet.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"mock-agentpay-cabinet.d.ts","sourceRoot":"","sources":["../../src/secrets/mock-agentpay-cabinet.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,qBAAqB,EAIrB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAEzB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,cAAc,CAAC;AAKtB,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,WAAW,uBAAwB,SAAQ,qBAAqB;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,CAAC,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;CACnD,CAAC;AAIF,KAAK,uBAAuB,GAAG;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,4BAA6B,SAAQ,uBAAuB;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,6BAA8B,SAAQ,yBAAyB;CAAG;AAQnF,iBAAS,aAAa,IAAI,sBAAsB,CAuB/C;AAWD,iBAAS,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEhD;AA+FD,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,4BAA4B,GAClC,6BAA6B,CA6C/B;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,uBAA4B,GACpC,uBAAuB,GAAG,IAAI,CAchC;AAqCD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,uBAA4B,GACpC,uBAAuB,CAEzB;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,uBAA4B,GACpC,uBAAuB,CAEzB;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,uBAAuB,GAAG;IACjC,aAAa,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC3E,GACA,wBAAwB,CAiD1B;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAIlD;AAED,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,uBAA4B,kCAWtC;AAED,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC"}
|
|
@@ -3,13 +3,6 @@ import { homedir } from 'node:os';
|
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
const MOCK_CABINET_DIR = join(homedir(), '.agentpay');
|
|
5
5
|
const MOCK_CABINET_PATH = join(MOCK_CABINET_DIR, 'mock-secret-intents.json');
|
|
6
|
-
const APPROVAL_CHANNEL = 'agentpay-cabinet';
|
|
7
|
-
const TERMINAL_INTENT_STATUSES = new Set([
|
|
8
|
-
'approved',
|
|
9
|
-
'denied',
|
|
10
|
-
'timed_out',
|
|
11
|
-
'completed',
|
|
12
|
-
]);
|
|
13
6
|
function ensureMockCabinetDir() {
|
|
14
7
|
if (!existsSync(MOCK_CABINET_DIR)) {
|
|
15
8
|
mkdirSync(MOCK_CABINET_DIR, { recursive: true });
|
|
@@ -18,24 +11,24 @@ function ensureMockCabinetDir() {
|
|
|
18
11
|
function readMockStore() {
|
|
19
12
|
if (!existsSync(MOCK_CABINET_PATH)) {
|
|
20
13
|
return {
|
|
21
|
-
version:
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
version: 2,
|
|
15
|
+
nextRequest: 1,
|
|
16
|
+
requests: {},
|
|
24
17
|
};
|
|
25
18
|
}
|
|
26
19
|
try {
|
|
27
20
|
const raw = JSON.parse(readFileSync(MOCK_CABINET_PATH, 'utf-8'));
|
|
28
21
|
return {
|
|
29
|
-
version:
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
version: 2,
|
|
23
|
+
nextRequest: Number.isFinite(raw.nextRequest) ? Number(raw.nextRequest) : 1,
|
|
24
|
+
requests: raw.requests ?? {},
|
|
32
25
|
};
|
|
33
26
|
}
|
|
34
27
|
catch {
|
|
35
28
|
return {
|
|
36
|
-
version:
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
version: 2,
|
|
30
|
+
nextRequest: 1,
|
|
31
|
+
requests: {},
|
|
39
32
|
};
|
|
40
33
|
}
|
|
41
34
|
}
|
|
@@ -50,151 +43,224 @@ function defaultExpiry(createdAt) {
|
|
|
50
43
|
return new Date(new Date(createdAt).getTime() + 15 * 60_000).toISOString();
|
|
51
44
|
}
|
|
52
45
|
function isExpired(record, now) {
|
|
53
|
-
if (!record.expiresAt ||
|
|
46
|
+
if (!record.expiresAt || record.status !== 'pending') {
|
|
54
47
|
return false;
|
|
55
48
|
}
|
|
56
49
|
return new Date(record.expiresAt).getTime() <= new Date(now).getTime();
|
|
57
50
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
function requestStatusForSession(status) {
|
|
52
|
+
return status === 'pending' ? 'waiting_for_user' : 'in_progress';
|
|
53
|
+
}
|
|
54
|
+
function toSessionState(record) {
|
|
55
|
+
return {
|
|
56
|
+
sessionId: record.sessionId,
|
|
57
|
+
status: requestStatusForSession(record.status),
|
|
58
|
+
currentRequestId: record.status === 'pending' ? record.requestId : null,
|
|
59
|
+
lastEventSeq: 0,
|
|
60
|
+
browserSessionId: null,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function buildRequestKey(input) {
|
|
64
|
+
return JSON.stringify({
|
|
65
|
+
sessionId: input.sessionId,
|
|
66
|
+
fillRef: input.fillRef,
|
|
67
|
+
storedSecretRef: input.storedSecretRef ?? null,
|
|
68
|
+
kind: input.kind ?? null,
|
|
69
|
+
host: input.host,
|
|
70
|
+
scopeRef: input.scopeRef ?? null,
|
|
71
|
+
fields: [...input.fields].map((field) => field.key).sort(),
|
|
72
|
+
purpose: input.purpose,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function requestMatchesKey(record, key) {
|
|
76
|
+
return (JSON.stringify({
|
|
77
|
+
sessionId: record.sessionId,
|
|
78
|
+
fillRef: record.fillRef,
|
|
79
|
+
storedSecretRef: record.storedSecretRef ?? null,
|
|
80
|
+
kind: record.kind ?? null,
|
|
81
|
+
host: record.host ?? null,
|
|
82
|
+
scopeRef: record.scopeRef ?? null,
|
|
83
|
+
fields: [...record.fields].map((field) => field.key).sort(),
|
|
84
|
+
purpose: record.purpose,
|
|
85
|
+
}) === key);
|
|
86
|
+
}
|
|
87
|
+
function nextRequestId(store) {
|
|
88
|
+
return `sr_mock_${store.nextRequest++}`;
|
|
89
|
+
}
|
|
90
|
+
function findReusableRequest(store, input) {
|
|
91
|
+
const requestKey = buildRequestKey(input);
|
|
92
|
+
const matching = Object.values(store.requests).filter((request) => request.sessionId === input.sessionId && requestMatchesKey(request, requestKey));
|
|
93
|
+
const reusableFulfilled = matching.find((request) => request.status === 'fulfilled' && request.claims.length === 0);
|
|
94
|
+
if (reusableFulfilled) {
|
|
95
|
+
return reusableFulfilled;
|
|
96
|
+
}
|
|
97
|
+
return matching.find((request) => request.status === 'pending') ?? null;
|
|
98
|
+
}
|
|
99
|
+
function normalizeRequest(record, now) {
|
|
100
|
+
if (!isExpired(record, now)) {
|
|
101
|
+
return record;
|
|
64
102
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
pollCount: record.pollCount + 1,
|
|
77
|
-
};
|
|
78
|
-
case 'notify':
|
|
79
|
-
return {
|
|
80
|
-
...record,
|
|
81
|
-
status: 'confirmation',
|
|
82
|
-
pollCount: record.pollCount + 1,
|
|
83
|
-
};
|
|
84
|
-
case 'confirmation':
|
|
85
|
-
return {
|
|
86
|
-
...record,
|
|
87
|
-
pollCount: record.pollCount + 1,
|
|
88
|
-
};
|
|
89
|
-
default:
|
|
90
|
-
return record;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function isActiveIntentStatus(status) {
|
|
94
|
-
return !TERMINAL_INTENT_STATUSES.has(status);
|
|
95
|
-
}
|
|
96
|
-
function nextIntentId(store) {
|
|
97
|
-
return `si_mock_${store.nextIntent++}`;
|
|
98
|
-
}
|
|
99
|
-
export function createOrReuseMockSecretIntent(input) {
|
|
103
|
+
return {
|
|
104
|
+
...record,
|
|
105
|
+
status: 'expired',
|
|
106
|
+
updatedAt: now,
|
|
107
|
+
resolvedAt: now,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function requestTypeForStoredSecret(storedSecretRef) {
|
|
111
|
+
return storedSecretRef ? 'secret_read' : 'secret_write';
|
|
112
|
+
}
|
|
113
|
+
export function createOrReuseMockSecretRequest(input) {
|
|
100
114
|
const store = readMockStore();
|
|
101
|
-
const
|
|
102
|
-
const existing =
|
|
103
|
-
intent.storedSecretRef === input.storedSecretRef &&
|
|
104
|
-
isActiveIntentStatus(intent.status));
|
|
115
|
+
const now = nowIso(input.now);
|
|
116
|
+
const existing = findReusableRequest(store, input);
|
|
105
117
|
if (existing) {
|
|
118
|
+
const normalized = normalizeRequest(existing, now);
|
|
119
|
+
store.requests[normalized.requestId] = normalized;
|
|
120
|
+
writeMockStore(store);
|
|
106
121
|
return {
|
|
107
|
-
|
|
122
|
+
snapshot: normalized,
|
|
108
123
|
reused: true,
|
|
124
|
+
duplicate: false,
|
|
125
|
+
session: toSessionState(normalized),
|
|
109
126
|
};
|
|
110
127
|
}
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
|
|
128
|
+
const requestId = nextRequestId(store);
|
|
129
|
+
const request = {
|
|
130
|
+
requestId,
|
|
131
|
+
sessionId: input.sessionId,
|
|
114
132
|
fillRef: input.fillRef,
|
|
115
|
-
|
|
133
|
+
requestType: requestTypeForStoredSecret(input.storedSecretRef),
|
|
116
134
|
status: 'pending',
|
|
117
|
-
|
|
135
|
+
...(input.storedSecretRef ? { storedSecretRef: input.storedSecretRef } : {}),
|
|
136
|
+
...(input.kind ? { kind: input.kind } : {}),
|
|
118
137
|
host: input.host,
|
|
119
138
|
pageRef: input.pageRef,
|
|
120
139
|
scopeRef: input.scopeRef,
|
|
121
|
-
createdAt,
|
|
122
|
-
|
|
123
|
-
|
|
140
|
+
createdAt: now,
|
|
141
|
+
updatedAt: now,
|
|
142
|
+
expiresAt: input.expiresAt ?? defaultExpiry(now),
|
|
143
|
+
purpose: input.purpose,
|
|
144
|
+
fields: input.fields.map((field) => ({ ...field })),
|
|
145
|
+
claims: [],
|
|
124
146
|
};
|
|
125
|
-
store.
|
|
147
|
+
store.requests[requestId] = request;
|
|
126
148
|
writeMockStore(store);
|
|
127
149
|
return {
|
|
128
|
-
|
|
150
|
+
snapshot: request,
|
|
129
151
|
reused: false,
|
|
152
|
+
duplicate: false,
|
|
153
|
+
session: toSessionState(request),
|
|
130
154
|
};
|
|
131
155
|
}
|
|
132
|
-
export function
|
|
156
|
+
export function getMockSecretRequest(sessionId, requestId, options = {}) {
|
|
133
157
|
const store = readMockStore();
|
|
134
|
-
const current = store.
|
|
135
|
-
if (!current) {
|
|
158
|
+
const current = store.requests[requestId];
|
|
159
|
+
if (!current || current.sessionId !== sessionId) {
|
|
136
160
|
return null;
|
|
137
161
|
}
|
|
138
|
-
const
|
|
139
|
-
store.
|
|
162
|
+
const normalized = normalizeRequest(current, nowIso(options.now));
|
|
163
|
+
store.requests[requestId] = normalized;
|
|
140
164
|
writeMockStore(store);
|
|
141
|
-
return
|
|
165
|
+
return {
|
|
166
|
+
snapshot: normalized,
|
|
167
|
+
session: toSessionState(normalized),
|
|
168
|
+
};
|
|
142
169
|
}
|
|
143
|
-
function
|
|
170
|
+
function transitionRequestDecision(requestId, status, options = {}) {
|
|
144
171
|
const store = readMockStore();
|
|
145
|
-
const current = store.
|
|
172
|
+
const current = store.requests[requestId];
|
|
146
173
|
if (!current) {
|
|
147
|
-
throw new Error('
|
|
174
|
+
throw new Error('secret_request_not_found');
|
|
148
175
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
};
|
|
154
|
-
store.intents[intentId] = timedOut;
|
|
176
|
+
const now = nowIso(options.now);
|
|
177
|
+
const normalized = normalizeRequest(current, now);
|
|
178
|
+
if (normalized.status === 'expired') {
|
|
179
|
+
store.requests[requestId] = normalized;
|
|
155
180
|
writeMockStore(store);
|
|
156
|
-
throw new Error('
|
|
181
|
+
throw new Error('secret_request_expired');
|
|
157
182
|
}
|
|
158
|
-
if (
|
|
159
|
-
throw new Error(`
|
|
183
|
+
if (normalized.status !== 'pending') {
|
|
184
|
+
throw new Error(`secret_request_not_pending:${normalized.status}`);
|
|
160
185
|
}
|
|
161
186
|
const decided = {
|
|
162
|
-
...
|
|
187
|
+
...normalized,
|
|
163
188
|
status,
|
|
164
|
-
|
|
189
|
+
updatedAt: now,
|
|
190
|
+
resolvedAt: now,
|
|
191
|
+
...(status === 'fulfilled' ? { approvedAt: now } : {}),
|
|
165
192
|
};
|
|
166
|
-
store.
|
|
193
|
+
store.requests[requestId] = decided;
|
|
167
194
|
writeMockStore(store);
|
|
168
195
|
return decided;
|
|
169
196
|
}
|
|
170
|
-
export function
|
|
171
|
-
return
|
|
197
|
+
export function approveMockSecretRequest(requestId, options = {}) {
|
|
198
|
+
return transitionRequestDecision(requestId, 'fulfilled', options);
|
|
172
199
|
}
|
|
173
|
-
export function
|
|
174
|
-
return
|
|
200
|
+
export function denyMockSecretRequest(requestId, options = {}) {
|
|
201
|
+
return transitionRequestDecision(requestId, 'denied', options);
|
|
175
202
|
}
|
|
176
|
-
export function
|
|
203
|
+
export function claimMockSecretRequest(sessionId, requestId, claimId, options) {
|
|
177
204
|
const store = readMockStore();
|
|
178
|
-
const current = store.
|
|
179
|
-
if (!current) {
|
|
180
|
-
throw new Error('
|
|
205
|
+
const current = store.requests[requestId];
|
|
206
|
+
if (!current || current.sessionId !== sessionId) {
|
|
207
|
+
throw new Error('secret_request_not_found');
|
|
208
|
+
}
|
|
209
|
+
const now = nowIso(options.now);
|
|
210
|
+
const normalized = normalizeRequest(current, now);
|
|
211
|
+
if (normalized.status !== 'fulfilled') {
|
|
212
|
+
throw new Error(`secret_request_not_fulfilled:${normalized.status}`);
|
|
181
213
|
}
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
214
|
+
const existingClaim = normalized.claims.find((claim) => claim.claimId === claimId);
|
|
215
|
+
if (!existingClaim && normalized.claims.length > 0) {
|
|
216
|
+
throw new Error('secret_request_already_claimed');
|
|
217
|
+
}
|
|
218
|
+
const storedSecretRef = normalized.storedSecretRef;
|
|
219
|
+
if (!storedSecretRef) {
|
|
220
|
+
throw new Error('mock_secret_values_missing');
|
|
221
|
+
}
|
|
222
|
+
const values = options.resolveValues(storedSecretRef);
|
|
223
|
+
if (!values) {
|
|
224
|
+
throw new Error('mock_secret_values_missing');
|
|
225
|
+
}
|
|
226
|
+
const issuedAt = existingClaim?.issuedAt ?? now;
|
|
227
|
+
if (!existingClaim) {
|
|
228
|
+
store.requests[requestId] = {
|
|
229
|
+
...normalized,
|
|
230
|
+
updatedAt: now,
|
|
231
|
+
claims: [...normalized.claims, { claimId, issuedAt }],
|
|
232
|
+
};
|
|
233
|
+
writeMockStore(store);
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
requestId,
|
|
237
|
+
issuedAt,
|
|
238
|
+
expiresAt: normalized.expiresAt,
|
|
239
|
+
secret: {
|
|
240
|
+
values: values,
|
|
241
|
+
source: 'saved_secret',
|
|
242
|
+
storedSecretRef,
|
|
243
|
+
...(normalized.kind ? { kind: normalized.kind } : {}),
|
|
244
|
+
},
|
|
186
245
|
};
|
|
187
|
-
store.intents[intentId] = completed;
|
|
188
|
-
writeMockStore(store);
|
|
189
|
-
return completed;
|
|
190
246
|
}
|
|
191
|
-
export function
|
|
247
|
+
export function resetMockSecretRequestStore() {
|
|
192
248
|
if (existsSync(MOCK_CABINET_PATH)) {
|
|
193
249
|
unlinkSync(MOCK_CABINET_PATH);
|
|
194
250
|
}
|
|
195
251
|
}
|
|
252
|
+
export function getMockSecretRequestRecord(requestId, options = {}) {
|
|
253
|
+
const store = readMockStore();
|
|
254
|
+
const current = store.requests[requestId];
|
|
255
|
+
if (!current) {
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
const normalized = normalizeRequest(current, nowIso(options.now));
|
|
259
|
+
store.requests[requestId] = normalized;
|
|
260
|
+
writeMockStore(store);
|
|
261
|
+
return normalized;
|
|
262
|
+
}
|
|
196
263
|
export const __testMockCabinet = {
|
|
197
264
|
defaultExpiry,
|
|
198
|
-
progressIntentStatus,
|
|
199
265
|
readMockStore,
|
|
200
266
|
};
|
|
@@ -5,7 +5,7 @@ export interface ProtectedArtifactsSuppressed {
|
|
|
5
5
|
reason: string;
|
|
6
6
|
pageRef: string;
|
|
7
7
|
fillRef: string;
|
|
8
|
-
|
|
8
|
+
requestId: string;
|
|
9
9
|
activatedAt: string;
|
|
10
10
|
exposureReason: ProtectedExposureState['reason'];
|
|
11
11
|
message: string;
|
|
@@ -17,7 +17,7 @@ export declare function buildProtectedScreenshotBlockedResult(exposure: Protecte
|
|
|
17
17
|
reason: string;
|
|
18
18
|
pageRef: string;
|
|
19
19
|
fillRef: string;
|
|
20
|
-
|
|
20
|
+
requestId: string;
|
|
21
21
|
activatedAt: string;
|
|
22
22
|
exposureReason: "protected_fill_success" | "protected_fill_binding_stale" | "protected_fill_validation_failed" | "protected_fill_unexpected_error";
|
|
23
23
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protected-artifact-guard.d.ts","sourceRoot":"","sources":["../../src/secrets/protected-artifact-guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,IAAI,CAAC;IACjB,WAAW,EAAE,2BAA2B,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"protected-artifact-guard.d.ts","sourceRoot":"","sources":["../../src/secrets/protected-artifact-guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,IAAI,CAAC;IACjB,WAAW,EAAE,2BAA2B,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACjD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,sBAAsB,GAC/B,4BAA4B,CAc9B;AAED,wBAAgB,qCAAqC,CAAC,QAAQ,EAAE,sBAAsB;;;;;;;;;;EAcrF"}
|
|
@@ -5,7 +5,7 @@ export function buildProtectedArtifactsSuppressed(exposure) {
|
|
|
5
5
|
reason: 'Failure artifacts were suppressed because protected values may still be visible on the page.',
|
|
6
6
|
pageRef: exposure.pageRef,
|
|
7
7
|
fillRef: exposure.fillRef,
|
|
8
|
-
|
|
8
|
+
requestId: exposure.requestId,
|
|
9
9
|
activatedAt: exposure.activatedAt,
|
|
10
10
|
exposureReason: exposure.reason,
|
|
11
11
|
message: 'Failure artifacts were suppressed because protected values may still be visible on the page.',
|
|
@@ -18,7 +18,7 @@ export function buildProtectedScreenshotBlockedResult(exposure) {
|
|
|
18
18
|
reason: 'Screenshot capture is currently restricted because protected values may still be visible on the page.',
|
|
19
19
|
pageRef: exposure.pageRef,
|
|
20
20
|
fillRef: exposure.fillRef,
|
|
21
|
-
|
|
21
|
+
requestId: exposure.requestId,
|
|
22
22
|
activatedAt: exposure.activatedAt,
|
|
23
23
|
exposureReason: exposure.reason,
|
|
24
24
|
message: 'Screenshot capture is blocked because protected values may still be visible on the page.',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type ProtectedBindingValueHint } from './types.js';
|
|
3
|
-
export declare const protectedBindingValueHintSchema: z.ZodEnum<["direct", "full_name.given", "full_name.family"]>;
|
|
3
|
+
export declare const protectedBindingValueHintSchema: z.ZodEnum<["direct", "full_name.given", "full_name.family", "date_of_birth.day", "date_of_birth.month", "date_of_birth.year"]>;
|
|
4
4
|
export declare function normalizeProtectedBindingValueHint(fieldKey: string, valueHint?: string | null): ProtectedBindingValueHint;
|
|
5
5
|
export declare function protectedBindingKey(binding: {
|
|
6
6
|
targetRef: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protected-bindings.d.ts","sourceRoot":"","sources":["../../src/secrets/protected-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAiC,KAAK,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE3F,eAAO,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"protected-bindings.d.ts","sourceRoot":"","sources":["../../src/secrets/protected-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAiC,KAAK,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE3F,eAAO,MAAM,+BAA+B,gIAAwC,CAAC;AAErF,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,yBAAyB,CAkB3B;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,GAAG,MAAM,CAMT;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,GAAG,MAAM,CAKT"}
|
|
@@ -6,6 +6,12 @@ export function normalizeProtectedBindingValueHint(fieldKey, valueHint) {
|
|
|
6
6
|
(valueHint === 'full_name.given' || valueHint === 'full_name.family')) {
|
|
7
7
|
return valueHint;
|
|
8
8
|
}
|
|
9
|
+
if (fieldKey === 'date_of_birth' &&
|
|
10
|
+
(valueHint === 'date_of_birth.day' ||
|
|
11
|
+
valueHint === 'date_of_birth.month' ||
|
|
12
|
+
valueHint === 'date_of_birth.year')) {
|
|
13
|
+
return valueHint;
|
|
14
|
+
}
|
|
9
15
|
return 'direct';
|
|
10
16
|
}
|
|
11
17
|
export function protectedBindingKey(binding) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TargetDescriptor } from '../runtime-state.js';
|
|
2
|
+
import type { ProtectedBindingValueHint, StoredSecretFieldKey, StoredSecretKind } from './types.js';
|
|
3
|
+
export interface ProtectedFieldMeaningHint {
|
|
4
|
+
kind: StoredSecretKind;
|
|
5
|
+
fieldKey: StoredSecretFieldKey;
|
|
6
|
+
valueHint: ProtectedBindingValueHint;
|
|
7
|
+
}
|
|
8
|
+
export declare function inferProtectedFieldMeaningFromTarget(target: TargetDescriptor): ProtectedFieldMeaningHint[];
|
|
9
|
+
//# sourceMappingURL=protected-field-semantics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protected-field-semantics.d.ts","sourceRoot":"","sources":["../../src/secrets/protected-field-semantics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEpG,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,SAAS,EAAE,yBAAyB,CAAC;CACtC;AAiED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,gBAAgB,GACvB,yBAAyB,EAAE,CAwJ7B"}
|