Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
877f9e8
The ledger reads OpenAPI 2.0 and the RFCs the client follows; the SDK…
rsaryev Nov 26, 2026
1ba4991
SDK texts: a README title, a package description, method names withou…
rsaryev Nov 26, 2026
fd7522b
Merge branch 'sdk-texts' into sdk-auth
rsaryev Nov 26, 2026
32637b7
SDK servers and HTTP by the ledger: variables, relative URLs, retries…
rsaryev Nov 26, 2026
f3f940c
SDK bodies by the ledger: the Encoding Object from the description, f…
rsaryev Nov 26, 2026
51cf22a
Merge branch 'sdk-enc' into sdk-http
rsaryev Nov 26, 2026
2301860
SDK authentication by the ledger: every scheme kind, client credentia…
rsaryev Nov 26, 2026
fb3337f
Swagger 2.0 collectionFormat in every location and nested items; room…
rsaryev Nov 26, 2026
33e5f8d
Merge branch 'sdk-auth' into sdk-http
rsaryev Nov 26, 2026
a0624e2
Merge branch 'sdk-core' into sdk-http
rsaryev Nov 26, 2026
d8f3738
The ledger's last id and the leftovers: 2.0 operation schemes, retrie…
rsaryev Nov 26, 2026
e38aa3c
The Rust SDK writes form bodies by the description's encoding, as O8 …
rsaryev Nov 26, 2026
2781747
One reader of Swagger 2.0 form members: the core's model; generate pr…
rsaryev Nov 26, 2026
83b280c
npm: the second module's budget for the SDK layer made to the ledger;…
rsaryev Nov 26, 2026
eb11cb1
O8 results: 489 calls of cases.json and the corpus, no difference
rsaryev Nov 26, 2026
07c7269
bench: writing requests after the SDK layer's ledger work, the same a…
rsaryev Nov 26, 2026
72847f7
config draft leaves security unset when the description has none, so …
rsaryev Nov 26, 2026
f446105
flowapi 0.3.0
rsaryev Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
51 changes: 33 additions & 18 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ work here.
- `schema`: [`Keyword`](crates/flowapi/src/schema/keyword.rs), every keyword of every dialect;
where a schema holds schemas (`sub.rs`); the index of `$id`, `$anchor` and big objects.
- `spec`: what a description names: components, a JSON Schema's root, operations
(`operations/reader.rs`, `responses.rs`, `style.rs` how a parameter is serialized; Swagger
2.0's bodies, forms and media types lifted into the 3.x model in `swagger.rs`).
(`operations/reader.rs`, `responses.rs`, `style.rs` how a parameter is serialized, and a
request's form members by their Encoding Objects; Swagger 2.0's bodies, forms (an array
field by its `collectionFormat`) and media types lifted into the 3.x model in `swagger.rs`).
- `graph`: schemas into types. `build.rs` (a queue, no recursion), `read.rs` (one keyword),
`own.rs` (a schema's own values), `narrow.rs` and `literal.rs` (`enum`, `const`), `ops.rs`
(operations as types).
Expand All @@ -30,53 +31,66 @@ work here.
that names every type.
- `crates/flowapi-ts`: the TypeScript target. `tests/cases/*.json` and the `.ts` kept beside each.
`src/sdk.rs` the opt-in SDK (`--sdk`): `sdk/request.rs`, `sdk/response.rs` and the runtime
printed once (`sdk/runtime.ts` writes requests, `sdk/multipart.ts` their `multipart/form-data`
bodies, `sdk/read.ts` reads responses);
printed once (`sdk/runtime.ts` writes requests, `sdk/form.ts` their form bodies by the
Encoding Objects, `sdk/multipart.ts` their `multipart` bodies, `sdk/read.ts` reads responses);
`tests/sdk/*.json` kept like the cases.
- `crates/flowapi-rust`: the Rust target (serde types). `tests/cases/*.rs`, kept like the TypeScript ones.
`src/sdk.rs` the opt-in SDK (`--target rust --sdk`): `sdk/request.rs`, `sdk/param.rs`,
`sdk/response.rs`, and the runtime printed once as `pub mod sdk` (`sdk/runtime.rs` and
`src/sdk.rs` the opt-in SDK (`--target rust --sdk`): `sdk/request.rs`, `sdk/param.rs` (a
parameter's style, and a form's members by the description's Encoding Objects, printed into each
call), `sdk/response.rs`, and the runtime printed once as `pub mod sdk` (`sdk/runtime.rs` and
`sdk/errors.rs`, its modules `sdk/write.rs`, `sdk/expand.rs` and `sdk/finite.rs`, never compiled
here: this crate has no serde); `src/print/integer.rs` the `Integer` type printed with the types;
`tests/sdk/*.rs` kept for the TypeScript SDK's cases and `tests/sdk/names.json`.
- `crates/flowapi-sdk`: the SDK layer, above the targets: what a client needs beside a target's
SDK, which no type depends on. It reads the documents through the core's public modules
(`doc.rs`: references followed, each endpoint's Operation Object found again), `servers.rs`
(3.x `servers` at three levels with variables; 2.0's `host`, `basePath`, `schemes` lifted) and
`security.rs` (`securitySchemes` or 2.0's `securityDefinitions`, `security`) into `model.rs`,
(3.x `servers` at three levels with variables, a relative URL of another document written from
the first; 2.0's `host`, `basePath`, `schemes` lifted) and
`security.rs` (`securitySchemes` or 2.0's `securityDefinitions`; `security/flows.rs` OAuth 2.0's
flows, `security/requirements.rs` `security` and its names) into `model.rs`,
and `print.rs` prints the TypeScript table put after `--sdk`'s output (`flowapiServers`,
`flowapiSecuritySchemes`, `flowapiOperations`), naming the functions as `flowapi-ts` does. No
I/O (G5). `tests/cases/*.json` and the `.ts` kept beside each (`--test table`, each case's
`x-flowapi-covers` the ledger's markers); `tests/tsc.mjs` type-checks and imports them after the
`--sdk` output. The `flowapi-sdk.yml` config, also no I/O: `config/shape.rs` (and
`shape/schemes.rs`) its format once, as tables that `config/read.rs` validates by,
`config/build.rs` reads into `config/model.rs` and `config/schema.rs` prints as JSON Schema;
`config/check.rs` and `config/names.rs` hold it to the description, `config/issue.rs` the
`config/build.rs` (`build/members.rs`) reads into `config/model.rs` and `config/schema.rs`
prints as JSON Schema (`shape/package.rs` the `package` and `readme` tables);
`config/check.rs` and `config/names.rs` hold it to the description (`config/auth.rs` and
`auth/usage.rs` its `auth` and `security`, also laid over the description's), `config/issue.rs` the
issues; `ops.rs` the operations by id and route, `words.rs` names as words, `paging/` the
pagination a schema fits (`fit.rs`) or suggests (`suggest.rs`), `draft.rs` (`draft/naming.rs`)
a first config, `summary.rs` the compact summary. `tests/config/*.yml` with the issues kept
pagination a schema fits (`fit.rs`) or suggests (`suggest.rs`), `draft.rs` (`draft/naming.rs`,
a method's name without its resource's words in `draft/naming/trim.rs`) a first config,
`prose.rs` a description's CommonMark as plain text, `summary.rs` the compact summary. `tests/config/*.yml` with the issues kept
beside each (`--test config`), `tests/schema.json` (`--test schema`, the reader and the schema
agree both ways), `tests/draft/` (`--test draft`), `tests/summary/` (`--test summary`).
`encoding.rs` a `multipart/form-data` body's encoding, put in the table. `client.rs` the whole
TypeScript client from a config (`client_files`): `client/resources.rs` a class per resource,
`client/entry.rs` the client class and `index.ts`, `client/core/*.ts` the runtime, kept as
`encoding.rs` a form or `multipart` body's Encoding Objects, put in the table (`encoding/inspect.rs`
a part's type from its schema, `encoding/swagger.rs` 2.0's forms from the core's
`Media::encoding`, which alone reads `collectionFormat`; `encoding/print.rs` the table's literal). `client.rs` the whole
TypeScript client from a config (`client_files`): `client/resources.rs` a class per resource
(`client/comment.rs` each method's doc comment),
`client/entry.rs` the client class and `index.ts`, `client/core/*.ts` the runtime (`auth.ts`
the credentials, `token.ts` OAuth 2.0's client credentials grant), kept as
TypeScript and printed as it is (each file held to 300 working lines by `tests/client.mjs`).
`tests/client/<case>/` a config and a description with the client kept beside them
(`--test client`); `tests/client.mjs` type-checks them and runs `tests/client/*.mjs` against a
stub `fetch`, each test naming the pitfall it holds. `repo.rs` the whole repository around the
client (`repo_files`): `repo/package.rs` `package.json`, the TypeScript configs and the
license, `repo/texts.rs` the scripts, CI, release-please and the repository's `AGENTS.md`,
`repo/mock.rs` the mock server's routes, `repo/suite.rs` a test per resource, `repo/readme.rs`
`README.md` and `api.md`, `repo/example.rs` a schema's example value, `repo/lock.rs`
`README.md` (its sections in `readme/sections.rs`, the servers' in `readme/servers.rs`) and `api.md` (`readme/api.rs`), `repo/example.rs` a schema's example value, `repo/lock.rs`
`.flowapi/lock.json` (the shape the agent plugin reads), `repo/plan.rs` what writing the
repository changes on disk (`plan`: by the lock and what the host found at each path; every host
runs it, none decides alone); `repo/files/` the texts printed
as they are (scripts, `server.mjs`, the licenses); `sha256.rs` our own SHA-256.
`tests/repo/<case>/` the repository of each client case but its `src/`, kept (`--test repo`).
`tests/repo/<case>/` the repository of each client case but its `src/`, kept (`--test repo`);
`tests/texts.mjs` compiles their README examples and `api.md` signatures against the client
and refuses a placeholder in their texts.
- `crates/flowapi-cli`: the `flowapi` command, all of flowapi's I/O. `src/sdk.rs` the subcommands
put before the path (`summary`, `config draft|schema|check`; `tests/sdk_cli.rs`);
`src/generate.rs` `generate`, `generate/disk.rs` what is on disk for the SDK layer's `plan`,
`generate/apply.rs` the writes, staged first (`tests/generate_cli.rs`).
`generate/apply.rs` the writes, staged first (`tests/generate_cli.rs`; its warnings, the core's
and the SDK layer's, each once: `tests/generate_warnings_cli.rs`).
- `crates/flowapi-yaml`: a description's text as the core reads it, shared by the command and the
WebAssembly module: which document is YAML (`is_yaml`), YAML 1.2 read into JSON with each node's
YAML place (`reader.rs`, `saphyr-parser`), and the line and column of an offset. No I/O (G5).
Expand Down Expand Up @@ -144,6 +158,7 @@ cargo test -p flowapi-cli --test sdk_cli # summary and config as t
cargo test -p flowapi-sdk --test repo # the repositories kept in tests/repo/ (FLOWAPI_BLESS=1)
cargo test -p flowapi-cli --test generate_cli # generate's writing rules as the command runs them
node crates/flowapi-sdk/tests/tsc.mjs # them type-checked after --sdk; after cargo build --release
node crates/flowapi-sdk/tests/texts.mjs # the kept READMEs and api.md compiled against their clients
cargo run --release -p flowapi-cli -- <description.json> -o types.ts
(cd plugins/flowapi && npm test) # the agent plugin; its e2e on target/release/flowapi
(cd plugins/flowapi && npm run docs) # the flowapi skill's references, after a docs change
Expand Down
Loading