@kosdev-code/kos-ddk-cli 0.1.0-dev.57 → 0.1.0-dev.63

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
@@ -16,7 +16,7 @@ workspace or globally, repo roots, and installing the agent plugin and MCP serve
16
16
 
17
17
  | Command | Writes |
18
18
  | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
19
- | `ddk:utility` | a utility (`utilities` contribution, `utilDescriptor`) |
19
+ | `ddk:utility` | a utility in a modal (`utilities` contribution, `utilDescriptor`); `--layout maximized` (default) or `fullscreen` |
20
20
  | `ddk:setup` | a setup step (`setupStep` contribution, `setupDescriptor`) |
21
21
  | `ddk:dashboard-card` | a dashboard summary card and its detail, sharing `--dashboardKey` |
22
22
  | `ddk:pump-detail` | a pump detail for holders with `--dashboardKey` |
@@ -62,6 +62,19 @@ the parent's roles. For contributions written before the descriptor project,
62
62
  entry. Build and install the descriptor project's KAB (`nx run my-ncui:kab`) beside the DDK
63
63
  app.
64
64
 
65
+ To try a descriptor project without installing it, serve it with KosMock. Each
66
+ descriptor project has a generated setup module, `fixtures/setups/<name>.mjs`, rewritten
67
+ whenever a command lists an entry there; it calls `kosMock.ddk.useDescriptor`, which
68
+ answers the DDK's descriptor reads from the project and lists its setup steps:
69
+
70
+ ```sh
71
+ kosui fixtures serve
72
+ # open the DDK app (or ddk:dev) with ?kosMock=on&kosFixtureServer&kosSetup=my-ncui
73
+ ```
74
+
75
+ For mocking beyond the descriptor, a setup of your own can call `kosMock.ddk.addUtility`,
76
+ `addNavigation` and `addSetupStep`.
77
+
65
78
  ## Overriding a standard contribution
66
79
 
67
80
  Utilities, setup steps, navigation views, dashboard cards, pump details, macro
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kos-ddk-tools",
3
- "version": "0.1.0-dev.57",
3
+ "version": "0.1.0-dev.63",
4
4
  "description": "KOS DDK plugin authoring (kos-ddk) MCP server: plugin projects, extension-point contributions and overrides of the standard ones.",
5
5
  "author": {
6
6
  "name": "kosdev-code"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "kos-ddk-tools",
4
- "version": "0.1.0-dev.57",
4
+ "version": "0.1.0-dev.63",
5
5
  "description": "KOS DDK plugin authoring (kos-ddk) MCP server: plugin projects, extension-point contributions and overrides of the standard ones.",
6
6
  "license": "MIT"
7
7
  }
@@ -18947,6 +18947,11 @@
18947
18947
  "package": "@kosdev-code/kos-ddk-components",
18948
18948
  "file": "src/hooks/router/useNavigate.tsx"
18949
18949
  },
18950
+ {
18951
+ "name": "useUtilityModal",
18952
+ "package": "@kosdev-code/kos-ddk-components",
18953
+ "file": "src/components/modal/utility-modal/use-utility-modal.tsx"
18954
+ },
18950
18955
  {
18951
18956
  "name": "useViewExperience",
18952
18957
  "package": "@kosdev-code/kos-ddk-components",
@@ -19235,7 +19240,7 @@
19235
19240
  "name": "ddk-guide-storybook",
19236
19241
  "title": "Developing DDK contributions in Storybook",
19237
19242
  "description": "Running a plugin's Storybook against a simulator or with KosMock story mocks, where model data comes from, the story container per contribution command, render modes and overrides.",
19238
- "body": "# Developing DDK contributions in Storybook\n\nEvery `ddk:*` contribution command writes a story next to the component, so a contribution\ncan be developed in isolation before the plugin is loaded into a running DDK. Stories render\nagainst live models from a running simulator.\n\n## Run it\n\n```sh\nnpx nx run <plugin>:storybook\n```\n\nStorybook serves on port 4400. The plugin's `serve` target is the module federation dev\nserver used by `kosui ddk:dev`; Storybook has its own `storybook` target.\n\n## Where model data comes from\n\nThe preview (`.storybook/preview.tsx`) wraps every story in the providers the DDK hosts use:\nKosCore, translations (`app/system`, `app/kosdev.ddk`), `AssemblyProvider`,\n`ApplicationProvider` and `ApplicationComponentConfigurationProvider`. KosCore connects to the\nfirst of:\n\n1. the `?host=` query parameter on the Storybook URL;\n2. `KOS_HOST` and `KOS_PORT` in the plugin's `.env` (the generated `.env` sets\n `KOS_PORT=8081`, the simulator's default);\n3. the page's own origin.\n\nTranslations come from the same device: the DDK's namespaces (`app/system`,\n`app/kosdev.ddk`) from its files, and the plugin's own namespace from the plugin's\n`src/assets/locales`, since the device lists it only once the KAB is installed. Each\ncontribution command adds its title key, and the keys its component calls, to\n`src/assets/locales/en/<plugin>.json`.\n\nStart the simulator before Storybook. A story shows what the simulator has: a dashboard card\nneeds an active model at its `dashboardKey`, a trouble action needs an active trouble of its\n`troubleType`.\n\n## Mocking what the simulator lacks\n\nA story can bring its own data with KosMock, the SDK's transport-level mocks\n(`kos://guide/mocking`), instead of waiting for the simulator to reach a state: an active\ntrouble, setup mode, a descriptor entry. It names the mocks as `parameters.kosMock`, and\nthe preview's outermost decorator reloads the page into those boot switches\n(`ensureKosMockBoot`):\n\n```tsx\nexport const ActiveTrouble: Story = {\n parameters: { kosMock: { setups: [\"daily-cleaning-trouble\"] } },\n};\n```\n\n`kosMock` takes `setups` (setup modules in `fixtures/setups/`), `fixture` (a recorded\nfixture), `mode` and `fixtureServer`:\n\n- `mode: \"on\"` (the default) mocks only the named endpoints over the running simulator.\n- `mode: \"standalone\"` boots with no device at all; every endpoint the story reads must\n be mocked.\n\nServe the fixtures beside Storybook:\n\n```sh\nkosui fixtures serve\n```\n\nA story without `kosMock` reloads without switches, so mocks never carry over between\nstories. Every generated story has a commented `kosMock` line to start from.\n\n## Story containers\n\nEach story renders the component inside the container for its extension point, from\n`@kosdev-code/kos-ddk-story-containers`:\n\n| Command | Container | Gives the component |\n| -------------------- | ----------------------------------------------------------------- | ----------------------------------------------------- |\n| `ddk:utility` | `UtilityStoryContainer` | the utility frame |\n| `ddk:setup` | `SetupStepStoryContainer` | the setup step frame |\n| `ddk:nav` | `NavStoryContainer` | the navigation view frame |\n| `ddk:cui` | `CUIStoryContainer` | the CUI frame |\n| `ddk:dashboard-card` | `DashboardSummaryStoryContainer`, `DashboardDetailStoryContainer` | `dashboardKey`, `assembly`, `cardModel`, `onComplete` |\n| `ddk:pump-detail` | `PumpDetailStoryContainer` | the first `holder` with the `dashboardKey` |\n| `ddk:pump-card` | `PumpSummaryStoryContainer`, `PumpDetailStoryContainer` | the first `holder` with the `dashboardKey` |\n| `ddk:macro-summary` | `MacroSummaryStoryContainer` | the first `holder` with the `dashboardKey` |\n| `ddk:trouble-action` | `TroubleActionStoryContainer` | the active `trouble` of the `troubleType` |\n\nWhen the simulator has no matching model, holder or trouble, the container says so in place\nof the story.\n\n## Standard and compact modes\n\nThe **Render Mode** toolbar switches between `standard` and `compact`. It changes the DDK\nstyles and the component mode; in `compact`, modals render full screen.\n\n## Overrides\n\nA story renders the override on its own, so an override of a standard contribution can be\ndeveloped here first. To see it replace the standard contribution, load the plugin into a\nrunning DDK with `kosui ddk:dev` (see the package README)."
19243
+ "body": "# Developing DDK contributions in Storybook\n\nEvery `ddk:*` contribution command writes a story next to the component, so a contribution\ncan be developed in isolation before the plugin is loaded into a running DDK. Stories render\nagainst live models from a running simulator.\n\n## Run it\n\n```sh\nnpx nx run <plugin>:storybook\n```\n\nStorybook serves on port 4400. The plugin's `serve` target is the module federation dev\nserver used by `kosui ddk:dev`; Storybook has its own `storybook` target.\n\n## Where model data comes from\n\nThe preview (`.storybook/preview.tsx`) wraps every story in the providers the DDK hosts use:\nKosCore, translations (`app/system`, `app/kosdev.ddk`), `AssemblyProvider`,\n`ApplicationProvider` and `ApplicationComponentConfigurationProvider`. KosCore connects to the\nfirst of:\n\n1. the `?host=` query parameter on the Storybook URL;\n2. `KOS_HOST` and `KOS_PORT` in the plugin's `.env` (the generated `.env` sets\n `KOS_PORT=8081`, the simulator's default);\n3. the page's own origin.\n\nTranslations come from the same device: the DDK's namespaces (`app/system`,\n`app/kosdev.ddk`) from its files, and the plugin's own namespace from the plugin's\n`src/assets/locales`, since the device lists it only once the KAB is installed. Each\ncontribution command adds its title key, and the keys its component calls, to\n`src/assets/locales/en/<plugin>.json`.\n\nStart the simulator before Storybook. A story shows what the simulator has: a dashboard card\nneeds an active model at its `dashboardKey`, a trouble action needs an active trouble of its\n`troubleType`.\n\n## Mocking what the simulator lacks\n\nA story can bring its own data with KosMock, the SDK's transport-level mocks\n(`kos://guide/mocking`), instead of waiting for the simulator to reach a state: an active\ntrouble, setup mode, a descriptor entry. It names the mocks as `parameters.kosMock`, and\nthe preview's outermost decorator reloads the page into those boot switches\n(`ensureKosMockBoot`):\n\n```tsx\nexport const ActiveTrouble: Story = {\n parameters: { kosMock: { setups: [\"daily-cleaning-trouble\"] } },\n};\n```\n\n`kosMock` takes `setups` (setup modules in `fixtures/setups/`), `fixture` (a recorded\nfixture), `mode` and `fixtureServer`:\n\n- `mode: \"on\"` (the default) mocks only the named endpoints over the running simulator.\n- `mode: \"standalone\"` boots with no device at all; every endpoint the story reads must\n be mocked.\n\nServe the fixtures beside Storybook:\n\n```sh\nkosui fixtures serve\n```\n\nA story without `kosMock` reloads without switches, so mocks never carry over between\nstories. Every generated story has a commented `kosMock` line to start from.\n\n## Story containers\n\nEach story renders the component inside the container for its extension point, from\n`@kosdev-code/kos-ddk-story-containers`:\n\n| Command | Container | Gives the component |\n| -------------------- | ----------------------------------------------------------------- | ----------------------------------------------------- |\n| `ddk:utility` | `UtilityStoryContainer` | nothing: the utility opens its own `Modal` |\n| `ddk:setup` | `SetupStepStoryContainer` | the setup step frame |\n| `ddk:nav` | `NavStoryContainer` | the navigation view frame |\n| `ddk:cui` | `CUIStoryContainer` | the CUI frame |\n| `ddk:dashboard-card` | `DashboardSummaryStoryContainer`, `DashboardDetailStoryContainer` | `dashboardKey`, `assembly`, `cardModel`, `onComplete` |\n| `ddk:pump-detail` | `PumpDetailStoryContainer` | the first `holder` with the `dashboardKey` |\n| `ddk:pump-card` | `PumpSummaryStoryContainer`, `PumpDetailStoryContainer` | the first `holder` with the `dashboardKey` |\n| `ddk:macro-summary` | `MacroSummaryStoryContainer` | the first `holder` with the `dashboardKey` |\n| `ddk:trouble-action` | `TroubleActionStoryContainer` | the active `trouble` of the `troubleType` |\n\nWhen the simulator has no matching model, holder or trouble, the container says so in place\nof the story.\n\nA utility story has an `open` control. Closing the utility turns it off and logs\n`onComplete` in the Actions panel; the **Open** button behind the modal, or the\ncontrol, opens it again.\n\n## Standard and compact modes\n\nThe **Render Mode** toolbar switches between `standard` and `compact`. It changes the DDK\nstyles and the component mode; in `compact`, modals render full screen.\n\n## Overrides\n\nA story renders the override on its own, so an override of a standard contribution can be\ndeveloped here first. To see it replace the standard contribution, load the plugin into a\nrunning DDK with `kosui ddk:dev` (see the package README)."
19239
19244
  },
19240
19245
  {
19241
19246
  "uri": "ddk://guide/descriptor-project",