@zenera/faker 1.1.15 → 1.1.16

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 +12 -12
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  # @zenera/faker
14
14
 
15
15
  **A mock HTTP server for swagger/OpenAPI documents. Point it at a spec and it
16
- serves it — the response bodies are written, once, by a model.**
16
+ serves it - the response bodies are written, once, by a model.**
17
17
 
18
18
  > Part of [ZeneraNeo](https://github.com/andreyryabov/ZeneraNeo). It ships no
19
19
  > binary of its own: installing it adds a `faker` **subcommand** to
@@ -60,7 +60,7 @@ zen faker cache clear # throw it away
60
60
  ## How a body is produced
61
61
 
62
62
  The first time an operation is called, the faker asks a model to write a
63
- **Python generator** for it — one file, taking a JSON input path and a JSON
63
+ **Python generator** for it - one file, taking a JSON input path and a JSON
64
64
  output path. That file is then run against sample requests it makes up, and
65
65
  judged twice: against the operation's response schema, and against the echo
66
66
  rule, which says that where a path or query parameter shares a name with a
@@ -71,7 +71,7 @@ and is still wrong.
71
71
  If it fails, the diagnostics go back to the model and it tries again, up to
72
72
  `--attempts`. If it passes, the generator is kept in this machine's shared cache
73
73
  under `~/.zenera/neo/cache/faker-generator/`, keyed by the operation's shape, and
74
- every later request is just `podman exec python3 gen.py in.json out.json` — no
74
+ every later request is just `podman exec python3 gen.py in.json out.json` - no
75
75
  model, no tokens. The store is the machine's, so the same document served from
76
76
  another directory costs nothing the second time.
77
77
 
@@ -82,7 +82,7 @@ Generators run in a container with **no network**, on an image baked once with
82
82
 
83
83
  A list endpoint is the one place a mock can hang a real client. Given
84
84
  `?cursor=abc`, the honest-looking answer is a body that validates, echoes
85
- nothing it shouldn't, and hands back `abc` again — so the client asks for the
85
+ nothing it shouldn't, and hands back `abc` again - so the client asks for the
86
86
  same page forever.
87
87
 
88
88
  The faker reads the document for this. Where an operation has a paging
@@ -91,13 +91,13 @@ that carries the next one (`next`, `next_cursor`, `has_more`, …), three things
91
91
  happen, all in the operation's own names:
92
92
 
93
93
  - the model is told to fabricate **three pages** in total, to build the token
94
- out of the paging parameter rather than the seed, and to end the list — null,
94
+ out of the paging parameter rather than the seed, and to end the list - null,
95
95
  absent, or `has_more: false` where the schema leaves no other room;
96
96
  - the generator is then **walked**: the faker calls it with no cursor, follows
97
97
  the token it gets back, and rejects the file if the token repeats, cycles, or
98
98
  never runs out. The diagnostics say which, and the model gets another go;
99
- - at request time a token identical to the one just sent is **cut** — nulled or
100
- dropped, whichever the schema allows — and the request line says so. Nothing
99
+ - at request time a token identical to the one just sent is **cut** - nulled or
100
+ dropped, whichever the schema allows - and the request line says so. Nothing
101
101
  is invented in its place; a generator written before this rule existed is
102
102
  still cached, and a cache is not rebuilt because a rule changed.
103
103
 
@@ -106,8 +106,8 @@ are written again on first use; everything else keeps the key it had.
106
106
  `GET /__faker/routes` reports the shape that was recognised, per operation.
107
107
 
108
108
  Plenty of documents describe the envelope and never write down the parameter
109
- that reads it back. The first two steps cannot help there — nothing static can
110
- see a parameter that is not declared — but the cut still applies: it takes the
109
+ that reads it back. The first two steps cannot help there - nothing static can
110
+ see a parameter that is not declared - but the cut still applies: it takes the
111
111
  paging parameter from the request itself, since a client only sends `?cursor=X`
112
112
  because a body handed it X.
113
113
 
@@ -142,9 +142,9 @@ Environment variables still win over the keyring, exactly as they do for `zen`.
142
142
 
143
143
  | Package | What it is |
144
144
  | ------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
145
- | [`@zenera/cli`](https://github.com/andreyryabov/ZeneraNeo/blob/main/packages/cli/README.md) | `zen` — agent projects on the command line |
146
- | [`@zenera/neo`](https://github.com/andreyryabov/ZeneraNeo/blob/main/packages/neo/README.md) | the runtime — agents, models, tools, skills, memory |
147
- | [`@zenera/rag`](https://github.com/andreyryabov/ZeneraNeo/blob/main/packages/rag/README.md) | `zen rag` — an API description as a searchable graph |
145
+ | [`@zenera/cli`](https://github.com/andreyryabov/ZeneraNeo/blob/main/packages/cli/README.md) | `zen` - agent projects on the command line |
146
+ | [`@zenera/neo`](https://github.com/andreyryabov/ZeneraNeo/blob/main/packages/neo/README.md) | the runtime - agents, models, tools, skills, memory |
147
+ | [`@zenera/rag`](https://github.com/andreyryabov/ZeneraNeo/blob/main/packages/rag/README.md) | `zen rag` - an API description as a searchable graph |
148
148
 
149
149
  ## License
150
150
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenera/faker",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "description": "Mock HTTP server for swagger/OpenAPI documents, with response bodies generated by a model.",
5
5
  "keywords": [
6
6
  "openapi",
@@ -45,7 +45,7 @@
45
45
  "@apidevtools/swagger-parser": "^12.0.0",
46
46
  "ajv": "^8.17.1",
47
47
  "ajv-formats": "^3.0.1",
48
- "@zenera/cli": "^1.1.15",
49
- "@zenera/neo": "^1.1.15"
48
+ "@zenera/cli": "^1.1.16",
49
+ "@zenera/neo": "^1.1.16"
50
50
  }
51
51
  }