agentcert 0.2.7 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +37 -0
  2. package/dist/cli.js +8 -0
  3. package/dist/command-help.js +2 -0
  4. package/dist/index.js +1 -0
  5. package/dist/sandbox.js +323 -0
  6. package/dist/vendor/onegent-runtime/mock-procurement.d.ts +6 -0
  7. package/dist/vendor/onegent-runtime/mock-procurement.d.ts.map +1 -0
  8. package/dist/vendor/onegent-runtime/mock-procurement.js +33 -0
  9. package/dist/vendor/onegent-runtime/policies.d.ts +6 -0
  10. package/dist/vendor/onegent-runtime/policies.d.ts.map +1 -0
  11. package/dist/vendor/onegent-runtime/policies.js +109 -0
  12. package/dist/vendor/onegent-runtime/risk.d.ts +3 -0
  13. package/dist/vendor/onegent-runtime/risk.d.ts.map +1 -0
  14. package/dist/vendor/onegent-runtime/risk.js +54 -0
  15. package/dist/vendor/onegent-runtime/sandbox-adapter-kit.d.ts +45 -0
  16. package/dist/vendor/onegent-runtime/sandbox-adapter-kit.d.ts.map +1 -0
  17. package/dist/vendor/onegent-runtime/sandbox-adapter-kit.js +148 -0
  18. package/dist/vendor/onegent-runtime/sandbox-harness.d.ts +167 -0
  19. package/dist/vendor/onegent-runtime/sandbox-harness.d.ts.map +1 -0
  20. package/dist/vendor/onegent-runtime/sandbox-harness.js +729 -0
  21. package/dist/vendor/onegent-runtime/sandbox-hosted.d.ts +77 -0
  22. package/dist/vendor/onegent-runtime/sandbox-hosted.d.ts.map +1 -0
  23. package/dist/vendor/onegent-runtime/sandbox-hosted.js +133 -0
  24. package/dist/vendor/onegent-runtime/sdk.d.ts +29 -0
  25. package/dist/vendor/onegent-runtime/sdk.d.ts.map +1 -0
  26. package/dist/vendor/onegent-runtime/sdk.js +140 -0
  27. package/dist/vendor/onegent-runtime/service.d.ts +27 -0
  28. package/dist/vendor/onegent-runtime/service.d.ts.map +1 -0
  29. package/dist/vendor/onegent-runtime/service.js +421 -0
  30. package/dist/vendor/onegent-runtime/store.d.ts +16 -0
  31. package/dist/vendor/onegent-runtime/store.d.ts.map +1 -0
  32. package/dist/vendor/onegent-runtime/store.js +29 -0
  33. package/dist/vendor/onegent-runtime/stripe-test-readonly.d.ts +79 -0
  34. package/dist/vendor/onegent-runtime/stripe-test-readonly.d.ts.map +1 -0
  35. package/dist/vendor/onegent-runtime/stripe-test-readonly.js +163 -0
  36. package/dist/vendor/onegent-runtime/types.d.ts +284 -0
  37. package/dist/vendor/onegent-runtime/types.d.ts.map +1 -0
  38. package/dist/vendor/onegent-runtime/types.js +1 -0
  39. package/dist/vendor/onegent-runtime/vendor-sandbox-egress.d.ts +49 -0
  40. package/dist/vendor/onegent-runtime/vendor-sandbox-egress.d.ts.map +1 -0
  41. package/dist/vendor/onegent-runtime/vendor-sandbox-egress.js +152 -0
  42. package/package.json +2 -2
@@ -0,0 +1,45 @@
1
+ import { type SandboxCertificationCheck, type SandboxCertificationReport, type SandboxSeed, type SandboxSystem, type SandboxTenantInput } from "./sandbox-harness.js";
2
+ import type { LocalActionAdapter } from "./types.js";
3
+ export declare const SANDBOX_ADAPTER_CONFORMANCE_SCHEMA_VERSION: "agentcert.sandbox_adapter_conformance.v0.2";
4
+ export interface SandboxSystemAdapterHandlers {
5
+ createTenant(input: SandboxTenantInput): void | Promise<void>;
6
+ deleteTenant(tenantId: string): void | Promise<void>;
7
+ resetTenant(tenantId: string): void | Promise<void>;
8
+ seedTenant(tenantId: string, seed: SandboxSeed): void | Promise<void>;
9
+ hasTenant(tenantId: string): boolean | Promise<boolean>;
10
+ snapshotTenant(tenantId: string): SandboxSeed | Promise<SandboxSeed>;
11
+ adapterForTenant(tenantId: string): LocalActionAdapter;
12
+ }
13
+ export interface SandboxSystemAdapterDefinition {
14
+ name: string;
15
+ allowedTargetSystems: string[];
16
+ handlers: SandboxSystemAdapterHandlers;
17
+ }
18
+ export interface SandboxAdapterConformanceReport {
19
+ schemaVersion: typeof SANDBOX_ADAPTER_CONFORMANCE_SCHEMA_VERSION;
20
+ kind: "agentcert.sandbox_adapter_conformance";
21
+ implementation: string;
22
+ generatedAt: string;
23
+ verdict: {
24
+ passed: boolean;
25
+ score: number;
26
+ };
27
+ summary: {
28
+ passed: number;
29
+ failed: number;
30
+ total: number;
31
+ };
32
+ checks: SandboxCertificationCheck[];
33
+ certification?: SandboxCertificationReport;
34
+ disclaimer: string;
35
+ }
36
+ export interface SandboxAdapterConformanceOptions {
37
+ system: SandboxSystem;
38
+ implementation?: string;
39
+ targetSystem?: string;
40
+ now?: () => Date;
41
+ }
42
+ export declare function createSandboxSystemAdapter(definition: SandboxSystemAdapterDefinition): SandboxSystem;
43
+ export declare function runSandboxAdapterConformanceSuite(options: SandboxAdapterConformanceOptions): Promise<SandboxAdapterConformanceReport>;
44
+ export declare function writeSandboxAdapterConformanceReport(report: SandboxAdapterConformanceReport, filePath: string): Promise<string>;
45
+ //# sourceMappingURL=sandbox-adapter-kit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox-adapter-kit.d.ts","sourceRoot":"","sources":["../../../../onegent-runtime/src/sandbox-adapter-kit.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,eAAO,MAAM,0CAA0C,EAAG,4CAAqD,CAAC;AAEhH,MAAM,WAAW,4BAA4B;IAC3C,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAA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AAG,aAAa,CA8BpG;AAED,wBAAsB,iCAAiC,CACrD,OAAO,EAAE,gCAAgC,GACxC,OAAO,CAAC,+BAA+B,CAAC,CAmF1C;AAED,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,+BAA+B,EACvC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAMjB"}
@@ -0,0 +1,148 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { chmod, mkdir, writeFile } from "node:fs/promises";
3
+ import { dirname, resolve } from "node:path";
4
+ import { isDeepStrictEqual } from "node:util";
5
+ import { createSandboxCertificationHarness, runSandboxCertificationSuite, validateSyntheticSandboxSeed, } from "./sandbox-harness.js";
6
+ export const SANDBOX_ADAPTER_CONFORMANCE_SCHEMA_VERSION = "agentcert.sandbox_adapter_conformance.v0.2";
7
+ export function createSandboxSystemAdapter(definition) {
8
+ const name = definition.name.trim();
9
+ if (!name)
10
+ throw new Error("Sandbox adapter name is required.");
11
+ const allowedTargetSystems = normalizeTargets(definition.allowedTargetSystems);
12
+ const handlers = definition.handlers;
13
+ for (const method of ["createTenant", "deleteTenant", "resetTenant", "seedTenant", "hasTenant", "snapshotTenant", "adapterForTenant"]) {
14
+ if (typeof handlers[method] !== "function")
15
+ throw new Error(`Sandbox adapter handler ${method} is required.`);
16
+ }
17
+ return {
18
+ name,
19
+ safety: Object.freeze({
20
+ mode: "sandbox",
21
+ networkAccess: false,
22
+ syntheticDataOnly: true,
23
+ allowedTargetSystems: Object.freeze(allowedTargetSystems),
24
+ }),
25
+ createTenant: (input) => {
26
+ if (input.synthetic !== true)
27
+ throw new Error("Sandbox adapter tenants must declare synthetic: true.");
28
+ return handlers.createTenant({
29
+ ...input,
30
+ ...(input.seed ? { seed: validateSyntheticSandboxSeed(input.seed) } : {}),
31
+ });
32
+ },
33
+ deleteTenant: (tenantId) => handlers.deleteTenant(tenantId),
34
+ resetTenant: (tenantId) => handlers.resetTenant(tenantId),
35
+ seedTenant: (tenantId, seed) => handlers.seedTenant(tenantId, validateSyntheticSandboxSeed(seed)),
36
+ hasTenant: (tenantId) => handlers.hasTenant(tenantId),
37
+ snapshotTenant: (tenantId) => handlers.snapshotTenant(tenantId),
38
+ adapterForTenant: (tenantId) => handlers.adapterForTenant(tenantId),
39
+ };
40
+ }
41
+ export async function runSandboxAdapterConformanceSuite(options) {
42
+ const now = options.now ?? (() => new Date());
43
+ const implementation = options.implementation?.trim() || options.system.name;
44
+ const targetSystem = options.targetSystem ?? options.system.safety.allowedTargetSystems[0];
45
+ const checks = [];
46
+ let certification;
47
+ await check(checks, "adapter-contract", "The adapter declares the complete synthetic, network-denied SandboxSystem contract.", async () => {
48
+ if (!options.system.name.trim())
49
+ throw new Error("Adapter name is required.");
50
+ if (options.system.safety.mode !== "sandbox" || options.system.safety.networkAccess !== false || options.system.safety.syntheticDataOnly !== true) {
51
+ throw new Error("Adapter safety must be sandbox, network-denied, and synthetic-only.");
52
+ }
53
+ normalizeTargets([...options.system.safety.allowedTargetSystems]);
54
+ return { targetSystems: [...options.system.safety.allowedTargetSystems] };
55
+ });
56
+ await check(checks, "core-certification-v0.1", "The adapter passes the active ten-control Sandbox Certification Harness v0.1 suite.", async () => {
57
+ certification = await runSandboxCertificationSuite({
58
+ system: options.system,
59
+ implementation,
60
+ targetSystem,
61
+ now,
62
+ });
63
+ if (!certification.verdict.passed) {
64
+ throw new Error(`${certification.summary.failed} core certification control(s) failed.`);
65
+ }
66
+ return { score: certification.verdict.score, controls: certification.summary.total };
67
+ });
68
+ await check(checks, "tenant-lifecycle", "Create, inspect, seed, reset, and delete remain isolated behind the tenant lifecycle contract.", async () => {
69
+ const suffix = randomUUID().slice(0, 8);
70
+ const tenantId = `adapter-lifecycle-${suffix}`;
71
+ const harness = createSandboxCertificationHarness({ system: options.system, autoCleanup: false, now });
72
+ try {
73
+ await harness.createTenant({ id: tenantId, synthetic: true, seed: { record: { state: "seed" } } });
74
+ const initial = await harness.snapshotTenant(tenantId);
75
+ if (!isDeepStrictEqual(initial, { record: { state: "seed" } }))
76
+ throw new Error("Initial tenant snapshot did not match the seed.");
77
+ await harness.seedTenant(tenantId, { record: { state: "replacement" } });
78
+ await harness.resetTenant(tenantId);
79
+ const reset = await harness.snapshotTenant(tenantId);
80
+ if (!isDeepStrictEqual(reset, { record: { state: "replacement" } }))
81
+ throw new Error("Tenant reset did not restore the replacement seed.");
82
+ await harness.deleteTenant(tenantId);
83
+ if (await options.system.hasTenant(tenantId))
84
+ throw new Error("Deleted tenant remains accessible.");
85
+ return { tenantDeleted: true };
86
+ }
87
+ finally {
88
+ await harness.close();
89
+ }
90
+ });
91
+ await check(checks, "temporary-tenant-cleanup", "Expired tenant leases are removed deterministically from the underlying sandbox.", async () => {
92
+ let current = new Date("2030-01-01T00:00:00.000Z");
93
+ const tenantId = `adapter-expiry-${randomUUID().slice(0, 8)}`;
94
+ const harness = createSandboxCertificationHarness({
95
+ system: options.system,
96
+ tenantTtlMs: 1_000,
97
+ maxTenantTtlMs: 5_000,
98
+ autoCleanup: false,
99
+ now: () => current,
100
+ });
101
+ try {
102
+ const lease = await harness.createTenant({ id: tenantId, synthetic: true, seed: { record: { state: "temporary" } } });
103
+ current = new Date(current.getTime() + 1_001);
104
+ const removed = await harness.cleanupExpiredTenants();
105
+ if (!removed.includes(tenantId) || await options.system.hasTenant(tenantId))
106
+ throw new Error("Expired tenant was not deleted.");
107
+ return { expiresAt: lease.expiresAt, removed: true };
108
+ }
109
+ finally {
110
+ await harness.close();
111
+ }
112
+ });
113
+ const passed = checks.filter((item) => item.status === "passed").length;
114
+ const failed = checks.length - passed;
115
+ return {
116
+ schemaVersion: SANDBOX_ADAPTER_CONFORMANCE_SCHEMA_VERSION,
117
+ kind: "agentcert.sandbox_adapter_conformance",
118
+ implementation,
119
+ generatedAt: now().toISOString(),
120
+ verdict: { passed: failed === 0, score: Math.round((passed / checks.length) * 100) },
121
+ summary: { passed, failed, total: checks.length },
122
+ checks,
123
+ ...(certification ? { certification } : {}),
124
+ disclaimer: "Conformance covers the AgentCert synthetic sandbox adapter contract. It does not authorize production access or certify vendor-side controls.",
125
+ };
126
+ }
127
+ export async function writeSandboxAdapterConformanceReport(report, filePath) {
128
+ const absolutePath = resolve(filePath);
129
+ await mkdir(dirname(absolutePath), { recursive: true });
130
+ await writeFile(absolutePath, `${JSON.stringify(report, null, 2)}\n`, { encoding: "utf8", mode: 0o600 });
131
+ await chmod(absolutePath, 0o600);
132
+ return absolutePath;
133
+ }
134
+ async function check(checks, id, message, operation) {
135
+ try {
136
+ const evidence = await operation();
137
+ checks.push({ id, status: "passed", message, ...(evidence ? { evidence } : {}) });
138
+ }
139
+ catch (error) {
140
+ checks.push({ id, status: "failed", message: error instanceof Error ? error.message : String(error) });
141
+ }
142
+ }
143
+ function normalizeTargets(input) {
144
+ const targets = [...new Set(input.map((item) => item.trim()).filter(Boolean))];
145
+ if (targets.length === 0)
146
+ throw new Error("Sandbox adapters require at least one allowed target system.");
147
+ return targets;
148
+ }
@@ -0,0 +1,167 @@
1
+ import type { ActionAuditPacket, ActionExecutionReceipt, ActionExecutionSummary, CreateActionIntentInput, LocalActionAdapter, VerificationResult } from "./types.js";
2
+ export declare const SANDBOX_CERTIFICATION_SCHEMA_VERSION: "agentcert.sandbox_certification.v0.1";
3
+ export declare const SANDBOX_RUN_SCHEMA_VERSION: "agentcert.sandbox_run.v0.1";
4
+ export type SandboxSeed = Record<string, Record<string, unknown>>;
5
+ export interface SandboxTenantInput {
6
+ id: string;
7
+ synthetic: true;
8
+ displayName?: string;
9
+ seed?: SandboxSeed;
10
+ ttlMs?: number;
11
+ }
12
+ export interface SandboxTenantLease {
13
+ tenantId: string;
14
+ createdAt: string;
15
+ expiresAt: string;
16
+ }
17
+ export interface SandboxSystemSafety {
18
+ readonly mode: "sandbox";
19
+ readonly networkAccess: false;
20
+ readonly syntheticDataOnly: true;
21
+ readonly allowedTargetSystems: readonly string[];
22
+ }
23
+ export interface SandboxSystem {
24
+ name: string;
25
+ safety: SandboxSystemSafety;
26
+ createTenant(input: SandboxTenantInput): void | Promise<void>;
27
+ deleteTenant(tenantId: string): void | Promise<void>;
28
+ resetTenant(tenantId: string): void | Promise<void>;
29
+ seedTenant(tenantId: string, seed: SandboxSeed): void | Promise<void>;
30
+ hasTenant(tenantId: string): boolean | Promise<boolean>;
31
+ snapshotTenant(tenantId: string): SandboxSeed | Promise<SandboxSeed>;
32
+ adapterForTenant(tenantId: string): LocalActionAdapter;
33
+ }
34
+ export interface InMemorySandboxSystemOptions {
35
+ name?: string;
36
+ allowedTargetSystems: string[];
37
+ }
38
+ export interface SandboxExecutionLimits {
39
+ readonly maxActionsPerRun: number;
40
+ readonly maxAmountPerAction: number;
41
+ readonly maxTotalAmountPerRun: number;
42
+ }
43
+ export interface SandboxKillSwitchState {
44
+ enabled: boolean;
45
+ reason?: string;
46
+ changedAt: string;
47
+ }
48
+ export type SandboxRejectionCode = "ACTION_LIMIT_EXCEEDED" | "AMOUNT_LIMIT_EXCEEDED" | "APPROVAL_REJECTED" | "APPROVAL_REQUIRED" | "GLOBAL_KILL_SWITCH" | "IDEMPOTENCY_CONFLICT" | "IDEMPOTENCY_REQUIRED" | "INVALID_AMOUNT" | "NETWORK_DENIED" | "PRODUCTION_DENIED" | "RUN_AMOUNT_LIMIT_EXCEEDED" | "TARGET_NOT_ALLOWED" | "TENANT_KILL_SWITCH" | "TENANT_MISMATCH";
49
+ export interface SandboxApprovalDecision {
50
+ approved: boolean;
51
+ reviewerId: string;
52
+ comment?: string;
53
+ }
54
+ export interface SandboxActionOptions {
55
+ approval?: SandboxApprovalDecision;
56
+ rollbackAfterVerification?: boolean;
57
+ rollbackReason?: string;
58
+ }
59
+ export type SandboxActionStatus = "verified" | "rolled_back" | "rejected" | "failed" | "rollback_failed";
60
+ export interface SandboxActionResult {
61
+ idempotencyKey: string;
62
+ actionIntentId?: string;
63
+ status: SandboxActionStatus;
64
+ rejectionCode?: SandboxRejectionCode;
65
+ message: string;
66
+ startedAt: string;
67
+ completedAt: string;
68
+ execution?: ActionExecutionSummary;
69
+ verification?: VerificationResult;
70
+ rollback?: ActionExecutionReceipt;
71
+ auditPacket?: ActionAuditPacket;
72
+ }
73
+ export interface SandboxRunSummary {
74
+ attempted: number;
75
+ verified: number;
76
+ rolledBack: number;
77
+ rejected: number;
78
+ failed: number;
79
+ totalApprovedAmount: number;
80
+ }
81
+ export interface SandboxRunReport {
82
+ schemaVersion: typeof SANDBOX_RUN_SCHEMA_VERSION;
83
+ kind: "agentcert.sandbox_run";
84
+ runId: string;
85
+ tenantId: string;
86
+ system: string;
87
+ startedAt: string;
88
+ completedAt: string;
89
+ safe: boolean;
90
+ syntheticData: true;
91
+ networkAccess: false;
92
+ allowedTargetSystems: string[];
93
+ limits: SandboxExecutionLimits;
94
+ summary: SandboxRunSummary;
95
+ actions: SandboxActionResult[];
96
+ disclaimer: string;
97
+ }
98
+ export interface SandboxRun {
99
+ readonly runId: string;
100
+ readonly tenantId: string;
101
+ executeAction(input: CreateActionIntentInput, options?: SandboxActionOptions): Promise<SandboxActionResult>;
102
+ complete(): SandboxRunReport;
103
+ }
104
+ export interface SandboxHarnessOptions {
105
+ system?: SandboxSystem;
106
+ allowedTargetSystems?: string[];
107
+ limits?: Partial<SandboxExecutionLimits>;
108
+ tenantTtlMs?: number;
109
+ maxTenantTtlMs?: number;
110
+ cleanupIntervalMs?: number;
111
+ autoCleanup?: boolean;
112
+ now?: () => Date;
113
+ }
114
+ export interface SandboxCertificationHarness {
115
+ readonly limits: SandboxExecutionLimits;
116
+ createTenant(input: SandboxTenantInput): Promise<SandboxTenantLease>;
117
+ deleteTenant(tenantId: string): Promise<void>;
118
+ tenantLease(tenantId: string): SandboxTenantLease | undefined;
119
+ renewTenant(tenantId: string, ttlMs?: number): Promise<SandboxTenantLease>;
120
+ cleanupExpiredTenants(): Promise<string[]>;
121
+ seedTenant(tenantId: string, seed: SandboxSeed): Promise<void>;
122
+ resetTenant(tenantId: string): Promise<void>;
123
+ snapshotTenant(tenantId: string): Promise<SandboxSeed>;
124
+ startRun(input: {
125
+ tenantId: string;
126
+ runId?: string;
127
+ }): Promise<SandboxRun>;
128
+ setGlobalKillSwitch(enabled: boolean, reason?: string): SandboxKillSwitchState;
129
+ setTenantKillSwitch(tenantId: string, enabled: boolean, reason?: string): SandboxKillSwitchState;
130
+ close(): Promise<void>;
131
+ }
132
+ export interface SandboxCertificationCheck {
133
+ id: string;
134
+ status: "passed" | "failed";
135
+ message: string;
136
+ evidence?: Record<string, unknown>;
137
+ }
138
+ export interface SandboxCertificationReport {
139
+ schemaVersion: typeof SANDBOX_CERTIFICATION_SCHEMA_VERSION;
140
+ kind: "agentcert.sandbox_certification";
141
+ implementation: string;
142
+ generatedAt: string;
143
+ verdict: {
144
+ passed: boolean;
145
+ score: number;
146
+ };
147
+ summary: {
148
+ passed: number;
149
+ failed: number;
150
+ total: number;
151
+ };
152
+ checks: SandboxCertificationCheck[];
153
+ runIds: string[];
154
+ disclaimer: string;
155
+ }
156
+ export interface SandboxCertificationSuiteOptions {
157
+ system?: SandboxSystem;
158
+ implementation?: string;
159
+ targetSystem?: string;
160
+ now?: () => Date;
161
+ }
162
+ export declare function createInMemorySandboxSystem(options: InMemorySandboxSystemOptions): SandboxSystem;
163
+ export declare function createSandboxCertificationHarness(options: SandboxHarnessOptions): SandboxCertificationHarness;
164
+ export declare function runSandboxCertificationSuite(options?: SandboxCertificationSuiteOptions): Promise<SandboxCertificationReport>;
165
+ export declare function writeSandboxReport(report: SandboxRunReport | SandboxCertificationReport, filePath: string): Promise<string>;
166
+ export declare function validateSyntheticSandboxSeed(input: SandboxSeed): SandboxSeed;
167
+ //# sourceMappingURL=sandbox-harness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox-harness.d.ts","sourceRoot":"","sources":["../../../../onegent-runtime/src/sandbox-harness.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EA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