@invisible-labs/sdk 0.6.0-devnet.4 → 0.6.0-devnet.5
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/README.md +70 -13
- package/dist/.invisible-sdk-build-target.json +2 -2
- package/dist/{chunk-UADJCUPK.js → chunk-3MDHAS4D.js} +6 -5
- package/dist/chunk-3MDHAS4D.js.map +1 -0
- package/dist/{chunk-E4DCEDAG.js → chunk-3TGQ4CZ3.js} +178 -2
- package/dist/chunk-3TGQ4CZ3.js.map +1 -0
- package/dist/chunk-DCTYBUY3.js +258 -0
- package/dist/chunk-DCTYBUY3.js.map +1 -0
- package/dist/{chunk-NHEHCUS5.js → chunk-EBWTAXNT.js} +3 -3
- package/dist/{chunk-NHEHCUS5.js.map → chunk-EBWTAXNT.js.map} +1 -1
- package/dist/{chunk-V5HXJRBW.js → chunk-HJFMDMPY.js} +3 -3
- package/dist/chunk-HJFMDMPY.js.map +1 -0
- package/dist/{chunk-GHBQF3A7.js → chunk-QRN46R3F.js} +5 -2
- package/dist/chunk-QRN46R3F.js.map +1 -0
- package/dist/chunk-Y7AK6RBV.js +4189 -0
- package/dist/chunk-Y7AK6RBV.js.map +1 -0
- package/dist/{coordinator-ZNLGAYXD.js → coordinator-PEWHNZ7I.js} +3 -3
- package/dist/{coordinator-ZNLGAYXD.js.map → coordinator-PEWHNZ7I.js.map} +1 -1
- package/dist/events.js +3 -3
- package/dist/index.d.ts +14 -4
- package/dist/index.js +74 -11
- package/dist/index.js.map +1 -1
- package/dist/lp.d.ts +33 -9
- package/dist/lp.js +305 -45
- package/dist/lp.js.map +1 -1
- package/dist/presets.d.ts +6 -2
- package/dist/presets.js +8 -8
- package/dist/presets.js.map +1 -1
- package/dist/stats.js +1 -1
- package/dist/storage.js +2 -243
- package/dist/storage.js.map +1 -1
- package/dist/{types.generated-DJBTjLpP.d.ts → types.generated-YhFu9ZBR.d.ts} +29 -4
- package/dist/user.d.ts +31 -4
- package/dist/user.js +409 -57
- package/dist/user.js.map +1 -1
- package/package.json +4 -1
- package/dist/chunk-5NNEO7IK.js +0 -1150
- package/dist/chunk-5NNEO7IK.js.map +0 -1
- package/dist/chunk-BRDLLGCZ.js +0 -59
- package/dist/chunk-BRDLLGCZ.js.map +0 -1
- package/dist/chunk-DIA6U2CV.js +0 -1927
- package/dist/chunk-DIA6U2CV.js.map +0 -1
- package/dist/chunk-E4DCEDAG.js.map +0 -1
- package/dist/chunk-GHBQF3A7.js.map +0 -1
- package/dist/chunk-UADJCUPK.js.map +0 -1
- package/dist/chunk-V5HXJRBW.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { COORDINATOR_BINARY_FIELD_NAMES, COORDINATOR_ENVELOPE_SCHEMA, COORDINATOR_SCHEMA_PAYLOAD_CATEGORIES, CoordinatorError, CoordinatorMessageType, DEFAULT_PAYOUT_WINDOW_ID, DIRECTION_BY_TYPE, ENVELOPE_VERSION, EnvelopeKind, ErrorCode, INITIAL_STATE, MAX_FRAME_SIZE, MessageDirection, PAYOUT_WINDOW_OPTIONS, TERMINAL_STATES, TRANSITIONS, VALID_SWAP_STATES, asDelegateAckPayload, asDelegateSharePayload, asDelegateShareResponsePayload, asDepositConfirmedPayload, asDkgCompletePayload, asDkgInitPayload, asDkgInitResponsePayload, asDkgRound1Payload, asDkgRound1ResponsePayload, asDkgRound2Payload, asDkgRound2ResponsePayload, asErrorPayload, asLpCommandResponsePayload, asPayoutExecutedPayload, asSwapRequestPayload, asSwapRequestResponsePayload, asSyncRequiredPayload, asSyncUserRequestPayload, asSyncUserResponsePayload, asWithdrawAcceptedPayload, asWithdrawExecutedPayload, asWithdrawRequestPayload, decode, encode, encodeLpCommandForSigning, encodeValidated, isAllowedInState, isAllowedKindForType, isPayoutWindowId, isValidEnvelopeKind, isValidErrorCode, isValidMessageType, isValidSwapState, lpSignedCommandEnvelope, nextState, payloadCategory, payoutWindowLabelForId, payoutWindowOptionById, safeEncode, scheduledPayoutWindowOptions, scheduledPayoutWindowSeconds } from './chunk-
|
|
1
|
+
export { COORDINATOR_BINARY_FIELD_NAMES, COORDINATOR_ENVELOPE_SCHEMA, COORDINATOR_SCHEMA_PAYLOAD_CATEGORIES, CoordinatorError, CoordinatorMessageType, DEFAULT_PAYOUT_WINDOW_ID, DIRECTION_BY_TYPE, ENVELOPE_VERSION, EnvelopeKind, ErrorCode, INITIAL_STATE, MAX_FRAME_SIZE, MessageDirection, PAYOUT_WINDOW_OPTIONS, TERMINAL_STATES, TRANSITIONS, VALID_SWAP_STATES, asDelegateAckPayload, asDelegateSharePayload, asDelegateShareResponsePayload, asDepositConfirmedPayload, asDkgCompletePayload, asDkgInitPayload, asDkgInitResponsePayload, asDkgRound1Payload, asDkgRound1ResponsePayload, asDkgRound2Payload, asDkgRound2ResponsePayload, asErrorPayload, asLpCommandResponsePayload, asPayoutExecutedPayload, asSwapRequestPayload, asSwapRequestResponsePayload, asSyncRequiredPayload, asSyncUserRequestPayload, asSyncUserResponsePayload, asWithdrawAcceptedPayload, asWithdrawExecutedPayload, asWithdrawRequestPayload, decode, encode, encodeLpCommandForSigning, encodeValidated, isAllowedInState, isAllowedKindForType, isPayoutWindowId, isValidEnvelopeKind, isValidErrorCode, isValidMessageType, isValidSwapState, lpSignedCommandEnvelope, nextState, payloadCategory, payoutWindowLabelForId, payoutWindowOptionById, safeEncode, scheduledPayoutWindowOptions, scheduledPayoutWindowSeconds } from './chunk-3TGQ4CZ3.js';
|
|
2
2
|
import './chunk-VR6T6OJS.js';
|
|
3
|
-
//# sourceMappingURL=coordinator-
|
|
4
|
-
//# sourceMappingURL=coordinator-
|
|
3
|
+
//# sourceMappingURL=coordinator-PEWHNZ7I.js.map
|
|
4
|
+
//# sourceMappingURL=coordinator-PEWHNZ7I.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"coordinator-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"coordinator-PEWHNZ7I.js"}
|
package/dist/events.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { onEnvelope, EnvelopeKind, CoordinatorMessageType } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import { NotImplementedError } from './chunk-
|
|
1
|
+
import { onEnvelope, EnvelopeKind, CoordinatorMessageType } from './chunk-3MDHAS4D.js';
|
|
2
|
+
import './chunk-HJFMDMPY.js';
|
|
3
|
+
import { NotImplementedError } from './chunk-QRN46R3F.js';
|
|
4
4
|
import './chunk-VR6T6OJS.js';
|
|
5
5
|
|
|
6
6
|
// src/events/index.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S as Session } from './session-DFuy54C-.js';
|
|
2
2
|
export { i as isAttested } from './session-DFuy54C-.js';
|
|
3
|
-
export { A as AttestationError, a as AttestationErrorCode, C as CommandError, b as CommandErrorCode, c as CommandErrorOptions, d as CoordinatorWireErrorCode, I as InvalidDepositAmountError, e as InvisibleError, f as InvisibleErrorCode, g as InvisibleErrorOptions, L as LpLifecycleError, h as LpLifecycleErrorCode, i as LpPositionView, N as NotImplementedError, j as NotImplementedErrorCode, k as PayoutDestination, P as PayoutPolicy, l as PolicyValidationError, m as PolicyValidationErrorCode, R as RoutingError, n as RoutingErrorCode, S as StorageEnvelope,
|
|
3
|
+
export { A as AttestationError, a as AttestationErrorCode, C as CommandError, b as CommandErrorCode, c as CommandErrorOptions, d as CoordinatorWireErrorCode, I as InvalidDepositAmountError, e as InvisibleError, f as InvisibleErrorCode, g as InvisibleErrorOptions, L as LpLifecycleError, h as LpLifecycleErrorCode, i as LpPositionView, N as NotImplementedError, j as NotImplementedErrorCode, k as PayoutDestination, P as PayoutPolicy, l as PolicyValidationError, m as PolicyValidationErrorCode, R as RoutingError, n as RoutingErrorCode, o as RuntimeMeasurements, S as StorageEnvelope, p as StorageError, q as StorageErrorCode, r as StorageErrorOptions, s as StorageErrorPhase, T as TransportError, t as TransportErrorCode, W as WalletError, u as WalletErrorCode, v as isInvisibleError, w as normalizeError } from './types.generated-YhFu9ZBR.js';
|
|
4
4
|
import { T as Transport, N as NoiseWebSocketTransportOptions, U as Unsubscribe } from './types-ZhV7TIQY.js';
|
|
5
5
|
export { C as ConnectionState, W as WebSocketFactory, a as WebSocketLike } from './types-ZhV7TIQY.js';
|
|
6
6
|
|
|
@@ -153,6 +153,8 @@ interface PublicCreateSessionOptions {
|
|
|
153
153
|
readonly coordinatorUrl: string;
|
|
154
154
|
readonly storage?: unknown;
|
|
155
155
|
readonly wallet?: unknown;
|
|
156
|
+
/** Opt into SDK-owned normal-user transfer persistence. */
|
|
157
|
+
readonly clientPersistence?: boolean;
|
|
156
158
|
}
|
|
157
159
|
/**
|
|
158
160
|
* Open a production-only public SDK session.
|
|
@@ -175,6 +177,8 @@ declare function createSession(options: PublicCreateSessionOptions): Promise<Ses
|
|
|
175
177
|
*/
|
|
176
178
|
declare function assertAttested(session: Session): void;
|
|
177
179
|
|
|
180
|
+
type CoordinatorRuntimeProfile = "prod-hardened" | "prod-devnet-simplified" | "prod-devnet-simplified-locked" | "azure-tdx-v0-agentless";
|
|
181
|
+
|
|
178
182
|
/**
|
|
179
183
|
* Session-establishment seams layered on top of an open {@link Transport}.
|
|
180
184
|
*
|
|
@@ -200,7 +204,7 @@ interface AttestationResult {
|
|
|
200
204
|
/** Coordinator binary hash reported by the verified attestation response. */
|
|
201
205
|
readonly binaryHash: string;
|
|
202
206
|
/** Compile-time runtime profile carried by the attested coordinator artifact. */
|
|
203
|
-
readonly runtimeProfile?: "prod-hardened" | "prod-devnet-simplified";
|
|
207
|
+
readonly runtimeProfile?: "prod-hardened" | "prod-devnet-simplified" | "prod-devnet-simplified-locked" | "azure-tdx-v0-agentless";
|
|
204
208
|
/** Noise static public key bound into the attestation quote. */
|
|
205
209
|
readonly pubkeyHex: string;
|
|
206
210
|
/** True only for explicit loopback local development attestation. */
|
|
@@ -216,13 +220,19 @@ interface AttestationResult {
|
|
|
216
220
|
interface PublicProductionReleasePolicy {
|
|
217
221
|
readonly expectedMrtd: string;
|
|
218
222
|
readonly expectedBinaryHash: string;
|
|
219
|
-
readonly expectedRuntimeProfile:
|
|
223
|
+
readonly expectedRuntimeProfile: CoordinatorRuntimeProfile;
|
|
220
224
|
}
|
|
221
225
|
|
|
222
226
|
interface PublicAttestationPolicy {
|
|
223
227
|
readonly expectedMrtd: string;
|
|
224
228
|
readonly expectedBinaryHash?: string;
|
|
225
|
-
readonly expectedRuntimeProfile?: "prod-hardened" | "prod-devnet-simplified";
|
|
229
|
+
readonly expectedRuntimeProfile?: "prod-hardened" | "prod-devnet-simplified" | "prod-devnet-simplified-locked" | "azure-tdx-v0-agentless";
|
|
230
|
+
readonly expectedRuntimeMeasurements?: {
|
|
231
|
+
readonly rtmr0: string;
|
|
232
|
+
readonly rtmr1: string;
|
|
233
|
+
readonly rtmr2: string;
|
|
234
|
+
readonly rtmr3: string;
|
|
235
|
+
};
|
|
226
236
|
readonly intelRootFingerprint?: string;
|
|
227
237
|
readonly azureMaa?: {
|
|
228
238
|
readonly expectedIssuer: string;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { createStateController, createSessionInternal, isLoopbackUrl, reattestSerialized } from './chunk-
|
|
2
|
-
export { closeSession, createExponentialBackoff, noiseWebSocketTransport } from './chunk-
|
|
3
|
-
export { assertAttested, hex, lamports, publicKey, requestId } from './chunk-
|
|
4
|
-
import { getSessionState, failSessionClosed } from './chunk-
|
|
5
|
-
import
|
|
6
|
-
import './chunk-
|
|
7
|
-
|
|
8
|
-
export { AttestationError, CommandError, InvalidDepositAmountError, InvisibleError, LpLifecycleError, NotImplementedError, PolicyValidationError, RoutingError, StorageError, TransportError, WalletError, isInvisibleError, normalizeError } from './chunk-GHBQF3A7.js';
|
|
1
|
+
import { createStateController, createSessionInternal, isLoopbackUrl, reattestSerialized, INTEL_SGX_ROOT_CA_FINGERPRINT_SHA256 } from './chunk-Y7AK6RBV.js';
|
|
2
|
+
export { closeSession, createExponentialBackoff, noiseWebSocketTransport } from './chunk-Y7AK6RBV.js';
|
|
3
|
+
export { assertAttested, hex, lamports, publicKey, requestId } from './chunk-EBWTAXNT.js';
|
|
4
|
+
import { getSessionState, failSessionClosed } from './chunk-HJFMDMPY.js';
|
|
5
|
+
import './chunk-DCTYBUY3.js';
|
|
6
|
+
import { TransportError, NotImplementedError } from './chunk-QRN46R3F.js';
|
|
7
|
+
export { AttestationError, CommandError, InvalidDepositAmountError, InvisibleError, LpLifecycleError, NotImplementedError, PolicyValidationError, RoutingError, StorageError, TransportError, WalletError, isInvisibleError, normalizeError } from './chunk-QRN46R3F.js';
|
|
9
8
|
import './chunk-VR6T6OJS.js';
|
|
10
9
|
|
|
11
10
|
// src/core/version.ts
|
|
@@ -52,8 +51,61 @@ function inMemoryTransport(options = {}) {
|
|
|
52
51
|
};
|
|
53
52
|
}
|
|
54
53
|
|
|
54
|
+
// src/presets/azure-prod-maa.generated.ts
|
|
55
|
+
var AZURE_PROD_MAA_TRUST = {
|
|
56
|
+
issuer: "https://sharedweu.weu.attest.azure.net",
|
|
57
|
+
jwksUrl: "https://sharedweu.weu.attest.azure.net/certs",
|
|
58
|
+
policyHash: "9NY0VnTQ-IiBriBplVUpFbczcDaEBUwsiFYAzHu_gco"};
|
|
59
|
+
var configuredRuntimeProfile = "prod-devnet-simplified-locked" ;
|
|
60
|
+
var APPROVED_PRODUCTION_RUNTIME_PROFILE = configuredRuntimeProfile ;
|
|
61
|
+
|
|
62
|
+
// src/presets/production.ts
|
|
63
|
+
var AZURE_PROD_COORDINATOR_MRTD = "a2e61f1316e9e367e9c1f7a0adc98c48eb13875c399c85d286cee5ea2b05e57f2df9f61d903b0ae7ac5607d843dfffc1";
|
|
64
|
+
var AZURE_PROD_RUNTIME_PROFILE = APPROVED_PRODUCTION_RUNTIME_PROFILE;
|
|
65
|
+
var BINARY_HASH_HEX = /^[0-9a-f]{64}$/i;
|
|
66
|
+
var MRTD_HEX = /^[0-9a-f]{96}$/i;
|
|
67
|
+
var AZURE_PROD_RELEASE_PIN = {
|
|
68
|
+
mrtd: AZURE_PROD_COORDINATOR_MRTD,
|
|
69
|
+
runtimeProfile: AZURE_PROD_RUNTIME_PROFILE,
|
|
70
|
+
intelRootFingerprint: INTEL_SGX_ROOT_CA_FINGERPRINT_SHA256,
|
|
71
|
+
azureMaa: {
|
|
72
|
+
issuer: AZURE_PROD_MAA_TRUST.issuer,
|
|
73
|
+
jwksUrl: AZURE_PROD_MAA_TRUST.jwksUrl,
|
|
74
|
+
policyHash: AZURE_PROD_MAA_TRUST.policyHash
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
function assertApprovedBinaryHash(value) {
|
|
78
|
+
const binaryHash = typeof value === "string" ? value.toLowerCase() : "";
|
|
79
|
+
if (!BINARY_HASH_HEX.test(binaryHash)) {
|
|
80
|
+
throw new Error("an approved 64-character binary SHA-256 hash is required");
|
|
81
|
+
}
|
|
82
|
+
return binaryHash;
|
|
83
|
+
}
|
|
84
|
+
function assertApprovedMrtd(value) {
|
|
85
|
+
const mrtd = typeof value === "string" ? value.toLowerCase() : "";
|
|
86
|
+
if (!MRTD_HEX.test(mrtd)) {
|
|
87
|
+
throw new Error("an approved 96-character production MRTD is required");
|
|
88
|
+
}
|
|
89
|
+
return mrtd;
|
|
90
|
+
}
|
|
91
|
+
function createAzureProductionEndpoint({
|
|
92
|
+
wsUrl,
|
|
93
|
+
expectedHostname,
|
|
94
|
+
approvedBinaryHash,
|
|
95
|
+
approvedMrtd = AZURE_PROD_COORDINATOR_MRTD
|
|
96
|
+
}) {
|
|
97
|
+
const binaryHash = assertApprovedBinaryHash(approvedBinaryHash);
|
|
98
|
+
const mrtd = assertApprovedMrtd(approvedMrtd);
|
|
99
|
+
return {
|
|
100
|
+
wsUrl,
|
|
101
|
+
expectedHostname,
|
|
102
|
+
releasePin: { ...AZURE_PROD_RELEASE_PIN, mrtd, binaryHash },
|
|
103
|
+
requiredMode: "prod"
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
55
107
|
// src/presets/productionBinaryHash.ts
|
|
56
|
-
var APPROVED_PRODUCTION_COORDINATOR_BINARY_HASH = "
|
|
108
|
+
var APPROVED_PRODUCTION_COORDINATOR_BINARY_HASH = "e08f16d1c303f402e8210302e85ff8ce497e4152d7511143849c7771d56a1663".toLowerCase() ;
|
|
57
109
|
|
|
58
110
|
// src/presets/productionMrtd.ts
|
|
59
111
|
var APPROVED_PRODUCTION_COORDINATOR_MRTD = "a2e61f1316e9e367e9c1f7a0adc98c48eb13875c399c85d286cee5ea2b05e57f2df9f61d903b0ae7ac5607d843dfffc1".toLowerCase() ;
|
|
@@ -68,7 +120,12 @@ function publicProductionReleasePolicy() {
|
|
|
68
120
|
}
|
|
69
121
|
|
|
70
122
|
// src/session/publicSession.ts
|
|
71
|
-
var PUBLIC_SESSION_OPTION_KEYS = /* @__PURE__ */ new Set([
|
|
123
|
+
var PUBLIC_SESSION_OPTION_KEYS = /* @__PURE__ */ new Set([
|
|
124
|
+
"coordinatorUrl",
|
|
125
|
+
"storage",
|
|
126
|
+
"wallet",
|
|
127
|
+
"clientPersistence"
|
|
128
|
+
]);
|
|
72
129
|
var PUBLIC_COORDINATOR_URL_PROTOCOL = "wss:";
|
|
73
130
|
var PUBLIC_COORDINATOR_URL_ERROR = "public SDK createSession requires a non-loopback wss:// coordinatorUrl";
|
|
74
131
|
async function createSession(options) {
|
|
@@ -84,7 +141,8 @@ async function createSession(options) {
|
|
|
84
141
|
const internalOptions = {
|
|
85
142
|
coordinator: { endpoints: [endpoint] },
|
|
86
143
|
...options.storage === void 0 ? {} : { storage: options.storage },
|
|
87
|
-
...options.wallet === void 0 ? {} : { wallet: options.wallet }
|
|
144
|
+
...options.wallet === void 0 ? {} : { wallet: options.wallet },
|
|
145
|
+
...options.clientPersistence === void 0 ? {} : { clientPersistence: options.clientPersistence }
|
|
88
146
|
};
|
|
89
147
|
return createSessionInternal(internalOptions);
|
|
90
148
|
}
|
|
@@ -101,6 +159,10 @@ function assertPublicOptions(options) {
|
|
|
101
159
|
if (typeof coordinatorUrl !== "string") {
|
|
102
160
|
throw new TypeError("public SDK createSession requires coordinatorUrl");
|
|
103
161
|
}
|
|
162
|
+
const clientPersistence = options.clientPersistence;
|
|
163
|
+
if (clientPersistence !== void 0 && typeof clientPersistence !== "boolean") {
|
|
164
|
+
throw new TypeError("public SDK createSession clientPersistence must be a boolean");
|
|
165
|
+
}
|
|
104
166
|
}
|
|
105
167
|
function parsePublicCoordinatorUrl(value) {
|
|
106
168
|
let parsed;
|
|
@@ -145,6 +207,7 @@ var attestation = {
|
|
|
145
207
|
expectedMrtd: pin.mrtd,
|
|
146
208
|
...pin.binaryHash === void 0 ? {} : { expectedBinaryHash: pin.binaryHash },
|
|
147
209
|
...pin.runtimeProfile === void 0 ? {} : { expectedRuntimeProfile: pin.runtimeProfile },
|
|
210
|
+
...pin.runtimeMeasurements === void 0 ? {} : { expectedRuntimeMeasurements: pin.runtimeMeasurements },
|
|
148
211
|
...pin.intelRootFingerprint === void 0 ? {} : { intelRootFingerprint: pin.intelRootFingerprint },
|
|
149
212
|
...pin.azureMaa === void 0 ? {} : {
|
|
150
213
|
azureMaa: {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/version.ts","../src/core/session.ts","../src/transport/inMemoryTransport.ts","../src/presets/productionBinaryHash.ts","../src/presets/productionMrtd.ts","../src/session/publicReleasePolicy.ts","../src/session/publicSession.ts","../src/attestation/public.ts","../src/coordinator/public.ts"],"names":[],"mappings":";;;;;;;;;;;AAIO,IAAM,UAAA,GAAa;;;AC2BnB,SAAS,WAAW,OAAA,EAA2B;AACpD,EAAA,OAAO,OAAA,CAAQ,QAAA;AACjB;;;ACEO,SAAS,iBAAA,CAAkB,OAAA,GAAoC,EAAC,EAA4B;AACjG,EAAA,MAAM,EAAA,GAAK,sBAAsB,MAAM,CAAA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esContent":["/**\n * The API surface version this build implements. Bumped only on a breaking\n * surface change. See docs/sdk-specification.md section 12.\n */\nexport const apiVersion = \"v0\" as const;\n\n/** Literal type of {@link apiVersion}. */\nexport type ApiVersion = typeof apiVersion;\n","/**\n * The opaque session handle.\n *\n * A `Session` is the single stateful object the functional surface threads\n * through every call: `fn(session, args)`. It owns the transport, the\n * attestation state, and (later) the leader-epoch bookkeeping. Consumers treat\n * it as opaque - they read `session.attested` and pass it back to SDK\n * functions, but never reach inside. The internal state map and constructor\n * live alongside `createSession` (added in a later ticket); this module only\n * fixes the public shape so the rest of the surface can type against it.\n */\n\ndeclare const sessionBrand: unique symbol;\n\n/**\n * Opaque, attested session handle. Obtain one from `createSession`; pass it as\n * the first argument to every actor command. The only field consumers read is\n * {@link Session.attested}.\n */\nexport interface Session {\n /**\n * Whether the current Noise session has passed full TDX attestation. Sensitive\n * commands refuse to run until this is `true`. Re-handshake or failover resets\n * it to `false` until a fresh attestation completes.\n */\n readonly attested: boolean;\n /** @internal Opacity brand; not constructable by consumers. */\n readonly [sessionBrand]: true;\n}\n\n/** Convenience predicate mirroring {@link Session.attested}. */\nexport function isAttested(session: Session): boolean {\n return session.attested;\n}\n","/**\n * In-memory transport.\n *\n * A zero-network channel used by unit tests. It transitions straight to `open`\n * on connect. `send` delivers the raw frame bytes to an optional peer sink: the\n * WebSocket message boundary is the frame boundary, so there is no extra length\n * prefix (matching the production transport). Noise lives above this pure byte\n * channel, never inside it.\n *\n * With no peer wired in, `send` is a silent no-op (legacy stub behaviour for\n * tests that never exchange frames). A paired loopback coordinator supplies a\n * `peer` sink so a real Noise XX handshake can run in-process (see the\n * `testLoopback` fixture).\n */\n\nimport { TransportError } from \"../core/errors.js\";\nimport { createStateController } from \"./stateController.js\";\nimport type { Transport, Unsubscribe } from \"./types.js\";\n\n/** Options for {@link inMemoryTransport}. Test-only paired-loopback wiring. */\nexport interface InMemoryTransportOptions {\n /**\n * Sink for frames written via `send()`. A paired in-process coordinator sets\n * this so the client's raw bytes reach the responder. When omitted, `send`\n * is a no-op so legacy stub-only tests keep working.\n */\n readonly peer?: (frame: Uint8Array) => void;\n}\n\n/** In-memory transport with a hook to feed inbound frames into `onMessage`. */\nexport interface InMemoryTransportHandle extends Transport {\n /** Deliver a frame to this transport's `onMessage` listeners (peer -> client). */\n readonly deliver: (frame: Uint8Array) => void;\n}\n\nexport function inMemoryTransport(options: InMemoryTransportOptions = {}): InMemoryTransportHandle {\n const sc = createStateController(\"idle\");\n const messageListeners = new Set<(frame: Uint8Array) => void>();\n\n return {\n state: () => sc.get(),\n onStateChange: (listener) => sc.onChange(listener),\n onMessage(listener): Unsubscribe {\n messageListeners.add(listener);\n return () => messageListeners.delete(listener);\n },\n deliver(frame: Uint8Array): void {\n for (const listener of messageListeners) listener(frame);\n },\n async connect(signal) {\n if (signal?.aborted) {\n throw new TransportError(\"CONNECTION_LOST\", \"connect aborted before it started\");\n }\n if (sc.get() === \"open\") return;\n sc.set(\"connecting\");\n sc.set(\"open\");\n },\n send(frame: Uint8Array): void {\n if (sc.get() !== \"open\") {\n throw new TransportError(\"CONNECTION_LOST\", \"cannot send on a non-open transport\");\n }\n options.peer?.(frame);\n },\n close() {\n if (sc.get() === \"closed\") return;\n sc.set(\"closing\");\n sc.set(\"closed\");\n },\n };\n}\n","/** Build-time projection of the approved coordinator binary hash. */\n\ndeclare const __INVISIBLE_SDK_PRODUCTION_BINARY_HASH__: string | undefined;\n\nexport const APPROVED_PRODUCTION_COORDINATOR_BINARY_HASH =\n typeof __INVISIBLE_SDK_PRODUCTION_BINARY_HASH__ === \"string\"\n ? __INVISIBLE_SDK_PRODUCTION_BINARY_HASH__.toLowerCase()\n : \"\";\n","/** Build-time projection of the approved production coordinator MRTD. */\n\ndeclare const __INVISIBLE_SDK_PRODUCTION_MRTD__: string | undefined;\n\nexport const APPROVED_PRODUCTION_COORDINATOR_MRTD =\n typeof __INVISIBLE_SDK_PRODUCTION_MRTD__ === \"string\"\n ? __INVISIBLE_SDK_PRODUCTION_MRTD__.toLowerCase()\n : \"\";\n","import { APPROVED_PRODUCTION_COORDINATOR_BINARY_HASH } from \"../presets/productionBinaryHash.js\";\nimport { APPROVED_PRODUCTION_COORDINATOR_MRTD } from \"../presets/productionMrtd.js\";\nimport { APPROVED_PRODUCTION_RUNTIME_PROFILE } from \"../presets/productionRuntimeProfile.js\";\n\nexport interface PublicProductionReleasePolicy {\n readonly expectedMrtd: string;\n readonly expectedBinaryHash: string;\n readonly expectedRuntimeProfile: \"prod-hardened\" | \"prod-devnet-simplified\";\n}\n\n/** The build-bound production tuple used by the public session constructor. */\nexport function publicProductionReleasePolicy(): PublicProductionReleasePolicy {\n return {\n expectedMrtd: APPROVED_PRODUCTION_COORDINATOR_MRTD,\n expectedBinaryHash: APPROVED_PRODUCTION_COORDINATOR_BINARY_HASH,\n expectedRuntimeProfile: APPROVED_PRODUCTION_RUNTIME_PROFILE,\n };\n}\n","import type { Session } from \"../core/session.js\";\nimport { createAzureProductionEndpoint } from \"../presets/production.js\";\nimport { isLoopbackUrl } from \"./secureChannel.js\";\nimport { publicProductionReleasePolicy } from \"./publicReleasePolicy.js\";\nimport {\n closeSession,\n createSessionInternal,\n type CreateSessionOptions as InternalCreateSessionOptions,\n} from \"./createSession.js\";\n\nconst PUBLIC_SESSION_OPTION_KEYS = new Set([\"coordinatorUrl\", \"storage\", \"wallet\"]);\nconst PUBLIC_COORDINATOR_URL_PROTOCOL = \"wss:\";\nconst PUBLIC_COORDINATOR_URL_ERROR =\n \"public SDK createSession requires a non-loopback wss:// coordinatorUrl\";\n\nexport interface PublicCreateSessionOptions {\n readonly coordinatorUrl: string;\n readonly storage?: unknown;\n readonly wallet?: unknown;\n}\n\n/**\n * Open a production-only public SDK session.\n *\n * The caller supplies only the route and public adapters. The Azure\n * production release policy is embedded by the selected SDK build.\n */\nexport async function createSession(options: PublicCreateSessionOptions): Promise<Session> {\n assertPublicOptions(options);\n const parsedUrl = parsePublicCoordinatorUrl(options.coordinatorUrl);\n const releasePolicy = publicProductionReleasePolicy();\n const endpoint = createAzureProductionEndpoint({\n wsUrl: options.coordinatorUrl,\n expectedHostname: parsedUrl.hostname,\n approvedBinaryHash: releasePolicy.expectedBinaryHash,\n approvedMrtd: releasePolicy.expectedMrtd,\n });\n\n const internalOptions: InternalCreateSessionOptions = {\n coordinator: { endpoints: [endpoint] },\n ...(options.storage === undefined ? {} : { storage: options.storage }),\n ...(options.wallet === undefined ? {} : { wallet: options.wallet }),\n };\n return createSessionInternal(internalOptions);\n}\n\nexport { closeSession };\n\nfunction assertPublicOptions(options: unknown): asserts options is PublicCreateSessionOptions {\n if (typeof options !== \"object\" || options === null || Array.isArray(options)) {\n throw new TypeError(\"public SDK createSession options must be an object\");\n }\n for (const key of Object.keys(options)) {\n if (!PUBLIC_SESSION_OPTION_KEYS.has(key)) {\n throw new Error(`public SDK createSession does not accept option ${key}`);\n }\n }\n const coordinatorUrl = (options as { coordinatorUrl?: unknown }).coordinatorUrl;\n if (typeof coordinatorUrl !== \"string\") {\n throw new TypeError(\"public SDK createSession requires coordinatorUrl\");\n }\n}\n\nfunction parsePublicCoordinatorUrl(value: string): URL {\n let parsed: URL;\n try {\n parsed = new URL(value);\n } catch (cause) {\n const error = new Error(PUBLIC_COORDINATOR_URL_ERROR);\n (error as { cause?: unknown }).cause = cause;\n throw error;\n }\n if (parsed.protocol !== PUBLIC_COORDINATOR_URL_PROTOCOL || isLoopbackUrl(value)) {\n throw new Error(PUBLIC_COORDINATOR_URL_ERROR);\n }\n return parsed;\n}\n","import type { Session } from \"../core/session.js\";\nimport type { AttestationResult } from \"../transport/handshake.js\";\nimport type { Unsubscribe } from \"../transport/types.js\";\nimport { reattestSerialized } from \"./reattest.js\";\nimport { failSessionClosed, getSessionState } from \"../session/state.js\";\nimport {\n publicProductionReleasePolicy,\n type PublicProductionReleasePolicy,\n} from \"../session/publicReleasePolicy.js\";\n\nexport type { AttestationResult } from \"../transport/handshake.js\";\n\nexport interface PublicAttestationPolicy {\n readonly expectedMrtd: string;\n readonly expectedBinaryHash?: string;\n readonly expectedRuntimeProfile?: \"prod-hardened\" | \"prod-devnet-simplified\";\n readonly intelRootFingerprint?: string;\n readonly azureMaa?: {\n readonly expectedIssuer: string;\n readonly expectedJwksUrl: string;\n readonly expectedPolicyHash: string;\n };\n}\n\n/** Public attestation read controls. Policy construction remains internal. */\nexport const attestation = {\n productionPolicy(): PublicProductionReleasePolicy {\n return publicProductionReleasePolicy();\n },\n\n async assertValid(session: Session): Promise<AttestationResult> {\n const state = getSessionState(session);\n const endpoint = state.pool.endpoints[0]!;\n try {\n const result = await reattestSerialized(state, endpoint, state.pool.noiseTransportTimeoutMs);\n state.attestation = result;\n state.attested = true;\n return result;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n failSessionClosed(state, error);\n throw error;\n }\n },\n\n current(session: Session): AttestationResult | null {\n return getSessionState(session).attestation;\n },\n\n policy(session: Session): PublicAttestationPolicy {\n const pin = getSessionState(session).pool.endpoints[0]!.releasePin;\n return {\n expectedMrtd: pin.mrtd,\n ...(pin.binaryHash === undefined ? {} : { expectedBinaryHash: pin.binaryHash }),\n ...(pin.runtimeProfile === undefined ? {} : { expectedRuntimeProfile: pin.runtimeProfile }),\n ...(pin.intelRootFingerprint === undefined\n ? {}\n : { intelRootFingerprint: pin.intelRootFingerprint }),\n ...(pin.azureMaa === undefined\n ? {}\n : {\n azureMaa: {\n expectedIssuer: pin.azureMaa.issuer,\n expectedJwksUrl: pin.azureMaa.jwksUrl,\n expectedPolicyHash: pin.azureMaa.policyHash,\n },\n }),\n };\n },\n\n onPolicyViolation(session: Session, handler: (error: Error) => void): Unsubscribe {\n const handlers = getSessionState(session).policyViolationHandlers;\n handlers.add(handler);\n return () => handlers.delete(handler);\n },\n};\n","import { NotImplementedError } from \"../core/errors.js\";\nimport type { Session } from \"../core/session.js\";\nimport { getSessionState } from \"../session/state.js\";\n\nexport interface PublicCoordinatorEndpoint {\n readonly coordinatorUrl: string;\n readonly roleHint?: \"leader\" | \"watcher\";\n readonly weight?: number;\n}\n\nexport interface CoordinatorVersion {\n readonly mode: \"prod\" | \"dev\";\n readonly protocolVersion: string;\n readonly schemaVersion: string;\n readonly hostname: string;\n readonly leaderEpoch: number;\n}\n\nexport const coordinator = {\n endpoints(session: Session): readonly PublicCoordinatorEndpoint[] {\n return getSessionState(session).pool.endpoints.map((endpoint) => ({\n coordinatorUrl: endpoint.wsUrl,\n ...(endpoint.roleHint === undefined ? {} : { roleHint: endpoint.roleHint }),\n ...(endpoint.weight === undefined ? {} : { weight: endpoint.weight }),\n }));\n },\n\n currentLeader(_session: Session): Promise<PublicCoordinatorEndpoint | null> {\n return Promise.reject(new NotImplementedError(\"coordinator.currentLeader\"));\n },\n\n version(_session: Session): Promise<CoordinatorVersion> {\n return Promise.reject(new NotImplementedError(\"coordinator.version\"));\n },\n\n forceFailover(_session: Session): Promise<void> {\n return Promise.reject(new NotImplementedError(\"coordinator.forceFailover\"));\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/core/version.ts","../src/core/session.ts","../src/transport/inMemoryTransport.ts","../src/presets/azure-prod-maa.generated.ts","../src/presets/productionRuntimeProfile.ts","../src/presets/production.ts","../src/presets/productionBinaryHash.ts","../src/presets/productionMrtd.ts","../src/session/publicReleasePolicy.ts","../src/session/publicSession.ts","../src/attestation/public.ts","../src/coordinator/public.ts"],"names":[],"mappings":";;;;;;;;;;AAIO,IAAM,UAAA,GAAa;;;AC2BnB,SAAS,WAAW,OAAA,EAA2B;AACpD,EAAA,OAAO,OAAA,CAAQ,QAAA;AACjB;;;ACEO,SAAS,iBAAA,CAAkB,OAAA,GAAoC,EAAC,EAA4B;AACjG,EAAA,MAAM,EAAA,GAAK,sBAAsB,MAAM,CAAA;AACvC,EAAA,MAAM,gBAAA,uBAAuB,GAAA,EAAiC;AAE9D,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,MAAM,EAAA,CAAG,GAAA,EAAI;AAAA,IACpB,aAAA,EAAe,CAA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,QAAA,EAAU,QAAA,CAAS,QAAA,EAAS;AAAA,MACzE,GAAI,SAAS,MAAA,KAAW,MAAA,GAAY,EAAC,GAAI,EAAE,MAAA,EAAQ,QAAA,CAAS,MAAA;AAAO,KACrE,CAAE,CAAA;AAAA,EACJ,CAAA;AAAA,EAEA,cAAc,QAAA,EAA8D;AAC1E,IAAA,OAAO,OAAA,CAAQ,MAAA,CAAO,IAAI,mBAAA,CAAoB,2BAA2B,CAAC,CAAA;AAAA,EAC5E,CAAA;AAAA,EAEA,QAAQ,QAAA,EAAgD;AACtD,IAAA,OAAO,OAAA,CAAQ,MAAA,CAAO,IAAI,mBAAA,CAAoB,qBAAqB,CAAC,CAAA;AAAA,EACtE,CAAA;AAAA,EAEA,cAAc,QAAA,EAAkC;AAC9C,IAAA,OAAO,OAAA,CAAQ,MAAA,CAAO,IAAI,mBAAA,CAAoB,2BAA2B,CAAC,CAAA;AAAA,EAC5E;AACF","file":"index.js","sourcesContent":["/**\n * The API surface version this build implements. Bumped only on a breaking\n * surface change. See docs/sdk-specification.md section 12.\n */\nexport const apiVersion = \"v0\" as const;\n\n/** Literal type of {@link apiVersion}. */\nexport type ApiVersion = typeof apiVersion;\n","/**\n * The opaque session handle.\n *\n * A `Session` is the single stateful object the functional surface threads\n * through every call: `fn(session, args)`. It owns the transport, the\n * attestation state, and (later) the leader-epoch bookkeeping. Consumers treat\n * it as opaque - they read `session.attested` and pass it back to SDK\n * functions, but never reach inside. The internal state map and constructor\n * live alongside `createSession` (added in a later ticket); this module only\n * fixes the public shape so the rest of the surface can type against it.\n */\n\ndeclare const sessionBrand: unique symbol;\n\n/**\n * Opaque, attested session handle. Obtain one from `createSession`; pass it as\n * the first argument to every actor command. The only field consumers read is\n * {@link Session.attested}.\n */\nexport interface Session {\n /**\n * Whether the current Noise session has passed full TDX attestation. Sensitive\n * commands refuse to run until this is `true`. Re-handshake or failover resets\n * it to `false` until a fresh attestation completes.\n */\n readonly attested: boolean;\n /** @internal Opacity brand; not constructable by consumers. */\n readonly [sessionBrand]: true;\n}\n\n/** Convenience predicate mirroring {@link Session.attested}. */\nexport function isAttested(session: Session): boolean {\n return session.attested;\n}\n","/**\n * In-memory transport.\n *\n * A zero-network channel used by unit tests. It transitions straight to `open`\n * on connect. `send` delivers the raw frame bytes to an optional peer sink: the\n * WebSocket message boundary is the frame boundary, so there is no extra length\n * prefix (matching the production transport). Noise lives above this pure byte\n * channel, never inside it.\n *\n * With no peer wired in, `send` is a silent no-op (legacy stub behaviour for\n * tests that never exchange frames). A paired loopback coordinator supplies a\n * `peer` sink so a real Noise XX handshake can run in-process (see the\n * `testLoopback` fixture).\n */\n\nimport { TransportError } from \"../core/errors.js\";\nimport { createStateController } from \"./stateController.js\";\nimport type { Transport, Unsubscribe } from \"./types.js\";\n\n/** Options for {@link inMemoryTransport}. Test-only paired-loopback wiring. */\nexport interface InMemoryTransportOptions {\n /**\n * Sink for frames written via `send()`. A paired in-process coordinator sets\n * this so the client's raw bytes reach the responder. When omitted, `send`\n * is a no-op so legacy stub-only tests keep working.\n */\n readonly peer?: (frame: Uint8Array) => void;\n}\n\n/** In-memory transport with a hook to feed inbound frames into `onMessage`. */\nexport interface InMemoryTransportHandle extends Transport {\n /** Deliver a frame to this transport's `onMessage` listeners (peer -> client). */\n readonly deliver: (frame: Uint8Array) => void;\n}\n\nexport function inMemoryTransport(options: InMemoryTransportOptions = {}): InMemoryTransportHandle {\n const sc = createStateController(\"idle\");\n const messageListeners = new Set<(frame: Uint8Array) => void>();\n\n return {\n state: () => sc.get(),\n onStateChange: (listener) => sc.onChange(listener),\n onMessage(listener): Unsubscribe {\n messageListeners.add(listener);\n return () => messageListeners.delete(listener);\n },\n deliver(frame: Uint8Array): void {\n for (const listener of messageListeners) listener(frame);\n },\n async connect(signal) {\n if (signal?.aborted) {\n throw new TransportError(\"CONNECTION_LOST\", \"connect aborted before it started\");\n }\n if (sc.get() === \"open\") return;\n sc.set(\"connecting\");\n sc.set(\"open\");\n },\n send(frame: Uint8Array): void {\n if (sc.get() !== \"open\") {\n throw new TransportError(\"CONNECTION_LOST\", \"cannot send on a non-open transport\");\n }\n options.peer?.(frame);\n },\n close() {\n if (sc.get() === \"closed\") return;\n sc.set(\"closing\");\n sc.set(\"closed\");\n },\n };\n}\n","// Generated by npm run release:trust-policy:generate-sdk. Do not edit.\nexport const AZURE_PROD_MAA_TRUST = {\n issuer: \"https://sharedweu.weu.attest.azure.net\",\n jwksUrl: \"https://sharedweu.weu.attest.azure.net/certs\",\n policyHash: \"9NY0VnTQ-IiBriBplVUpFbczcDaEBUwsiFYAzHu_gco\",\n trustSetVersion: \"azure-prod-maa-v1\",\n} as const;\n","/** Build-time projection of the approved production runtime profile. */\n\nexport const DEFAULT_AZURE_PROD_RUNTIME_PROFILE = \"prod-devnet-simplified\" as const;\nexport const PROD_HARDENED_RUNTIME_PROFILE = \"prod-hardened\" as const;\nexport const PROD_DEVNET_SIMPLIFIED_RUNTIME_PROFILE = \"prod-devnet-simplified\" as const;\nexport const PROD_DEVNET_SIMPLIFIED_LOCKED_RUNTIME_PROFILE =\n \"prod-devnet-simplified-locked\" as const;\n\ndeclare const __INVISIBLE_SDK_PRODUCTION_RUNTIME_PROFILE__: string | undefined;\n\nconst configuredRuntimeProfile =\n typeof __INVISIBLE_SDK_PRODUCTION_RUNTIME_PROFILE__ === \"string\"\n ? __INVISIBLE_SDK_PRODUCTION_RUNTIME_PROFILE__\n : \"\";\n\nexport const APPROVED_PRODUCTION_RUNTIME_PROFILE =\n configuredRuntimeProfile === PROD_HARDENED_RUNTIME_PROFILE ||\n configuredRuntimeProfile === PROD_DEVNET_SIMPLIFIED_RUNTIME_PROFILE ||\n configuredRuntimeProfile === PROD_DEVNET_SIMPLIFIED_LOCKED_RUNTIME_PROFILE\n ? configuredRuntimeProfile\n : DEFAULT_AZURE_PROD_RUNTIME_PROFILE;\n","import { INTEL_SGX_ROOT_CA_FINGERPRINT_SHA256 } from \"../attestation/verifier.js\";\nimport type { CoordinatorEndpoint, CoordinatorReleasePin } from \"../schemas/types.generated.js\";\nimport { AZURE_PROD_MAA_TRUST } from \"./azure-prod-maa.generated.js\";\nimport { APPROVED_PRODUCTION_RUNTIME_PROFILE } from \"./productionRuntimeProfile.js\";\n\nexport const LOCAL_DEV_RELEASE_PIN_MRTD = \"local-dev-no-mrtd\";\n\nexport const PLACEHOLDER_RELEASE_PIN = {\n mrtd: \"\",\n intelRootFingerprint: \"\",\n} as const satisfies CoordinatorReleasePin;\n\nexport const AZURE_PROD_COORDINATOR_MRTD =\n \"a2e61f1316e9e367e9c1f7a0adc98c48eb13875c399c85d286cee5ea2b05e57f2df9f61d903b0ae7ac5607d843dfffc1\";\nexport const AZURE_PROD_RUNTIME_PROFILE = APPROVED_PRODUCTION_RUNTIME_PROFILE;\n\nconst BINARY_HASH_HEX = /^[0-9a-f]{64}$/i;\nconst MRTD_HEX = /^[0-9a-f]{96}$/i;\n\nconst AZURE_PROD_RELEASE_PIN = {\n mrtd: AZURE_PROD_COORDINATOR_MRTD,\n runtimeProfile: AZURE_PROD_RUNTIME_PROFILE,\n intelRootFingerprint: INTEL_SGX_ROOT_CA_FINGERPRINT_SHA256,\n azureMaa: {\n issuer: AZURE_PROD_MAA_TRUST.issuer,\n jwksUrl: AZURE_PROD_MAA_TRUST.jwksUrl,\n policyHash: AZURE_PROD_MAA_TRUST.policyHash,\n },\n} as const;\n\nexport function assertApprovedBinaryHash(value: string): string {\n const binaryHash = typeof value === \"string\" ? value.toLowerCase() : \"\";\n if (!BINARY_HASH_HEX.test(binaryHash)) {\n throw new Error(\"an approved 64-character binary SHA-256 hash is required\");\n }\n return binaryHash;\n}\n\nexport function assertApprovedMrtd(value: string): string {\n const mrtd = typeof value === \"string\" ? value.toLowerCase() : \"\";\n if (!MRTD_HEX.test(mrtd)) {\n throw new Error(\"an approved 96-character production MRTD is required\");\n }\n return mrtd;\n}\n\n/** Build the active Azure production policy for a concrete coordinator URL. */\nexport function createAzureProductionEndpoint({\n wsUrl,\n expectedHostname,\n approvedBinaryHash,\n approvedMrtd = AZURE_PROD_COORDINATOR_MRTD,\n}: {\n readonly wsUrl: string;\n readonly expectedHostname: string;\n readonly approvedBinaryHash: string;\n readonly approvedMrtd?: string;\n}): CoordinatorEndpoint {\n const binaryHash = assertApprovedBinaryHash(approvedBinaryHash);\n const mrtd = assertApprovedMrtd(approvedMrtd);\n return {\n wsUrl,\n expectedHostname,\n releasePin: { ...AZURE_PROD_RELEASE_PIN, mrtd, binaryHash },\n requiredMode: \"prod\",\n };\n}\n\n/** Build the explicit private dev/test policy. */\nexport function createDevelopmentEndpoint({\n wsUrl,\n expectedHostname,\n allowMissingDcapCollateral,\n}: {\n readonly wsUrl: string;\n readonly expectedHostname: string;\n readonly allowMissingDcapCollateral?: boolean;\n}): CoordinatorEndpoint {\n return {\n wsUrl,\n expectedHostname,\n releasePin: {\n ...PLACEHOLDER_RELEASE_PIN,\n ...(allowMissingDcapCollateral === true ? { allowMissingDcapCollateral: true } : {}),\n },\n requiredMode: \"dev\",\n };\n}\n","/** Build-time projection of the approved coordinator binary hash. */\n\ndeclare const __INVISIBLE_SDK_PRODUCTION_BINARY_HASH__: string | undefined;\n\nexport const APPROVED_PRODUCTION_COORDINATOR_BINARY_HASH =\n typeof __INVISIBLE_SDK_PRODUCTION_BINARY_HASH__ === \"string\"\n ? __INVISIBLE_SDK_PRODUCTION_BINARY_HASH__.toLowerCase()\n : \"\";\n","/** Build-time projection of the approved production coordinator MRTD. */\n\ndeclare const __INVISIBLE_SDK_PRODUCTION_MRTD__: string | undefined;\n\nexport const APPROVED_PRODUCTION_COORDINATOR_MRTD =\n typeof __INVISIBLE_SDK_PRODUCTION_MRTD__ === \"string\"\n ? __INVISIBLE_SDK_PRODUCTION_MRTD__.toLowerCase()\n : \"\";\n","import { APPROVED_PRODUCTION_COORDINATOR_BINARY_HASH } from \"../presets/productionBinaryHash.js\";\nimport { APPROVED_PRODUCTION_COORDINATOR_MRTD } from \"../presets/productionMrtd.js\";\nimport { APPROVED_PRODUCTION_RUNTIME_PROFILE } from \"../presets/productionRuntimeProfile.js\";\nimport type { CoordinatorRuntimeProfile } from \"../attestation/verifier.js\";\n\nexport interface PublicProductionReleasePolicy {\n readonly expectedMrtd: string;\n readonly expectedBinaryHash: string;\n readonly expectedRuntimeProfile: CoordinatorRuntimeProfile;\n}\n\n/** The build-bound production tuple used by the public session constructor. */\nexport function publicProductionReleasePolicy(): PublicProductionReleasePolicy {\n return {\n expectedMrtd: APPROVED_PRODUCTION_COORDINATOR_MRTD,\n expectedBinaryHash: APPROVED_PRODUCTION_COORDINATOR_BINARY_HASH,\n expectedRuntimeProfile: APPROVED_PRODUCTION_RUNTIME_PROFILE,\n };\n}\n","import type { Session } from \"../core/session.js\";\nimport { createAzureProductionEndpoint } from \"../presets/production.js\";\nimport { isLoopbackUrl } from \"./secureChannel.js\";\nimport { publicProductionReleasePolicy } from \"./publicReleasePolicy.js\";\nimport {\n closeSession,\n createSessionInternal,\n type CreateSessionOptions as InternalCreateSessionOptions,\n} from \"./createSession.js\";\n\nconst PUBLIC_SESSION_OPTION_KEYS = new Set([\n \"coordinatorUrl\",\n \"storage\",\n \"wallet\",\n \"clientPersistence\",\n]);\nconst PUBLIC_COORDINATOR_URL_PROTOCOL = \"wss:\";\nconst PUBLIC_COORDINATOR_URL_ERROR =\n \"public SDK createSession requires a non-loopback wss:// coordinatorUrl\";\n\nexport interface PublicCreateSessionOptions {\n readonly coordinatorUrl: string;\n readonly storage?: unknown;\n readonly wallet?: unknown;\n /** Opt into SDK-owned normal-user transfer persistence. */\n readonly clientPersistence?: boolean;\n}\n\n/**\n * Open a production-only public SDK session.\n *\n * The caller supplies only the route and public adapters. The Azure\n * production release policy is embedded by the selected SDK build.\n */\nexport async function createSession(options: PublicCreateSessionOptions): Promise<Session> {\n assertPublicOptions(options);\n const parsedUrl = parsePublicCoordinatorUrl(options.coordinatorUrl);\n const releasePolicy = publicProductionReleasePolicy();\n const endpoint = createAzureProductionEndpoint({\n wsUrl: options.coordinatorUrl,\n expectedHostname: parsedUrl.hostname,\n approvedBinaryHash: releasePolicy.expectedBinaryHash,\n approvedMrtd: releasePolicy.expectedMrtd,\n });\n\n const internalOptions: InternalCreateSessionOptions = {\n coordinator: { endpoints: [endpoint] },\n ...(options.storage === undefined ? {} : { storage: options.storage }),\n ...(options.wallet === undefined ? {} : { wallet: options.wallet }),\n ...(options.clientPersistence === undefined\n ? {}\n : { clientPersistence: options.clientPersistence }),\n };\n return createSessionInternal(internalOptions);\n}\n\nexport { closeSession };\n\nfunction assertPublicOptions(options: unknown): asserts options is PublicCreateSessionOptions {\n if (typeof options !== \"object\" || options === null || Array.isArray(options)) {\n throw new TypeError(\"public SDK createSession options must be an object\");\n }\n for (const key of Object.keys(options)) {\n if (!PUBLIC_SESSION_OPTION_KEYS.has(key)) {\n throw new Error(`public SDK createSession does not accept option ${key}`);\n }\n }\n const coordinatorUrl = (options as { coordinatorUrl?: unknown }).coordinatorUrl;\n if (typeof coordinatorUrl !== \"string\") {\n throw new TypeError(\"public SDK createSession requires coordinatorUrl\");\n }\n const clientPersistence = (options as { clientPersistence?: unknown }).clientPersistence;\n if (clientPersistence !== undefined && typeof clientPersistence !== \"boolean\") {\n throw new TypeError(\"public SDK createSession clientPersistence must be a boolean\");\n }\n}\n\nfunction parsePublicCoordinatorUrl(value: string): URL {\n let parsed: URL;\n try {\n parsed = new URL(value);\n } catch (cause) {\n const error = new Error(PUBLIC_COORDINATOR_URL_ERROR);\n (error as { cause?: unknown }).cause = cause;\n throw error;\n }\n if (parsed.protocol !== PUBLIC_COORDINATOR_URL_PROTOCOL || isLoopbackUrl(value)) {\n throw new Error(PUBLIC_COORDINATOR_URL_ERROR);\n }\n return parsed;\n}\n","import type { Session } from \"../core/session.js\";\nimport type { AttestationResult } from \"../transport/handshake.js\";\nimport type { Unsubscribe } from \"../transport/types.js\";\nimport { reattestSerialized } from \"./reattest.js\";\nimport { failSessionClosed, getSessionState } from \"../session/state.js\";\nimport {\n publicProductionReleasePolicy,\n type PublicProductionReleasePolicy,\n} from \"../session/publicReleasePolicy.js\";\n\nexport type { AttestationResult } from \"../transport/handshake.js\";\n\nexport interface PublicAttestationPolicy {\n readonly expectedMrtd: string;\n readonly expectedBinaryHash?: string;\n readonly expectedRuntimeProfile?:\n | \"prod-hardened\"\n | \"prod-devnet-simplified\"\n | \"prod-devnet-simplified-locked\"\n | \"azure-tdx-v0-agentless\";\n readonly expectedRuntimeMeasurements?: {\n readonly rtmr0: string;\n readonly rtmr1: string;\n readonly rtmr2: string;\n readonly rtmr3: string;\n };\n readonly intelRootFingerprint?: string;\n readonly azureMaa?: {\n readonly expectedIssuer: string;\n readonly expectedJwksUrl: string;\n readonly expectedPolicyHash: string;\n };\n}\n\n/** Public attestation read controls. Policy construction remains internal. */\nexport const attestation = {\n productionPolicy(): PublicProductionReleasePolicy {\n return publicProductionReleasePolicy();\n },\n\n async assertValid(session: Session): Promise<AttestationResult> {\n const state = getSessionState(session);\n const endpoint = state.pool.endpoints[0]!;\n try {\n const result = await reattestSerialized(state, endpoint, state.pool.noiseTransportTimeoutMs);\n state.attestation = result;\n state.attested = true;\n return result;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n failSessionClosed(state, error);\n throw error;\n }\n },\n\n current(session: Session): AttestationResult | null {\n return getSessionState(session).attestation;\n },\n\n policy(session: Session): PublicAttestationPolicy {\n const pin = getSessionState(session).pool.endpoints[0]!.releasePin;\n return {\n expectedMrtd: pin.mrtd,\n ...(pin.binaryHash === undefined ? {} : { expectedBinaryHash: pin.binaryHash }),\n ...(pin.runtimeProfile === undefined ? {} : { expectedRuntimeProfile: pin.runtimeProfile }),\n ...(pin.runtimeMeasurements === undefined\n ? {}\n : { expectedRuntimeMeasurements: pin.runtimeMeasurements }),\n ...(pin.intelRootFingerprint === undefined\n ? {}\n : { intelRootFingerprint: pin.intelRootFingerprint }),\n ...(pin.azureMaa === undefined\n ? {}\n : {\n azureMaa: {\n expectedIssuer: pin.azureMaa.issuer,\n expectedJwksUrl: pin.azureMaa.jwksUrl,\n expectedPolicyHash: pin.azureMaa.policyHash,\n },\n }),\n };\n },\n\n onPolicyViolation(session: Session, handler: (error: Error) => void): Unsubscribe {\n const handlers = getSessionState(session).policyViolationHandlers;\n handlers.add(handler);\n return () => handlers.delete(handler);\n },\n};\n","import { NotImplementedError } from \"../core/errors.js\";\nimport type { Session } from \"../core/session.js\";\nimport { getSessionState } from \"../session/state.js\";\n\nexport interface PublicCoordinatorEndpoint {\n readonly coordinatorUrl: string;\n readonly roleHint?: \"leader\" | \"watcher\";\n readonly weight?: number;\n}\n\nexport interface CoordinatorVersion {\n readonly mode: \"prod\" | \"dev\";\n readonly protocolVersion: string;\n readonly schemaVersion: string;\n readonly hostname: string;\n readonly leaderEpoch: number;\n}\n\nexport const coordinator = {\n endpoints(session: Session): readonly PublicCoordinatorEndpoint[] {\n return getSessionState(session).pool.endpoints.map((endpoint) => ({\n coordinatorUrl: endpoint.wsUrl,\n ...(endpoint.roleHint === undefined ? {} : { roleHint: endpoint.roleHint }),\n ...(endpoint.weight === undefined ? {} : { weight: endpoint.weight }),\n }));\n },\n\n currentLeader(_session: Session): Promise<PublicCoordinatorEndpoint | null> {\n return Promise.reject(new NotImplementedError(\"coordinator.currentLeader\"));\n },\n\n version(_session: Session): Promise<CoordinatorVersion> {\n return Promise.reject(new NotImplementedError(\"coordinator.version\"));\n },\n\n forceFailover(_session: Session): Promise<void> {\n return Promise.reject(new NotImplementedError(\"coordinator.forceFailover\"));\n },\n};\n"]}
|
package/dist/lp.d.ts
CHANGED
|
@@ -45,8 +45,14 @@ type LpPositionView = {
|
|
|
45
45
|
refillThreshold: number;
|
|
46
46
|
shards: LpInventoryShard[];
|
|
47
47
|
createdAt: number;
|
|
48
|
+
redemptionPermission?: LpRedemptionPermission;
|
|
48
49
|
actorSync?: LpActorSyncView;
|
|
49
50
|
};
|
|
51
|
+
type LpRedemptionPermission = {
|
|
52
|
+
state: "unknown" | "locked" | "enabled";
|
|
53
|
+
grantRevision: number;
|
|
54
|
+
observedAtMs: number;
|
|
55
|
+
};
|
|
50
56
|
type LpActorSyncView = {
|
|
51
57
|
lpPositionId: string;
|
|
52
58
|
status: "idle" | "settling" | "reimbursement_due";
|
|
@@ -103,8 +109,23 @@ type LpRedemptionHistoryView = {
|
|
|
103
109
|
createdAtMs: number;
|
|
104
110
|
updatedAtMs: number;
|
|
105
111
|
};
|
|
112
|
+
/** Wallet adapter used only for the coordinator-issued V0 LP admission proof. */
|
|
113
|
+
type LpCreationSigner = {
|
|
114
|
+
readonly publicKey: string;
|
|
115
|
+
readonly signMessage: (message: Uint8Array) => Promise<Uint8Array>;
|
|
116
|
+
};
|
|
117
|
+
type LpPositionCreationIntent = {
|
|
118
|
+
readonly committedLamports: number;
|
|
119
|
+
readonly shardCount: number;
|
|
120
|
+
readonly shardAmountLamports: number;
|
|
121
|
+
readonly refillThreshold: number;
|
|
122
|
+
};
|
|
123
|
+
type LpCreationAuthorization = {
|
|
124
|
+
readonly authorizationId: string;
|
|
125
|
+
};
|
|
106
126
|
type OpenLpPositionInput = {
|
|
107
127
|
lpPositionId: string;
|
|
128
|
+
creationAuthorizationId: string;
|
|
108
129
|
authPublicKey: number[];
|
|
109
130
|
refillPublicKey: number[];
|
|
110
131
|
withdrawalCommitment: number[];
|
|
@@ -177,6 +198,7 @@ type LpDkgClient = {
|
|
|
177
198
|
}>;
|
|
178
199
|
};
|
|
179
200
|
type LpCoordinatorClient = LpDkgClient & {
|
|
201
|
+
authorizePositionCreation(intent: LpPositionCreationIntent, signer: LpCreationSigner): Promise<LpCreationAuthorization>;
|
|
180
202
|
openPosition(input: OpenLpPositionInput, auth: LpPositionCodeAuth): Promise<LpPositionView>;
|
|
181
203
|
getPosition(lpPositionId: string, auth: LpPositionCodeAuth, options?: LpPositionRequestOptions): Promise<LpPositionView>;
|
|
182
204
|
finalizeDkgBatch(input: FinalizeLpDkgBatchInput, auth: LpPositionCodeAuth): Promise<LpPositionView>;
|
|
@@ -225,14 +247,12 @@ type LpLifecycleDkgProgress = {
|
|
|
225
247
|
readonly total: number;
|
|
226
248
|
};
|
|
227
249
|
interface CreatePositionArgs {
|
|
250
|
+
readonly wallet: LpCreationSigner;
|
|
228
251
|
readonly committedLamports?: number;
|
|
229
252
|
readonly shardCount?: number;
|
|
230
253
|
readonly refillThreshold?: number;
|
|
231
254
|
readonly feePolicy?: unknown;
|
|
232
|
-
/**
|
|
233
|
-
* Called after SDK-owned code generation and before the coordinator open call.
|
|
234
|
-
* Use this to show/save the code if coordinator intake fails.
|
|
235
|
-
*/
|
|
255
|
+
/** Called only after the coordinator has durably opened the position. */
|
|
236
256
|
readonly onPositionCode?: (code: LpGeneratedPositionCode) => void;
|
|
237
257
|
}
|
|
238
258
|
interface LpGeneratedPositionCode {
|
|
@@ -319,6 +339,7 @@ interface WithdrawalConfirmation {
|
|
|
319
339
|
}
|
|
320
340
|
interface LpLifecycleRuntime {
|
|
321
341
|
readonly coordinatorClient?: LpCoordinatorClient;
|
|
342
|
+
readonly reconnectSession?: () => Promise<Session>;
|
|
322
343
|
readonly workerFactory?: () => Worker;
|
|
323
344
|
readonly useDeterministicTestAddresses?: boolean;
|
|
324
345
|
readonly nowMs?: () => number;
|
|
@@ -360,7 +381,7 @@ declare function isLpRedemptionReconcilingError(error: unknown): boolean;
|
|
|
360
381
|
declare function isLpPositionAuthMissingError(error: unknown): boolean;
|
|
361
382
|
declare function previewLpWithdrawalPlan(position: LpPositionView, args?: LpWithdrawalPlanPreviewArgs): LpWithdrawalPlanPreview;
|
|
362
383
|
interface LpLifecycleClient {
|
|
363
|
-
createPosition(args
|
|
384
|
+
createPosition(args: CreatePositionArgs): Promise<CreatePositionResult>;
|
|
364
385
|
recoverPosition(args: RecoverPositionArgs): Promise<LpPositionView>;
|
|
365
386
|
confirmPositionCodeSaved(positionId: string): void;
|
|
366
387
|
completeDkgBatch(positionId: string, options?: CompleteDkgBatchOptions): Promise<LpPositionView>;
|
|
@@ -380,9 +401,12 @@ interface LpLifecycleClient {
|
|
|
380
401
|
declare function createLpLifecycleClient(session: Session, runtime?: LpLifecycleRuntime): LpLifecycleClient;
|
|
381
402
|
declare function defaultLpLifecycleClient(session: Session): LpLifecycleClient;
|
|
382
403
|
|
|
383
|
-
declare const LP_COMMAND_REQUEST_TIMEOUT_MS =
|
|
404
|
+
declare const LP_COMMAND_REQUEST_TIMEOUT_MS = 30000;
|
|
384
405
|
declare const LP_DKG_ABORT_REQUEST_TIMEOUT_MS = 10000;
|
|
385
|
-
|
|
406
|
+
type LpCoordinatorClientOptions = {
|
|
407
|
+
readonly reconnectSession?: () => Promise<Session>;
|
|
408
|
+
};
|
|
409
|
+
declare function createLpCoordinatorClient(session: Session, options?: LpCoordinatorClientOptions): LpCoordinatorClient;
|
|
386
410
|
|
|
387
411
|
type LpDkgProgress = {
|
|
388
412
|
completed: number;
|
|
@@ -405,7 +429,7 @@ declare const LP_DKG_WORKER_REQUEST_TIMEOUT_MESSAGE = "LP DKG worker request tim
|
|
|
405
429
|
declare const LP_DKG_ABORT_CLEANUP_TIMEOUT_MS = 10000;
|
|
406
430
|
declare function createLpDkgBatch(input: CreateLpDkgBatchInput): Promise<string[]>;
|
|
407
431
|
|
|
408
|
-
declare function createPosition(session: Session, args
|
|
432
|
+
declare function createPosition(session: Session, args: CreatePositionArgs): Promise<CreatePositionResult>;
|
|
409
433
|
declare function recoverPosition(session: Session, args: RecoverPositionArgs): Promise<LpPositionView>;
|
|
410
434
|
declare function confirmPositionCodeSaved(session: Session, positionId: string): void;
|
|
411
435
|
declare function completeDkgBatch(session: Session, positionId: string, opts?: CompleteDkgBatchOptions): Promise<LpPositionView>;
|
|
@@ -426,4 +450,4 @@ declare function withdrawFees(session: Session, positionId: string, args: {
|
|
|
426
450
|
}): Promise<never>;
|
|
427
451
|
declare function listPositions(session: Session): Promise<LpPositionView[]>;
|
|
428
452
|
|
|
429
|
-
export { type CompleteDkgBatchOptions, type CreateLpDkgBatchInput, type CreatePositionArgs, type CreatePositionResult, type FinalizeLpDkgBatchInput, type FundingConfirmationInput, type InitialFundingPlan, LP_COMMAND_REQUEST_TIMEOUT_MS, LP_DKG_ABORT_CLEANUP_TIMEOUT_MS, LP_DKG_ABORT_REQUEST_TIMEOUT_MS, LP_DKG_WORKER_REQUEST_TIMEOUT_MESSAGE, LP_DKG_WORKER_REQUEST_TIMEOUT_MS, LP_FEE_SOURCE_COUNT_UNAVAILABLE_MESSAGE, LP_MISSING_POSITION_CODE_MESSAGE, LP_REDEMPTION_RECONCILING_MESSAGE, type LpActorSyncView, type LpCoordinatorClient, type LpDkgClient, type LpDkgProgress, type LpInventoryShard, type LpLifecycleClient, type LpLifecycleDkgProgress, type LpLifecycleRuntime, type LpPositionCode, type LpPositionCodeAuth, type LpPositionRequestOptions, type LpPositionView, type LpRedemptionHistoryView, type LpTopUpRequest, type LpWithdrawalExecutionView, type LpWithdrawalMode, type LpWithdrawalPlanPreview, type LpWithdrawalPlanPreviewArgs, type LpWithdrawalRecord, type OpenLpPositionInput, type RecoverPositionArgs, type RefillArgs, type RefillLpPositionInput, type SourceLiquidityUse, type WaitForTopUpOptions, type WaitForWithdrawalConfirmationOptions, type WithdrawPositionArgs, type WithdrawPositionResult, type WithdrawalConfirmation, type WithdrawalExecution, bytesToHex, completeDkgBatch, confirmPositionCodeSaved, createLpCoordinatorClient, createLpDkgBatch, createLpLifecycleClient, createPosition, defaultLpLifecycleClient, deriveLpPositionCodeAuth, generateLpPositionCode, isLpPositionAuthMissingError, isLpRedemptionReconcilingError, listPositions, normalizeLpPositionCode, prepareInitialFunding, prepareTopUp, previewLpWithdrawalPlan, reconcileFunding, recoverPosition, refill, refreshPosition, signLpCommandBytes, waitForTopUp, waitForWithdrawalConfirmation, withdrawFees, withdrawPosition };
|
|
453
|
+
export { type CompleteDkgBatchOptions, type CreateLpDkgBatchInput, type CreatePositionArgs, type CreatePositionResult, type FinalizeLpDkgBatchInput, type FundingConfirmationInput, type InitialFundingPlan, LP_COMMAND_REQUEST_TIMEOUT_MS, LP_DKG_ABORT_CLEANUP_TIMEOUT_MS, LP_DKG_ABORT_REQUEST_TIMEOUT_MS, LP_DKG_WORKER_REQUEST_TIMEOUT_MESSAGE, LP_DKG_WORKER_REQUEST_TIMEOUT_MS, LP_FEE_SOURCE_COUNT_UNAVAILABLE_MESSAGE, LP_MISSING_POSITION_CODE_MESSAGE, LP_REDEMPTION_RECONCILING_MESSAGE, type LpActorSyncView, type LpCoordinatorClient, type LpCoordinatorClientOptions, type LpCreationAuthorization, type LpCreationSigner, type LpDkgClient, type LpDkgProgress, type LpInventoryShard, type LpLifecycleClient, type LpLifecycleDkgProgress, type LpLifecycleRuntime, type LpPositionCode, type LpPositionCodeAuth, type LpPositionCreationIntent, type LpPositionRequestOptions, type LpPositionView, type LpRedemptionHistoryView, type LpRedemptionPermission, type LpTopUpRequest, type LpWithdrawalExecutionView, type LpWithdrawalMode, type LpWithdrawalPlanPreview, type LpWithdrawalPlanPreviewArgs, type LpWithdrawalRecord, type OpenLpPositionInput, type RecoverPositionArgs, type RefillArgs, type RefillLpPositionInput, type SourceLiquidityUse, type WaitForTopUpOptions, type WaitForWithdrawalConfirmationOptions, type WithdrawPositionArgs, type WithdrawPositionResult, type WithdrawalConfirmation, type WithdrawalExecution, bytesToHex, completeDkgBatch, confirmPositionCodeSaved, createLpCoordinatorClient, createLpDkgBatch, createLpLifecycleClient, createPosition, defaultLpLifecycleClient, deriveLpPositionCodeAuth, generateLpPositionCode, isLpPositionAuthMissingError, isLpRedemptionReconcilingError, listPositions, normalizeLpPositionCode, prepareInitialFunding, prepareTopUp, previewLpWithdrawalPlan, reconcileFunding, recoverPosition, refill, refreshPosition, signLpCommandBytes, waitForTopUp, waitForWithdrawalConfirmation, withdrawFees, withdrawPosition };
|