@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.
Files changed (112) hide show
  1. package/LICENSE +3 -0
  2. package/README.md +331 -0
  3. package/dist/cli.js +2965 -0
  4. package/dist/http-api.js +6448 -0
  5. package/dist/index.js +28536 -0
  6. package/dist/migrate.js +346 -0
  7. package/dist/self-hosted-migrate.js +2064 -0
  8. package/dist/self-hosted.js +13180 -0
  9. package/dist/types/authcapsules/codewith-local.d.ts +109 -0
  10. package/dist/types/authcapsules/infinity-agent-policy.d.ts +57 -0
  11. package/dist/types/authcapsules/os-isolated-runner.d.ts +87 -0
  12. package/dist/types/authority/authority.d.ts +342 -0
  13. package/dist/types/authority/effect-journal.d.ts +205 -0
  14. package/dist/types/authority/mutation-journal.d.ts +163 -0
  15. package/dist/types/authority/mutation-tuple.d.ts +26 -0
  16. package/dist/types/authority/state.d.ts +75 -0
  17. package/dist/types/authority/store.d.ts +15 -0
  18. package/dist/types/brokers/checkpoint/archive.d.ts +21 -0
  19. package/dist/types/brokers/checkpoint/bundle.d.ts +22 -0
  20. package/dist/types/brokers/checkpoint/bytes.d.ts +4 -0
  21. package/dist/types/brokers/checkpoint/clean-verifier-finalization.d.ts +62 -0
  22. package/dist/types/brokers/checkpoint/clean-verifier.d.ts +145 -0
  23. package/dist/types/brokers/checkpoint/final-trust-authority.d.ts +55 -0
  24. package/dist/types/brokers/checkpoint/idempotency.d.ts +25 -0
  25. package/dist/types/brokers/checkpoint/journaled-store.d.ts +9 -0
  26. package/dist/types/brokers/checkpoint/manifest-signature.d.ts +135 -0
  27. package/dist/types/brokers/checkpoint/manifest.d.ts +57 -0
  28. package/dist/types/brokers/checkpoint/s3-store.d.ts +215 -0
  29. package/dist/types/brokers/checkpoint/seal-authority.d.ts +86 -0
  30. package/dist/types/brokers/checkpoint/service.d.ts +198 -0
  31. package/dist/types/brokers/checkpoint/signing-message.d.ts +22 -0
  32. package/dist/types/brokers/checkpoint/store.d.ts +76 -0
  33. package/dist/types/brokers/checkpoint/verifier-cleanup-authority.d.ts +108 -0
  34. package/dist/types/brokers/checkpoint/verifier-cleanup.d.ts +391 -0
  35. package/dist/types/brokers/checkpoint/verifier.d.ts +225 -0
  36. package/dist/types/brokers/composition.d.ts +86 -0
  37. package/dist/types/brokers/git/github-app.d.ts +216 -0
  38. package/dist/types/brokers/git/promotion.d.ts +418 -0
  39. package/dist/types/brokers/persistence/contracts.d.ts +77 -0
  40. package/dist/types/brokers/persistence/memory.d.ts +5 -0
  41. package/dist/types/brokers/persistence/migration.d.ts +6 -0
  42. package/dist/types/brokers/persistence/postgres.d.ts +74 -0
  43. package/dist/types/cli/main.d.ts +2 -0
  44. package/dist/types/cli/operation-journal.d.ts +47 -0
  45. package/dist/types/cli/run.d.ts +15 -0
  46. package/dist/types/client/operator-client.d.ts +100 -0
  47. package/dist/types/contracts/dtos.d.ts +198 -0
  48. package/dist/types/contracts/events.d.ts +45 -0
  49. package/dist/types/contracts/fence.d.ts +39 -0
  50. package/dist/types/contracts/operations.d.ts +91 -0
  51. package/dist/types/contracts/runspec.d.ts +75 -0
  52. package/dist/types/contracts/validators.d.ts +8 -0
  53. package/dist/types/core/clock.d.ts +12 -0
  54. package/dist/types/core/errors.d.ts +18 -0
  55. package/dist/types/core/ids.d.ts +10 -0
  56. package/dist/types/core/int64.d.ts +7 -0
  57. package/dist/types/core/strict-json.d.ts +8 -0
  58. package/dist/types/core/validation.d.ts +25 -0
  59. package/dist/types/golden/disposable-task.d.ts +108 -0
  60. package/dist/types/golden/source-pins.d.ts +77 -0
  61. package/dist/types/http/api.d.ts +52 -0
  62. package/dist/types/http/bearer-auth.d.ts +8 -0
  63. package/dist/types/http/main.d.ts +3 -0
  64. package/dist/types/http/self-hosted-main.d.ts +17 -0
  65. package/dist/types/index.d.ts +65 -0
  66. package/dist/types/mcp/schema.d.ts +7 -0
  67. package/dist/types/node-agent/agent.d.ts +174 -0
  68. package/dist/types/node-agent/contracts.d.ts +119 -0
  69. package/dist/types/node-agent/macos-service.d.ts +33 -0
  70. package/dist/types/node-agent/service-cli.d.ts +26 -0
  71. package/dist/types/persistence/composition.d.ts +49 -0
  72. package/dist/types/persistence/migrate-main.d.ts +2 -0
  73. package/dist/types/persistence/migrations.d.ts +30 -0
  74. package/dist/types/persistence/postgres-accounts-operation.d.ts +26 -0
  75. package/dist/types/persistence/postgres-authority.d.ts +69 -0
  76. package/dist/types/persistence/postgres-external-mutation-journal.d.ts +22 -0
  77. package/dist/types/persistence/postgres-json.d.ts +1 -0
  78. package/dist/types/persistence/postgres-mutation-journal.d.ts +31 -0
  79. package/dist/types/persistence/postgres-reconciler.d.ts +34 -0
  80. package/dist/types/persistence/postgres-sandbox-dispatch-authority.d.ts +9 -0
  81. package/dist/types/persistence/self-hosted-migrate-main.d.ts +2 -0
  82. package/dist/types/ports/accounts-operation.d.ts +336 -0
  83. package/dist/types/ports/accounts.d.ts +293 -0
  84. package/dist/types/ports/sandbox-dispatch-authority.d.ts +154 -0
  85. package/dist/types/ports/sandboxes.d.ts +40 -0
  86. package/dist/types/providers/sandbox-dispatch.d.ts +143 -0
  87. package/dist/types/runtime/config.d.ts +61 -0
  88. package/dist/types/runtime/postgres.d.ts +18 -0
  89. package/dist/types/runtime/provider-activation.d.ts +45 -0
  90. package/dist/types/runtime/server.d.ts +68 -0
  91. package/dist/types/testing/accounts-fake.d.ts +31 -0
  92. package/dist/types/testing/fakes.d.ts +2 -0
  93. package/dist/types/testing/node-control-plane-fake.d.ts +20 -0
  94. package/dist/types/testing/reference.d.ts +27 -0
  95. package/dist/types/testing/sandboxes-fake.d.ts +22 -0
  96. package/evidence/provider-live-daytona-v3.json +1 -0
  97. package/evidence/provider-live-e2b-v3.json +1 -0
  98. package/evidence/provider-production-route-daytona-v1.json +1 -0
  99. package/evidence/provider-production-route-e2b-v1.json +1 -0
  100. package/migrations/0001_authority.sql +689 -0
  101. package/migrations/0002_effect_step_global_owner.sql +2 -0
  102. package/migrations/0003_effect_journal_observed_head.sql +34 -0
  103. package/migrations/0004_authority_mutation_journal_binding.sql +15 -0
  104. package/migrations/20260710_checkpoint_broker_v1.sql +163 -0
  105. package/migrations/20260711_accounts_operation_v1.sql +137 -0
  106. package/migrations/20260711_checkpoint_trust_v2.sql +17 -0
  107. package/migrations/20260711_verifier_cleanup_v2.sql +169 -0
  108. package/migrations/20260711_z_accounts_claim_authority_v2.sql +172 -0
  109. package/migrations/20260711_zz_sandbox_dispatch_authority_v1.sql +143 -0
  110. package/migrations/20260712_sandbox_dispatch_authority_v2.sql +58 -0
  111. package/migrations/external-journal/0001_external_authority_mutation_journal.sql +175 -0
  112. package/package.json +47 -0
@@ -0,0 +1,108 @@
1
+ import type { InfinityAccountsOperationRecoveryPort, VerifiedConsumeBoundOperation } from "../ports/accounts-operation";
2
+ import { type SandboxDispatchAuthorityPortV2 } from "../ports/sandbox-dispatch-authority";
3
+ export type GoldenDigestV1 = `sha256:${string}`;
4
+ export declare const GOLDEN_SOURCE_PIN_SET_SHA256: GoldenDigestV1;
5
+ export interface GoldenDisposableTaskRequestV1 {
6
+ readonly schema_version: "infinity.golden-disposable-task-request/v1";
7
+ readonly invocation_nonce_sha256: GoldenDigestV1;
8
+ readonly task_invocation_sha256: GoldenDigestV1;
9
+ readonly authority_binding_sha256: GoldenDigestV1;
10
+ readonly prepared_anchor_sha256: GoldenDigestV1;
11
+ readonly consume_request_sha256: GoldenDigestV1;
12
+ readonly source_pin_set_sha256: typeof GOLDEN_SOURCE_PIN_SET_SHA256;
13
+ readonly environment_sha256: GoldenDigestV1;
14
+ readonly checkpoint_policy_sha256: GoldenDigestV1;
15
+ }
16
+ export interface GoldenAccountsConsumeResultV1 {
17
+ readonly receiptBytes: Uint8Array;
18
+ readonly replayed: boolean;
19
+ readonly bindingCurrent: boolean;
20
+ readonly consumeReceiptDigest: GoldenDigestV1;
21
+ readonly tombstoneBytes: Uint8Array;
22
+ readonly tombstoneDigest: GoldenDigestV1;
23
+ readonly useId: GoldenDigestV1;
24
+ readonly consumeBound?: VerifiedConsumeBoundOperation;
25
+ }
26
+ export interface GoldenAccountsConsumePortV1 {
27
+ consume(input: unknown): Promise<GoldenAccountsConsumeResultV1>;
28
+ }
29
+ export interface GoldenAccountsConsumeInputV1 {
30
+ readonly consumeRequestBytes: Uint8Array;
31
+ readonly [key: string]: unknown;
32
+ }
33
+ export interface TrustedGoldenAccountsConsumeEvidenceV1 {
34
+ readonly schema_version: "infinity.trusted-accounts-consume-evidence.v1";
35
+ readonly model_operation_id: string;
36
+ readonly consume_receipt_sha256: GoldenDigestV1;
37
+ readonly consume_tombstone_sha256: GoldenDigestV1;
38
+ readonly consume_use_id_sha256: GoldenDigestV1;
39
+ readonly consume_binding_sha256: GoldenDigestV1;
40
+ readonly receipt_bytes_sha256: GoldenDigestV1;
41
+ readonly tombstone_bytes_sha256: GoldenDigestV1;
42
+ }
43
+ interface AuthorizedGoldenTaskEvidenceV1 {
44
+ readonly prepared_anchor_sha256: GoldenDigestV1;
45
+ readonly consume_receipt_sha256: GoldenDigestV1;
46
+ readonly consume_binding_sha256: GoldenDigestV1;
47
+ }
48
+ export interface InfinityDisposableTaskAuthorityPortV1 {
49
+ authorize(request: GoldenDisposableTaskRequestV1): Promise<AuthorizedGoldenTaskEvidenceV1>;
50
+ }
51
+ export declare function createInfinityDisposableTaskAuthorityPortV1(input: Readonly<{
52
+ accounts: GoldenAccountsConsumePortV1;
53
+ accountsConsumeInput: GoldenAccountsConsumeInputV1;
54
+ infinity: Pick<InfinityAccountsOperationRecoveryPort, "readConsumeBoundOperation" | "assertPreparedOpenCurrent" | "bindCapabilityUse" | "assertConsumeBoundCurrent">;
55
+ prepared: VerifiedConsumeBoundOperation["prepared"];
56
+ accountsEvidenceBinding: Readonly<{
57
+ port: Pick<SandboxDispatchAuthorityPortV2, "bindAccountsConsumeEvidence">;
58
+ bindOperationId: string;
59
+ idempotencyKey: string;
60
+ }>;
61
+ }>): InfinityDisposableTaskAuthorityPortV1;
62
+ export declare function assertTrustedGoldenAccountsConsumeEvidenceV1(value: object): TrustedGoldenAccountsConsumeEvidenceV1;
63
+ export interface GoldenSandboxTaskRequestV1 {
64
+ readonly schema_version: "sandboxes.disposable-task-request/v1";
65
+ readonly invocation_nonce_sha256: GoldenDigestV1;
66
+ readonly authority_envelope_sha256: GoldenDigestV1;
67
+ readonly source_manifest_sha256: GoldenDigestV1;
68
+ readonly input_manifest_sha256: GoldenDigestV1;
69
+ }
70
+ export interface GoldenSandboxTaskReceiptV1 {
71
+ readonly schema_version: "sandboxes.disposable-task-receipt/v1";
72
+ readonly request_sha256: GoldenDigestV1;
73
+ readonly authority_envelope_sha256: GoldenDigestV1;
74
+ readonly source_manifest_sha256: GoldenDigestV1;
75
+ readonly input_manifest_sha256: GoldenDigestV1;
76
+ readonly task_result_sha256: GoldenDigestV1;
77
+ readonly checkpoint_handoff_sha256: GoldenDigestV1;
78
+ readonly absence_evidence_sha256: GoldenDigestV1;
79
+ readonly destroyed: true;
80
+ readonly absent_by_get: true;
81
+ readonly absent_by_list: true;
82
+ readonly replayed: boolean;
83
+ }
84
+ export interface GoldenDisposableSandboxTaskPortV1 {
85
+ runDisposableTask(request: GoldenSandboxTaskRequestV1): Promise<GoldenSandboxTaskReceiptV1>;
86
+ }
87
+ export interface GoldenDisposableTaskReceiptV1 {
88
+ readonly schema_version: "infinity.golden-disposable-task-receipt/v1";
89
+ readonly source_pin_set_sha256: GoldenDigestV1;
90
+ readonly authority_binding_sha256: GoldenDigestV1;
91
+ readonly prepared_anchor_sha256: GoldenDigestV1;
92
+ readonly consume_receipt_sha256: GoldenDigestV1;
93
+ readonly consume_binding_sha256: GoldenDigestV1;
94
+ readonly authority_envelope_sha256: GoldenDigestV1;
95
+ readonly sandbox_request_sha256: GoldenDigestV1;
96
+ readonly task_result_sha256: GoldenDigestV1;
97
+ readonly checkpoint_handoff_sha256: GoldenDigestV1;
98
+ readonly absence_evidence_sha256: GoldenDigestV1;
99
+ readonly destroyed: true;
100
+ readonly absent_by_get: true;
101
+ readonly absent_by_list: true;
102
+ readonly receipt_sha256: GoldenDigestV1;
103
+ }
104
+ export declare function runGoldenDisposableTaskV1(input: GoldenDisposableTaskRequestV1, ports: Readonly<{
105
+ authority: InfinityDisposableTaskAuthorityPortV1;
106
+ sandboxes: GoldenDisposableSandboxTaskPortV1;
107
+ }>): Promise<GoldenDisposableTaskReceiptV1>;
108
+ export {};
@@ -0,0 +1,77 @@
1
+ export declare const GOLDEN_BUILD_RECIPE_V1: Readonly<{
2
+ readonly schema_version: "infinity.golden-build-recipe/v1";
3
+ readonly git: Readonly<{
4
+ path: "/usr/bin/git";
5
+ version: "2.43.0";
6
+ executable_sha256: "sha256:aa6540695d076182256dd6e96c8b302e4d56381e3000bbfd5c71bbdfe94a4942";
7
+ }>;
8
+ readonly bun: Readonly<{
9
+ version: "1.3.13";
10
+ executable_sha256: "sha256:67892bb6734ef352f90a964f0a2a680d5f6e6d15bdb5510e56b8065ac4d599ae";
11
+ }>;
12
+ readonly umask: "0022";
13
+ readonly source_materialization: "git archive <commit> into fresh mode-0700 root";
14
+ readonly commands: readonly string[];
15
+ readonly consumer_commands: readonly string[];
16
+ readonly ambient_resolution: false;
17
+ }>;
18
+ export declare const GOLDEN_SOURCE_PINS_V1: Readonly<{
19
+ readonly schema_version: "infinity.golden-source-pins/v1";
20
+ readonly build_recipe: Readonly<{
21
+ readonly schema_version: "infinity.golden-build-recipe/v1";
22
+ readonly git: Readonly<{
23
+ path: "/usr/bin/git";
24
+ version: "2.43.0";
25
+ executable_sha256: "sha256:aa6540695d076182256dd6e96c8b302e4d56381e3000bbfd5c71bbdfe94a4942";
26
+ }>;
27
+ readonly bun: Readonly<{
28
+ version: "1.3.13";
29
+ executable_sha256: "sha256:67892bb6734ef352f90a964f0a2a680d5f6e6d15bdb5510e56b8065ac4d599ae";
30
+ }>;
31
+ readonly umask: "0022";
32
+ readonly source_materialization: "git archive <commit> into fresh mode-0700 root";
33
+ readonly commands: readonly string[];
34
+ readonly consumer_commands: readonly string[];
35
+ readonly ambient_resolution: false;
36
+ }>;
37
+ readonly infinity: Readonly<{
38
+ repository: "hasna/infinity";
39
+ commit: "c5970a24525835ecf23c8540517c424ea54c9fa0";
40
+ tree: "ea9d18003bc018841ac653cb45c7a7b54f50bb94";
41
+ archive_sha256: "sha256:4384c9994f7b4aae9f3454126dcb8a4fb8e5f6763fdf236cde59851e85469b33";
42
+ }>;
43
+ readonly accounts: Readonly<{
44
+ repository: "hasna/accounts";
45
+ commit: "fe26a79f316ce81ca64366194e0f3f7e3534f4e3";
46
+ tree: "52e9aa6311369a896b03aea1586c1ab8af2542f8";
47
+ archive_sha256: "sha256:84ce1409c87ba20f4b938279161d2b5a0965e224219d4af06e0d63ea7d5c48a0";
48
+ package_sha256: "sha256:55a579f60b677ea58c903319b5f84241fd58d997380afd50fd7068030dcd578b";
49
+ }>;
50
+ readonly sandboxes: Readonly<{
51
+ repository: "hasna/sandboxes";
52
+ commit: "33a5f670d4c20469902c641dd493c7c0c09726c0";
53
+ tree: "f041a133fc69db56cf206871c8708bef6843a6ae";
54
+ archive_sha256: "sha256:caed739b07fa828baf9e5ec6669d3b53d793fa3077fe101d8426ac72f32c15e9";
55
+ package_sha256: "sha256:5a911d3556b8b8e54df94c665f0ceffaf49bd57834ec6a9360907ebac54eaf68";
56
+ }>;
57
+ readonly reference_only_golden: Readonly<{
58
+ repository: "hasna/infinity";
59
+ commit: "c0dd4b9612cdd9705856fa155c89402a40f8b7fa";
60
+ imported: false;
61
+ }>;
62
+ }>;
63
+ export type GoldenSourceNameV1 = "infinity" | "accounts" | "sandboxes";
64
+ export interface GoldenSourceAttestationV1 {
65
+ readonly schema_version: "infinity.golden-source-attestation/v1";
66
+ readonly source: GoldenSourceNameV1;
67
+ readonly commit: string;
68
+ readonly tree: string;
69
+ readonly archive_sha256: `sha256:${string}`;
70
+ readonly package_sha256?: `sha256:${string}`;
71
+ readonly exact: true;
72
+ }
73
+ export declare function attestGoldenSourceV1(input: {
74
+ readonly source: GoldenSourceNameV1;
75
+ readonly root: string;
76
+ readonly package_path?: string;
77
+ }): Promise<GoldenSourceAttestationV1>;
@@ -0,0 +1,52 @@
1
+ import type { CapabilityProjection, PublicRunMutationContext, SubmitRunContext } from "../authority/authority";
2
+ import { type Int64 } from "../core/int64";
3
+ import { type InfinityProductionSandboxDispatchService, type InfinitySandboxDispatchAuthorizationRequestV1 } from "../providers/sandbox-dispatch";
4
+ export declare const OPERATOR_SCHEMA_VERSION: "infinity.operator/v1";
5
+ export declare const INFINITY_VERSION: "0.1.0";
6
+ export interface AuthenticatedOperator {
7
+ principal: string;
8
+ audience: "operator";
9
+ }
10
+ export interface OperatorAuthenticator {
11
+ authenticate(request: Request): Promise<AuthenticatedOperator>;
12
+ }
13
+ export declare class FixedPrincipalAuthenticator implements OperatorAuthenticator {
14
+ private readonly principal;
15
+ constructor(principal: string);
16
+ authenticate(_request: Request): Promise<AuthenticatedOperator>;
17
+ }
18
+ export interface AuthorityApi {
19
+ handle(request: Request): Promise<Response>;
20
+ }
21
+ type MaybePromise<T> = T | Promise<T>;
22
+ export interface OperatorAuthority {
23
+ snapshot(): MaybePromise<{
24
+ authority_epoch: Int64;
25
+ }>;
26
+ listCapabilities(actorPrincipal: string): MaybePromise<CapabilityProjection>;
27
+ validateRunSpec(input: unknown): MaybePromise<unknown>;
28
+ planRun(input: unknown): MaybePromise<unknown>;
29
+ submitRun(input: unknown, context: SubmitRunContext): MaybePromise<unknown>;
30
+ getRun(runId: string, actorPrincipal: string): MaybePromise<unknown>;
31
+ listRuns(actorPrincipal: string, options: {
32
+ limit?: number;
33
+ cursor?: string;
34
+ }): MaybePromise<unknown>;
35
+ waitRun(runId: string, actorPrincipal: string, timeoutMs: number): MaybePromise<unknown>;
36
+ readRunEvents(runId: string, actorPrincipal: string, options: {
37
+ cursor: string;
38
+ limit: number;
39
+ waitMs: number;
40
+ }): MaybePromise<unknown>;
41
+ cancelRun(runId: string, context: PublicRunMutationContext & {
42
+ reasonCode: string;
43
+ }): MaybePromise<unknown>;
44
+ retryRun(runId: string, context: PublicRunMutationContext): MaybePromise<unknown>;
45
+ authorizeSandboxDispatch?(input: InfinitySandboxDispatchAuthorizationRequestV1, actorPrincipal: string): MaybePromise<unknown>;
46
+ resolveOperation(operationId: string, actorPrincipal: string): MaybePromise<unknown>;
47
+ }
48
+ export interface AuthorityApiExtensions {
49
+ readonly productionSandboxDispatch?: InfinityProductionSandboxDispatchService;
50
+ }
51
+ export declare function createAuthorityApi(authority: OperatorAuthority, authenticator: OperatorAuthenticator, extensions?: Readonly<AuthorityApiExtensions>): AuthorityApi;
52
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { AuthenticatedOperator, OperatorAuthenticator } from "./api";
2
+ export declare class BearerTokenFileAuthenticator implements OperatorAuthenticator {
3
+ private readonly expectedDigest;
4
+ private readonly principal;
5
+ private constructor();
6
+ static open(path: string, principalInput: string): BearerTokenFileAuthenticator;
7
+ authenticate(request: Request): Promise<AuthenticatedOperator>;
8
+ }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export declare const LOCAL_REFERENCE_HOSTNAME: "127.0.0.1";
3
+ export declare function startLocalReferenceServer(port: number): ReturnType<typeof Bun.serve>;
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env bun
2
+ import { type InfinityManagedSandboxProviderV1, type SandboxesV2ProductionDispatchPort } from "../providers/sandbox-dispatch";
3
+ export interface SelfHostedServerDependencies {
4
+ readonly productionDispatchPorts?: Readonly<Record<InfinityManagedSandboxProviderV1, SandboxesV2ProductionDispatchPort>>;
5
+ }
6
+ export declare function startSelfHostedServer(environment?: NodeJS.ProcessEnv, dependencies?: Readonly<SelfHostedServerDependencies>): Promise<{
7
+ readonly server: Bun.Server<unknown>;
8
+ readonly runtime: {
9
+ readonly report: Readonly<import("..").SelfHostedRuntimeReport>;
10
+ readonly markReady: () => void;
11
+ readonly markNotReady: () => void;
12
+ readonly beginShutdown: () => void;
13
+ readonly fetch: (request: Request) => Promise<Response>;
14
+ };
15
+ readonly report: Readonly<import("..").SelfHostedRuntimeReport>;
16
+ readonly stop: (signal: "SIGINT" | "SIGTERM") => Promise<void>;
17
+ }>;
@@ -0,0 +1,65 @@
1
+ export { InMemoryRunAuthority, computeDiscardConsequenceDigest, mutationRequestHash, type ApprovalDecisionContext, type ApprovalProposalInput, type CapabilityProjection, type ClaimAttemptInput, type ClaimAttemptResult, type ConsumeApprovalResult, type DiscardConsequenceInput, type HumanApprovalAuthorizer, type MaintenanceQuiescenceBlockers, type MaintenanceQuiescenceReport, type RunEventPage, type RunMutationResult, type RunWaitProjection, type SubmitRunContext, type SubmitRunResult, } from "./authority/authority";
2
+ export { InMemoryAuthorityStore, DeterministicFaultInjector } from "./authority/store";
3
+ export { EFFECT_JOURNAL_OUTCOME_KINDS, EFFECT_JOURNAL_OUTCOME_SCHEMA, EFFECT_JOURNAL_OUTCOME_SCHEMA_DIGEST, EFFECT_JOURNAL_OUTCOME_SCHEMA_VERSION, EFFECT_JOURNAL_ANCHOR_SCHEMA_VERSION, EFFECT_JOURNAL_HEAD_SCHEMA_VERSION, EFFECT_JOURNAL_PROTECTION_SCHEMA_VERSION, EFFECT_JOURNAL_RANGE_SCHEMA_VERSION, EFFECT_JOURNAL_RECORD_SCHEMA_VERSION, Ed25519EffectJournalSigner, Ed25519EffectJournalVerifier, InMemoryEffectJournal, OPERATION_STEP_SCHEMA_VERSION, RECONCILIATION_BLOCKED_MAPPING_FIXTURE, assertEffectJournalSeparated, operationStepDigest, parseEffectJournalRecord, parseOperationStep, type EffectJournalOutcomeKind, type EffectJournalHeadReceipt, type EffectJournalPort, type EffectJournalProtection, type EffectJournalRange, type EffectJournalReceiptVerifier, type EffectJournalAppendAuthorization, type EffectJournalAppendAuthorizer, type EffectJournalRecord, type EffectJournalRecordInput, type EffectJournalRecordKind, type EffectJournalSigner, type OperationStep, type OperationStepInput, type StoredEffectJournalRecord, type SynchronousEffectJournalPort, } from "./authority/effect-journal";
4
+ export { AUTHORITY_MUTATION_ACK_SCHEMA_VERSION, AUTHORITY_MUTATION_ANCHOR_SCHEMA_VERSION, AUTHORITY_MUTATION_ENVELOPE_SCHEMA_VERSION, AUTHORITY_MUTATION_PROTECTION_SCHEMA_VERSION, AUTHORITY_MUTATION_RANGE_SCHEMA_VERSION, Ed25519AuthorityMutationJournalSigner, Ed25519AuthorityMutationJournalVerifier, InMemoryAuthorityMutationJournal, authorityMutationJournalProtectionDigest, assertAuthorityMutationJournalSeparated, parseAuthorityMutationEnvelope, type AuthorityMutationAppendReceipt, type AuthorityMutationChange, type AuthorityMutationEnvelope, type AuthorityMutationJournalAcknowledgement, type AuthorityMutationJournalPort, type AuthorityMutationJournalProtection, type AuthorityMutationJournalRange, type AuthorityMutationJournalReceiptVerifier, type AuthorityMutationJournalSigner, type SynchronousAuthorityMutationJournalPort, type StoredAuthorityMutationAnchor, } from "./authority/mutation-journal";
5
+ export { initialAuthorityState, type AuthoritySnapshot, type AuthorityState } from "./authority/state";
6
+ export { BROKER_FENCE_FIELDS, BROKER_FENCE_SCHEMA_VERSION, BROKER_FENCE_WIRE_FIELDS, REJECTED_FENCE_ALIASES, assertFenceCurrent, parseBrokerFence, type AuthenticatedFenceContext, type BrokerFence, } from "./contracts/fence";
7
+ export type { Int64 } from "./core/int64";
8
+ export { RUN_SPEC_INPUT_SCHEMA, parseRunSpec, runSpecDigest, type RunSpec, type RunSpecInput } from "./contracts/runspec";
9
+ export { parseAttemptRecord, parseAuthorityEvent, parseExternalOperation, parseOutboxRow, parseRunRecord, } from "./contracts/validators";
10
+ export { MAX_SLOT_ELIGIBILITY_LIFETIME_MS, parseSlotEligibility, type AccountsSlotEligibilityPort, type SlotEligibility } from "./ports/accounts";
11
+ export { Ed25519AccountsOperationEvidenceSigner, InMemoryAccountsOperationSignerHistory, InMemoryInfinityAccountsOperationAdapter, INFINITY_ACCOUNT_SERIALIZATION_FRONTIER_HEAD_DESCRIPTOR, INFINITY_ACCOUNT_SERIALIZATION_FRONTIER_HEAD_SCHEMA_DIGEST, INFINITY_ACCOUNTS_INTEGRATION_COMMIT, INFINITY_MODEL_CALL_CONSUME_BINDING_DESCRIPTOR, INFINITY_MODEL_CALL_CONSUME_BINDING_SCHEMA_DIGEST, INFINITY_MODEL_CALL_PREPARED_ANCHOR_DESCRIPTOR, INFINITY_MODEL_CALL_PREPARED_ANCHOR_SCHEMA_DIGEST, accountsSerializationKeyDigest, assertVerifiedConsumeBoundEvidence, type AccountsModelCallEffectJournalRecord, type AccountsModelCallOperationRecord, type AccountsOperationEvidenceSigner, type AccountsOperationSignerHistoryPin, type AccountsOperationSignerHistoryRecord, type AccountsOperationSigningKeyStatus, type AccountsSerializationDomainState, type AccountsSerializationFrontierKind, type AssertConsumeBoundCurrentRequest, type AssertPreparedOpenCurrentRequest, type BindCapabilityUseRequest, type CapabilityUseOperationBinding, type InfinityAccountsOperationPort, type InfinityAccountsOperationRecoveryPort, type InfinityCounter, type InfinitySha256Digest, type PrepareAccountsModelCallInput, type SignedAccountsSerializationFrontierHead, type VerifiedConsumeBoundOperation, type VerifiedPreparedOpenOperation, } from "./ports/accounts-operation";
12
+ export type { SandboxesPort } from "./ports/sandboxes";
13
+ export { INFINITY_SANDBOX_DISPATCH_AUTHORIZATION_REQUEST_SCHEMA_V1, INFINITY_SANDBOX_DISPATCH_AUTHORIZATION_RESULT_SCHEMA_V1, INFINITY_SANDBOX_PROVIDER_DISPATCH_PRODUCTION_ADMISSION_V1, InfinityProductionSandboxDispatchService, InfinitySandboxDispatchAuthorizationService, type InfinityProductionSandboxDispatchResultV1, type InfinityManagedSandboxProviderV1, type InfinitySandboxDispatchAuthorizationRequestV1, type InfinitySandboxDispatchAuthorizationResultV1, type SandboxesV2AuthorizationPort, type SandboxesV2BoundAuthorization, type SandboxesV2Intent, type SandboxesV2PreparedIntent, type SandboxesV2ProductionDispatchPort, type SandboxesV2ProductionDispatchResult, } from "./providers/sandbox-dispatch";
14
+ export { SANDBOX_DISPATCH_ACCOUNTS_CONSUME_EVIDENCE_REQUEST_SCHEMA_VERSION, SANDBOX_DISPATCH_ACCOUNTS_CONSUME_EVIDENCE_SCHEMA_VERSION, SANDBOX_DISPATCH_AUTHORIZATION_REQUEST_SCHEMA_V2, SANDBOX_DISPATCH_AUTHORIZATION_SCHEMA_V2, DISPOSABLE_TASK_AUTHORIZATION_CONSUMPTION_SCHEMA_V2, DISPOSABLE_TASK_PROVIDER_CONTACT_AUDIENCE_V2, parseSandboxDispatchAuthorizationRequestV2, parseSandboxDispatchAccountsConsumeEvidenceRequestV1, parseSandboxDispatchAccountsConsumeEvidenceV1, parseDisposableTaskAuthorityConsumeInputV2, parseDisposableTaskAuthorizationConsumptionV2, disposableTaskAuthorizationArtifactsV2, parseDisposableTaskAuthorizationArtifactsV2, parseSignedSandboxDispatchAuthorizationV2, sandboxDispatchAuthorizationDigest, disposableTaskAuthorizationConsumptionDigest, type SandboxDispatchAuthorityPortV2, type SandboxDispatchAccountsConsumeEvidenceRequestV1, type SandboxDispatchAccountsConsumeEvidenceV1, type SandboxDispatchAuthorizationRequestV2, type DisposableTaskAuthorityConsumeInputV2, type DisposableTaskAuthorizationConsumptionV2, type DisposableTaskAuthorizationArtifactsV2, type ManagedProviderIdV1, type SignedSandboxDispatchAuthorizationV2, } from "./ports/sandbox-dispatch-authority";
15
+ export { MCP_TOOL_SCHEMAS, getMcpToolSchema, type McpToolSchema } from "./mcp/schema";
16
+ export { assertStoredMutationResult, isPublicMutationCommand, MAX_MUTABLE_IF_REVISION, MAX_REVISION, parsePublicMutationResult, parsePublicMutationResultExpectation, parsePublicOperationResolution, type OperationBinding, type OperationResolution, type PublicMutationCommand, type PublicMutationResultExpectation, type PublicOperationBinding, type PublicOperationResolution, } from "./contracts/operations";
17
+ export { OperatorHttpClient, type ExistingRunRequest, type OperatorClient, type OperatorEnvelope, type SubmitRequest, } from "./client/operator-client";
18
+ export { FixedPrincipalAuthenticator, createAuthorityApi, type AuthenticatedOperator, type AuthorityApi, type OperatorAuthenticator, type OperatorAuthority, } from "./http/api";
19
+ export { BearerTokenFileAuthenticator } from "./http/bearer-auth";
20
+ export { startSelfHostedServer, type SelfHostedServerDependencies, } from "./http/self-hosted-main";
21
+ export { FileEd25519Signer, assertOwnerOnlySecretFile, loadSelfHostedRuntimeConfig, loadSelfHostedMigrationConfig, readPostgresUrlFile, readOwnerOnlySecretFile, type SelfHostedRuntimeConfig, type SelfHostedMigrationConfig, } from "./runtime/config";
22
+ export { createSelfHostedPostgresRuntime } from "./runtime/postgres";
23
+ export { INFINITY_PROVIDER_ACTIVATION_INFINITY_COMMIT, INFINITY_PROVIDER_ACTIVATION_SANDBOXES_COMMIT, INFINITY_PROVIDER_ACTIVATION_SCHEMA_VERSION, INFINITY_PROVIDER_DAYTONA_EVIDENCE_MANIFEST_SHA256, INFINITY_PROVIDER_E2B_EVIDENCE_MANIFEST_SHA256, defaultProviderActivation, authorizeProviderProductionAdmission, loadProviderActivationManifest, parseProviderActivationManifest, providerActivationHasEligibleProductionProvider, type ProviderActivationEntry, type ProviderActivationState, type ProviderProductionAdmission, } from "./runtime/provider-activation";
24
+ export { assertPostgresMigrationState, assertBuildRevisionMatches, EMBEDDED_BUILD_REVISION, createRuntimeReport, createSelfHostedRuntimeHandler, type RuntimeAuditRecord, type RuntimeAuditSink, type SelfHostedRuntimeReport, } from "./runtime/server";
25
+ export { DurableCliOperationJournal, defaultCliOperationJournalPath, successfulMutationConsequenceDigest, type CliOperationIntent, type CliOperationJournal, type PreparedCliOperation, } from "./cli/operation-journal";
26
+ export { applyPostgresMigrations, configurePostgresRoles, DEFAULT_POSTGRES_ROLES, POSTGRES_MIGRATION_MANIFEST, readMigrationState, type MigrationResult, type PostgresRoleNames, } from "./persistence/migrations";
27
+ export { PostgresRunAuthority } from "./persistence/postgres-authority";
28
+ export { createPostgresSandboxDispatchAuthorityV2 } from "./persistence/postgres-sandbox-dispatch-authority";
29
+ export { PostgresMutationJournalCoordinator } from "./persistence/postgres-mutation-journal";
30
+ export { POSTGRES_EXTERNAL_MUTATION_JOURNAL_MIGRATION_MANIFEST, applyPostgresExternalMutationJournalMigrations, configurePostgresExternalMutationJournalRole, initializePostgresExternalMutationJournalStore, type PostgresExternalMutationJournalMigrationResult, type PostgresExternalMutationJournalOptions, } from "./persistence/postgres-external-mutation-journal";
31
+ export { PostgresReconciler, type EffectJournalAnchorVerifier, type LeasedOutboxRecord, } from "./persistence/postgres-reconciler";
32
+ export { createPostgresAuthorityComposition } from "./persistence/composition";
33
+ export { AUTH_CAPSULE_DESCRIPTOR_SCHEMA_VERSION, CAPSULE_REMOTE_TOOL_BINDING_SCHEMA_VERSION, LocalCodewithAuthCapsuleLauncher, authCapsuleDescriptorFromEligibility, parseAuthCapsuleDescriptor, parseCapsuleRemoteToolBinding, type AuthCapsuleDescriptor, type AuthCapsuleLaunchAuthorityPort, type AuthCapsuleLocalProfileReference, type CapsuleRemoteToolBinding, type CapsuleRemoteToolBridgePort, type CapsuleRemoteToolBridgeSession, type CodewithAuthCapsuleLaunchRequest, type CodewithAuthCapsuleLaunchResult, type CodewithLocalProfile, type CodewithLocalProfileRegistry, } from "./authcapsules/codewith-local";
34
+ export { CAPSULE_REMOTE_CAPABILITIES, INFINITY_AGENT_POLICY_SCHEMA_VERSION, ProtectedCapsuleRemoteToolBridge, infinityAgentPolicyDigest, parseInfinityAgentPolicy, type CapsuleRemoteCapability, type CapsuleRemoteToolAuthorityPort, type CapsuleRemoteToolBackendPort, type CapsuleRemoteToolCall, type InfinityAgentPolicy, type ProtectedCapsuleRemoteToolSession, } from "./authcapsules/infinity-agent-policy";
35
+ export { SUBSCRIPTION_CAPSULE_ATTESTATION_SCHEMA_VERSION, IsolatedSubscriptionCapsuleRunner, LinuxBubblewrapCapsuleProvider, MacOsVmSubscriptionCapsuleProvider, parseSubscriptionCapsuleAttestation, type LinuxBubblewrapCapsuleOptions, type MacOsVmCapsuleAdapter, type MacOsVmDriver, type SubscriptionCapsuleAttestation, type SubscriptionCapsuleLaunchResult, type SubscriptionCapsuleProvider, } from "./authcapsules/os-isolated-runner";
36
+ export { CheckpointBroker, checkpointProvenanceInputDigest, checkpointProvenanceReceiptCoreDigest, checkpointProvenanceReceiptDigest, checkpointProvenanceReceiptSigningPreimage, checkpointSealOperationDigest, checkpointSealReceiptDigest, parseVerifiedCheckpointProvenanceReceipt, verifyCheckpointProvenanceReceiptSignature, type CheckpointSealCore, type CheckpointProvenanceVerificationInput, type CheckpointProvenanceVerifierPort, type CheckpointProvenanceReceiptCryptographyPort, type CheckpointSealReceipt, type CheckpointSealRequest, type FenceAuthorityPort, type ManifestSignerPort, type VerifiedCheckpointProvenanceReceipt, } from "./brokers/checkpoint/service";
37
+ export type { ArchiveEntry, ArchivePolicy } from "./brokers/checkpoint/archive";
38
+ export type { BinarySource } from "./brokers/checkpoint/bytes";
39
+ export type { GitBundleInspectionPolicy } from "./brokers/checkpoint/bundle";
40
+ export { IdempotentOperationLedger, type IdempotentExecutionContext, type IdempotentExecutor, type IdempotentResolution, } from "./brokers/checkpoint/idempotency";
41
+ export { CleanCheckpointVerifier, parseManagedVerifierResult, parseManagedVerifierSandboxHandle, parseSandboxesVerifierAllocationReceipt, parseSandboxesVerifierCleanupReceipt, parseSandboxesVerifierQuarantineReceipt, parseVerifierCleanupCommitReceipt, parseVerifierCleanupGrant, sandboxesVerifierAllocationReceiptDigest, sandboxesVerifierCleanupReceiptDigest, sandboxesVerifierQuarantineReceiptCanonicalBytes, sandboxesVerifierQuarantineReceiptDigest, verifierCleanupCommitReceiptDigest, verifierCleanupGrantDigest, verifierCleanupGrantRequestDigest, verifierCleanupOperationDigest, verifierCleanupTarget, verifierInvalidAllocationEvidenceDigest, verifierQuarantineSubjectDigest, verifyRecordAndReadbackVerifierQuarantine, verifySandboxesVerifierAllocationReceipt, verifySandboxesVerifierCleanupReceipt, verifySandboxesVerifierQuarantineReceipt, type CleanCheckpointVerifierLimits, type ManagedVerifierDependentResource, type ManagedVerifierProviderHandle, type ManagedVerifierResultAttestationPort, type ManagedVerifierSandboxHandle, type ManagedVerifierSandboxPort, type ManagedVerifierSandboxResult, type SandboxesVerifierAllocationReceipt, type SandboxesVerifierAllocationReceiptAttestation, type SandboxesVerifierAllocationReceiptCore, type SandboxesVerifierAllocationReceiptVerifierPort, type SandboxesResourceAbsence, type SandboxesVerifierCleanupReceipt, type SandboxesVerifierCleanupReceiptAttestation, type SandboxesVerifierCleanupReceiptCore, type SandboxesVerifierCleanupReceiptVerifierPort, type SandboxesVerifierQuarantineReceipt, type SandboxesVerifierQuarantineReceiptAttestation, type SandboxesVerifierQuarantineReceiptCore, type SandboxesVerifierQuarantineReceiptVerifierPort, type VerifiedVerifierCleanupEvidence, type VerifierCleanupAuthorityPort, type VerifierCleanupFenceAuthorityPort, type VerifierCleanupCommitReceipt, type VerifierCleanupGrant, type VerifierCleanupGrantBinding, type VerifierCleanupGrantCore, type VerifierCleanupTarget, type VerifierQuarantineExpectation, type VerifierQuarantineReason, type VerifierEvidenceLoaderPort, } from "./brokers/checkpoint/clean-verifier";
42
+ export { parseCheckpointManifestSigningTrust, parseCheckpointManifestSigningTrustHead, checkpointManifestKeyHistoryDigest, checkpointManifestSigningTrustHeadDigest, assertCheckpointManifestSigningTrustHeadMonotonic, assertCheckpointManifestSigningTrustHeadFreshAtDatabaseTime, verifyCheckpointManifestSignature, verifyCheckpointManifestSigningTrustHead, type CheckpointManifestSignatureVerifierPort, type CheckpointManifestSignatureVerificationResult, type CheckpointManifestSigningKeyRecord, type CheckpointManifestSigningKeyRecordInput, type CheckpointManifestSigningKeyStatus, type CheckpointManifestSigningTrust, type CheckpointManifestSigningTrustInput, type CheckpointManifestSigningTrustResolverPort, type CheckpointManifestSigningTrustHead, type CheckpointManifestSigningTrustHeadAttestation, type CheckpointManifestSigningTrustHeadCore, type CheckpointManifestSigningTrustHeadResolverPort, type CheckpointManifestSigningTrustHeadVerifierPort, } from "./brokers/checkpoint/manifest-signature";
43
+ export { CHECKPOINT_MANIFEST_SIGNATURE_DOMAIN, CHECKPOINT_PROVENANCE_SIGNATURE_DOMAIN, checkpointSigningMessage, checkpointSigningMessageCanonicalBytes, checkpointSigningMessageDigest, checkpointSigningMessageDigestBytes, type CheckpointSignatureDomain, type CheckpointSigningMessage, } from "./brokers/checkpoint/signing-message";
44
+ export { InMemoryVerifierCleanupAuthority, type VerifierCleanupGrantAuthorityPort, } from "./brokers/checkpoint/verifier-cleanup";
45
+ export { PostgresVerifierCleanupAuthority, PostgresVerifierCleanupFinalizationAuthority, type VerifierCleanupFinalizationAuthorityPort, } from "./brokers/checkpoint/verifier-cleanup-authority";
46
+ export { InMemoryCleanVerifierFinalizationAuthority, PostgresCleanVerifierFinalizationAuthority, type CleanVerifierCompletionPreparation, type CleanVerifierFinalizationAuthorityPort, } from "./brokers/checkpoint/clean-verifier-finalization";
47
+ export { cleanVerifierOperationDigest, createCleanVerifierHandoff, finalizePassingVerificationReceipt, parseCleanVerifierHandoff, parseCheckpointSealReceipt, parseVerificationReceiptFinalTrustAuthorization, validatePassingVerificationReceipt, validateCheckpointSealReceipt, verifyPassingVerificationReceiptSignature, verifyPassingVerificationReceiptFinalTrustAuthorization, verificationReceiptFinalTrustAuthorizationDigest, verificationReceiptTrustGenerationDigest, verificationReceiptDigest, type CleanVerifierHandoff, type CleanVerifierHandoffRequest, type PassingVerificationReceipt, type AuthoritySignedPassingVerificationReceipt, type PassingVerificationReceiptCore, type PassingVerificationReceiptInput, type VerificationReceiptAuthorityAttestation, type VerificationReceiptCryptographyPort, type VerificationReceiptFinalTrustAuthorization, type VerificationReceiptFinalTrustAuthorityPort, type VerificationReceiptFinalTrustCryptographyPort, type VerificationReceiptCurrentTrustEffectContext, } from "./brokers/checkpoint/verifier";
48
+ export { PostgresRecordedManifestSigningTrustHeadResolver, PostgresVerificationReceiptFinalTrustAuthority, } from "./brokers/checkpoint/final-trust-authority";
49
+ export { checkpointManifestCanonicalBytes, checkpointManifestDigest, parseCheckpointManifest, type CheckpointArtifactName, type CheckpointArtifactRef, type CheckpointArtifactRefInput, type CheckpointManifest, type CheckpointManifestInput, } from "./brokers/checkpoint/manifest";
50
+ export { InMemoryVersionedObjectStore, parseVersionedObjectRef, type PutAndReadbackInput, type PutVersionedObjectInput, type VersionedObjectRead, type VersionedObjectRef, type VersionedObjectStore, type VersionedReadbackReceipt, } from "./brokers/checkpoint/store";
51
+ export { ProviderJournaledVersionedObjectStore } from "./brokers/checkpoint/journaled-store";
52
+ export { InMemoryCheckpointSealAuthority, PostgresCheckpointSealAuthority, parseAuthorityCheckpointSealCommitReceipt, verifyAuthorityCheckpointSeal, type AuthorityCheckpointSealCommitReceipt, type AuthorityReceiptCryptographyPort, type CheckpointManifestSigningTrustFinalizationAuthorityPort, type CheckpointSealAuthorityPort, } from "./brokers/checkpoint/seal-authority";
53
+ export { S3VersionedObjectStore, AwsSdkV3S3EvidenceClient, S3AmbiguousWriteError, S3ConditionalWriteConflictError, type AwsSdkV3Client, type AwsSdkV3S3CommandFactory, type S3EvidenceBucketInspector, type S3EvidenceBucketControls, type S3EvidenceClient, type S3EvidenceFenceAuthorityPort, type S3GetObjectRequest, type S3GetObjectResponse, type S3HeadObjectVersionResponse, type S3KmsContextAuditPort, type S3ObjectVersionSummary, type S3PutObjectRequest, type S3PutObjectResponse, type S3VersionedObjectStoreConfig, } from "./brokers/checkpoint/s3-store";
54
+ export { GitPromotionBroker, InMemoryExpectedBaseGitPort, createGitPromotionIntent, derivePromotionBranchRef, parseGitPromotionReceipt, promotionApprovalConsumptionReceiptDigest, promotionApprovalSignedEnvelopeDigest, promotionApprovalWebauthnChallengeDigest, promotionOperationDigest, promotionProposalDigest, type DecisionIdempotencyTuple, type ExpectedBaseGitPort, type FreshPromotionSecretScanReceipt, type GitBranchCasReceipt, type GitBranchCreateReceipt, type GitCandidateObjectSource, type GitPromotionIntent, type GitPromotionIntentInput, type GitPromotionProposalInput, type GitPromotionReceipt, type GitPromotionReceiptCore, type GitPromotionResultAuthorityCommit, type GitPromotionStatus, type GitPullRequestCreateReceipt, type GitPullRequestReadReceipt, type GitPullRequestRecord, type GitRefReadReceipt, type InMemoryExpectedBaseGitPortOptions, type PromotionApprovalReceipt, type PromotionApprovalSignedEnvelope, type PromotionApprovalAuthorityPort, type PromotionApprovalChallengeInput, type PromotionApprovalConsumptionVerification, type PromotionFenceAuthorityPort, type PromotionSecretScannerPort, type PromotionResultAuthorityPort, type PromotionStepAction, } from "./brokers/git/promotion";
55
+ export { GitHubAppExpectedBaseGitPort, GitHubAmbiguousCreateError, GitHubAmbiguousBranchWriteError, VersionedGitCandidateObjectLoader, type GitHubAppExpectedBaseConfig, type GitHubAppCredentialBrokerPort, type GitHubAppSessionContext, type GitHubBranchWriteEvidence, type GitHubRawBranchWriteReceipt, type GitHubRawRefReceipt, type GitHubRepositorySession, type GitHubSessionAuthorityPort, type GitPromotionCandidateObjectLoaderPort, type RepositoryAutomationAdmission, type RepositoryAutomationAdmissionPort, } from "./brokers/git/github-app";
56
+ export { BunPostgresExecutor, PostgresOperationLedger, PostgresProviderStepLedger, ProviderNoEffectError, providerEffectJournalAnchorCoreDigest, applyCheckpointBrokerMigration, canonicalCodec, type CanonicalCodec, type PostgresLedgerOptions, type ProviderEffectJournalAnchorInput, type ProviderEffectJournalAuthorityPort, type ProviderStepExecutor, type ProviderStepExecutionInput, type ProviderStepResolution, type VerifiedProviderEffectJournalAnchor, type SqlParameter, type SqlExecutor, } from "./brokers/persistence/postgres";
57
+ export { InMemoryProviderStepLedger } from "./brokers/persistence/memory";
58
+ export { CHECKPOINT_BROKER_MIGRATION_ID, CHECKPOINT_BROKER_MIGRATION_V1, CHECKPOINT_TRUST_MIGRATION_ID, CHECKPOINT_TRUST_MIGRATION_V2, CHECKPOINT_BROKER_MIGRATION_V2_ID, CHECKPOINT_BROKER_MIGRATION_V2, } from "./brokers/persistence/migration";
59
+ export { createDurableCheckpointBroker, createDurableGitPromotionBroker, createProductionCheckpointGitBrokerStack, type DurableCheckpointBrokerDependencies, type DurableGitPromotionBrokerDependencies, type ProductionCheckpointGitBrokerStack, type ProductionCheckpointGitBrokerStackDependencies, } from "./brokers/composition";
60
+ export { GOLDEN_BUILD_RECIPE_V1, GOLDEN_SOURCE_PINS_V1, attestGoldenSourceV1, type GoldenSourceAttestationV1, type GoldenSourceNameV1, } from "./golden/source-pins";
61
+ export { GOLDEN_SOURCE_PIN_SET_SHA256, runGoldenDisposableTaskV1, type GoldenAccountsConsumeInputV1, type GoldenAccountsConsumePortV1, type GoldenAccountsConsumeResultV1, type GoldenDigestV1, type GoldenDisposableSandboxTaskPortV1, type GoldenDisposableTaskReceiptV1, type GoldenDisposableTaskRequestV1, type GoldenSandboxTaskReceiptV1, type GoldenSandboxTaskRequestV1, type InfinityDisposableTaskAuthorityPortV1, } from "./golden/disposable-task";
62
+ export { NODE_AGENT_COMMAND_SCHEMA_VERSION, NODE_AGENT_HEARTBEAT_SCHEMA_VERSION, MAX_NODE_AGENT_COMMAND_LIFETIME_MS, NODE_AGENT_RECEIPT_SCHEMA_VERSION, NODE_AGENT_REGISTRATION_SCHEMA_VERSION, nodeAgentCommandDigest, nodeAgentCommandSigningBytes, parseNodeAgentCommandCore, parseNodeAgentTransportPolicy, parseSignedNodeAgentCommand, type NodeAgentCommandCore, type NodeAgentCommandPayload, type NodeAgentHeartbeat, type NodeAgentLaunchPayload, type NodeAgentReceipt, type NodeAgentRegistration, type NodeAgentRevokePayload, type NodeAgentTransportPolicy, type NodeControlPlanePeerEvidence, type NodeControlPlaneSession, type NodeControlPlaneTransport, type SignedNodeAgentCommand, } from "./node-agent/contracts";
63
+ export { Ed25519NodeCommandVerifier, DurableNodeAgentJournal, InMemoryNodeAgentAuditSink, InMemoryNodeAgentJournal, IsolatedRunnerNodeCapsuleRuntime, JsonLinesNodeAgentAuditSink, NodeAgentDaemon, ed25519PublicKeyThumbprint, type NodeAgentAuditEvent, type NodeAgentAuditSink, type NodeAgentConfig, type NodeAgentJournal, type NodeCapsuleRuntimePort, type NodeCapsuleLifecyclePort, type NodeCapsuleCommandIdentity, type NodeCommandClaim, type NodeCommandVerifier, } from "./node-agent/agent";
64
+ export { INFINITY_AGENT_LAUNCHD_LABEL, MacOsLaunchdService, renderMacOsLaunchdPlist, type MacOsLaunchdHostPort, type MacOsLaunchdOptions, type MacOsServiceStatus, } from "./node-agent/macos-service";
65
+ export { ComposedNodeAgentServiceCliRuntime, runNodeAgentServiceCli, type NodeAgentServiceCliRuntime, } from "./node-agent/service-cli";
@@ -0,0 +1,7 @@
1
+ export interface McpToolSchema {
2
+ readonly name: string;
3
+ readonly description: string;
4
+ readonly inputSchema: Readonly<Record<string, unknown>>;
5
+ }
6
+ export declare const MCP_TOOL_SCHEMAS: readonly McpToolSchema[];
7
+ export declare function getMcpToolSchema(name: string): McpToolSchema | undefined;
@@ -0,0 +1,174 @@
1
+ import { type KeyObject } from "node:crypto";
2
+ import type { Clock } from "../core/clock";
3
+ import type { IsolatedSubscriptionCapsuleRunner, SubscriptionCapsuleAttestation, SubscriptionCapsuleLaunchResult, SubscriptionCapsuleProvider } from "../authcapsules/os-isolated-runner";
4
+ import { type NodeAgentCommandCore, type NodeAgentLaunchPayload, type NodeAgentReceipt, type NodeAgentTransportPolicy, type NodeControlPlaneTransport, type SignedNodeAgentCommand } from "./contracts";
5
+ export interface NodeCapsuleRuntimePort {
6
+ readonly owner_ref: string;
7
+ inspect(): Promise<SubscriptionCapsuleAttestation>;
8
+ launch(input: Readonly<{
9
+ identity: NodeCapsuleCommandIdentity;
10
+ request: Extract<NodeAgentCommandCore["payload"], {
11
+ schema_version: "infinity.node-agent-launch.v1";
12
+ }>;
13
+ }>): Promise<SubscriptionCapsuleLaunchResult>;
14
+ revoke(input: Readonly<{
15
+ identity: NodeCapsuleCommandIdentity;
16
+ reason_code: string;
17
+ }>): Promise<void>;
18
+ reconcile(command: SignedNodeAgentCommand): Promise<Readonly<{
19
+ state: "not_applied";
20
+ }> | Readonly<{
21
+ state: "applied";
22
+ exit_code?: number;
23
+ }>>;
24
+ }
25
+ export interface NodeCapsuleCommandIdentity {
26
+ readonly command_id: string;
27
+ readonly command_sha256: string;
28
+ readonly lease_id: string;
29
+ readonly lease_epoch: string;
30
+ }
31
+ export interface NodeCapsuleLifecyclePort {
32
+ launch(input: Readonly<{
33
+ identity: NodeCapsuleCommandIdentity;
34
+ }>, effect: () => Promise<SubscriptionCapsuleLaunchResult>): Promise<SubscriptionCapsuleLaunchResult>;
35
+ revoke(input: Readonly<{
36
+ identity: NodeCapsuleCommandIdentity;
37
+ reason_code: string;
38
+ }>): Promise<void>;
39
+ reconcile(command: SignedNodeAgentCommand): Promise<Readonly<{
40
+ state: "not_applied";
41
+ }> | Readonly<{
42
+ state: "applied";
43
+ exit_code?: number;
44
+ }>>;
45
+ }
46
+ /**
47
+ * Narrow composition adapter for the existing OS-isolated runner. The adapter
48
+ * deliberately has no caller-controlled path, mount, argv, environment, repo,
49
+ * endpoint, or credential input.
50
+ */
51
+ export declare class IsolatedRunnerNodeCapsuleRuntime implements NodeCapsuleRuntimePort {
52
+ #private;
53
+ readonly owner_ref: string;
54
+ constructor(input: Readonly<{
55
+ provider: Pick<SubscriptionCapsuleProvider, "inspect">;
56
+ runner: Pick<IsolatedSubscriptionCapsuleRunner, "launch">;
57
+ lifecycle: NodeCapsuleLifecyclePort;
58
+ owner_ref: string;
59
+ }>);
60
+ inspect(): Promise<SubscriptionCapsuleAttestation>;
61
+ launch(input: Readonly<{
62
+ identity: NodeCapsuleCommandIdentity;
63
+ request: NodeAgentLaunchPayload;
64
+ }>): Promise<SubscriptionCapsuleLaunchResult>;
65
+ revoke(input: Readonly<{
66
+ identity: NodeCapsuleCommandIdentity;
67
+ reason_code: string;
68
+ }>): Promise<void>;
69
+ reconcile(command: SignedNodeAgentCommand): ReturnType<NodeCapsuleLifecyclePort["reconcile"]>;
70
+ }
71
+ export interface NodeAgentAuditEvent {
72
+ readonly schema_version: "infinity.node-agent-audit.v1";
73
+ readonly event_id: string;
74
+ readonly observed_at: string;
75
+ readonly canonical_node_id: string;
76
+ readonly action: "connect" | "heartbeat" | "launch" | "revoke" | "reconcile";
77
+ readonly outcome: "accepted" | "succeeded" | "rejected";
78
+ readonly command_id?: string;
79
+ readonly command_sha256?: string;
80
+ readonly capsule_id?: string;
81
+ readonly lease_epoch?: string;
82
+ readonly reason_code?: string;
83
+ }
84
+ export interface NodeAgentAuditSink {
85
+ write(event: NodeAgentAuditEvent): Promise<void>;
86
+ }
87
+ export declare class InMemoryNodeAgentAuditSink implements NodeAgentAuditSink {
88
+ readonly events: NodeAgentAuditEvent[];
89
+ write(event: NodeAgentAuditEvent): Promise<void>;
90
+ }
91
+ export declare class JsonLinesNodeAgentAuditSink implements NodeAgentAuditSink {
92
+ #private;
93
+ constructor(path: string);
94
+ write(event: NodeAgentAuditEvent): Promise<void>;
95
+ }
96
+ export interface NodeCommandClaim {
97
+ readonly state: "claimed" | "pending_replay" | "completed_replay";
98
+ readonly receipt?: NodeAgentReceipt;
99
+ }
100
+ export interface NodeAgentJournal {
101
+ claim(command: SignedNodeAgentCommand): Promise<NodeCommandClaim>;
102
+ complete(commandId: string, receipt: NodeAgentReceipt): Promise<void>;
103
+ pending(): Promise<readonly SignedNodeAgentCommand[]>;
104
+ lastSequence(): Promise<string>;
105
+ }
106
+ interface JournalEntry {
107
+ readonly digest: string;
108
+ readonly command: SignedNodeAgentCommand;
109
+ receipt?: NodeAgentReceipt;
110
+ }
111
+ interface CapsuleFenceState {
112
+ leaseEpoch: bigint;
113
+ placementGeneration: string;
114
+ authGeneration: string;
115
+ revoked: boolean;
116
+ }
117
+ export declare class InMemoryNodeAgentJournal implements NodeAgentJournal {
118
+ protected readonly entries: Map<string, JournalEntry>;
119
+ protected readonly capsuleFences: Map<string, CapsuleFenceState>;
120
+ protected highSequence: bigint;
121
+ claim(command: SignedNodeAgentCommand): Promise<NodeCommandClaim>;
122
+ complete(commandId: string, receipt: NodeAgentReceipt): Promise<void>;
123
+ pending(): Promise<readonly SignedNodeAgentCommand[]>;
124
+ lastSequence(): Promise<string>;
125
+ snapshotEntries(): readonly JournalEntry[];
126
+ }
127
+ export declare class DurableNodeAgentJournal implements NodeAgentJournal {
128
+ #private;
129
+ private constructor();
130
+ static open(path: string): Promise<DurableNodeAgentJournal>;
131
+ claim(command: SignedNodeAgentCommand): Promise<NodeCommandClaim>;
132
+ complete(commandId: string, receipt: NodeAgentReceipt): Promise<void>;
133
+ pending(): Promise<readonly SignedNodeAgentCommand[]>;
134
+ lastSequence(): Promise<string>;
135
+ }
136
+ export interface NodeCommandVerifier {
137
+ readonly key_id: string;
138
+ readonly key_thumbprint: string;
139
+ verify(command: SignedNodeAgentCommand): void;
140
+ }
141
+ export declare class Ed25519NodeCommandVerifier implements NodeCommandVerifier {
142
+ #private;
143
+ readonly key_id: string;
144
+ readonly key_thumbprint: string;
145
+ constructor(input: Readonly<{
146
+ key_id: string;
147
+ key_thumbprint: string;
148
+ public_key: KeyObject | string | Buffer;
149
+ }>);
150
+ verify(command: SignedNodeAgentCommand): void;
151
+ }
152
+ export declare function ed25519PublicKeyThumbprint(publicKey: KeyObject): string;
153
+ export interface NodeAgentConfig {
154
+ readonly canonical_node_id: string;
155
+ readonly node_key_thumbprint: string;
156
+ readonly node_generation: string;
157
+ readonly agent_version: string;
158
+ readonly transport_policy: NodeAgentTransportPolicy;
159
+ }
160
+ export declare class NodeAgentDaemon {
161
+ #private;
162
+ constructor(input: Readonly<{
163
+ config: NodeAgentConfig;
164
+ transport: NodeControlPlaneTransport;
165
+ verifier: NodeCommandVerifier;
166
+ capsules: Readonly<Record<string, NodeCapsuleRuntimePort>>;
167
+ journal: NodeAgentJournal;
168
+ audit: NodeAgentAuditSink;
169
+ clock?: Clock;
170
+ }>);
171
+ runOnce(): Promise<void>;
172
+ run(signal: AbortSignal): Promise<void>;
173
+ }
174
+ export {};