@kana-ai/edgar-contracts 0.1.2 → 0.1.4

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/README.md CHANGED
@@ -4,20 +4,22 @@ JSON Schemas (2020-12) of what the EDGAR engine and its TypeScript side exchange
4
4
 
5
5
  Use this package when you write code that reads or writes one of these messages: the SDK, the extension runtime, a provider runtime, or a program that reads `edgar check --json`. An extension author does not import it directly: the SDK gives the same types. For how the processes talk, see [architecture](/docs/concepts/architecture.md#the-processes).
6
6
 
7
- > `schemas/json/diagnostic.schema.json` and `schemas/json/limit.schema.json` come from the Rust types `Diagnostic` and `Limit`. After you change one of these types, run `edgar contracts emit` from the repository root, and commit the files. A unit test in `edgar-core` fails when a committed file differs. The other four schemas are written by hand until their types derive `JsonSchema`. For them, the files in `schemas/` are the source, and the engine's Rust types in `edgar-core` must match them. See [logs, spans and contracts](/docs/reference/observability.md#make-the-contracts-from-the-rust-types).
7
+ > `schemas/json/config.schema.json`, `schemas/json/diagnostic.schema.json`, `schemas/json/limit.schema.json` and `schemas/json/setup.schema.json` come from the Rust types `Config`, `Diagnostic`, `Limit` and `Setup`. After you change one of these types, run `edgar contracts emit` from the repository root, and commit the files. A unit test in `edgar-core` fails when a committed file differs. The other four schemas are written by hand until their types derive `JsonSchema`. For them, the files in `schemas/` are the source, and the engine's Rust types in `edgar-core` must match them. See [logs, spans and contracts](/docs/reference/observability.md#make-the-contracts-from-the-rust-types).
8
8
 
9
9
  ## Schemas
10
10
 
11
11
  The package has two folders: `schemas/json/` holds the JSON Schema files, and `schemas/ts/` holds the Zod schemas that the TypeScript side imports.
12
12
 
13
- | Schema | What it describes |
14
- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
15
- | `schemas/json/outcome.schema.json` | The outcome union, the temporary and the permanent kinds; `retry_after` is in seconds and `timeout_at` in Unix milliseconds; `done` and both failures take an optional `limit` |
16
- | `schemas/json/limit.schema.json` | One rate or usage limit, `{source, remaining?, limit?, resets_at?, window?}`, made from the Rust `Limit` type by `edgar contracts emit`; `resets_at` is in Unix milliseconds |
17
- | `schemas/json/rpc.schema.json` | The JSON-RPC 2.0 lines between the engine and `edgar-runtime`, their params and results, and the 4 MiB line limit (`MaxMessageBytes`) |
18
- | `schemas/json/provider.schema.json` | The JSON-RPC 2.0 lines between the engine and a provider runtime such as `edgar-provider-claude`: `hello`, `session.*`, `tool.request` and the `session.event` notifications, with the `limit` event |
19
- | `schemas/json/manifest.schema.json` | `edgar-extension.json`, which the SDK build writes |
20
- | `schemas/json/diagnostic.schema.json` | One record of `edgar check --json` |
13
+ | Schema | What it describes |
14
+ | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
15
+ | `schemas/json/outcome.schema.json` | The outcome union, the temporary and the permanent kinds; `retry_after` is in seconds and `timeout_at` in Unix milliseconds; `done` and both failures take an optional `limit` |
16
+ | `schemas/json/limit.schema.json` | One rate or usage limit, `{source, remaining?, limit?, resets_at?, window?}`, made from the Rust `Limit` type by `edgar contracts emit`; `resets_at` is in Unix milliseconds |
17
+ | `schemas/json/rpc.schema.json` | The JSON-RPC 2.0 lines between the engine and `edgar-runtime`, their params and results, and the 4 MiB line limit (`MaxMessageBytes`) |
18
+ | `schemas/json/provider.schema.json` | The JSON-RPC 2.0 lines between the engine and a provider runtime such as `edgar-provider-claude`: `hello`, `session.*`, `tool.request` and the `session.event` notifications, with the `limit` event |
19
+ | `schemas/json/manifest.schema.json` | `edgar-extension.json`, which the SDK build writes |
20
+ | `schemas/json/diagnostic.schema.json` | One record of `edgar check --json` |
21
+ | `schemas/json/setup.schema.json` | What the setup probes found, `{extensions: [{extension, probes: [{label, verdict}]}]}`, each verdict `pass`, `fail` with `reason` and `fix`, or `skipped` with `why`: `edgar check --live --json` prints it under `setup`, and `GET /api/setup` answers it; made from the Rust `Setup` type by `edgar contracts emit` |
22
+ | `schemas/json/config.schema.json` | `edgar.toml`: each key's `title` is its label in the console, its `description` the help sentence, and its `x-edgar` its `group`, its `apply` (`live` or `restart`, once the running project reloads) and its `console` access (`edit` or `view`) |
21
23
 
22
24
  `schemas/ts/` holds the Zod schemas. `end.ts` has `runEnded`, the part of a `run_outcome` event that a note at the end of a run reads. `card.ts` has `cardBlock` and `cardSpec`, whose output types are the `CardBlock` and `CardSpec` of `rpc.schema.json`. The tracker extensions import them from `@kana-ai/edgar-contracts/card`, so their `create_card` schemas stay the same. A card's block has a `kind` (`defect`, `request`, `question` or `investigation`) and optional facts such as `service`, `fingerprint` (16 lower-case hex characters) and `severity`. The intake refuses a card whose block does not match, and says why on the card.
23
25