@compose-market/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,100 @@
1
+ const ENCODER_EOL = /\r\n|\r|\n/;
2
+ function splitLines(buffer) {
3
+ const parts = buffer.split(ENCODER_EOL);
4
+ const rest = parts.pop() ?? "";
5
+ return { lines: parts, rest };
6
+ }
7
+ export async function* parseSSEStream(stream, options = {}) {
8
+ const reader = stream.getReader();
9
+ const decoder = new TextDecoder("utf-8");
10
+ let buffer = "";
11
+ let currentEvent = "message";
12
+ let currentData = [];
13
+ let currentId;
14
+ const onAbort = () => {
15
+ try {
16
+ reader.cancel();
17
+ }
18
+ catch { /* best-effort */ }
19
+ };
20
+ options.signal?.addEventListener("abort", onAbort);
21
+ try {
22
+ while (true) {
23
+ const { value, done } = await reader.read();
24
+ if (done)
25
+ break;
26
+ buffer += decoder.decode(value, { stream: true });
27
+ const { lines, rest } = splitLines(buffer);
28
+ buffer = rest;
29
+ for (const line of lines) {
30
+ if (line === "") {
31
+ if (currentData.length > 0) {
32
+ yield {
33
+ event: currentEvent,
34
+ data: currentData.join("\n"),
35
+ id: currentId,
36
+ };
37
+ }
38
+ currentEvent = "message";
39
+ currentData = [];
40
+ currentId = undefined;
41
+ continue;
42
+ }
43
+ if (line.startsWith(":")) {
44
+ continue;
45
+ }
46
+ const colonIndex = line.indexOf(":");
47
+ const field = colonIndex === -1 ? line : line.slice(0, colonIndex);
48
+ let value = colonIndex === -1 ? "" : line.slice(colonIndex + 1);
49
+ if (value.startsWith(" ")) {
50
+ value = value.slice(1);
51
+ }
52
+ switch (field) {
53
+ case "event":
54
+ currentEvent = value || "message";
55
+ break;
56
+ case "data":
57
+ currentData.push(value);
58
+ break;
59
+ case "id":
60
+ currentId = value;
61
+ break;
62
+ case "retry":
63
+ break;
64
+ }
65
+ }
66
+ }
67
+ buffer += decoder.decode();
68
+ if (buffer.length > 0) {
69
+ const { lines } = splitLines(buffer + "\n");
70
+ for (const line of lines) {
71
+ if (line === "")
72
+ break;
73
+ if (line.startsWith(":"))
74
+ continue;
75
+ const colonIndex = line.indexOf(":");
76
+ const field = colonIndex === -1 ? line : line.slice(0, colonIndex);
77
+ let value = colonIndex === -1 ? "" : line.slice(colonIndex + 1);
78
+ if (value.startsWith(" "))
79
+ value = value.slice(1);
80
+ if (field === "event")
81
+ currentEvent = value || "message";
82
+ else if (field === "data")
83
+ currentData.push(value);
84
+ else if (field === "id")
85
+ currentId = value;
86
+ }
87
+ }
88
+ if (currentData.length > 0) {
89
+ yield { event: currentEvent, data: currentData.join("\n"), id: currentId };
90
+ }
91
+ }
92
+ finally {
93
+ options.signal?.removeEventListener("abort", onAbort);
94
+ try {
95
+ reader.releaseLock();
96
+ }
97
+ catch { /* best-effort */ }
98
+ }
99
+ }
100
+ //# sourceMappingURL=sse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sse.js","sourceRoot":"","sources":["../../src/streaming/sse.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,GAAG,YAAY,CAAC;AAEjC,SAAS,UAAU,CAAC,MAAc;IAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;IAC/B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,cAAc,CACjC,MAAkC,EAClC,UAAoC,EAAE;IAEtC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;IAClC,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,YAAY,GAAG,SAAS,CAAC;IAC7B,IAAI,WAAW,GAAa,EAAE,CAAC;IAC/B,IAAI,SAA6B,CAA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E,IAAI,KAAK,GAAG,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;gBAChE,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;oBAAE,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAClD,IAAI,KAAK,KAAK,OAAO;oBAAE,YAAY,GAAG,KAAK,IAAI,SAAS,CAAC;qBACpD,IAAI,KAAK,KAAK,MAAM;oBAAE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;qBAC9C,IAAI,KAAK,KAAK,IAAI;oBAAE,SAAS,GAAG,KAAK,CAAC;YAC/C,CAAC;QACL,CAAC;QAED,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;QAC/E,CAAC;IACL,CAAC;YAAS,CAAC;QACP,OAAO,CAAC,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC;YAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAC7D,CAAC;AACL,CAAC"}
@@ -0,0 +1,99 @@
1
+ export type ComposeErrorCode = "validation_error" | "authentication_required" | "authentication_failed" | "forbidden" | "not_found" | "conflict" | "rate_limited" | "payment_required" | "insufficient_balance" | "insufficient_allowance" | "budget_exhausted" | "key_revoked" | "key_expired" | "key_not_found" | "chain_not_supported" | "model_not_found" | "model_ambiguous" | "provider_unavailable" | "upstream_timeout" | "upstream_error" | "internal_error" | "idempotency_conflict" | "idempotency_in_flight" | "settlement_failed" | "session_invalid" | "network_error" | "timeout";
2
+ export interface ComposeErrorEnvelope {
3
+ error: {
4
+ code: ComposeErrorCode;
5
+ message: string;
6
+ details?: Record<string, unknown>;
7
+ };
8
+ }
9
+ export interface PaymentRequirements {
10
+ scheme: string;
11
+ network: string;
12
+ amount: string;
13
+ asset: string;
14
+ payTo: string;
15
+ maxTimeoutSeconds: number;
16
+ extra?: Record<string, unknown> | null;
17
+ }
18
+ export interface PaymentRequiredResource {
19
+ url: string;
20
+ description?: string;
21
+ mimeType?: string;
22
+ }
23
+ export interface PaymentRequired {
24
+ x402Version: 2;
25
+ error?: string;
26
+ resource: PaymentRequiredResource;
27
+ accepts: PaymentRequirements[];
28
+ extensions?: Record<string, unknown> | null;
29
+ }
30
+ export interface PaymentPayload {
31
+ x402Version: 2;
32
+ accepted: PaymentRequirements;
33
+ payload: unknown;
34
+ resource?: PaymentRequiredResource;
35
+ extensions?: Record<string, unknown> | null;
36
+ }
37
+ export type X402PaymentSignature = string | PaymentPayload;
38
+ export interface X402PaymentRequest {
39
+ paymentRequired: PaymentRequired;
40
+ paymentRequiredHeader: string | null;
41
+ method: string;
42
+ path: string;
43
+ url: string;
44
+ body?: unknown;
45
+ userAddress?: string | null;
46
+ chainId?: number | null;
47
+ maxAmountWei?: string;
48
+ }
49
+ export type X402PaymentSigner = (request: X402PaymentRequest) => X402PaymentSignature | Promise<X402PaymentSignature>;
50
+ export type ComposePaymentMode = "auto" | "composeKey" | "x402";
51
+ export interface ComposeReceiptLineItem {
52
+ key: string;
53
+ unit: string;
54
+ quantity: number;
55
+ unitPriceUsd: number;
56
+ amountWei: string;
57
+ }
58
+ export interface ComposeReceipt {
59
+ subject?: string;
60
+ lineItems?: ComposeReceiptLineItem[];
61
+ providerAmountWei?: string;
62
+ platformFeeWei?: string;
63
+ finalAmountWei: string;
64
+ txHash?: string;
65
+ network: `eip155:${number}`;
66
+ settledAt: number;
67
+ }
68
+ export interface SessionBudgetSnapshot {
69
+ limitWei: string | null;
70
+ usedWei: string | null;
71
+ lockedWei: string | null;
72
+ remainingWei: string | null;
73
+ }
74
+ export type SessionInvalidReason = "budget-depleted" | "expired" | "revoked" | "chain-mismatch" | (string & {
75
+ readonly __brand?: "SessionInvalidReason";
76
+ });
77
+ export interface SessionActiveEvent {
78
+ type: "session-active";
79
+ userAddress: string;
80
+ chainId: number;
81
+ expiresAt?: number;
82
+ budgetLimit?: string;
83
+ budgetUsed?: string;
84
+ budgetLocked?: string;
85
+ budgetRemaining?: string;
86
+ timestamp?: number;
87
+ }
88
+ export interface SessionExpiredEvent {
89
+ type: "session-expired";
90
+ userAddress: string;
91
+ chainId: number;
92
+ reason?: SessionInvalidReason;
93
+ message?: string;
94
+ action?: string;
95
+ expiresAt?: number;
96
+ timestamp?: number;
97
+ }
98
+ export type SessionEvent = SessionActiveEvent | SessionExpiredEvent;
99
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GACtB,kBAAkB,GAClB,yBAAyB,GACzB,uBAAuB,GACvB,WAAW,GACX,WAAW,GACX,UAAU,GACV,cAAc,GACd,kBAAkB,GAClB,sBAAsB,GACtB,wBAAwB,GACxB,kBAAkB,GAClB,aAAa,GACb,aAAa,GACb,eAAe,GACf,qBAAqB,GACrB,iBAAiB,GACjB,iBAAiB,GACjB,sBAAsB,GACtB,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,sBAAsB,GACtB,uBAAuB,GACvB,mBAAmB,GACnB,iBAAiB,GACjB,eAAe,GACf,SAAS,CAAC;AAEhB,MAAM,WAAW,oBAAoB;IACjC,KAAK,EAAE;QACH,IAAI,EAAE,gBAAgB,CAAC;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACrC,CAAC;CACL;AAED,MAAM,WAAW,mBAAmB;IAChC,MAAM,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,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,iBAAiB,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@compose-market/core",
3
+ "version": "0.1.0",
4
+ "description": "Shared Compose.Market SDK runtime primitives: HTTP client, typed errors, retries, storage, streaming parsers, receipts, and x402 wire types.",
5
+ "keywords": [
6
+ "compose",
7
+ "compose-market",
8
+ "sdk",
9
+ "http-client",
10
+ "x402",
11
+ "streaming",
12
+ "sse"
13
+ ],
14
+ "homepage": "https://github.com/compose-market/core#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/compose-market/core/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/compose-market/core.git"
21
+ },
22
+ "license": "MIT",
23
+ "author": "Compose.Market",
24
+ "type": "module",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js",
29
+ "default": "./dist/index.js"
30
+ },
31
+ "./errors": {
32
+ "types": "./dist/errors.d.ts",
33
+ "import": "./dist/errors.js",
34
+ "default": "./dist/errors.js"
35
+ },
36
+ "./http": {
37
+ "types": "./dist/http.d.ts",
38
+ "import": "./dist/http.js",
39
+ "default": "./dist/http.js"
40
+ },
41
+ "./storage": {
42
+ "types": "./dist/storage.d.ts",
43
+ "import": "./dist/storage.js",
44
+ "default": "./dist/storage.js"
45
+ },
46
+ "./streaming": {
47
+ "types": "./dist/streaming/index.d.ts",
48
+ "import": "./dist/streaming/index.js",
49
+ "default": "./dist/streaming/index.js"
50
+ },
51
+ "./streaming/budget": {
52
+ "types": "./dist/streaming/budget.d.ts",
53
+ "import": "./dist/streaming/budget.js",
54
+ "default": "./dist/streaming/budget.js"
55
+ },
56
+ "./streaming/receipt": {
57
+ "types": "./dist/streaming/receipt.d.ts",
58
+ "import": "./dist/streaming/receipt.js",
59
+ "default": "./dist/streaming/receipt.js"
60
+ },
61
+ "./streaming/sse": {
62
+ "types": "./dist/streaming/sse.d.ts",
63
+ "import": "./dist/streaming/sse.js",
64
+ "default": "./dist/streaming/sse.js"
65
+ },
66
+ "./types": {
67
+ "types": "./dist/types/index.d.ts",
68
+ "import": "./dist/types/index.js",
69
+ "default": "./dist/types/index.js"
70
+ },
71
+ "./package.json": "./package.json"
72
+ },
73
+ "main": "./dist/index.js",
74
+ "types": "./dist/index.d.ts",
75
+ "module": "./dist/index.js",
76
+ "files": [
77
+ "dist",
78
+ "README.md",
79
+ "LICENSE"
80
+ ],
81
+ "sideEffects": false,
82
+ "engines": {
83
+ "node": ">=25"
84
+ },
85
+ "scripts": {
86
+ "clean": "rm -rf dist",
87
+ "build": "npm run clean && tsc -p tsconfig.json",
88
+ "test": "node --import tsx --test tests/core.test.ts",
89
+ "test:build": "npm run build && npm test",
90
+ "typecheck": "tsc --noEmit -p tsconfig.json",
91
+ "prepublishOnly": "npm run test:build"
92
+ },
93
+ "devDependencies": {
94
+ "@types/node": "^25.6.0",
95
+ "tsx": "^4.21.0",
96
+ "typescript": "^6.0.3"
97
+ },
98
+ "publishConfig": {
99
+ "access": "public"
100
+ }
101
+ }