@openbkn/workshop 0.2.2-rc.5 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +83 -13
  2. package/component.d.ts +10 -0
  3. package/dist/ActionConfirm-DJ91X3ml.js +236 -0
  4. package/dist/ActionFailure-ZgPt_3B-.js +37 -0
  5. package/dist/AgentChat-CRYai8ge.js +1062 -0
  6. package/dist/AppFormModal-D73ucaHK.js +4282 -0
  7. package/dist/AppListPage-D87piiOw.js +1364 -0
  8. package/dist/AskDrawer-BUMYsRnt.js +38 -0
  9. package/dist/ComputedView-CgYrDbx1.js +3221 -0
  10. package/dist/ConclusionApply-sjGfoEBY.js +153 -0
  11. package/dist/CypherEditor-lus6FA5L.js +485 -0
  12. package/dist/LandingList-6JI6864C.js +230 -0
  13. package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
  14. package/dist/ModelTrial-ClHFGTpQ.js +359 -0
  15. package/dist/PageRenderer-DBd_g6mN.js +85480 -0
  16. package/dist/README-DjRyTQSR.js +76 -0
  17. package/dist/ScenarioApply-DtW_hh47.js +590 -0
  18. package/dist/SimulateForm-C-i08Jjd.js +153 -0
  19. package/dist/Subgraph-CnrkH9AN.js +32586 -0
  20. package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
  21. package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
  22. package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
  23. package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
  24. package/dist/actionButton-DA5CNEzx.js +94 -0
  25. package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
  26. package/dist/agentChat-EoDznd58.js +116 -0
  27. package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
  28. package/dist/alertList-DqditwM8.js +84 -0
  29. package/dist/alertList.en-US-BAXAgltP.js +84 -0
  30. package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
  31. package/dist/asOfSlider-QPvHWUMV.js +83 -0
  32. package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
  33. package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
  34. package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
  35. package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
  36. package/dist/channel-B034hcOF.js +5 -0
  37. package/dist/china-C6m7zXIv.js +9 -0
  38. package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
  39. package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
  40. package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
  41. package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
  42. package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
  43. package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
  44. package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
  45. package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
  46. package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
  47. package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
  48. package/dist/component.d-DFoMKuUv.js +179 -0
  49. package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
  50. package/dist/customComponents-DasaZ6pq.js +4 -0
  51. package/dist/customComponents.en-US-CkabuCXg.js +79 -0
  52. package/dist/customParseFormat-C0uLEpdq.js +182 -0
  53. package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
  54. package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
  55. package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
  56. package/dist/d3-scale-DA8IHmf0.js +1841 -0
  57. package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
  58. package/dist/dateRange-BbkLMg8L.js +79 -0
  59. package/dist/dateRange.en-US-CV12Q02G.js +79 -0
  60. package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
  61. package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
  62. package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
  63. package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
  64. package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
  65. package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
  66. package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
  67. package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
  68. package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
  69. package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
  70. package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
  71. package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
  72. package/dist/eventList-CnsAwfDS.js +115 -0
  73. package/dist/eventList.en-US-Cof3rCLq.js +115 -0
  74. package/dist/eventReport-XS-HegnH.js +76 -0
  75. package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
  76. package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
  77. package/dist/ganttChart-DEeSvTJA.js +77 -0
  78. package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
  79. package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
  80. package/dist/generateCypher-Ch9_lQa6.js +399 -0
  81. package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
  82. package/dist/graph-CKJmgLki.js +1541 -0
  83. package/dist/index-BA-GzCXt.js +441 -0
  84. package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
  85. package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
  86. package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
  87. package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
  88. package/dist/katex-BsrBVQKd.js +11314 -0
  89. package/dist/manifest-BjV1PJ6u.js +41 -0
  90. package/dist/mermaid.core-yQghUlIz.js +17642 -0
  91. package/dist/metricCards-CSb-_cT2.js +104 -0
  92. package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
  93. package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
  94. package/dist/modelTrial-Bvb-RhGt.js +137 -0
  95. package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
  96. package/dist/models-DekiCOuZ.js +6 -0
  97. package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
  98. package/dist/object-metric.service-flZgBMRX.js +233 -0
  99. package/dist/objectDetail-SQUbp4Py.js +117 -0
  100. package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
  101. package/dist/objectList-D99wPtJH.js +97 -0
  102. package/dist/objectList.en-US-PBBNyVLW.js +97 -0
  103. package/dist/objectTable-0jsFFMN3.js +127 -0
  104. package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
  105. package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
  106. package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
  107. package/dist/pivotTable-CHmQw18-.js +102 -0
  108. package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
  109. package/dist/prompt-DYrjlEFr.js +373 -0
  110. package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
  111. package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
  112. package/dist/regionMap-Cme-JyV_.js +128 -0
  113. package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
  114. package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
  115. package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
  116. package/dist/scenarioBar-BV43p7n-.js +122 -0
  117. package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
  118. package/dist/scheduleGantt-CTYO-zYP.js +180 -0
  119. package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
  120. package/dist/searchBox-Ca7w0f_6.js +67 -0
  121. package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
  122. package/dist/segmentedFilter-MhjVcWo0.js +80 -0
  123. package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
  124. package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
  125. package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
  126. package/dist/stageChain-BxBafwjD.js +74 -0
  127. package/dist/stageChain.en-US-CP0G27n8.js +74 -0
  128. package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
  129. package/dist/subgraph-7n4SwliR.js +71 -0
  130. package/dist/subgraph.en-US-BNvY18IW.js +71 -0
  131. package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
  132. package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
  133. package/dist/taskInbox-DGWYeI2b.js +118 -0
  134. package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
  135. package/dist/text-BqSVQKS6.js +78 -0
  136. package/dist/text.en-US-BhAxy_LE.js +78 -0
  137. package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
  138. package/dist/trendChart-BjEeRS5_.js +135 -0
  139. package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
  140. package/dist/useLabData-Df-jEHKs.js +20470 -0
  141. package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
  142. package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
  143. package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
  144. package/dist/workshop-app-DnHNjBqy.js +86038 -0
  145. package/dist/workshop-app.css +1 -0
  146. package/dist/workshop-app.js +4 -0
  147. package/dist/world-Djau1JyJ.js +9 -0
  148. package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
  149. package/dist-cli/workshop.js +341 -218
  150. package/example/host.js +109 -0
  151. package/example/index.html +93 -0
  152. package/example/server.mjs +237 -0
  153. package/index.d.ts +48 -0
  154. package/lib/validate.js +47 -1
  155. package/package.json +17 -5
  156. package/runtime/frame-runtime.js +13 -1
  157. package/workshop-component.js +32 -12
  158. package/workshop.js +2 -0
@@ -0,0 +1,4 @@
1
+ const n = '# 自定义组件:开发与二次开发\n\n标准组件满足不了的展示与交互,可以自己开发组件,打成组件包上传到这个应用。组件跑在隔离的框架里,只能通过 Workshop 给的接口读数据、执行行动,拿不到登录信息,也不能随意联网。\n\n## 一 怎样开发一个组件\n\n1. **装开发包。** 在自己的项目里装 `@openbkn/workshop`(发布在公开 npm 源上,直接安装):\n\n ```bash\n npm install --save-dev @openbkn/workshop\n ```\n\n2. **新建组件包。** 目录名就是组件名,类型为 `x-<前缀>.<名称>`:\n\n ```bash\n npx workshop-component init supplier-ranking --prefix acme --label 供应商排行\n ```\n\n 生成四个文件:`manifest.json`(清单:类型、名称、配置项、数据角色、联动)、`index.js`(入口,定义一个自定义元素)、`preview.json`(本地预览用的示例数据)、`README.md`(组件说明,见第三节)。\n\n3. **本地预览。** `npx workshop-component dev supplier-ranking`,打开 `http://localhost:8765/`。组件在与 Workshop 相同的隔离框架里运行,可以切换主题、语言、宽度,模拟空结果、无权限和行动确认框。\n\n4. **校验并打包。** `npx workshop-component validate` 按上传时的检查校验;`npx workshop-component pack --out dist` 打出 zip。\n\n5. **上传。** 在左侧组件库「自定义组件」里点「上传组件包」。上传后组件会放到当前页面上,配置面板按清单生成;同一类型再次上传会换成新包。发布前,应用里用到的每个组件包都要能找到,否则发布会被拦下。\n\n## 二 组件能做什么、不能做什么\n\n| 能做 | 怎么做 |\n| --- | --- |\n| 显示数据源里的对象 | 配置项里的数据源与字段角色,组件从 `data` 拿到已经取好的行 |\n| 补查数据 | `workshop.query`:只读 Cypher,或在已有数据源里再筛选(见下文“取数与提问的现状”) |\n| 选中、筛选别的组件 | 清单 `emits` 声明后,写入共享筛选 |\n| 执行行动 | `workshop.act`:一定先弹 Workshop 的确认框,用户点确定才执行。行动有名为 `app_id` 的参数时,由 Workshop 填入当前应用的 ID,组件传的值不生效 |\n| 让页面的 Agent 读懂组件 | `workshop.describe`:告诉 Agent 组件现在显示什么 |\n| 向 Agent 提问 | `workshop.ask`:把问题交给页面上的 Agent 对话 |\n\n**取数与提问的现状。** 下面这些是现在的实际行为,写组件时按它来:\n\n- `query({ kind: "objects" })` 不查服务端,只在页面上已有的、这个对象类的数据源里筛选:页面没有这样的数据源时返回 `unavailable`;`where` 只支持等值条件;最多返回 5000 行,超出时 `truncated` 为 true。选中方案时,返回的是方案里的数据,与组件自己的 `data` 一致,计算列也一样算好。要查更多数据或更复杂的条件,用 Cypher。\n- `query({ kind: "cypher" })` 以使用者的身份查知识网络当前的数据,不带方案里的改动;拿不到页面数据源上的计算列。\n- `query({ kind: "metric" })` 还没有提供,调用会以 `unavailable` 拒绝。要用指标,先在页面上放指标卡,或把指标的结果放进数据源。\n- `ask` 只带问题,`context` 里的对象暂不发送;问题填进 Agent 对话的输入框,由使用者确认发送。页面上有 Agent 对话组件时交给它;没有时在页面旁边的抽屉里打开一个对话,关掉抽屉对话还在,下次提问再打开。\n- 配置项里没有 `x-workshop` 控件的数组、对象,配置面板不显示,可以在应用的 `app.yaml` 里直接写,组件拿到写的值或清单里的默认值;应用校验只检查它是数组还是对象。\n\n不能做:读写浏览器存储与 Cookie;访问清单没有声明的网络地址;绕过确认框执行行动;在构建器设计和预览时执行行动或打开页面;拿使用者的令牌,或以使用者的身份做上表以外的事(比如建分析画布)。清单 `network` 里声明的地址可以访问,但请求不带使用者的身份。\n\n包的限制:总大小 5 MB、最多 500 个文件,入口建议不超过 300 KB;只收 js、css、json、svg、png、jpg、webp、woff2、md 文件。\n\n## 三 每个组件都要附说明\n\n组件包里放一份 `README.md`,上传后在组件库和配置面板上点「说明」就能看到,构建应用的人和 AI 都靠它配置组件。没有说明的包,校验时会给出提醒。\n\n说明按下面的标题写,没有内容的节写“无”:\n\n- **概述**:写在标题下的第一段,说明展示什么、用来做什么决策。\n- **适用与不适用**:不适用时改用什么。\n- **本体契约**:组件里有哪些角色(如“项”“资源”“任务”),每个角色要哪类对象、哪些属性、哪些关系、是否必填。\n- **组件内置的判断**:组件自己做的、与行业无关的检查,是硬约束还是只标出。\n- **扩展点**:场景判断从哪里接进来,接逻辑属性、指标还是规则工具,输入输出是什么。\n- **交互与联动**:写入、读取哪些筛选,能触发哪些行动。\n- **场景配方**:每个场景怎样对应角色、要在知识网络里补什么、扩展点挂什么。\n- **给 AI 的指引**:配置步骤、先问用户什么、常见错误。\n- **限制**:数量上限、不支持的情况。\n\n## 四 二次开发建议\n\n- **业务判断放在知识网络里,不写进组件。** “是否超期”“是否齐套”“风险高低”这类判断,写成知识网络的属性、逻辑属性、指标或规则工具,组件只读结果。这样同一个问题在各处答案一致,改规则不用改组件。\n- **组件只做通用能力。** 排行、矩阵、甘特、拖动、重叠检查这类与行业无关的展示和交互放在组件里;行业规则通过扩展点接进来。\n- **为新场景复用组件,先改知识网络。** 按说明里的本体契约把场景对象对应到组件角色,缺的对象、属性、关系在知识网络里补;再把场景判断挂到扩展点上。\n- **不要写死对象类和属性名。** 对象类、关系、字段都从配置项和数据源里取,不要在代码里写死 `supplier` 这样的名字,换一个网络组件照样能用。\n- **改数据只走行动。** 组件不直接写数据,需要改动时调用知识网络的行动,用户在确认框里确认。\n- **让 Agent 能读懂。** 用 `describe` 报告组件当前显示的内容和选中项,页面上的 Agent 才能基于它回答问题。\n- **说明与代码一起改。** 配置项、上限、扩展点变了,同一次改动更新 `README.md`,并把清单里的版本号加一。\n- **AI 生成或修改组件时也一样。** 缺判断时补知识网络,不补代码。\n';
2
+ export {
3
+ n as default
4
+ };
@@ -0,0 +1,79 @@
1
+ const e = `# Custom components: building and extending
2
+
3
+ When the standard components cannot show or do what you need, you can build your own component, pack it and upload it to this app. It runs in an isolated frame: it reads data and runs actions only through what Workshop gives it, never sees the sign-in, and cannot reach the network freely.
4
+
5
+ ## 1 Building a component
6
+
7
+ 1. **Install the package.** In your own project, install \`@openbkn/workshop\` (published on the public npm registry):
8
+
9
+ \`\`\`bash
10
+ npm install --save-dev @openbkn/workshop
11
+ \`\`\`
12
+
13
+ 2. **Create a package.** The folder name is the component's name; its type is \`x-<prefix>.<name>\`:
14
+
15
+ \`\`\`bash
16
+ npx workshop-component init supplier-ranking --prefix acme --label "Supplier ranking"
17
+ \`\`\`
18
+
19
+ It writes four files: \`manifest.json\` (type, name, settings, data roles, links), \`index.js\` (the entry, which defines a custom element), \`preview.json\` (sample data for the local preview) and \`README.md\` (the component's guide, see section 3).
20
+
21
+ 3. **Preview it locally.** Run \`npx workshop-component dev supplier-ranking\` and open \`http://localhost:8765/\`. The component runs in the same isolated frame as in Workshop; you can switch theme, language and width, and try empty results, a refused query and the action confirmation.
22
+
23
+ 4. **Check and pack.** \`npx workshop-component validate\` runs the checks an upload runs; \`npx workshop-component pack --out dist\` writes the zip.
24
+
25
+ 5. **Upload.** In the library on the left, under Custom components, choose Upload package. The component is placed on the current page and its settings are drawn from the manifest; uploading the same type again replaces its package. Before publishing, every package the app uses must be found, or the publish is stopped.
26
+
27
+ ## 2 What a component can and cannot do
28
+
29
+ | Can | How |
30
+ | --- | --- |
31
+ | Show the objects of a data source | The data source and field roles in its settings; the component gets the rows in \`data\` |
32
+ | Look up more data | \`workshop.query\`: read-only Cypher, or a filter over an existing data source (see "What lookups and questions do today" below) |
33
+ | Select or filter for other components | Declared in the manifest's \`emits\`, written to the shared filters |
34
+ | Run an action | \`workshop.act\`: Workshop always asks for confirmation first. When the action has a parameter named \`app_id\`, Workshop fills in the current app's ID and ignores any value the component passes |
35
+ | Let the page's Agent understand it | \`workshop.describe\`: tells the Agent what the component shows now |
36
+ | Ask the Agent | \`workshop.ask\`: hands a question to the page's Agent chat |
37
+
38
+ **What lookups and questions do today.** This is how they behave now; write components for it:
39
+
40
+ - \`query({ kind: "objects" })\` does not go to the server: it filters the page's own data source of that object type. With no such source on the page it rejects with \`unavailable\`; \`where\` takes equal values only; at most 5000 rows come back, with \`truncated\` true when there were more. With a scenario picked, the rows are the scenario's, as in the component's own \`data\`, computed columns worked out the same way. For more data or other conditions, use Cypher.
41
+ - \`query({ kind: "cypher" })\` reads the network's current data as the user, without a scenario's changes, and without the computed columns of the page's data sources.
42
+ - \`query({ kind: "metric" })\` is not offered yet and rejects with \`unavailable\`. To use a metric, put a metric card on the page, or its results in a data source.
43
+ - \`ask\` sends only the question; the objects in \`context\` are not sent yet. The question goes into the Agent chat's input box for the user to send. A page with an Agent chat component gets it there; without one, a chat opens in a drawer beside the page, which keeps the conversation when closed and opens again on the next question.
44
+ - Array and object settings with no \`x-workshop\` widget are not in the settings panel: write them in the app's \`app.yaml\`, and the component gets what is written or the manifest's default; the app's check only sees that each is an array or an object.
45
+
46
+ It cannot: use browser storage or cookies; reach addresses its manifest does not declare; run an action without the confirmation; run actions or open pages while the app is designed or previewed in the builder; get the user's token, or act as the user beyond the table above (it cannot create an analysis canvas, for one). The addresses its manifest's \`network\` declares can be reached, but the requests do not carry the user's identity.
47
+
48
+ Package limits: 5 MB in all, at most 500 files, an entry of 300 KB or less is advised; only js, css, json, svg, png, jpg, webp, woff2 and md files.
49
+
50
+ ## 3 Every component comes with a guide
51
+
52
+ Put a \`README.md\` in the package. After the upload, Guide in the library and in the settings panel shows it; people and the AI building the app configure the component by it. A package without one gets a warning when checked.
53
+
54
+ Write it under these headings, with "None" under a heading that has nothing:
55
+
56
+ - **One sentence**: what it shows and which decision it serves.
57
+ - **When to use it and when not**: and what to use instead.
58
+ - **Ontology contract**: the component's roles (such as item, resource, task), and for each the object type, properties and relations it needs, and whether it is required.
59
+ - **Built-in checks**: what the component checks by itself, regardless of business, and whether a check blocks or only marks.
60
+ - **Extension points**: where a business's rules plug in, whether a logic property, a metric or a rule tool, with its inputs and outputs.
61
+ - **Interaction and links**: which filters it writes and reads, which actions it can run.
62
+ - **Recipes**: for each business, how its objects map to the roles, what to add to the network and what to plug in.
63
+ - **Guidance for AI**: the steps to configure it, what to ask the user first, common mistakes.
64
+ - **Limits**: maximum counts and what is not supported.
65
+
66
+ ## 4 Advice for extending
67
+
68
+ - **Business rules live in the knowledge network, not in the component.** Judgments such as "overdue", "fully kitted" or "high risk" are properties, logic properties, metrics or rule tools of the network; the component only reads their results. The same question then gets the same answer everywhere, and a rule changes without touching the component.
69
+ - **A component does what any business needs.** Rankings, matrices, Gantt charts, dragging and overlap checks belong in the component; a business's rules come in through extension points.
70
+ - **To use a component in a new business, change the network first.** Map the business's objects to the component's roles by the ontology contract, add the missing objects, properties and relations to the network, then plug the business's rules into the extension points.
71
+ - **Don't hard-code object types or property names.** Take object types, relations and fields from the settings and the data source rather than writing names such as \`supplier\` in the code, so the component works with another network.
72
+ - **Change data only through actions.** A component does not write data; it runs the network's actions, which the user confirms.
73
+ - **Let the Agent read it.** Report what the component shows and what is selected with \`describe\`, so the page's Agent can answer from it.
74
+ - **Change the guide with the code.** When settings, limits or extension points change, update \`README.md\` in the same change and raise the manifest's version.
75
+ - **The same holds when the AI builds or changes a component.** When a rule is missing, add it to the network, not to the code.
76
+ `;
77
+ export {
78
+ e as default
79
+ };
@@ -0,0 +1,182 @@
1
+ import { N as J } from "./workshop-app-DnHNjBqy.js";
2
+ var P = { exports: {} }, it = P.exports, B;
3
+ function ut() {
4
+ return B || (B = 1, (function(C, K) {
5
+ (function(S, g) {
6
+ C.exports = g();
7
+ })(it, (function() {
8
+ return function(S, g) {
9
+ var F = g.prototype, v = F.format;
10
+ F.format = function(s) {
11
+ var a = this, u = this.$locale();
12
+ if (!this.isValid()) return v.bind(this)(s);
13
+ var k = this.$utils(), o = (s || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(p) {
14
+ switch (p) {
15
+ case "Q":
16
+ return Math.ceil((a.$M + 1) / 3);
17
+ case "Do":
18
+ return u.ordinal(a.$D);
19
+ case "gggg":
20
+ return a.weekYear();
21
+ case "GGGG":
22
+ return a.isoWeekYear();
23
+ case "wo":
24
+ return u.ordinal(a.week(), "W");
25
+ case "w":
26
+ case "ww":
27
+ return k.s(a.week(), p === "w" ? 1 : 2, "0");
28
+ case "W":
29
+ case "WW":
30
+ return k.s(a.isoWeek(), p === "W" ? 1 : 2, "0");
31
+ case "k":
32
+ case "kk":
33
+ return k.s(String(a.$H === 0 ? 24 : a.$H), p === "k" ? 1 : 2, "0");
34
+ case "X":
35
+ return Math.floor(a.$d.getTime() / 1e3);
36
+ case "x":
37
+ return a.$d.getTime();
38
+ case "z":
39
+ return "[" + a.offsetName() + "]";
40
+ case "zzz":
41
+ return "[" + a.offsetName("long") + "]";
42
+ default:
43
+ return p;
44
+ }
45
+ }));
46
+ return v.bind(this)(o);
47
+ };
48
+ };
49
+ }));
50
+ })(P)), P.exports;
51
+ }
52
+ var ct = ut();
53
+ const vt = /* @__PURE__ */ J(ct);
54
+ var Z = { exports: {} }, ft = Z.exports, I;
55
+ function ht() {
56
+ return I || (I = 1, (function(C, K) {
57
+ (function(S, g) {
58
+ C.exports = g();
59
+ })(ft, (function() {
60
+ var S = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, g = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, F = /\d/, v = /\d\d/, s = /\d\d?/, a = /\d*[^-_:/,()\s\d]+/, u = {}, k = function(t) {
61
+ return (t = +t) + (t > 68 ? 1900 : 2e3);
62
+ }, o = function(t) {
63
+ return function(r) {
64
+ this[t] = +r;
65
+ };
66
+ }, p = [/[+-]\d\d:?(\d\d)?|Z/, function(t) {
67
+ (this.zone || (this.zone = {})).offset = (function(r) {
68
+ if (!r || r === "Z") return 0;
69
+ var e = r.match(/([+-]|\d\d)/g), n = 60 * e[1] + (+e[2] || 0);
70
+ return n === 0 ? 0 : e[0] === "+" ? -n : n;
71
+ })(t);
72
+ }], E = function(t) {
73
+ var r = u[t];
74
+ return r && (r.indexOf ? r : r.s.concat(r.f));
75
+ }, R = function(t, r) {
76
+ var e, n = u.meridiem;
77
+ if (n) {
78
+ for (var h = 1; h <= 24; h += 1) if (t.indexOf(n(h, 0, r)) > -1) {
79
+ e = h > 12;
80
+ break;
81
+ }
82
+ } else e = t === (r ? "pm" : "PM");
83
+ return e;
84
+ }, tt = { A: [a, function(t) {
85
+ this.afternoon = R(t, !1);
86
+ }], a: [a, function(t) {
87
+ this.afternoon = R(t, !0);
88
+ }], Q: [F, function(t) {
89
+ this.month = 3 * (t - 1) + 1;
90
+ }], S: [F, function(t) {
91
+ this.milliseconds = 100 * +t;
92
+ }], SS: [v, function(t) {
93
+ this.milliseconds = 10 * +t;
94
+ }], SSS: [/\d{3}/, function(t) {
95
+ this.milliseconds = +t;
96
+ }], s: [s, o("seconds")], ss: [s, o("seconds")], m: [s, o("minutes")], mm: [s, o("minutes")], H: [s, o("hours")], h: [s, o("hours")], HH: [s, o("hours")], hh: [s, o("hours")], D: [s, o("day")], DD: [v, o("day")], Do: [a, function(t) {
97
+ var r = u.ordinal, e = t.match(/\d+/);
98
+ if (this.day = e[0], r) for (var n = 1; n <= 31; n += 1) r(n).replace(/\[|\]/g, "") === t && (this.day = n);
99
+ }], w: [s, o("week")], ww: [v, o("week")], M: [s, o("month")], MM: [v, o("month")], MMM: [a, function(t) {
100
+ var r = E("months"), e = (E("monthsShort") || r.map((function(n) {
101
+ return n.slice(0, 3);
102
+ }))).indexOf(t) + 1;
103
+ if (e < 1) throw new Error();
104
+ this.month = e % 12 || e;
105
+ }], MMMM: [a, function(t) {
106
+ var r = E("months").indexOf(t) + 1;
107
+ if (r < 1) throw new Error();
108
+ this.month = r % 12 || r;
109
+ }], Y: [/[+-]?\d+/, o("year")], YY: [v, function(t) {
110
+ this.year = k(t);
111
+ }], YYYY: [/\d{4}/, o("year")], Z: p, ZZ: p };
112
+ function rt(t) {
113
+ var r, e;
114
+ r = t, e = u && u.formats;
115
+ for (var n = (t = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(x, M, f) {
116
+ var c = f && f.toUpperCase();
117
+ return M || e[f] || S[f] || e[c].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(Y, w, $) {
118
+ return w || $.slice(1);
119
+ }));
120
+ }))).match(g), h = n.length, d = 0; d < h; d += 1) {
121
+ var z = n[d], D = tt[z], m = D && D[0], l = D && D[1];
122
+ n[d] = l ? { regex: m, parser: l } : z.replace(/^\[|\]$/g, "");
123
+ }
124
+ return function(x) {
125
+ for (var M = {}, f = 0, c = 0; f < h; f += 1) {
126
+ var Y = n[f];
127
+ if (typeof Y == "string") c += Y.length;
128
+ else {
129
+ var w = Y.regex, $ = Y.parser, A = x.slice(c), y = w.exec(A)[0];
130
+ $.call(M, y), x = x.replace(y, "");
131
+ }
132
+ }
133
+ return (function(L) {
134
+ var T = L.afternoon;
135
+ if (T !== void 0) {
136
+ var i = L.hours;
137
+ T ? i < 12 && (L.hours += 12) : i === 12 && (L.hours = 0), delete L.afternoon;
138
+ }
139
+ })(M), M;
140
+ };
141
+ }
142
+ return function(t, r, e) {
143
+ e.p.customParseFormat = !0, t && t.parseTwoDigitYear && (k = t.parseTwoDigitYear);
144
+ var n = r.prototype, h = n.parse;
145
+ n.parse = function(d) {
146
+ var z = d.date, D = d.utc, m = d.args;
147
+ this.$u = D;
148
+ var l = m[1];
149
+ if (typeof l == "string") {
150
+ var x = m[2] === !0, M = m[3] === !0, f = x || M, c = m[2];
151
+ M && (c = m[2]), u = this.$locale(), !x && c && (u = e.Ls[c]), this.$d = (function(A, y, L, T) {
152
+ try {
153
+ if (["x", "X"].indexOf(y) > -1) return new Date((y === "X" ? 1e3 : 1) * A);
154
+ var i = rt(y)(A), O = i.year, W = i.month, et = i.day, nt = i.hours, at = i.minutes, ot = i.seconds, st = i.milliseconds, V = i.zone, _ = i.week, b = /* @__PURE__ */ new Date(), q = et || (O || W ? 1 : b.getDate()), Q = O || b.getFullYear(), H = 0;
155
+ O && !W || (H = W > 0 ? W - 1 : b.getMonth());
156
+ var G, X = nt || 0, j = at || 0, N = ot || 0, U = st || 0;
157
+ return V ? new Date(Date.UTC(Q, H, q, X, j, N, U + 60 * V.offset * 1e3)) : L ? new Date(Date.UTC(Q, H, q, X, j, N, U)) : (G = new Date(Q, H, q, X, j, N, U), _ && (G = T(G).week(_).toDate()), G);
158
+ } catch {
159
+ return /* @__PURE__ */ new Date("");
160
+ }
161
+ })(z, l, D, e), this.init(), c && c !== !0 && (this.$L = this.locale(c).$L), f && z != this.format(l) && (this.$d = /* @__PURE__ */ new Date("")), u = {};
162
+ } else if (l instanceof Array) for (var Y = l.length, w = 1; w <= Y; w += 1) {
163
+ m[1] = l[w - 1];
164
+ var $ = e.apply(this, m);
165
+ if ($.isValid()) {
166
+ this.$d = $.$d, this.$L = $.$L, this.init();
167
+ break;
168
+ }
169
+ w === Y && (this.$d = /* @__PURE__ */ new Date(""));
170
+ }
171
+ else h.call(this, d);
172
+ };
173
+ };
174
+ }));
175
+ })(Z)), Z.exports;
176
+ }
177
+ var dt = ht();
178
+ const pt = /* @__PURE__ */ J(dt);
179
+ export {
180
+ vt as a,
181
+ pt as d
182
+ };