@ikenga/contract 0.3.0

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 ADDED
@@ -0,0 +1,38 @@
1
+ # @ikenga/contract
2
+
3
+ The single source of truth for how the **Ikenga shell**, **pkgs**, and **engines** talk to each other.
4
+
5
+ This package is intentionally small and stable. Bumping its major version is an event coordinated across the shell + every published pkg.
6
+
7
+ ## What's in here
8
+
9
+ | Module | Exports |
10
+ |--------|---------|
11
+ | `@ikenga/contract/manifest` | `ikenga-pkg.toml` schema (zod) — `ManifestSchema`, `Manifest` type |
12
+ | `@ikenga/contract/rpc` | Shell ↔ pkg postMessage RPC envelope, request/response types |
13
+ | `@ikenga/contract/engine` | `Engine` interface, `Session`, `EngineEvent` types |
14
+ | `@ikenga/contract/scopes` | Capability scope catalogue (`tasks:read`, `engine:invoke`, …) |
15
+ | `@ikenga/contract/artifact` | Ikenga artifact manifest schema (zod) — `ArtifactManifestSchema`, `ArtifactManifest` type, refresh / data-source / fallback sub-schemas |
16
+
17
+ ## Artifact manifest
18
+
19
+ The artifact manifest is the JSON block embedded in `<script type="application/json" id="ikenga-manifest">…</script>` (single-file artifacts) or in `manifest.json` (folder mode). It's a separate concept from the pkg manifest — pkgs are heavyweight Tauri-side mini-apps; artifacts are portable HTML docs that render anywhere and light up with live data inside the Ikenga shell.
20
+
21
+ - Source of truth: `src/artifact.ts` (Zod).
22
+ - Generated JSON Schema: `schemas/artifact/v0.json` — regenerate with `pnpm generate:schemas` after schema edits.
23
+ - Published at: `https://royalti-io.github.io/ikenga-contract/schemas/artifact/v0.json` (`$id` is stamped at generation time).
24
+ - Fixtures (the three v0 example artifacts) live in `src/artifact-fixtures/` and are gated by `pnpm test`.
25
+
26
+ ## Versioning
27
+
28
+ Strict semver. Pkgs declare `"contract": "^1"` and the kernel checks compatibility at install time.
29
+
30
+ ## Source of truth
31
+
32
+ The `Manifest` schema **mirrors** the Rust struct in `royalti-io/ikenga` at `src-tauri/src/pkg/manifest.rs`. The Rust kernel parses pkg `manifest.json` files; this package is a TS-side validator and types-only mirror for tooling (CLI, registry build).
33
+
34
+ If you need to change the manifest, change the Rust struct first and update this schema in lockstep.
35
+
36
+ ## Status
37
+
38
+ `v0.2.0` — manifest realigned to the real Rust schema (was a speculative parallel in v0.1.0). RPC method catalogue, engine interface, and capability scopes still in place but unused by the kernel today; treat them as forward-looking.