mythik 0.1.5 → 0.2.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.
Files changed (81) hide show
  1. package/README.md +68 -32
  2. package/dist/actions/transaction-engine.d.ts +10 -0
  3. package/dist/actions/transaction-engine.d.ts.map +1 -1
  4. package/dist/actions/transaction-engine.js +13 -1
  5. package/dist/actions/transaction-engine.js.map +1 -1
  6. package/dist/agent-context/inventory.d.ts +62 -0
  7. package/dist/agent-context/inventory.d.ts.map +1 -0
  8. package/dist/agent-context/inventory.js +248 -0
  9. package/dist/agent-context/inventory.js.map +1 -0
  10. package/dist/data/data-sources.d.ts +12 -0
  11. package/dist/data/data-sources.d.ts.map +1 -1
  12. package/dist/data/data-sources.js +13 -0
  13. package/dist/data/data-sources.js.map +1 -1
  14. package/dist/index.d.ts +12 -2
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +5 -0
  17. package/dist/index.js.map +1 -1
  18. package/dist/reveal/context.d.ts +22 -0
  19. package/dist/reveal/context.d.ts.map +1 -0
  20. package/dist/reveal/context.js +159 -0
  21. package/dist/reveal/context.js.map +1 -0
  22. package/dist/reveal/index.d.ts +7 -0
  23. package/dist/reveal/index.d.ts.map +1 -0
  24. package/dist/reveal/index.js +7 -0
  25. package/dist/reveal/index.js.map +1 -0
  26. package/dist/reveal/protocol.d.ts +28 -0
  27. package/dist/reveal/protocol.d.ts.map +1 -0
  28. package/dist/reveal/protocol.js +2 -0
  29. package/dist/reveal/protocol.js.map +1 -0
  30. package/dist/reveal/recorder.d.ts +20 -0
  31. package/dist/reveal/recorder.d.ts.map +1 -0
  32. package/dist/reveal/recorder.js +31 -0
  33. package/dist/reveal/recorder.js.map +1 -0
  34. package/dist/reveal/redaction.d.ts +12 -0
  35. package/dist/reveal/redaction.d.ts.map +1 -0
  36. package/dist/reveal/redaction.js +85 -0
  37. package/dist/reveal/redaction.js.map +1 -0
  38. package/dist/reveal/truncation.d.ts +4 -0
  39. package/dist/reveal/truncation.d.ts.map +1 -0
  40. package/dist/reveal/truncation.js +48 -0
  41. package/dist/reveal/truncation.js.map +1 -0
  42. package/dist/reveal/types.d.ts +104 -0
  43. package/dist/reveal/types.d.ts.map +1 -0
  44. package/dist/reveal/types.js +2 -0
  45. package/dist/reveal/types.js.map +1 -0
  46. package/dist/runtime/mount-spec-runtime.d.ts +5 -0
  47. package/dist/runtime/mount-spec-runtime.d.ts.map +1 -1
  48. package/dist/runtime/mount-spec-runtime.js +1 -0
  49. package/dist/runtime/mount-spec-runtime.js.map +1 -1
  50. package/docs/consumer/README.md +11 -0
  51. package/docs/consumer/WHERE-TO-LOOK.md +1 -1
  52. package/docs/consumer/ai-context-runtime-semantics.md +14 -11
  53. package/docs/consumer/ai-context.md +85 -18
  54. package/docs/consumer/reference-doc.md +131 -34
  55. package/docs/llms.txt +6 -1
  56. package/docs/wiki/compiled/README.md +13 -11
  57. package/docs/wiki/compiled/_gaps.md +1 -1
  58. package/docs/wiki/compiled/_index.md +11 -7
  59. package/docs/wiki/compiled/_inventory.md +22 -14
  60. package/docs/wiki/compiled/_lint.md +21 -17
  61. package/docs/wiki/compiled/antipattern-store-save-bypass.md +13 -8
  62. package/docs/wiki/compiled/cli-agent.md +70 -0
  63. package/docs/wiki/compiled/cli-existing-spec-edit-loop.md +9 -8
  64. package/docs/wiki/compiled/cli-overview.md +12 -7
  65. package/docs/wiki/compiled/cli-patch.md +14 -11
  66. package/docs/wiki/compiled/cli-programmatic-api.md +17 -7
  67. package/docs/wiki/compiled/cli-push.md +36 -24
  68. package/docs/wiki/compiled/cli-reveal.md +64 -0
  69. package/docs/wiki/compiled/cli-toon.md +9 -9
  70. package/docs/wiki/compiled/cli-versioning-author.md +19 -15
  71. package/docs/wiki/compiled/concept-agent-context-protocol.md +76 -0
  72. package/docs/wiki/compiled/concept-mythik-reveal.md +63 -0
  73. package/docs/wiki/compiled/concept-package-layout.md +7 -6
  74. package/docs/wiki/compiled/concept-public-package-names.md +9 -5
  75. package/docs/wiki/compiled/concept-shape-animations.md +4 -2
  76. package/docs/wiki/compiled/concept-spec-store-interface.md +7 -4
  77. package/docs/wiki/compiled/concept-spec-store-layering.md +5 -5
  78. package/docs/wiki/compiled/concept-versioned-store.md +8 -5
  79. package/docs/wiki/compiled/pattern-git-vs-db-versioning.md +8 -6
  80. package/docs/wiki/compiled/pattern-push-vs-patch.md +13 -12
  81. package/package.json +1 -1
@@ -13,10 +13,11 @@ Mythik publishes unscoped npm packages. Do not generate scoped package imports f
13
13
  |---|---|
14
14
  | `mythik` | Browser-safe core runtime, state, expressions, validation, browser-safe stores |
15
15
  | `mythik/server` | Node-only stores, SQL drivers, and SQL DDL helpers exported from the core package subpath |
16
- | `mythik-react` | React host, renderer, and web primitives |
17
- | `mythik-cli` | CLI package; installs the `mythik` binary |
18
- | `mythik-cli/api` | Programmatic CLI API: `runPush`, `runPatch`, `runLint`, and related types |
19
- | `mythik-server` | Express server runtime for ApiSpecs |
16
+ | `mythik-react` | React host, renderer, and web primitives |
17
+ | `mythik-react-native` | React Native and Expo renderer, public preview, with an explicit primitive support matrix |
18
+ | `mythik-cli` | CLI package; installs the `mythik` binary |
19
+ | `mythik-cli/api` | Programmatic CLI API: `runPush`, `runPatch`, `runLint`, and related types |
20
+ | `mythik-server` | Express server runtime for ApiSpecs |
20
21
 
21
22
  The `mythik` package also ships the AI documentation under `node_modules/mythik/docs`.
22
23
  Use [[@cli-docs]] to locate or copy it after install.
@@ -28,7 +29,10 @@ npm install mythik mythik-react
28
29
  npm install -D mythik-cli
29
30
  ```
30
31
 
31
- Add `mythik-server` only when building a Mythik-backed Node server. React Native work is a repository preview track, not part of the supported npm publish surface yet.
32
+ Add `mythik-server` only when building a Mythik-backed Node server.
33
+ For React Native and Expo, install `mythik mythik-react-native`; Expo
34
+ apps should install native peer packages with `npx expo install ...`
35
+ so Expo selects versions compatible with the app SDK.
32
36
 
33
37
  SQL adapters (`mssql`, `pg`, `mysql2`, `better-sqlite3`) are optional peer dependencies. Install only the selected database adapter:
34
38
 
@@ -29,8 +29,10 @@ useShapeAnimations(ref, animations, options)
29
29
 
30
30
  ## RN variant
31
31
 
32
- `packages/react-native/src/animation/useShapeAnimations.ts` — repository
33
- preview implementation. It is not part of the supported npm publish surface yet.
32
+ `packages/react-native/src/animation/useShapeAnimations.ts` — internal
33
+ implementation used by the public-preview native blob/background renderer.
34
+ It is not exported from the `mythik-react-native` package root as a standalone
35
+ public hook.
34
36
 
35
37
  ```ts
36
38
  useShapeAnimations(animations, options) → { animatedProps }
@@ -32,10 +32,13 @@ readers without breaking the consumer adapter contract.**
32
32
 
33
33
  ## Approved consumer paths (3 forms)
34
34
 
35
- Never call `SpecStore.save()` from app code. Use:
36
- - **Shell**: `mythik push <id> --from-file spec.json`
37
- - **Bulk**: `mythik push --from-dir <folder>`
38
- - **Programmatic**: `runPush` / `runPatch` from `mythik-cli/api`
35
+ Never call `SpecStore.save()` from app code. Use:
36
+ - **Shell**: `mythik push <id> --from-file spec.json --author <agent>` or `mythik patch <id> --from-file patch.json --author <agent>`
37
+ - **Bulk**: `mythik push --from-dir <folder> --author <agent>`
38
+ - **Programmatic**: `runPush` / `runPatch` from `mythik-cli/api` with `author`
39
+
40
+ Existing full-spec replacement requires explicit `--replace`. Intentionally
41
+ unversioned stores require explicit `--allow-unversioned`.
39
42
 
40
43
  See [[@cli-push]] + [[@antipattern-store-save-bypass]].
41
44
 
@@ -18,14 +18,14 @@ Understanding the layering prevents bypassing validation.
18
18
  | `store.saveVersion(id, doc, meta)` | **NO** | Versioned write. Writes to `screen_versions` and updates the current spec. |
19
19
  | `SpecEngine.patch(id, patches)` | **YES** | Applies RFC-6902 patches, validates through the document handler, and persists the patched document through `store.save`. |
20
20
  | `mythik push` / `runPush` | **YES** | Validates and writes through `saveVersion` when a versioned store + author are used. |
21
- | `mythik patch` / `runPatch` | **YES** | Uses `SpecEngine.patch` for patch application + validation. Without author, persists through `store.save`; with a versioned store + author, captures the patched document and writes once through `saveVersion`. |
21
+ | `mythik patch` / `runPatch` | **YES** | Uses `SpecEngine.patch` for patch application + validation. With a versioned store + author, captures the patched document and writes once through `saveVersion`. Without author, persisted writes are rejected unless `--allow-unversioned` is explicit. |
22
22
 
23
23
  ## Consumer rule
24
24
 
25
- **Never call `store.save()` from application code.** Use:
26
-
27
- - `mythik push <id>` / `mythik patch <id> --from-file patch.json` for shell work.
28
- - `runPush` / `runPatch` from `mythik-cli/api` for programmatic work.
25
+ **Never call `store.save()` from application code.** Use:
26
+
27
+ - `mythik push <id> --from-file spec.json --author <agent>` / `mythik patch <id> --from-file patch.json --author <agent>` for shell work.
28
+ - `runPush` / `runPatch` from `mythik-cli/api` with `author` for programmatic work.
29
29
 
30
30
  See [[@antipattern-store-save-bypass]] and [[@cli-lint]].
31
31
 
@@ -21,9 +21,11 @@ currentVersion(id): Promise<number>
21
21
 
22
22
  ## Activation
23
23
 
24
- `mythik push --author <name>` and `mythik patch --author <name>` activate
25
- versioning automatically. Without `--author`, commands work as before
26
- (no versioning).
24
+ `mythik push --author <name>` and `mythik patch --author <name>` activate
25
+ versioning automatically when the resolved store supports
26
+ `saveVersion`. Without `--author`, persisted writes are rejected unless
27
+ `--allow-unversioned` is explicit. Existing full-spec replacement
28
+ requires `--replace`.
27
29
 
28
30
  ## Snapshots + patch chain
29
31
 
@@ -57,8 +59,9 @@ See `concept-customize-versioned-store.md` for the recipe.
57
59
  - [[@cli-versioning-author]]
58
60
  - [[@cli-history]]
59
61
  - [[@concept-rollback]]
60
- - [[@concept-environment-store]]
61
- - [[@concept-customize-versioned-store]]
62
+ - [[@concept-environment-store]]
63
+ - [[@concept-customize-versioned-store]]
64
+ - [[@concept-agent-context-protocol]]
62
65
 
63
66
  ## Sources (raw)
64
67
 
@@ -9,12 +9,14 @@ sources: [docs/consumer/ai-context-runtime-semantics.md#62-git-backed-vs-db-vers
9
9
 
10
10
  Two history models — pick one per project.
11
11
 
12
- ## Git-backed history
13
-
14
- - Specs in repo, `git log` + `git blame` serve as audit trail.
15
- - No `--author` flag needed on push/patch.
16
- - CLI writes via `store.save` (unversioned path).
17
- - **Best for**: single-env apps, dev-loop iteration, specs-as-code.
12
+ ## Git-backed history
13
+
14
+ - Specs in repo, `git log` + `git blame` serve as audit trail.
15
+ - Persisted CLI writes must still be explicit: use `--author <name>`
16
+ when the resolved store supports versioning, or `--allow-unversioned`
17
+ only when the project intentionally uses a non-versioned store.
18
+ - CLI writes via `store.save` only on the explicit unversioned path.
19
+ - **Best for**: single-env apps, dev-loop iteration, specs-as-code.
18
20
 
19
21
  ## DB-versioned history
20
22
 
@@ -10,18 +10,19 @@ sources: [docs/consumer/ai-context-runtime-semantics.md#61-push-vs-patch--file-f
10
10
  Two paradigms for modifying specs. Pick one per project; mixing creates
11
11
  issues.
12
12
 
13
- ## Push paradigm (file-first)
14
-
15
- - Specs live in git under `specs/*.json`.
16
- - Modify locally, then run `mythik push <id>`.
17
- - Diff-reviewable in CI through normal JSON file diffs.
18
- - Full-spec bandwidth cost per write.
19
-
20
- ## Patch paradigm (DB-first)
21
-
22
- - Specs live in the DB; local files are optional working snapshots.
23
- - Modify via `mythik patch <id> --from-file patch.json` for shell-safe
24
- surgical writes.
13
+ ## Push paradigm (file-first)
14
+
15
+ - Specs live in git under `specs/*.json`.
16
+ - Modify locally, lint, then run `mythik push <id> --from-file spec.json --author <agent>`.
17
+ - Existing persisted specs require explicit `--replace` for full replacement.
18
+ - Diff-reviewable in CI through normal JSON file diffs.
19
+ - Full-spec bandwidth cost per write.
20
+
21
+ ## Patch paradigm (DB-first)
22
+
23
+ - Specs live in the DB; local files are optional working snapshots.
24
+ - Modify via `mythik patch <id> --from-file patch.json --author <agent>` for shell-safe
25
+ surgical writes.
25
26
  - Requires `mythik pull <id>` to refresh any local `specs/*.json` snapshot
26
27
  after a DB patch.
27
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mythik",
3
- "version": "0.1.5",
3
+ "version": "0.2.0",
4
4
  "description": "AI-first JSON-native core runtime for validated applications, APIs, editor sessions, state, actions, validation, and versioning.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",