@kizenapps/cli 1.8.0-5359c23 → 1.9.0-5d4160b

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 (24) hide show
  1. package/README.md +31 -2
  2. package/dist/index.js +29 -29
  3. package/dist/index.js.map +1 -1
  4. package/dist/viewer/assets/CodeStepsPage-C5l1pu51.js +1 -0
  5. package/dist/viewer/assets/{ConfigurationPage-P12z6vGj.js → ConfigurationPage-DMUqeW2V.js} +1 -1
  6. package/dist/viewer/assets/SandboxPage-qLFGQ_Lg.js +1 -0
  7. package/dist/viewer/assets/{SecretsPage-CeSIhKDx.js → SecretsPage-GbNJAR3u.js} +1 -1
  8. package/dist/viewer/assets/{WhenBadge-xRYajcDX.js → WhenBadge-BD_2mB-N.js} +1 -1
  9. package/dist/viewer/assets/api-ViOFtzH7.js +11 -0
  10. package/dist/viewer/assets/{bootstrapQuery-CbwKDhqe.js → bootstrapQuery-DQckmnki.js} +1 -1
  11. package/dist/viewer/assets/{calendarSource.worker-ChbwoBdD.js → calendarSource.worker-mLICe-Oi.js} +1 -1
  12. package/dist/viewer/assets/{configStorage-DoMfqInd.js → configStorage-CfwJ8JQJ.js} +1 -1
  13. package/dist/viewer/assets/{floatingFrame.worker-ObFUZfkb.js → floatingFrame.worker-C8edGbiJ.js} +1 -1
  14. package/dist/viewer/assets/{generic.worker-TTxPXEzW.js → generic.worker-DSYVvVm0.js} +1 -1
  15. package/dist/viewer/assets/{index-IPap1aum.js → index-B7mInhXv.js} +3 -3
  16. package/dist/viewer/assets/index-ZrNbBIqA.css +2 -0
  17. package/dist/viewer/assets/{recordDetail.worker-ClqoFFJe.js → recordDetail.worker-Bsa6yMRD.js} +1 -1
  18. package/dist/viewer/assets/{useCriticalExceptionDialog-Dxoa5oCH.js → useCriticalExceptionDialog-CncFngL7.js} +4 -4
  19. package/dist/viewer/index.html +4 -4
  20. package/package.json +3 -3
  21. package/dist/viewer/assets/CodeStepsPage-DGeG_PIE.js +0 -1
  22. package/dist/viewer/assets/SandboxPage-BUdgHfUU.js +0 -1
  23. package/dist/viewer/assets/api-DwPVK6u4.js +0 -11
  24. package/dist/viewer/assets/index-CnQPaS6I.css +0 -2
package/README.md CHANGED
@@ -20,11 +20,13 @@ Scaffolds a new plugin project. Interactive — prompts for the plugin name, API
20
20
 
21
21
  ### `@kizenapps/cli build`
22
22
 
23
- Reads the plugin in the current directory, minifies sources, and writes `.kizenapp/bundle.json`. No flags. Run this if you want to produce a bundle without starting the dev server.
23
+ Reads the plugin in the current directory, validates it against the same rules enforced by the Kizen platform and Plugin Wizard, minifies sources, and writes `.kizenapp/bundle.json`. No flags. Run this if you want to produce a bundle without starting the dev server.
24
+
25
+ If validation finds any errors (for example an `api_name` containing hyphens, which the platform rejects) the build fails and prints each issue grouped by file. Fix the reported issues and re-run.
24
26
 
25
27
  ### `@kizenapps/cli dev`
26
28
 
27
- Starts the dev server and opens the viewer. Watches your plugin directory and rebuilds + hot-reloads the viewer on every change.
29
+ Starts the dev server and opens the viewer. Watches your plugin directory and rebuilds + hot-reloads the viewer on every change. Each rebuild runs the same validation as `build`; if it fails, the error is shown in the TUI and the viewer keeps the last good bundle until you fix it.
28
30
 
29
31
  | Flag | Default | Purpose |
30
32
  | -------------------------- | ------- | ---------------------------------------------------------------- |
@@ -32,11 +34,38 @@ Starts the dev server and opens the viewer. Watches your plugin directory and re
32
34
  | `-c, --credentials <path>` | — | Use a specific credentials JSON file instead of a stored profile |
33
35
  | `-d, --debug` | off | Show a CDP event panel in the TUI |
34
36
  | `-v, --verbose` | off | Log every CDP event (implies `--debug`) |
37
+ | `--no-viewer` | off | Don't auto-launch the viewer on startup (press `v` to launch it) |
38
+ | `--no-cache` | off | Disable the network proxy cache (always fetch upstream) |
35
39
 
36
40
  On first run you'll be prompted to set up credentials — either stored globally at `~/.kizenappbuilder/` or kept locally in your browser instance in `.kizenapp/`. Subsequent runs read from the stored profile silently. Press `c` in the TUI at any time to switch profiles.
37
41
 
38
42
  Supported environments: `go`, `fmo`, `staging`, `integration`, `test1`.
39
43
 
44
+ ## Navigation context
45
+
46
+ Plugin scripts can attach a JSON context payload to an in-app navigation:
47
+
48
+ ```js
49
+ this.openWindow('/some/path', '_self', { recordId: 'abc', mode: 'edit' });
50
+ ```
51
+
52
+ The engine transmits that payload out of band through `sessionStorage` and appends a `session_data_key` to the URL; the destination page reads it back with `readNavigationContext` / `consumeNavigationContext` (or the `useAppNavigationContext` React hook). The sandbox surfaces this end to end:
53
+
54
+ - **Navigation Context panel** — a slide-out panel on the Routable Pages browser (toggled by the `context` button in its chrome, which shows a live event count) with a reverse-chronological log of every navigation that carried a context payload, plus any external `window.open` (which the engine drops context from). Each entry shows the target, whether a context payload rode along, its key and byte size, an expandable pretty-printed payload, and a status badge.
55
+ - **Simulated destination page** — navigating to an in-app path that isn't a routable page in your plugin renders a stand-in for the real Kizen page. When the URL carries a valid context key it shows the payload and lets you **Consume**, **Clear**, or **Re-read** it, so you can confirm the destination sees exactly what the script sent (and that a re-read after consuming sees nothing).
56
+
57
+ How the two navigation targets behave:
58
+
59
+ - **`_self`** (same-tab, relative) — the context stays in this tab's `sessionStorage` across the navigation, so the destination reads it normally. The sandbox reads (does not consume) it when logging.
60
+ - **`_blank`** (new-tab, relative, same origin) — the engine stores the context, opens the tab, then immediately deletes its own copy, relying on a real browser having already copied `sessionStorage` into the new tab.
61
+ - **External / cross-origin** URLs — context is never attached and is dropped by design; these appear in the log as `ignored (external)`.
62
+
63
+ **Fidelity limit:** a real `_blank` open gives the new tab its own `sessionStorage` copy. The sandbox has no real second tab, so the "opener" and the simulated destination share one `sessionStorage`; to keep the engine's reader helpers working, the harness snapshots the payload and re-inserts it under the same key immediately after the engine deletes it. Behavior matches a real browser for reading/consuming, but the two "tabs" are not truly isolated.
64
+
65
+ **Scope boundary:** navigating to a path that matches one of your plugin's own routable pages activates that page's tab without carrying the URL through, so the page cannot observe its own `session_data_key` via the simulated location. Use the simulated destination page (any non-routable in-app path) to inspect what a destination receives.
66
+
67
+ **Error surfacing:** if `sessionStorage` writes fail (e.g. quota exceeded, storage disabled), the engine navigates without context and reports a message through the same `onError` path every script artifact already uses — it shows in that artifact's result UI and the DevTools console, not as a separate log entry, because on failure the URL carries no key for the harness to detect. Note also that context is serialized with `JSON.stringify` inside the worker script: circular references and `BigInt` values throw there before any navigation happens, while functions, `undefined` values, and symbols are silently dropped.
68
+
40
69
  ## License
41
70
 
42
71
  GPL-3.0. See [LICENSE.md](./LICENSE.md).