@leaflow/sdk 0.0.0-dev.457.g4544173 → 0.0.0-dev.459.gaa32320

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.
Files changed (2) hide show
  1. package/README.md +9 -18
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Leaflow TypeScript SDK
2
2
 
3
- Native Orval fetch functions, a native models.ts and request-only Zod schemas live together under
4
- `src/<service>/v1/generated`. Module entry points stay outside that generated directory.
5
- Root namespaces, versioned subpath imports and each module's `schemas`
6
- export are preserved. `src/routes.ts` retains the static routing and authentication facts.
3
+ TypeScript SDK for the Leaflow platform, generated from the [leaflowapis](https://github.com/leaflowapis/leaflowapis) contracts.
7
4
 
8
- Validate requests with generated schemas before invoking native operations. Responses retain their
9
- native models and return types. Credentials remain in RequestInit and the existing fetch transport.
5
+ ```sh
6
+ npm install @leaflow/sdk
7
+ ```
8
+
9
+ Clients, models, and request validation schemas live under `src/<service>/<version>/generated`. Validate requests with the generated schemas before calling an operation.
10
10
 
11
11
  ## Generate and build
12
12
 
@@ -18,15 +18,12 @@ npm run generate
18
18
  npm run build
19
19
  ```
20
20
 
21
- `orval.config.mjs` is plain official Orval configuration that recursively discovers OpenAPI entry documents. The Canopy hook chooses JSON or Blob for the chat completion response according to Content-Type,
22
- so JSON and SSE retain their respective response formats. No compatibility forwarding layer is used. For local generation, CONTRACTS_DIR
23
- may point to an existing clean checkout of the exact CONTRACTS_REF commit. CI checks out that commit.
21
+ The contract version is recorded in `CONTRACTS_REF`. `CONTRACTS_DIR` may point to a clean checkout at that ref.
24
22
 
25
23
  ## Protocol messages
26
24
 
27
- The contract's protobuf messages, currently the Fleet protocol spoken by VirtualDesktop viewers, are
28
- generated with protoc-gen-es under `src/proto`, keeping their proto paths. Import a file by that
29
- path and encode or decode with `@bufbuild/protobuf`; no gRPC or Connect transport is involved:
25
+ Protobuf messages from the contract are generated with protoc-gen-es under `src/proto`, preserving their
26
+ proto paths. Import them by path and encode or decode with `@bufbuild/protobuf`:
30
27
 
31
28
  ```ts
32
29
  import { create, toBinary } from "@bufbuild/protobuf";
@@ -36,9 +33,3 @@ const bytes = toBinary(ClientMessageSchema, create(ClientMessageSchema, {}));
36
33
  ```
37
34
 
38
35
  `npm run generate` runs Orval and then `buf generate` on the same contract checkout.
39
-
40
- ## Canopy migration
41
-
42
- Project inference and management are exported from `canopy` and `@leaflow/sdk/canopy/v1`.
43
- Replace `canopyInference` and `@leaflow/sdk/canopy/inference/v1` imports with the shared Canopy module.
44
- The OpenAI-compatible `/v1` paths, management `/api/v1` paths and scoped-token authentication are unchanged.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.0.0-dev.457.g4544173",
3
+ "version": "0.0.0-dev.459.gaa32320",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {