stellarium-ts 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/operatorAuth.d.ts +19 -0
- package/dist/client/operatorAuth.d.ts.map +1 -0
- package/dist/client/operatorAuth.js +21 -0
- package/dist/client/operatorClient.d.ts +68 -31
- package/dist/client/operatorClient.d.ts.map +1 -1
- package/dist/client/operatorClient.js +82 -23
- package/dist/db/db.d.ts.map +1 -1
- package/dist/db/db.js +8 -5
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/resource/inference.d.ts +3 -3
- package/dist/resource/inference.d.ts.map +1 -1
- package/dist/resource/inference.js +7 -7
- package/dist/resource/invoker.d.ts +13 -13
- package/dist/resource/invoker.d.ts.map +1 -1
- package/dist/resource/invoker.js +26 -23
- package/dist/resource/repository.d.ts +13 -7
- package/dist/resource/repository.d.ts.map +1 -1
- package/dist/resource/repository.js +23 -13
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +46 -37
- package/dist/server.d.ts +10 -5
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +20 -7
- package/dist/service.d.ts +7 -2
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +3 -3
- package/dist/tests/client/operatorClient.test.js +94 -36
- package/dist/tests/db/db.test.js +4 -4
- package/dist/tests/helpers.d.ts +4 -3
- package/dist/tests/helpers.d.ts.map +1 -1
- package/dist/tests/helpers.js +8 -6
- package/dist/tests/integration/network.test.js +56 -9
- package/dist/tests/resource/invoker.test.js +14 -9
- package/dist/tests/resource/repository.test.js +9 -9
- package/dist/tests/routes.test.js +71 -38
- package/dist/tests/server.test.js +15 -15
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The scheme of the `Authorization` header on node requests to the operator. */
|
|
2
|
+
export declare const OPERATOR_AUTH_SCHEME = "Stellarium";
|
|
3
|
+
/**
|
|
4
|
+
* The object a node signs to authenticate one operator request. `path` is the URL path without the
|
|
5
|
+
* query string, and `bodyHash` is `hashData` of the parsed JSON body (`{}` when there is none).
|
|
6
|
+
* Key order is part of the signed bytes. The operator rebuilds this in apps/operator/src/auth/nodeAuth.ts.
|
|
7
|
+
*/
|
|
8
|
+
export declare function operatorRequestPayload(method: string, path: string, body: unknown, timestamp: string): {
|
|
9
|
+
method: string;
|
|
10
|
+
path: string;
|
|
11
|
+
bodyHash: string;
|
|
12
|
+
timestamp: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* `Authorization` header value for a request to `url`: the scheme, then base64url JSON of
|
|
16
|
+
* `{ publicKey, timestamp, signature }`. The operator accepts timestamps within a few minutes of its clock.
|
|
17
|
+
*/
|
|
18
|
+
export declare function operatorAuthorization(method: string, url: string, body: unknown, publicKey: string, privateKey: string): string;
|
|
19
|
+
//# sourceMappingURL=operatorAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operatorAuth.d.ts","sourceRoot":"","sources":["../../src/client/operatorAuth.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM;;;;;EAEpG;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAK/H"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { hashData, signData } from "../crypto/utils.js";
|
|
2
|
+
/** The scheme of the `Authorization` header on node requests to the operator. */
|
|
3
|
+
export const OPERATOR_AUTH_SCHEME = 'Stellarium';
|
|
4
|
+
/**
|
|
5
|
+
* The object a node signs to authenticate one operator request. `path` is the URL path without the
|
|
6
|
+
* query string, and `bodyHash` is `hashData` of the parsed JSON body (`{}` when there is none).
|
|
7
|
+
* Key order is part of the signed bytes. The operator rebuilds this in apps/operator/src/auth/nodeAuth.ts.
|
|
8
|
+
*/
|
|
9
|
+
export function operatorRequestPayload(method, path, body, timestamp) {
|
|
10
|
+
return { method: method.toUpperCase(), path, bodyHash: hashData(body ?? {}), timestamp };
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* `Authorization` header value for a request to `url`: the scheme, then base64url JSON of
|
|
14
|
+
* `{ publicKey, timestamp, signature }`. The operator accepts timestamps within a few minutes of its clock.
|
|
15
|
+
*/
|
|
16
|
+
export function operatorAuthorization(method, url, body, publicKey, privateKey) {
|
|
17
|
+
const timestamp = new Date().toISOString();
|
|
18
|
+
const signature = signData(operatorRequestPayload(method, new URL(url).pathname, body, timestamp), privateKey);
|
|
19
|
+
const credentials = Buffer.from(JSON.stringify({ publicKey, timestamp, signature })).toString('base64url');
|
|
20
|
+
return `${OPERATOR_AUTH_SCHEME} ${credentials}`;
|
|
21
|
+
}
|
|
@@ -1,48 +1,85 @@
|
|
|
1
1
|
export type PaymentSubmission = FixedPaymentSubmission | InferencePaymentSubmission;
|
|
2
|
+
export interface FixedPaymentVoucher {
|
|
3
|
+
kind?: undefined;
|
|
4
|
+
requestId: string;
|
|
5
|
+
invocationId: string;
|
|
6
|
+
amount: number;
|
|
7
|
+
recipientOrganizationId: string;
|
|
8
|
+
signature: string;
|
|
9
|
+
expiresAt: string;
|
|
10
|
+
invocationHash: string;
|
|
11
|
+
publicKey: string;
|
|
12
|
+
}
|
|
13
|
+
export interface InferenceVoucher {
|
|
14
|
+
kind: 'inference';
|
|
15
|
+
requestId: string;
|
|
16
|
+
invocationId: string;
|
|
17
|
+
maxAmount: number;
|
|
18
|
+
inputCostMicroUsdPerMillionTokens: number;
|
|
19
|
+
outputCostMicroUsdPerMillionTokens: number;
|
|
20
|
+
maxTokens: number;
|
|
21
|
+
recipientOrganizationId: string;
|
|
22
|
+
signature: string;
|
|
23
|
+
expiresAt: string;
|
|
24
|
+
invocationHash: string;
|
|
25
|
+
publicKey: string;
|
|
26
|
+
}
|
|
2
27
|
export interface FixedPaymentSubmission {
|
|
3
|
-
voucher:
|
|
4
|
-
requestId: string;
|
|
5
|
-
invocationId: string;
|
|
6
|
-
amount: number;
|
|
7
|
-
recipientAddress: string;
|
|
8
|
-
signature: string;
|
|
9
|
-
expiresAt: string;
|
|
10
|
-
invocationHash: string;
|
|
11
|
-
publicKey: string;
|
|
12
|
-
};
|
|
28
|
+
voucher: FixedPaymentVoucher;
|
|
13
29
|
}
|
|
14
|
-
/** The provider reports the call's usage; the operator charges it at the voucher's rates, up to `maxAmount`. */
|
|
30
|
+
/** The provider reports the call's usage; the operator charges it at the voucher's rates, up to the held `maxAmount`. */
|
|
15
31
|
export interface InferencePaymentSubmission {
|
|
16
|
-
voucher:
|
|
17
|
-
kind: 'inference';
|
|
18
|
-
requestId: string;
|
|
19
|
-
invocationId: string;
|
|
20
|
-
maxAmount: number;
|
|
21
|
-
inputCostMicroUsdcPerMillionTokens: number;
|
|
22
|
-
outputCostMicroUsdcPerMillionTokens: number;
|
|
23
|
-
maxTokens: number;
|
|
24
|
-
recipientAddress: string;
|
|
25
|
-
signature: string;
|
|
26
|
-
expiresAt: string;
|
|
27
|
-
invocationHash: string;
|
|
28
|
-
publicKey: string;
|
|
29
|
-
};
|
|
32
|
+
voucher: InferenceVoucher;
|
|
30
33
|
usage: {
|
|
31
34
|
inputTokens: number;
|
|
32
35
|
outputTokens: number;
|
|
33
36
|
};
|
|
34
37
|
}
|
|
35
|
-
|
|
36
|
-
export
|
|
38
|
+
/** Whether the operator placed a hold for a voucher. A refusal carries the operator's status and error. */
|
|
39
|
+
export type AuthorizeResult = {
|
|
40
|
+
ok: true;
|
|
41
|
+
} | {
|
|
42
|
+
ok: false;
|
|
43
|
+
status: number;
|
|
44
|
+
error: string;
|
|
45
|
+
};
|
|
46
|
+
export declare const OPERATOR_MAX_RETRIES = 5;
|
|
47
|
+
/** Authorization runs while the caller waits, so it gives up much sooner than capture and release. */
|
|
48
|
+
export declare const AUTHORIZE_MAX_RETRIES = 2;
|
|
49
|
+
export declare const OPERATOR_BASE_DELAY_MS = 1000;
|
|
50
|
+
export declare const AUTHORIZE_BASE_DELAY_MS = 200;
|
|
37
51
|
/** Per attempt. A timed-out attempt is retried like a network error. */
|
|
38
|
-
export declare const
|
|
52
|
+
export declare const OPERATOR_TIMEOUT_MS = 10000;
|
|
53
|
+
/** Talks to the operator as this node. Every request is signed with the node's key. */
|
|
39
54
|
export declare class OperatorClient {
|
|
40
55
|
private readonly url;
|
|
41
|
-
|
|
56
|
+
private readonly publicKey;
|
|
57
|
+
private readonly privateKey;
|
|
58
|
+
constructor(url: string | undefined, publicKey: string, privateKey: string);
|
|
42
59
|
/**
|
|
43
|
-
*
|
|
60
|
+
* POSTs `body`, retrying `RETRYABLE_STATUSES` and network errors up to `retries` times.
|
|
61
|
+
* Each attempt is signed afresh, since the operator only accepts recent timestamps.
|
|
44
62
|
* Throws the last network error if the operator could not be reached, or if no operator URL is configured.
|
|
45
63
|
*/
|
|
46
|
-
|
|
64
|
+
private post;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the organization this node is enrolled in. With an `enrollmentToken` from the dashboard,
|
|
67
|
+
* enrolls the node first; a node that is already enrolled ignores the token. Throws if the node is
|
|
68
|
+
* not enrolled or the operator refuses.
|
|
69
|
+
*/
|
|
70
|
+
session(enrollmentToken?: string): Promise<{
|
|
71
|
+
organizationId: string;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Asks the operator to hold the voucher's amount (or `maxAmount`) on the payer's balance, before
|
|
75
|
+
* running the paid function. An unreachable operator is reported as a 503 refusal.
|
|
76
|
+
*/
|
|
77
|
+
authorize(voucher: FixedPaymentVoucher | InferenceVoucher): Promise<AuthorizeResult>;
|
|
78
|
+
/** Charges a held voucher: its amount, or for inference the reported usage capped at the hold. */
|
|
79
|
+
capture(payment: PaymentSubmission): Promise<void>;
|
|
80
|
+
/** Releases a held voucher without charging it, for a call that failed or cost nothing. */
|
|
81
|
+
release(voucher: FixedPaymentVoucher | InferenceVoucher): Promise<void>;
|
|
82
|
+
/** Logs a refusal instead of throwing: nothing waits on capture or release. Throws only if the operator can't be reached. */
|
|
83
|
+
private settle;
|
|
47
84
|
}
|
|
48
85
|
//# sourceMappingURL=operatorClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operatorClient.d.ts","sourceRoot":"","sources":["../../src/client/operatorClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"operatorClient.d.ts","sourceRoot":"","sources":["../../src/client/operatorClient.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,GAAG,0BAA0B,CAAC;AAEpF,MAAM,WAAW,mBAAmB;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB,EAAE,MAAM,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC,EAAE,MAAM,CAAC;IAC1C,kCAAkC,EAAE,MAAM,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB,EAAE,MAAM,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;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F,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvD;IAED,2FAA2F;IACrF,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5E;IAED,6HAA6H;YAC/G,MAAM;CAMvB"}
|
|
@@ -1,62 +1,121 @@
|
|
|
1
|
-
|
|
2
|
-
export const
|
|
1
|
+
import { operatorAuthorization } from "./operatorAuth.js";
|
|
2
|
+
export const OPERATOR_MAX_RETRIES = 5;
|
|
3
|
+
/** Authorization runs while the caller waits, so it gives up much sooner than capture and release. */
|
|
4
|
+
export const AUTHORIZE_MAX_RETRIES = 2;
|
|
5
|
+
export const OPERATOR_BASE_DELAY_MS = 1000;
|
|
6
|
+
export const AUTHORIZE_BASE_DELAY_MS = 200;
|
|
3
7
|
/** Per attempt. A timed-out attempt is retried like a network error. */
|
|
4
|
-
export const
|
|
8
|
+
export const OPERATOR_TIMEOUT_MS = 10_000;
|
|
5
9
|
/**
|
|
6
|
-
* Transient failures. Resending is safe even if an earlier attempt reached the operator:
|
|
7
|
-
*
|
|
8
|
-
* Rejections (400, 401, 404, 409, 422) are not retried because they won't change.
|
|
10
|
+
* Transient failures. Resending is safe even if an earlier attempt reached the operator: every payment
|
|
11
|
+
* request is idempotent per voucher (requestId, invocationId).
|
|
12
|
+
* Rejections (400, 401, 402, 403, 404, 409, 422) are not retried because they won't change.
|
|
9
13
|
*/
|
|
10
14
|
const RETRYABLE_STATUSES = new Set([408, 429, 500, 502, 503, 504]);
|
|
11
15
|
/**
|
|
12
|
-
* Delay before retry `attempt` (0-based): exponential backoff
|
|
16
|
+
* Delay before retry `attempt` (0-based): exponential backoff from `baseDelayMs`,
|
|
13
17
|
* or the operator's `Retry-After` seconds when that is longer.
|
|
14
18
|
*/
|
|
15
|
-
function retryDelayMs(response, attempt) {
|
|
16
|
-
const backoff =
|
|
19
|
+
function retryDelayMs(response, attempt, baseDelayMs) {
|
|
20
|
+
const backoff = baseDelayMs * 2 ** attempt;
|
|
17
21
|
const retryAfterSeconds = Number(response?.headers.get('retry-after') ?? NaN);
|
|
18
22
|
return Number.isFinite(retryAfterSeconds) ? Math.max(backoff, retryAfterSeconds * 1000) : backoff;
|
|
19
23
|
}
|
|
24
|
+
async function errorMessage(response) {
|
|
25
|
+
const body = await response.json().catch(() => undefined);
|
|
26
|
+
return typeof body?.error === 'string' ? body.error : `${response.status} ${response.statusText}`.trim();
|
|
27
|
+
}
|
|
28
|
+
/** Talks to the operator as this node. Every request is signed with the node's key. */
|
|
20
29
|
export class OperatorClient {
|
|
21
30
|
url;
|
|
22
|
-
|
|
31
|
+
publicKey;
|
|
32
|
+
privateKey;
|
|
33
|
+
constructor(url, publicKey, privateKey) {
|
|
23
34
|
this.url = url;
|
|
35
|
+
this.publicKey = publicKey;
|
|
36
|
+
this.privateKey = privateKey;
|
|
24
37
|
}
|
|
25
38
|
/**
|
|
26
|
-
*
|
|
39
|
+
* POSTs `body`, retrying `RETRYABLE_STATUSES` and network errors up to `retries` times.
|
|
40
|
+
* Each attempt is signed afresh, since the operator only accepts recent timestamps.
|
|
27
41
|
* Throws the last network error if the operator could not be reached, or if no operator URL is configured.
|
|
28
42
|
*/
|
|
29
|
-
async
|
|
43
|
+
async post(path, body, retries, baseDelayMs) {
|
|
30
44
|
if (!this.url) {
|
|
31
|
-
throw new Error('
|
|
45
|
+
throw new Error('No operator URL is configured');
|
|
32
46
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
47
|
+
const url = `${this.url}${path}`;
|
|
48
|
+
const serialized = JSON.stringify(body);
|
|
35
49
|
for (let attempt = 0;; attempt++) {
|
|
36
50
|
let retryable;
|
|
37
51
|
try {
|
|
38
|
-
response = await fetch(
|
|
52
|
+
const response = await fetch(url, {
|
|
39
53
|
method: 'POST',
|
|
40
|
-
body,
|
|
54
|
+
body: serialized,
|
|
41
55
|
headers: {
|
|
42
56
|
'Content-Type': 'application/json',
|
|
57
|
+
Authorization: operatorAuthorization('POST', url, body, this.publicKey, this.privateKey),
|
|
43
58
|
},
|
|
44
|
-
signal: AbortSignal.timeout(
|
|
59
|
+
signal: AbortSignal.timeout(OPERATOR_TIMEOUT_MS),
|
|
45
60
|
});
|
|
46
|
-
if (!RETRYABLE_STATUSES.has(response.status) || attempt >=
|
|
47
|
-
|
|
61
|
+
if (!RETRYABLE_STATUSES.has(response.status) || attempt >= retries) {
|
|
62
|
+
return response;
|
|
48
63
|
}
|
|
49
64
|
retryable = response;
|
|
50
65
|
}
|
|
51
66
|
catch (error) {
|
|
52
|
-
if (attempt >=
|
|
67
|
+
if (attempt >= retries) {
|
|
53
68
|
throw error;
|
|
54
69
|
}
|
|
55
70
|
}
|
|
56
|
-
await new Promise(resolve => setTimeout(resolve, retryDelayMs(retryable, attempt)));
|
|
71
|
+
await new Promise(resolve => setTimeout(resolve, retryDelayMs(retryable, attempt, baseDelayMs)));
|
|
57
72
|
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Returns the organization this node is enrolled in. With an `enrollmentToken` from the dashboard,
|
|
76
|
+
* enrolls the node first; a node that is already enrolled ignores the token. Throws if the node is
|
|
77
|
+
* not enrolled or the operator refuses.
|
|
78
|
+
*/
|
|
79
|
+
async session(enrollmentToken) {
|
|
80
|
+
const response = await this.post('/nodes/session', enrollmentToken ? { enrollmentToken } : {}, OPERATOR_MAX_RETRIES, OPERATOR_BASE_DELAY_MS);
|
|
81
|
+
if (!response.ok) {
|
|
82
|
+
throw new Error(`Operator refused this node's session: ${await errorMessage(response)}`);
|
|
83
|
+
}
|
|
84
|
+
return await response.json();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Asks the operator to hold the voucher's amount (or `maxAmount`) on the payer's balance, before
|
|
88
|
+
* running the paid function. An unreachable operator is reported as a 503 refusal.
|
|
89
|
+
*/
|
|
90
|
+
async authorize(voucher) {
|
|
91
|
+
let response;
|
|
92
|
+
try {
|
|
93
|
+
response = await this.post('/payments/authorize', { voucher }, AUTHORIZE_MAX_RETRIES, AUTHORIZE_BASE_DELAY_MS);
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
console.error('Failed to reach the operator to authorize a payment', error);
|
|
97
|
+
return { ok: false, status: 503, error: 'Payment operator is unavailable' };
|
|
98
|
+
}
|
|
99
|
+
if (response.ok) {
|
|
100
|
+
return { ok: true };
|
|
101
|
+
}
|
|
102
|
+
// Retries ran out on a transient failure: the caller may try again later.
|
|
103
|
+
const status = RETRYABLE_STATUSES.has(response.status) ? 503 : response.status;
|
|
104
|
+
return { ok: false, status, error: await errorMessage(response) };
|
|
105
|
+
}
|
|
106
|
+
/** Charges a held voucher: its amount, or for inference the reported usage capped at the hold. */
|
|
107
|
+
async capture(payment) {
|
|
108
|
+
await this.settle('/payments/capture', payment);
|
|
109
|
+
}
|
|
110
|
+
/** Releases a held voucher without charging it, for a call that failed or cost nothing. */
|
|
111
|
+
async release(voucher) {
|
|
112
|
+
await this.settle('/payments/release', { voucher });
|
|
113
|
+
}
|
|
114
|
+
/** Logs a refusal instead of throwing: nothing waits on capture or release. Throws only if the operator can't be reached. */
|
|
115
|
+
async settle(path, body) {
|
|
116
|
+
const response = await this.post(path, body, OPERATOR_MAX_RETRIES, OPERATOR_BASE_DELAY_MS);
|
|
58
117
|
if (!response.ok) {
|
|
59
|
-
console.error(`
|
|
118
|
+
console.error(`Operator refused ${path}: ${await errorMessage(response)}`);
|
|
60
119
|
}
|
|
61
120
|
}
|
|
62
121
|
}
|
package/dist/db/db.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/db/db.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE7C,eAAO,MAAM,qBAAqB,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/db/db.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE7C,eAAO,MAAM,qBAAqB,uBAAuB,CAAC;AAc1D,wGAAwG;AACxG,wBAAsB,YAAY,CAAC,QAAQ,GAAE,MAA8B,GAAG,OAAO,CAAC,QAAQ,CAAC,CAI9F;AAED,wBAAsB,YAAY,CAAC,EAAE,EAAE,QAAQ,iBA+I9C"}
|
package/dist/db/db.js
CHANGED
|
@@ -8,8 +8,10 @@ export const DEFAULT_DATABASE_PATH = './requestscript.db';
|
|
|
8
8
|
* Version 3 added `resource.website` and the `description` columns of the resource tables.
|
|
9
9
|
* Version 4 renamed `resource_function_payment_manifest.cost_lamports` to `cost_micro_usdc` (payments moved to USDC).
|
|
10
10
|
* Version 5 added `resource_function.kind` and per-token inference pricing, which made `cost_micro_usdc` nullable.
|
|
11
|
+
* Version 6 moved payments to Stripe: `*_micro_usdc` columns became `*_micro_usd`, and `recipient_address`
|
|
12
|
+
* became `recipient_organization_id`.
|
|
11
13
|
*/
|
|
12
|
-
const SCHEMA_VERSION =
|
|
14
|
+
const SCHEMA_VERSION = 6;
|
|
13
15
|
/** Opens (or creates) the node database and brings its schema up to date. Pass ':memory:' for tests. */
|
|
14
16
|
export async function openDatabase(filename = DEFAULT_DATABASE_PATH) {
|
|
15
17
|
const db = await open({ filename, driver: sqlite3.Database });
|
|
@@ -92,10 +94,11 @@ export async function createTables(db) {
|
|
|
92
94
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
93
95
|
resource_function_id INTEGER NOT NULL,
|
|
94
96
|
-- Null for inference functions, which are priced per million tokens instead.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
cost_micro_usd INTEGER,
|
|
98
|
+
input_cost_micro_usd_per_million_tokens INTEGER,
|
|
99
|
+
output_cost_micro_usd_per_million_tokens INTEGER,
|
|
100
|
+
-- The hosting node's organization. Null only if a peer advertised the manifest without one.
|
|
101
|
+
recipient_organization_id TEXT,
|
|
99
102
|
created_at TEXT NOT NULL,
|
|
100
103
|
updated_at TEXT NOT NULL,
|
|
101
104
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export type { NodeConfig } from './service.js';
|
|
|
3
3
|
export type { StellariumFixedPaymentManifest, StellariumInferencePaymentManifest, StellariumResource, StellariumResourceFunction, StellariumResourceFunctionKind, StellariumResourceFunctionParameter, StellariumResourceFunctionPaymentManifest, } from './resource/repository.js';
|
|
4
4
|
export { CombinationResourceInvoker, inferenceVoucherPayload, invocationHash, paymentVoucherPayload, type InferenceEstimate, type InferencePaymentVoucher, type PaymentVoucher, } from './resource/invoker.js';
|
|
5
5
|
export { inferenceCharge, MAX_TOKENS_PARAMETER, type InferenceResult, type InferenceUsage } from './resource/inference.js';
|
|
6
|
-
export type { InferencePaymentSubmission, PaymentSubmission } from './client/operatorClient.js';
|
|
6
|
+
export type { FixedPaymentVoucher, InferencePaymentSubmission, InferenceVoucher, PaymentSubmission } from './client/operatorClient.js';
|
|
7
|
+
export { OPERATOR_AUTH_SCHEME, operatorAuthorization, operatorRequestPayload } from './client/operatorAuth.js';
|
|
7
8
|
export { grantHash, grantPayload, grantRenewalPayload, grantRequestPayload, grantsHash, CLOCK_SKEW_TOLERANCE_MS, invocationAuthorizationPayload, MAX_AUTHORIZATION_LIFETIME_MS, MAX_GRANT_CHAIN_LENGTH, MAX_GRANT_LIFETIME_MS, type Capability, type Grant, type GrantRenewalRequest, type GrantRequest, type InvocationAuthorization, } from './grant/grant.js';
|
|
8
9
|
export type { ApproveGrant, GrantApproval, GrantOptions } from './grant/service.js';
|
|
9
10
|
export type { GrantKey } from './grant/repository.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,qBAAqB,EAA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AC;AAEvI,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAE/G,OAAO,EACH,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,uBAAuB,EACvB,8BAA8B,EAC9B,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,uBAAuB,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpF,YAAY,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,5 +2,7 @@ export { StellariumNode, resolveConfig } from './server.js';
|
|
|
2
2
|
// The voucher wire format, so the operator and other settlers can test against the real signer.
|
|
3
3
|
export { CombinationResourceInvoker, inferenceVoucherPayload, invocationHash, paymentVoucherPayload, } from './resource/invoker.js';
|
|
4
4
|
export { inferenceCharge, MAX_TOKENS_PARAMETER } from './resource/inference.js';
|
|
5
|
+
// The operator request signature, so the operator can test against the real signer.
|
|
6
|
+
export { OPERATOR_AUTH_SCHEME, operatorAuthorization, operatorRequestPayload } from './client/operatorAuth.js';
|
|
5
7
|
// Grant wire format, so other implementations can test against the real signer.
|
|
6
8
|
export { grantHash, grantPayload, grantRenewalPayload, grantRequestPayload, grantsHash, CLOCK_SKEW_TOLERANCE_MS, invocationAuthorizationPayload, MAX_AUTHORIZATION_LIFETIME_MS, MAX_GRANT_CHAIN_LENGTH, MAX_GRANT_LIFETIME_MS, } from './grant/grant.js';
|
|
@@ -14,13 +14,13 @@ export interface InferenceResult {
|
|
|
14
14
|
}
|
|
15
15
|
/** The per-million-token rates a charge is computed from. */
|
|
16
16
|
export interface InferenceRates {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
inputCostMicroUsdPerMillionTokens: number;
|
|
18
|
+
outputCostMicroUsdPerMillionTokens: number;
|
|
19
19
|
}
|
|
20
20
|
export declare function isInferenceManifest(manifest: StellariumResourceFunctionPaymentManifest | undefined): manifest is StellariumInferencePaymentManifest;
|
|
21
21
|
export declare function isInferenceFunction(fn: Pick<StellariumResourceFunction, 'kind'>): boolean;
|
|
22
22
|
/**
|
|
23
|
-
* Micro-
|
|
23
|
+
* Micro-USD owed for `inputTokens` and `outputTokens` at `rates`, rounded up.
|
|
24
24
|
* Computed exactly in BigInt. Throws if the charge isn't a safe integer.
|
|
25
25
|
* The operator keeps a copy (apps/operator/src/inference.ts) that must stay in sync.
|
|
26
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../src/resource/inference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,kCAAkC,EAAE,0BAA0B,EAAE,yCAAyC,EAAE,MAAM,iBAAiB,CAAC;AAEjJ,8FAA8F;AAC9F,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAIhD,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,sFAAsF;AACtF,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,cAAc,CAAC;CACzB;AAED,6DAA6D;AAC7D,MAAM,WAAW,cAAc;IAC3B,
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../src/resource/inference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,kCAAkC,EAAE,0BAA0B,EAAE,yCAAyC,EAAE,MAAM,iBAAiB,CAAC;AAEjJ,8FAA8F;AAC9F,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAIhD,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,sFAAsF;AACtF,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,cAAc,CAAC;CACzB;AAED,6DAA6D;AAC7D,MAAM,WAAW,cAAc;IAC3B,iCAAiC,EAAE,MAAM,CAAC;IAC1C,kCAAkC,EAAE,MAAM,CAAC;CAC9C;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,yCAAyC,GAAG,SAAS,GAAG,QAAQ,IAAI,kCAAkC,CAEnJ;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,0BAA0B,EAAE,MAAM,CAAC,GAAG,OAAO,CAEzF;AAMD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAQxG;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,UAAU,EAAE,6BAA6B,EAAE,GAAG,MAAM,GAAG,SAAS,CAG9F;AAED,sGAAsG;AACtG,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAajF;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,0BAA0B,GAAG,IAAI,CAsB9E"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export const MAX_TOKENS_PARAMETER = 'maxTokens';
|
|
3
3
|
const INT32_MAX = 2_147_483_647;
|
|
4
4
|
export function isInferenceManifest(manifest) {
|
|
5
|
-
return typeof manifest === 'object' && manifest !== null && '
|
|
5
|
+
return typeof manifest === 'object' && manifest !== null && 'inputCostMicroUsdPerMillionTokens' in manifest;
|
|
6
6
|
}
|
|
7
7
|
export function isInferenceFunction(fn) {
|
|
8
8
|
return fn.kind === 'inference';
|
|
@@ -11,13 +11,13 @@ function isNonnegativeSafeInteger(value) {
|
|
|
11
11
|
return Number.isSafeInteger(value) && value >= 0;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Micro-
|
|
14
|
+
* Micro-USD owed for `inputTokens` and `outputTokens` at `rates`, rounded up.
|
|
15
15
|
* Computed exactly in BigInt. Throws if the charge isn't a safe integer.
|
|
16
16
|
* The operator keeps a copy (apps/operator/src/inference.ts) that must stay in sync.
|
|
17
17
|
*/
|
|
18
18
|
export function inferenceCharge(rates, inputTokens, outputTokens) {
|
|
19
|
-
const micros = BigInt(inputTokens) * BigInt(rates.
|
|
20
|
-
+ BigInt(outputTokens) * BigInt(rates.
|
|
19
|
+
const micros = BigInt(inputTokens) * BigInt(rates.inputCostMicroUsdPerMillionTokens)
|
|
20
|
+
+ BigInt(outputTokens) * BigInt(rates.outputCostMicroUsdPerMillionTokens);
|
|
21
21
|
const charge = (micros + 999999n) / 1000000n;
|
|
22
22
|
if (charge > BigInt(Number.MAX_SAFE_INTEGER)) {
|
|
23
23
|
throw new Error('Inference charge exceeds the largest safe integer');
|
|
@@ -64,9 +64,9 @@ export function validateInferenceFunction(fn) {
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
if (!isInferenceManifest(fn.paymentManifest)
|
|
67
|
-
|| !isNonnegativeSafeInteger(fn.paymentManifest.
|
|
68
|
-
|| !isNonnegativeSafeInteger(fn.paymentManifest.
|
|
69
|
-
throw new Error(`Inference function ${fn.name} must price input and output tokens as nonnegative integer micro-
|
|
67
|
+
|| !isNonnegativeSafeInteger(fn.paymentManifest.inputCostMicroUsdPerMillionTokens)
|
|
68
|
+
|| !isNonnegativeSafeInteger(fn.paymentManifest.outputCostMicroUsdPerMillionTokens)) {
|
|
69
|
+
throw new Error(`Inference function ${fn.name} must price input and output tokens as nonnegative integer micro-USD per million tokens`);
|
|
70
70
|
}
|
|
71
71
|
if (typeof fn.estimateInputTokens !== 'function') {
|
|
72
72
|
throw new Error(`Paid inference function ${fn.name} must declare estimateInputTokens`);
|
|
@@ -6,7 +6,7 @@ export interface PaymentVoucher {
|
|
|
6
6
|
requestId: string;
|
|
7
7
|
invocationId: string;
|
|
8
8
|
amount: number;
|
|
9
|
-
|
|
9
|
+
recipientOrganizationId: string;
|
|
10
10
|
signature: string;
|
|
11
11
|
expiresAt: string;
|
|
12
12
|
invocationHash: string;
|
|
@@ -22,10 +22,10 @@ export interface InferencePaymentVoucher {
|
|
|
22
22
|
requestId: string;
|
|
23
23
|
invocationId: string;
|
|
24
24
|
maxAmount: number;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
inputCostMicroUsdPerMillionTokens: number;
|
|
26
|
+
outputCostMicroUsdPerMillionTokens: number;
|
|
27
27
|
maxTokens: number;
|
|
28
|
-
|
|
28
|
+
recipientOrganizationId: string;
|
|
29
29
|
signature: string;
|
|
30
30
|
expiresAt: string;
|
|
31
31
|
invocationHash: string;
|
|
@@ -50,7 +50,7 @@ export declare function paymentVoucherPayload(voucher: Omit<PaymentVoucher, "sig
|
|
|
50
50
|
requestId: string;
|
|
51
51
|
invocationId: string;
|
|
52
52
|
amount: number;
|
|
53
|
-
|
|
53
|
+
recipientOrganizationId: string;
|
|
54
54
|
expiresAt: string;
|
|
55
55
|
invocationHash: string;
|
|
56
56
|
publicKey: string;
|
|
@@ -64,10 +64,10 @@ export declare function inferenceVoucherPayload(voucher: Omit<InferencePaymentVo
|
|
|
64
64
|
requestId: string;
|
|
65
65
|
invocationId: string;
|
|
66
66
|
maxAmount: number;
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
inputCostMicroUsdPerMillionTokens: number;
|
|
68
|
+
outputCostMicroUsdPerMillionTokens: number;
|
|
69
69
|
maxTokens: number;
|
|
70
|
-
|
|
70
|
+
recipientOrganizationId: string;
|
|
71
71
|
expiresAt: string;
|
|
72
72
|
invocationHash: string;
|
|
73
73
|
publicKey: string;
|
|
@@ -84,16 +84,16 @@ export declare const EXTERNAL_INVOKE_TIMEOUT_MS = 30000;
|
|
|
84
84
|
export declare const INFERENCE_INVOKE_TIMEOUT_MS = 120000;
|
|
85
85
|
export declare class CombinationResourceInvoker implements ResourceInvoker {
|
|
86
86
|
private readonly resourceRepository;
|
|
87
|
-
private readonly
|
|
87
|
+
private readonly costLimitMicroUsd;
|
|
88
88
|
private readonly publicKey;
|
|
89
89
|
private readonly privateKey;
|
|
90
90
|
private readonly grantService?;
|
|
91
|
-
private readonly
|
|
91
|
+
private readonly inferenceCostLimitMicroUsd;
|
|
92
92
|
/**
|
|
93
93
|
* Without a `grantService`, calls to restricted remote functions fail.
|
|
94
|
-
* `
|
|
94
|
+
* `inferenceCostLimitMicroUsd` caps an inference voucher's `maxAmount`, and defaults to `costLimitMicroUsd`.
|
|
95
95
|
*/
|
|
96
|
-
constructor(resourceRepository: ResourceRepository,
|
|
96
|
+
constructor(resourceRepository: ResourceRepository, costLimitMicroUsd: number, publicKey: string, privateKey: string, grantService?: GrantService | undefined, inferenceCostLimitMicroUsd?: number);
|
|
97
97
|
/**
|
|
98
98
|
* Invoke a function on a resource.
|
|
99
99
|
* If the resource has a baseUrl, it will be invoked as a remote function.
|
|
@@ -116,7 +116,7 @@ export declare class CombinationResourceInvoker implements ResourceInvoker {
|
|
|
116
116
|
}>;
|
|
117
117
|
/** Asks the provider what a call to a paid inference function will cost at most. */
|
|
118
118
|
private estimate;
|
|
119
|
-
createPaymentVoucher(
|
|
119
|
+
createPaymentVoucher(recipientOrganizationId: string, amount: number, resourcePath: string, resourceName: string, functionName: string, parameters: ResourceFunctionCallParameter[]): PaymentVoucher;
|
|
120
120
|
createInferenceVoucher(manifest: StellariumInferencePaymentManifest, maxAmount: number, maxTokens: number, resourcePath: string, resourceName: string, functionName: string, parameters: ResourceFunctionCallParameter[]): InferencePaymentVoucher;
|
|
121
121
|
}
|
|
122
122
|
//# sourceMappingURL=invoker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoker.d.ts","sourceRoot":"","sources":["../../src/resource/invoker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAmB,KAAK,cAAc,EAAkF,MAAM,gBAAgB,CAAC;AACtJ,OAAO,EAAE,kBAAkB,EAAE,KAAK,kCAAkC,EAAmC,MAAM,iBAAiB,CAAC;AAE/H,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"invoker.d.ts","sourceRoot":"","sources":["../../src/resource/invoker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAmB,KAAK,cAAc,EAAkF,MAAM,gBAAgB,CAAC;AACtJ,OAAO,EAAE,kBAAkB,EAAE,KAAK,kCAAkC,EAAmC,MAAM,iBAAiB,CAAC;AAE/H,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB,EAAE,MAAM,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAA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