@hasna/infinity 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +3 -0
- package/README.md +331 -0
- package/dist/cli.js +2965 -0
- package/dist/http-api.js +6448 -0
- package/dist/index.js +28536 -0
- package/dist/migrate.js +346 -0
- package/dist/self-hosted-migrate.js +2064 -0
- package/dist/self-hosted.js +13180 -0
- package/dist/types/authcapsules/codewith-local.d.ts +109 -0
- package/dist/types/authcapsules/infinity-agent-policy.d.ts +57 -0
- package/dist/types/authcapsules/os-isolated-runner.d.ts +87 -0
- package/dist/types/authority/authority.d.ts +342 -0
- package/dist/types/authority/effect-journal.d.ts +205 -0
- package/dist/types/authority/mutation-journal.d.ts +163 -0
- package/dist/types/authority/mutation-tuple.d.ts +26 -0
- package/dist/types/authority/state.d.ts +75 -0
- package/dist/types/authority/store.d.ts +15 -0
- package/dist/types/brokers/checkpoint/archive.d.ts +21 -0
- package/dist/types/brokers/checkpoint/bundle.d.ts +22 -0
- package/dist/types/brokers/checkpoint/bytes.d.ts +4 -0
- package/dist/types/brokers/checkpoint/clean-verifier-finalization.d.ts +62 -0
- package/dist/types/brokers/checkpoint/clean-verifier.d.ts +145 -0
- package/dist/types/brokers/checkpoint/final-trust-authority.d.ts +55 -0
- package/dist/types/brokers/checkpoint/idempotency.d.ts +25 -0
- package/dist/types/brokers/checkpoint/journaled-store.d.ts +9 -0
- package/dist/types/brokers/checkpoint/manifest-signature.d.ts +135 -0
- package/dist/types/brokers/checkpoint/manifest.d.ts +57 -0
- package/dist/types/brokers/checkpoint/s3-store.d.ts +215 -0
- package/dist/types/brokers/checkpoint/seal-authority.d.ts +86 -0
- package/dist/types/brokers/checkpoint/service.d.ts +198 -0
- package/dist/types/brokers/checkpoint/signing-message.d.ts +22 -0
- package/dist/types/brokers/checkpoint/store.d.ts +76 -0
- package/dist/types/brokers/checkpoint/verifier-cleanup-authority.d.ts +108 -0
- package/dist/types/brokers/checkpoint/verifier-cleanup.d.ts +391 -0
- package/dist/types/brokers/checkpoint/verifier.d.ts +225 -0
- package/dist/types/brokers/composition.d.ts +86 -0
- package/dist/types/brokers/git/github-app.d.ts +216 -0
- package/dist/types/brokers/git/promotion.d.ts +418 -0
- package/dist/types/brokers/persistence/contracts.d.ts +77 -0
- package/dist/types/brokers/persistence/memory.d.ts +5 -0
- package/dist/types/brokers/persistence/migration.d.ts +6 -0
- package/dist/types/brokers/persistence/postgres.d.ts +74 -0
- package/dist/types/cli/main.d.ts +2 -0
- package/dist/types/cli/operation-journal.d.ts +47 -0
- package/dist/types/cli/run.d.ts +15 -0
- package/dist/types/client/operator-client.d.ts +100 -0
- package/dist/types/contracts/dtos.d.ts +198 -0
- package/dist/types/contracts/events.d.ts +45 -0
- package/dist/types/contracts/fence.d.ts +39 -0
- package/dist/types/contracts/operations.d.ts +91 -0
- package/dist/types/contracts/runspec.d.ts +75 -0
- package/dist/types/contracts/validators.d.ts +8 -0
- package/dist/types/core/clock.d.ts +12 -0
- package/dist/types/core/errors.d.ts +18 -0
- package/dist/types/core/ids.d.ts +10 -0
- package/dist/types/core/int64.d.ts +7 -0
- package/dist/types/core/strict-json.d.ts +8 -0
- package/dist/types/core/validation.d.ts +25 -0
- package/dist/types/golden/disposable-task.d.ts +108 -0
- package/dist/types/golden/source-pins.d.ts +77 -0
- package/dist/types/http/api.d.ts +52 -0
- package/dist/types/http/bearer-auth.d.ts +8 -0
- package/dist/types/http/main.d.ts +3 -0
- package/dist/types/http/self-hosted-main.d.ts +17 -0
- package/dist/types/index.d.ts +65 -0
- package/dist/types/mcp/schema.d.ts +7 -0
- package/dist/types/node-agent/agent.d.ts +174 -0
- package/dist/types/node-agent/contracts.d.ts +119 -0
- package/dist/types/node-agent/macos-service.d.ts +33 -0
- package/dist/types/node-agent/service-cli.d.ts +26 -0
- package/dist/types/persistence/composition.d.ts +49 -0
- package/dist/types/persistence/migrate-main.d.ts +2 -0
- package/dist/types/persistence/migrations.d.ts +30 -0
- package/dist/types/persistence/postgres-accounts-operation.d.ts +26 -0
- package/dist/types/persistence/postgres-authority.d.ts +69 -0
- package/dist/types/persistence/postgres-external-mutation-journal.d.ts +22 -0
- package/dist/types/persistence/postgres-json.d.ts +1 -0
- package/dist/types/persistence/postgres-mutation-journal.d.ts +31 -0
- package/dist/types/persistence/postgres-reconciler.d.ts +34 -0
- package/dist/types/persistence/postgres-sandbox-dispatch-authority.d.ts +9 -0
- package/dist/types/persistence/self-hosted-migrate-main.d.ts +2 -0
- package/dist/types/ports/accounts-operation.d.ts +336 -0
- package/dist/types/ports/accounts.d.ts +293 -0
- package/dist/types/ports/sandbox-dispatch-authority.d.ts +154 -0
- package/dist/types/ports/sandboxes.d.ts +40 -0
- package/dist/types/providers/sandbox-dispatch.d.ts +143 -0
- package/dist/types/runtime/config.d.ts +61 -0
- package/dist/types/runtime/postgres.d.ts +18 -0
- package/dist/types/runtime/provider-activation.d.ts +45 -0
- package/dist/types/runtime/server.d.ts +68 -0
- package/dist/types/testing/accounts-fake.d.ts +31 -0
- package/dist/types/testing/fakes.d.ts +2 -0
- package/dist/types/testing/node-control-plane-fake.d.ts +20 -0
- package/dist/types/testing/reference.d.ts +27 -0
- package/dist/types/testing/sandboxes-fake.d.ts +22 -0
- package/evidence/provider-live-daytona-v3.json +1 -0
- package/evidence/provider-live-e2b-v3.json +1 -0
- package/evidence/provider-production-route-daytona-v1.json +1 -0
- package/evidence/provider-production-route-e2b-v1.json +1 -0
- package/migrations/0001_authority.sql +689 -0
- package/migrations/0002_effect_step_global_owner.sql +2 -0
- package/migrations/0003_effect_journal_observed_head.sql +34 -0
- package/migrations/0004_authority_mutation_journal_binding.sql +15 -0
- package/migrations/20260710_checkpoint_broker_v1.sql +163 -0
- package/migrations/20260711_accounts_operation_v1.sql +137 -0
- package/migrations/20260711_checkpoint_trust_v2.sql +17 -0
- package/migrations/20260711_verifier_cleanup_v2.sql +169 -0
- package/migrations/20260711_z_accounts_claim_authority_v2.sql +172 -0
- package/migrations/20260711_zz_sandbox_dispatch_authority_v1.sql +143 -0
- package/migrations/20260712_sandbox_dispatch_authority_v2.sql +58 -0
- package/migrations/external-journal/0001_external_authority_mutation_journal.sql +175 -0
- package/package.json +47 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { AccountsOperationEvidenceSigner, InMemoryAccountsOperationSignerHistory, InfinitySha256Digest } from "./accounts-operation";
|
|
2
|
+
export declare const SANDBOX_DISPATCH_AUTHORIZATION_REQUEST_SCHEMA_V2: "infinity.sandbox-dispatch-authorization-request.v2";
|
|
3
|
+
export declare const SANDBOX_DISPATCH_ACCOUNTS_CONSUME_EVIDENCE_REQUEST_SCHEMA_VERSION: "infinity.sandbox-dispatch-accounts-consume-evidence-request.v1";
|
|
4
|
+
export declare const SANDBOX_DISPATCH_ACCOUNTS_CONSUME_EVIDENCE_SCHEMA_VERSION: "infinity.sandbox-dispatch-accounts-consume-evidence.v1";
|
|
5
|
+
export declare const SANDBOX_DISPATCH_AUTHORIZATION_SCHEMA_V2: "infinity.sandbox-dispatch-authorization.v2";
|
|
6
|
+
export declare const DISPOSABLE_TASK_AUTHORIZATION_CONSUMPTION_SCHEMA_V2: "sandboxes.disposable-task-authorization-consumption/v2";
|
|
7
|
+
export declare const DISPOSABLE_TASK_PROVIDER_CONTACT_AUDIENCE_V2: "hasna:sandboxes:disposable-task-provider-contact/v2";
|
|
8
|
+
export type ManagedProviderIdV1 = "e2b" | "daytona_cloud";
|
|
9
|
+
export interface SandboxDispatchAuthorizationRequestV2 {
|
|
10
|
+
readonly schema_version: typeof SANDBOX_DISPATCH_AUTHORIZATION_REQUEST_SCHEMA_V2;
|
|
11
|
+
readonly dispatch_id: string;
|
|
12
|
+
readonly mint_operation_id: string;
|
|
13
|
+
readonly idempotency_key: string;
|
|
14
|
+
readonly run_id: string;
|
|
15
|
+
readonly attempt_id: string;
|
|
16
|
+
readonly attempt_lease_id: string;
|
|
17
|
+
readonly lease_epoch: string;
|
|
18
|
+
readonly account_lane_id: string;
|
|
19
|
+
readonly model_operation_id: string;
|
|
20
|
+
readonly operation_digest: InfinitySha256Digest;
|
|
21
|
+
readonly provider: ManagedProviderIdV1;
|
|
22
|
+
readonly canonical_intent_sha256: InfinitySha256Digest;
|
|
23
|
+
readonly provider_execution_sha256: InfinitySha256Digest;
|
|
24
|
+
readonly source_manifest_sha256: InfinitySha256Digest;
|
|
25
|
+
readonly input_manifest_sha256: InfinitySha256Digest;
|
|
26
|
+
readonly checkpoint_policy_sha256: InfinitySha256Digest;
|
|
27
|
+
readonly prepared_anchor_sha256: InfinitySha256Digest;
|
|
28
|
+
readonly effect_claim_sha256: InfinitySha256Digest;
|
|
29
|
+
readonly sandbox_prepare_anchor_sha256: InfinitySha256Digest;
|
|
30
|
+
readonly consume_receipt_sha256: InfinitySha256Digest;
|
|
31
|
+
readonly consume_tombstone_sha256: InfinitySha256Digest;
|
|
32
|
+
readonly consume_use_id_sha256: InfinitySha256Digest;
|
|
33
|
+
readonly consume_binding_sha256: InfinitySha256Digest;
|
|
34
|
+
readonly audience: string;
|
|
35
|
+
readonly expires_at: string;
|
|
36
|
+
}
|
|
37
|
+
export interface SandboxDispatchAccountsConsumeEvidenceRequestV1 {
|
|
38
|
+
readonly schema_version: typeof SANDBOX_DISPATCH_ACCOUNTS_CONSUME_EVIDENCE_REQUEST_SCHEMA_VERSION;
|
|
39
|
+
readonly bind_operation_id: string;
|
|
40
|
+
readonly idempotency_key: string;
|
|
41
|
+
readonly model_operation_id: string;
|
|
42
|
+
readonly verified_accounts_consume_evidence: object;
|
|
43
|
+
}
|
|
44
|
+
export interface SandboxDispatchAccountsConsumeEvidenceV1 {
|
|
45
|
+
readonly schema_version: typeof SANDBOX_DISPATCH_ACCOUNTS_CONSUME_EVIDENCE_SCHEMA_VERSION;
|
|
46
|
+
readonly model_operation_id: string;
|
|
47
|
+
readonly consume_receipt_sha256: InfinitySha256Digest;
|
|
48
|
+
readonly consume_tombstone_sha256: InfinitySha256Digest;
|
|
49
|
+
readonly consume_use_id_sha256: InfinitySha256Digest;
|
|
50
|
+
readonly consume_binding_sha256: InfinitySha256Digest;
|
|
51
|
+
readonly recorded_at: string;
|
|
52
|
+
}
|
|
53
|
+
export interface SignedSandboxDispatchAuthorizationV2 {
|
|
54
|
+
readonly schema_version: typeof SANDBOX_DISPATCH_AUTHORIZATION_SCHEMA_V2;
|
|
55
|
+
readonly dispatch_id: string;
|
|
56
|
+
readonly mint_operation_id: string;
|
|
57
|
+
readonly idempotency_key: string;
|
|
58
|
+
readonly run_id: string;
|
|
59
|
+
readonly attempt_id: string;
|
|
60
|
+
readonly attempt_lease_id: string;
|
|
61
|
+
readonly lease_epoch: string;
|
|
62
|
+
readonly account_lane_id: string;
|
|
63
|
+
readonly model_operation_id: string;
|
|
64
|
+
readonly operation_digest: InfinitySha256Digest;
|
|
65
|
+
readonly provider: ManagedProviderIdV1;
|
|
66
|
+
readonly canonical_intent_sha256: InfinitySha256Digest;
|
|
67
|
+
readonly provider_execution_sha256: InfinitySha256Digest;
|
|
68
|
+
readonly source_manifest_sha256: InfinitySha256Digest;
|
|
69
|
+
readonly input_manifest_sha256: InfinitySha256Digest;
|
|
70
|
+
readonly checkpoint_policy_sha256: InfinitySha256Digest;
|
|
71
|
+
readonly prepared_anchor_sha256: InfinitySha256Digest;
|
|
72
|
+
readonly effect_claim_sha256: InfinitySha256Digest;
|
|
73
|
+
readonly sandbox_prepare_anchor_sha256: InfinitySha256Digest;
|
|
74
|
+
readonly consume_receipt_sha256: InfinitySha256Digest;
|
|
75
|
+
readonly consume_tombstone_sha256: InfinitySha256Digest;
|
|
76
|
+
readonly consume_use_id_sha256: InfinitySha256Digest;
|
|
77
|
+
readonly consume_binding_sha256: InfinitySha256Digest;
|
|
78
|
+
readonly authority_epoch: string;
|
|
79
|
+
readonly audience: string;
|
|
80
|
+
readonly issued_at: string;
|
|
81
|
+
readonly expires_at: string;
|
|
82
|
+
readonly signer_ref: string;
|
|
83
|
+
readonly signer_incarnation: string;
|
|
84
|
+
readonly key_id: string;
|
|
85
|
+
readonly signature: string;
|
|
86
|
+
}
|
|
87
|
+
export interface DisposableTaskAuthorityConsumeInputV2 {
|
|
88
|
+
readonly dispatch_id: string;
|
|
89
|
+
readonly canonical_intent_sha256: InfinitySha256Digest;
|
|
90
|
+
readonly sandbox_prepare_anchor_sha256: InfinitySha256Digest;
|
|
91
|
+
readonly authority_envelope_sha256: InfinitySha256Digest;
|
|
92
|
+
readonly operation_digest: InfinitySha256Digest;
|
|
93
|
+
readonly provider: ManagedProviderIdV1;
|
|
94
|
+
readonly source_manifest_sha256: InfinitySha256Digest;
|
|
95
|
+
readonly input_manifest_sha256: InfinitySha256Digest;
|
|
96
|
+
readonly checkpoint_policy_sha256: InfinitySha256Digest;
|
|
97
|
+
readonly effect_claim_sha256: InfinitySha256Digest;
|
|
98
|
+
}
|
|
99
|
+
export interface DisposableTaskAuthorizationConsumptionV2 {
|
|
100
|
+
readonly schema_version: typeof DISPOSABLE_TASK_AUTHORIZATION_CONSUMPTION_SCHEMA_V2;
|
|
101
|
+
readonly dispatch_id: string;
|
|
102
|
+
readonly canonical_intent_sha256: InfinitySha256Digest;
|
|
103
|
+
readonly sandbox_prepare_anchor_sha256: InfinitySha256Digest;
|
|
104
|
+
readonly authority_envelope_sha256: InfinitySha256Digest;
|
|
105
|
+
readonly operation_digest: InfinitySha256Digest;
|
|
106
|
+
readonly provider: ManagedProviderIdV1;
|
|
107
|
+
readonly source_manifest_sha256: InfinitySha256Digest;
|
|
108
|
+
readonly input_manifest_sha256: InfinitySha256Digest;
|
|
109
|
+
readonly checkpoint_policy_sha256: InfinitySha256Digest;
|
|
110
|
+
readonly effect_claim_sha256: InfinitySha256Digest;
|
|
111
|
+
readonly authority_epoch: string;
|
|
112
|
+
readonly run_id: string;
|
|
113
|
+
readonly attempt_id: string;
|
|
114
|
+
readonly attempt_lease_id: string;
|
|
115
|
+
readonly lease_epoch: string;
|
|
116
|
+
readonly model_operation_id: string;
|
|
117
|
+
readonly audience: string;
|
|
118
|
+
readonly issued_at: string;
|
|
119
|
+
readonly consumed_at: string;
|
|
120
|
+
readonly expires_at: string;
|
|
121
|
+
readonly signer_ref: string;
|
|
122
|
+
readonly signer_incarnation: string;
|
|
123
|
+
readonly key_id: string;
|
|
124
|
+
readonly signature: string;
|
|
125
|
+
}
|
|
126
|
+
export interface DisposableTaskAuthorizationArtifactsV2 {
|
|
127
|
+
readonly canonical_authority_envelope_bytes: Uint8Array;
|
|
128
|
+
readonly authority_envelope_sha256: InfinitySha256Digest;
|
|
129
|
+
readonly canonical_receipt_bytes: Uint8Array;
|
|
130
|
+
readonly receipt_sha256: InfinitySha256Digest;
|
|
131
|
+
}
|
|
132
|
+
export interface SandboxDispatchAuthorityPortV2 {
|
|
133
|
+
bindAccountsConsumeEvidence(request: SandboxDispatchAccountsConsumeEvidenceRequestV1): Promise<SandboxDispatchAccountsConsumeEvidenceV1>;
|
|
134
|
+
mintAuthorization(request: SandboxDispatchAuthorizationRequestV2): Promise<SignedSandboxDispatchAuthorizationV2>;
|
|
135
|
+
describe(): Readonly<{
|
|
136
|
+
durability: "durable";
|
|
137
|
+
implementation_sha256: InfinitySha256Digest;
|
|
138
|
+
trust_root_sha256: InfinitySha256Digest;
|
|
139
|
+
}>;
|
|
140
|
+
consumeOnceV2(request: DisposableTaskAuthorityConsumeInputV2): Promise<DisposableTaskAuthorizationArtifactsV2>;
|
|
141
|
+
readAuthorization(dispatchId: string): Promise<SignedSandboxDispatchAuthorizationV2 | null>;
|
|
142
|
+
}
|
|
143
|
+
export declare function parseSandboxDispatchAuthorizationRequestV2(value: unknown): SandboxDispatchAuthorizationRequestV2;
|
|
144
|
+
export declare function parseSandboxDispatchAccountsConsumeEvidenceRequestV1(value: unknown): SandboxDispatchAccountsConsumeEvidenceRequestV1;
|
|
145
|
+
export declare function parseSandboxDispatchAccountsConsumeEvidenceV1(value: unknown): SandboxDispatchAccountsConsumeEvidenceV1;
|
|
146
|
+
export declare function signSandboxDispatchAuthorizationV2(requestValue: SandboxDispatchAuthorizationRequestV2, authorityEpoch: string, issuedAt: string, signer: AccountsOperationEvidenceSigner): SignedSandboxDispatchAuthorizationV2;
|
|
147
|
+
export declare function parseSignedSandboxDispatchAuthorizationV2(value: unknown, signerHistory: InMemoryAccountsOperationSignerHistory): SignedSandboxDispatchAuthorizationV2;
|
|
148
|
+
export declare function parseDisposableTaskAuthorityConsumeInputV2(value: unknown): DisposableTaskAuthorityConsumeInputV2;
|
|
149
|
+
export declare function signDisposableTaskAuthorizationConsumptionV2(authorizationValue: SignedSandboxDispatchAuthorizationV2, requestValue: DisposableTaskAuthorityConsumeInputV2, consumedAt: string, expiresAt: string, signer: AccountsOperationEvidenceSigner): DisposableTaskAuthorizationConsumptionV2;
|
|
150
|
+
export declare function parseDisposableTaskAuthorizationConsumptionV2(value: unknown, signerHistory: InMemoryAccountsOperationSignerHistory): DisposableTaskAuthorizationConsumptionV2;
|
|
151
|
+
export declare function disposableTaskAuthorizationArtifactsV2(authorization: SignedSandboxDispatchAuthorizationV2, receipt: DisposableTaskAuthorizationConsumptionV2): DisposableTaskAuthorizationArtifactsV2;
|
|
152
|
+
export declare function parseDisposableTaskAuthorizationArtifactsV2(value: DisposableTaskAuthorizationArtifactsV2, signerHistory: InMemoryAccountsOperationSignerHistory): DisposableTaskAuthorizationArtifactsV2;
|
|
153
|
+
export declare function sandboxDispatchAuthorizationDigest(value: SignedSandboxDispatchAuthorizationV2): InfinitySha256Digest;
|
|
154
|
+
export declare function disposableTaskAuthorizationConsumptionDigest(value: DisposableTaskAuthorizationConsumptionV2): InfinitySha256Digest;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AuthenticatedFenceContext, BrokerFence } from "../contracts/fence";
|
|
2
|
+
import type { Int64 } from "../core/int64";
|
|
3
|
+
export interface SandboxHandle {
|
|
4
|
+
handle_id: string;
|
|
5
|
+
resource_id: string;
|
|
6
|
+
resource_lifecycle_generation: Int64;
|
|
7
|
+
provider_identity_digest: string;
|
|
8
|
+
creation_receipt_digest: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CreateInertSandboxRequest {
|
|
11
|
+
fence: BrokerFence;
|
|
12
|
+
allocation_token: string;
|
|
13
|
+
image_digest: string;
|
|
14
|
+
resource_policy_digest: string;
|
|
15
|
+
network_policy_digest: string;
|
|
16
|
+
ttl_policy_digest: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ActivateSandboxRequest {
|
|
19
|
+
fence: BrokerFence;
|
|
20
|
+
handle: SandboxHandle;
|
|
21
|
+
}
|
|
22
|
+
export interface DestroySandboxRequest {
|
|
23
|
+
fence: BrokerFence;
|
|
24
|
+
handle: SandboxHandle;
|
|
25
|
+
cleanup_grant_digest: string;
|
|
26
|
+
}
|
|
27
|
+
export interface SandboxAbsenceReceipt {
|
|
28
|
+
handle_id: string;
|
|
29
|
+
resource_id: string;
|
|
30
|
+
resource_lifecycle_generation: Int64;
|
|
31
|
+
absence_receipt_digest: string;
|
|
32
|
+
}
|
|
33
|
+
export interface SandboxesPort {
|
|
34
|
+
createInert(request: CreateInertSandboxRequest, authenticated: AuthenticatedFenceContext): Promise<SandboxHandle>;
|
|
35
|
+
activate(request: ActivateSandboxRequest, authenticated: AuthenticatedFenceContext): Promise<{
|
|
36
|
+
activation_receipt_digest: string;
|
|
37
|
+
}>;
|
|
38
|
+
describe(handle: SandboxHandle): Promise<"inert" | "active" | "absent" | "unknown">;
|
|
39
|
+
destroy(request: DestroySandboxRequest, authenticated: AuthenticatedFenceContext): Promise<SandboxAbsenceReceipt>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { INFINITY_PROVIDER_ACTIVATION_SANDBOXES_COMMIT, type ProviderActivationState, type ProviderProductionAdmission } from "../runtime/provider-activation";
|
|
2
|
+
export declare const INFINITY_SANDBOX_DISPATCH_AUTHORIZATION_REQUEST_SCHEMA_V1: "infinity.sandbox-dispatch-authorization-request.v1";
|
|
3
|
+
export declare const INFINITY_SANDBOX_DISPATCH_AUTHORIZATION_RESULT_SCHEMA_V1: "infinity.sandbox-dispatch-authorization-result.v1";
|
|
4
|
+
export declare const INFINITY_SANDBOX_PROVIDER_DISPATCH_PRODUCTION_ADMISSION_V1: false;
|
|
5
|
+
export type InfinityManagedSandboxProviderV1 = "e2b" | "daytona_cloud";
|
|
6
|
+
export interface SandboxesV2Intent {
|
|
7
|
+
readonly schema_version: "sandboxes.disposable-task-intent/v2";
|
|
8
|
+
readonly provider: InfinityManagedSandboxProviderV1;
|
|
9
|
+
readonly idempotency_key_sha256: string;
|
|
10
|
+
readonly operation_digest: string;
|
|
11
|
+
readonly source_manifest_sha256: string;
|
|
12
|
+
readonly input_manifest_sha256: string;
|
|
13
|
+
readonly environment_image_sha256: string;
|
|
14
|
+
readonly task_bundle_sha256: string;
|
|
15
|
+
readonly network_policy: "deny_all";
|
|
16
|
+
readonly maximum_allocations: 1;
|
|
17
|
+
readonly max_runtime_ms: number;
|
|
18
|
+
readonly files: readonly unknown[];
|
|
19
|
+
readonly exec: Readonly<Record<string, unknown>>;
|
|
20
|
+
readonly checkpoint: Readonly<Record<string, unknown>>;
|
|
21
|
+
}
|
|
22
|
+
export interface SandboxesV2PreparedIntent {
|
|
23
|
+
readonly schema_version: "sandboxes.disposable-task-prepared/v2";
|
|
24
|
+
readonly dispatch_id: string;
|
|
25
|
+
readonly canonical_intent_sha256: string;
|
|
26
|
+
readonly sandbox_prepare_anchor_sha256: string;
|
|
27
|
+
readonly operation_digest: string;
|
|
28
|
+
readonly provider: InfinityManagedSandboxProviderV1;
|
|
29
|
+
readonly source_manifest_sha256: string;
|
|
30
|
+
readonly input_manifest_sha256: string;
|
|
31
|
+
readonly checkpoint_policy_sha256: string;
|
|
32
|
+
readonly effect_claim_sha256: string;
|
|
33
|
+
readonly prepared_sha256: string;
|
|
34
|
+
}
|
|
35
|
+
export interface InfinitySandboxDispatchAuthorizationRequestV1 {
|
|
36
|
+
readonly schema_version: typeof INFINITY_SANDBOX_DISPATCH_AUTHORIZATION_REQUEST_SCHEMA_V1;
|
|
37
|
+
readonly provider: InfinityManagedSandboxProviderV1;
|
|
38
|
+
readonly authority_envelope_sha256: string;
|
|
39
|
+
readonly intent: SandboxesV2Intent;
|
|
40
|
+
readonly prepared: SandboxesV2PreparedIntent;
|
|
41
|
+
}
|
|
42
|
+
export interface SandboxesV2BoundAuthorization {
|
|
43
|
+
readonly schema_version: "sandboxes.disposable-task-bound-authorization/v2";
|
|
44
|
+
readonly dispatch_id: string;
|
|
45
|
+
readonly canonical_intent_sha256: string;
|
|
46
|
+
readonly sandbox_prepare_anchor_sha256: string;
|
|
47
|
+
readonly effect_claim_sha256: string;
|
|
48
|
+
readonly authority_envelope_sha256: string;
|
|
49
|
+
readonly authorization_consumption_receipt_sha256: string;
|
|
50
|
+
readonly dispatch_intent_anchor_sha256: string;
|
|
51
|
+
}
|
|
52
|
+
export interface SandboxesV2AuthorizationPort {
|
|
53
|
+
readonly provider: InfinityManagedSandboxProviderV1;
|
|
54
|
+
readonly production_admission: false;
|
|
55
|
+
authorizePrepared(input: Readonly<{
|
|
56
|
+
intent: SandboxesV2Intent;
|
|
57
|
+
prepared: SandboxesV2PreparedIntent;
|
|
58
|
+
authority_envelope_sha256: string;
|
|
59
|
+
}>): Promise<SandboxesV2BoundAuthorization>;
|
|
60
|
+
}
|
|
61
|
+
export interface InfinitySandboxDispatchAuthorizationResultV1 {
|
|
62
|
+
readonly schema_version: typeof INFINITY_SANDBOX_DISPATCH_AUTHORIZATION_RESULT_SCHEMA_V1;
|
|
63
|
+
readonly provider: InfinityManagedSandboxProviderV1;
|
|
64
|
+
readonly state: "dispatch_intent";
|
|
65
|
+
readonly provider_contacted: false;
|
|
66
|
+
readonly production_dispatch_admitted: false;
|
|
67
|
+
readonly dispatch_id: string;
|
|
68
|
+
readonly canonical_intent_sha256: string;
|
|
69
|
+
readonly sandbox_prepare_anchor_sha256: string;
|
|
70
|
+
readonly effect_claim_sha256: string;
|
|
71
|
+
readonly authority_envelope_sha256: string;
|
|
72
|
+
readonly authorization_consumption_receipt_sha256: string;
|
|
73
|
+
readonly dispatch_intent_anchor_sha256: string;
|
|
74
|
+
}
|
|
75
|
+
export interface InfinityProductionSandboxDispatchResultV1 {
|
|
76
|
+
readonly schema_version: "infinity.production-sandbox-dispatch-result.v1";
|
|
77
|
+
readonly provider: InfinityManagedSandboxProviderV1;
|
|
78
|
+
readonly state: "provider_dispatched";
|
|
79
|
+
readonly provider_contacted: true;
|
|
80
|
+
readonly production_dispatch_admitted: true;
|
|
81
|
+
readonly dispatch_id: string;
|
|
82
|
+
readonly canonical_intent_sha256: string;
|
|
83
|
+
readonly sandbox_prepare_anchor_sha256: string;
|
|
84
|
+
readonly effect_claim_sha256: string;
|
|
85
|
+
readonly authority_envelope_sha256: string;
|
|
86
|
+
readonly authorization_consumption_receipt_sha256: string;
|
|
87
|
+
readonly dispatch_intent_anchor_sha256: string;
|
|
88
|
+
readonly evidence_manifest_sha256: string;
|
|
89
|
+
readonly activation_manifest_sha256: string;
|
|
90
|
+
readonly production_admission_sha256: string;
|
|
91
|
+
readonly provider_effect_journal_receipt_sha256: string;
|
|
92
|
+
readonly adapter_artifact_sha256: string;
|
|
93
|
+
}
|
|
94
|
+
export interface SandboxesV2ProductionDispatchResult {
|
|
95
|
+
readonly schema_version: "sandboxes.disposable-task-production-dispatch/v2";
|
|
96
|
+
readonly provider: InfinityManagedSandboxProviderV1;
|
|
97
|
+
readonly provider_contacted: true;
|
|
98
|
+
readonly production_dispatch_admitted: true;
|
|
99
|
+
readonly dispatch_id: string;
|
|
100
|
+
readonly canonical_intent_sha256: string;
|
|
101
|
+
readonly sandbox_prepare_anchor_sha256: string;
|
|
102
|
+
readonly effect_claim_sha256: string;
|
|
103
|
+
readonly authority_envelope_sha256: string;
|
|
104
|
+
readonly authorization_consumption_receipt_sha256: string;
|
|
105
|
+
readonly dispatch_intent_anchor_sha256: string;
|
|
106
|
+
readonly production_admission_sha256: string;
|
|
107
|
+
readonly provider_effect_journal_receipt_sha256: string;
|
|
108
|
+
}
|
|
109
|
+
export interface SandboxesV2ProductionDispatchPort {
|
|
110
|
+
readonly provider: InfinityManagedSandboxProviderV1;
|
|
111
|
+
readonly production_admission: true;
|
|
112
|
+
readonly sandboxes_source_commit: typeof INFINITY_PROVIDER_ACTIVATION_SANDBOXES_COMMIT;
|
|
113
|
+
readonly evidence_manifest_sha256: string;
|
|
114
|
+
readonly adapter_artifact_sha256: string;
|
|
115
|
+
dispatchAuthorized(input: Readonly<{
|
|
116
|
+
request: InfinitySandboxDispatchAuthorizationRequestV1;
|
|
117
|
+
admission: ProviderProductionAdmission;
|
|
118
|
+
}>): Promise<SandboxesV2ProductionDispatchResult>;
|
|
119
|
+
}
|
|
120
|
+
export declare class InfinitySandboxDispatchAuthorizationService {
|
|
121
|
+
private readonly ports;
|
|
122
|
+
constructor(ports: Readonly<Record<InfinityManagedSandboxProviderV1, SandboxesV2AuthorizationPort>>);
|
|
123
|
+
authorize(value: unknown): Promise<InfinitySandboxDispatchAuthorizationResultV1>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Production gate for the injected Sandboxes adapter boundary. Infinity does
|
|
127
|
+
* not hold provider credentials or contact the provider directly; the selected
|
|
128
|
+
* adapter may be entered only after the reviewed activation manifest mints an
|
|
129
|
+
* exact provider/source/evidence admission.
|
|
130
|
+
*/
|
|
131
|
+
export declare class InfinityProductionSandboxDispatchService {
|
|
132
|
+
#private;
|
|
133
|
+
constructor(input: Readonly<{
|
|
134
|
+
activation: Readonly<ProviderActivationState>;
|
|
135
|
+
runtimeBuildRevision: string;
|
|
136
|
+
authorizedPrincipal: string;
|
|
137
|
+
ports: Readonly<Record<InfinityManagedSandboxProviderV1, SandboxesV2ProductionDispatchPort>>;
|
|
138
|
+
}>);
|
|
139
|
+
authorize(value: unknown, actorPrincipal: string): Promise<Readonly<InfinityProductionSandboxDispatchResultV1>>;
|
|
140
|
+
}
|
|
141
|
+
export declare function productionDispatchServiceAuthorizesPrincipal(service: InfinityProductionSandboxDispatchService | undefined, actorPrincipal: string): boolean;
|
|
142
|
+
export declare function productionDispatchServiceCanAdmit(service: InfinityProductionSandboxDispatchService | undefined, activation: Readonly<ProviderActivationState>, runtimeBuildRevision: string): boolean;
|
|
143
|
+
export declare function parseSandboxDispatchAuthorizationRequestV1(value: unknown): InfinitySandboxDispatchAuthorizationRequestV1;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { AuthorityMutationJournalSigner } from "../authority/mutation-journal";
|
|
2
|
+
import type { EffectJournalSigner } from "../authority/effect-journal";
|
|
3
|
+
export interface SelfHostedRuntimeConfig {
|
|
4
|
+
readonly deploymentMode: "self-hosted";
|
|
5
|
+
readonly hostname: string;
|
|
6
|
+
readonly port: number;
|
|
7
|
+
readonly migrationPolicy: "verify-only";
|
|
8
|
+
readonly buildRevision: string;
|
|
9
|
+
readonly operatorPrincipal: string;
|
|
10
|
+
readonly authorityRestoreDomainId: string;
|
|
11
|
+
readonly externalJournalId: string;
|
|
12
|
+
readonly externalJournalRestoreDomainId: string;
|
|
13
|
+
readonly effectJournalRestoreDomainId: string;
|
|
14
|
+
readonly mutationSignerPrincipal: string;
|
|
15
|
+
readonly mutationSigningKeyId: string;
|
|
16
|
+
readonly effectSignerPrincipal: string;
|
|
17
|
+
readonly effectSigningKeyId: string;
|
|
18
|
+
readonly runtimeRole: string;
|
|
19
|
+
readonly reconcilerRole: string;
|
|
20
|
+
readonly journalAckerRole: string;
|
|
21
|
+
readonly externalJournalRole: string;
|
|
22
|
+
readonly providerActivationManifestFile: string | null;
|
|
23
|
+
readonly secretFiles: Readonly<{
|
|
24
|
+
runtimeDatabaseUrl: string;
|
|
25
|
+
reconcilerDatabaseUrl: string;
|
|
26
|
+
journalAckerDatabaseUrl: string;
|
|
27
|
+
externalJournalDatabaseUrl: string;
|
|
28
|
+
operatorToken: string;
|
|
29
|
+
mutationSigningKey: string;
|
|
30
|
+
effectSigningKey: string;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
export interface SelfHostedMigrationConfig {
|
|
34
|
+
readonly primaryMigratorDatabaseUrlFile: string;
|
|
35
|
+
readonly externalJournalMigratorDatabaseUrlFile: string;
|
|
36
|
+
readonly mutationSigningKeyFile: string;
|
|
37
|
+
readonly externalJournalId: string;
|
|
38
|
+
readonly externalJournalRestoreDomainId: string;
|
|
39
|
+
readonly mutationSignerPrincipal: string;
|
|
40
|
+
readonly mutationSigningKeyId: string;
|
|
41
|
+
readonly runtimeRole: string;
|
|
42
|
+
readonly reconcilerRole: string;
|
|
43
|
+
readonly journalAckerRole: string;
|
|
44
|
+
readonly externalJournalRole: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function loadSelfHostedMigrationConfig(environment: Readonly<Record<string, string | undefined>>): Readonly<SelfHostedMigrationConfig>;
|
|
47
|
+
export declare function loadSelfHostedRuntimeConfig(environment: Readonly<Record<string, string | undefined>>): Readonly<SelfHostedRuntimeConfig>;
|
|
48
|
+
export declare class FileEd25519Signer implements AuthorityMutationJournalSigner, EffectJournalSigner {
|
|
49
|
+
readonly signerPrincipal: string;
|
|
50
|
+
readonly signingKeyId: string;
|
|
51
|
+
private readonly privateKey;
|
|
52
|
+
private readonly publicKey;
|
|
53
|
+
private constructor();
|
|
54
|
+
static open(path: string, principalInput: string, keyIdInput: string): FileEd25519Signer;
|
|
55
|
+
publicKeySpki(): string;
|
|
56
|
+
sign(payload: string): string;
|
|
57
|
+
verify(payload: string, signature: string): boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare function assertOwnerOnlySecretFile(path: string, label: string): void;
|
|
60
|
+
export declare function readOwnerOnlySecretFile(path: string, label: string): Buffer;
|
|
61
|
+
export declare function readPostgresUrlFile(path: string, label: string): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BearerTokenFileAuthenticator } from "../http/bearer-auth";
|
|
2
|
+
import { type SelfHostedRuntimeConfig } from "./config";
|
|
3
|
+
import type { InfinityProductionSandboxDispatchService } from "../providers/sandbox-dispatch";
|
|
4
|
+
export declare function createSelfHostedPostgresRuntime(config: Readonly<SelfHostedRuntimeConfig>, providerDispatch?: InfinityProductionSandboxDispatchService): Promise<{
|
|
5
|
+
readonly api: import("..").AuthorityApi;
|
|
6
|
+
readonly authenticator: BearerTokenFileAuthenticator;
|
|
7
|
+
readonly composition: {
|
|
8
|
+
readonly authority: import("..").PostgresRunAuthority;
|
|
9
|
+
readonly accountsOperation: import("..").InfinityAccountsOperationPort | null;
|
|
10
|
+
readonly accountsScheduler: import("../persistence/postgres-accounts-operation").AccountsSchedulerClaimPort | null;
|
|
11
|
+
readonly sandboxDispatchAuthority: import("..").SandboxDispatchAuthorityPortV2 | null;
|
|
12
|
+
readonly reconciler: import("..").PostgresReconciler;
|
|
13
|
+
readonly mutationJournal: import("..").PostgresMutationJournalCoordinator;
|
|
14
|
+
readonly api: import("..").AuthorityApi;
|
|
15
|
+
};
|
|
16
|
+
readonly readinessProbe: () => Promise<boolean>;
|
|
17
|
+
readonly close: () => Promise<void>;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const INFINITY_PROVIDER_ACTIVATION_SCHEMA_VERSION: "infinity.provider-production-activation/v1";
|
|
2
|
+
export declare const INFINITY_PROVIDER_ACTIVATION_INFINITY_COMMIT: "952dd7a9a646f16fed9653bab170032db61e0353";
|
|
3
|
+
export declare const INFINITY_PROVIDER_ACTIVATION_SANDBOXES_COMMIT: "8b71a53b9b44bbdf0f7a9536d4f2b7bfeaa0edda";
|
|
4
|
+
export declare const INFINITY_PROVIDER_E2B_EVIDENCE_MANIFEST_SHA256: "sha256:e7e68d1c4f48be2d4ea397fe3cfe7969094ece4a69ef1fbc8548d320e65bc298";
|
|
5
|
+
export declare const INFINITY_PROVIDER_DAYTONA_EVIDENCE_MANIFEST_SHA256: "sha256:b2b26f5ef95224efe93885381e57a62f6ca94da20f36f6921b6dcde8e2100f20";
|
|
6
|
+
export declare const INFINITY_PROVIDER_E2B_ADAPTER_ARTIFACT_SHA256: "sha256:ab9e312b7be170a19382028642fa688d7d700d6555b5c04cb4baf6e51c5ebd19";
|
|
7
|
+
export declare const INFINITY_PROVIDER_DAYTONA_ADAPTER_ARTIFACT_SHA256: "sha256:8c3ffa92eb833c4d2fe6f623e056cd96f66af6394f6ac2ad61e01b1570339aad";
|
|
8
|
+
export interface ProviderActivationState {
|
|
9
|
+
readonly schema_version: typeof INFINITY_PROVIDER_ACTIVATION_SCHEMA_VERSION;
|
|
10
|
+
readonly infinity_source_commit: typeof INFINITY_PROVIDER_ACTIVATION_INFINITY_COMMIT;
|
|
11
|
+
readonly sandboxes_source_commit: typeof INFINITY_PROVIDER_ACTIVATION_SANDBOXES_COMMIT;
|
|
12
|
+
readonly providers: Readonly<{
|
|
13
|
+
e2b: Readonly<ProviderActivationEntry>;
|
|
14
|
+
daytona_cloud: Readonly<ProviderActivationEntry>;
|
|
15
|
+
}>;
|
|
16
|
+
readonly activation_manifest_sha256: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ProviderActivationEntry {
|
|
19
|
+
readonly activation_requested: boolean;
|
|
20
|
+
readonly activation_eligible: boolean;
|
|
21
|
+
readonly evidence_manifest_sha256: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface ProviderProductionAdmission {
|
|
24
|
+
readonly schema_version: "infinity.provider-production-admission/v1";
|
|
25
|
+
readonly provider: "e2b" | "daytona_cloud";
|
|
26
|
+
readonly tested_infinity_source_commit: typeof INFINITY_PROVIDER_ACTIVATION_INFINITY_COMMIT;
|
|
27
|
+
readonly tested_sandboxes_source_commit: typeof INFINITY_PROVIDER_ACTIVATION_SANDBOXES_COMMIT;
|
|
28
|
+
readonly evidence_manifest_sha256: string;
|
|
29
|
+
readonly activation_manifest_sha256: string;
|
|
30
|
+
readonly runtime_build_revision: string;
|
|
31
|
+
readonly actor_principal: string;
|
|
32
|
+
readonly dispatch_request_sha256: string;
|
|
33
|
+
readonly adapter_artifact_sha256: string;
|
|
34
|
+
readonly admission_sha256: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function defaultProviderActivation(): Readonly<ProviderActivationState>;
|
|
37
|
+
export declare function loadProviderActivationManifest(path: string | null): Readonly<ProviderActivationState>;
|
|
38
|
+
export declare function parseProviderActivationManifest(value: unknown): Readonly<ProviderActivationState>;
|
|
39
|
+
export declare function authorizeProviderProductionAdmission(activation: Readonly<ProviderActivationState>, provider: "e2b" | "daytona_cloud", context: Readonly<{
|
|
40
|
+
runtime_build_revision: string;
|
|
41
|
+
actor_principal: string;
|
|
42
|
+
dispatch_request_sha256: string;
|
|
43
|
+
adapter_artifact_sha256: string;
|
|
44
|
+
}>): Readonly<ProviderProductionAdmission>;
|
|
45
|
+
export declare function providerActivationHasEligibleProductionProvider(activation: Readonly<ProviderActivationState>): boolean;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { AuthorityApi, OperatorAuthenticator } from "../http/api";
|
|
2
|
+
import { type InfinityProductionSandboxDispatchService } from "../providers/sandbox-dispatch";
|
|
3
|
+
import { type ProviderActivationState } from "./provider-activation";
|
|
4
|
+
export declare const EMBEDDED_BUILD_REVISION: string | null;
|
|
5
|
+
export interface RuntimeAuditRecord {
|
|
6
|
+
readonly event: "http_request";
|
|
7
|
+
readonly timestamp: string;
|
|
8
|
+
readonly request_id: string;
|
|
9
|
+
readonly method: string;
|
|
10
|
+
readonly route: string;
|
|
11
|
+
readonly status: number;
|
|
12
|
+
readonly duration_ms: number;
|
|
13
|
+
readonly authenticated_principal?: string;
|
|
14
|
+
}
|
|
15
|
+
export type RuntimeAuditSink = (record: Readonly<RuntimeAuditRecord>) => void;
|
|
16
|
+
export interface SelfHostedRuntimeReport {
|
|
17
|
+
readonly schema_version: "infinity.self-hosted-runtime-report/v1";
|
|
18
|
+
readonly infinity_version: string;
|
|
19
|
+
readonly build_revision: string;
|
|
20
|
+
readonly deployment_mode: "self-hosted";
|
|
21
|
+
readonly operator_schema: string;
|
|
22
|
+
readonly postgres: Readonly<{
|
|
23
|
+
source_of_truth: true;
|
|
24
|
+
startup_migration_policy: "verify-only";
|
|
25
|
+
migration_manifest_sha256: string;
|
|
26
|
+
}>;
|
|
27
|
+
readonly authentication: Readonly<{
|
|
28
|
+
mode: "bearer-token-file";
|
|
29
|
+
fail_closed: true;
|
|
30
|
+
}>;
|
|
31
|
+
readonly provider_dispatch: Readonly<{
|
|
32
|
+
production_admission: boolean;
|
|
33
|
+
live_composed_evidence_required: true;
|
|
34
|
+
activation: Readonly<ProviderActivationState>;
|
|
35
|
+
}>;
|
|
36
|
+
readonly execution: Readonly<{
|
|
37
|
+
untrusted_code_execution: false;
|
|
38
|
+
subprocess_capability: false;
|
|
39
|
+
provider_effect_journal: "disabled-empty-frontier" | "production-adapter-enforced";
|
|
40
|
+
}>;
|
|
41
|
+
readonly runtime_report_sha256: string;
|
|
42
|
+
}
|
|
43
|
+
export declare function createRuntimeReport(input: {
|
|
44
|
+
buildRevision: string;
|
|
45
|
+
providerActivation?: Readonly<ProviderActivationState>;
|
|
46
|
+
providerDispatch?: InfinityProductionSandboxDispatchService;
|
|
47
|
+
}): Readonly<SelfHostedRuntimeReport>;
|
|
48
|
+
export declare function assertBuildRevisionMatches(declared: string, embedded: string | null): string;
|
|
49
|
+
export declare function assertPostgresMigrationState(state: readonly {
|
|
50
|
+
migration_name: string;
|
|
51
|
+
checksum: string;
|
|
52
|
+
}[]): readonly {
|
|
53
|
+
migration_name: string;
|
|
54
|
+
checksum: string;
|
|
55
|
+
}[];
|
|
56
|
+
export declare function createSelfHostedRuntimeHandler(input: {
|
|
57
|
+
readonly api: AuthorityApi;
|
|
58
|
+
readonly authenticator: OperatorAuthenticator;
|
|
59
|
+
readonly report: Readonly<SelfHostedRuntimeReport>;
|
|
60
|
+
readonly readinessProbe: () => Promise<boolean>;
|
|
61
|
+
readonly audit: RuntimeAuditSink;
|
|
62
|
+
}): {
|
|
63
|
+
readonly report: Readonly<SelfHostedRuntimeReport>;
|
|
64
|
+
readonly markReady: () => void;
|
|
65
|
+
readonly markNotReady: () => void;
|
|
66
|
+
readonly beginShutdown: () => void;
|
|
67
|
+
readonly fetch: (request: Request) => Promise<Response>;
|
|
68
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Clock } from "../core/clock";
|
|
2
|
+
import type { AccountsOnlineGenerationContext, AccountsSlotEligibilityPort, AllowedOnlineGenerationCheckReceipt, SlotEligibility, SlotEligibilityRequest } from "../ports/accounts";
|
|
3
|
+
export declare class DeterministicAccountsPort implements AccountsSlotEligibilityPort {
|
|
4
|
+
private readonly clock;
|
|
5
|
+
unavailable: boolean;
|
|
6
|
+
denyGeneration: number;
|
|
7
|
+
issuedAtOffsetMs: number;
|
|
8
|
+
lifetimeMs: number;
|
|
9
|
+
maxConcurrency: number;
|
|
10
|
+
capacityGeneration: number;
|
|
11
|
+
credentialGeneration: number;
|
|
12
|
+
nativeSession: boolean;
|
|
13
|
+
effectNamespaceId: string;
|
|
14
|
+
providerAccountId: string;
|
|
15
|
+
capacityPoolId: string;
|
|
16
|
+
serializationKey: string;
|
|
17
|
+
ownerRef: string;
|
|
18
|
+
capsuleAttestedAtOffsetMs: number;
|
|
19
|
+
capsuleAttestationLifetimeMs: number;
|
|
20
|
+
lastEligibilityRequest: SlotEligibilityRequest | null;
|
|
21
|
+
lastOnlineContext: AccountsOnlineGenerationContext | null;
|
|
22
|
+
onlineChecks: number;
|
|
23
|
+
onlineReceiptMutator: ((receipt: AllowedOnlineGenerationCheckReceipt) => unknown) | null;
|
|
24
|
+
afterOnlineReceipt: (() => void) | null;
|
|
25
|
+
constructor(clock: Clock);
|
|
26
|
+
getSlotEligibility(request: SlotEligibilityRequest): Promise<SlotEligibility>;
|
|
27
|
+
checkOnlineGeneration(request: {
|
|
28
|
+
readonly expectedSlotEligibility: SlotEligibility;
|
|
29
|
+
readonly context: AccountsOnlineGenerationContext;
|
|
30
|
+
}): Promise<AllowedOnlineGenerationCheckReceipt>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type KeyObject } from "node:crypto";
|
|
2
|
+
import { type NodeAgentCommandCore, type NodeAgentHeartbeat, type NodeAgentReceipt, type NodeAgentRegistration, type NodeAgentTransportPolicy, type NodeControlPlaneSession, type NodeControlPlaneTransport, type SignedNodeAgentCommand } from "../node-agent/contracts";
|
|
3
|
+
/** Deterministic in-process protocol peer; it opens no socket and is suitable for contract tests. */
|
|
4
|
+
export declare class InProcessNodeControlPlane implements NodeControlPlaneTransport {
|
|
5
|
+
#private;
|
|
6
|
+
readonly registrations: NodeAgentRegistration[];
|
|
7
|
+
readonly heartbeats: NodeAgentHeartbeat[];
|
|
8
|
+
readonly receipts: NodeAgentReceipt[];
|
|
9
|
+
presentedServerSpkiSha256: string;
|
|
10
|
+
constructor(input: Readonly<{
|
|
11
|
+
transport_policy: NodeAgentTransportPolicy;
|
|
12
|
+
command_private_key: KeyObject;
|
|
13
|
+
}>);
|
|
14
|
+
sign(value: NodeAgentCommandCore): SignedNodeAgentCommand;
|
|
15
|
+
enqueue(command: SignedNodeAgentCommand): void;
|
|
16
|
+
connect(input: Readonly<{
|
|
17
|
+
transport_policy: NodeAgentTransportPolicy;
|
|
18
|
+
registration: NodeAgentRegistration;
|
|
19
|
+
}>): Promise<NodeControlPlaneSession>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InMemoryRunAuthority } from "../authority/authority";
|
|
2
|
+
import { DeterministicFaultInjector, InMemoryAuthorityStore } from "../authority/store";
|
|
3
|
+
import { FakeClock } from "../core/clock";
|
|
4
|
+
import { DeterministicIdFactory } from "../core/ids";
|
|
5
|
+
import { DeterministicAccountsPort } from "./accounts-fake";
|
|
6
|
+
import { Ed25519AuthorityMutationJournalVerifier, InMemoryAuthorityMutationJournal } from "../authority/mutation-journal";
|
|
7
|
+
import { Ed25519AccountsOperationEvidenceSigner, InMemoryAccountsOperationSignerHistory } from "../ports/accounts-operation";
|
|
8
|
+
export declare const TEST_ACCOUNTS_ELIGIBILITY_REQUEST: Readonly<{
|
|
9
|
+
schema_version: "accounts.eligibility-request.v1";
|
|
10
|
+
account_lane_id: "0198a0a0-0000-7000-8000-000000000002";
|
|
11
|
+
data_classification: "internal";
|
|
12
|
+
destination_policy_class: "managed_isolated";
|
|
13
|
+
model: "provider-model-1";
|
|
14
|
+
operation: "generate";
|
|
15
|
+
}>;
|
|
16
|
+
export declare function createReferenceAuthority(): {
|
|
17
|
+
authority: InMemoryRunAuthority;
|
|
18
|
+
clock: FakeClock;
|
|
19
|
+
ids: DeterministicIdFactory;
|
|
20
|
+
faults: DeterministicFaultInjector;
|
|
21
|
+
store: InMemoryAuthorityStore;
|
|
22
|
+
accounts: DeterministicAccountsPort;
|
|
23
|
+
accountsOperationSigner: Ed25519AccountsOperationEvidenceSigner;
|
|
24
|
+
accountsOperationSignerHistory: InMemoryAccountsOperationSignerHistory;
|
|
25
|
+
mutationJournal: InMemoryAuthorityMutationJournal;
|
|
26
|
+
mutationJournalVerifier: Ed25519AuthorityMutationJournalVerifier;
|
|
27
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type AuthenticatedFenceContext, type BrokerFence } from "../contracts/fence";
|
|
2
|
+
import type { ActivateSandboxRequest, CreateInertSandboxRequest, DestroySandboxRequest, SandboxAbsenceReceipt, SandboxHandle, SandboxesPort } from "../ports/sandboxes";
|
|
3
|
+
export declare class DeterministicSandboxesPort implements SandboxesPort {
|
|
4
|
+
readonly calls: string[];
|
|
5
|
+
private readonly resources;
|
|
6
|
+
private readonly currentFences;
|
|
7
|
+
private readonly cleanupGrants;
|
|
8
|
+
private readonly creations;
|
|
9
|
+
private readonly activations;
|
|
10
|
+
private readonly destructions;
|
|
11
|
+
registerCurrentFence(fence: BrokerFence): void;
|
|
12
|
+
registerCleanupGrant(operationIdInput: string, cleanupGrantDigestInput: string): void;
|
|
13
|
+
createInert(request: CreateInertSandboxRequest, authenticated: AuthenticatedFenceContext): Promise<SandboxHandle>;
|
|
14
|
+
activate(request: ActivateSandboxRequest, authenticated: AuthenticatedFenceContext): Promise<{
|
|
15
|
+
activation_receipt_digest: string;
|
|
16
|
+
}>;
|
|
17
|
+
describe(handle: SandboxHandle): Promise<"inert" | "active" | "absent" | "unknown">;
|
|
18
|
+
destroy(request: DestroySandboxRequest, authenticated: AuthenticatedFenceContext): Promise<SandboxAbsenceReceipt>;
|
|
19
|
+
private requireAuthorized;
|
|
20
|
+
private requireExactHandle;
|
|
21
|
+
private handlesEqual;
|
|
22
|
+
}
|