@pipelex/sdk 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,164 @@
1
+ /**
2
+ * Pipelex-product wire models — the snake_case JSON shapes the hosted-product
3
+ * routes (`/v1/me`, `/v1/methods`, `/v1/organizations`, `/v1/billing/*`,
4
+ * `/v1/pipelex-api-keys`, `/v1/gateway-api-key`, `/v1/onboarding/submit`,
5
+ * `/v1/resolve-storage-url`, `/v1/upload`, `/v1/runs`) speak.
6
+ *
7
+ * These are the management surface a consumer (today `pipelex-app`) hand-rolls.
8
+ * The wire is snake_case; any camelCase remap is a consumer's UI concern and
9
+ * stays in the consumer. Each model holds only the fields the product actually
10
+ * consumes — not a speculative mirror of every server field.
11
+ */
12
+ import type { RunStatus } from "./runs.js";
13
+ export interface UserProfile {
14
+ email: string;
15
+ user_id: string;
16
+ full_name: string;
17
+ /** ISO timestamp the user completed onboarding; absent/null until they do. */
18
+ onboarding_completed_at?: string | null;
19
+ }
20
+ export interface MethodData {
21
+ method_id: string;
22
+ name: string;
23
+ /** The `.mthds` bundle source. */
24
+ mthds: string;
25
+ input_data?: Record<string, unknown> | null;
26
+ /** Legacy persisted output spec; optional. */
27
+ pipe_output?: Record<string, unknown> | null;
28
+ created_at: string;
29
+ updated_at: string;
30
+ }
31
+ /** The create/update payload — a rename is a `PUT` with a changed `name`. */
32
+ export interface MethodWriteInput {
33
+ name: string;
34
+ mthds: string;
35
+ input_data?: Record<string, unknown> | null;
36
+ }
37
+ export interface Membership {
38
+ org_id: string;
39
+ /** Null for the implicit personal org (no backing WorkOS organization). */
40
+ workos_organization_id: string | null;
41
+ name: string;
42
+ is_personal: boolean;
43
+ role_in_org: "admin" | "member";
44
+ }
45
+ export interface MembershipsResponse {
46
+ memberships: Membership[];
47
+ active_org_feature_flags: string[];
48
+ }
49
+ export interface SubscriptionResponse {
50
+ plan: string | null;
51
+ status: string | null;
52
+ can_use_service: boolean;
53
+ renews_at?: string | null;
54
+ ends_at?: string | null;
55
+ }
56
+ export interface PlanView {
57
+ slug: string;
58
+ name: string;
59
+ price_display: string;
60
+ monthly_price_cents: number;
61
+ period: string;
62
+ features: string[];
63
+ highlight: boolean;
64
+ is_current: boolean;
65
+ }
66
+ export interface InvoiceView {
67
+ id: string;
68
+ created_at: string;
69
+ status: string;
70
+ amount_cents: number;
71
+ currency: string;
72
+ card_brand: string | null;
73
+ card_last_four: string | null;
74
+ refunded: boolean;
75
+ download_url: string | null;
76
+ }
77
+ export interface CheckoutResponse {
78
+ checkout_url?: string;
79
+ }
80
+ export interface ChangePlanResponse {
81
+ plan?: string;
82
+ status?: string;
83
+ charged_immediately?: boolean;
84
+ resumed?: boolean;
85
+ }
86
+ export interface BillingPortalResponse {
87
+ portal_url?: string;
88
+ }
89
+ export interface PipelexApiKey {
90
+ id: string;
91
+ label: string;
92
+ prefix: string;
93
+ created_at: string;
94
+ last_used_at: string | null;
95
+ expires_at: string | null;
96
+ }
97
+ /** The create/rotate response — the plaintext `api_key` is returned ONCE. */
98
+ export interface PipelexApiKeyCreated {
99
+ api_key: string;
100
+ id: string;
101
+ label: string;
102
+ prefix: string;
103
+ created_at: string;
104
+ }
105
+ export interface PipelexApiKeyList {
106
+ keys: PipelexApiKey[];
107
+ }
108
+ export interface GatewayApiKey {
109
+ gateway_api_key: string;
110
+ budget_usd?: number;
111
+ }
112
+ export interface GatewayApiKeyStatus {
113
+ /** Null until a gateway key has been provisioned. */
114
+ gateway_api_key: string | null;
115
+ }
116
+ export type OnboardingRole = "developer" | "founder" | "data_scientist" | "researcher" | "other";
117
+ export type OnboardingCurrentTool = "langchain" | "crewai" | "llamaindex" | "custom" | "none" | "other";
118
+ export type OnboardingInputType = "documents" | "images" | "videos" | "audio" | "structured_data" | "text";
119
+ export type OnboardingHeardFrom = "twitter" | "youtube" | "hackernews" | "discord" | "friend" | "google" | "conference" | "other";
120
+ export interface OnboardingSubmission {
121
+ role: OnboardingRole;
122
+ company?: string;
123
+ use_case: string;
124
+ process_to_transform: string;
125
+ input_types: OnboardingInputType[];
126
+ material_domain: string;
127
+ current_tool: OnboardingCurrentTool;
128
+ current_tool_other?: string;
129
+ heard_from: OnboardingHeardFrom;
130
+ }
131
+ export interface ResolvedStorageUrl {
132
+ url: string;
133
+ expires_at: string;
134
+ content_type: string | null;
135
+ }
136
+ /** Upload payload — base64 `data` (the multipart hop is browser→BFF only). */
137
+ export interface UploadInput {
138
+ filename: string;
139
+ data: string;
140
+ content_type: string;
141
+ }
142
+ export interface UploadedFile {
143
+ uri: string;
144
+ filename: string;
145
+ }
146
+ /** Per-pipe progress marker surfaced in a run's `pipe_statuses` map. */
147
+ export type PipeStatus = "scheduled" | "running" | "succeeded" | "failed" | "skipped";
148
+ export interface PipelineRun {
149
+ pipeline_run_id: string;
150
+ method_id: string;
151
+ pipe_code: string;
152
+ workflow_id?: string | null;
153
+ status: RunStatus;
154
+ result_url?: string | null;
155
+ pipe_statuses?: Record<string, PipeStatus> | null;
156
+ created_at: string;
157
+ finished_at?: string | null;
158
+ }
159
+ /** The admin/manual run-status patch — `status` is a free string here. */
160
+ export interface UpdateRunInput {
161
+ status: string;
162
+ result_url?: string;
163
+ finished_at?: string;
164
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Pipelex-product wire models — the snake_case JSON shapes the hosted-product
3
+ * routes (`/v1/me`, `/v1/methods`, `/v1/organizations`, `/v1/billing/*`,
4
+ * `/v1/pipelex-api-keys`, `/v1/gateway-api-key`, `/v1/onboarding/submit`,
5
+ * `/v1/resolve-storage-url`, `/v1/upload`, `/v1/runs`) speak.
6
+ *
7
+ * These are the management surface a consumer (today `pipelex-app`) hand-rolls.
8
+ * The wire is snake_case; any camelCase remap is a consumer's UI concern and
9
+ * stays in the consumer. Each model holds only the fields the product actually
10
+ * consumes — not a speculative mirror of every server field.
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=product-models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-models.js","sourceRoot":"","sources":["../src/product-models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
package/dist/runs.d.ts ADDED
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Run-lifecycle types + polling for the hosted polling surface (`/v1/runs/*`).
3
+ *
4
+ * Long method runs outlive the hosted gateway's ~30s synchronous cap, so the
5
+ * SDK submits a run (`POST /v1/start`), then polls a self-healing endpoint by
6
+ * bare `pipeline_run_id` until the run reaches a terminal state. All state lives behind
7
+ * the id (DynamoDB + Temporal on the platform), so a caller can drop the poll
8
+ * loop and resume later with just the id.
9
+ *
10
+ * Polling is NOT part of the MTHDS Protocol — it is a hosted-API extension. A
11
+ * bare runner 404s these routes, which the client translates into
12
+ * `RunLifecycleUnavailableError`.
13
+ *
14
+ * Wire contract mirrors the Pipelex Hosted API:
15
+ * POST /v1/start → RunResultStart (start, 202)
16
+ * GET /v1/runs/{pipeline_run_id}/status → RunRead (status, self-healing)
17
+ * GET /v1/runs/{pipeline_run_id}/results → 202 / 200 / 409 (results)
18
+ */
19
+ /**
20
+ * Hosted run lifecycle status. Mirrors `pipelex_shared.schemas.run.RunStatus`
21
+ * — run states are a hosted-implementation concept; the protocol defines none
22
+ * (the hosted store tracks states like `PENDING`). `STARTED` is deprecated
23
+ * server-side but kept here for historical rows.
24
+ */
25
+ export type RunStatus = "PENDING" | "STARTED" | "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "TERMINATED" | "TIMED_OUT";
26
+ /** A terminal status means the run is done and will not transition again. */
27
+ export declare function isTerminalRunStatus(status: RunStatus): boolean;
28
+ /** Only `COMPLETED` has a result; every other terminal status is a failure. */
29
+ export declare function isSuccessRunStatus(status: RunStatus): boolean;
30
+ /**
31
+ * A run record — the BASE shape of the run-lifecycle read surface.
32
+ *
33
+ * Only the base fields are declared. An implementation may return more
34
+ * (identity, workflow ids, storage URLs, anything else) — those are
35
+ * server-specific response fields, never named in this SDK; the index
36
+ * signature keeps them accessible, mirroring the request-side `extra`
37
+ * passthrough.
38
+ */
39
+ export interface RunPublic {
40
+ pipeline_run_id: string;
41
+ pipe_code?: string | null;
42
+ status: RunStatus;
43
+ created_at: string;
44
+ finished_at?: string | null;
45
+ /** Server-specific response fields (defined by the server you call). */
46
+ [extension: string]: unknown;
47
+ }
48
+ /**
49
+ * A run read through the self-healing path (`RunPublic` + `degraded`).
50
+ * When `degraded` is true, Temporal was unreachable and `status` is the
51
+ * last-known DB value, not a freshly-derived one — pair with
52
+ * `retry_after_seconds` (parsed from the `Retry-After` header).
53
+ */
54
+ export interface RunRead extends RunPublic {
55
+ degraded: boolean;
56
+ retry_after_seconds?: number | null;
57
+ }
58
+ /**
59
+ * Result artifacts for a completed run — `GET /v1/runs/{pipeline_run_id}/results`.
60
+ *
61
+ * Hosted: `main_stuff` + `graph_spec` (S3 artifacts relayed verbatim;
62
+ * `main_stuff` is polymorphic — a list output renders to a top-level array —
63
+ * so both are typed as opaque JSON). Bare-runner blocking fallback: the
64
+ * runner's native execute response, so `pipe_output` carries the output.
65
+ * Consumers read `main_stuff ?? pipe_output` (the documented output-shape
66
+ * difference between the two tiers).
67
+ */
68
+ export interface RunResults {
69
+ pipeline_run_id: string;
70
+ /** Method graph spec (`graphspec.json`); null if missing mid-write. */
71
+ graph_spec?: unknown;
72
+ /** Main output stuff (`main_stuff.json`); null if missing mid-write. */
73
+ main_stuff?: unknown;
74
+ /** Bare runner's native pipe output (blocking-execute fallback only). */
75
+ pipe_output?: Record<string, unknown> | null;
76
+ }
77
+ /**
78
+ * Single-shot result lookup outcome, discriminated on `state`:
79
+ * - `running` — HTTP 202; poll again after `retry_after_seconds`.
80
+ * - `completed` — HTTP 200; `result` carries the artifacts.
81
+ * - `failed` — HTTP 409; run reached a terminal non-`COMPLETED` status.
82
+ */
83
+ export type RunResultState = {
84
+ state: "running";
85
+ pipeline_run_id: string;
86
+ retry_after_seconds: number | null;
87
+ } | {
88
+ state: "completed";
89
+ pipeline_run_id: string;
90
+ result: RunResults;
91
+ } | {
92
+ state: "failed";
93
+ pipeline_run_id: string;
94
+ status: RunStatus;
95
+ message: string;
96
+ };
97
+ export interface WaitForResultOptions {
98
+ /**
99
+ * Base poll interval in ms (default 2000). The server's `Retry-After`
100
+ * header overrides this when it asks for a longer wait.
101
+ */
102
+ intervalMs?: number;
103
+ /** Max ms to wait before throwing `RunTimeoutError` (default 1_200_000 — 20 min). */
104
+ timeoutMs?: number;
105
+ /** Abort the poll loop (Ctrl-C / agent walk-away). */
106
+ signal?: AbortSignal;
107
+ /** Invoked before each sleep so callers can drive a spinner / progress line. */
108
+ onPoll?: (info: {
109
+ attempt: number;
110
+ elapsedMs: number;
111
+ }) => void;
112
+ }
113
+ export declare const DEFAULT_POLL_INTERVAL_MS = 2000;
114
+ export declare const DEFAULT_WAIT_TIMEOUT_MS = 1200000;
115
+ /** A single result lookup — the primitive the poll loop drives. */
116
+ export type FetchResultOnce = (runId: string, options?: {
117
+ signal?: AbortSignal;
118
+ }) => Promise<RunResultState>;
119
+ /**
120
+ * Poll a single-shot result lookup (`fetchOnce`) until the run reaches a
121
+ * terminal state. Returns the artifacts on `COMPLETED`, throws `RunFailedError`
122
+ * on any other terminal status, and throws `RunTimeoutError` if `timeoutMs`
123
+ * elapses first (the run keeps executing server-side — re-poll by id later).
124
+ *
125
+ * The single owner of the wait/poll/Retry-After/abort logic — `PipelexApiClient.waitForResult`
126
+ * delegates here, so the behavior can never drift.
127
+ */
128
+ export declare function pollUntilResult(fetchOnce: FetchResultOnce, runId: string, options?: WaitForResultOptions): Promise<RunResults>;
package/dist/runs.js ADDED
@@ -0,0 +1,92 @@
1
+ import { RunFailedError, RunTimeoutError } from "./errors.js";
2
+ const TERMINAL_RUN_STATUSES = new Set([
3
+ "COMPLETED",
4
+ "FAILED",
5
+ "CANCELLED",
6
+ "TERMINATED",
7
+ "TIMED_OUT",
8
+ ]);
9
+ /** A terminal status means the run is done and will not transition again. */
10
+ export function isTerminalRunStatus(status) {
11
+ return TERMINAL_RUN_STATUSES.has(status);
12
+ }
13
+ /** Only `COMPLETED` has a result; every other terminal status is a failure. */
14
+ export function isSuccessRunStatus(status) {
15
+ return status === "COMPLETED";
16
+ }
17
+ // ── Poll loop ───────────────────────────────────────────────────────
18
+ export const DEFAULT_POLL_INTERVAL_MS = 2_000;
19
+ export const DEFAULT_WAIT_TIMEOUT_MS = 1_200_000; // 20 min — matches the runner's blocking execute ceiling.
20
+ /**
21
+ * Poll a single-shot result lookup (`fetchOnce`) until the run reaches a
22
+ * terminal state. Returns the artifacts on `COMPLETED`, throws `RunFailedError`
23
+ * on any other terminal status, and throws `RunTimeoutError` if `timeoutMs`
24
+ * elapses first (the run keeps executing server-side — re-poll by id later).
25
+ *
26
+ * The single owner of the wait/poll/Retry-After/abort logic — `PipelexApiClient.waitForResult`
27
+ * delegates here, so the behavior can never drift.
28
+ */
29
+ export async function pollUntilResult(fetchOnce, runId, options = {}) {
30
+ const intervalMs = options.intervalMs ?? DEFAULT_POLL_INTERVAL_MS;
31
+ const timeoutMs = options.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
32
+ const startedAt = Date.now();
33
+ let attempt = 0;
34
+ for (;;) {
35
+ throwIfAborted(options.signal);
36
+ // Enforce the deadline BEFORE each lookup, so a poll is never issued past the
37
+ // timeout (the previous wait is clamped to the deadline, so the next loop
38
+ // would otherwise fire one extra fetch right at it).
39
+ const elapsedMs = Date.now() - startedAt;
40
+ if (elapsedMs >= timeoutMs) {
41
+ throw new RunTimeoutError(`Run ${runId} did not reach a terminal state within ${timeoutMs}ms.`, runId, timeoutMs);
42
+ }
43
+ const state = await fetchOnce(runId, { signal: options.signal });
44
+ if (state.state === "completed") {
45
+ return state.result;
46
+ }
47
+ if (state.state === "failed") {
48
+ throw new RunFailedError(state.message, runId, state.status);
49
+ }
50
+ attempt += 1;
51
+ options.onPoll?.({ attempt, elapsedMs });
52
+ const retryMs = state.retry_after_seconds != null ? state.retry_after_seconds * 1000 : 0;
53
+ const waitMs = Math.min(Math.max(intervalMs, retryMs), timeoutMs - elapsedMs);
54
+ await sleep(waitMs, options.signal);
55
+ }
56
+ }
57
+ function throwIfAborted(signal) {
58
+ if (signal?.aborted)
59
+ throw abortError(signal);
60
+ }
61
+ function abortError(signal) {
62
+ const reason = signal?.reason;
63
+ if (reason instanceof Error)
64
+ return reason;
65
+ return new DOMException("The run poll was aborted.", "AbortError");
66
+ }
67
+ /** Sleep that resolves after `ms`, or rejects immediately if `signal` aborts. */
68
+ function sleep(ms, signal) {
69
+ if (ms <= 0) {
70
+ throwIfAborted(signal);
71
+ return Promise.resolve();
72
+ }
73
+ return new Promise((resolve, reject) => {
74
+ const onAbort = () => {
75
+ clearTimeout(timer);
76
+ reject(abortError(signal));
77
+ };
78
+ const timer = setTimeout(() => {
79
+ signal?.removeEventListener("abort", onAbort);
80
+ resolve();
81
+ }, ms);
82
+ if (signal) {
83
+ if (signal.aborted) {
84
+ clearTimeout(timer);
85
+ reject(abortError(signal));
86
+ return;
87
+ }
88
+ signal.addEventListener("abort", onAbort, { once: true });
89
+ }
90
+ });
91
+ }
92
+ //# sourceMappingURL=runs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs.js","sourceRoot":"","sources":["../src/runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAuC9D,MAAM,qBAAqB,GAA2B,IAAI,GAAG,CAAY;IACvE,WAAW;IACX,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,WAAW;CACZ,CAAC,CAAC;AAEH,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,OAAO,qBAAqB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,OAAO,MAAM,KAAK,WAAW,CAAC;AAChC,CAAC;AAiFD,uEAAuE;AAEvE,MAAM,CAAC,MAAM,wBAAwB,G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CAAC,CAAC;QACP,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,YAAY,CAAC,KAAK,CAAC,CAAC;gBACpB,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC3B,OAAO;YACT,CAAC;YACD,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@pipelex/sdk",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript SDK for the Pipelex hosted API — execute methods, manage runs, and call the product surface.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/Pipelex/pipelex-sdk-js"
9
+ },
10
+ "type": "module",
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/index.js",
16
+ "types": "./dist/index.d.ts"
17
+ }
18
+ },
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "test": "vitest run",
22
+ "test:coverage": "vitest run --coverage",
23
+ "typecheck": "tsc --noEmit",
24
+ "typecheck:test": "tsc -p tsconfig.test.json --noEmit",
25
+ "lint": "eslint src/ tests/",
26
+ "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\" \"*.ts\"",
27
+ "format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\" \"*.ts\"",
28
+ "depcruise": "depcruise --config .dependency-cruiser.cjs src",
29
+ "check": "npm run lint && npm run format:check && npm run typecheck && npm run typecheck:test && npm run build && npm run depcruise",
30
+ "prepare": "tsc"
31
+ },
32
+ "files": [
33
+ "dist/"
34
+ ],
35
+ "engines": {
36
+ "node": ">=18"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "devDependencies": {
42
+ "@eslint/js": "^9.39.4",
43
+ "@types/node": "^22.12.0",
44
+ "@vitest/coverage-v8": "^4.1.9",
45
+ "dependency-cruiser": "^17.4.3",
46
+ "eslint": "^9.39.4",
47
+ "globals": "^16.5.0",
48
+ "prettier": "^3.8.4",
49
+ "typescript": "^5.7.3",
50
+ "typescript-eslint": "^8.62.0",
51
+ "vitest": "^4.0.18"
52
+ },
53
+ "dependencies": {
54
+ "mthds": "github:mthds-ai/mthds-js#refactor/Sdk-mthds-vs-pipelex"
55
+ }
56
+ }