@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.
Files changed (190) hide show
  1. package/README.md +69 -10
  2. package/dist/agentpay-gateway.d.ts +9 -0
  3. package/dist/agentpay-gateway.d.ts.map +1 -1
  4. package/dist/agentpay-gateway.js +30 -0
  5. package/dist/agentpay-stagehand-llm.d.ts.map +1 -1
  6. package/dist/agentpay-stagehand-llm.js +9 -1
  7. package/dist/command-api-tracing.d.ts +19 -0
  8. package/dist/command-api-tracing.d.ts.map +1 -0
  9. package/dist/command-api-tracing.js +137 -0
  10. package/dist/commands/act.d.ts.map +1 -1
  11. package/dist/commands/act.js +822 -670
  12. package/dist/commands/act.test-harness.d.ts +6 -0
  13. package/dist/commands/act.test-harness.d.ts.map +1 -1
  14. package/dist/commands/act.test-harness.js +44 -1
  15. package/dist/commands/action-acceptance.d.ts.map +1 -1
  16. package/dist/commands/action-acceptance.js +115 -0
  17. package/dist/commands/captcha-solve.d.ts.map +1 -1
  18. package/dist/commands/captcha-solve.js +83 -16
  19. package/dist/commands/click-action-executor.d.ts +0 -1
  20. package/dist/commands/click-action-executor.d.ts.map +1 -1
  21. package/dist/commands/click-action-executor.js +31 -77
  22. package/dist/commands/close.d.ts +3 -3
  23. package/dist/commands/close.d.ts.map +1 -1
  24. package/dist/commands/close.js +178 -0
  25. package/dist/commands/descriptor-validation.d.ts.map +1 -1
  26. package/dist/commands/descriptor-validation.js +75 -57
  27. package/dist/commands/end-session.d.ts +25 -0
  28. package/dist/commands/end-session.d.ts.map +1 -0
  29. package/dist/commands/end-session.js +161 -0
  30. package/dist/commands/extract-stagehand-executor.js +1 -1
  31. package/dist/commands/extract.d.ts.map +1 -1
  32. package/dist/commands/extract.js +339 -202
  33. package/dist/commands/fill-secret.d.ts +3 -3
  34. package/dist/commands/fill-secret.d.ts.map +1 -1
  35. package/dist/commands/fill-secret.js +419 -234
  36. package/dist/commands/get-secrets-catalog.d.ts.map +1 -1
  37. package/dist/commands/get-secrets-catalog.js +66 -5
  38. package/dist/commands/interaction-kernel.d.ts +46 -0
  39. package/dist/commands/interaction-kernel.d.ts.map +1 -0
  40. package/dist/commands/interaction-kernel.js +215 -0
  41. package/dist/commands/launch.d.ts +0 -2
  42. package/dist/commands/launch.d.ts.map +1 -1
  43. package/dist/commands/launch.js +109 -17
  44. package/dist/commands/navigate.d.ts.map +1 -1
  45. package/dist/commands/navigate.js +188 -45
  46. package/dist/commands/observe-accessibility.d.ts.map +1 -1
  47. package/dist/commands/observe-accessibility.js +50 -39
  48. package/dist/commands/observe-dom-label-contract.d.ts.map +1 -1
  49. package/dist/commands/observe-dom-label-contract.js +5 -0
  50. package/dist/commands/observe-inventory.d.ts +13 -0
  51. package/dist/commands/observe-inventory.d.ts.map +1 -1
  52. package/dist/commands/observe-inventory.js +320 -65
  53. package/dist/commands/observe-persistence.d.ts.map +1 -1
  54. package/dist/commands/observe-persistence.js +3 -0
  55. package/dist/commands/observe-projection.d.ts +1 -0
  56. package/dist/commands/observe-projection.d.ts.map +1 -1
  57. package/dist/commands/observe-projection.js +7 -2
  58. package/dist/commands/observe-protected.d.ts +1 -0
  59. package/dist/commands/observe-protected.d.ts.map +1 -1
  60. package/dist/commands/observe-protected.js +9 -4
  61. package/dist/commands/observe-semantics.d.ts.map +1 -1
  62. package/dist/commands/observe-semantics.js +5 -2
  63. package/dist/commands/observe-stagehand.d.ts +1 -0
  64. package/dist/commands/observe-stagehand.d.ts.map +1 -1
  65. package/dist/commands/observe-stagehand.js +2 -0
  66. package/dist/commands/observe.d.ts +2 -0
  67. package/dist/commands/observe.d.ts.map +1 -1
  68. package/dist/commands/observe.js +387 -203
  69. package/dist/commands/observe.test-harness.d.ts +8 -0
  70. package/dist/commands/observe.test-harness.d.ts.map +1 -1
  71. package/dist/commands/observe.test-harness.js +48 -1
  72. package/dist/commands/poll-secret.d.ts +6 -0
  73. package/dist/commands/poll-secret.d.ts.map +1 -0
  74. package/dist/commands/poll-secret.js +159 -0
  75. package/dist/commands/request-secret.d.ts +6 -0
  76. package/dist/commands/request-secret.d.ts.map +1 -0
  77. package/dist/commands/request-secret.js +284 -0
  78. package/dist/commands/screenshot.d.ts.map +1 -1
  79. package/dist/commands/screenshot.js +172 -7
  80. package/dist/commands/select-action-executor.d.ts.map +1 -1
  81. package/dist/commands/semantic-observe.d.ts +4 -0
  82. package/dist/commands/semantic-observe.d.ts.map +1 -1
  83. package/dist/commands/semantic-observe.js +388 -17
  84. package/dist/commands/start-session.d.ts +31 -0
  85. package/dist/commands/start-session.d.ts.map +1 -0
  86. package/dist/commands/start-session.js +347 -0
  87. package/dist/commands/status.d.ts +2 -1
  88. package/dist/commands/status.d.ts.map +1 -1
  89. package/dist/commands/status.js +166 -144
  90. package/dist/control-semantics.d.ts +1 -0
  91. package/dist/control-semantics.d.ts.map +1 -1
  92. package/dist/control-semantics.js +51 -9
  93. package/dist/index.d.ts.map +1 -1
  94. package/dist/index.js +144 -45
  95. package/dist/otel-exporter.d.ts +58 -0
  96. package/dist/otel-exporter.d.ts.map +1 -0
  97. package/dist/otel-exporter.js +263 -0
  98. package/dist/otel-projector.d.ts +75 -0
  99. package/dist/otel-projector.d.ts.map +1 -0
  100. package/dist/otel-projector.js +409 -0
  101. package/dist/owned-browser.d.ts +1 -1
  102. package/dist/owned-browser.d.ts.map +1 -1
  103. package/dist/owned-browser.js +13 -1
  104. package/dist/owned-process.d.ts +2 -0
  105. package/dist/owned-process.d.ts.map +1 -1
  106. package/dist/owned-process.js +7 -3
  107. package/dist/playwright-runtime.d.ts +1 -1
  108. package/dist/playwright-runtime.d.ts.map +1 -1
  109. package/dist/playwright-runtime.js +8 -8
  110. package/dist/run-observability.d.ts +25 -0
  111. package/dist/run-observability.d.ts.map +1 -0
  112. package/dist/run-observability.js +115 -0
  113. package/dist/run-store.d.ts +274 -0
  114. package/dist/run-store.d.ts.map +1 -0
  115. package/dist/run-store.js +631 -0
  116. package/dist/runtime-metrics.d.ts +27 -0
  117. package/dist/runtime-metrics.d.ts.map +1 -0
  118. package/dist/runtime-metrics.js +66 -0
  119. package/dist/runtime-page-state.d.ts +11 -0
  120. package/dist/runtime-page-state.d.ts.map +1 -0
  121. package/dist/runtime-page-state.js +62 -0
  122. package/dist/runtime-protected-state.d.ts +16 -0
  123. package/dist/runtime-protected-state.d.ts.map +1 -0
  124. package/dist/runtime-protected-state.js +157 -0
  125. package/dist/runtime-state.d.ts +10 -44
  126. package/dist/runtime-state.d.ts.map +1 -1
  127. package/dist/runtime-state.js +57 -222
  128. package/dist/secrets/backend.d.ts +65 -16
  129. package/dist/secrets/backend.d.ts.map +1 -1
  130. package/dist/secrets/backend.js +135 -95
  131. package/dist/secrets/catalog-sync.d.ts.map +1 -1
  132. package/dist/secrets/catalog-sync.js +4 -1
  133. package/dist/secrets/form-matcher.d.ts +5 -5
  134. package/dist/secrets/form-matcher.d.ts.map +1 -1
  135. package/dist/secrets/form-matcher.js +292 -164
  136. package/dist/secrets/intent-output.d.ts +6 -10
  137. package/dist/secrets/intent-output.d.ts.map +1 -1
  138. package/dist/secrets/intent-output.js +4 -58
  139. package/dist/secrets/mock-agentpay-cabinet.d.ts +38 -27
  140. package/dist/secrets/mock-agentpay-cabinet.d.ts.map +1 -1
  141. package/dist/secrets/mock-agentpay-cabinet.js +177 -111
  142. package/dist/secrets/protected-artifact-guard.d.ts +2 -2
  143. package/dist/secrets/protected-artifact-guard.d.ts.map +1 -1
  144. package/dist/secrets/protected-artifact-guard.js +2 -2
  145. package/dist/secrets/protected-bindings.d.ts +1 -1
  146. package/dist/secrets/protected-bindings.d.ts.map +1 -1
  147. package/dist/secrets/protected-bindings.js +6 -0
  148. package/dist/secrets/protected-field-semantics.d.ts +9 -0
  149. package/dist/secrets/protected-field-semantics.d.ts.map +1 -0
  150. package/dist/secrets/protected-field-semantics.js +154 -0
  151. package/dist/secrets/protected-field-values.d.ts.map +1 -1
  152. package/dist/secrets/protected-field-values.js +3 -3
  153. package/dist/secrets/protected-fill.d.ts +1 -1
  154. package/dist/secrets/protected-fill.d.ts.map +1 -1
  155. package/dist/secrets/protected-fill.js +45 -149
  156. package/dist/secrets/protected-value-adapters.d.ts +2 -1
  157. package/dist/secrets/protected-value-adapters.d.ts.map +1 -1
  158. package/dist/secrets/protected-value-adapters.js +80 -1
  159. package/dist/secrets/request-output.d.ts +11 -0
  160. package/dist/secrets/request-output.d.ts.map +1 -0
  161. package/dist/secrets/request-output.js +75 -0
  162. package/dist/secrets/types.d.ts +15 -9
  163. package/dist/secrets/types.d.ts.map +1 -1
  164. package/dist/secrets/types.js +3 -0
  165. package/dist/session-event-exporter.d.ts +36 -0
  166. package/dist/session-event-exporter.d.ts.map +1 -0
  167. package/dist/session-event-exporter.js +428 -0
  168. package/dist/session.d.ts +16 -7
  169. package/dist/session.d.ts.map +1 -1
  170. package/dist/session.js +150 -23
  171. package/dist/sessions-backend.d.ts +354 -0
  172. package/dist/sessions-backend.d.ts.map +1 -0
  173. package/dist/sessions-backend.js +126 -0
  174. package/dist/solver/browser-launcher.d.ts +1 -1
  175. package/dist/solver/browser-launcher.d.ts.map +1 -1
  176. package/dist/solver/browser-launcher.js +39 -13
  177. package/dist/solver/captcha-solver.d.ts.map +1 -1
  178. package/dist/solver/captcha-solver.js +8 -1
  179. package/dist/solver/types.d.ts +1 -0
  180. package/dist/solver/types.d.ts.map +1 -1
  181. package/dist/workflow-session-completion.d.ts +33 -0
  182. package/dist/workflow-session-completion.d.ts.map +1 -0
  183. package/dist/workflow-session-completion.js +156 -0
  184. package/package.json +9 -1
  185. package/dist/commands/create-intent.d.ts +0 -6
  186. package/dist/commands/create-intent.d.ts.map +0 -1
  187. package/dist/commands/create-intent.js +0 -75
  188. package/dist/commands/poll-intent.d.ts +0 -6
  189. package/dist/commands/poll-intent.d.ts.map +0 -1
  190. 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
- switch (status) {
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 { SecretIntentSnapshot } from './types.js';
2
- export interface MockSecretIntentRecord extends SecretIntentSnapshot {
3
- approvalChannel: 'agentpay-cabinet';
4
- host: string;
5
- pageRef: string;
6
- pollCount: number;
7
- }
8
- interface MockSecretIntentStore {
9
- version: 1;
10
- nextIntent: number;
11
- intents: Record<string, MockSecretIntentRecord>;
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
- interface IntentLifecycleOptions {
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 CreateMockSecretIntentInput extends IntentLifecycleOptions {
21
+ };
22
+ export interface CreateMockSecretRequestInput extends RequestLifecycleOptions {
23
+ sessionId: string;
24
+ clientRequestId: string;
17
25
  fillRef: string;
18
- storedSecretRef: string;
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 CreateMockSecretIntentResult {
25
- intent: MockSecretIntentRecord;
26
- reused: boolean;
36
+ export interface CreateMockSecretRequestResult extends CreateSecretRequestResult {
27
37
  }
28
- declare function readMockStore(): MockSecretIntentStore;
38
+ declare function readMockStore(): MockSecretRequestStore;
29
39
  declare function defaultExpiry(createdAt: string): string;
30
- declare function progressIntentStatus(record: MockSecretIntentRecord, now: string): MockSecretIntentRecord;
31
- export declare function createOrReuseMockSecretIntent(input: CreateMockSecretIntentInput): CreateMockSecretIntentResult;
32
- export declare function getMockSecretIntent(intentId: string, options?: IntentLifecycleOptions): MockSecretIntentRecord | null;
33
- export declare function approveMockSecretIntent(intentId: string, options?: IntentLifecycleOptions): MockSecretIntentRecord;
34
- export declare function denyMockSecretIntent(intentId: string, options?: IntentLifecycleOptions): MockSecretIntentRecord;
35
- export declare function markMockSecretIntentCompleted(intentId: string, options?: IntentLifecycleOptions): MockSecretIntentRecord;
36
- export declare function resetMockSecretIntentStore(): void;
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,EAAE,oBAAoB,EAAsB,MAAM,YAAY,CAAC;AAY3E,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAClE,eAAe,EAAE,kBAAkB,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,qBAAqB;IAC7B,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;CACjD;AAED,UAAU,sBAAsB;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,2BAA4B,SAAQ,sBAAsB;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC;CACjB;AAQD,iBAAS,aAAa,IAAI,qBAAqB,CAyB9C;AAWD,iBAAS,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEhD;AAaD,iBAAS,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,EAAE,GAAG,EAAE,MAAM,GAAG,sBAAsB,CAmCjG;AAUD,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,2BAA2B,GACjC,4BAA4B,CAuC9B;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,sBAA2B,GACnC,sBAAsB,GAAG,IAAI,CAW/B;AAqCD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,sBAA2B,GACnC,sBAAsB,CAExB;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,sBAA2B,GACnC,sBAAsB,CAExB;AAED,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,sBAA2B,GACnC,sBAAsB,CAexB;AAED,wBAAgB,0BAA0B,IAAI,IAAI,CAIjD;AAED,eAAO,MAAM,iBAAiB;;;;CAI7B,CAAC"}
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: 1,
22
- nextIntent: 1,
23
- intents: {},
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: 1,
30
- nextIntent: Number.isFinite(raw.nextIntent) ? Number(raw.nextIntent) : 1,
31
- intents: raw.intents ?? {},
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: 1,
37
- nextIntent: 1,
38
- intents: {},
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 || TERMINAL_INTENT_STATUSES.has(record.status)) {
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 progressIntentStatus(record, now) {
59
- if (isExpired(record, now)) {
60
- return {
61
- ...record,
62
- status: 'timed_out',
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
- switch (record.status) {
66
- case 'pending':
67
- return {
68
- ...record,
69
- status: 'checking',
70
- pollCount: record.pollCount + 1,
71
- };
72
- case 'checking':
73
- return {
74
- ...record,
75
- status: 'notify',
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 createdAt = nowIso(input.now);
102
- const existing = Object.values(store.intents).find((intent) => intent.fillRef === input.fillRef &&
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
- intent: existing,
122
+ snapshot: normalized,
108
123
  reused: true,
124
+ duplicate: false,
125
+ session: toSessionState(normalized),
109
126
  };
110
127
  }
111
- const intentId = nextIntentId(store);
112
- const intent = {
113
- intentId,
128
+ const requestId = nextRequestId(store);
129
+ const request = {
130
+ requestId,
131
+ sessionId: input.sessionId,
114
132
  fillRef: input.fillRef,
115
- storedSecretRef: input.storedSecretRef,
133
+ requestType: requestTypeForStoredSecret(input.storedSecretRef),
116
134
  status: 'pending',
117
- approvalChannel: APPROVAL_CHANNEL,
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
- expiresAt: input.expiresAt ?? defaultExpiry(createdAt),
123
- pollCount: 0,
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.intents[intentId] = intent;
147
+ store.requests[requestId] = request;
126
148
  writeMockStore(store);
127
149
  return {
128
- intent,
150
+ snapshot: request,
129
151
  reused: false,
152
+ duplicate: false,
153
+ session: toSessionState(request),
130
154
  };
131
155
  }
132
- export function getMockSecretIntent(intentId, options = {}) {
156
+ export function getMockSecretRequest(sessionId, requestId, options = {}) {
133
157
  const store = readMockStore();
134
- const current = store.intents[intentId];
135
- if (!current) {
158
+ const current = store.requests[requestId];
159
+ if (!current || current.sessionId !== sessionId) {
136
160
  return null;
137
161
  }
138
- const next = progressIntentStatus(current, nowIso(options.now));
139
- store.intents[intentId] = next;
162
+ const normalized = normalizeRequest(current, nowIso(options.now));
163
+ store.requests[requestId] = normalized;
140
164
  writeMockStore(store);
141
- return next;
165
+ return {
166
+ snapshot: normalized,
167
+ session: toSessionState(normalized),
168
+ };
142
169
  }
143
- function transitionIntentDecision(intentId, status, options = {}) {
170
+ function transitionRequestDecision(requestId, status, options = {}) {
144
171
  const store = readMockStore();
145
- const current = store.intents[intentId];
172
+ const current = store.requests[requestId];
146
173
  if (!current) {
147
- throw new Error('secret_intent_not_found');
174
+ throw new Error('secret_request_not_found');
148
175
  }
149
- if (isExpired(current, nowIso(options.now))) {
150
- const timedOut = {
151
- ...current,
152
- status: 'timed_out',
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('secret_intent_timed_out');
181
+ throw new Error('secret_request_expired');
157
182
  }
158
- if (!(current.status === 'notify' || current.status === 'confirmation')) {
159
- throw new Error(`secret_intent_not_awaiting_decision:${current.status}`);
183
+ if (normalized.status !== 'pending') {
184
+ throw new Error(`secret_request_not_pending:${normalized.status}`);
160
185
  }
161
186
  const decided = {
162
- ...current,
187
+ ...normalized,
163
188
  status,
164
- approvedAt: status === 'approved' ? nowIso(options.now) : current.approvedAt,
189
+ updatedAt: now,
190
+ resolvedAt: now,
191
+ ...(status === 'fulfilled' ? { approvedAt: now } : {}),
165
192
  };
166
- store.intents[intentId] = decided;
193
+ store.requests[requestId] = decided;
167
194
  writeMockStore(store);
168
195
  return decided;
169
196
  }
170
- export function approveMockSecretIntent(intentId, options = {}) {
171
- return transitionIntentDecision(intentId, 'approved', options);
197
+ export function approveMockSecretRequest(requestId, options = {}) {
198
+ return transitionRequestDecision(requestId, 'fulfilled', options);
172
199
  }
173
- export function denyMockSecretIntent(intentId, options = {}) {
174
- return transitionIntentDecision(intentId, 'denied', options);
200
+ export function denyMockSecretRequest(requestId, options = {}) {
201
+ return transitionRequestDecision(requestId, 'denied', options);
175
202
  }
176
- export function markMockSecretIntentCompleted(intentId, options = {}) {
203
+ export function claimMockSecretRequest(sessionId, requestId, claimId, options) {
177
204
  const store = readMockStore();
178
- const current = store.intents[intentId];
179
- if (!current) {
180
- throw new Error('secret_intent_not_found');
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 completed = {
183
- ...current,
184
- status: 'completed',
185
- completedAt: nowIso(options.now),
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 resetMockSecretIntentStore() {
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
- intentId: string;
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
- intentId: string;
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,QAAQ,EAAE,MAAM,CAAC;IACjB,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"}
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
- intentId: exposure.intentId,
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
- intentId: exposure.intentId,
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,8DAAwC,CAAC;AAErF,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,yBAAyB,CAS3B;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"}
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"}