@xenosystem/agent-interface-runtime 0.1.25 → 0.1.26

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 (60) hide show
  1. package/dist/accountWorkerConfiguration.d.ts +10 -0
  2. package/dist/accountWorkerConfiguration.d.ts.map +1 -0
  3. package/dist/accountWorkerConfiguration.js +19 -0
  4. package/dist/accountWorkerConfiguration.js.map +1 -0
  5. package/dist/browser/BrowserAuthorityResources.d.ts +33 -0
  6. package/dist/browser/BrowserAuthorityResources.d.ts.map +1 -0
  7. package/dist/browser/BrowserAuthorityResources.js +35 -0
  8. package/dist/browser/BrowserAuthorityResources.js.map +1 -0
  9. package/dist/browser/BrowserCommandPreparationStore.d.ts +46 -0
  10. package/dist/browser/BrowserCommandPreparationStore.d.ts.map +1 -0
  11. package/dist/browser/BrowserCommandPreparationStore.js +135 -0
  12. package/dist/browser/BrowserCommandPreparationStore.js.map +1 -0
  13. package/dist/browser/BrowserConsentController.d.ts +38 -0
  14. package/dist/browser/BrowserConsentController.d.ts.map +1 -0
  15. package/dist/browser/BrowserConsentController.js +46 -0
  16. package/dist/browser/BrowserConsentController.js.map +1 -0
  17. package/dist/browser/BrowserInteractiveConsent.d.ts +24 -0
  18. package/dist/browser/BrowserInteractiveConsent.d.ts.map +1 -0
  19. package/dist/browser/BrowserInteractiveConsent.js +45 -0
  20. package/dist/browser/BrowserInteractiveConsent.js.map +1 -0
  21. package/dist/browser/OwnedBrowserHostServices.d.ts +38 -0
  22. package/dist/browser/OwnedBrowserHostServices.d.ts.map +1 -0
  23. package/dist/browser/OwnedBrowserHostServices.js +31 -0
  24. package/dist/browser/OwnedBrowserHostServices.js.map +1 -0
  25. package/dist/browser/PersistedBrowserPolicyResolver.d.ts +22 -0
  26. package/dist/browser/PersistedBrowserPolicyResolver.d.ts.map +1 -0
  27. package/dist/browser/PersistedBrowserPolicyResolver.js +62 -0
  28. package/dist/browser/PersistedBrowserPolicyResolver.js.map +1 -0
  29. package/dist/browser/SdkBrowserCommandAuthority.d.ts +152 -0
  30. package/dist/browser/SdkBrowserCommandAuthority.d.ts.map +1 -0
  31. package/dist/browser/SdkBrowserCommandAuthority.js +181 -0
  32. package/dist/browser/SdkBrowserCommandAuthority.js.map +1 -0
  33. package/dist/browser/createSdkBrowserAuthority.d.ts +14 -0
  34. package/dist/browser/createSdkBrowserAuthority.d.ts.map +1 -0
  35. package/dist/browser/createSdkBrowserAuthority.js +43 -0
  36. package/dist/browser/createSdkBrowserAuthority.js.map +1 -0
  37. package/dist/browser/managedBrowserConfiguration.d.ts +22 -0
  38. package/dist/browser/managedBrowserConfiguration.d.ts.map +1 -0
  39. package/dist/browser/managedBrowserConfiguration.js +70 -0
  40. package/dist/browser/managedBrowserConfiguration.js.map +1 -0
  41. package/dist/composeHost.d.ts +18 -0
  42. package/dist/composeHost.d.ts.map +1 -1
  43. package/dist/composeHost.js +275 -67
  44. package/dist/composeHost.js.map +1 -1
  45. package/dist/detachedHostEntry.d.ts.map +1 -1
  46. package/dist/detachedHostEntry.js +5 -1
  47. package/dist/detachedHostEntry.js.map +1 -1
  48. package/dist/hostServices.d.ts +2 -1
  49. package/dist/hostServices.d.ts.map +1 -1
  50. package/dist/hostServices.js +5 -7
  51. package/dist/hostServices.js.map +1 -1
  52. package/dist/node.d.ts +6 -0
  53. package/dist/node.d.ts.map +1 -1
  54. package/dist/node.js +3 -0
  55. package/dist/node.js.map +1 -1
  56. package/dist/notificationSecretSurface.d.ts +12 -0
  57. package/dist/notificationSecretSurface.d.ts.map +1 -0
  58. package/dist/notificationSecretSurface.js +72 -0
  59. package/dist/notificationSecretSurface.js.map +1 -0
  60. package/package.json +9 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersistedBrowserPolicyResolver.d.ts","sourceRoot":"","sources":["../../src/browser/PersistedBrowserPolicyResolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAsF,KAAK,sBAAsB,EAAC,MAAM,uCAAuC,CAAA;AAC3L,OAAO,KAAK,EAAC,0BAA0B,EAAyB,MAAM,iCAAiC,CAAA;AAEvG,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB,EAAC,cAAc,uBAAuB,EAAE,mBAAmB,CAAA;IAC9E,0BAA0B,EAAC,cAAc,uBAAuB,EAAE,0BAA0B,CAAA;IAC5F,gCAAgC,EAAC,cAAc,uBAAuB,EAAE,gCAAgC,CAAA;CACzG;AACD,MAAM,WAAW,6BAA6B;IAC5C,GAAG,EAAC,gBAAgB,CAAA;IACpB,UAAU,EAAC,sBAAsB,CAAA;IACjC,MAAM,EAAC,oBAAoB,CAAA;IAC3B,iGAAiG;IACjG,SAAS,CAAC,gBAAgB,EAAC,MAAM,GAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IAClD,cAAc,CAAC,OAAO,EAAC,UAAU,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1F;wGACoG;IACpG,aAAa,CAAC,OAAO,EAAC,UAAU,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAAE,OAAO,CAAC,MAAM,GAAC,SAAS,CAAC,CAAA;CACtG;AACD;+FAC+F;AAC/F,wBAAgB,oCAAoC,CAAC,OAAO,EAAC,6BAA6B,GAAE,0BAA0B,CAAC,SAAS,CAAC,CAwChI"}
@@ -0,0 +1,62 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { BrowserScopeResolver, sameOwnedBrowserScope, resolvePersistedToolCapabilities, resolveAgentPermissionProfile } from '@xenosystem/agent-interface-host/node';
3
+ /** Current schema has tool/capability and permission-profile policy, not a browser-domain allowlist.
4
+ * Consent may narrow an enabled Browser to one origin; it never overrides persisted denies. */
5
+ export function createPersistedBrowserPolicyResolver(options) {
6
+ return async (command, identity) => {
7
+ command = structuredClone(command);
8
+ identity = { ...identity };
9
+ const scope = await options.scopes.resolve(command.request);
10
+ if (!sameOwnedBrowserScope(scope, command.scope))
11
+ throw Error('Browser policy owned scope changed');
12
+ await options.assertOwnedTab(command);
13
+ const state = await options.repository.loadWorkspaces(), conversation = await options.repository.loadConversationForHost(command.request.conversationId);
14
+ if (!conversation)
15
+ throw Error('Browser conversation disappeared');
16
+ const workspace = rows(state.workspaces).find(row => row.id === scope.workspaceId), team = rows(workspace?.teams).find(row => row.id === scope.teamId), agent = rows(team?.agents).find(row => row.id === scope.agentId);
17
+ if (!workspace || String(workspace.createdAt) !== scope.workspaceIncarnation || workspace.isArchived || team?.isArchived || agent?.isArchived || (scope.teamId && !team) || (scope.agentId && !agent))
18
+ throw Error('Browser persisted policy scope changed');
19
+ const capabilities = resolvePersistedToolCapabilities(state.workspaces, scope);
20
+ if (capabilities?.browser !== true)
21
+ throw Error('Persisted policies do not explicitly enable Browser');
22
+ for (const row of [workspace, team, agent, conversation]) {
23
+ const permission = resolveAgentPermissionProfile({ requestedProfile: row?.permissionProfile, capabilities, isProduction: true, allowDebugBypass: false });
24
+ if (permission.capabilities.browser !== true)
25
+ throw Error('Persisted permission profile refuses Browser');
26
+ }
27
+ const executionProfile = conversation.permissionProfile ?? agent?.permissionProfile ?? team?.permissionProfile ?? workspace.permissionProfile;
28
+ if (executionProfile !== 'trusted-workspace')
29
+ throw Error('Browser policy-only execution requires the persisted trusted-workspace permission profile; untrusted execution requires certified containment');
30
+ const requestedOrigin = command.request.action.kind === 'navigate' ? origin(command.request.action.url) : await options.currentOrigin(command);
31
+ if (!requestedOrigin)
32
+ throw Error('An acknowledged owned-tab origin is required before this Browser action');
33
+ const target = origin(requestedOrigin), url = new URL(target), port = Number(url.port || (url.protocol === 'https:' ? 443 : 80));
34
+ const base = options.sdk.resolveBuiltInAgentProfile('assistant');
35
+ if (!base)
36
+ throw Error('Canonical assistant capability profile is unavailable');
37
+ const profile = options.sdk.compileAgentProfile(base, { boundaries: [{ source: 'xeno-agent:persisted-owned-browser', tools: { mode: 'inherit', allow: ['Browser'] }, permissionProfile: 'default', externalActions: { default: 'deny' } }] });
38
+ const principalId = await options.principal(scope.clientInstanceId);
39
+ if (!principalId.trim())
40
+ throw Error('Native Browser principal is unavailable');
41
+ const contract = options.sdk.buildXenoSecureExecutionContract({
42
+ contractId: identity.contractId, identity: { runId: 'browser-' + hash(command.request.requestId), agentId: scope.agentId ?? 'browser-human-' + hash(principalId), workspaceId: scope.workspaceId, sessionId: command.request.sessionId }, profile,
43
+ now: () => identity.requestedAt, platform: process.platform, architecture: process.arch,
44
+ policy: { allowedDirectories: [], capabilities: { fileRead: false, fileWrite: false, terminal: false, appLaunch: false }, executionLevel: 'policy-only', trustMode: 'trusted-workspace', allowNetwork: false },
45
+ filesystem: { readRoots: [], writeRoots: [], executeRoots: [] },
46
+ network: { default: 'deny', allowDestinations: [{ scheme: url.protocol === 'https:' ? 'https' : 'http', host: url.hostname, port }], downloads: 'deny' },
47
+ browser: { mode: 'act', allowedDomains: [url.hostname], readAllowedDomains: [url.hostname], actAllowedDomains: [url.hostname], allowedSchemes: [url.protocol === 'https:' ? 'https' : 'http'], allowedPorts: [port], redirectPolicy: 'same-origin', downloads: 'deny', uploads: 'deny', recording: 'bounded' },
48
+ computer: { mode: 'none' }, capabilityLeaseIds: [identity.leaseId], secrets: [],
49
+ });
50
+ // Validate again after all asynchronous reads; authority also repeats this resolver before use.
51
+ const latest = await options.scopes.resolve(command.request);
52
+ if (!sameOwnedBrowserScope(latest, scope))
53
+ throw Error('Browser policy scope changed while resolving');
54
+ await options.assertOwnedTab(command);
55
+ return { principalId, profile, contract };
56
+ };
57
+ }
58
+ function rows(value) { return Array.isArray(value) ? value.filter((row) => !!row && typeof row === 'object' && !Array.isArray(row)) : []; }
59
+ function origin(value) { const url = new URL(value); if (!['https:', 'http:'].includes(url.protocol) || url.username || url.password)
60
+ throw Error('Browser requires an HTTP(S) origin without URL credentials'); return url.origin; }
61
+ function hash(value) { return createHash('sha256').update(value).digest('hex'); }
62
+ //# sourceMappingURL=PersistedBrowser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AAC,QAAQ,EAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAE,GAAG,CAAC,QAAQ,IAAE,GAAG,CAAC,QAAQ;IAAC,MAAM,KAAK,CAAC,4DAA4D,CAAC,CAAC,CAAA,OAAO,GAAG,CAAC,MAAM,CAAA,CAAA,CAAC;AAC7N,SAAS,IAAI,CAAC,KAAY,IAAE,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA,CAAA,CAAC"}
@@ -0,0 +1,152 @@
1
+ import type { CompiledAgentProfile, XenoSecureExecutionContract, XenoAutomationRequest, XenoAutomationAdapter, XenoAutomationExecutionResult, XenoCapabilityLease, XenoCapabilityUse, XenoCapabilityLeaseRequest, XenoCapabilityLeaseApprovalRequest, XenoCapabilityLeaseDenialRequest, XenoArtifactRepository } from '@xenosystem/agent-sdk';
2
+ import type { BrowserCommandAuthority, BrowserConsumptionPermit, BrowserWireRequest } from '@xenosystem/agent-interface-host/node';
3
+ import type { BrowserPreparationStore } from './BrowserCommandPreparationStore.js';
4
+ import { type BrowserPrincipalConsentPort } from './BrowserConsentController.js';
5
+ type Command = Parameters<BrowserCommandAuthority['execute']>[0];
6
+ type Transport = Parameters<BrowserCommandAuthority['execute']>[1];
7
+ interface MutationAck {
8
+ lease: XenoCapabilityLease;
9
+ replayed: boolean;
10
+ executionDisposition: 'dispatch-once' | 'receipt-only';
11
+ }
12
+ interface Registry {
13
+ request(id: string, request: XenoCapabilityLeaseRequest & {
14
+ leaseId: string;
15
+ }, profile: CompiledAgentProfile): Promise<MutationAck>;
16
+ approve(id: string, request: XenoCapabilityLeaseApprovalRequest): Promise<MutationAck>;
17
+ deny(id: string, request: XenoCapabilityLeaseDenialRequest): Promise<MutationAck>;
18
+ consume(id: string, leaseId: string, version: number, use: XenoCapabilityUse): Promise<MutationAck>;
19
+ get(id: string): Promise<XenoCapabilityLease | undefined>;
20
+ inspect?(id: string): Promise<XenoCapabilityLease | undefined>;
21
+ }
22
+ /** Additive R5 contract. Checked against the actual packed SDK in the candidate integration test. */
23
+ export interface BrowserCapabilityPersistence {
24
+ transaction<T>(callback: (transaction: {
25
+ lease(id: string): unknown;
26
+ receipt(id: string): unknown;
27
+ writeLease(lease: XenoCapabilityLease, expectedVersion: number | null): void;
28
+ writeReceipt(receipt: {
29
+ schemaVersion: 1;
30
+ commandId: string;
31
+ fingerprint: string;
32
+ lease: XenoCapabilityLease;
33
+ }): void;
34
+ }) => T): Promise<T>;
35
+ }
36
+ interface BrowserJournalRecord {
37
+ schemaVersion: 1;
38
+ operationId: string;
39
+ fingerprint: string;
40
+ ownerToken: string;
41
+ outcome: {
42
+ kind: 'pending';
43
+ } | {
44
+ kind: 'result';
45
+ artifactId: string;
46
+ sha256: string;
47
+ } | {
48
+ kind: 'failed';
49
+ code: string;
50
+ };
51
+ }
52
+ export interface BrowserExecutionJournal {
53
+ get(id: string): Promise<BrowserJournalRecord | undefined>;
54
+ begin(identity: {
55
+ operationId: string;
56
+ fingerprint: string;
57
+ ownerToken: string;
58
+ }): Promise<{
59
+ claimed: boolean;
60
+ record: BrowserJournalRecord;
61
+ }>;
62
+ finish(identity: {
63
+ operationId: string;
64
+ fingerprint: string;
65
+ ownerToken: string;
66
+ }, outcome: {
67
+ kind: 'result';
68
+ artifactId: string;
69
+ sha256: string;
70
+ } | {
71
+ kind: 'failed';
72
+ code: string;
73
+ }): Promise<void>;
74
+ }
75
+ export interface BrowserAuthoritySdk {
76
+ DurableXenoCapabilityLeaseRegistry: new (options: {
77
+ persistence: BrowserCapabilityPersistence;
78
+ now: () => string;
79
+ authorizeMutation: (command: unknown) => boolean;
80
+ }) => Registry;
81
+ XenoGovernedAutomationExecutor: new (options: {
82
+ adapter: XenoAutomationAdapter;
83
+ now: () => string;
84
+ durable: {
85
+ journal: BrowserExecutionJournal;
86
+ artifactRepository: XenoArtifactRepository;
87
+ assertCurrent(request: Readonly<XenoAutomationRequest>): Promise<void>;
88
+ consume(id: string, leaseId: string, version: number, use: XenoCapabilityUse): Promise<MutationAck>;
89
+ };
90
+ }) => {
91
+ execute(request: XenoAutomationRequest): Promise<XenoAutomationExecutionResult & {
92
+ replayed?: boolean;
93
+ }>;
94
+ };
95
+ buildXenoAutomationCapabilityUse: typeof import('@xenosystem/agent-sdk').buildXenoAutomationCapabilityUse;
96
+ describeXenoAutomationOperation: typeof import('@xenosystem/agent-sdk').describeXenoAutomationOperation;
97
+ assertValidXenoAutomationRequest: typeof import('@xenosystem/agent-sdk').assertValidXenoAutomationRequest;
98
+ assertXenoAutomationAuthority: typeof import('@xenosystem/agent-sdk').assertXenoAutomationAuthority;
99
+ /** Feature-presence checks prevent the older, identically versioned installed SDK being used. */
100
+ runDurableAutomation: Function;
101
+ openSqliteAutomationExecutionJournal: Function;
102
+ }
103
+ export interface BrowserAuthorityContext {
104
+ principalId: string;
105
+ profile: CompiledAgentProfile;
106
+ contract: XenoSecureExecutionContract;
107
+ }
108
+ export interface SdkBrowserAuthorityOptions {
109
+ sdk: BrowserAuthoritySdk;
110
+ preparations: BrowserPreparationStore;
111
+ capabilities: BrowserCapabilityPersistence;
112
+ journal: BrowserExecutionJournal;
113
+ artifacts: XenoArtifactRepository;
114
+ consent: BrowserPrincipalConsentPort;
115
+ /** Must authenticate actual caller/session/tab custody and reload persisted policy/incarnation.
116
+ * Reconstruct the same canonical contract using the supplied stable IDs/time, not wall-clock now.
117
+ * Never accept a renderer-provided profile, principal, approval or contract. */
118
+ resolve(command: Readonly<Command>, identity: {
119
+ requestedAt: string;
120
+ leaseId: string;
121
+ contractId: string;
122
+ }): Promise<BrowserAuthorityContext>;
123
+ now?: () => string;
124
+ consentTimeoutMs?: number;
125
+ }
126
+ /** Host-private orchestration only; all capability eligibility/consume/result replay belongs to SDK R5. */
127
+ export declare class SdkBrowserCommandAuthority implements BrowserCommandAuthority {
128
+ private readonly options;
129
+ private readonly active;
130
+ private readonly claims;
131
+ private readonly consents;
132
+ private closing;
133
+ private readonly now;
134
+ constructor(options: SdkBrowserAuthorityOptions);
135
+ execute(command: Command, transport: Transport): Promise<{
136
+ publishFrame?: () => Promise<import("@xenosystem/agent-interface-host/node").AgentBrowserFrame>;
137
+ receipt: unknown;
138
+ replayed: boolean;
139
+ }>;
140
+ /** Stop admission/pending native prompts and wait actual operations. Close owned Browser registry
141
+ * before awaiting this when an operation is in the owning native process. Keep storage alive. */
142
+ close(): Promise<void>;
143
+ /** Wire the owned session registry's mandatory verifier here. Only a live original consume ACK
144
+ * may pass. Recovered receipts validate history but can never authorize a second dispatch. */
145
+ assertConsumption(permit: BrowserConsumptionPermit, request: BrowserWireRequest): Promise<void>;
146
+ private revalidate;
147
+ private context;
148
+ private executeFresh;
149
+ private request;
150
+ }
151
+ export {};
152
+ //# sourceMappingURL=SdkBrowserCommandAuthority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SdkBrowserCommandAuthority.d.ts","sourceRoot":"","sources":["../../src/browser/SdkBrowserCommandAuthority.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EAAC,2BAA2B,EAAC,qBAAqB,EAAC,qBAAqB,EAC5F,6BAA6B,EAA8B,mBAAmB,EAAC,iBAAiB,EAChG,0BAA0B,EAAC,kCAAkC,EAAC,gCAAgC,EAC9F,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAC,uBAAuB,EAAC,wBAAwB,EAAC,kBAAkB,EAAsB,MAAM,uCAAuC,CAAA;AACnJ,OAAO,KAAK,EAA2B,uBAAuB,EAAC,MAAM,qCAAqC,CAAA;AAC1G,OAAO,EAA0B,KAAK,2BAA2B,EAAC,MAAM,+BAA+B,CAAA;AAEvG,KAAK,OAAO,GAAC,UAAU,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC9D,KAAK,SAAS,GAAC,UAAU,CAAC,uBAAuB,CAAC,S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rowserConsentController } from './BrowserConsentController.js';
3
+ /** Host-private orchestration only; all capability eligibility/consume/result replay belongs to SDK R5. */
4
+ export class SdkBrowserCommandAuthority {
5
+ options;
6
+ active = new Map();
7
+ claims = new Map();
8
+ consents = new Set();
9
+ closing = false;
10
+ now;
11
+ constructor(options) {
12
+ this.options = options;
13
+ for (const key of ['DurableXenoCapabilityLeaseRegistry', 'XenoGovernedAutomationExecutor', 'runDurableAutomation', 'openSqliteAutomationExecutionJournal', 'buildXenoAutomationCapabilityUse', 'describeXenoAutomationOperation', 'assertValidXenoAutomationRequest', 'assertXenoAutomationAuthority'])
14
+ if (typeof options.sdk?.[key] !== 'function')
15
+ throw Error('Durable Browser authority requires the qualified SDK capability surface');
16
+ this.now = options.now ?? (() => new Date().toISOString());
17
+ }
18
+ async execute(command, transport) {
19
+ if (this.closing)
20
+ throw Error('Browser authority is closing');
21
+ command = structuredClone(command);
22
+ const fingerprint = digest(command), id = command.request.requestId;
23
+ const existing = this.active.get(id);
24
+ if (existing) {
25
+ if (existing.fingerprint !== fingerprint)
26
+ throw Error('Browser operation identity was reused');
27
+ await this.revalidate(command);
28
+ const result = await existing.promise;
29
+ await this.revalidate(command);
30
+ return { ...structuredClone({ receipt: result.receipt, replayed: result.replayed }), ...result.publishFrame ? { publishFrame: result.publishFrame } : {} };
31
+ }
32
+ if (this.active.size >= 128)
33
+ throw Error('Browser authority has too many active operations');
34
+ const promise = this.executeFresh(command, transport, fingerprint);
35
+ this.active.set(id, { fingerprint, promise });
36
+ try {
37
+ return await promise;
38
+ }
39
+ finally {
40
+ this.active.delete(id);
41
+ this.claims.delete(id);
42
+ }
43
+ }
44
+ /** Stop admission/pending native prompts and wait actual operations. Close owned Browser registry
45
+ * before awaiting this when an operation is in the owning native process. Keep storage alive. */
46
+ async close() { this.closing = true; for (const consent of this.consents)
47
+ consent.cancel(); await Promise.allSettled([...this.active.values()].map(entry => entry.promise)); }
48
+ /** Wire the owned session registry's mandatory verifier here. Only a live original consume ACK
49
+ * may pass. Recovered receipts validate history but can never authorize a second dispatch. */
50
+ async assertConsumption(permit, request) {
51
+ const claim = this.claims.get(request.operationId);
52
+ if (!claim || claim.checked || permit.executionDisposition !== 'dispatch-once' || permit.commandId !== claim.commandId || digest(request) !== claim.requestFingerprint || digest(permit.grant) !== digest(claim.grant))
53
+ throw Error('Browser dispatch has no original canonical consume authority');
54
+ claim.checked = true;
55
+ await claim.assertCurrent();
56
+ const lease = await claim.registry.get(claim.grant.lease.leaseId);
57
+ if (!lease || digest(lease) !== digest(claim.grant.lease) || !['active', 'exhausted'].includes(lease.state))
58
+ throw Error('Browser consumed authority changed before dispatch');
59
+ await claim.assertCurrent();
60
+ }
61
+ async revalidate(command) { const record = await this.options.preparations.get(command.request.requestId); if (!record)
62
+ throw Error('Browser preparation is not yet acknowledged'); await this.context(command, record); }
63
+ async context(command, record) {
64
+ const context = await this.options.resolve(structuredClone(command), { requestedAt: record.requestedAt, leaseId: record.leaseId, contractId: record.contractId });
65
+ if (record.inputFingerprint !== digest(command) || digest(record.scope) !== digest(command.scope) || record.sessionId !== command.request.sessionId || record.tabId !== command.request.tabId || context.principalId !== record.principalId || context.profile.fingerprint !== record.profileFingerprint || context.contract.fingerprint !== record.contractFingerprint || context.contract.contractId !== record.contractId)
66
+ throw Error('Browser preparation no longer matches authenticated ownership or policy');
67
+ return context;
68
+ }
69
+ async executeFresh(command, transport, inputFingerprint) {
70
+ const { sdk, preparations } = this.options, id = command.request.requestId;
71
+ let record = await preparations.get(id);
72
+ let consentPreflight;
73
+ let context;
74
+ if (!record) {
75
+ const identity = { requestedAt: this.now(), leaseId: 'browser-lease-' + digest(id), contractId: 'browser-contract-' + digest(id) };
76
+ context = await this.options.resolve(structuredClone(command), identity);
77
+ const request = this.request(command, context.contract, identity.requestedAt, identity.leaseId, 2);
78
+ sdk.assertValidXenoAutomationRequest(request);
79
+ const manifest = await transport.manifest(), preflight = await transport.preflight(wire(request));
80
+ sdk.assertXenoAutomationAuthority(request, manifest, preflight.observedTarget);
81
+ const target = targetIdentity(preflight, command.request.tabId);
82
+ consentPreflight = preflight;
83
+ record = await preparations.create({ schemaVersion: 1, version: 1, operationId: id, inputFingerprint, scope: command.scope, sessionId: command.request.sessionId, tabId: command.request.tabId, origin: target.origin, targetFingerprint: target.fingerprint, principalId: context.principalId, ...identity, profileFingerprint: context.profile.fingerprint, contractFingerprint: context.contract.fingerprint, phase: 'prepared' });
84
+ }
85
+ context = await this.context(command, record);
86
+ const current = async () => { if (this.closing)
87
+ throw Error('Browser authority is closing'); await this.context(command, record); };
88
+ // A registry instance authorizes only the exact mutation currently initiated by this host path.
89
+ // The actual principal approval is produced solely by the native controller below.
90
+ let allowedMutation;
91
+ const registry = new sdk.DurableXenoCapabilityLeaseRegistry({ persistence: this.options.capabilities, now: this.now, authorizeMutation: mutation => allowedMutation !== undefined && digest(mutation) === allowedMutation });
92
+ if (command.request.action.kind === 'frame' && typeof registry.inspect !== 'function')
93
+ throw Error('Browser frames require canonical read-only lease inspection');
94
+ const mutate = async (mutation, invoke) => { await current(); allowedMutation = digest(mutation); try {
95
+ return await invoke();
96
+ }
97
+ finally {
98
+ allowedMutation = undefined;
99
+ } };
100
+ const stableRequest = () => this.request(command, context.contract, record.requestedAt, record.leaseId, (record.leaseVersion ?? 1) + 1);
101
+ if (record.phase === 'prepared') {
102
+ if (!consentPreflight || targetIdentity(consentPreflight, record.tabId).fingerprint !== record.targetFingerprint)
103
+ throw Error('Original Browser preflight is unavailable; no action may be resumed from URL alone');
104
+ const use = sdk.buildXenoAutomationCapabilityUse(stableRequest(), { tabId: record.tabId, origin: record.origin });
105
+ const descriptor = sdk.describeXenoAutomationOperation(stableRequest().operation);
106
+ const request = { leaseId: record.leaseId, subject: use.subject, scope: { kind: use.kind, effect: descriptor.effect === 'act' ? 'external' : 'read', operations: [use.operation], resources: [record.tabId], destinations: [record.origin], governingToolName: 'Browser' }, reason: 'Principal consent for this exact owned Browser operation', requestedBy: { kind: 'user', id: record.principalId }, durationMs: 120000, requestTtlMs: 120000, maxUses: 1, childInheritance: 'none' };
107
+ const ack = await mutate({ kind: 'request', request, profile: context.profile }, () => registry.request('browser-request-' + digest(id), request, context.profile));
108
+ if (ack.lease.state !== 'requested')
109
+ throw Error('Browser approval state cannot be restarted');
110
+ const consent = new BrowserConsentController(preparations, this.options.consent, current, this.options.consentTimeoutMs);
111
+ this.consents.add(consent);
112
+ try {
113
+ record = await consent.obtain(record, ack.lease.version, command.operation);
114
+ }
115
+ finally {
116
+ this.consents.delete(consent);
117
+ }
118
+ }
119
+ if (record.phase === 'denied') {
120
+ const request = { leaseId: record.leaseId, expectedVersion: record.leaseVersion, deniedBy: { kind: 'user', id: record.principalId } };
121
+ await mutate({ kind: 'deny', request }, () => registry.deny('browser-deny-' + digest(id), request));
122
+ throw Error('Browser operation was declined');
123
+ }
124
+ if (record.phase === 'consent-pending')
125
+ throw Error('Browser consent outcome is pending; no action was dispatched');
126
+ if (record.phase === 'consent-accepted') {
127
+ const request = { leaseId: record.leaseId, expectedVersion: record.leaseVersion, approvedBy: { kind: 'user', id: record.principalId }, approvalContext: { surface: 'custom:xeno-agent-browser', promptHash: record.challengeHash, messageId: record.consentReceiptId } };
128
+ const ack = await mutate({ kind: 'approve', request }, () => registry.approve('browser-approve-' + digest(id), request));
129
+ if (ack.lease.version !== record.leaseVersion + 1 || ack.lease.approvalContext?.promptHash !== record.challengeHash)
130
+ throw Error('Canonical Browser approval acknowledgement differs');
131
+ record = await preparations.update({ ...record, version: record.version + 1, phase: 'approved' }, record.version);
132
+ }
133
+ if (record.phase !== 'approved')
134
+ throw Error('Browser operation has no approved preparation');
135
+ let consumption;
136
+ const adapter = {
137
+ manifest: async () => await transport.manifest(),
138
+ // Never refresh this token after approval: the owning Browser holds its captured
139
+ // WebContents/document epoch. Same-URL navigation cannot silently rebind consent.
140
+ preflight: async () => { await current(); if (!consentPreflight)
141
+ throw Error('Original Browser preflight is unavailable; recover the durable outcome only'); return consentPreflight; },
142
+ execute: async (request, preflight, grant, signal) => {
143
+ if (!consumption || consumption.ack.replayed || consumption.ack.executionDisposition !== 'dispatch-once' || digest(consumption.ack.lease) !== digest(grant.lease))
144
+ throw Error('Original Browser consumption acknowledgement is absent');
145
+ this.claims.set(id, { commandId: consumption.commandId, requestFingerprint: digest(wire(request)), grant: structuredClone(grant), checked: false, assertCurrent: current, registry });
146
+ return await transport.execute(wire(request), preflight, { commandId: consumption.commandId, executionDisposition: 'dispatch-once', grant }, signal);
147
+ }, stop: async (_id, reason) => transport.stop(reason),
148
+ };
149
+ const executor = new sdk.XenoGovernedAutomationExecutor({ adapter, now: this.now, durable: { journal: this.options.journal, artifactRepository: this.options.artifacts, assertCurrent: current, consume: async (commandId, leaseId, expectedVersion, use) => {
150
+ const request = { leaseId, expectedVersion, use }, ack = await mutate({ kind: 'consume', request }, () => registry.consume(commandId, leaseId, expectedVersion, use));
151
+ consumption = { commandId, ack };
152
+ return ack;
153
+ } } });
154
+ const result = await executor.execute(stableRequest());
155
+ await current();
156
+ const publishFrame = command.request.action.kind === 'frame' && result.replayed !== true && result.status === 'ok' ? async () => transport.publishFrame(async () => {
157
+ await current();
158
+ sdk.assertValidXenoAutomationRequest(stableRequest());
159
+ if (!consumption || typeof registry.inspect !== 'function')
160
+ throw Error('Original consumed Browser lease is unavailable');
161
+ const lease = await registry.inspect(consumption.ack.lease.leaseId);
162
+ const inspectedAt = Date.parse(this.now());
163
+ const expiresAt = typeof lease?.expiresAt === 'string' ? Date.parse(lease.expiresAt) : Number.NaN;
164
+ if (!lease || !['active', 'exhausted'].includes(lease.state) || !Number.isFinite(inspectedAt) || !Number.isFinite(expiresAt) || expiresAt <= inspectedAt || digest(lease) !== digest(consumption.ack.lease))
165
+ throw Error('Browser consumed lease changed after capture');
166
+ await current();
167
+ }) : undefined;
168
+ return { receipt: result, replayed: result.replayed === true, ...publishFrame ? { publishFrame } : {} };
169
+ }
170
+ request(command, contract, requestedAt, leaseId, version) {
171
+ if (contract.identity.workspaceId !== command.scope.workspaceId || contract.identity.sessionId !== command.request.sessionId)
172
+ throw Error('Browser contract is not bound to this workspace/session');
173
+ return { protocolVersion: 1, operationId: command.request.requestId, idempotencyKey: command.request.requestId, requestedAt, identity: contract.identity, governingToolName: 'Browser', operation: command.operation, parameters: structuredClone(command.parameters), declaredTarget: { tabId: command.request.tabId }, executionContract: contract, capabilityLeaseId: leaseId, expectedLeaseVersion: version };
174
+ }
175
+ }
176
+ function wire(request) { return request; }
177
+ function targetIdentity(preflight, tabId) { const value = preflight.observedTarget; if (value.tabId !== tabId || typeof value.url !== 'string')
178
+ throw Error('Owned Browser did not return its exact target URL'); const url = new URL(value.url); if (!['https:', 'http:'].includes(url.protocol) || url.username || url.password)
179
+ throw Error('Browser consent target is not a safe web origin'); return { origin: url.origin, fingerprint: digest({ tabId, url: url.href, token: preflight.token }) }; }
180
+ function digest(value) { const canonical = (v) => Array.isArray(v) ? v.map(canonical) : v && typeof v === 'object' ? Object.fromEntries(Object.entries(v).filter(([, item]) => item !== undefined && typeof item !== 'function').sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => [key, canonical(item)])) : v; return createHash('sha256').update(JSON.stringify(canonical(value))).digest('hex'); }
181
+ //# sourceMappingURL=SdkBrowserCommandAuthority.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SdkBrowserCommandAuthority.js","sourceRoot":"","sources":["../../src/browser/SdkBrowserCommandAuthority.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAA;AAStC,OAAO,EAAC,wBAAwB,EAAkC,MAAM,+BAA+B,CAAA;AAmDvG,2GAA2G;AAC3G,MAAM,OAAO,0BAA0B;IAMR;IALZ,MAAM,GAAC,IAAI,GAAG,EAAsF,CAAA;IACpG,MAAM,GAAC,IAAI,GAAG,EAAwB,CAAA;IACtC,QAAQ,GAAC,IAAI,GAAG,EAA4B,CAAA;IACrD,OAAO,GAAC,KAAK,CAAA;IACJ,GAAG,CAAW;IAC/B,YAA6B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AS,GAAC,CAAC,CAAS,EAAS,EAAE,CAAA,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA,CAAC,CAAA,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA,CAAC,CAAA,CAAC,IAAE,OAAO,CAAC,KAAG,QAAQ,CAAA,CAAC,CAAA,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC,IAAI,CAAC,EAAC,EAAE,CAAA,IAAI,KAAG,SAAS,IAAE,OAAO,IAAI,KAAG,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAC,IAAI,CAAC,EAAC,EAAE,CAAA,CAAC,GAAG,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,CAAA,CAAC,CAAC,CAAA,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA,CAAA,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type BrowserResourceSdk } from './BrowserAuthorityResources.js';
2
+ import { type BrowserPolicySdk } from './PersistedBrowserPolicyResolver.js';
3
+ import type { OwnedBrowserHostConfiguration } from './OwnedBrowserHostServices.js';
4
+ /** The managed Browser consumer is wired through the host-private qualified-artifact
5
+ * loader. Installed/public activation remains deliberately unavailable until those
6
+ * exact Browser and SDK artifacts are released under unique public versions. */
7
+ /** The production composition seam. Inject the actual qualified package module and native host
8
+ * capabilities; no renderer configuration, SDK source path, fixed principal or automatic approval. */
9
+ export declare function createSdkBrowserAuthorityFactory(options: {
10
+ sdk: BrowserResourceSdk & BrowserPolicySdk;
11
+ directory: string;
12
+ assertPrivateDirectory(path: string): Promise<void>;
13
+ }): OwnedBrowserHostConfiguration['createAuthority'];
14
+ //# sourceMappingURL=createSdkBrowserAuthority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSdkBrowserAuthority.d.ts","sourceRoot":"","sources":["../../src/browser/createSdkBrowserAuthority.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,kBAAkB,EAAC,MAAM,gCAAgC,CAAA;AACpG,OAAO,EAAsC,KAAK,gBAAgB,EAAC,MAAM,qCAAqC,CAAA;AAE9G,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,+BAA+B,CAAA;AAEhF;;gFAEgF;AAEhF;sGACsG;AACtG,wBAAgB,gCAAgC,CAAC,OAAO,EAAC;IACvD,GAAG,EAAC,kBAAkB,GAAC,gBAAgB,CAAA;IACvC,SAAS,EAAC,MAAM,CAAA;IAChB,sBAAsB,CAAC,IAAI,EAAC,MAAM,GAAE,OAAO,CAAC,IAAI,CAAC,CAAA;CAClD,GAAE,6BAA6B,CAAC,iBAAiB,CAAC,CAyBlD"}
@@ -0,0 +1,43 @@
1
+ import { BrowserAutomationHttpTransport, sameOwnedBrowserScope } from '@xenosystem/agent-interface-host/node';
2
+ import { openBrowserAuthorityResources } from './BrowserAuthorityResources.js';
3
+ import { createPersistedBrowserPolicyResolver } from './PersistedBrowserPolicyResolver.js';
4
+ import { SdkBrowserCommandAuthority } from './SdkBrowserCommandAuthority.js';
5
+ /** The managed Browser consumer is wired through the host-private qualified-artifact
6
+ * loader. Installed/public activation remains deliberately unavailable until those
7
+ * exact Browser and SDK artifacts are released under unique public versions. */
8
+ /** The production composition seam. Inject the actual qualified package module and native host
9
+ * capabilities; no renderer configuration, SDK source path, fixed principal or automatic approval. */
10
+ export function createSdkBrowserAuthorityFactory(options) {
11
+ return async ({ scopes, sessions, repository, principal, consent }) => {
12
+ const resources = await openBrowserAuthorityResources(options);
13
+ try {
14
+ const sessionFor = async (command) => {
15
+ const session = await sessions.resolveSession(command.request.sessionId);
16
+ if (!session || !session.ownsTab(command.request.tabId) || !sameOwnedBrowserScope(session.scope, command.scope))
17
+ throw Error('Browser policy has no exact owned session/tab');
18
+ await session.assertCurrent();
19
+ return session;
20
+ };
21
+ const resolve = createPersistedBrowserPolicyResolver({ sdk: options.sdk, repository, scopes, principal,
22
+ assertOwnedTab: async (command) => { await sessionFor(command); },
23
+ currentOrigin: async (command) => { const session = await sessionFor(command); return (await new BrowserAutomationHttpTransport(session, command.request.tabId, command.request.requestId, command.operation).target()).origin ?? undefined; },
24
+ });
25
+ const authority = new SdkBrowserCommandAuthority({ sdk: options.sdk, ...resources, consent, resolve });
26
+ return {
27
+ execute: authority.execute.bind(authority),
28
+ assertConsumption: async (scope, sessionId, permit, wire) => {
29
+ const record = await resources.preparations.get(wire.operationId);
30
+ if (!record || record.sessionId !== sessionId || !sameOwnedBrowserScope(record.scope, scope))
31
+ throw Error('Browser consume receipt belongs to another owned scope');
32
+ await authority.assertConsumption(permit, wire);
33
+ },
34
+ close: async () => { await authority.close(); resources.close(); },
35
+ };
36
+ }
37
+ catch (error) {
38
+ resources.close();
39
+ throw error;
40
+ }
41
+ };
42
+ }
43
+ //# sourceMappingURL=createSdkBrowserAuthority.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSdkBrowserAuthority.js","sourceRoot":"","sources":["../../src/browser/createSdkBrowserAuthority.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,8BAA8B,EAAC,qBAAqB,EAAC,MAAM,uCAAuC,CAAA;AAC1G,OAAO,EAAC,6BAA6B,EAAyB,MAAM,gCAAgC,CAAA;AACpG,OAAO,EAAC,oCAAoC,EAAuB,MAAM,qCAAqC,CAAA;AAC9G,OAAO,EAAC,0BAA0B,EAAC,MAAM,iCAAiC,CAAA;AAG1E;;gFAEgF;AAEhF;sGACsG;AACtG,MAAM,UAAU,gCAAgC,CAAC,OAIhD;IACC,OAAO,K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AAC,EAAC,GAAG,EAAC,OAAO,CAAC,GAAG,EAAC,GAAG,SAAS,EAAC,OAAO,EAAC,OAAO,EAAC,CAAC,CAAA;YAC9F,OAAO;gBACL,OAAO,EAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;gBACzC,iBAAiB,EAAC,KAAK,EAAC,KAAK,EAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAC,EAAE;oBACpD,MAAM,MAAM,GAAC,MAAM,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;oBAC/D,IAAG,CAAC,MAAM,IAAE,MAAM,CAAC,SAAS,KAAG,SAAS,IAAE,CAAC,qBAAqB,CAAC,MAAM,CAAC,KAAK,EAAC,KAAK,CAAC;wBAAC,MAAM,KAAK,CAAC,wDAAwD,CAAC,CAAA;oBAC1J,MAAM,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAC,IAAI,CAAC,CAAA;gBAChD,CAAC;gBACD,KAAK,EAAC,KAAK,IAAE,EAAE,GAAC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,CAAA,SAAS,CAAC,KAAK,EAAE,CAAA,CAAA,CAAC;aAC3D,CAAA;QACH,CAAC;QAAA,OAAM,KAAK,EAAC,CAAC;YAAA,SAAS,CAAC,KAAK,EAAE,CAAC;YAAA,MAAM,KAAK,CAAA;QAAA,CAAC;IAC9C,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { OwnedBrowserHostConfiguration } from './OwnedBrowserHostServices.js';
2
+ /** Exact local source cohort qualified on 2026-09-04. These pins deliberately
3
+ * refuse another same-version SDK or a rebuilt Browser with different bytes. */
4
+ export declare const MANAGED_BROWSER_COHORT: {
5
+ readonly browserSource: "9637751e285370e1c5a0c3f59b14e2163caf004cdc252993cb2bad62c1c08fbe";
6
+ readonly browserSdkTree: "5571553bc0d48ec7cf94b0936a42bd7f331b6aee87bc62dd888acd7d258971ae";
7
+ readonly browserApplication: "03b147f7934e8073c434e2e4fe3cab6f87cd129c937e41e36ab68712c8ee1d2d";
8
+ readonly browserMain: "6b54b5fa1ebf4de5dd6eea8b7ef81aaebe6c4f72f2a74f6cdf66d5faa6205699";
9
+ readonly browserExecutable: "d6001225dce0df502929ab1ed85c5a9a24ce3e4ac86f6d2d7e4c9e55e5d146d3";
10
+ readonly authoritySdkArchive: "184a7d48757edb7db4ca30fc2549f3c150b6efc2b5168e338f1470f03f316d56";
11
+ readonly authoritySdkDistTree: "56fbee9b789678383d40f5efa5b6e78e2846e0819b64c5e060123645dbef0c8c";
12
+ readonly authoritySdkEntry: "ae6f71575d77be2bc882f7c54597135bb456d01d1d2b355b1f890f94a6d2864e";
13
+ };
14
+ /** Host-private candidate activation. Absence is an explicit unavailable state;
15
+ * partial/non-matching configuration refuses before loading or launching code.
16
+ * The archive pin is evidence binding only: this source cohort is not a public
17
+ * install because the SDK tarball reuses nominal version 0.9.25. */
18
+ export declare function loadManagedBrowserConfiguration(input: {
19
+ env: NodeJS.ProcessEnv;
20
+ hostRoot: string;
21
+ }): Promise<OwnedBrowserHostConfiguration | undefined>;
22
+ //# sourceMappingURL=managedBrowserConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managedBrowserConfiguration.d.ts","sourceRoot":"","sources":["../../src/browser/managedBrowserConfiguration.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,+BAA+B,CAAA;AAEhF;gFACgF;AAChF,eAAO,MAAM,sBAAsB;;;;;;;;;CASzB,CAAA;AA0BV;;;oEAGoE;AACpE,wBAAsB,+BAA+B,CAAC,KAAK,EAAC;IAAC,GAAG,EAAC,MAAM,CAAC,UAAU,CAAC;IAAA,QAAQ,EAAC,MAAM,CAAA;CAAC,GAAE,OAAO,CAAC,6BAA6B,GAAC,SAAS,CAAC,CAqBpJ"}