@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,179 @@
1
+ const e = `// Copyright openbkn.ai. All rights reserved.
2
+ // Proprietary — OpenBKN Enterprise Edition. See LICENSE in the repository root.
3
+
4
+ // The contract between Workshop and a custom component: the custom component spec, sections 3,
5
+ // 4 and 6. Types only, imported from "@openbkn/workshop/component"; there is no code behind it.
6
+
7
+ export type FieldType = "string" | "number" | "boolean" | "date" | "datetime" | "object";
8
+
9
+ export type ObjectRef = { type: string; id: string };
10
+
11
+ export type DataField = { key: string; label?: string; type: FieldType };
12
+
13
+ /** A data source's result as the user may see it: fields without permission are left out. */
14
+ export type WorkshopData = {
15
+ fields: DataField[];
16
+ /** Rows from objects carry \`_object\`; rows from aggregations do not. */
17
+ rows: Array<Record<string, unknown> & { _object?: ObjectRef }>;
18
+ total: number;
19
+ /** Cut to the first rows; say "showing the first N". */
20
+ truncated: boolean;
21
+ asOf: string;
22
+ };
23
+
24
+ export type WorkshopTheme = {
25
+ mode: "light" | "dark";
26
+ colorPrimary?: string;
27
+ colorAccent?: string;
28
+ colorBg?: string;
29
+ colorSurface?: string;
30
+ colorSurfaceAlt?: string;
31
+ colorBorder?: string;
32
+ colorText?: string;
33
+ colorTextMuted?: string;
34
+ colorSuccess?: string;
35
+ colorWarning?: string;
36
+ colorDanger?: string;
37
+ colorInfo?: string;
38
+ fontFamily?: string;
39
+ /** Pixels; also set as --workshop-font-size. */
40
+ fontSize?: number;
41
+ /** Pixels; also set as --workshop-radius. */
42
+ radius?: number;
43
+ };
44
+
45
+ export type WorkshopMode = "run" | "design" | "preview";
46
+
47
+ /**
48
+ * A lookup as the user. \`objects\` filters the page's own data source of the object type (no
49
+ * request to the server): equal values only in \`where\`, at most 5000 rows, the scenario's rows
50
+ * while one is picked. \`cypher\` reads the network's current data, read-only. \`metric\` is not
51
+ * offered yet: it rejects with \`unavailable\`.
52
+ */
53
+ export type QueryRequest =
54
+ | {
55
+ kind: "objects";
56
+ objectType: string;
57
+ where?: Record<string, unknown>;
58
+ properties?: string[];
59
+ limit?: number;
60
+ }
61
+ | { kind: "cypher"; statement: string; params?: Record<string, unknown> }
62
+ | {
63
+ kind: "metric";
64
+ metric: string;
65
+ groupBy?: string[];
66
+ timeRange?: { last: string } | { from: string; to: string };
67
+ };
68
+
69
+ export type ActRequest = {
70
+ actionType: string;
71
+ objects?: ObjectRef[];
72
+ /** Only the parameters the user fills; they may change them in the confirmation. */
73
+ params?: Record<string, unknown>;
74
+ };
75
+
76
+ /** \`failed\`: how many objects did not run; when none ran, act ends in a \`failed\` error. */
77
+ export type ActResult = { status: "submitted" | "pending_approval"; executionIds?: string[]; failed?: number };
78
+
79
+ export type DescribeState = {
80
+ /** At most 500 characters. */
81
+ summary: string;
82
+ /** At most 8 KB as JSON. */
83
+ details?: Record<string, unknown>;
84
+ };
85
+
86
+ export type WorkshopErrorCode = "not_declared" | "forbidden" | "invalid" | "cancelled" | "unavailable" | "failed";
87
+
88
+ /** What a refused request rejects with. */
89
+ export interface WorkshopError extends Error {
90
+ code: WorkshopErrorCode;
91
+ }
92
+
93
+ /** Requests Workshop does as the user; each needs its capability in the manifest. */
94
+ export interface Workshop {
95
+ query(request: QueryRequest): Promise<WorkshopData>;
96
+ act(request: ActRequest): Promise<ActResult>;
97
+ /**
98
+ * Puts the question in the page's Agent chat for the user to send, or in a chat drawer beside
99
+ * the page when it has none. The objects in \`context\` are not sent yet.
100
+ */
101
+ ask(question: string, context?: { objects?: ObjectRef[] } & Record<string, unknown>): Promise<null>;
102
+ openPage(pageId: string, variables?: Record<string, unknown>): Promise<null>;
103
+ describe(state: DescribeState): void;
104
+ }
105
+
106
+ /** The properties Workshop sets on the element; any may come before or after it connects. */
107
+ export interface WorkshopComponentProps<Config = Record<string, unknown>> {
108
+ config: Config & { fieldRoles?: Record<string, string> };
109
+ data: WorkshopData | null;
110
+ variables: Record<string, unknown>;
111
+ theme: WorkshopTheme;
112
+ locale: string;
113
+ mode: WorkshopMode;
114
+ workshop: Workshop;
115
+ }
116
+
117
+ export type SetVariableDetail = { variable: string; value: unknown };
118
+ export type SelectDetail = { objectType: string; ids: string[] };
119
+
120
+ declare global {
121
+ interface HTMLElementEventMap {
122
+ "workshop:set-variable": CustomEvent<SetVariableDetail>;
123
+ "workshop:select": CustomEvent<SelectDetail>;
124
+ }
125
+ }
126
+
127
+ export type WorkshopWidget = {
128
+ widget?: "field" | "fields" | "variable" | "objectType" | "relationPath" | "actionType";
129
+ fieldTypes?: FieldType[];
130
+ maxHops?: number;
131
+ tab?: "data" | "display" | "link";
132
+ showIf?: Record<string, unknown>;
133
+ };
134
+
135
+ /** The subset of JSON Schema the builder makes forms from. */
136
+ export type ConfigSchema = {
137
+ type?: "string" | "number" | "integer" | "boolean" | "object" | "array";
138
+ properties?: Record<string, ConfigSchema>;
139
+ required?: string[];
140
+ items?: ConfigSchema;
141
+ enum?: unknown[];
142
+ title?: string;
143
+ description?: string;
144
+ default?: unknown;
145
+ minimum?: number;
146
+ maximum?: number;
147
+ minItems?: number;
148
+ maxItems?: number;
149
+ maxLength?: number;
150
+ "x-workshop"?: WorkshopWidget;
151
+ };
152
+
153
+ export type Size = { w: number; h: number };
154
+
155
+ export type WorkshopManifest = {
156
+ type: \`x-\${string}.\${string}\`;
157
+ kind: "component" | "page";
158
+ version: string;
159
+ workshopApi: 1;
160
+ element: string;
161
+ entry: string;
162
+ publisher?: { id?: string; name?: string; contact?: string };
163
+ label: { "zh-CN": string } & Record<string, string>;
164
+ description: string;
165
+ category?: "filter" | "display" | "chart" | "relation";
166
+ configSchema: ConfigSchema;
167
+ data: { source: boolean; fields: "any" | Array<{ role: string; type: FieldType }> };
168
+ follows: boolean;
169
+ emits?: Array<"value" | "dateRange" | "selection" | "set">;
170
+ capabilities?: Array<"query" | "act" | "ask" | "navigate">;
171
+ describes?: boolean;
172
+ defaultSize?: Size;
173
+ minSize?: Size;
174
+ network?: string[];
175
+ };
176
+ `;
177
+ export {
178
+ e as default
179
+ };