@kosdev-code/kos-ddk-cli 0.1.0-dev.88 → 0.1.0-dev.91

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kos-ddk-tools",
3
- "version": "0.1.0-dev.88",
3
+ "version": "0.1.0-dev.91",
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.88",
4
+ "version": "0.1.0-dev.91",
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
  }
@@ -165,7 +165,7 @@
165
165
  "name": "dashboardKey",
166
166
  "type": "string",
167
167
  "required": true,
168
- "description": "Key used to match this extension with a macro holder. Tried in order: (1) holder.name (e.g. 'ns', 'water', 'carb'), (2) ExtensionManager.executeDashboardKeyFactory(holder) (default: holder.pumps.data[0]?.type, e.g. 'lfcv', 'cgp')."
168
+ "description": "Key used to match this extension with a macro holder. Tried in order: (1) holder.name (e.g. 'ns', 'water', 'carb'), (2) the holder's dashboard keys in order (registered key factories, lowest rank first, ending with holder.pumps.data[0]?.type, e.g. 'lfcv-x', 'lfcv')."
169
169
  },
170
170
  {
171
171
  "name": "rank",
@@ -205,7 +205,7 @@
205
205
  "name": "dashboardKey",
206
206
  "type": "string",
207
207
  "required": true,
208
- "description": "Key used to match this extension with specific dashboard pumps"
208
+ "description": "Key used to match this extension with dashboard pumps. A holder has an ordered list of dashboard keys (registered key factories, lowest rank first, ending with its first pump's type, e.g. 'lfcv-x', 'lfcv'); the first key with a contribution wins."
209
209
  },
210
210
  {
211
211
  "name": "rank",
@@ -246,7 +246,7 @@
246
246
  "name": "dashboardKey",
247
247
  "type": "string",
248
248
  "required": true,
249
- "description": "Key used to match this extension with dashboard pumps: the holder's dashboard key, by default its first pump's type (e.g. 'cgp', 'lfcv')."
249
+ "description": "Key used to match this extension with dashboard pumps. A holder has an ordered list of dashboard keys (registered key factories, lowest rank first, ending with its first pump's type, e.g. 'lfcv-x', 'lfcv'); the first key with a contribution wins."
250
250
  },
251
251
  {
252
252
  "name": "rank",
@@ -1466,7 +1466,7 @@
1466
1466
  {
1467
1467
  "name": "--ddk-component-dashboard-card-layout-columns",
1468
1468
  "values": {
1469
- "flex-eu": "minmax(0, min-content) auto auto 30px",
1469
+ "flex-eu": "max-content auto auto 30px",
1470
1470
  "compact": "60px auto 40px 30px"
1471
1471
  }
1472
1472
  },
@@ -3313,6 +3313,7 @@
3313
3313
  "package": "@kosdev-code/kos-ddk-components",
3314
3314
  "file": "src/components/dashboard-card/dashboard-card.tsx",
3315
3315
  "styled": true,
3316
+ "description": "Cuts the footer off with an ellipsis after two lines.",
3316
3317
  "props": [],
3317
3318
  "renders": [
3318
3319
  "CardAvatar",
@@ -3330,25 +3331,29 @@
3330
3331
  "useRef"
3331
3332
  ],
3332
3333
  "styles": [
3333
- {
3334
- "property": "align-items",
3335
- "value": "center"
3336
- },
3337
3334
  {
3338
3335
  "property": "grid-area",
3339
3336
  "value": "footer"
3340
3337
  },
3341
3338
  {
3342
3339
  "property": "display",
3343
- "value": "flex"
3340
+ "value": "-webkit-box"
3344
3341
  },
3345
3342
  {
3346
- "property": "font-size",
3347
- "value": "14px"
3343
+ "property": "-webkit-box-orient",
3344
+ "value": "vertical"
3348
3345
  },
3349
3346
  {
3350
- "property": "flex-wrap",
3351
- "value": "wrap"
3347
+ "property": "-webkit-line-clamp",
3348
+ "value": "2"
3349
+ },
3350
+ {
3351
+ "property": "overflow",
3352
+ "value": "hidden"
3353
+ },
3354
+ {
3355
+ "property": "font-size",
3356
+ "value": "14px"
3352
3357
  }
3353
3358
  ],
3354
3359
  "tokens": []
@@ -4198,7 +4203,7 @@
4198
4203
  {
4199
4204
  "name": "--ddk-component-dashboard-card-layout-columns",
4200
4205
  "values": {
4201
- "flex-eu": "minmax(0, min-content) auto auto 30px",
4206
+ "flex-eu": "max-content auto auto 30px",
4202
4207
  "compact": "60px auto 40px 30px"
4203
4208
  }
4204
4209
  },
@@ -6071,7 +6076,7 @@
6071
6076
  {
6072
6077
  "name": "--ddk-component-dashboard-card-layout-columns",
6073
6078
  "values": {
6074
- "flex-eu": "minmax(0, min-content) auto auto 30px",
6079
+ "flex-eu": "max-content auto auto 30px",
6075
6080
  "compact": "60px auto 40px 30px"
6076
6081
  }
6077
6082
  },
@@ -20969,21 +20974,21 @@
20969
20974
  "name": "ddk-extension-point-ddk.dashboard.macro-summary",
20970
20975
  "title": "Dashboard Macro Summary extension point",
20971
20976
  "description": "ddk.dashboard.macro-summary (contributes.dashboardMacroSummary): fields, the props its component receives and add_macro_summary.",
20972
- "body": "# Dashboard Macro Summary (`ddk.dashboard.macro-summary`)\n\nExtension point for plug-in supplied macro holder card summary content (the body shown on the dashboard, not the tap-detail modal)\n\n- Contribution key: `contributes.dashboardMacroSummary` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_macro_summary` (`kosui ddk:macro-summary`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-macro-summary-extension.ts` as `DashboardMacroSummaryExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.macro.summary\"` | yes | Extension type, must be 'dashboard.macro.summary' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with a macro holder. Tried in order: (1) holder.name (e.g. 'ns', 'water', 'carb'), (2) ExtensionManager.executeDashboardKeyFactory(holder) (default: holder.pumps.data[0]?.type, e.g. 'lfcv', 'cgp'). |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |"
20977
+ "body": "# Dashboard Macro Summary (`ddk.dashboard.macro-summary`)\n\nExtension point for plug-in supplied macro holder card summary content (the body shown on the dashboard, not the tap-detail modal)\n\n- Contribution key: `contributes.dashboardMacroSummary` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_macro_summary` (`kosui ddk:macro-summary`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-macro-summary-extension.ts` as `DashboardMacroSummaryExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.macro.summary\"` | yes | Extension type, must be 'dashboard.macro.summary' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with a macro holder. Tried in order: (1) holder.name (e.g. 'ns', 'water', 'carb'), (2) the holder's dashboard keys in order (registered key factories, lowest rank first, ending with holder.pumps.data[0]?.type, e.g. 'lfcv-x', 'lfcv'). |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |"
20973
20978
  },
20974
20979
  {
20975
20980
  "uri": "ddk://extension-point/ddk.dashboard.pump-detail",
20976
20981
  "name": "ddk-extension-point-ddk.dashboard.pump-detail",
20977
20982
  "title": "Dashboard Pump Detail extension point",
20978
20983
  "description": "ddk.dashboard.pump-detail (contributes.dashboardPumpDetail): fields, the props its component receives, standard contributions and add_pump_detail.",
20979
- "body": "# Dashboard Pump Detail (`ddk.dashboard.pump-detail`)\n\nExtension point for dashboard pump detail plugin configurations with view support\n\n- Contribution key: `contributes.dashboardPumpDetail` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_pump_detail` (`kosui ddk:pump-detail`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-pump-detail-extension.ts` as `DashboardPumpDetailExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.detail.pump\"` | yes | Extension type, must be 'dashboard.detail.pump' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with specific dashboard pumps |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |\n\n## Standard contributions\n\nOverride one by passing its id as `override` to the writing tool.\n\n| Id | Slot | Rank | Plugin |\n| --- | --- | --- | --- |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.CANSuperPump` | dashboardKey=microSuper | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.MicroPump` | dashboardKey=micro | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.cgp` | dashboardKey=cgp | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.fcm` | dashboardKey=fcm | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.lfcv` | dashboardKey=lfcv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.lfcvdv` | dashboardKey=lfcvdv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.msv` | dashboardKey=msv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.valve` | dashboardKey=valve | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.CANSuperPump` | dashboardKey=microSuper | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.MicroPump` | dashboardKey=micro | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.fcm` | dashboardKey=fcm | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.lfcv` | dashboardKey=lfcv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.lfcvdv` | dashboardKey=lfcvdv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.msv` | dashboardKey=msv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.valve` | dashboardKey=valve | unranked | kos-ddk-compact-plugin |"
20984
+ "body": "# Dashboard Pump Detail (`ddk.dashboard.pump-detail`)\n\nExtension point for dashboard pump detail plugin configurations with view support\n\n- Contribution key: `contributes.dashboardPumpDetail` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_pump_detail` (`kosui ddk:pump-detail`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-pump-detail-extension.ts` as `DashboardPumpDetailExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.detail.pump\"` | yes | Extension type, must be 'dashboard.detail.pump' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with dashboard pumps. A holder has an ordered list of dashboard keys (registered key factories, lowest rank first, ending with its first pump's type, e.g. 'lfcv-x', 'lfcv'); the first key with a contribution wins. |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |\n\n## Standard contributions\n\nOverride one by passing its id as `override` to the writing tool.\n\n| Id | Slot | Rank | Plugin |\n| --- | --- | --- | --- |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.CANSuperPump` | dashboardKey=microSuper | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.MicroPump` | dashboardKey=micro | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.cgp` | dashboardKey=cgp | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.fcm` | dashboardKey=fcm | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.lfcv` | dashboardKey=lfcv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.lfcvdv` | dashboardKey=lfcvdv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.msv` | dashboardKey=msv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.valve` | dashboardKey=valve | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.CANSuperPump` | dashboardKey=microSuper | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.MicroPump` | dashboardKey=micro | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.fcm` | dashboardKey=fcm | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.lfcv` | dashboardKey=lfcv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.lfcvdv` | dashboardKey=lfcvdv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.msv` | dashboardKey=msv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.valve` | dashboardKey=valve | unranked | kos-ddk-compact-plugin |"
20980
20985
  },
20981
20986
  {
20982
20987
  "uri": "ddk://extension-point/ddk.dashboard.pump-summary",
20983
20988
  "name": "ddk-extension-point-ddk.dashboard.pump-summary",
20984
20989
  "title": "Dashboard Pump Summary extension point",
20985
20990
  "description": "ddk.dashboard.pump-summary (contributes.dashboardPumpSummary): fields, the props its component receives and add_pump_card.",
20986
- "body": "# Dashboard Pump Summary (`ddk.dashboard.pump-summary`)\n\nExtension point for the body of a holder's dashboard card by pump type; the card keeps its default body when none matches\n\n- Contribution key: `contributes.dashboardPumpSummary` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_pump_card` (`kosui ddk:pump-card`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-pump-summary-extension.ts` as `DashboardPumpSummaryExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.summary.pump\"` | yes | Extension type, must be 'dashboard.summary.pump' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with dashboard pumps: the holder's dashboard key, by default its first pump's type (e.g. 'cgp', 'lfcv'). |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |"
20991
+ "body": "# Dashboard Pump Summary (`ddk.dashboard.pump-summary`)\n\nExtension point for the body of a holder's dashboard card by pump type; the card keeps its default body when none matches\n\n- Contribution key: `contributes.dashboardPumpSummary` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_pump_card` (`kosui ddk:pump-card`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-pump-summary-extension.ts` as `DashboardPumpSummaryExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.summary.pump\"` | yes | Extension type, must be 'dashboard.summary.pump' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with dashboard pumps. A holder has an ordered list of dashboard keys (registered key factories, lowest rank first, ending with its first pump's type, e.g. 'lfcv-x', 'lfcv'); the first key with a contribution wins. |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |"
20987
20992
  },
20988
20993
  {
20989
20994
  "uri": "ddk://extension-point/ddk.dashboard.region",
@@ -48554,7 +48554,7 @@ export default (kosMock) => {
48554
48554
  }
48555
48555
  return kosMock.ddk.useDescriptor(descriptor);
48556
48556
  };
48557
- `}}var vPr=s=>(Array.isArray(s)?s:String(s??"").split(",")).map(a=>a.trim()).filter(Boolean);function drn(s,a,{project:p,slot:g,roles:E,column:A}){let{name:I,kosJsonPath:F}=g3n(s,p),W=s.read(F),$=JSON.parse(W),X=($.kondra??={}).ncui??={},ee=vPr(E),H=ee.length?{roles:ee}:{},ue;if(a==="utility"){let ae=X.utilities??=[[]];if(ae.flat().some(Fe=>Fe.name===g))return`${I} already lists utility "${g}".`;let Me=A===void 0||A===""?ae.length-1:Number(A)-1;if(!Number.isInteger(Me)||Me<0||Me>ae.length)throw new Error(`column must be 1 to ${ae.length+1}; got "${A}"`);(ae[Me]??=[]).push({name:g,options:{},...H}),ue=`Listed utility "${g}" in ${I} (column ${Me+1}).`}else if(a==="setup"){let ae=(X.setup??={}).steps??=[];if(ae.some(Me=>Me.name===g))return`${I} already lists setup step "${g}".`;ae.push({name:g}),ue=`Listed setup step "${g}" last in ${I}; the setup flow runs steps in that order.`}else{let ae=g.split("."),Me=X.navigations??=[],Fe;for(let Ee of ae.slice(0,-1)){if(Fe=Me.find(Ge=>Ge.name===Ee),!Fe)throw new Error(`${I} has no navigation "${ae.slice(0,ae.indexOf(Ee)+1).join(".")}" to add "${g}" under`);Me=Fe.children??=[]}let ke=ae[ae.length-1];if(Me.some(Ee=>Ee.name===ke))return`${I} already lists navigation "${g}".`;let Ie=ee.length?ee:Fe?.roles;Me.push({name:ke,...Ie?{roles:Ie}:{}}),ue=`Listed navigation "${g}" in ${I}.`}s.write(F,Mtt(W,$));let Q=tNt($);return s.write(Q.path,Q.content),ue}function f3n(s,a,p){if(a==="utility")return(s.utilities??[]).flat().some(E=>E.name===p);if(a==="setup")return(s.setup?.steps??[]).some(E=>E.name===p);let g=s.navigations??[];for(let E of p.split(".")){let A=g.find(I=>I.name===E);if(!A)return!1;g=A.children??[]}return!0}function Hjt(s,a,p){let g=o8e(s);return g.length?g.some(({kosJsonPath:E})=>f3n(JSON.parse(s.read(E)).kondra?.ncui??{},a,p)):Rtt.some(E=>[!1,!0].some(A=>f3n(Ott({layout:E,...Object.fromEntries(Object.keys(eNt).map(I=>[I,A]))}).ncui,a,p)))}var bPr=(s,a)=>new RegExp(`^${s.split("*").map(p=>p.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join(".*")}$`).test(a),_3n=/^\d+(\.\d+)?%$/,lrn=["left","right","center"],m3n=[...lrn,"full"];function h3n(s,a,p){if(!p)return[];let g=p.filter(I=>I!=="fit"&&!_3n.test(I)).map(I=>`${s} ${a} size "${I}" is not a share like "50%" or fit`),E=p.filter(I=>_3n.test(I)),A=E.reduce((I,F)=>I+parseFloat(F),0);return E.length>0&&Math.abs(A-100)>.5&&g.push(`${s} ${a} shares add up to ${A}%, not 100%`),g}function xPr(s,a,p){if(!s)return[];let g=s.regions??[],E=new Set(g.map(I=>I.name)),A=[];!s.layouts?.portrait&&!s.layouts?.landscape&&A.push("dashboard has no portrait or landscape layout, so the built-in one shows");for(let I of g)p&&I.component&&!p.includes(I.component)&&A.push(`region "${I.name}" component "${I.component}" is contributed by no plugin in the workspace, so the region shows its built-in cards`),I.justify!==void 0&&!m3n.includes(I.justify)&&A.push(`region "${I.name}" justify "${I.justify}" is not ${m3n.join(", ")}`);for(let[I,F]of Object.entries(s.layouts??{})){F?.justify!==void 0&&!lrn.includes(F.justify)&&A.push(`${I} justify "${F.justify}" is not ${lrn.join(", ")}`),A.push(...h3n(I,"column",F?.columns),...h3n(I,"row",F?.rows));let W=new Set((F?.areas??[]).flatMap(X=>X.trim().split(/\s+/)).filter(X=>!/^\.+$/.test(X)));for(let X of W)E.has(X)||A.push(`${I} area "${X}" is not a dashboard region`);let $=g.filter(X=>W.has(X.name));for(let X of a)$.some(H=>(H.summaries??[]).some(ue=>bPr(ue,X)))||A.push(`dashboard summary "${X}" is in no ${I} region, so it does not show`)}return A}function y3n(s,a,p){return o8e(s).flatMap(({name:g,kosJsonPath:E})=>xPr(JSON.parse(s.read(E)).kondra?.ncui?.dashboard,a,p).map(A=>({project:g,problem:A})))}var v3n=s=>s.component??s.name;function qjt(s,a){let p=o8e(s);return(p.length?p.map(({kosJsonPath:E})=>JSON.parse(s.read(E)).kondra?.ncui?.dashboard):Rtt.map(E=>Ott({layout:E}).ncui.dashboard)).some(E=>(E?.regions??[]).some(A=>v3n(A)===a))}function b3n(s,{project:a,key:p}){let{name:g,kosJsonPath:E}=g3n(s,a),A=s.read(E),I=JSON.parse(A),F=(I.kondra??={}).ncui??={},W=[];F.dashboard||(F.dashboard=Ott({layout:"standard"}).ncui.dashboard,W.push(`${g} had no dashboard; it now has the built-in standard one.`));let $=F.dashboard.regions??=[];if($.some(ee=>v3n(ee)===p))return`${g} already has a dashboard region rendered by "${p}".`;if($.some(ee=>ee.name===p))throw new Error(`${g} has a dashboard region named "${p}" with another component; choose another regionKey`);$.push({name:p});for(let ee of Object.values(F.dashboard.layouts??{})){let H=Math.max(1,...(ee.areas??[]).map(ue=>ue.trim().split(/\s+/).length));(ee.areas??=[]).push(Array(H).fill(p).join(" ")),ee.rows&&ee.rows.push("fit")}s.write(E,Mtt(A,I));let X=tNt(I);return s.write(X.path,X.content),[...W,`Added dashboard region "${p}" to ${g} as the full-width last row of each layout; it claims no holders or summaries, so the component reads the assembly. Move it in kondra.ncui.dashboard.layouts, or give it holders and summaries patterns.`].join(" ")}var SPr=[["utilities","utility","utilDescriptor"],["setupStep","setup","setupDescriptor"],["navViews","nav","navDescriptor"]];function x3n(s,{project:a,descriptorProject:p}){let g=Nge(s.root,a)?.root,E=g&&s.read(urn.join(g,".kos.json"));if(!E)throw new Error(`No plugin project "${a}" with a .kos.json`);let A=JSON.parse(E).kos?.ui?.plugin?.contributes??{},I=[];for(let[F,W,$]of SPr)for(let X of A[F]??[])if(X[$])try{I.push(drn(s,W,{project:p,slot:X[$]}))}catch(ee){I.push(`${X.id}: ${ee.message}`)}return{label:"DDK descriptor entries",notes:I.length?I:[`${a} contributes no utility, setup step or navigation slot.`]}}var S3n={cui:{pluginType:"ddk.cui",label:"DDK CUI Configuration",required:"cuiDescriptor",description:"Create a CUI configuration; --descriptor is the CUI's appId from /api/app/kosdev.ddk/cui"},setup:{pluginType:"ddk.setup",label:"DDK Setup Step",overridable:"setupDescriptor",listedIn:"kondra.ncui.setup.steps",descriptorType:"setup",description:"Create a setup step; --descriptor is its kondra.ncui.setup.steps entry (default: from the name)"},utility:{pluginType:"ddk.utility",label:"DDK Utility",overridable:"utilDescriptor",listedIn:"kondra.ncui.utilities",descriptorType:"utility",layouts:["maximized","fullscreen"],description:"Create a utility in a modal; --layout maximized (default) or fullscreen; --descriptor is its kondra.ncui.utilities entry (default: from the name)"},nav:{pluginType:"ddk.nav",label:"DDK Navigation View",overridable:"navDescriptor",listedIn:"kondra.ncui.navigations",descriptorType:"nav",slotRequired:!0,description:"Create a navigation view; --descriptor is its kondra.ncui.navigations entry, e.g. settings.water for a Settings tab"}},TPr={"ddk.cui":{proceed:"Proceed"},"ddk.setup":{proceed:"Proceed"},"ddk.utility":{back:"Back",close:"Close",done:"Done"},"ddk.dashboardDetail":{close:"Close"},"ddk.troubleAction":{resolve:"Resolve"}};function EPr(s,a,p){let g=TPr[a],E=Nge(s.root,p)?.sourceRoot;if(!g||!E)return;let A=$jt.join(E,"assets","locales","en",`${p}.json`);s.exists(A)&&Gjt(s,A,I=>({...g,...I}))}function Ftt(s,a,p){let g=Nge(s.root,a)?.root,E=g&&s.read($jt.join(g,".kos.json"));if(!E)return;let A=JSON.parse(E).kos?.ui?.plugin?.contributes?.experiences??{},I=k9e({name:p}).namePascalCase,F=Object.values(A).find(W=>[I,`${I}Summary`,`${I}Detail`].includes(W.component));if(F)throw new Error(`${a} already has a component ${F.component} (${F.location}); components are exposed by name, so choose another --name (kosui ddk:descriptor-entries lists an existing contribution's slot in a descriptor project)`)}function Btt(s,a){let p=k9e({name:a}).namePascalCase,g=[];for(let E of QIt(s.root).values()){let A=s.read($jt.join(E.root,".kos.json"));if(!A)continue;let I;try{I=JSON.parse(A).models}catch{continue}for(let[F,W]of Object.entries(I??{})){let $=W?.factory??k9e({name:F}).namePascalCase;$===p&&g.push(`WARNING: component ${p} has the same name as model ${F}'s registration bean ${$} (${E.name}). Choose another name, e.g. ${a}-config (${p}Config), before writing.`)}}return g}function s8e(s,a,{name:p,project:g,...E}){d3n();let A=Nge(s.root,g)?.root,I=A&&$jt.join(A,".kos.json"),F=I&&s.read(I);l3n(s,ZIt,{name:p,appProject:g,type:"components",pluginType:a,useEmotionCss:!1,appDirectory:"",modelDirectory:"",...E});let W=F&&s.read(I);W&&W!==F&&s.write(I,Mtt(F,JSON.parse(W))),EPr(s,a,g)}function Ltt(s,a){if(!s)throw new Error(`${a} is required`)}var jtt=s=>s===void 0?{}:{rank:s};function T3n(s,{type:a,name:p,project:g,descriptor:E,override:A,rank:I,descriptorProject:F,roles:W,column:$,layout:X}){let ee=S3n[a];if(!ee)throw new Error(`Unknown contribution type "${a}". Choose from ${Object.keys(S3n).join(", ")}.`);let H=A||I!==void 0&&I!=="";if(!ee.overridable&&H)throw new Error(`${a} contributions are not ranked; --override and --rank do not apply`);if(ee.required&&Ltt(E,`descriptor (${ee.required})`),X&&!ee.layouts)throw new Error(`${a} contributions have no layout; --layout does not apply`);if(X&&!ee.layouts.includes(X))throw new Error(`Unknown layout "${X}". Choose from ${ee.layouts.join(", ")}.`);let ue=ee.overridable?Ptt(a,{override:A,rank:I,explicit:{[ee.overridable]:E}}):{fields:{},notes:[]},Q=ue.fields[ee.overridable]??E;if(ee.slotRequired&&!Q&&Ltt(Q,`descriptor (${ee.overridable}, a kondra.ncui.navigations path such as settings.water)`),Ftt(s,g,p),F&&A)throw new Error("--override fills a slot the descriptor already lists; --descriptorProject does not apply");let ae=ee.listedIn&&!Q?[`${ee.overridable} "${k9e({name:p}).nameCamelCase}" comes from the name (--descriptor sets it).`]:[];s8e(s,ee.pluginType,{name:p,project:g,...Q?{descriptor:Q}:{},...jtt(ue.rank),...ee.layouts?{layout:X||ee.layouts[0]}:{}});let Me=ee.descriptorType?DPr(s,ee,{slot:Q||k9e({name:p}).nameCamelCase,override:A,descriptorProject:F,roles:W,column:$}):[];return{label:ee.label,notes:[...Btt(s,p),...ue.notes,...ae,...Me]}}function DPr(s,a,{slot:p,override:g,descriptorProject:E,roles:A,column:I}){if(g)return[];if(E)return[drn(s,a.descriptorType,{project:E,slot:p,roles:A,column:I})];if(Hjt(s,a.descriptorType,p))return[];let W=o8e(s).map($=>$.name);return[W.length?`No descriptor project lists ${a.overridable} "${p}"; add it with --descriptorProject ${W[0]}.`:`The NCUI shows "${p}" only if its descriptor (${a.listedIn}) lists it: create a descriptor project with kosui ddk:descriptor-project and pass --descriptorProject, or the system app's descriptor must list it.`]}function E3n(s,{name:a,project:p,dashboardKey:g,detail:E=!0,override:A,rank:I}){Ftt(s,p,a);let F=Ptt("dashboard-card",{override:A,rank:I,explicit:{dashboardKey:g}}),W=F.fields.dashboardKey??g;Ltt(W,"dashboardKey");let $={name:a,project:p,dashboardKey:W,...jtt(F.rank)};return s8e(s,"ddk.dashboardSummary",$),E&&s8e(s,"ddk.dashboardDetail",$),{label:E?"DDK Dashboard Card":"DDK Dashboard Summary",notes:[...Btt(s,a),`The dashboard draws one card per active model at assembly.${W} (or the FreestyleAssembly companion's ${W}); no such model, no card.`,...E?["The detail opens when a technician selects the card."]:[],...F.notes,...Vnn("dashboard-card",{override:A,rank:F.rank,slot:{dashboardKey:W},written:E?["dashboardSummary","dashboardDetail"]:["dashboardSummary"]})]}}function D3n(s,{name:a,project:p,dashboardKey:g,override:E,rank:A}){Ftt(s,p,a);let I=Ptt("pump-detail",{override:E,rank:A,explicit:{dashboardKey:g}}),F=I.fields.dashboardKey??g;return Ltt(F,"dashboardKey"),s8e(s,"ddk.pumpDetail",{name:a,project:p,dashboardKey:F,...jtt(I.rank)}),{label:"DDK Pump Detail",notes:[...Btt(s,a),`Shown in the holder modal when the dashboard key factory returns "${F}" for the holder (default: its first pump's type), unless the holder has its own content.`,...I.notes]}}function C3n(s,{name:a,project:p,dashboardKey:g,detail:E=!0,override:A,rank:I}){Ftt(s,p,a);let F=Ptt("pump-card",{override:A,rank:I,explicit:{dashboardKey:g}}),W=F.fields.dashboardKey??g;Ltt(W,"dashboardKey");let $={name:a,project:p,dashboardKey:W,...jtt(F.rank)};return s8e(s,"ddk.pumpSummary",$),E&&s8e(s,"ddk.pumpDetail",$),{label:E?"DDK Pump Card":"DDK Pump Summary",notes:[...Btt(s,a),`Used for holders whose dashboard key factory returns "${W}" (default: the holder's first pump type, which the backend assembly assigns); other holders keep the default card body.`,...E?["The detail shows in the holder modal a technician opens from the card."]:[],...F.notes,...Vnn("pump-card",{override:A,rank:F.rank,slot:{dashboardKey:W},written:E?["dashboardPumpSummary","dashboardPumpDetail"]:["dashboardPumpSummary"]})]}}function A3n(s,{name:a,project:p,dashboardKey:g,override:E,rank:A}){Ftt(s,p,a);let I=Ptt("macro-summary",{override:E,rank:A,explicit:{dashboardKey:g}}),F=I.fields.dashboardKey??g;return Ltt(F,"dashboardKey"),s8e(s,"ddk.macroSummary",{name:a,project:p,dashboardKey:F,...jtt(I.rank)}),{label:"DDK Macro Summary",notes:[...Btt(s,a),`Matched to a macro holder by holder.name "${F}" first, then by the dashboard key factory.`,...I.notes]}}function P3n(s,{name:a,project:p,regionKey:g,rank:E,descriptorProject:A}){Ftt(s,p,a);let I=g||k9e({name:a}).nameCamelCase;s8e(s,"ddk.dashboardRegion",{name:a,project:p,regionKey:I,claimsNothing:!!A,...jtt(Gnn(E))});let F=g?[]:[`regionKey "${I}" comes from the name (--regionKey sets it).`],W;if(A)W=b3n(s,{project:A,key:I});else if(qjt(s,I))W=`Renders the dashboard region "${I}" in place of its built-in cards.`;else{let $=o8e(s).map(X=>X.name);W=$.length?`No dashboard region in a descriptor project is rendered by "${I}"; add one with --descriptorProject ${$[0]}, or set a region's component to "${I}".`:`The dashboard shows "${I}" only if its descriptor (kondra.ncui.dashboard) has a region named "${I}" or with component "${I}": create a descriptor project with kosui ddk:descriptor-project and pass --descriptorProject.`}return{label:"DDK Dashboard Region",notes:[...Btt(s,a),...F,W]}}function k3n(s,{name:a,project:p,troubleType:g,stateKey:E,stateValue:A,override:I,rank:F}){Ftt(s,p,a);let W=Ptt("trouble-action",{override:I,rank:F,explicit:{troubleType:g,stateKey:E,stateValue:A}}),$=W.fields.troubleType??g;return Ltt($,"troubleType"),s8e(s,"ddk.troubleAction",{name:a,project:p,troubleType:$,stateKey:W.fields.stateKey??(E||$),stateValue:W.fields.stateValue??(A||$),...jtt(W.rank)}),{label:"DDK Trouble Action",notes:[...Btt(s,a),`troubleType "${$}" must be the exact type the device raises; the experience shows while one is active and goes away once it is resolved.`,...W.notes]}}import{spawnSync as CPr}from"node:child_process";import kme from"node:fs";import AX from"node:path";var APr="~3.1.0",I3n="kosdev.ddk",PPr=["@kosdev-code/kos-ddk","@kosdev-code/kos-ddk-components","@kosdev-code/kos-ddk-model-components","@kosdev-code/kos-ddk-models","@kosdev-code/kos-ddk-styles","@kosdev-code/kos-ddk-story-containers"],kPr={cui:[],utilities:[]},nNt=s=>JSON.parse(kme.readFileSync(s,"utf-8")),prn=(s,a)=>kme.writeFileSync(s,JSON.stringify(a,null,2)+`
48557
+ `}}var vPr=s=>(Array.isArray(s)?s:String(s??"").split(",")).map(a=>a.trim()).filter(Boolean);function drn(s,a,{project:p,slot:g,roles:E,column:A}){let{name:I,kosJsonPath:F}=g3n(s,p),W=s.read(F),$=JSON.parse(W),X=($.kondra??={}).ncui??={},ee=vPr(E),H=ee.length?{roles:ee}:{},ue;if(a==="utility"){let ae=X.utilities??=[[]];if(ae.flat().some(Fe=>Fe.name===g))return`${I} already lists utility "${g}".`;let Me=A===void 0||A===""?ae.length-1:Number(A)-1;if(!Number.isInteger(Me)||Me<0||Me>ae.length)throw new Error(`column must be 1 to ${ae.length+1}; got "${A}"`);(ae[Me]??=[]).push({name:g,options:{},...H}),ue=`Listed utility "${g}" in ${I} (column ${Me+1}).`}else if(a==="setup"){let ae=(X.setup??={}).steps??=[];if(ae.some(Me=>Me.name===g))return`${I} already lists setup step "${g}".`;ae.push({name:g}),ue=`Listed setup step "${g}" last in ${I}; the setup flow runs steps in that order.`}else{let ae=g.split("."),Me=X.navigations??=[],Fe;for(let Ee of ae.slice(0,-1)){if(Fe=Me.find(Ge=>Ge.name===Ee),!Fe)throw new Error(`${I} has no navigation "${ae.slice(0,ae.indexOf(Ee)+1).join(".")}" to add "${g}" under`);Me=Fe.children??=[]}let ke=ae[ae.length-1];if(Me.some(Ee=>Ee.name===ke))return`${I} already lists navigation "${g}".`;let Ie=ee.length?ee:Fe?.roles;Me.push({name:ke,...Ie?{roles:Ie}:{}}),ue=`Listed navigation "${g}" in ${I}.`}s.write(F,Mtt(W,$));let Q=tNt($);return s.write(Q.path,Q.content),ue}function f3n(s,a,p){if(a==="utility")return(s.utilities??[]).flat().some(E=>E.name===p);if(a==="setup")return(s.setup?.steps??[]).some(E=>E.name===p);let g=s.navigations??[];for(let E of p.split(".")){let A=g.find(I=>I.name===E);if(!A)return!1;g=A.children??[]}return!0}function Hjt(s,a,p){let g=o8e(s);return g.length?g.some(({kosJsonPath:E})=>f3n(JSON.parse(s.read(E)).kondra?.ncui??{},a,p)):Rtt.some(E=>[!1,!0].some(A=>f3n(Ott({layout:E,...Object.fromEntries(Object.keys(eNt).map(I=>[I,A]))}).ncui,a,p)))}var bPr=(s,a)=>new RegExp(`^${s.split("*").map(p=>p.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join(".*")}$`).test(a),_3n=/^\d+(\.\d+)?%$/,lrn=["left","right","center"],m3n=[...lrn,"full"];function h3n(s,a,p){if(!p)return[];let g=p.filter(I=>I!=="fit"&&!_3n.test(I)).map(I=>`${s} ${a} size "${I}" is not a share like "50%" or fit`),E=p.filter(I=>_3n.test(I)),A=E.reduce((I,F)=>I+parseFloat(F),0);return E.length>0&&Math.abs(A-100)>.5&&g.push(`${s} ${a} shares add up to ${A}%, not 100%`),g}function xPr(s,a,p){if(!s)return[];let g=s.regions??[],E=new Set(g.map(I=>I.name)),A=[];!s.layouts?.portrait&&!s.layouts?.landscape&&A.push("dashboard has no portrait or landscape layout, so the built-in one shows");for(let I of g)p&&I.component&&!p.includes(I.component)&&A.push(`region "${I.name}" component "${I.component}" is contributed by no plugin in the workspace, so the region shows its built-in cards`),I.justify!==void 0&&!m3n.includes(I.justify)&&A.push(`region "${I.name}" justify "${I.justify}" is not ${m3n.join(", ")}`);for(let[I,F]of Object.entries(s.layouts??{})){F?.justify!==void 0&&!lrn.includes(F.justify)&&A.push(`${I} justify "${F.justify}" is not ${lrn.join(", ")}`),A.push(...h3n(I,"column",F?.columns),...h3n(I,"row",F?.rows));let W=new Set((F?.areas??[]).flatMap(X=>X.trim().split(/\s+/)).filter(X=>!/^\.+$/.test(X)));for(let X of W)E.has(X)||A.push(`${I} area "${X}" is not a dashboard region`);let $=g.filter(X=>W.has(X.name));for(let X of a)$.some(H=>(H.summaries??[]).some(ue=>bPr(ue,X)))||A.push(`dashboard summary "${X}" is in no ${I} region, so it does not show`)}return A}function y3n(s,a,p){return o8e(s).flatMap(({name:g,kosJsonPath:E})=>xPr(JSON.parse(s.read(E)).kondra?.ncui?.dashboard,a,p).map(A=>({project:g,problem:A})))}var v3n=s=>s.component??s.name;function qjt(s,a){let p=o8e(s);return(p.length?p.map(({kosJsonPath:E})=>JSON.parse(s.read(E)).kondra?.ncui?.dashboard):Rtt.map(E=>Ott({layout:E}).ncui.dashboard)).some(E=>(E?.regions??[]).some(A=>v3n(A)===a))}function b3n(s,{project:a,key:p}){let{name:g,kosJsonPath:E}=g3n(s,a),A=s.read(E),I=JSON.parse(A),F=(I.kondra??={}).ncui??={},W=[];F.dashboard||(F.dashboard=Ott({layout:"standard"}).ncui.dashboard,W.push(`${g} had no dashboard; it now has the built-in standard one.`));let $=F.dashboard.regions??=[];if($.some(ee=>v3n(ee)===p))return`${g} already has a dashboard region rendered by "${p}".`;if($.some(ee=>ee.name===p))throw new Error(`${g} has a dashboard region named "${p}" with another component; choose another regionKey`);$.push({name:p});for(let ee of Object.values(F.dashboard.layouts??{})){let H=Math.max(1,...(ee.areas??[]).map(ue=>ue.trim().split(/\s+/).length));(ee.areas??=[]).push(Array(H).fill(p).join(" ")),ee.rows&&ee.rows.push("fit")}s.write(E,Mtt(A,I));let X=tNt(I);return s.write(X.path,X.content),[...W,`Added dashboard region "${p}" to ${g} as the full-width last row of each layout; it claims no holders or summaries, so the component reads the assembly. Move it in kondra.ncui.dashboard.layouts, or give it holders and summaries patterns.`].join(" ")}var SPr=[["utilities","utility","utilDescriptor"],["setupStep","setup","setupDescriptor"],["navViews","nav","navDescriptor"]];function x3n(s,{project:a,descriptorProject:p}){let g=Nge(s.root,a)?.root,E=g&&s.read(urn.join(g,".kos.json"));if(!E)throw new Error(`No plugin project "${a}" with a .kos.json`);let A=JSON.parse(E).kos?.ui?.plugin?.contributes??{},I=[];for(let[F,W,$]of SPr)for(let X of A[F]??[])if(X[$])try{I.push(drn(s,W,{project:p,slot:X[$]}))}catch(ee){I.push(`${X.id}: ${ee.message}`)}return{label:"DDK descriptor entries",notes:I.length?I:[`${a} contributes no utility, setup step or navigation slot.`]}}var S3n={cui:{pluginType:"ddk.cui",label:"DDK CUI Configuration",required:"cuiDescriptor",description:"Create a CUI configuration; --descriptor is the CUI's appId from /api/app/kosdev.ddk/cui"},setup:{pluginType:"ddk.setup",label:"DDK Setup Step",overridable:"setupDescriptor",listedIn:"kondra.ncui.setup.steps",descriptorType:"setup",description:"Create a setup step; --descriptor is its kondra.ncui.setup.steps entry (default: from the name)"},utility:{pluginType:"ddk.utility",label:"DDK Utility",overridable:"utilDescriptor",listedIn:"kondra.ncui.utilities",descriptorType:"utility",layouts:["maximized","fullscreen"],description:"Create a utility in a modal; --layout maximized (default) or fullscreen; --descriptor is its kondra.ncui.utilities entry (default: from the name)"},nav:{pluginType:"ddk.nav",label:"DDK Navigation View",overridable:"navDescriptor",listedIn:"kondra.ncui.navigations",descriptorType:"nav",slotRequired:!0,description:"Create a navigation view; --descriptor is its kondra.ncui.navigations entry, e.g. settings.water for a Settings tab"}},TPr={"ddk.cui":{proceed:"Proceed"},"ddk.setup":{proceed:"Proceed"},"ddk.utility":{back:"Back",close:"Close",done:"Done"},"ddk.dashboardDetail":{close:"Close"},"ddk.troubleAction":{resolve:"Resolve"}};function EPr(s,a,p){let g=TPr[a],E=Nge(s.root,p)?.sourceRoot;if(!g||!E)return;let A=$jt.join(E,"assets","locales","en",`${p}.json`);s.exists(A)&&Gjt(s,A,I=>({...g,...I}))}function Ftt(s,a,p){let g=Nge(s.root,a)?.root,E=g&&s.read($jt.join(g,".kos.json"));if(!E)return;let A=JSON.parse(E).kos?.ui?.plugin?.contributes?.experiences??{},I=k9e({name:p}).namePascalCase,F=Object.values(A).find(W=>[I,`${I}Summary`,`${I}Detail`].includes(W.component));if(F)throw new Error(`${a} already has a component ${F.component} (${F.location}); components are exposed by name, so choose another --name (kosui ddk:descriptor-entries lists an existing contribution's slot in a descriptor project)`)}function Btt(s,a){let p=k9e({name:a}).namePascalCase,g=[];for(let E of QIt(s.root).values()){let A=s.read($jt.join(E.root,".kos.json"));if(!A)continue;let I;try{I=JSON.parse(A).models}catch{continue}for(let[F,W]of Object.entries(I??{})){let $=W?.factory??k9e({name:F}).namePascalCase;$===p&&g.push(`WARNING: component ${p} has the same name as model ${F}'s registration bean ${$} (${E.name}). Choose another name, e.g. ${a}-config (${p}Config), before writing.`)}}return g}function s8e(s,a,{name:p,project:g,...E}){d3n();let A=Nge(s.root,g)?.root,I=A&&$jt.join(A,".kos.json"),F=I&&s.read(I);l3n(s,ZIt,{name:p,appProject:g,type:"components",pluginType:a,useEmotionCss:!1,appDirectory:"",modelDirectory:"",...E});let W=F&&s.read(I);W&&W!==F&&s.write(I,Mtt(F,JSON.parse(W))),EPr(s,a,g)}function Ltt(s,a){if(!s)throw new Error(`${a} is required`)}var jtt=s=>s===void 0?{}:{rank:s};function T3n(s,{type:a,name:p,project:g,descriptor:E,override:A,rank:I,descriptorProject:F,roles:W,column:$,layout:X}){let ee=S3n[a];if(!ee)throw new Error(`Unknown contribution type "${a}". Choose from ${Object.keys(S3n).join(", ")}.`);let H=A||I!==void 0&&I!=="";if(!ee.overridable&&H)throw new Error(`${a} contributions are not ranked; --override and --rank do not apply`);if(ee.required&&Ltt(E,`descriptor (${ee.required})`),X&&!ee.layouts)throw new Error(`${a} contributions have no layout; --layout does not apply`);if(X&&!ee.layouts.includes(X))throw new Error(`Unknown layout "${X}". Choose from ${ee.layouts.join(", ")}.`);let ue=ee.overridable?Ptt(a,{override:A,rank:I,explicit:{[ee.overridable]:E}}):{fields:{},notes:[]},Q=ue.fields[ee.overridable]??E;if(ee.slotRequired&&!Q&&Ltt(Q,`descriptor (${ee.overridable}, a kondra.ncui.navigations path such as settings.water)`),Ftt(s,g,p),F&&A)throw new Error("--override fills a slot the descriptor already lists; --descriptorProject does not apply");let ae=ee.listedIn&&!Q?[`${ee.overridable} "${k9e({name:p}).nameCamelCase}" comes from the name (--descriptor sets it).`]:[];s8e(s,ee.pluginType,{name:p,project:g,...Q?{descriptor:Q}:{},...jtt(ue.rank),...ee.layouts?{layout:X||ee.layouts[0]}:{}});let Me=ee.descriptorType?DPr(s,ee,{slot:Q||k9e({name:p}).nameCamelCase,override:A,descriptorProject:F,roles:W,column:$}):[];return{label:ee.label,notes:[...Btt(s,p),...ue.notes,...ae,...Me]}}function DPr(s,a,{slot:p,override:g,descriptorProject:E,roles:A,column:I}){if(g)return[];if(E)return[drn(s,a.descriptorType,{project:E,slot:p,roles:A,column:I})];if(Hjt(s,a.descriptorType,p))return[];let W=o8e(s).map($=>$.name);return[W.length?`No descriptor project lists ${a.overridable} "${p}"; add it with --descriptorProject ${W[0]}.`:`The NCUI shows "${p}" only if its descriptor (${a.listedIn}) lists it: create a descriptor project with kosui ddk:descriptor-project and pass --descriptorProject, or the system app's descriptor must list it.`]}function E3n(s,{name:a,project:p,dashboardKey:g,detail:E=!0,override:A,rank:I}){Ftt(s,p,a);let F=Ptt("dashboard-card",{override:A,rank:I,explicit:{dashboardKey:g}}),W=F.fields.dashboardKey??g;Ltt(W,"dashboardKey");let $={name:a,project:p,dashboardKey:W,...jtt(F.rank)};return s8e(s,"ddk.dashboardSummary",$),E&&s8e(s,"ddk.dashboardDetail",$),{label:E?"DDK Dashboard Card":"DDK Dashboard Summary",notes:[...Btt(s,a),`The dashboard draws one card per active model at assembly.${W} (or the FreestyleAssembly companion's ${W}); no such model, no card.`,...E?["The detail opens when a technician selects the card."]:[],...F.notes,...Vnn("dashboard-card",{override:A,rank:F.rank,slot:{dashboardKey:W},written:E?["dashboardSummary","dashboardDetail"]:["dashboardSummary"]})]}}function D3n(s,{name:a,project:p,dashboardKey:g,override:E,rank:A}){Ftt(s,p,a);let I=Ptt("pump-detail",{override:E,rank:A,explicit:{dashboardKey:g}}),F=I.fields.dashboardKey??g;return Ltt(F,"dashboardKey"),s8e(s,"ddk.pumpDetail",{name:a,project:p,dashboardKey:F,...jtt(I.rank)}),{label:"DDK Pump Detail",notes:[...Btt(s,a),`Shown in the holder modal for holders with dashboard key "${F}" (default: its first pump's type; a holder with several keys uses the first one that has a pump detail), unless the holder has its own content.`,...I.notes]}}function C3n(s,{name:a,project:p,dashboardKey:g,detail:E=!0,override:A,rank:I}){Ftt(s,p,a);let F=Ptt("pump-card",{override:A,rank:I,explicit:{dashboardKey:g}}),W=F.fields.dashboardKey??g;Ltt(W,"dashboardKey");let $={name:a,project:p,dashboardKey:W,...jtt(F.rank)};return s8e(s,"ddk.pumpSummary",$),E&&s8e(s,"ddk.pumpDetail",$),{label:E?"DDK Pump Card":"DDK Pump Summary",notes:[...Btt(s,a),`Used for holders with dashboard key "${W}" (default: the holder's first pump type, which the backend assembly assigns; a holder with several keys uses the first one that has a contribution); other holders keep the default card body.`,...E?["The detail shows in the holder modal a technician opens from the card."]:[],...F.notes,...Vnn("pump-card",{override:A,rank:F.rank,slot:{dashboardKey:W},written:E?["dashboardPumpSummary","dashboardPumpDetail"]:["dashboardPumpSummary"]})]}}function A3n(s,{name:a,project:p,dashboardKey:g,override:E,rank:A}){Ftt(s,p,a);let I=Ptt("macro-summary",{override:E,rank:A,explicit:{dashboardKey:g}}),F=I.fields.dashboardKey??g;return Ltt(F,"dashboardKey"),s8e(s,"ddk.macroSummary",{name:a,project:p,dashboardKey:F,...jtt(I.rank)}),{label:"DDK Macro Summary",notes:[...Btt(s,a),`Matched to a macro holder by holder.name "${F}" first, then by the dashboard key factory.`,...I.notes]}}function P3n(s,{name:a,project:p,regionKey:g,rank:E,descriptorProject:A}){Ftt(s,p,a);let I=g||k9e({name:a}).nameCamelCase;s8e(s,"ddk.dashboardRegion",{name:a,project:p,regionKey:I,claimsNothing:!!A,...jtt(Gnn(E))});let F=g?[]:[`regionKey "${I}" comes from the name (--regionKey sets it).`],W;if(A)W=b3n(s,{project:A,key:I});else if(qjt(s,I))W=`Renders the dashboard region "${I}" in place of its built-in cards.`;else{let $=o8e(s).map(X=>X.name);W=$.length?`No dashboard region in a descriptor project is rendered by "${I}"; add one with --descriptorProject ${$[0]}, or set a region's component to "${I}".`:`The dashboard shows "${I}" only if its descriptor (kondra.ncui.dashboard) has a region named "${I}" or with component "${I}": create a descriptor project with kosui ddk:descriptor-project and pass --descriptorProject.`}return{label:"DDK Dashboard Region",notes:[...Btt(s,a),...F,W]}}function k3n(s,{name:a,project:p,troubleType:g,stateKey:E,stateValue:A,override:I,rank:F}){Ftt(s,p,a);let W=Ptt("trouble-action",{override:I,rank:F,explicit:{troubleType:g,stateKey:E,stateValue:A}}),$=W.fields.troubleType??g;return Ltt($,"troubleType"),s8e(s,"ddk.troubleAction",{name:a,project:p,troubleType:$,stateKey:W.fields.stateKey??(E||$),stateValue:W.fields.stateValue??(A||$),...jtt(W.rank)}),{label:"DDK Trouble Action",notes:[...Btt(s,a),`troubleType "${$}" must be the exact type the device raises; the experience shows while one is active and goes away once it is resolved.`,...W.notes]}}import{spawnSync as CPr}from"node:child_process";import kme from"node:fs";import AX from"node:path";var APr="~3.1.0",I3n="kosdev.ddk",PPr=["@kosdev-code/kos-ddk","@kosdev-code/kos-ddk-components","@kosdev-code/kos-ddk-model-components","@kosdev-code/kos-ddk-models","@kosdev-code/kos-ddk-styles","@kosdev-code/kos-ddk-story-containers"],kPr={cui:[],utilities:[]},nNt=s=>JSON.parse(kme.readFileSync(s,"utf-8")),prn=(s,a)=>kme.writeFileSync(s,JSON.stringify(a,null,2)+`
48558
48558
  `);function N3n(s){let a=AX.join(ZIt,`${s}-project`);return kme.readdirSync(a,{recursive:!0,withFileTypes:!0}).filter(p=>p.isFile()).map(p=>AX.relative(a,AX.join(p.parentPath,p.name)).replace(/\.template$/,"")).sort()}function R3n(s,a){let p=AX.join(ZIt,`${s}-project`);for(let g of N3n(s)){let E=AX.join(a,g);kme.mkdirSync(AX.dirname(E),{recursive:!0}),kme.copyFileSync(AX.join(p,`${g}.template`),E)}}function wPr(s,a){R3n("plugin",a);let p=AX.join(a,".kos.json"),g=nNt(p),E=g.kos.ui.plugin;E.contributes={...kPr,...E.contributes},g.test={...g.test,plugin:{...g.test?.plugin,context:I3n}},prn(p,g);let A=AX.join(s,"package.json"),I=nNt(A),F={...I.dependencies,...I.devDependencies},W=PPr.filter($=>!F[$]);if(W.length){I.dependencies={...I.dependencies};for(let $ of W)I.dependencies[$]=APr;prn(A,I)}}function IPr(s,a){R3n("theme",a),kme.rmSync(AX.join(a,"theme","assets",".gitkeep"),{force:!0})}function NPr(s,a,{ncui:p}={}){let g=AX.join(a,".kos.json"),E=nNt(g);E.type=Vjt,E.kondra=Ott(p),prn(g,E);let A=tNt(E),I=AX.join(s,A.path);kme.mkdirSync(AX.dirname(I),{recursive:!0}),kme.writeFileSync(I,A.content)}var O3n={plugin:{generator:"@kosdev-code/kos-nx-plugin:kos-plugin-project",uiType:"ddk.ncui.plugin",overlay:wPr},theme:{generator:"@kosdev-code/kos-nx-plugin:kos-theme-project",uiType:"ddk.ncui.theme",overlay:IPr},descriptor:{generator:"@kosdev-code/kos-nx-plugin:kos-content-project",overlay:NPr}};function RPr(s,a,p,g={}){O3n[s].overlay(a,p,g)}function w3n(s){let a=nNt(AX.join(s,"package.json"));return{...a.dependencies,...a.devDependencies}}var M3n=s=>AX.join(s,".kos.json");function OPr(s){let a=M3n(s);return kme.existsSync(a)?nNt(a).development?.hosts??[]:[]}function MPr(s,a){return a||OPr(s).find(p=>p.pluginContext===I3n)?.name}function LPr(s,a){let p=M3n(s);if(!kme.existsSync(p))return;let g=kme.readFileSync(p,"utf-8"),E=JSON.parse(g),A=!1;for(let I of E.development?.hosts??[]){let F=(I.plugins??[]).filter(W=>W.project!==a);F.length!==(I.plugins??[]).length&&(I.plugins=F,A=!0)}A&&kme.writeFileSync(p,Mtt(g,E))}function L3n(s,{workspaceRoot:a,name:p,directory:g,host:E,ncui:A={},dryRun:I=!1,stdio:F="pipe"}){let W=O3n[s];s==="descriptor"&&Ott(A);let $=w3n(a),X=s==="plugin"?MPr(a,E):void 0,ee=CPr("npx",["nx","generate",W.generator,`--name=${p}`,...W.uiType?[`--uiType=${W.uiType}`]:[],...g?[`--directory=${g}`]:[],...X?[`--host=${X}`]:[],"--no-interactive",...I?["--dry-run"]:[]],{cwd:a,encoding:"utf-8",stdio:F,shell:process.platform==="win32"}),H=ee.stdout?.trim()??"",ue=I&&/does not support --dry-run/.test(H+(ee.stderr??""));if(ee.status!==0&&!ue)throw new Error(`nx generate exited with ${ee.status}
48559
48559
  ${[ee.stderr,H].filter(Boolean).join(`
48560
48560
  `)}`);if(I)return{output:ue?`${W.generator} creates project ${p}; it installs a missing Nx plugin on write, so Nx cannot list its files in a dry run.`:H,ddkFiles:s==="descriptor"?[`.kos.json: type ${Vjt}, kondra.ncui for the ${A.layout??"standard"} layout`,tNt({name:p}).path+": KosMock setup serving the descriptor"]:N3n(s)};let Q=Nge(a,p);if(!Q)throw new Error(`nx generate did not create project ${p}`);s==="plugin"&&!X&&LPr(a,p),RPr(s,a,AX.join(a,Q.root),{ncui:A});let ae=AX.join(a,"node_modules"),Me=Object.keys(w3n(a)).filter(Fe=>!$[Fe]&&!kme.existsSync(AX.join(ae,Fe)));return{output:H,root:Q.root,toInstall:Me}}import{existsSync as mrn,readFileSync as Jjt,readdirSync as zPr}from"node:fs";import c8e from"node:path";import{existsSync as F3n,readFileSync as FPr,readdirSync as BPr}from"node:fs";import MSe from"node:path";var jPr="ddk.ncui.plugin",WPr=new Set(["node_modules","dist","tmp",".git",".nx"]),jUr=process.env.DEV_LOG_DIR||"/tmp/kos-dev-logs";var frn=s=>JSON.parse(FPr(s,"utf-8"));function B3n(s,a){for(let p of BPr(s,{withFileTypes:!0}))p.isDirectory()&&!WPr.has(p.name)?B3n(MSe.join(s,p.name),a):p.name===".kos.json"&&s!==a.root&&a.files.push(MSe.join(s,p.name));return a.files}function _rn(s){let a=F3n(MSe.join(s,".kos.json"))?frn(MSe.join(s,".kos.json")):{},p=new Map((a.development?.hosts??[]).flatMap(g=>g.plugins??[]).map(g=>[g.project,g.alias]));return B3n(s,{root:s,files:[]}).filter(g=>frn(g).type===jPr).map(g=>{let E=MSe.join(MSe.dirname(g),"project.json"),A=F3n(E)?frn(E):{},I=A.name??MSe.basename(MSe.dirname(g));return{project:I,dir:MSe.relative(s,MSe.dirname(g)).split(MSe.sep).join("/"),alias:p.get(I),port:A.targets?.serve?.options?.port}}).sort((g,E)=>g.project.localeCompare(E.project))}var j3n=s=>JSON.parse(Jjt(s,"utf-8")),GPr=Object.fromEntries(Object.values(C9e).flatMap(({contributionKeys:s,keys:a})=>s.map(p=>[p,a])));function W3n(s,a){let p=_rn(s),g=p.find(I=>I.project===a||I.alias===a);if(!g)throw new Error(`No DDK plugin project "${a}". DDK plugin projects: ${p.map(I=>I.project).join(", ")||"none"}.`);let E=c8e.join(s,g.dir),A=j3n(c8e.join(E,".kos.json"));return{...g,absDir:E,block:A.kos?.ui?.plugin??{}}}var UPr=(s,a)=>Object.fromEntries((GPr[s]??[]).filter(p=>a[p]!==void 0).map(p=>[p,a[p]])),VPr=(s,a)=>{let p=Object.keys(s);return p.length>0&&p.length===Object.keys(a).length&&p.every(g=>s[g]===a[g])},HPr=(s,a)=>typeof s=="number"&&(typeof a!="number"||s<a);function hrn(s,a){let p=W3n(s,a),{extensionPoints:g}=ktt(),E=Qdt(Zdt()),A=p.block.contributes??{},I=A.experiences??{},F=[];for(let[W,$]of Object.entries(A)){if(!Array.isArray($))continue;let X=g.find(ee=>ee.contributionKey===W);for(let ee of $){let H=UPr(W,ee),ue=E.filter(ae=>ae.plugin!==p.project&&ae.contributionKey===W&&VPr(H,ae.keys)),Q=I[ee.experienceId];F.push({contributionKey:W,...X?{extensionPoint:X.id}:{},id:ee.id,...Object.keys(H).length?{slot:H}:{},...typeof ee.rank=="number"?{rank:ee.rank}:{},...Q?{component:Q.component,location:Q.location}:{},...ue.length?{sharesSlotWith:ue.map(ae=>({id:ae.id,...typeof ae.rank=="number"?{rank:ae.rank}:{},wins:HPr(ee.rank,ae.rank)}))}:{}})}}return{project:p.project,dir:p.dir,pluginId:p.block.id,contributions:F}}function z3n(s){return mrn(s)?zPr(s,{withFileTypes:!0}).flatMap(a=>{let p=c8e.join(s,a.name);return a.isDirectory()?a.name==="node_modules"?[]:z3n(p):/\.(tsx?|css)$/.test(a.name)?[p]:[]}):[]}var qPr=(s,a)=>/export\s+default\b/.test(s)||new RegExp(`export\\s+(const|let|function|class)\\s+${a}\\b`).test(s)||new RegExp(`export\\s*\\{[^}]*\\b${a}\\b[^}]*\\}`).test(s);function $Pr(s,a){return a===void 0||a===""?s.required?`missing required ${s.name}`:null:s.type.startsWith('"')?s.type.split(" | ").map(g=>JSON.parse(g)).includes(a)?null:`${s.name} must be ${s.type}`:["string","number","boolean"].includes(s.type)&&typeof a!==s.type?`${s.name} must be a ${s.type}`:null}function G3n(s,a){let p=W3n(s,a),{extensionPoints:g}=ktt(),E=hrn(s,a),A=p.block.contributes??{},I=A.experiences??{},F=[],W=[],$=new Map;for(let[Me,Fe]of Object.entries(A)){if(!Array.isArray(Fe))continue;let ke=g.find(Ie=>Ie.contributionKey===Me);for(let Ie of Fe){let Ee=`contributes.${Me} ${Ie.id??"(no id)"}`;Ie.id?$.has(Ie.id)?F.push(`${Ee}: id also used in contributes.${$.get(Ie.id)}`):$.set(Ie.id,Me):F.push(`${Ee}: missing id`);for(let Ge of ke?.fields??[]){if(Ge.name==="rank")continue;let Le=$Pr(Ge,Ie[Ge.name]);Le&&F.push(`${Ee}: ${Le} (${ke.id})`)}if(Ie.rank!==void 0&&(!Number.isInteger(Ie.rank)||Ie.rank<0||Ie.rank>KIt?F.push(`${Ee}: rank must be an integer from 0 to ${KIt}`):ke&&!ke.isRankable&&W.push(`${Ee}: ${ke.id} is not ranked, so rank has no effect`)),Ie.experienceId!==void 0||ke?.hasView){let Ge=I[Ie.experienceId];if(!Ge)F.push(`${Ee}: experience ${Ie.experienceId??"(none)"} is not in contributes.experiences`);else{let Le=c8e.join(p.absDir,Ge.location??"");!Ge.location||!mrn(Le)?F.push(`${Ee}: component file ${Ge.location} does not exist`):Ge.component&&!qPr(Jjt(Le,"utf-8"),Ge.component)&&F.push(`${Ee}: ${Ge.location} has no default export and does not export ${Ge.component}`)}}}}let X={root:s,read:Me=>{let Fe=c8e.join(s,Me);return mrn(Fe)?Jjt(Fe,"utf-8"):null}},ee=o8e(X).map(Me=>Me.name);for(let[Me,Fe,ke]of[["utilities","utility","utilDescriptor"],["setupStep","setup","setupDescriptor"],["navViews","nav","navDescriptor"]])for(let Ie of A[Me]??[]){let Ee=Ie[ke];!Ee||Hjt(X,Fe,Ee)||W.push(`contributes.${Me} ${Ie.id}: ${ke} "${Ee}" is not in ${ee.length?`descriptor project ${ee.join(", ")}`:"the standard NCUI descriptor (no descriptor project in the workspace)"}, so the NCUI does not show it${ee.length?`; list it with kosui ddk:descriptor-entries --project ${a} --descriptorProject ${ee[0]}`:""}`)}for(let Me of A.dashboardRegion??[])!Me.regionKey||qjt(X,Me.regionKey)||W.push(`contributes.dashboardRegion ${Me.id}: regionKey "${Me.regionKey}" is no region's component or name in ${ee.length?`descriptor project ${ee.join(", ")}`:"the built-in dashboard layout (no descriptor project in the workspace)"}, so the dashboard does not show it${ee.length?`; add it with kosui ddk:dashboard-region --descriptorProject ${ee[0]}`:""}`);let H=(A.dashboardSummary??[]).map(Me=>Me.dashboardKey).filter(Boolean),ue=_rn(s).flatMap(({dir:Me})=>(j3n(c8e.join(s,Me,".kos.json")).kos?.ui?.plugin?.contributes?.dashboardRegion??[]).map(Fe=>Fe.regionKey));for(let{project:Me,problem:Fe}of y3n(X,H,ue))W.push(`descriptor project ${Me}: ${Fe}`);let Q=new Map;for(let Me of E.contributions.filter(Fe=>Fe.slot)){let Fe=`${Me.contributionKey} ${JSON.stringify(Me.slot)}`,ke=Q.get(Fe);if(ke&&ke.rank===Me.rank&&W.push(`contributes.${Me.contributionKey} ${Me.id}: same slot and rank as ${ke.id}; which renders is not defined`),Q.set(Fe,Me),!Att().sources.includes(p.project))for(let Ie of Me.sharesSlotWith??[])Ie.wins||W.push(`contributes.${Me.contributionKey} ${Me.id}: shares a slot with ${Ie.id} (${typeof Ie.rank=="number"?`rank ${Ie.rank}`:"unranked"}) without a winning rank, so it does not replace it`)}let ae=c8e.join(p.absDir,"src");for(let Me of z3n(ae)){let Fe=Jjt(Me,"utf-8"),ke=c8e.relative(p.absDir,Me).split(c8e.sep).join("/"),Ie=[...new Set([...Fe.matchAll(/(--ddk-[\w-]+)\s*:/g)].map(Ee=>Ee[1]))];Ie.length&&F.push(`${ke}: sets DDK tokens (${Ie.join(", ")}); plugins compose DDK components and do not set tokens`)}return{project:p.project,ok:F.length===0,errors:F,warnings:W}}var JPr={type:"string",description:"Component name in kebab-case, e.g. fuel-level."},Xjt={type:"string",description:"DDK plugin project to write into."},brn={type:"boolean",description:"Default true: return the would-write files. false writes."},ept={type:"string",description:"Id of a standard contribution to replace (from list_ddk_contributions). Takes its slot with a winning rank."},tpt={type:"integer",description:"0-1000; lower wins. Default with override: 100, or one better than a ranked target."},grn={type:"string",description:"Assembly property whose models get the contribution, e.g. carbTank. Taken from override when given."},Wtt={name:JPr,project:Xjt,dryRun:brn,...Ydt};async function I9e(s,a){try{let p=JIt(s),g=await J7n({dryRun:s.dryRun!==!1,cwd:p,generate:a});return n8e(g.dryRun?{...g,hint:"Re-run with dryRun:false to write."}:g)}catch(p){return IAe(p.message)}}function Kjt(s,a,p,g={},E=[]){return{name:s,description:p,inputSchema:{type:"object",properties:{...Wtt,...g},required:["name","project",...E]},handler:A=>I9e(A,I=>T3n(I,{type:a,name:A.name,project:A.project,descriptor:A.descriptor,override:A.override,rank:A.rank,descriptorProject:A.descriptorProject,roles:A.roles,column:A.column,layout:A.layout}))}}var yrn=(s,a,p={})=>({descriptor:{type:"string",description:`${s}; shown only if the NCUI descriptor lists it (${a}). Default: from the name.`},descriptorProject:{type:"string",description:"NCUI descriptor project to list a new slot in (scaffold_ddk_descriptor_project)."},roles:{type:"string",description:"With descriptorProject: comma-separated roles that see it."},...p,override:ept,rank:tpt});function vrn(s,a,p){return{name:s,description:p,inputSchema:{type:"object",properties:{name:{type:"string",description:`${{plugin:"Plugin",theme:"Theme",descriptor:"Descriptor"}[a]} project name in kebab-case.`},...a==="descriptor"?{layout:{type:"string",enum:Rtt,description:"NCUI layout. Default: standard."},...Object.fromEntries(Object.entries(eNt).map(([g,E])=>[g,{type:"boolean",description:`Include ${E}.`}]))}:{},...a==="plugin"?{directory:{type:"string",description:"Parent folder of the project. Default: plugins."},host:{type:"string",description:"Workspace host to register with. Default: the host with the kosdev.ddk plugin context, else none."}}:{},dryRun:brn,...Ydt},required:["name"]},handler:async g=>{try{let E=g.dryRun!==!1,A=L3n(a,{workspaceRoot:JIt(g),name:g.name,directory:g.directory,host:g.host,ncui:{layout:g.layout,...Object.fromEntries(Object.keys(eNt).map(I=>[I,!!g[I]]))},dryRun:E});return n8e({dryRun:E,...A})}catch(E){return IAe(E.message)}}}}var U3n=[vrn("scaffold_ddk_plugin_project","plugin","Create a DDK plugin project: module federation serve target, DDK Storybook, .kos.json. dryRun lists the files."),vrn("scaffold_ddk_theme_project","theme","Create a DDK theme project; its theme-overlay.css overrides the DDK tokens. dryRun lists the files."),vrn("scaffold_ddk_descriptor_project","descriptor","Create an NCUI descriptor project (ddk.ncui.descriptor KAB) for a layout and options; list new utility, setup or nav slots in it. dryRun lists the files."),Kjt("add_utility","utility","Add a utility (utilities contribution) with its component, story and i18n title. The component renders in a modal through useUtilityModal.",yrn("utilDescriptor","kondra.ncui.utilities",{column:{type:"integer",description:"With descriptorProject: utilities column, 1-based. Default: the last."},layout:{type:"string",enum:["maximized","fullscreen"],description:"The utility's modal: maximized (default, a modal over the shell) or fullscreen (covers the display)."}})),Kjt("add_setup_step","setup","Add a setup step (setupStep contribution) with its component, story and i18n title.",yrn("setupDescriptor","kondra.ncui.setup.steps")),Kjt("add_nav_view","nav","Add a navigation view (navViews contribution) with its component, story and i18n title.",yrn("navDescriptor","kondra.ncui.navigations",{descriptor:{type:"string",description:"navDescriptor, a kondra.ncui.navigations path such as settings.water. Required unless override."}})),Kjt("add_cui_config","cui","Add a CUI configuration (cui contribution) with its component and story.",{descriptor:{type:"string",description:"cuiDescriptor: the CUI's appId from /api/app/kosdev.ddk/cui."}},["descriptor"]),{name:"add_dashboard_card",description:"Add a dashboard summary card and, by default, the detail it opens; both share dashboardKey and rank.",inputSchema:{type:"object",properties:{...Wtt,dashboardKey:grn,detail:{type:"boolean",description:"Also add the detail the card opens. Default true."},override:ept,rank:tpt},required:["name","project"]},handler:s=>I9e(s,a=>E3n(a,{name:s.name,project:s.project,dashboardKey:s.dashboardKey,detail:s.detail!==!1,override:s.override,rank:s.rank}))},{name:"add_pump_detail",description:"Add the pump detail shown in the holder modal for holders with dashboardKey.",inputSchema:{type:"object",properties:{...Wtt,dashboardKey:grn,override:ept,rank:tpt},required:["name","project"]},handler:s=>I9e(s,a=>D3n(a,{name:s.name,project:s.project,dashboardKey:s.dashboardKey,override:s.override,rank:s.rank}))},{name:"add_pump_card",description:"Add a pump card for a pump type: the holder card body and, by default, the pump detail; both share dashboardKey and rank.",inputSchema:{type:"object",properties:{...Wtt,dashboardKey:{type:"string",description:"The pump type the backend assembly assigns (the holder's first pump), e.g. cgp. Taken from override when given."},detail:{type:"boolean",description:"Also add the pump detail. Default true."},override:ept,rank:tpt},required:["name","project"]},handler:s=>I9e(s,a=>C3n(a,{name:s.name,project:s.project,dashboardKey:s.dashboardKey,detail:s.detail!==!1,override:s.override,rank:s.rank}))},{name:"add_macro_summary",description:"Add the macro holder card body for dashboardKey.",inputSchema:{type:"object",properties:{...Wtt,dashboardKey:grn,override:ept,rank:tpt},required:["name","project"]},handler:s=>I9e(s,a=>A3n(a,{name:s.name,project:s.project,dashboardKey:s.dashboardKey,override:s.override,rank:s.rank}))},{name:"add_dashboard_region",description:"Add a component that renders a whole dashboard region in place of its built-in cards: the descriptor region whose component (else name) is regionKey. A built-in region name such as macros replaces that region's cards.",inputSchema:{type:"object",properties:{...Wtt,regionKey:{type:"string",description:"The descriptor region's component, else its name. Default: from the name."},descriptorProject:{type:"string",description:"NCUI descriptor project to add the region to, as a full-width last row claiming no holders or summaries (scaffold_ddk_descriptor_project)."},rank:{type:"integer",description:"0-1000; lower wins among plugins rendering the same region."}},required:["name","project"]},handler:s=>I9e(s,a=>P3n(a,{name:s.name,project:s.project,regionKey:s.regionKey,rank:s.rank,descriptorProject:s.descriptorProject}))},{name:"add_trouble_action",description:"Add the experience shown while the device has an active trouble of troubleType.",inputSchema:{type:"object",properties:{...Wtt,troubleType:{type:"string",description:"Exact trouble type the device raises. Taken from override when given."},stateKey:{type:"string",description:"Contributions sharing a stateKey share one experience. Default: troubleType."},stateValue:{type:"string",description:"Default: troubleType."},override:ept,rank:tpt},required:["name","project"]},handler:s=>I9e(s,a=>k3n(a,{name:s.name,project:s.project,troubleType:s.troubleType,stateKey:s.stateKey,stateValue:s.stateValue,override:s.override,rank:s.rank}))},{name:"describe_ddk_plugin",description:"A DDK plugin project's contributions from its .kos.json: extension point, slot, rank, component, and which standard contributions it shares a slot with and beats.",inputSchema:{type:"object",properties:{project:Xjt,...Ydt},required:["project"]},handler:async s=>{try{return n8e(hrn(JIt(s),s.project))}catch(a){return IAe(a.message)}}},{name:"add_descriptor_entries",description:"List a plugin's existing utility, setup step and navigation slots in an NCUI descriptor project.",inputSchema:{type:"object",properties:{project:Xjt,descriptorProject:{type:"string",description:"NCUI descriptor project to list them in."},dryRun:brn,...Ydt},required:["project","descriptorProject"]},handler:s=>I9e(s,a=>x3n(a,{project:s.project,descriptorProject:s.descriptorProject}))},{name:"validate_ddk_plugin",description:"Check a DDK plugin project: contribution fields against each extension point's schema, ranks, experiences and their component files, overrides that do not win, and tokens set in plugin code.",inputSchema:{type:"object",properties:{project:Xjt,...Ydt},required:["project"]},handler:async s=>{try{return n8e(G3n(JIt(s),s.project))}catch(a){return IAe(a.message)}}},{name:"find_ddk_capability",description:"Map a plain-language need (e.g. replace the carb tank card) to the DDK extension points and components that cover it, with the resource and tool for each.",inputSchema:{type:"object",properties:{need:{type:"string",description:"What the plugin should do."}},required:["need"]},handler:async s=>{try{return n8e(n3n(s.need))}catch(a){return IAe(a.message)}}},{name:"list_ddk_components",description:"List the DDK components and styled parts plugins render, by name and source file.",inputSchema:{type:"object",properties:{library:{type:"string",enum:qnn,description:"Only this library."},query:{type:"string",description:"Words every match has in its name or path, e.g. dashboard card."}}},handler:async s=>{try{return n8e({components:e3n(s)})}catch(a){return IAe(a.message)}}},{name:"describe_ddk_component",description:"One DDK component or hook from its source. Component: props (inherited ones included), the components and hooks it uses, each token it reads per theme. Hook: signature, option fields, returned fields.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Export name, e.g. HolderDashboardCard or useUtilityModal."},library:{type:"string",enum:qnn,description:"Library, when both export the name."}},required:["name"]},handler:async s=>{try{let a=t3n(s.name,s.library);return a?{content:[{type:"text",text:a}]}:IAe(`No DDK component or hook named ${s.name}; list_ddk_components lists the components.`)}catch(a){return IAe(a.message)}}},{name:"list_ddk_contributions",description:"List the standard DDK contributions an override can replace, with each one's slot and rank, and the contribution keys each point writes. A pump detail is listed under both pump-detail and pump-card.",inputSchema:{type:"object",properties:{point:{type:"string",enum:Object.keys(C9e),description:"Only this command's contributions."}}},handler:async s=>{try{return n8e({points:Y7n(s.point||void 0),contributions:Zdt(s.point||void 0)})}catch(a){return IAe(a.message)}}}];await q7n(process.argv.slice(2),{name:"kos-ddk",version:K7n.version,tools:U3n,resources:Z7n()});
@@ -45,8 +45,14 @@ component content. Never hand-edit the contributions or experiences the tools wr
45
45
  Pump cards are keyed by pump type: the backend assembly assigns it to the holder's
46
46
  first pump, and the default dashboard key factory returns it. A new pump type is
47
47
  `add_pump_card` with `dashboardKey` set to that type (the card body and the pump
48
- detail); no factory is needed. A dashboard key factory is only for nonstandard
49
- cards keyed from another part of the assembly.
48
+ detail); no factory is needed. A dashboard key factory is for variants of a pump
49
+ type (e.g. `lfcv-x` from pump or holder properties) and for nonstandard cards keyed
50
+ from another part of the assembly. Register it in the plugin's `src/app/init.ts`
51
+ with `ExtensionManager.registerDashboardKeyFactory({ rank, factory })`, rank below
52
+ 999, returning `undefined` for holders it does not recognise. A holder gets every
53
+ key its factories return, lowest rank first, then its pump type; each card uses
54
+ the first key it has a contribution for, so `lfcv-x` holders fall back to the
55
+ `lfcv` summary or detail when the plugin contributes only one of them.
50
56
 
51
57
  6. **The NCUI descriptor.** A utility, setup step or nav view appears only if the
52
58
  device's NCUI descriptor lists its descriptor (`kondra.ncui` `utilities`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosdev-code/kos-ddk-cli",
3
- "version": "0.1.0-dev.88",
3
+ "version": "0.1.0-dev.91",
4
4
  "description": "DDK commands for kosui: plugin projects and DDK extension-point contributions.",
5
5
  "type": "module",
6
6
  "kosui": {
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "kos": {
29
29
  "build": {
30
- "gitHash": "ea0f5c4d750d31059f841b1b55f2af47b41f0edc"
30
+ "gitHash": "5a55097241d7df57a40bae804d2697febc8992df"
31
31
  }
32
32
  },
33
33
  "publishConfig": {
@@ -165,7 +165,7 @@
165
165
  "name": "dashboardKey",
166
166
  "type": "string",
167
167
  "required": true,
168
- "description": "Key used to match this extension with a macro holder. Tried in order: (1) holder.name (e.g. 'ns', 'water', 'carb'), (2) ExtensionManager.executeDashboardKeyFactory(holder) (default: holder.pumps.data[0]?.type, e.g. 'lfcv', 'cgp')."
168
+ "description": "Key used to match this extension with a macro holder. Tried in order: (1) holder.name (e.g. 'ns', 'water', 'carb'), (2) the holder's dashboard keys in order (registered key factories, lowest rank first, ending with holder.pumps.data[0]?.type, e.g. 'lfcv-x', 'lfcv')."
169
169
  },
170
170
  {
171
171
  "name": "rank",
@@ -205,7 +205,7 @@
205
205
  "name": "dashboardKey",
206
206
  "type": "string",
207
207
  "required": true,
208
- "description": "Key used to match this extension with specific dashboard pumps"
208
+ "description": "Key used to match this extension with dashboard pumps. A holder has an ordered list of dashboard keys (registered key factories, lowest rank first, ending with its first pump's type, e.g. 'lfcv-x', 'lfcv'); the first key with a contribution wins."
209
209
  },
210
210
  {
211
211
  "name": "rank",
@@ -246,7 +246,7 @@
246
246
  "name": "dashboardKey",
247
247
  "type": "string",
248
248
  "required": true,
249
- "description": "Key used to match this extension with dashboard pumps: the holder's dashboard key, by default its first pump's type (e.g. 'cgp', 'lfcv')."
249
+ "description": "Key used to match this extension with dashboard pumps. A holder has an ordered list of dashboard keys (registered key factories, lowest rank first, ending with its first pump's type, e.g. 'lfcv-x', 'lfcv'); the first key with a contribution wins."
250
250
  },
251
251
  {
252
252
  "name": "rank",
@@ -1466,7 +1466,7 @@
1466
1466
  {
1467
1467
  "name": "--ddk-component-dashboard-card-layout-columns",
1468
1468
  "values": {
1469
- "flex-eu": "minmax(0, min-content) auto auto 30px",
1469
+ "flex-eu": "max-content auto auto 30px",
1470
1470
  "compact": "60px auto 40px 30px"
1471
1471
  }
1472
1472
  },
@@ -3313,6 +3313,7 @@
3313
3313
  "package": "@kosdev-code/kos-ddk-components",
3314
3314
  "file": "src/components/dashboard-card/dashboard-card.tsx",
3315
3315
  "styled": true,
3316
+ "description": "Cuts the footer off with an ellipsis after two lines.",
3316
3317
  "props": [],
3317
3318
  "renders": [
3318
3319
  "CardAvatar",
@@ -3330,25 +3331,29 @@
3330
3331
  "useRef"
3331
3332
  ],
3332
3333
  "styles": [
3333
- {
3334
- "property": "align-items",
3335
- "value": "center"
3336
- },
3337
3334
  {
3338
3335
  "property": "grid-area",
3339
3336
  "value": "footer"
3340
3337
  },
3341
3338
  {
3342
3339
  "property": "display",
3343
- "value": "flex"
3340
+ "value": "-webkit-box"
3344
3341
  },
3345
3342
  {
3346
- "property": "font-size",
3347
- "value": "14px"
3343
+ "property": "-webkit-box-orient",
3344
+ "value": "vertical"
3348
3345
  },
3349
3346
  {
3350
- "property": "flex-wrap",
3351
- "value": "wrap"
3347
+ "property": "-webkit-line-clamp",
3348
+ "value": "2"
3349
+ },
3350
+ {
3351
+ "property": "overflow",
3352
+ "value": "hidden"
3353
+ },
3354
+ {
3355
+ "property": "font-size",
3356
+ "value": "14px"
3352
3357
  }
3353
3358
  ],
3354
3359
  "tokens": []
@@ -4198,7 +4203,7 @@
4198
4203
  {
4199
4204
  "name": "--ddk-component-dashboard-card-layout-columns",
4200
4205
  "values": {
4201
- "flex-eu": "minmax(0, min-content) auto auto 30px",
4206
+ "flex-eu": "max-content auto auto 30px",
4202
4207
  "compact": "60px auto 40px 30px"
4203
4208
  }
4204
4209
  },
@@ -6071,7 +6076,7 @@
6071
6076
  {
6072
6077
  "name": "--ddk-component-dashboard-card-layout-columns",
6073
6078
  "values": {
6074
- "flex-eu": "minmax(0, min-content) auto auto 30px",
6079
+ "flex-eu": "max-content auto auto 30px",
6075
6080
  "compact": "60px auto 40px 30px"
6076
6081
  }
6077
6082
  },
@@ -20969,21 +20974,21 @@
20969
20974
  "name": "ddk-extension-point-ddk.dashboard.macro-summary",
20970
20975
  "title": "Dashboard Macro Summary extension point",
20971
20976
  "description": "ddk.dashboard.macro-summary (contributes.dashboardMacroSummary): fields, the props its component receives and add_macro_summary.",
20972
- "body": "# Dashboard Macro Summary (`ddk.dashboard.macro-summary`)\n\nExtension point for plug-in supplied macro holder card summary content (the body shown on the dashboard, not the tap-detail modal)\n\n- Contribution key: `contributes.dashboardMacroSummary` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_macro_summary` (`kosui ddk:macro-summary`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-macro-summary-extension.ts` as `DashboardMacroSummaryExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.macro.summary\"` | yes | Extension type, must be 'dashboard.macro.summary' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with a macro holder. Tried in order: (1) holder.name (e.g. 'ns', 'water', 'carb'), (2) ExtensionManager.executeDashboardKeyFactory(holder) (default: holder.pumps.data[0]?.type, e.g. 'lfcv', 'cgp'). |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |"
20977
+ "body": "# Dashboard Macro Summary (`ddk.dashboard.macro-summary`)\n\nExtension point for plug-in supplied macro holder card summary content (the body shown on the dashboard, not the tap-detail modal)\n\n- Contribution key: `contributes.dashboardMacroSummary` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_macro_summary` (`kosui ddk:macro-summary`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-macro-summary-extension.ts` as `DashboardMacroSummaryExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.macro.summary\"` | yes | Extension type, must be 'dashboard.macro.summary' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with a macro holder. Tried in order: (1) holder.name (e.g. 'ns', 'water', 'carb'), (2) the holder's dashboard keys in order (registered key factories, lowest rank first, ending with holder.pumps.data[0]?.type, e.g. 'lfcv-x', 'lfcv'). |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |"
20973
20978
  },
20974
20979
  {
20975
20980
  "uri": "ddk://extension-point/ddk.dashboard.pump-detail",
20976
20981
  "name": "ddk-extension-point-ddk.dashboard.pump-detail",
20977
20982
  "title": "Dashboard Pump Detail extension point",
20978
20983
  "description": "ddk.dashboard.pump-detail (contributes.dashboardPumpDetail): fields, the props its component receives, standard contributions and add_pump_detail.",
20979
- "body": "# Dashboard Pump Detail (`ddk.dashboard.pump-detail`)\n\nExtension point for dashboard pump detail plugin configurations with view support\n\n- Contribution key: `contributes.dashboardPumpDetail` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_pump_detail` (`kosui ddk:pump-detail`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-pump-detail-extension.ts` as `DashboardPumpDetailExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.detail.pump\"` | yes | Extension type, must be 'dashboard.detail.pump' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with specific dashboard pumps |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |\n\n## Standard contributions\n\nOverride one by passing its id as `override` to the writing tool.\n\n| Id | Slot | Rank | Plugin |\n| --- | --- | --- | --- |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.CANSuperPump` | dashboardKey=microSuper | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.MicroPump` | dashboardKey=micro | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.cgp` | dashboardKey=cgp | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.fcm` | dashboardKey=fcm | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.lfcv` | dashboardKey=lfcv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.lfcvdv` | dashboardKey=lfcvdv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.msv` | dashboardKey=msv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.valve` | dashboardKey=valve | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.CANSuperPump` | dashboardKey=microSuper | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.MicroPump` | dashboardKey=micro | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.fcm` | dashboardKey=fcm | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.lfcv` | dashboardKey=lfcv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.lfcvdv` | dashboardKey=lfcvdv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.msv` | dashboardKey=msv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.valve` | dashboardKey=valve | unranked | kos-ddk-compact-plugin |"
20984
+ "body": "# Dashboard Pump Detail (`ddk.dashboard.pump-detail`)\n\nExtension point for dashboard pump detail plugin configurations with view support\n\n- Contribution key: `contributes.dashboardPumpDetail` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_pump_detail` (`kosui ddk:pump-detail`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-pump-detail-extension.ts` as `DashboardPumpDetailExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.detail.pump\"` | yes | Extension type, must be 'dashboard.detail.pump' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with dashboard pumps. A holder has an ordered list of dashboard keys (registered key factories, lowest rank first, ending with its first pump's type, e.g. 'lfcv-x', 'lfcv'); the first key with a contribution wins. |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |\n\n## Standard contributions\n\nOverride one by passing its id as `override` to the writing tool.\n\n| Id | Slot | Rank | Plugin |\n| --- | --- | --- | --- |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.CANSuperPump` | dashboardKey=microSuper | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.MicroPump` | dashboardKey=micro | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.cgp` | dashboardKey=cgp | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.fcm` | dashboardKey=fcm | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.lfcv` | dashboardKey=lfcv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.lfcvdv` | dashboardKey=lfcvdv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.msv` | dashboardKey=msv | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-standard-plugin.dashboard.pumpDetail.valve` | dashboardKey=valve | unranked | kos-ddk-standard-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.CANSuperPump` | dashboardKey=microSuper | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.MicroPump` | dashboardKey=micro | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.fcm` | dashboardKey=fcm | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.lfcv` | dashboardKey=lfcv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.lfcvdv` | dashboardKey=lfcvdv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.msv` | dashboardKey=msv | unranked | kos-ddk-compact-plugin |\n| `kos-ddk-compact-plugin.dashboard.pumpDetail.valve` | dashboardKey=valve | unranked | kos-ddk-compact-plugin |"
20980
20985
  },
20981
20986
  {
20982
20987
  "uri": "ddk://extension-point/ddk.dashboard.pump-summary",
20983
20988
  "name": "ddk-extension-point-ddk.dashboard.pump-summary",
20984
20989
  "title": "Dashboard Pump Summary extension point",
20985
20990
  "description": "ddk.dashboard.pump-summary (contributes.dashboardPumpSummary): fields, the props its component receives and add_pump_card.",
20986
- "body": "# Dashboard Pump Summary (`ddk.dashboard.pump-summary`)\n\nExtension point for the body of a holder's dashboard card by pump type; the card keeps its default body when none matches\n\n- Contribution key: `contributes.dashboardPumpSummary` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_pump_card` (`kosui ddk:pump-card`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-pump-summary-extension.ts` as `DashboardPumpSummaryExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.summary.pump\"` | yes | Extension type, must be 'dashboard.summary.pump' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with dashboard pumps: the holder's dashboard key, by default its first pump's type (e.g. 'cgp', 'lfcv'). |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |"
20991
+ "body": "# Dashboard Pump Summary (`ddk.dashboard.pump-summary`)\n\nExtension point for the body of a holder's dashboard card by pump type; the card keeps its default body when none matches\n\n- Contribution key: `contributes.dashboardPumpSummary` in the plugin's `.kos.json`.\n- Ranked: yes. The lowest rank wins a slot; an unranked contribution loses to any ranked one.\n- View: yes, each contribution names an experience that renders its component.\n- Written by: `add_pump_card` (`kosui ddk:pump-card`).\n- Defined in: `@kosdev-code/kos-ddk-model-components/src/extensions/dashboard-pump-summary-extension.ts` as `DashboardPumpSummaryExtension`.\n\n## Contribution fields\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | `\"dashboard.summary.pump\"` | yes | Extension type, must be 'dashboard.summary.pump' |\n| `dashboardKey` | `string` | yes | Key used to match this extension with dashboard pumps. A holder has an ordered list of dashboard keys (registered key factories, lowest rank first, ending with its first pump's type, e.g. 'lfcv-x', 'lfcv'); the first key with a contribution wins. |\n| `rank` | `number` | no | |\n\n## Props your component receives\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `holder` | `HolderModel` | no | |"
20987
20992
  },
20988
20993
  {
20989
20994
  "uri": "ddk://extension-point/ddk.dashboard.region",
@@ -368,7 +368,7 @@ export function generatePumpDetail(
368
368
  label: "DDK Pump Detail",
369
369
  notes: [
370
370
  ...beanCollisionNotes(codegenFs, name),
371
- `Shown in the holder modal when the dashboard key factory returns "${key}" for the holder (default: its first pump's type), unless the holder has its own content.`,
371
+ `Shown in the holder modal for holders with dashboard key "${key}" (default: its first pump's type; a holder with several keys uses the first one that has a pump detail), unless the holder has its own content.`,
372
372
  ...resolved.notes,
373
373
  ],
374
374
  };
@@ -406,7 +406,7 @@ export function generatePumpCard(
406
406
  label: detail ? "DDK Pump Card" : "DDK Pump Summary",
407
407
  notes: [
408
408
  ...beanCollisionNotes(codegenFs, name),
409
- `Used for holders whose dashboard key factory returns "${key}" (default: the holder's first pump type, which the backend assembly assigns); other holders keep the default card body.`,
409
+ `Used for holders with dashboard key "${key}" (default: the holder's first pump type, which the backend assembly assigns; a holder with several keys uses the first one that has a contribution); other holders keep the default card body.`,
410
410
  ...(detail
411
411
  ? [
412
412
  "The detail shows in the holder modal a technician opens from the card.",