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
@@ -34,18 +34,29 @@ mythik manifest <screen>
34
34
  # Get specific element details
35
35
  mythik elements <screen> <id1,id2,...>
36
36
 
37
- # Apply RFC 6902 patches
38
- mythik patch <screen> --from-file patch.json
37
+ # Apply RFC 6902 patches
38
+ mythik patch <screen> --from-file patch.json --author <agent>
39
39
 
40
40
  # Export a full screen spec for backup/review
41
41
  mythik pull <screen>
42
42
 
43
- # Create or intentionally replace a full screen spec from stdin
44
- mythik push <screen>
43
+ # Create a new screen spec or intentionally replace a full screen spec
44
+ mythik push <screen> --from-file spec.json --author <agent>
45
+ mythik push <screen> --from-file spec.json --replace --author <agent>
45
46
 
46
47
  # Validate a screen spec
47
48
  mythik validate <screen>
48
49
 
50
+ # Start and query live runtime context for AI agents
51
+ mythik reveal start
52
+ mythik reveal apps --json
53
+ mythik reveal context --app <name>
54
+ mythik reveal element <element-id> --app <name>
55
+
56
+ # Install and refresh project-local AI operating context
57
+ mythik agent init codex|claude|all
58
+ mythik agent context --app <app-id> --include-screens --out .mythik/agent/context.md
59
+
49
60
  # Delete a screen (preview without --confirm)
50
61
  mythik delete <screen> --confirm
51
62
  ```
@@ -72,15 +83,15 @@ Set the env var once per session: `export MYTHIK_API_KEY="your-key"`. The CLI re
72
83
  ### Patch Input: File vs Stdin
73
84
 
74
85
  **Preferred shell-safe path** - write patch JSON to a file:
75
- ```bash
76
- mythik patch task-manager --from-file patch.json
77
- ```
86
+ ```bash
87
+ mythik patch task-manager --from-file patch.json --author <agent>
88
+ ```
78
89
 
79
90
  `--from-file <path>` wins over ambient non-TTY stdin. Use `--from-file -` or pipe without `--from-file` when stdin is intentional:
80
- ```bash
81
- cat patch.json | mythik patch task-manager
82
- mythik patch task-manager --from-file -
83
- ```
91
+ ```bash
92
+ cat patch.json | mythik patch task-manager --author <agent>
93
+ mythik patch task-manager --from-file - --author <agent>
94
+ ```
84
95
 
85
96
  Inline JSON still works for tiny patches, but `--from-file` is preferred for anything containing `$state`, `$template`, `$auth`, or shell-sensitive quoting.
86
97
 
@@ -90,9 +101,9 @@ Inline JSON still works for tiny patches, but `--from-file` is preferred for any
90
101
 
91
102
  Use `--toon` for token-efficient output on `elements` and `patch` commands:
92
103
 
93
- ```bash
94
- mythik elements task-manager btn,nav --toon
95
- mythik patch task-manager --from-file patch.toon --toon
104
+ ```bash
105
+ mythik elements task-manager btn,nav --toon
106
+ mythik patch task-manager --from-file patch.toon --toon --author <agent>
96
107
  ```
97
108
 
98
109
  TOON reduces output by ~40% vs JSON. Lossless roundtrip. Based on `@toon-format/toon` v2.
@@ -101,33 +112,117 @@ TOON reduces output by ~40% vs JSON. Lossless roundtrip. Based on `@toon-format/
101
112
 
102
113
  ```bash
103
114
  # JSON input (as before)
104
- mythik patch task-manager --from-file patch.json
115
+ mythik patch task-manager --from-file patch.json --author <agent>
105
116
 
106
117
  # TOON input (autodetected)
107
- mythik patch task-manager --from-file patch.toon
118
+ mythik patch task-manager --from-file patch.toon --author <agent>
108
119
  ```
109
120
 
110
121
  ### Workflow: Manifest → Elements → Patch
111
122
 
112
123
  1. **`mythik manifest <screen>`** — see the structure, decide what to modify
113
124
  2. **`mythik elements <screen> <ids>`** — inspect specific elements you need to change
114
- 3. **`mythik patch <screen> --from-file patch.json`** - apply surgical changes
115
- 4. **`mythik manifest <screen>`** — verify the result
125
+ 3. **`mythik patch <screen> --from-file patch.json --author <agent>`** - apply a surgical, versioned change
126
+ 4. **`mythik validate <screen>`** — validate the stored result
127
+ 5. **`mythik manifest <screen>`** — verify the changed structure
116
128
 
117
129
  This is the required default loop for AI agents editing an existing spec. Do not begin a small change by pulling the full spec and rewriting it. `manifest` gives the structural map, `elements` gives the exact JSON for the target nodes, and `patch --from-file` keeps the write validated, versionable, and reviewable. Use `pull` for backup/migration/review and `push` for new specs or deliberate full replacement only.
118
130
 
131
+ ### Mythik Reveal — Live Runtime Context for AI Agents
132
+
133
+ `mythik reveal` lets a running Mythik app expose its live contract,
134
+ state, actions, diagnostics, and environment as structured context for
135
+ AI agents. It complements the spec-edit loop:
136
+
137
+ - `manifest` and `elements` read stored specs.
138
+ - `lint` and `validate` check candidate specs before runtime.
139
+ - `reveal` reads the app that is actually running.
140
+
141
+ Use Reveal when the symptom is runtime behavior: a button does not
142
+ fire, a dataSource does not load, a screen renders the wrong branch, a
143
+ native app behaves differently from web, or a render error appears.
144
+ Do not guess from source files first when a Reveal-enabled app can
145
+ answer with live context.
146
+
147
+ Start the local bridge:
148
+
149
+ ```bash
150
+ mythik reveal start --port 17373
151
+ ```
152
+
153
+ The command prints:
154
+
155
+ ```text
156
+ MYTHIK_REVEAL_URL=http://127.0.0.1:17373
157
+ MYTHIK_REVEAL_TOKEN=<generated-token>
158
+ ```
159
+
160
+ Pass those values into the host runtime in development:
161
+
162
+ ```tsx
163
+ const reveal = React.useMemo(() => ({
164
+ enabled: import.meta.env.DEV,
165
+ appName: 'my-app',
166
+ bridgeUrl: import.meta.env.VITE_MYTHIK_REVEAL_URL,
167
+ token: import.meta.env.VITE_MYTHIK_REVEAL_TOKEN,
168
+ environment: { id: 'dev', source: 'host' as const },
169
+ includeStatePaths: ['/ui', '/form'],
170
+ redactStatePaths: ['/auth', '/secrets'],
171
+ }), []);
172
+
173
+ <MythikApp appSpec={appSpec} specStore={specStore} reveal={reveal} />
174
+ ```
175
+
176
+ Then query the connected app:
177
+
178
+ ```bash
179
+ mythik reveal apps --json
180
+ mythik reveal context --app my-app
181
+ mythik reveal current --app my-app
182
+ mythik reveal screen dashboard --app my-app
183
+ mythik reveal element save-button --app my-app
184
+ ```
185
+
186
+ Reveal context includes:
187
+
188
+ - runtime renderer (`react`, `react-native`, `server`, or `unknown`)
189
+ - app name, platform, and environment metadata
190
+ - spec summary and optional screen/element summary
191
+ - resolved public props for inspected elements
192
+ - dependency paths for inspected elements
193
+ - included state paths and omitted paths
194
+ - render errors and warnings
195
+ - action, transaction, dataSource, navigation, lifecycle, and render
196
+ error events
197
+ - patch target metadata when the host can identify a versioned spec
198
+ - redaction and truncation metadata
199
+
200
+ Security rules:
201
+
202
+ - Reveal is development tooling. Do not enable it in production.
203
+ - The bridge is local and token-protected. Never commit or publish the
204
+ token.
205
+ - Use narrow `includeStatePaths`; do not expose the whole store by
206
+ default.
207
+ - Redact `/auth`, `/secrets`, tokens, passwords, API keys, and session
208
+ values.
209
+ - React and React Native hosts should memoize the `reveal` config
210
+ object so the bridge client is stable across renders.
211
+ - For Android emulator testing, use `adb reverse tcp:17373 tcp:17373`
212
+ before querying the host bridge from the native app.
213
+
119
214
  ### Full Spec Lifecycle
120
215
 
121
216
  ```bash
122
- Create: mythik push <id> < spec.json
123
- Read: mythik manifest <id> / mythik elements <id> ids / mythik pull <id>
124
- Modify: mythik patch <id> --from-file patch.json
125
- Validate: mythik validate <id>
126
- Delete: mythik delete <id> --confirm
127
- Backup: mythik pull <id> > backup.json
128
- Restore: mythik push <id> < backup.json
129
- Migrate: mythik pull <id> --store A | mythik push <id> --store B
130
- Tokens: mythik tokens --dna '{"primary":"#0D9488"}' --json
217
+ Create: mythik push <id> --from-file spec.json --author <agent>
218
+ Read: mythik manifest <id> / mythik elements <id> ids / mythik pull <id>
219
+ Modify: mythik patch <id> --from-file patch.json --author <agent>
220
+ Validate: mythik validate <id>
221
+ Delete: mythik delete <id> --confirm
222
+ Backup: mythik pull <id> > backup.json
223
+ Restore: mythik push <id> --from-file backup.json --replace --author <agent>
224
+ Migrate: mythik push <id> --from-file exported.json --author <agent> --store B
225
+ Tokens: mythik tokens --dna '{"primary":"#0D9488"}' --json
131
226
  ```
132
227
 
133
228
  ### Push — Create New Screens
@@ -1990,7 +2085,7 @@ Reference tokens or write custom values:
1990
2085
  89. **Lazy bootstrap for existing specs** — first versioned save on an existing spec with no history automatically creates v1 (snapshot of current spec), then saves the change as v2. No migration script needed. Specs without history continue working via base `SpecStore.load()`
1991
2086
  90. **Use `navigateScreen` and `goBackScreen` in specs** — `navigateScreen` and `goBackScreen` are registered by MythikApp and call the AppEngine directly. The built-in `navigate` and `goBack` only set state intents. Always use `navigateScreen`/`goBackScreen` in specs for navigation that works. Example: `{ "action": "goBackScreen" }` goes back to the previous screen in the navigation history, regardless of which screen navigated to the current one
1992
2087
  91. **CLI `--table` flag overrides the current spec table** — all commands accept `--table <name>` to read/write from a different base table. Use `--table api_specs` to operate on api-specs. The flag overrides the base table for Supabase, SQL Server, PostgreSQL, MySQL, and SQLite stores. Version and environment tables are configured separately with `MYTHIK_VERSIONS_TABLE`, `MYTHIK_ENVIRONMENTS_TABLE`, or the equivalent `.mythikrc` SQL settings.
1993
- 92. **`push` and `patch` version automatically with `--author`**when `--author` is provided, both commands use `VersionedSpecStore.saveVersion()` instead of `SpecStore.save()`. The version includes author, source type (`push`/`patch`), and optional `--description`. Without `--author`, commands work as before (no versioning). Example: `mythik patch screen-id --author alice --description "Fixed layout"`
2088
+ 92. **`push` and `patch` require explicit write intent**persisted writes should use `--author <name>` so the resolved versioned store records a version through `VersionedSpecStore.saveVersion()`. Existing specs require `--replace` for full replacement. Use `--allow-unversioned` only for intentionally unversioned stores such as file-store smoke tests. The version includes author, source type (`push`/`patch`), and optional `--description`. Example: `mythik patch screen-id --from-file patch.json --author alice --description "Fixed layout"`
1994
2089
  93. **`mythik history` shows inline diffs** — each version in the history output shows the actual changes (before/after values), not just a summary. Uses `computeStructuralDiff` between consecutive versions. Example output: `~ element "btn" prop content: "Send" → "Submit"`
1995
2090
  95. **`ai-context.md` is the AI-optimized spec reference** — compressed from this reference-doc (1145 lines vs 2658). Use ai-context.md for spec generation, reference-doc for full human reference. Validated via agent-based testing with progressive difficulty levels (L1-L4). Test scenarios in `../ai-context-test-scenarios.md`, results in `../ai-context-test-results.md` (framework-dev, not part of consumer publish surface)
1996
2091
 
@@ -2009,7 +2104,7 @@ Reference tokens or write custom values:
2009
2104
  107. **`Element.key` forces remount on value change** — Add `key` to any element with a dynamic expression (e.g., `{ "$template": "preview-${/internal/tokenVersion}" }`). When the resolved value changes, React unmounts and remounts the element, re-triggering mount animations. Used by DNA Playground to re-animate preview on Apply DNA
2010
2105
  108. **Input supports `type: "color"`** — Renders native OS color picker. Use with `$bindState` for interactive color selection in specs
2011
2106
  109. **Slider label is display-only** — The slider primitive renders the `label` prop as-is without appending the current value. Use `$template` in the label to include the value if desired (e.g., `"label": { "$template": "Roundness: ${/dna/roundness}%" }`)
2012
- 110. **`--author` activates CLI versioning** — `mythik push` and `mythik patch` without `--author` write directly to the `screens` table with NO version history. With `--author ai-agent`, they use `VersionedSpecStore` which writes to both `screens` AND `screen_versions`, enabling `history`, `diff`, and `rollback` commands. Always use `--author` during development
2107
+ 110. **`--author` is the normal persisted-write path** — `mythik push` and `mythik patch` with `--author ai-agent` use `VersionedSpecStore` when available, writing to both `screens` and `screen_versions` and enabling `history`, `diff`, and `rollback` commands. Without `--author`, persisted writes are rejected unless `--allow-unversioned` is explicit. Always use `--author` during development.
2013
2108
  111. **Identity System — `tokens.identity` controls visual identity beyond DNA** — DNA controls continuous/color values. Identity controls categorical dimensions: `surface` (how containers render), `radiusPattern` (corner shape), `typographyHierarchy` (heading scale), `labelStyle` (label formatting), `textDecoration` (heading decoration), `depth` (shadow intensity 0-1), `shadowAngle` (shadow direction 0-360°), `colorScheme` (light/dark/colored polarity), `colorWeight` (where color appears), `accentApplication` (where accent appears). Set via `tokens.identity` in AppSpec or screen Spec. Lint validates deep identity enum/range values; for example use `colorScheme: "light-surface"`, not `"light"`
2014
2109
  112. **Surface Treatment — 6 types transform all containers** — `identity.surface`: `elevated` (shadow+border, material), `flat` (color blocks only, no borders/shadows), `outlined` (borders only, transparent bg, Linear-like), `glass` (backdrop-filter blur, semi-transparent), `bold` (thick 2-3px borders, brutalist), `neo` (neumorphic inset+outset shadows). Every input, button, card, modal, select, textarea, checkbox, accordion, table adapts automatically
2015
2110
  113. **Surface styles are explicit — every property set, no implicit values** — All 6 surface types define `border` and `boxShadow` explicitly for every component category. Properties are `'none'` when not used, never omitted. This prevents browser defaults from showing (e.g., native button borders in flat mode)
@@ -3058,7 +3153,7 @@ The current background and motion stack combines app-level `LayerBackground`, an
3058
3153
 
3059
3154
  211. **`useShapeAnimations(ref, animations, options)` — Layer 3 web runner** — Exported from `mythik-react` via `packages/react/src/animation/useShapeAnimations.ts`. React hook for SVG-child animations (`<path>`/`<circle>`/`<rect>`/`<g>`…). Consumes the same `ElementAnimations` contract as `useElementAnimations` but narrowed to the `ambient` trigger ONLY; shape children have no hover/focus/active contract and no distinct mount ceremony. Attaches CSS animations via `el.style.animation` (surgical, preserves other inline styles); keyframes register once through the CSSOM singleton (zero `dangerouslySetInnerHTML`) and dedupe by hash so multiple shape instances with the same recipe share one CSS rule. Dev mode warns when non-ambient triggers are passed. Production silently ignores them. `options.recipes` SHOULD be stable for useMemo performance.
3060
3155
 
3061
- 212. **`useShapeAnimations(animations, options)` — Layer 3 RN runner** — Published through `mythik-react-native` from `packages/react-native/src/animation/useShapeAnimations.ts`. Reanimated parity of rule 211: returns `{ animatedProps }` that the consumer spreads onto `Animated.createAnimatedComponent(Path)` from `react-native-svg`. Uses the `HARD_PER_TRIGGER` (=6) fixed-pool `useSharedValue` pattern (`useSharedValueArray` helper, also exported) so React Hook count stays stable. Reuses `composeRNStyle(contributions, interpolate, interpolateColor)` shared with `useElementAnimations` — single composition pipeline for View-style and animated SVG props. Relies on `react-native-svg` v13+ auto-translating the transform array into SVG `transform="..."` strings. Same dev-mode non-ambient-trigger warning as the web hook.
3156
+ 212. **`useShapeAnimations(animations, options)` — Layer 3 RN runner** — Implemented inside `mythik-react-native` at `packages/react-native/src/animation/useShapeAnimations.ts` for the native blob/background renderer. It is not exported from the package root as a standalone public hook. Reanimated parity of rule 211: returns `{ animatedProps }` that the renderer spreads onto `Animated.createAnimatedComponent(Path)` from `react-native-svg`. Uses the `HARD_PER_TRIGGER` (=6) fixed-pool `useSharedValue` pattern (`useSharedValueArray` helper) so React Hook count stays stable. Reuses `composeRNStyle(contributions, interpolate, interpolateColor)` shared with `useElementAnimations` — single composition pipeline for View-style and animated SVG props. Relies on `react-native-svg` v13+ auto-translating the transform array into SVG `transform="..."` strings. Same dev-mode non-ambient-trigger warning as the web hook.
3062
3157
 
3063
3158
  213. **Cross-platform Layer 3 parity pins** — `buildCSSKeyframes` (web) and `buildReanimatedSpec` (RN) interpret the same resolved `AnimationSpec` identically on load-bearing invariants: duration agreement (ms count matches regardless of input form `'28s'`/`'28000'`), keyframe stop count (web `%` markers match RN `inputRange` length), direction semantic (`'alternate'` token ⇔ `timing.reverse=true`), iterations `'infinite'`/numeric count, animated-prop enumeration (`translateX/Y`/`rotateDeg`/`scale`).
3064
3159
 
@@ -3134,7 +3229,7 @@ The current background and motion stack combines app-level `LayerBackground`, an
3134
3229
 
3135
3230
  247. **`derive` and `dataSources` are processed at runtime per spec mount** (v0.1.0). When `spec.derive` is present, the framework instantiates a `DeriveEngine`, evaluates all derive paths in topological order at mount, and re-evaluates dirty paths reactively on state changes. Derive paths are protected: setState targeting a derive path errors at validate time and runtime. When `spec.dataSources` is present, the framework instantiates a `DataSourcesEngine`, performs initial fetches (deferred to reactive resolution when URL template deps are undefined), and re-fetches reactively when dependencies change. The action `refreshDataSource` (params: `{ id: string }`) is automatically registered for any spec with dataSources. URL templating requires the explicit `{ $template: '...' }` form — plain strings with `${...}` are NOT substituted (validator catches at load). See `ai-context-runtime-semantics.md` for lifecycle, ordering, error degradation, and state protection details.
3136
3231
 
3137
- 248. **CLI is the only approved path for spec writes** (v0.1.0). Three approved forms: (a) **Shell** - `mythik push <id> --from-file spec.json` / `mythik patch <id> --from-file patch.json` (or intentional stdin via `--from-file -` / pipe without `--from-file`); (b) **Bulk** - `mythik push --from-dir ./specs/` (sequential, continue-on-error, no rollback; partial state on failure recovers by fixing failures and re-running the same command); (c) **Programmatic** - `import { runPush, runPatch } from 'mythik-cli/api'` for IDE tooling, test harnesses, CI scripts. NEVER call `SpecStore.save()` directly from application code. It is an internal persistence primitive marked `@internal`; validation happens at the CLI / engine tier. Bypassing this path skips validation and can produce runtime errors visible only at render time. `mythik patch --from-file <path>` is preferred over inline JSON for any patch containing `$state`, `$template`, `$auth`, or `$row` references (PowerShell expands `$<word>` in double-quoted strings).
3232
+ 248. **CLI is the only approved path for spec writes** (v0.1.0). Three approved forms: (a) **Shell** - `mythik push <id> --from-file spec.json --author <name>` / `mythik patch <id> --from-file patch.json --author <name>` (or intentional stdin via `--from-file -` / pipe without `--from-file` plus `--author`); (b) **Bulk** - `mythik push --from-dir ./specs/ --author <name>` (sequential, continue-on-error, no rollback; partial state on failure recovers by fixing failures and re-running the same command); (c) **Programmatic** - `import { runPush, runPatch } from 'mythik-cli/api'` for IDE tooling, test harnesses, CI scripts. NEVER call `SpecStore.save()` directly from application code. It is an internal persistence primitive marked `@internal`; validation happens at the CLI / engine tier. Bypassing this path skips validation and can produce runtime errors visible only at render time. `mythik patch --from-file <path>` is preferred over inline JSON for any patch containing `$state`, `$template`, `$auth`, or `$row` references (PowerShell expands `$<word>` in double-quoted strings). Existing full-spec replacement requires `--replace`; intentionally unversioned writes require `--allow-unversioned`.
3138
3233
 
3139
3234
  249. **`mythik lint` detects known anti-patterns in specs and consumer code** (v0.1.0).
3140
3235
 
@@ -3149,7 +3244,7 @@ A new CLI command + programmatic API:
3149
3244
  - `spec-row-literal` (warning) — `$row` is not an expression handler; use `$state: '/ui/selectedRow/<key>'`. Validator-resident in `spec-validator.ts` (also surfaces during `mythik push` and `mythik validate`).
3150
3245
  - `spec-crud-id-collision` (error) — `endpoint.path` ending `/:id` combined with `crud: {}` produces `/path/:id/:id`. Strip trailing `/:id`. Walks the object-shaped `endpoints: Record<string, EndpointConfig>`; emits JSON Pointer paths `/endpoints/<name>/path`.
3151
3246
  - `spec-auth-domains-port` (warning) — `auth.authDomains[i]` containing `:port` strips the port silently (matcher uses hostname-only via `URL.hostname`). Walks the `string[]` shape; emits JSON Pointer paths `/auth/authDomains/<index>`.
3152
- - `code-store-save-bypass` (error) — calling `*store*.save()` outside `packages/core/` and `packages/cli/` bypasses validation. Use `runPush` from `mythik-cli/api` or `mythik push --from-file`. **Known scope**: matches `<Identifier>.save()` callees only (e.g. `myStore.save(...)`). Does NOT detect `this.store.save()`, `<obj>.<store>.save()`, or `(await getStore()).save()` patterns — these slip through the AST scanner. Generation-level guidance in `ai-context.md` (anti-patterns section) covers all variants; the lint rule is one layer of defense-in-depth, not a complete catch. Widening the scanner to handle `PropertyAccessExpression` callees is tracked as a v0.2+ candidate if real consumer code shows these patterns slipping through generation guidance.
3247
+ - `code-store-save-bypass` (error) — calling `*store*.save()` outside `packages/core/` and `packages/cli/` bypasses validation. Use `runPush` from `mythik-cli/api` with `author` or `mythik push --from-file ... --author <name>`. **Known scope**: matches `<Identifier>.save()` callees only (e.g. `myStore.save(...)`). Does NOT detect `this.store.save()`, `<obj>.<store>.save()`, or `(await getStore()).save()` patterns — these slip through the AST scanner. Generation-level guidance in `ai-context.md` (anti-patterns section) covers all variants; the lint rule is one layer of defense-in-depth, not a complete catch. Widening the scanner to handle `PropertyAccessExpression` callees is tracked as a v0.2+ candidate if real consumer code shows these patterns slipping through generation guidance.
3153
3248
 
3154
3249
  **Code rules require TypeScript ^5.0.0 as peerDependency** (optional). If not installed, code rules emit one warning finding `lint-meta-no-typescript` (severity matches `LintSeverity = 'error' | 'warning'`) and skip cleanly. Spec rules run independently.
3155
3250
 
@@ -3214,12 +3309,12 @@ See `ai-context.md` for spec-gen anti-patterns the AI must NOT generate.
3214
3309
 
3215
3310
  281. **`MythikApp.fetcher` supplies editor persistence when auth fetch is absent** - React hosts can pass `fetcher={(url, options) => ...}` to `MythikApp` so `editorSave` and `navigationGuardSaveAndProceed` have a transport in non-auth apps. When auth is configured, the framework fetch with auth interceptors remains the active fetcher. Save actions do not read global `/ui/lastError`; editor save status, errors, and attempts are reported under `/ui/editorSessions/<id>`.
3216
3311
 
3217
- 282. **Existing spec edits must use the CLI inspection-then-patch loop** - For an existing screen/app/api spec, AI agents should run `mythik manifest <id>` first, inspect only the target nodes with `mythik elements <id> <ids>`, apply a small RFC 6902 patch with `mythik patch <id> --from-file patch.json`, and verify with `manifest` or `elements`. This keeps edits surgical, validated, versionable, and reviewable. `pull` is for backup, migration, review, or full-document work; `push` is for new specs or intentional full replacement. Direct database edits and direct `SpecStore.save()` calls bypass validation and are not approved spec-write paths.
3312
+ 282. **Existing spec edits must use the CLI inspection-then-patch loop** - For an existing screen/app/api spec, AI agents should run `mythik manifest <id>` first, inspect only the target nodes with `mythik elements <id> <ids>`, apply a small RFC 6902 patch with `mythik patch <id> --from-file patch.json --author <agent>`, validate, and verify with `manifest` or `elements`. This keeps edits surgical, validated, versionable, and reviewable. `pull` is for backup, migration, review, or full-document work; `push` is for new specs or intentional full replacement with explicit `--replace`. Direct database edits and direct `SpecStore.save()` calls bypass validation and are not approved spec-write paths.
3218
3313
  283. **Bundled AI docs are part of the install surface** - The `mythik` package includes `docs/llms.txt`, `docs/consumer/*`, and `docs/wiki/compiled/*`. Agents should run `mythik docs path` before spec generation and read the bundled docs rather than guessing from package source. Use `mythik docs copy ./mythik-docs` to create a project-local copy when the host workflow needs explicit files.
3219
3314
  284. **DNA numeric seeds are canonical `0–1`, with legacy `0–100` normalization** - Generate `tokens.dna.roundness`, `density`, `depth`, and `formality` as `0–1` numbers (`0.7`, not `70`). The runtime normalizes numeric seed values greater than `1` by dividing by `100` inside DNA derivation, so initial AppSpec load and runtime `updateTokens` share the same backward-compatible behavior.
3220
3315
  285. **Scoped pagination counts filter before aggregation** - Query endpoints may combine `pagination: "offset"` with `scopeFilter`. For generated counts, the server applies the scope filter to the query source first and then counts the scoped source, so the response `total` matches the same tenant/role slice as `data`. Prefer generated counts. If custom `endpoint.count` is truly needed with `scopeFilter`, it must include `{{scopeWhere[:alias]}}` or `{{scopeAnd[:alias]}}`; Mythik expands the macro to the correct scope predicate and removes it for bypass roles. Other custom count SQL is left verbatim. Specs should use `:alias` for JOIN/subquery counts and should not reference internal scope parameter names directly.
3221
3316
  286. **Transaction fetch failures preserve backend error details** - When a transaction `confirm` uses `fetch` and the backend returns an HTTP error payload such as `{ error: { code, message } }`, `/tx/error` is written after rollback with the best backend message plus `code`, HTTP `status`, and raw `data`. `onError` should read `/tx/error/message`; transaction specs should not read global `/ui/lastError`.
3222
- 287. **SQL-backed stores and servers use one dialect-aware `mythik/server` boundary** - Import `createSqlDriver`, `SqlSpecStore`, `SqlVersionedSpecStore`, `SqlEnvironmentStore`, and `getSqlStoreDdl` from `mythik/server` for Node-side SQL work. Supported dialects are `sqlserver`, `postgres`, `mysql`, and `sqlite`. Initialize store tables with `mythik init-store --dialect <dialect>` for reachable SQL stores, `--target` for SQLite, or `--dry-run` for review/apply through a deployment process. SQL Server `init-store` accepts explicit `--server`, `--database`, `--user`, `--password`, `--encrypt`, and `--trust-server-certificate` flags. CLI commands share the same store flags/env vars and must keep existing-spec edits on the `manifest -> elements -> patch --from-file -> validate` loop. ApiSpec `dialect` controls generated CRUD/catalog/pagination/scope SQL; custom SQL remains dialect-native with Mythik named params (`@name`) and is not translated between dialects.
3317
+ 287. **SQL-backed stores and servers use one dialect-aware `mythik/server` boundary** - Import `createSqlDriver`, `SqlSpecStore`, `SqlVersionedSpecStore`, `SqlEnvironmentStore`, and `getSqlStoreDdl` from `mythik/server` for Node-side SQL work. Supported dialects are `sqlserver`, `postgres`, `mysql`, and `sqlite`. Initialize store tables with `mythik init-store --dialect <dialect>` for reachable SQL stores, `--target` for SQLite, or `--dry-run` for review/apply through a deployment process. SQL Server `init-store` accepts explicit `--server`, `--database`, `--user`, `--password`, `--encrypt`, and `--trust-server-certificate` flags. CLI commands share the same store flags/env vars and must keep existing-spec edits on the `manifest -> elements -> patch --from-file --author -> validate -> verify` loop. ApiSpec `dialect` controls generated CRUD/catalog/pagination/scope SQL; custom SQL remains dialect-native with Mythik named params (`@name`) and is not translated between dialects.
3223
3318
  288. **Event arrays may mix actions and transactions** - Event bindings can be a single action, a single transaction, or an array containing both normal action bindings and transaction bindings. Mythik executes the array sequentially and awaits each transaction before continuing. Transaction phases cannot contain nested transactions.
3224
3319
  289. **`$let` dotted references read nested binding values** - A `$ref` may target an object binding path such as `{ "$ref": "user.name" }`, and `$template` placeholders may read the same path as `${user.name}`. Use this for object values produced by `$let`; missing dotted `$ref` segments are invalid references and should be fixed instead of treated as optional data.
3225
3320
  290. **`params.skipIf` is a dispatch-time action guard** - Any action binding may include `params.skipIf`. Mythik resolves it before resolving the rest of the params; when truthy, the action is skipped and the action chain continues. The action handler never receives `skipIf`.
@@ -3228,3 +3323,5 @@ See `ai-context.md` for spec-gen anti-patterns the AI must NOT generate.
3228
3323
  293. **SQL adapters are optional peer dependencies** - `mythik` does not install SQL drivers by default. Browser-only apps install `mythik mythik-react`. SQL-backed stores/servers must install exactly the selected adapter (`mssql`, `pg`, `mysql2`, or `better-sqlite3`). SQLite uses native `better-sqlite3`; warnings from its transitive native-build helpers are adapter-level install warnings, not Mythik runtime failures.
3229
3324
  294. **Missing SQL adapter errors are actionable** - If a SQL-backed store or server uses a dialect whose adapter package is not installed, Mythik throws `SqlDriverError` with `code: "SQL_DRIVER_DEPENDENCY_MISSING"`, `packageName`, `installCommand`, and a message containing the exact `npm install ...` command.
3230
3325
  295. **`mythik-react-native` publishes an explicit native support contract** - Expo apps should install React Native/Expo peer packages with `npx expo install ...`, including `react-native-reanimated` and its Expo-matched `react-native-worklets` peer, before installing `mythik mythik-react-native`, so Expo selects native module versions that match the app SDK. Keep `react-native-reanimated/plugin` last in the app Babel config. The package exports `REACT_NATIVE_PRIMITIVE_SUPPORT` and `getReactNativePrimitiveSupport(name)`. Supported native primitives are `box`, `stack`, `grid`, `scroll`, `divider`, `spacer`, `text`, `image`, `icon`, `input`, `textarea`, `select`, `checkbox`, `toggle`, `slider`, `button`, `touchable`, `list`, `modal`, `drawer`, `tabs`, `accordion`, `wizard`, `screen`, `screen-outlet`, `toast-container`, and `skeleton`. Native-milestone primitives are `bar-chart`, `line-chart`, `pie-chart`, `area-chart`, `table`, `kanban-board`, `spatial-map`, `file-upload`, `camera`, `signature`, and `audio-player`; they should surface diagnostics instead of silently rendering broken UI. Keep `root` as a stable string and use `$platform` only in localized props/style/children/value branches.
3326
+ 296. **Mythik Reveal is the live-context bridge for AI agents** - Before guessing about running-app behavior, start `mythik reveal start`, wire the host `reveal` config in development, and inspect with `mythik reveal apps`, `context`, `current`, `screen`, or `element`. Reveal exposes renderer/environment/spec summaries, selected state paths, resolved public props, dependencies, render errors, warnings, events, patch-target metadata, and redaction/truncation metadata as structured JSON. It complements `manifest -> elements -> patch`: use the CLI loop to edit stored specs, and use Reveal to understand the app that is actually running. Keep it development-only, never commit tokens, memoize React/RN reveal config objects, use narrow `includeStatePaths`, and redact secrets deliberately.
3327
+ 297. **`mythik agent context` / `mythik agent init` install the AI operating contract**. Use `mythik agent init codex`, `mythik agent init claude`, or `mythik agent init all` to create `.mythik/agent/*` plus thin agent adapters. `codex` creates/updates `AGENTS.md`, `claude` creates/updates `CLAUDE.md`, and `all` updates both; existing file content outside the Mythik-managed `<!-- mythik-agent-protocol:start -->` / `<!-- mythik-agent-protocol:end -->` block is preserved. Use `mythik agent context --app <id> --include-screens` to generate the project-specific operating map. The generated protocol requires existing stored specs to use `manifest -> elements -> patch --from-file --author -> validate -> verify`, names the active store as the source of truth, recommends TOON for token-efficient reads when supported, and scopes `lint` to local drafts, replacement files, bulk import/migration folders, and relevant consumer code.
package/docs/llms.txt CHANGED
@@ -10,8 +10,13 @@ Start here:
10
10
  - wiki/compiled/README.md
11
11
  - wiki/compiled/_index.md
12
12
 
13
+ Project-local agent protocol:
14
+ 1. mythik agent init codex|claude|all
15
+ 2. mythik agent context --app <app-id> --include-screens --out .mythik/agent/context.md
16
+
13
17
  Required edit loop for existing persisted specs:
14
18
  1. mythik manifest <spec-id>
15
19
  2. mythik elements <spec-id> <element-ids>
16
- 3. mythik patch <spec-id> --from-file <patch.json>
20
+ 3. mythik patch <spec-id> --from-file <patch.json> --author <agent-name>
17
21
  4. mythik validate <spec-id>
22
+ 5. mythik manifest <spec-id> or mythik elements <spec-id> <element-ids> to verify
@@ -1,6 +1,6 @@
1
1
  # Mythik - Compiled Wiki
2
2
 
3
- Compiled from `docs/consumer/` into **327 atomic articles**. The wiki is optimized for AI consumption: each article is one concept, and `_index.md` is the flat searchable graph.
3
+ Compiled from `docs/consumer/` into **331 atomic articles**. The wiki is optimized for AI consumption: each article is one concept, and `_index.md` is the flat searchable graph.
4
4
 
5
5
  ## Reading order for first-time spec authoring
6
6
 
@@ -9,22 +9,24 @@ Compiled from `docs/consumer/` into **327 atomic articles**. The wiki is optimiz
9
9
  3. [concept-spec-types](concept-spec-types.md) - Screen vs AppSpec vs ApiSpec.
10
10
  4. [concept-expression-contexts](concept-expression-contexts.md) and [concept-expression-timing](concept-expression-timing.md) - where expressions work and when they resolve.
11
11
  5. [concept-primitives-overview](concept-primitives-overview.md) and [primitive-spatial-map](primitive-spatial-map.md) - primitives, including the spatial-map editor surface.
12
- 6. [cli-existing-spec-edit-loop](cli-existing-spec-edit-loop.md) - required loop for modifying existing persisted specs.
13
- 7. [cli-docs](cli-docs.md) - locate or copy the bundled AI documentation after `npm install`.
12
+ 6. [cli-existing-spec-edit-loop](cli-existing-spec-edit-loop.md) - required loop for modifying existing persisted specs.
13
+ 7. [concept-mythik-reveal](concept-mythik-reveal.md) and [cli-reveal](cli-reveal.md) - inspect live runtime context before guessing.
14
+ 8. [concept-agent-context-protocol](concept-agent-context-protocol.md) and [cli-agent](cli-agent.md) - install the project-local AI operating contract.
15
+ 9. [cli-docs](cli-docs.md) - locate or copy the bundled AI documentation after `npm install`.
14
16
 
15
- ## Publish notes
16
-
17
- - Public package names are unscoped: `mythik`, `mythik-react`, `mythik-cli`, `mythik-server`, `mythik-react-native`.
18
- - `mythik-react-native` is a public preview release line with an explicit support matrix.
19
- - The wiki metadata folder is not publish content.
20
- - `docs/consumer` remains the canonical source.
17
+ ## Publish notes
18
+
19
+ - Public package names are unscoped: `mythik`, `mythik-react`, `mythik-cli`, `mythik-server`, `mythik-react-native`.
20
+ - `mythik-react-native` is a public preview release line with an explicit support matrix.
21
+ - The wiki metadata folder is not publish content.
22
+ - `docs/consumer` remains the canonical source.
21
23
 
22
24
  ## Catalog
23
25
 
24
26
  - [Actions](#actions) - 19
25
27
  - [Anti-patterns](#anti-patterns) - 21
26
- - [CLI](#cli) - 19
27
- - [Concepts](#concepts) - 177
28
+ - [CLI](#cli) - 21
29
+ - [Concepts](#concepts) - 179
28
30
  - [Expressions](#expressions) - 22
29
31
  - [Paths](#paths) - 13
30
32
  - [Patterns](#patterns) - 18
@@ -6,7 +6,7 @@ Per the compilation rules: **never fabricate, surface as a gap.**
6
6
 
7
7
  ## Status: 0 gaps detected during compilation
8
8
 
9
- All 326 articles were written from raw content present in the source
9
+ All 331 articles were written from raw content present in the source
10
10
  files. Every fact in the compiled wiki traces to a `docs/consumer/<file>.md`
11
11
  section listed in the article's `sources:` frontmatter.
12
12
 
@@ -48,14 +48,15 @@ Flat catalog generated from `docs/wiki/compiled`. Use the article ID for wikilin
48
48
  @antipattern-style-block-duplication :: antipattern-style-block-duplication.md :: Anti-pattern — duplicate style blocks
49
49
  @antipattern-submit-form-in-tx-confirm :: antipattern-submit-form-in-tx-confirm.md :: Anti-pattern — `submitForm` in `transaction.confirm`
50
50
 
51
- ## CLI (19)
51
+ ## CLI (21)
52
52
 
53
- @cli-app-spec :: cli-app-spec.md :: CLI on AppSpecs
53
+ @cli-app-spec :: cli-app-spec.md :: CLI on AppSpecs
54
+ @cli-agent :: cli-agent.md :: `mythik agent` - project-local AI operating context
54
55
  @cli-config :: cli-config.md :: CLI config — `.mythikrc` + env vars
55
56
  @cli-contract :: cli-contract.md :: `mythik contract` — frontend↔backend cross-validation
56
- @cli-delete :: cli-delete.md :: `mythik delete` — with safety gate
57
- @cli-docs :: cli-docs.md :: `mythik docs` — bundled AI documentation
58
- @cli-elements :: cli-elements.md :: `mythik elements` — inspect specific elements
57
+ @cli-delete :: cli-delete.md :: `mythik delete` — with safety gate
58
+ @cli-docs :: cli-docs.md :: `mythik docs` — bundled AI documentation
59
+ @cli-elements :: cli-elements.md :: `mythik elements` — inspect specific elements
59
60
  @cli-existing-spec-edit-loop :: cli-existing-spec-edit-loop.md :: Existing spec edit loop
60
61
  @cli-history :: cli-history.md :: `mythik history` — version history with diffs
61
62
  @cli-lint :: cli-lint.md :: `mythik lint` — anti-pattern detection
@@ -65,12 +66,13 @@ Flat catalog generated from `docs/wiki/compiled`. Use the article ID for wikilin
65
66
  @cli-programmatic-api :: cli-programmatic-api.md :: Programmatic API — `mythik-cli/api`
66
67
  @cli-pull :: cli-pull.md :: `mythik pull` — export spec
67
68
  @cli-push :: cli-push.md :: `mythik push` — three approved write paths
69
+ @cli-reveal :: cli-reveal.md :: `mythik reveal` - live runtime context
68
70
  @cli-tokens :: cli-tokens.md :: `mythik tokens` — DNA inspection
69
71
  @cli-toon :: cli-toon.md :: `--toon` - token-efficient format
70
72
  @cli-validate :: cli-validate.md :: `mythik validate`
71
73
  @cli-versioning-author :: cli-versioning-author.md :: `--author` flag — activates versioning
72
74
 
73
- ## Concepts (177)
75
+ ## Concepts (179)
74
76
 
75
77
  @concept-action-chains :: concept-action-chains.md :: Action chains — sequential execution
76
78
  @concept-action-middleware :: concept-action-middleware.md :: Action middleware
@@ -81,7 +83,8 @@ Flat catalog generated from `docs/wiki/compiled`. Use the article ID for wikilin
81
83
  @concept-animation-null-semantics :: concept-animation-null-semantics.md :: Animation null semantics
82
84
  @concept-animation-recipes :: concept-animation-recipes.md :: 15 animation recipes
83
85
  @concept-animation-triggers :: concept-animation-triggers.md :: Animation triggers — 7 triggers
84
- @concept-animations-engine :: concept-animations-engine.md :: `animations` engine (preferred)
86
+ @concept-animations-engine :: concept-animations-engine.md :: `animations` engine (preferred)
87
+ @concept-agent-context-protocol :: concept-agent-context-protocol.md :: Mythik Agent Context and Agent Protocol
85
88
  @concept-api-audit :: concept-api-audit.md :: `audit` — auto-inject user + timestamp
86
89
  @concept-api-auth :: concept-api-auth.md :: API auth (`auth` block)
87
90
  @concept-api-catalogs :: concept-api-catalogs.md :: API catalogs — dropdown sources
@@ -179,6 +182,7 @@ Flat catalog generated from `docs/wiki/compiled`. Use the article ID for wikilin
179
182
  @concept-layer-background :: concept-layer-background.md :: `tokens.identity.background` — LayerBackground v2
180
183
  @concept-motion-field :: concept-motion-field.md :: `motion` field (legacy Framer-Motion)
181
184
  @concept-mount-spec-runtime :: concept-mount-spec-runtime.md :: `mountSpecRuntime` — internal mount helper
185
+ @concept-mythik-reveal :: concept-mythik-reveal.md :: Mythik Reveal - live runtime context for AI agents
182
186
  @concept-mythik-renderer :: concept-mythik-renderer.md :: `MythikRenderer` - root mount
183
187
  @concept-navigation :: concept-navigation.md :: Navigation config
184
188
  @concept-navigation-dirty-guard :: concept-navigation-dirty-guard.md :: Navigation dirty guard
@@ -910,6 +910,10 @@ Generated from article frontmatter and Sources sections. `docs/consumer` is the
910
910
  ## docs/consumer/ai-context.md
911
911
 
912
912
  - [[@action-apply-preset]] - `applyPreset` — apply curated DNA+Identity
913
+ - [[@cli-reveal]] - `mythik reveal` - live runtime context
914
+ - [[@cli-agent]] - `mythik agent` - project-local AI operating context
915
+ - [[@concept-mythik-reveal]] - Mythik Reveal - live runtime context for AI agents
916
+ - [[@concept-agent-context-protocol]] - Mythik Agent Context and Agent Protocol
913
917
  - [[@cli-existing-spec-edit-loop]] - Existing spec edit loop
914
918
  - [[@cli-overview]] - CLI overview - `mythik <command>`
915
919
  - [[@cli-patch]] - `mythik patch` - RFC 6902 patches
@@ -1415,11 +1419,11 @@ Generated from article frontmatter and Sources sections. `docs/consumer` is the
1415
1419
  - [[@cli-programmatic-api]] - Programmatic API — `mythik-cli/api`
1416
1420
  - [[@cli-push]] - `mythik push` — three approved write paths
1417
1421
 
1418
- ## docs/consumer/ai-context.md#cli-workflow
1419
-
1420
- - [[@cli-docs]] - `mythik docs` — bundled AI documentation
1421
- - [[@cli-elements]] - `mythik elements` — inspect specific elements
1422
- - [[@cli-manifest]] - `mythik manifest` — structural tree
1422
+ ## docs/consumer/ai-context.md#cli-workflow
1423
+
1424
+ - [[@cli-docs]] - `mythik docs` — bundled AI documentation
1425
+ - [[@cli-elements]] - `mythik elements` — inspect specific elements
1426
+ - [[@cli-manifest]] - `mythik manifest` — structural tree
1423
1427
  - [[@cli-overview]] - CLI overview - `mythik <command>`
1424
1428
  - [[@cli-patch]] - `mythik patch` - RFC 6902 patches
1425
1429
  - [[@cli-pull]] - `mythik pull` — export spec
@@ -1691,10 +1695,14 @@ Generated from article frontmatter and Sources sections. `docs/consumer` is the
1691
1695
 
1692
1696
  - [[@pattern-fetch-vs-datasources]] - Pattern — `fetch` vs `dataSources` decision
1693
1697
 
1694
- ## docs/consumer/reference-doc.md
1695
-
1696
- - [[@cli-existing-spec-edit-loop]] - Existing spec edit loop
1697
- - [[@cli-overview]] - CLI overview - `mythik <command>`
1698
+ ## docs/consumer/reference-doc.md
1699
+
1700
+ - [[@cli-existing-spec-edit-loop]] - Existing spec edit loop
1701
+ - [[@cli-reveal]] - `mythik reveal` - live runtime context
1702
+ - [[@cli-agent]] - `mythik agent` - project-local AI operating context
1703
+ - [[@concept-mythik-reveal]] - Mythik Reveal - live runtime context for AI agents
1704
+ - [[@concept-agent-context-protocol]] - Mythik Agent Context and Agent Protocol
1705
+ - [[@cli-overview]] - CLI overview - `mythik <command>`
1698
1706
  - [[@cli-patch]] - `mythik patch` - RFC 6902 patches
1699
1707
  - [[@cli-toon]] - `--toon` - token-efficient format
1700
1708
  - [[@concept-auth-config]] - AppSpec auth config
@@ -2472,11 +2480,11 @@ Generated from article frontmatter and Sources sections. `docs/consumer` is the
2472
2480
 
2473
2481
  - [[@concept-skeleton-auto]] - Auto-skeleton — zero-config loading state
2474
2482
 
2475
- ## docs/consumer/reference-doc.md#cli--spec-modification-via-mythik-cli
2476
-
2477
- - [[@cli-docs]] - `mythik docs` — bundled AI documentation
2478
- - [[@cli-overview]] - CLI overview - `mythik <command>`
2479
- - [[@cli-pull]] - `mythik pull` — export spec
2483
+ ## docs/consumer/reference-doc.md#cli--spec-modification-via-mythik-cli
2484
+
2485
+ - [[@cli-docs]] - `mythik docs` — bundled AI documentation
2486
+ - [[@cli-overview]] - CLI overview - `mythik <command>`
2487
+ - [[@cli-pull]] - `mythik pull` — export spec
2480
2488
 
2481
2489
  ## docs/consumer/reference-doc.md#cli-token-inspection
2482
2490
 
@@ -1,10 +1,10 @@
1
- # Lint Report - Event Binding Guard Refresh
1
+ # Lint Report - Mythik Agent Context Refresh
2
2
 
3
- Validation of cross-references, stale public references, and generated wiki shape after refreshing the compiled wiki delta from `docs/consumer` on 2026-05-09.
3
+ Validation of cross-references, stale public references, and generated wiki shape after refreshing the compiled wiki delta from `docs/consumer` on 2026-05-21.
4
4
 
5
5
  ## Broken Cross-References
6
6
 
7
- **0 broken wiki links** across compiled wiki files.
7
+ **0 broken wiki links** across compiled wiki files.
8
8
 
9
9
  ## Stale / Private Reference Scan
10
10
 
@@ -19,28 +19,32 @@ Validation of cross-references, stale public references, and generated wiki shap
19
19
 
20
20
  ## Article Counts
21
21
 
22
- - Total markdown files in `compiled`: **333**
23
- - Generated article files, excluding `README.md` and `_*.md`: **327**
22
+ - Total markdown files in `compiled`: **337**
23
+ - Generated article files, excluding `README.md` and `_*.md`: **331**
24
24
  - Migration pages removed: **yes** (`migration-*.md` no longer publish)
25
25
  - Metadata folder publish status: **excluded**
26
26
 
27
- ## Key Refresh Additions
28
-
29
- - Dotted `$let` binding reads for `$ref` and `$template`
30
- - Mixed event arrays containing actions plus transactions
31
- - `params.skipIf` dispatch-time action guards
32
- - Optional SQL adapter dependency wording
33
- - Generic SQL store / driver package-layout pages
34
- - `concept-public-package-names`
35
- - `cli-existing-spec-edit-loop`
36
- - `primitive-spatial-map`
27
+ ## Key Refresh Additions
28
+
29
+ - Dotted `$let` binding reads for `$ref` and `$template`
30
+ - Mixed event arrays containing actions plus transactions
31
+ - `params.skipIf` dispatch-time action guards
32
+ - Optional SQL adapter dependency wording
33
+ - Generic SQL store / driver package-layout pages
34
+ - `concept-public-package-names`
35
+ - `cli-existing-spec-edit-loop`
36
+ - `primitive-spatial-map`
37
37
  - `concept-spatial-map-editor`
38
38
  - `concept-spatial-map-zones`
39
39
  - `concept-editor-sessions`
40
40
  - `concept-editor-commit`
41
41
  - `concept-editor-save`
42
- - `concept-navigation-dirty-guard`
43
- - `cli-docs`
42
+ - `concept-navigation-dirty-guard`
43
+ - `cli-docs`
44
+ - `concept-mythik-reveal`
45
+ - `cli-reveal`
46
+ - `concept-agent-context-protocol`
47
+ - `cli-agent`
44
48
 
45
49
  ## Tooling
46
50
 
@@ -24,17 +24,22 @@ await store.save('my-screen', specObject); // BAD — no validation
24
24
  ## Right — three approved paths
25
25
 
26
26
  ```ts
27
- // Programmatic (best for tooling/CI):
28
- import { runPush } from 'mythik-cli/api';
29
- await runPush({ id: 'my-screen', spec: specObject });
27
+ // Programmatic (best for tooling/CI):
28
+ import { runPush } from 'mythik-cli/api';
29
+ await runPush('my-screen', JSON.stringify(specObject), {
30
+ store,
31
+ json: true,
32
+ force: false,
33
+ author: 'agent-name'
34
+ });
30
35
  ```
31
36
 
32
37
  ```bash
33
- # Shell:
34
- mythik push my-screen --from-file spec.json
35
-
36
- # Bulk:
37
- mythik push --from-dir ./specs/
38
+ # Shell:
39
+ mythik push my-screen --from-file spec.json --author <agent>
40
+
41
+ # Bulk:
42
+ mythik push --from-dir ./specs/ --author <agent>
38
43
  ```
39
44
 
40
45
  ## Why