@runinfra/sdk 0.1.1 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -3,11 +3,21 @@
3
3
  All notable changes to `@runinfra/sdk` are documented here. This project follows
4
4
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [0.1.2] - 2026-05-23
7
+
8
+ ### Changed
9
+ - Hardened CI and publish gates with exact npm tarball and Python wheel/sdist
10
+ content verification.
11
+ - Added version-sync and workflow-policy checks to prevent stale SDK releases
12
+ and long-lived registry-token regressions.
13
+ - Updated public docs to match the shipped voice pipeline helper: experimental,
14
+ pipeline-scoped, and not yet live-canary verified.
15
+
6
16
  ## [0.1.1] - 2026-05-23
7
17
 
8
18
  ### Changed
9
- - **`license`**: `UNLICENSED` → `LicenseRef-Proprietary` (aligns with Python SDK; the prior value was contradictory for a public package).
10
- - **`repository.url`**: now points at `RightNow-AI/RunInfra-Landing` (the actual source repo). Previous value pointed at the non-existent `RunPipe` slug.
19
+ - **`license`**: `UNLICENSED` -> `LicenseRef-Proprietary` (aligns with Python SDK; the prior value was contradictory for a public package).
20
+ - **`repository.url`**: now points at `RightNow-AI/runinfra-sdk` (the public source repo). Previous value pointed at the non-existent `RunPipe` slug.
11
21
  - **`bugs.url`**: same fix.
12
22
  - **`description`**: now states "beta; LLM + embeddings tested, image/audio surfaces experimental" so the registry listing accurately reflects verification state.
13
23
 
@@ -15,7 +25,7 @@ All notable changes to `@runinfra/sdk` are documented here. This project follows
15
25
  - **Modality status section** in the README documenting which surfaces are
16
26
  contract-tested vs experimental.
17
27
  - **`@experimental` JSDoc** on `client.images.*`, `client.audio.speech.*`, and
18
- `client.audio.transcriptions.*` — these surfaces match the OpenAI HTTP
28
+ `client.audio.transcriptions.*` - these surfaces match the OpenAI HTTP
19
29
  envelope but have not been verified end-to-end against a live deployed
20
30
  pipeline in the public-gateway canary suite. Test against your own
21
31
  deployments before using in production.
@@ -23,7 +33,7 @@ All notable changes to `@runinfra/sdk` are documented here. This project follows
23
33
 
24
34
  ### Provenance
25
35
  This is the first release published via GitHub OIDC trusted publishing
26
- (`.github/workflows/sdk-publish.yml` → `npm` environment). The published
36
+ (`.github/workflows/publish.yml` -> `npm` environment). The published
27
37
  tarball includes a Sigstore-backed provenance attestation that ties the
28
38
  release to a specific CI run. Verify with:
29
39
  ```bash
@@ -38,12 +48,13 @@ configuration and does not have provenance. All v0.1.1+ releases will.
38
48
  - Webhook delivery routes are not shipped; `client.webhooks.create` /
39
49
  `.list()` throw `UnsupportedOperationError`. Local signature verification
40
50
  (`verifySignature`, `constructEvent`) works.
41
- - `client.voice.pipeline.create` is not shipped; throws
42
- `UnsupportedOperationError`.
51
+ - `client.voice.pipeline.create` posts audio to the pipeline-scoped `/pipeline` route.
52
+ It is experimental until live canary coverage is complete.
43
53
 
44
54
  ### Toward 1.0.0 GA
45
- GA requires all 5 modalities live-canary verified, the workflow
46
- `bypass_live_canary` flag retired, and the strict gate scripts re-enabled.
55
+ GA requires all 5 model modalities plus voice pipeline live-canary verified and
56
+ public-repo release gates that block stale, missing, or bypassed canary
57
+ evidence.
47
58
 
48
59
  ## [0.1.0] - 2026-05-22
49
60
 
package/README.md CHANGED
@@ -10,7 +10,7 @@ Requires Node.js 18 or newer.
10
10
  npm install @runinfra/sdk
11
11
  ```
12
12
 
13
- ## Modality status (v0.1.1)
13
+ ## Modality status (v0.1.2)
14
14
 
15
15
  This SDK is in **beta**. The surfaces below have different verification levels:
16
16
 
@@ -22,13 +22,14 @@ This SDK is in **beta**. The surfaces below have different verification levels:
22
22
  | Audio (TTS) | `client.audio.speech.create` | **Experimental**, not live-canary verified |
23
23
  | Audio (ASR) | `client.audio.transcriptions.create` | **Experimental**, not live-canary verified |
24
24
  | Webhooks | `client.webhooks.*` | Local verification helpers only; remote delivery not shipped |
25
- | Voice pipeline | `client.voice.pipeline.create` | Not shipped; throws `UnsupportedOperationError` |
25
+ | Voice pipeline | `client.voice.pipeline.create` | **Experimental**, pipeline-scoped route, not live-canary verified |
26
26
 
27
- The HTTP envelopes for experimental surfaces match the OpenAI API contract,
28
- but we haven't yet completed a full end-to-end live-canary deployment for
29
- those modalities in the public gateway. They will reach GA in v1.0.0 once
30
- the canary suite covers all five modalities. Test against your own deployed
31
- models before using experimental surfaces in production.
27
+ Experimental surfaces match their documented gateway contracts, but we have
28
+ not yet completed a full end-to-end live-canary deployment for those
29
+ modalities in the public gateway. They will reach GA in v1.0.0 once the
30
+ canary suite covers all five model modalities plus voice pipeline. Test
31
+ against your own deployed models before using experimental surfaces in
32
+ production.
32
33
 
33
34
  ## Create a client
34
35
 
@@ -248,137 +249,46 @@ const client = new OpenAI({
248
249
 
249
250
  ## Production promotion
250
251
 
251
- Local package tests prove SDK shape, retry behavior, streaming parsing, and
252
- typed errors. They do not prove that a newly optimized deployment is ready for
253
- customers. For production promotion, run the strict live SDK canary gate from
254
- the RunPipe repo against the same base URL and API key you plan to expose. The gate starts with `test:sdk-live-api-key`, which verifies the plaintext key hashes to an active workspace-scoped `api_keys` row before any paid inference canary runs:
252
+ Local package tests prove SDK shape, retry behavior, streaming parsing, typed
253
+ errors, package contents, version sync, and trusted-publishing workflow policy.
254
+ They do not prove that a newly optimized deployment is ready for customers.
255
+ This extracted public repo does not define the old monorepo live-canary
256
+ commands.
257
+
258
+ For production promotion from this repo, run these local checks from the
259
+ repository root before opening a release PR:
255
260
 
256
261
  ```bash
257
- pnpm verify:sdk-release
258
- pnpm test:sdk-canary:live -- --print-env-template
259
- pnpm test:sdk-canary:live -- --env-file .env.sdk-live.local --print-env-status
260
- pnpm sync:sdk-live-env -- --source .env.local --target .env.sdk-live.local
261
- pnpm discover:sdk-live-targets -- --env-file .env.sdk-live.local --probe-inference --report artifacts/sdk/live-targets-discovery.json
262
- pnpm bootstrap:sdk-live-key -- --env-file .env.sdk-live.local
263
- pnpm discover:sdk-live-targets -- --env-file .env.sdk-live.local --probe-inference --report artifacts/sdk/live-targets-discovery.json
264
- pnpm prepare:sdk-live-env -- --discovery-report artifacts/sdk/live-targets-discovery.json --output .env.sdk-live.local
265
- pnpm discover:sdk-live-targets -- --env-file .env.sdk-live.local --probe-inference --report artifacts/sdk/live-targets-discovery.json
266
- pnpm verify:sdk-live-targets -- --env-file .env.sdk-live.local --require-available --discovery-report artifacts/sdk/live-targets-discovery.json
267
- pnpm test:sdk-canary:live -- --env-file .env.sdk-live.local --check-env-only
268
- pnpm test:sdk-canary:live -- --env-file .env.sdk-live.local --discovery-report artifacts/sdk/live-targets-discovery.json --report artifacts/sdk/live-canary.json
269
- pnpm verify:sdk-live-report -- artifacts/sdk/live-canary.json
270
- pnpm test:sdk-canary -- --env-file .env.sdk-live.local --report artifacts/sdk/native-focused-smoke.json
271
- pnpm test:openai-compat -- --env-file .env.sdk-live.local --report artifacts/sdk/openai-focused-smoke.json
272
- pnpm verify:sdk-goal -- --release-report artifacts/sdk/release-verification.json --live-report artifacts/sdk/live-canary.json --live-targets-report artifacts/sdk/live-targets-discovery.json --env-check-report artifacts/sdk/live-canary-env-check.json --focused-smoke-report artifacts/sdk/native-focused-smoke.json --openai-focused-smoke-report artifacts/sdk/openai-focused-smoke.json --report artifacts/sdk/goal-readiness.json
273
- pnpm verify:sdk-publish -- --release-report artifacts/sdk/release-verification.json --goal-report artifacts/sdk/goal-readiness.json --live-report artifacts/sdk/live-canary.json --live-targets-report artifacts/sdk/live-targets-discovery.json --env-check-report artifacts/sdk/live-canary-env-check.json --focused-smoke-report artifacts/sdk/native-focused-smoke.json --openai-focused-smoke-report artifacts/sdk/openai-focused-smoke.json --report artifacts/sdk/publish-readiness.json
262
+ node scripts/verify-workflow-policy.mjs
263
+ node scripts/verify-version-sync.mjs
264
+ pnpm --dir typescript install --lockfile=false
265
+ pnpm --dir typescript exec tsc -p tsconfig.json --noEmit
266
+ pnpm --dir typescript test
267
+ pnpm --dir typescript build
268
+ pnpm --dir typescript pack
269
+ node scripts/verify-npm-package.mjs typescript/runinfra-sdk-*.tgz
270
+ python -m pip install -e python pytest build twine
271
+ python -m pytest python/tests -v
272
+ python -m build python
273
+ python scripts/verify-python-package.py python/dist
274
+ python -m twine check python/dist/*
274
275
  ```
275
276
 
276
- Save the printed template as `.env.sdk-live.local`; it is ignored by git and
277
- should contain the real production gateway, workspace-scoped API key, database
278
- URL, pipeline-scoped API key for the optimized LLM pipeline, `RUNPOD_API_KEY`,
279
- deployed model IDs, the optimized LLM `TEST_PIPELINE_ID`, TTS proof inputs, and
280
- ASR clip path. `RUNPOD_API_KEY` is
281
- used only by discovery to prove checked RunPod endpoint inventory. A checked
282
- inventory needs endpointCount greater than zero, and `endpointCount: 0` blocks
283
- promotion even if old database rows still mention active deployments. Discovery
284
- also blocks any selected target with `endpoint_not_in_runpod_inventory` and
285
- emits `runpod_endpoint_inventory_empty` when RunPod returns no endpoints. For
286
- operator handoffs, set optional `RUNPOD_EXPECTED_ENDPOINT_IDS` to a
287
- comma-separated list of endpoint IDs. Discovery compares those IDs against the
288
- same checked inventory and reports only redacted verified or missing endpoint
289
- IDs, so a wrong RunPod account/scope becomes an explicit blocker.
290
- For TTS, set either `TEST_TTS_VOICE` or both `TEST_TTS_REF_AUDIO` and
291
- `TEST_TTS_REF_TEXT` for Base/voice-cloning models.
292
- `sync:sdk-live-env` copies `RUNPOD_API_KEY` from the source env file when it is
293
- present. If you keep the RunPod key only in the shell, discovery uses that
294
- process value instead of the generated placeholder in `.env.sdk-live.local`.
295
- Use `--print-env-status` before running the canary to see missing, placeholder,
296
- or invalid fields without printing API keys, database URLs, or file paths. Use `pnpm sync:sdk-live-env -- --source .env.local --target .env.sdk-live.local` to copy whitelisted local values such as `DATABASE_URL` without printing secrets, then use `pnpm discover:sdk-live-targets -- --env-file .env.sdk-live.local --probe-inference --report artifacts/sdk/live-targets-discovery.json` to inspect
297
- which `active_verified` deployments can satisfy strict modality coverage without
298
- printing API keys, key hashes, or database credentials. Deployments that are
299
- close but not promotable appear under redacted `nearEligibleTargets` with
300
- reasons such as `status_not_active_verified`, `missing_inference_url`, or
301
- `missing_endpoint_id`. The discovery report also includes `nextActions`, so
302
- deployment and SDK agents can follow safe commands without scraping error text.
303
- A skipped probe is diagnostic only. It means discovery intentionally avoided a
304
- live inference call after an earlier eligibility failure; only `passed` probes can promote `targets_available`.
305
- After discovery reports eligible `active_verified` targets, `pnpm bootstrap:sdk-live-key -- --env-file .env.sdk-live.local` can create a workspace-scoped key for that workspace, store only its hash in the database, and write the plaintext once into the ignored live env file without printing it. Rerun discovery after bootstrap so the report proves the selected workspace now has an active workspace-scoped key.
306
- When discovery is complete, use
307
- `pnpm prepare:sdk-live-env -- --discovery-report artifacts/sdk/live-targets-discovery.json --output .env.sdk-live.local`
308
- to fill the deployment model IDs and the optimized LLM `TEST_PIPELINE_ID`, then rerun `discover:sdk-live-targets` against the prepared env file.
309
- `prepare:sdk-live-env` cannot recover a one-time plaintext pipeline secret. Set
310
- `RUNINFRA_PIPELINE_API_KEY` from the Deploy tab for `TEST_PIPELINE_ID` before
311
- strict live canaries, while keeping `RUNINFRA_API_KEY` workspace-scoped for
312
- billing and flat-route verification.
313
- Before running live canaries, run
314
- `pnpm verify:sdk-live-targets -- --env-file .env.sdk-live.local --require-available --discovery-report artifacts/sdk/live-targets-discovery.json`
315
- against the prepared-env discovery report to validate that it is redacted, same-workspace, uses exact live env values, and only promotes callable `active_verified` targets.
316
- If the output file already has `RUNINFRA_API_KEY`, `RUNINFRA_PIPELINE_API_KEY`,
317
- `DATABASE_URL`, `TEST_ASR_FILE`, or local TTS reference inputs, the helper
318
- preserves them and does not print them.
319
-
320
- That gate must cover LLM, embeddings, image, TTS, and ASR endpoints before the
321
- deployment is treated as production verified. Those strict modality targets must
322
- be distinct deployed model IDs in the same workspace, because the promotion
323
- canary uses one workspace-scoped key and then proves billing for every reported
324
- model. The generated live report also records the SDK version and source digest,
325
- so stale canaries cannot promote a newer SDK build.
326
- Focused `pnpm test:sdk-canary -- --report ...` smoke reports also record the
327
- same SDK / Docs / Engine source digest and stay redacted. The raw
328
- OpenAI-compatible focused smoke writes `artifacts/sdk/openai-focused-smoke.json`
329
- and the native SDK smoke writes `artifacts/sdk/native-focused-smoke.json`.
330
- `verify:sdk-goal` rejects either focused smoke report when it was generated from older source,
331
- so focused LLM debugging evidence cannot be reused as fresh promotion evidence.
332
- Each canary result also records redacted `checks` for the required proof checks
333
- it emitted. If a canary exits successfully but misses a required proof line, the
334
- strict report records `missingChecks` and stays blocked. The runner only counts
335
- a proof line when the child canary prints `[ OK ] <required check>`; `[FAIL]` lines do not satisfy promotion evidence. The proof set covers model discovery
336
- and retrieval, LLM responses and streaming,
337
- pipeline-scoped native SDK responses, OpenAI-compatible pipeline-scoped `/v1/responses`, embeddings vectors, image data, TTS audio bytes, ASR transcription text,
338
- OpenAI-compatible auth and error paths, native SDK typed `AuthenticationError`
339
- mapping, request ID propagation, unsupported webhook guards, API key scope, and
340
- billing usage verification. OpenAI-compatible security checks also prove request tracing, HSTS, `nosniff`, path traversal blocking, invalid model 404, missing model 400, and auth failures before publish promotion can pass.
341
- The live-target gate also requires checked RunPod endpoint inventory before
342
- promotion. `selectedTargets.*.runpodEndpointVerified` must be true for every
343
- strict modality.
344
-
345
- Use registry trusted publishing first. Do not provide NPM or PyPI publish tokens.
346
- Registry tokens are not used; publish through GitHub trusted publishing only. If
347
- trusted publishing is unavailable, do not publish until the registry identity is fixed.
348
- The publish-readiness report ties the local release verification,
349
- goal-readiness report, live-target discovery report, and strict live canary
350
- report, plus both focused smoke reports, to the same source digest.
351
- The TypeScript package also runs the same publish-readiness gate from
352
- `prepublishOnly`, so a direct `npm publish` is blocked until that report passes.
353
- Use `pnpm prepare:sdk-publish` to build the npm package, Python wheel, and
354
- Python sdist only after publish readiness passes; the command writes a
355
- source-digest-tied manifest with artifact SHA-256 hashes, byte counts, and
356
- checksummed release / goal / live-target / live-canary proof reports at
357
- `artifacts/sdk/publish/publish-artifacts.json`.
358
- Use `pnpm publish:sdk -- --dry-run` to validate that manifest and print the npm
359
- trusted-publishing and PyPI action handoff without sending packages. The guarded publish wrapper
360
- refuses `--execute` outside CI, validates artifact checksums again, and supports
361
- npm trusted publishing through GitHub OIDC on the Node 22.14.0 publish workflow;
362
- PyPI should be uploaded by `pypa/gh-action-pypi-publish` in the `SDK Publish`
363
- workflow.
364
- GitHub Actions has two SDK-only workflows for the same path. `SDK Release Gate`
365
- runs `pnpm verify:sdk-release` and requires `RUNINFRA_SDK_CI_TOKEN` with
366
- read-only access to the docs and Engine contract repositories. `SDK Publish` is
367
- manual only, defaults to `publish: false`, runs `verify:sdk-release`, creates
368
- the strict live SDK env from GitHub secrets, discovers `active_verified` targets,
369
- prepares the modality env, runs strict live canaries, verifies goal and publish
370
- readiness, prepares artifacts, runs `publish:sdk -- --dry-run`, then uploads the
371
- proof reports and package artifacts. The verification job has no registry OIDC permission;
372
- the npm and PyPI publish jobs download the checked artifacts and are the only
373
- jobs with registry trusted publishing identity. The npm publish job uses GitHub environment `npm`;
374
- the PyPI publish job revalidates the publish manifest before upload and uses GitHub environment `pypi`. The live proof secrets are
375
- `RUNINFRA_SDK_LIVE_API_KEY`, `RUNINFRA_SDK_LIVE_DATABASE_URL`, `RUNPOD_API_KEY`, and
376
- `RUNINFRA_SDK_LIVE_ASR_FILE_BASE64`; voice-less Base TTS canaries can also set
377
- `RUNINFRA_SDK_LIVE_TTS_REF_AUDIO` and `RUNINFRA_SDK_LIVE_TTS_REF_TEXT`. Only
378
- after those gates pass should a maintainer rerun it with `publish: true`; npm
379
- and PyPI must use trusted publishers.
380
- `pnpm verify:sdk-release` also runs SDK secret hygiene and fails if non-test
381
- handoff docs or release files contain full-shaped RunInfra keys, service tokens,
382
- or package publish tokens.
383
-
384
- Co-located voice pipelines are available through the native `client.voice.pipeline.create()` helper on pipeline-scoped keys. The helper posts binary audio to the verified `/pipeline` route and returns the JSON transcript / response envelope. Public webhook create/list calls are intentionally unavailable until their gateway routes are verified, and the SDK throws `UnsupportedOperationError` locally for those webhook capabilities without making a request.
277
+ Then trigger a GitHub dry-run publish from `main`:
278
+
279
+ ```bash
280
+ gh workflow run publish.yml --repo RightNow-AI/runinfra-sdk --ref main -f package=both -f dry_run=true
281
+ ```
282
+
283
+ Actual publishing must use the same workflow with `dry_run=false` after CI,
284
+ review, and environment approval. Do not use npm or PyPI tokens. OIDC trusted
285
+ publishing is the only supported publish path.
286
+
287
+ Run live deployment canaries from RunPipe or RunInfra-Engine against the exact
288
+ production gateway, workspace, pipeline keys, and RunPod inventory that will
289
+ serve customers. The SDK repo only proves client artifact integrity. GA still
290
+ requires live coverage for LLM, embeddings, image, TTS, ASR, and voice pipeline
291
+ surfaces, plus explicit evidence that the smoke keys and temporary canary
292
+ resources were removed.
293
+
294
+ Co-located voice pipelines are available through the native `client.voice.pipeline.create()` helper on pipeline-scoped keys. The helper posts binary audio to the pipeline-scoped `/pipeline` route and returns the JSON transcript / response envelope. Public webhook create/list calls are intentionally unavailable until their gateway routes are verified, and the SDK throws `UnsupportedOperationError` locally for those webhook capabilities without making a request.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const RUNINFRA_SDK_VERSION = "0.1.1";
1
+ export declare const RUNINFRA_SDK_VERSION = "0.1.2";
2
2
  export interface RunInfraOptions {
3
3
  apiKey: string;
4
4
  pipelineId?: string;
@@ -255,7 +255,7 @@ export declare class RunInfra {
255
255
  /**
256
256
  * Audio surfaces (text-to-speech + speech-to-text).
257
257
  *
258
- * @experimental As of v0.1.1, these methods have NOT been verified end-to-end
258
+ * @experimental As of v0.1.2, these methods have NOT been verified end-to-end
259
259
  * against a live deployed pipeline in our canary suite. The HTTP envelope
260
260
  * matches the OpenAI Audio API contract and the request/response shapes are
261
261
  * stable, but you should test against your own deployed model before using
@@ -276,7 +276,7 @@ export declare class RunInfra {
276
276
  /**
277
277
  * Image generation surface.
278
278
  *
279
- * @experimental As of v0.1.1, this method has NOT been verified end-to-end
279
+ * @experimental As of v0.1.2, this method has NOT been verified end-to-end
280
280
  * against a live deployed pipeline in our canary suite. The HTTP envelope
281
281
  * matches the OpenAI Images API contract, but you should test against your
282
282
  * own deployed model before using in production. Live-canary verification
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createHmac, timingSafeEqual } from "node:crypto";
2
- export const RUNINFRA_SDK_VERSION = "0.1.1";
2
+ export const RUNINFRA_SDK_VERSION = "0.1.2";
3
3
  const MAX_AUTOMATIC_RETRY_AFTER_MS = 60_000;
4
4
  export class RunInfraError extends Error {
5
5
  status;
@@ -899,7 +899,7 @@ export class RunInfra {
899
899
  /**
900
900
  * Audio surfaces (text-to-speech + speech-to-text).
901
901
  *
902
- * @experimental As of v0.1.1, these methods have NOT been verified end-to-end
902
+ * @experimental As of v0.1.2, these methods have NOT been verified end-to-end
903
903
  * against a live deployed pipeline in our canary suite. The HTTP envelope
904
904
  * matches the OpenAI Audio API contract and the request/response shapes are
905
905
  * stable, but you should test against your own deployed model before using
@@ -910,7 +910,7 @@ export class RunInfra {
910
910
  /**
911
911
  * Image generation surface.
912
912
  *
913
- * @experimental As of v0.1.1, this method has NOT been verified end-to-end
913
+ * @experimental As of v0.1.2, this method has NOT been verified end-to-end
914
914
  * against a live deployed pipeline in our canary suite. The HTTP envelope
915
915
  * matches the OpenAI Images API contract, but you should test against your
916
916
  * own deployed model before using in production. Live-canary verification
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runinfra/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "RunInfra SDK for optimized inference deployments (beta; LLM + embeddings tested, image/audio surfaces experimental)",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://runinfra.ai/docs/tools-sdks/runinfra-sdk",