@openbkn/workshop 0.2.2-rc.5 → 0.2.2-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -8
- package/component.d.ts +10 -0
- package/dist/ActionConfirm-DJ91X3ml.js +236 -0
- package/dist/ActionFailure-ZgPt_3B-.js +37 -0
- package/dist/AgentChat-CRYai8ge.js +1062 -0
- package/dist/AppFormModal-D73ucaHK.js +4282 -0
- package/dist/AppListPage-D87piiOw.js +1364 -0
- package/dist/AskDrawer-BUMYsRnt.js +38 -0
- package/dist/ComputedView-CgYrDbx1.js +3221 -0
- package/dist/ConclusionApply-sjGfoEBY.js +153 -0
- package/dist/CypherEditor-lus6FA5L.js +485 -0
- package/dist/LandingList-6JI6864C.js +230 -0
- package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
- package/dist/ModelTrial-ClHFGTpQ.js +359 -0
- package/dist/PageRenderer-DBd_g6mN.js +85480 -0
- package/dist/README-DjRyTQSR.js +76 -0
- package/dist/ScenarioApply-DtW_hh47.js +590 -0
- package/dist/SimulateForm-C-i08Jjd.js +153 -0
- package/dist/Subgraph-CnrkH9AN.js +32586 -0
- package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
- package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
- package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
- package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
- package/dist/actionButton-DA5CNEzx.js +94 -0
- package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
- package/dist/agentChat-EoDznd58.js +116 -0
- package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
- package/dist/alertList-DqditwM8.js +84 -0
- package/dist/alertList.en-US-BAXAgltP.js +84 -0
- package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
- package/dist/asOfSlider-QPvHWUMV.js +83 -0
- package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
- package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
- package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
- package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
- package/dist/channel-B034hcOF.js +5 -0
- package/dist/china-C6m7zXIv.js +9 -0
- package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
- package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
- package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
- package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
- package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
- package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
- package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
- package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
- package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
- package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
- package/dist/component.d-DFoMKuUv.js +179 -0
- package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
- package/dist/customComponents-DasaZ6pq.js +4 -0
- package/dist/customComponents.en-US-CkabuCXg.js +79 -0
- package/dist/customParseFormat-C0uLEpdq.js +182 -0
- package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
- package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
- package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
- package/dist/d3-scale-DA8IHmf0.js +1841 -0
- package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
- package/dist/dateRange-BbkLMg8L.js +79 -0
- package/dist/dateRange.en-US-CV12Q02G.js +79 -0
- package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
- package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
- package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
- package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
- package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
- package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
- package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
- package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
- package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
- package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
- package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
- package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
- package/dist/eventList-CnsAwfDS.js +115 -0
- package/dist/eventList.en-US-Cof3rCLq.js +115 -0
- package/dist/eventReport-XS-HegnH.js +76 -0
- package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
- package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
- package/dist/ganttChart-DEeSvTJA.js +77 -0
- package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
- package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
- package/dist/generateCypher-Ch9_lQa6.js +399 -0
- package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
- package/dist/graph-CKJmgLki.js +1541 -0
- package/dist/index-BA-GzCXt.js +441 -0
- package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
- package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
- package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
- package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
- package/dist/katex-BsrBVQKd.js +11314 -0
- package/dist/manifest-BjV1PJ6u.js +41 -0
- package/dist/mermaid.core-yQghUlIz.js +17642 -0
- package/dist/metricCards-CSb-_cT2.js +104 -0
- package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
- package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
- package/dist/modelTrial-Bvb-RhGt.js +137 -0
- package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
- package/dist/models-DekiCOuZ.js +6 -0
- package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
- package/dist/object-metric.service-flZgBMRX.js +233 -0
- package/dist/objectDetail-SQUbp4Py.js +117 -0
- package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
- package/dist/objectList-D99wPtJH.js +97 -0
- package/dist/objectList.en-US-PBBNyVLW.js +97 -0
- package/dist/objectTable-0jsFFMN3.js +127 -0
- package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
- package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
- package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
- package/dist/pivotTable-CHmQw18-.js +102 -0
- package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
- package/dist/prompt-DYrjlEFr.js +373 -0
- package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
- package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
- package/dist/regionMap-Cme-JyV_.js +128 -0
- package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
- package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
- package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
- package/dist/scenarioBar-BV43p7n-.js +122 -0
- package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
- package/dist/scheduleGantt-CTYO-zYP.js +180 -0
- package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
- package/dist/searchBox-Ca7w0f_6.js +67 -0
- package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
- package/dist/segmentedFilter-MhjVcWo0.js +80 -0
- package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
- package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
- package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
- package/dist/stageChain-BxBafwjD.js +74 -0
- package/dist/stageChain.en-US-CP0G27n8.js +74 -0
- package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
- package/dist/subgraph-7n4SwliR.js +71 -0
- package/dist/subgraph.en-US-BNvY18IW.js +71 -0
- package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
- package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
- package/dist/taskInbox-DGWYeI2b.js +118 -0
- package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
- package/dist/text-BqSVQKS6.js +78 -0
- package/dist/text.en-US-BhAxy_LE.js +78 -0
- package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
- package/dist/trendChart-BjEeRS5_.js +135 -0
- package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
- package/dist/useLabData-Df-jEHKs.js +20470 -0
- package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
- package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
- package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
- package/dist/workshop-app-DnHNjBqy.js +86038 -0
- package/dist/workshop-app.css +1 -0
- package/dist/workshop-app.js +4 -0
- package/dist/world-Djau1JyJ.js +9 -0
- package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
- package/dist-cli/workshop.js +340 -217
- package/example/host.js +109 -0
- package/example/index.html +93 -0
- package/example/server.mjs +237 -0
- package/index.d.ts +48 -0
- package/lib/validate.js +47 -1
- package/package.json +17 -5
- package/runtime/frame-runtime.js +13 -1
- package/workshop-component.js +32 -12
- package/workshop.js +2 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
const n = `# 按钮(actionButton)
|
|
2
|
+
|
|
3
|
+
页面上的一个按钮,点一下按顺序做配置好的动作:向 Agent 提问,或对选中、勾选的对象执行知识网络里的行动。用来把“看完数据后要做的那一步”放在页面上,执行前总会先确认。
|
|
4
|
+
|
|
5
|
+
## 适用与不适用
|
|
6
|
+
|
|
7
|
+
- 适用:对选中的一个对象,或在表格里勾选的一组对象,执行一个已经在知识网络里定义好的行动;或一键把当前页面的情况交给 Agent 分析。例如“催办”“标记加急”“总结本页需要关注的情况”。
|
|
8
|
+
- 不适用:
|
|
9
|
+
- 每一行或每个命中对象各带一个按钮:在对象表(\`objectTable\`)、对象列表(\`objectList\`)、告警(\`alertList\`)的“点击时”里配置。
|
|
10
|
+
- 对象详情里的操作:用对象详情(\`objectDetail\`)的按钮。
|
|
11
|
+
- 行动要先试算再采用:用方案(\`scenarioBar\`)里的推演流程。
|
|
12
|
+
- 行动的判断逻辑要在页面里写:不行,应放在知识网络的行动里。
|
|
13
|
+
|
|
14
|
+
## 本体契约
|
|
15
|
+
|
|
16
|
+
| 角色 | 对象类要求 | 必要的属性 | 关系 | 必填 |
|
|
17
|
+
| --- | --- | --- | --- | --- |
|
|
18
|
+
| 行动的对象 | 数据源的对象类,必须是知识网络里的对象(查询结果与事件不能执行行动) | 标识 | — | 执行行动时是 |
|
|
19
|
+
| 行动 | 知识网络里作用于该对象类的行动 | 行动的参数定义 | — | 执行行动时是 |
|
|
20
|
+
| 对象来源 | 页面上的一个选中筛选或对象集合筛选,装着要执行的对象,必须是同一对象类 | — | — | 执行行动时是 |
|
|
21
|
+
|
|
22
|
+
只向 Agent 提问的按钮不需要行动,也不需要对象来源。
|
|
23
|
+
|
|
24
|
+
## 组件内置的判断
|
|
25
|
+
|
|
26
|
+
- 对象为空时:行动的对象来源是选中或对象集合,目前一个都没有,按钮不能点,旁边提示“请先选中一个对象”或“请先选出要执行的对象”;有对象时提示“将对 N 个对象执行”。
|
|
27
|
+
- 确认:行动执行前总会打开确认窗,列出对象、让用户填写参数、检查执行权限(无权时提示),确认后逐个对象以用户本人的身份执行,并显示每个对象的结果。行动有名为 \`app_id\` 的参数时,自动填入当前应用的 ID,不用填写。
|
|
28
|
+
- 数量:一次最多执行的对象数默认 20,可在动作里调到最多 100;超出时只执行前面的并说明。
|
|
29
|
+
- 按钮文字取按钮动作里写的名称,不写则取第一个动作的名称;最多 20 个字。
|
|
30
|
+
- 按钮的图标:第一个动作是提问时为对话图标,否则为闪电。
|
|
31
|
+
- 没有配好动作或没有数据源时,显示“尚未选择要执行的行动”。
|
|
32
|
+
|
|
33
|
+
## 扩展点
|
|
34
|
+
|
|
35
|
+
### 知识网络的行动
|
|
36
|
+
|
|
37
|
+
- **用途**:执行条件、写什么数据、需要哪些参数,这些业务判断放在行动里。
|
|
38
|
+
- **在哪里配**:按钮的“按钮动作”,选择行动类型;每个行动参数指定来源。
|
|
39
|
+
- **接什么**:知识网络里的行动类型,作用于数据源的对象类。
|
|
40
|
+
- **输入**:参数的来源有三种:确认时由用户填写、取页面某个筛选的值、固定值。行动自己从对象取的参数、自己设置的参数不在这里配。
|
|
41
|
+
- **输出**:每个对象的执行结果:已受理、已生效、执行失败、已取消。
|
|
42
|
+
- **失败与超时**:无权执行时在确认窗提示;单个对象失败不影响其他对象,各自显示结果。
|
|
43
|
+
- **结果怎样显示**:在确认窗内按对象逐个列出,不写回页面其他组件。
|
|
44
|
+
|
|
45
|
+
## 交互与联动
|
|
46
|
+
|
|
47
|
+
- **写入**:无。
|
|
48
|
+
- **读取**:读行动配置里指定的选中筛选或对象集合筛选(通常由对象表的点击行或勾选行写入);按钮不跟随其他筛选。
|
|
49
|
+
- 向 Agent 提问的动作可带上当前页面的筛选,可直接发送,或只放进输入框让用户修改后发送;问题先交给宿主页面(应用嵌入时),其次页面上的 Agent 对话,都没有时在抽屉里回答。
|
|
50
|
+
- 一个按钮只有一个“按钮动作”,其中最多 5 个按顺序执行的步骤。
|
|
51
|
+
|
|
52
|
+
## 场景配方
|
|
53
|
+
|
|
54
|
+
### 对勾选的订单批量催办
|
|
55
|
+
|
|
56
|
+
| 角色 | 对应 |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| 行动的对象 | 销售订单 |
|
|
59
|
+
| 行动 | 订单的“催办”行动(参数:催办说明) |
|
|
60
|
+
| 对象来源 | 订单表勾选行写入的对象集合筛选 |
|
|
61
|
+
|
|
62
|
+
**知识网络中要有:** 作用于订单的“催办”行动,参数“催办说明”;行动本身包含谁能执行、做什么。
|
|
63
|
+
|
|
64
|
+
**检查项:** 没勾选时按钮不能点并提示;勾选 3 张后提示“将对 3 个对象执行”;点击后确认窗列出 3 张订单并要求填写催办说明;无权用户看到无权提示。
|
|
65
|
+
|
|
66
|
+
### 一键总结当前页面
|
|
67
|
+
|
|
68
|
+
| 角色 | 对应 |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| 动作 | 向 Agent 提问:“总结本页需要关注的情况,并给出依据”,带上当前筛选,直接发送 |
|
|
71
|
+
|
|
72
|
+
**检查项:** 点击后页面上的 Agent 对话收到问题并开始回答;页面没有 Agent 对话时,问题在弹出的抽屉里回答。
|
|
73
|
+
|
|
74
|
+
## 给 AI 的指引
|
|
75
|
+
|
|
76
|
+
1. 先问用户:这个按钮是问 Agent 还是执行行动;执行行动的话,作用于哪类对象、对象从哪里来(选中的一个,还是勾选的一组)、行动在知识网络里叫什么。
|
|
77
|
+
2. 行动必须已经在知识网络里;没有就列出要新建的行动(名称、作用的对象类、参数),不要在页面里编执行逻辑。
|
|
78
|
+
3. 页面上要有写入对象的组件:选中筛选由对象表或对象列表点击写入,对象集合筛选由表格勾选写入。没有就先加。
|
|
79
|
+
4. 常见错误:
|
|
80
|
+
- 行动作用的对象类与数据源、对象来源筛选里的对象类不一致。
|
|
81
|
+
- 把需要用户填的参数都写成固定值,用户没法改;该由用户填的选“确认时填写”。
|
|
82
|
+
- 数据源选成查询结果或事件,这些不是网络里的对象,不能执行行动。
|
|
83
|
+
- 期望按钮不经确认直接执行:行动执行前总会确认,不能关闭。
|
|
84
|
+
|
|
85
|
+
## 限制
|
|
86
|
+
|
|
87
|
+
- 一个按钮只有一个按钮动作,最多 5 个步骤。
|
|
88
|
+
- 一次确认最多执行 100 个对象,默认 20。
|
|
89
|
+
- 不跟随筛选,不写入筛选。
|
|
90
|
+
- 行动按用户本人的权限执行。
|
|
91
|
+
`;
|
|
92
|
+
export {
|
|
93
|
+
n as default
|
|
94
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
const e = `# Button (actionButton)
|
|
2
|
+
|
|
3
|
+
A button on the page: one click takes the configured steps in order, asking the Agent or running an action of the knowledge network on the selected or ticked objects. Use it to put "the step to take after reading the data" on the page; it always asks for confirmation before running.
|
|
4
|
+
|
|
5
|
+
## When to use it and when not
|
|
6
|
+
|
|
7
|
+
- Use it to run an action already defined in the knowledge network on one selected object or a group ticked in a table, or to hand the page's current situation to the Agent in one click. For example "Chase", "Mark as rush", "Summarize what needs attention on this page".
|
|
8
|
+
- Do not use it:
|
|
9
|
+
- For a button on each row or each hit object: set it under "On click" of the object table (\`objectTable\`), object list (\`objectList\`) or alerts (\`alertList\`).
|
|
10
|
+
- For operations inside the object detail: use the buttons of the object detail (\`objectDetail\`).
|
|
11
|
+
- For an action to try out before applying: use the scenario flow of the scenario bar (\`scenarioBar\`).
|
|
12
|
+
- To put the action's decision logic in the page: not here; it belongs in the action in the knowledge network.
|
|
13
|
+
|
|
14
|
+
## Ontology contract
|
|
15
|
+
|
|
16
|
+
| Role | Object type | Required properties | Relations | Required |
|
|
17
|
+
| --- | --- | --- | --- | --- |
|
|
18
|
+
| Action's objects | The data source's object type; it must be an object of the knowledge network (query results and events cannot run actions) | An identifier | — | When running an action |
|
|
19
|
+
| Action | An action in the knowledge network on that object type | The action's parameter definitions | — | When running an action |
|
|
20
|
+
| Object source | A selection filter or object-set filter on the page holding the objects to run on, of the same object type | — | — | When running an action |
|
|
21
|
+
|
|
22
|
+
A button that only asks the Agent needs no action and no object source.
|
|
23
|
+
|
|
24
|
+
## Built-in checks
|
|
25
|
+
|
|
26
|
+
- No objects: when the action's object source is a selection or a set that is empty right now, the button cannot be clicked and a note says to select one object or to pick the objects first; with objects the note says how many objects it will run on.
|
|
27
|
+
- Confirmation: before an action runs, a confirmation opens that lists the objects, lets the user fill parameters and checks the permission to run (with a note when not allowed); after confirming, the action runs object by object as the user, and the result of each is shown. A parameter named \`app_id\` is filled in with the current app's ID and is not asked for.
|
|
28
|
+
- Count: at most 20 objects per run by default, raised in the step to at most 100; beyond that only the first ones run and the dialog says so.
|
|
29
|
+
- The button text is the name written in the button step, or the name of the first step when empty; at most 20 characters.
|
|
30
|
+
- The icon is a chat icon when the first step asks, a lightning bolt otherwise.
|
|
31
|
+
- With no step set or no data source, it shows a note that no action is chosen.
|
|
32
|
+
|
|
33
|
+
## Extension points
|
|
34
|
+
|
|
35
|
+
### The knowledge network's action
|
|
36
|
+
|
|
37
|
+
- **What for**: when the action may run, what data it writes and which parameters it needs; these business judgements live in the action.
|
|
38
|
+
- **Where**: "Button action" on the button: pick the action type and give each parameter a source.
|
|
39
|
+
- **What it connects to**: an action type in the knowledge network on the data source's object type.
|
|
40
|
+
- **Input**: a parameter comes from one of three: filled by the user at confirmation, the value of a page filter, or a fixed value. Parameters the action takes from the object itself or sets on its own are not set here.
|
|
41
|
+
- **Output**: the result for each object: accepted, done, failed or cancelled.
|
|
42
|
+
- **Failure and timeout**: a user without permission sees a note in the confirmation; one object failing does not stop the others, each shows its own result.
|
|
43
|
+
- **How the result shows**: listed object by object in the confirmation; it is not written back to other components.
|
|
44
|
+
|
|
45
|
+
## Interaction and links
|
|
46
|
+
|
|
47
|
+
- **Writes**: none.
|
|
48
|
+
- **Reads**: the selection filter or object-set filter named in the action step (usually written by clicking or ticking rows in an object table); the button does not follow other filters.
|
|
49
|
+
- A step that asks the Agent can carry the page's current filters, and either send at once or only put the question in the input box for the user to edit and send; the question goes first to the host page (when the app is embedded), then to the Agent chat on the page, and with neither it is answered in a drawer.
|
|
50
|
+
- A button has one "Button action", with up to 5 steps run in order.
|
|
51
|
+
|
|
52
|
+
## Recipes
|
|
53
|
+
|
|
54
|
+
### Chase the ticked orders in one go
|
|
55
|
+
|
|
56
|
+
| Role | Maps to |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| Action's objects | Sales orders |
|
|
59
|
+
| Action | The order's "Chase" action (parameter: chase note) |
|
|
60
|
+
| Object source | The object-set filter written by ticking rows in the order table |
|
|
61
|
+
|
|
62
|
+
**What the knowledge network needs:** a "Chase" action on orders with a "chase note" parameter; who may run it and what it does are part of the action.
|
|
63
|
+
|
|
64
|
+
**Checks:** with nothing ticked the button is disabled with a note; with 3 ticked the note says it will run on 3 objects; clicking opens a confirmation listing the 3 orders and asking for the note; a user without permission sees the permission note.
|
|
65
|
+
|
|
66
|
+
### Summarize the current page in one click
|
|
67
|
+
|
|
68
|
+
| Role | Maps to |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| Step | Ask the Agent: "Summarize what needs attention on this page, with evidence", with current filters, sent at once |
|
|
71
|
+
|
|
72
|
+
**Checks:** after a click the Agent chat on the page receives the question and starts answering; with no Agent chat on the page, the question is answered in a drawer that opens.
|
|
73
|
+
|
|
74
|
+
## Guidance for AI
|
|
75
|
+
|
|
76
|
+
1. Ask first: whether the button asks the Agent or runs an action; for an action, which object type it acts on, where the objects come from (one selected or a ticked group) and what the action is called in the knowledge network.
|
|
77
|
+
2. The action must already exist in the knowledge network; if not, list the action to create (name, object type, parameters) and do not invent execution logic in the page.
|
|
78
|
+
3. The page needs a component that writes the objects: a selection filter written by clicking in the object table or list, an object-set filter written by ticking rows. Add one first if missing.
|
|
79
|
+
4. Common mistakes:
|
|
80
|
+
- The action's object type differs from the data source's or from the filter's object type.
|
|
81
|
+
- Making every parameter a fixed value so the user cannot change it; choose "fill at confirmation" for what the user should enter.
|
|
82
|
+
- A data source that is a query result or events: these are not objects of the network and cannot run actions.
|
|
83
|
+
- Expecting the button to run without confirmation: actions always ask first and this cannot be turned off.
|
|
84
|
+
|
|
85
|
+
## Limits
|
|
86
|
+
|
|
87
|
+
- One button action per button, up to 5 steps.
|
|
88
|
+
- One confirmation runs at most 100 objects, 20 by default.
|
|
89
|
+
- It does not follow or write filters.
|
|
90
|
+
- Actions run with the user's own permissions.
|
|
91
|
+
`;
|
|
92
|
+
export {
|
|
93
|
+
e as default
|
|
94
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
const n = `# Agent 对话(agentChat)
|
|
2
|
+
|
|
3
|
+
围绕页面上的数据提问和回答的对话框。Agent 能查页面上全部数据源和整个知识网络,读当前筛选和选中的对象,允许时还能替用户设置筛选、建议行动。用来让业务人员用自然语言追问“为什么”“哪些”“怎么办”。
|
|
4
|
+
|
|
5
|
+
## 适用与不适用
|
|
6
|
+
|
|
7
|
+
- 适用:看完页面后要追问原因、要汇总比较、要沿关系查页面之外的对象;或让别的组件(按钮、告警、环节链路)点击后把问题交给它。
|
|
8
|
+
- 不适用:
|
|
9
|
+
- 固定的一键动作(总结、执行某个行动):用按钮(\`actionButton\`),可带上当前筛选提问。
|
|
10
|
+
- 页面上要常驻显示的数字和列表:用指标卡组(\`metricCards\`)、对象表(\`objectTable\`)。
|
|
11
|
+
- 要在外部系统里做的事:本组件只能读知识网络、提出建议,不执行。
|
|
12
|
+
|
|
13
|
+
## 本体契约
|
|
14
|
+
|
|
15
|
+
| 角色 | 对象类要求 | 必要的属性 | 关系 | 必填 |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| 可查询的对象 | 页面上所有数据源的对象类,以及知识网络中的其他对象类 | 属性与进度、计算列越清楚,回答越准 | 沿关系查询页面之外的对象时,需要网络里有对应关系 | 否:没有数据源也能对话,但只能答网络里的内容 |
|
|
18
|
+
| 当前对象 | 一个选中筛选里的对象 | — | — | 否 |
|
|
19
|
+
| 可建议的行动 | 知识网络里的行动类型 | 行动的参数定义 | — | 否 |
|
|
20
|
+
|
|
21
|
+
本组件不配数据源。
|
|
22
|
+
|
|
23
|
+
## 组件内置的判断
|
|
24
|
+
|
|
25
|
+
- 回答规则:数字与事实只能来自查询结果,查不到就说查不到;编号名称照原样引用;用提问所用的语言回答。
|
|
26
|
+
- 工具(前端 Agent):读取页面现状、查询对象(单次最多 50 条)、按字段汇总、沿关系查询知识网络;允许时设置筛选、选中对象;配了行动时提出行动建议;数据源有推演操作时提出推演建议。一次提问最多调用 12 步。
|
|
27
|
+
- 步骤显示:每次查询以一句话显示查了什么、条件与数量,不显示工具内部名称。
|
|
28
|
+
- 建议卡:行动或推演建议只生成卡片,用户点击后打开确认或参数窗,执行与否由用户决定;Agent 不能自己执行,每张卡只执行一次。
|
|
29
|
+
- 外部 Agent:页面以用户本人身份,经执行工厂调用登记的 MCP 服务里回答问题的工具,只传工具声明了的参数;回答标为外部 Agent、未经平台校验;单次最多等 1 分钟(默认部署下网关 60 秒即断开);工具说仍在处理时显示为处理中、不当作回答,工具声明了 \`run_id\` 时带上它续查,最多 10 分钟。
|
|
30
|
+
- 提问来源:别的组件配置的“向 Agent 提问”会先交给宿主页面(应用嵌入时),其次这个对话,都没有时在抽屉里回答;折叠的对话会自动展开接收。
|
|
31
|
+
|
|
32
|
+
## 扩展点
|
|
33
|
+
|
|
34
|
+
### 补充说明
|
|
35
|
+
|
|
36
|
+
- **用途**:告诉 Agent 这个应用特有的口径与说法,例如“超期指超过合同交期”“金额单位为万元”。
|
|
37
|
+
- **在哪里配**:“补充说明”,最多 600 字。
|
|
38
|
+
- **接什么**:文字,随每次提问一起发给回答方:前端 Agent 与内置 BKN Agent 直接使用,外部 Agent 放在 \`context\` 参数里。
|
|
39
|
+
- **输入 / 输出**:无格式要求。
|
|
40
|
+
- **失败与超时**:无。
|
|
41
|
+
- **结果怎样显示**:影响回答,不单独显示。
|
|
42
|
+
|
|
43
|
+
口径的定义不要只写在这里:能算的判断做成知识网络的逻辑属性或数据源的计算列,补充说明里只告诉 Agent 怎么用。
|
|
44
|
+
|
|
45
|
+
### 外部 Agent
|
|
46
|
+
|
|
47
|
+
- **用途**:由客户或第三方的 Agent 直接回答对话框里的问题,不经平台的 Agent。
|
|
48
|
+
- **在哪里配**:“由谁回答”选“外部 Agent”,再在“外部 Agent”里选执行工厂登记并发布的 MCP 服务与其中回答问题的工具(服务有 \`ask\` 工具时自动选上)。使用者须有该服务的执行权限。
|
|
49
|
+
- **按工作区预填**:应用所在的工作区(构建者自己放的)设了默认外部 Agent 时,新加的对话框预先选好服务、工具和智能体,可以改。填好后写进应用,以后改工作区设置不影响它;服务已删除、未发布或无权使用时不预填,并提示原因。登录令牌开关不预填。
|
|
50
|
+
- **接什么**:MCP 工具。页面只传工具声明了的参数:\`question\`、\`context\`(页面上下文与补充说明)、\`conversation_id\`(同一对话框共用)、\`app_id\`、\`kn_id\`、\`workspace_id\`(提问人把应用放在自己的哪个工作区,没放过的是默认工作区;只表示分组,不表示权限)、\`bkn_token\`,续查时另有 \`run_id\`(工具上次给出的运行编号)。
|
|
51
|
+
- **交出使用者的登录令牌**:默认关。打开后,工具声明了 \`bkn_token\` 时把使用者本人的访问令牌交给它;对方凭它能做使用者能做的一切,包括执行行动和办理审批。只对可信的 Agent 打开。
|
|
52
|
+
- **输入 / 输出**:返回 MCP 标准的文本内容,按 Markdown 显示。工具应在 45 秒内返回;做不完时在 \`structuredContent\` 中返回 \`status\`(\`running\` 或 \`queued\`)与 \`run_id\`,\`content\` 写给人看的说明;\`status\` 为 \`failed\` 时按报错显示。
|
|
53
|
+
- **失败与超时**:无执行权限、服务不存在或未发布、工具不在、对方报错、1 分钟无回答(含网关断开)、工具不能续查、续查 10 分钟仍未完成,分别提示原因;停止等待后对方可能仍在执行。
|
|
54
|
+
- **结果怎样显示**:回答上方标明是哪个外部 Agent 的回答(服务名称;配置里没有名称时向执行工厂取)、未经平台校验;处理中只显示工具的说明,不标为回答。
|
|
55
|
+
|
|
56
|
+
### 允许建议的行动
|
|
57
|
+
|
|
58
|
+
- **用途**:让 Agent 在分析后建议对某些对象执行知识网络里的行动,例如“催办”。
|
|
59
|
+
- **在哪里配**:“允许 Agent 建议的行动”。目前只有前端 Agent 支持。
|
|
60
|
+
- **接什么**:知识网络里的行动类型。
|
|
61
|
+
- **输入**:Agent 给出行动、对象、可选参数与理由。
|
|
62
|
+
- **输出**:建议卡,写明行动、对象数和理由;用户点击后进入执行确认(列出对象、填参数、检查权限),逐个对象以用户身份执行。
|
|
63
|
+
- **失败与超时**:见执行确认;建议卡会记下执行结果,不会重复执行。
|
|
64
|
+
- **结果怎样显示**:在建议卡上显示已生效、失败、已受理或已取消。
|
|
65
|
+
|
|
66
|
+
## 交互与联动
|
|
67
|
+
|
|
68
|
+
- **写入**:“允许 Agent 设置筛选和选中对象”打开时,Agent 可设置页面的筛选(例如“仅看超期”)和选中对象,再告诉用户页面现在显示什么;关闭时不能,只提示用户在页面上点哪里。目前只有前端 Agent 有这个能力。
|
|
69
|
+
- **读取**:读“当前对象”选中筛选,用户说“这个”“它”时指它;也读页面全部筛选与基准日期。
|
|
70
|
+
- 显示方式:悬浮(收起为贴在页面右下边缘的竖排小标签,页面右侧为它留出位置、不遮内容,点击弹出)、侧栏(固定在右侧,可收起)、常驻(嵌在网格中,高度 280 到 800)。悬浮与侧栏收起时对话保留。
|
|
71
|
+
- 建议问题 0 到 6 条,对话为空时显示,点击即发送。
|
|
72
|
+
|
|
73
|
+
## 场景配方
|
|
74
|
+
|
|
75
|
+
### 供应链指挥:追问“为什么这批订单会缺料”
|
|
76
|
+
|
|
77
|
+
| 角色 | 对应 |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| 可查询的对象 | 订单、工单、物料需求、物料(页面数据源 + 网络关系) |
|
|
80
|
+
| 当前对象 | 对象表里选中的订单 |
|
|
81
|
+
| 可建议的行动 | “催办采购” |
|
|
82
|
+
|
|
83
|
+
**知识网络中要有:** 订单 → 工单 → 物料需求 → 物料的关系;物料的库存与到货日;“催办采购”行动;工单的逻辑属性“是否缺料”。
|
|
84
|
+
|
|
85
|
+
**检查项:** 选中一张订单后问“这张为什么缺料”,回答引用物料与到货日并说明经过哪条关系;让它“只看超期订单”,页面表格随之筛选;它建议催办时出现建议卡,点击后确认窗列出对象,用户确认后才执行。
|
|
86
|
+
|
|
87
|
+
## 给 AI 的指引
|
|
88
|
+
|
|
89
|
+
1. 先问用户:由谁回答(前端 Agent、内置 BKN Agent、外部 Agent)、放在哪里(悬浮、侧栏或常驻)、要不要让 Agent 改页面筛选、是否允许建议行动、有哪些口径要写进补充说明。
|
|
90
|
+
2. 默认用前端 Agent,它能读页面、设置筛选、建议行动;换成内置 BKN Agent 或外部 Agent 时,设置筛选和行动建议不可用,要如实告诉用户。外部 Agent 要先由管理员在执行工厂登记并发布,使用者要有执行权限;“交出使用者的登录令牌”保持关闭,除非用户明确信任这个 Agent 并要求打开。
|
|
91
|
+
3. 前端 Agent 需要模型工厂里有可用的默认模型。
|
|
92
|
+
4. 想让别的组件的点击提问有人答,页面最好有这个对话;没有时也会在抽屉里回答。
|
|
93
|
+
5. 常见错误:
|
|
94
|
+
- 把业务口径只写在补充说明里,超过 600 字或和知识网络里的定义不一致。
|
|
95
|
+
- 选了内置 BKN Agent 却期待它设置页面筛选或提出行动建议。
|
|
96
|
+
- 打开“允许设置筛选”,却没有任何组件跟随这些筛选,页面不会变。
|
|
97
|
+
- 期待 Agent 直接执行行动:只能建议,用户确认后才执行。
|
|
98
|
+
- 选了外部 Agent 却没选服务和工具,或服务未发布:对话框提示不可用,不能提问。
|
|
99
|
+
- 常驻方式放进窄格子,对话区太小;窄处用悬浮或侧栏。
|
|
100
|
+
|
|
101
|
+
## 限制
|
|
102
|
+
|
|
103
|
+
- 补充说明最多 600 字;建议问题最多 6 条;常驻高度 280 到 800。
|
|
104
|
+
- 前端 Agent 单次提问最多 12 步,单次查询最多取 50 条对象。
|
|
105
|
+
- 设置筛选、行动建议与推演建议只有前端 Agent 支持。
|
|
106
|
+
- 外部 Agent 单次调用最多等 1 分钟,处理中续查累计最多 10 分钟。
|
|
107
|
+
- 一次行动建议最多对 100 个对象执行。
|
|
108
|
+
- Agent 的回答来自查询结果,不保存到知识网络。
|
|
109
|
+
|
|
110
|
+
### 选择服务中的智能体
|
|
111
|
+
|
|
112
|
+
外部 MCP 提供 list_agents(返回 structuredContent.agents: [{id, name}])和接受 agent_id 的 ask 时,组件配置可选择默认智能体。打开“允许使用者切换智能体”后,对话框显示智能体选择框。切换会清空当前对话并生成新的会话标识;回答期间不可切换。list_agents 与 ask 一样只收它声明了的参数:\`app_id\`、\`kn_id\`、\`workspace_id\`,以及打开“交出使用者的登录令牌”时的 \`bkn_token\`(在构建器里是构建者自己的)。列出哪些智能体、能否调用由服务端决定:声明了这些参数的服务可以按应用和使用者筛选,没有声明的只能按集成账号。选了默认智能体时,即使没有打开切换,对话框打开时也会调用 list_agents,返回之前不提问(点击带来的问题等列表返回再发):所选智能体不在返回结果里,就显示“智能体暂不可用”,不能提问,也不显示原名称;读不到列表时照常提问,由服务端核对。服务不提供 list_agents 时保持原有行为。
|
|
113
|
+
`;
|
|
114
|
+
export {
|
|
115
|
+
n as default
|
|
116
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
const e = `# Agent chat (agentChat)
|
|
2
|
+
|
|
3
|
+
A chat box that asks and answers about the data on the page. The Agent can query all the page's data sources and the whole knowledge network, read the current filters and the selected object, and when allowed set filters for the user and suggest actions. Use it so business users can follow up in plain language with "why", "which" and "what now".
|
|
4
|
+
|
|
5
|
+
## When to use it and when not
|
|
6
|
+
|
|
7
|
+
- Use it to follow up on a page with reasons, summaries and comparisons, to query objects beyond the page along relations, or as the place where clicks from other components (a button, alerts, the stage chain) send their questions.
|
|
8
|
+
- Do not use it:
|
|
9
|
+
- For fixed one-click steps (summarize, run an action): use the button (\`actionButton\`), which can carry the current filters with its question.
|
|
10
|
+
- For numbers and lists that must stay on the page: use the metric cards (\`metricCards\`) or object table (\`objectTable\`).
|
|
11
|
+
- For work in outside systems: this component only reads the knowledge network and suggests; it does not run anything.
|
|
12
|
+
|
|
13
|
+
## Ontology contract
|
|
14
|
+
|
|
15
|
+
| Role | Object type | Required properties | Relations | Required |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| Queryable objects | The object types of all the page's data sources, and other object types in the knowledge network | The clearer the properties, progress and computed columns, the better the answers | To query objects beyond the page along relations, those relations must exist in the network | No: with no data source it still chats, but can answer only from the network |
|
|
18
|
+
| Current object | The object in one selection filter | — | — | No |
|
|
19
|
+
| Suggestible actions | Action types in the knowledge network | The action's parameter definitions | — | No |
|
|
20
|
+
|
|
21
|
+
This component has no data source of its own.
|
|
22
|
+
|
|
23
|
+
## Built-in checks
|
|
24
|
+
|
|
25
|
+
- Answering rules: numbers and facts come only from query results, and "cannot find" is said when nothing is found; IDs and names are quoted as they are; the answer is in the language of the question.
|
|
26
|
+
- Tools (front-end Agent): read the page state, query objects (at most 50 per query), summarize by a field, query the knowledge network along relations; when allowed, set filters and select an object; when actions are set, suggest actions; when a data source has what-if operations, suggest those. At most 12 steps per question.
|
|
27
|
+
- Step display: each query shows as one sentence of what was looked at, its conditions and the count, not the tool's internal name.
|
|
28
|
+
- Suggestion cards: an action or what-if suggestion only makes a card; the user clicks it to open the confirmation or the parameter form and decides; the Agent cannot run anything itself, and a card runs only once.
|
|
29
|
+
- External Agent: the page calls the answering tool of a registered MCP service through the execution factory, as the user, sending only the parameters the tool declares; the answer is marked as from that external Agent and not checked by the platform; one call is waited on for up to a minute (by default the gateway cuts a call at 60 seconds); when the tool says it is still working, that is shown as such, not as an answer, and when the tool declares \`run_id\` the page asks again with it, for up to 10 minutes.
|
|
30
|
+
- Where questions come from: "Ask the Agent" set on other components goes first to the host page (when embedded), then to this chat, and with neither is answered in a drawer; a folded chat opens to receive it.
|
|
31
|
+
|
|
32
|
+
## Extension points
|
|
33
|
+
|
|
34
|
+
### Extra instructions
|
|
35
|
+
|
|
36
|
+
- **What for**: tell the Agent this app's own definitions and wording, such as "overdue means past the contract due date" or "amounts are in ten thousands".
|
|
37
|
+
- **Where**: "Extra instructions", up to 600 characters.
|
|
38
|
+
- **What it connects to**: text, sent with every question to whoever answers: the front-end Agent and the built-in BKN Agent use it directly, and an external Agent gets it in the \`context\` parameter.
|
|
39
|
+
- **Input / output**: no format required.
|
|
40
|
+
- **Failure and timeout**: none.
|
|
41
|
+
- **How the result shows**: it shapes answers and is not shown on its own.
|
|
42
|
+
|
|
43
|
+
Do not keep a definition only here: a judgement that can be computed belongs in a logical property on the knowledge network or a computed column of the data source, and the instructions only tell the Agent how to use it.
|
|
44
|
+
|
|
45
|
+
### External Agent
|
|
46
|
+
|
|
47
|
+
- **Purpose**: a customer's or third party's Agent answers the chat directly, without the platform's Agents.
|
|
48
|
+
- **Where**: set "Who answers" to "External Agent", then pick, under "External Agent", an MCP service registered and published in the execution factory and its answering tool (an \`ask\` tool is picked by itself). Users need execute permission on the service.
|
|
49
|
+
- **Filled in from the workspace**: when the app's workspace (where the builder put it) has a default outside Agent, a new chat starts with its service, tool and Agent, which you can change. They are written into the app then, and later changes to the workspace leave it alone; a service deleted, unpublished or not yours to use is not filled in, and the builder says why. The token switch is never filled in.
|
|
50
|
+
- **What it connects to**: an MCP tool. The page sends only the parameters the tool declares: \`question\`, \`context\` (page context and extra instructions), \`conversation_id\` (one per chat), \`app_id\`, \`kn_id\`, \`workspace_id\` (which of their own workspaces the asker put the app in, their default one when they put it nowhere; a grouping only, granting nothing), \`bkn_token\`, and when asking after a run, \`run_id\` (the number the tool gave for it).
|
|
51
|
+
- **Hand over the user's sign-in token**: off by default. When on, and the tool declares \`bkn_token\`, the user's own access token is sent; with it the Agent can do whatever the user can, running actions and approving included. Turn it on only for a trusted Agent.
|
|
52
|
+
- **Input / output**: standard MCP text content, shown as Markdown. The tool should answer within 45 seconds; when it needs longer it returns \`status\` (\`running\` or \`queued\`) and \`run_id\` in \`structuredContent\`, with a note for people in \`content\`; a \`status\` of \`failed\` is shown as an error.
|
|
53
|
+
- **Failures and timeouts**: no execute permission, service missing or unpublished, tool gone, an error from the other side, no answer within a minute (the gateway cutting the call included), a tool that cannot be asked after a run, and a run still unfinished after 10 minutes are each told apart; once the page stops waiting, the other side may still be working.
|
|
54
|
+
- **How the result shows**: the answer is headed with which external Agent gave it (the service name; when the settings have none, the name the execution factory gives) and that the platform did not check it; while the tool is still working, only its note shows, not marked as an answer.
|
|
55
|
+
|
|
56
|
+
### Actions it may suggest
|
|
57
|
+
|
|
58
|
+
- **What for**: let the Agent, after analysis, suggest running an action of the knowledge network on some objects, such as "Chase".
|
|
59
|
+
- **Where**: "Actions the Agent may suggest". Only the front-end Agent supports it for now.
|
|
60
|
+
- **What it connects to**: action types in the knowledge network.
|
|
61
|
+
- **Input**: the Agent gives the action, the objects, optional parameters and a reason.
|
|
62
|
+
- **Output**: a suggestion card naming the action, object count and reason; a click opens the execution confirmation (lists the objects, asks for parameters, checks permission), and the action runs object by object as the user.
|
|
63
|
+
- **Failure and timeout**: see the confirmation; the card remembers the result and does not run twice.
|
|
64
|
+
- **How the result shows**: done, failed, accepted or cancelled on the card.
|
|
65
|
+
|
|
66
|
+
## Interaction and links
|
|
67
|
+
|
|
68
|
+
- **Writes**: with "Allow the Agent to set filters and the selected object" on, the Agent can set the page's filters (for example "only overdue") and the selected object, then tell the user what the page shows now; with it off it cannot and only tells the user where to click. Only the front-end Agent has this for now.
|
|
69
|
+
- **Reads**: the "Current object" selection filter, which "this" and "it" refer to; also all the page's filters and the base date.
|
|
70
|
+
- Display: floating (folded to a slim vertical tab on the lower right edge of the page, which leaves room for it so it covers nothing; opens on click), side panel (fixed at the right, can fold), or fixed (in the grid, height 280 to 800). Floating and side chats keep the conversation while folded.
|
|
71
|
+
- 0 to 6 suggested questions show while the chat is empty; a click sends one.
|
|
72
|
+
|
|
73
|
+
## Recipes
|
|
74
|
+
|
|
75
|
+
### Supply chain control: follow up "why is this batch of orders short of material"
|
|
76
|
+
|
|
77
|
+
| Role | Maps to |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| Queryable objects | Orders, work orders, material requirements, materials (the page's data sources plus relations in the network) |
|
|
80
|
+
| Current object | The order selected in the object table |
|
|
81
|
+
| Suggestible actions | "Chase purchasing" |
|
|
82
|
+
|
|
83
|
+
**What the knowledge network needs:** relations order → work order → material requirement → material; stock and arrival dates on materials; a "Chase purchasing" action; a "short of material" logical property on work orders.
|
|
84
|
+
|
|
85
|
+
**Checks:** select an order and ask "why is this one short"; the answer cites materials and arrival dates and says which relation it went through; ask it to "only show overdue orders" and the page table filters; when it suggests chasing, a card appears, a click opens the confirmation listing the objects, and nothing runs until the user confirms.
|
|
86
|
+
|
|
87
|
+
## Guidance for AI
|
|
88
|
+
|
|
89
|
+
1. Ask first: who answers (front-end Agent, built-in BKN Agent, external Agent), where it sits (floating, side or fixed), whether the Agent may change page filters, whether it may suggest actions, and which definitions go into the extra instructions.
|
|
90
|
+
2. Default to the front-end Agent, which reads the page, sets filters and suggests actions; with the built-in BKN Agent or an external Agent, setting filters and suggesting actions are unavailable, and say so plainly. An external Agent must first be registered and published in the execution factory by an administrator, and users need execute permission on it; leave "Hand over the user's sign-in token" off unless the user trusts that Agent and asks for it.
|
|
91
|
+
3. The front-end Agent needs a default model available in the model factory.
|
|
92
|
+
4. For clicks on other components to be answered in place, put this chat on the page; without it they are answered in a drawer.
|
|
93
|
+
5. Common mistakes:
|
|
94
|
+
- Keeping a definition only in the extra instructions, over 600 characters or disagreeing with the knowledge network.
|
|
95
|
+
- Choosing the built-in BKN Agent but expecting it to set page filters or suggest actions.
|
|
96
|
+
- Allowing it to set filters when no component follows those filters, so the page does not change.
|
|
97
|
+
- Expecting the Agent to run an action itself: it only suggests, and nothing runs before the user confirms.
|
|
98
|
+
- Choosing an external Agent without picking its service and tool, or with an unpublished service: the chat says it is unavailable and takes no questions.
|
|
99
|
+
- Fixed display in a narrow cell, leaving the chat too small; use floating or side there.
|
|
100
|
+
|
|
101
|
+
## Limits
|
|
102
|
+
|
|
103
|
+
- Extra instructions up to 600 characters; up to 6 suggested questions; fixed height 280 to 800.
|
|
104
|
+
- The front-end Agent takes at most 12 steps per question and 50 objects per query.
|
|
105
|
+
- Setting filters, action suggestions and what-if suggestions are supported only by the front-end Agent.
|
|
106
|
+
- An external Agent is waited on for up to a minute per call, and asked after a run still going for up to 10 minutes in all.
|
|
107
|
+
- One action suggestion runs on at most 100 objects.
|
|
108
|
+
- The Agent's answers come from query results and are not saved to the knowledge network.
|
|
109
|
+
|
|
110
|
+
### Selecting an agent within a service
|
|
111
|
+
|
|
112
|
+
When an MCP exposes list_agents returning structuredContent.agents: [{id, name}] and an ask tool accepting agent_id, builders can choose a default agent. Enable runtime agent switching to show the selector. Switching clears the conversation and creates a new conversation ID; switching is disabled while a reply is pending. Like ask, list_agents is sent only the parameters it declares: \`app_id\`, \`kn_id\`, \`workspace_id\`, and \`bkn_token\` when "Hand over the user's sign-in token" is on (the builder's own token in the builder). The server decides which agents to list and whether a call may run: one that declares these parameters can filter by app and user; one that does not can only go by the integration account. When a default agent is chosen, the chat also calls list_agents on opening, even with switching off, and asks nothing until it answers (a question from a click is sent once it does): if the chosen agent is not in the result, it shows "Agent unavailable", takes no questions, and does not show the agent's name; if the list cannot be read, questions go ahead and the server decides. Servers without list_agents keep their behavior.
|
|
113
|
+
`;
|
|
114
|
+
export {
|
|
115
|
+
e as default
|
|
116
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const n = `# 告警(alertList)
|
|
2
|
+
|
|
3
|
+
按事先写好的规则,实时列出当前命中的对象,按严重程度排序。用来回答“现在有哪些对象需要关注”,点一条规则就把页面收窄到它命中的对象。
|
|
4
|
+
|
|
5
|
+
## 适用与不适用
|
|
6
|
+
|
|
7
|
+
- 适用:规则能用对象自身的属性(或沿关系查不到记录)表达,要看此刻有多少对象命中,例如已超期的工单、没有任何出货记录的订单、库存低于安全线的物料。
|
|
8
|
+
- 不适用:
|
|
9
|
+
- 告警要有负责人、处理状态、核实与关闭:用事件列表(\`eventList\`)和事件登记(\`eventReport\`)。
|
|
10
|
+
- 规则要读多个对象、复杂计算或外部数据:先在知识网络里做成逻辑属性,再在这里按取值判断。
|
|
11
|
+
- 只想按某个字段筛选:用下拉筛选(\`dropdownFilter\`)或分段筛选(\`segmentedFilter\`)。
|
|
12
|
+
|
|
13
|
+
## 本体契约
|
|
14
|
+
|
|
15
|
+
| 角色 | 对象类要求 | 必要的属性 | 关系 | 必填 |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| 被检查的对象 | 数据源的对象类:工单、订单、物料 | 规则条件用到的属性;名称属性(展开列表显示) | — | 是 |
|
|
18
|
+
| 缺失关联 | 规则要求“查不到记录”时,关联的对象类 | — | 从被检查对象出发的关系路径 | 否 |
|
|
19
|
+
|
|
20
|
+
规则条件可以用数据源的进度列(如进度状态、超期天数)和计算列。更复杂的业务判断(风险高低、是否加急)应做成知识网络的逻辑属性或数据源的计算列,规则里只写“等于某值”。
|
|
21
|
+
|
|
22
|
+
## 组件内置的判断
|
|
23
|
+
|
|
24
|
+
- 条件:一条规则由若干条件组成,须全部满足才算命中;比较方式有已填写、为空、等于、不等于、属于、早于、不晚于、晚于、不早于、大于、不小于、小于、不大于。日期可与另一字段或页面基准日期比较。
|
|
25
|
+
- 缺失关联:同时给“关联对象类”和“关系路径”时,再要求沿路径查不到任何记录;两者须一起填。
|
|
26
|
+
- 每条规则至少要有一个条件,或设置了缺失关联。
|
|
27
|
+
- 排序:按严重程度(严重、关注、提示)排列,同级按命中数从多到少。
|
|
28
|
+
- 命中数:按页面筛选后的对象和当前基准日期计算;0 命中的规则也列出,不能点击。
|
|
29
|
+
|
|
30
|
+
## 扩展点
|
|
31
|
+
|
|
32
|
+
无。组件只按配置的条件计数,不调用外部工具;行业判断请做成知识网络里的逻辑属性或数据源计算列,规则里引用其取值。
|
|
33
|
+
|
|
34
|
+
## 交互与联动
|
|
35
|
+
|
|
36
|
+
- **写入**:点击规则,把它命中的对象写入“点击规则写入”的对象集合筛选(再点一次取消);点击展开列表中的对象,写入“点击对象写入”的选中筛选,供对象详情、关系子图等读取。
|
|
37
|
+
- **读取**:跟随页面的“跟随的筛选”和基准日期。
|
|
38
|
+
- 展开显示条数 3 到 20,超出的显示“另有 N 个”;“命中对象的附加显示字段”可在名称旁显示一个属性。
|
|
39
|
+
- 可配置点击规则、点击对象时的按钮:向 Agent 提问,或对命中的对象执行行动(见按钮 \`actionButton\` 的执行确认)。
|
|
40
|
+
|
|
41
|
+
## 场景配方
|
|
42
|
+
|
|
43
|
+
### 工单超期预警:哪些工单已经或即将拖期
|
|
44
|
+
|
|
45
|
+
| 角色 | 对应 |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| 被检查的对象 | 生产工单 |
|
|
48
|
+
| 规则 | 严重:进度状态为已超期;关注:超期天数大于 0 且小于 3;提示:未登记负责人 |
|
|
49
|
+
|
|
50
|
+
**知识网络中要有:** 工单的计划完成日期;数据源设置了进度(才有进度状态与超期天数);负责人属性。
|
|
51
|
+
|
|
52
|
+
**检查项:** 把基准日期往后调,命中数增加;点“严重”规则,对象表只剩这些工单;展开后点某张工单,对象详情打开。
|
|
53
|
+
|
|
54
|
+
### 无出货订单:已下单却没有发货记录
|
|
55
|
+
|
|
56
|
+
| 角色 | 对应 |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| 被检查的对象 | 销售订单(条件:订单状态等于已确认) |
|
|
59
|
+
| 缺失关联 | 发货单,路径:订单 → 发货单 |
|
|
60
|
+
|
|
61
|
+
**知识网络中要有:** 订单到发货单的关系。
|
|
62
|
+
|
|
63
|
+
**检查项:** 补一张发货单后,该订单从命中列表中消失。
|
|
64
|
+
|
|
65
|
+
## 给 AI 的指引
|
|
66
|
+
|
|
67
|
+
1. 先问用户:要提醒哪些情况、各算哪一级、点了规则之后要联动哪个表。每条规则写成业务语言的名称。
|
|
68
|
+
2. 规则条件里引用的属性必须在数据源里;业务判断没有对应属性时,列出要补的逻辑属性,不要把复杂判断拆成多个条件硬凑。
|
|
69
|
+
3. 页面上要有一个对象集合筛选来接“点击规则写入”,另有一个选中筛选来接“点击对象写入”,否则点击没有效果;两者都要被对象表、对象详情等读取。
|
|
70
|
+
4. 常见错误:
|
|
71
|
+
- “无关联记录”只填了关系路径没填关联对象类,或相反。
|
|
72
|
+
- 一条规则既没条件也没缺失关联。
|
|
73
|
+
- 以为多个条件是“或”:条件须全部满足,要“或”就拆成两条规则。
|
|
74
|
+
- 规则超过 8 条,或把需要负责人与处理流程的告警放在这里,应改用事件列表。
|
|
75
|
+
|
|
76
|
+
## 限制
|
|
77
|
+
|
|
78
|
+
- 规则 1 到 8 条;展开显示 3 到 20 条。
|
|
79
|
+
- 只计算此刻命中,不保存历史,也没有负责人、处理状态。
|
|
80
|
+
- 缺失关联查询需要读取关系,命中数加载时显示转圈。
|
|
81
|
+
`;
|
|
82
|
+
export {
|
|
83
|
+
n as default
|
|
84
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const e = `# Alerts (alertList)
|
|
2
|
+
|
|
3
|
+
Lists, in real time, the objects that hit rules written beforehand, most severe first. Use it to answer "which objects need attention now"; click a rule and the page narrows to the objects it hits.
|
|
4
|
+
|
|
5
|
+
## When to use it and when not
|
|
6
|
+
|
|
7
|
+
- Use it when a rule can be written with the object's own properties (or "no records along a relation") and you want to see how many objects hit it right now, for example overdue work orders, orders with no shipment, materials below the safety level.
|
|
8
|
+
- Do not use it:
|
|
9
|
+
- When alerts need an owner, a handling state, verifying and closing: use the event list (\`eventList\`) and event report (\`eventReport\`).
|
|
10
|
+
- When a rule must read several objects, compute heavily or use outside data: make it a logical property in the knowledge network first, then judge its value here.
|
|
11
|
+
- To filter by one field only: use the dropdown filter (\`dropdownFilter\`) or segmented filter (\`segmentedFilter\`).
|
|
12
|
+
|
|
13
|
+
## Ontology contract
|
|
14
|
+
|
|
15
|
+
| Role | Object type | Required properties | Relations | Required |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| Checked object | The data source's object type: work orders, orders, materials | The properties the rule conditions use; a name property (shown in the expanded list) | — | Yes |
|
|
18
|
+
| Missing link | When a rule asks for "no records", the related object type | — | A relation path from the checked object | No |
|
|
19
|
+
|
|
20
|
+
Rule conditions can use the data source's progress columns (such as progress status and overdue days) and computed columns. Harder business judgements (risk level, rush) belong in logical properties on the knowledge network or computed columns of the data source; the rule then only says "equals a value".
|
|
21
|
+
|
|
22
|
+
## Built-in checks
|
|
23
|
+
|
|
24
|
+
- Conditions: a rule is a set of conditions that must all hold to hit; the comparisons are is set, is empty, equals, not equals, in, before, on or before, after, on or after, greater than, at least, less than, at most. A date can be compared with another field or the page's base date.
|
|
25
|
+
- Missing link: when both "related object type" and "relation path" are given, the rule also requires that nothing is found along the path; the two go together.
|
|
26
|
+
- Each rule needs at least one condition or a missing-link setting.
|
|
27
|
+
- Order: by severity (severe, watch, hint), then by number of hits, most first.
|
|
28
|
+
- Hits: counted on the objects after the page's filters and at the current base date; rules with 0 hits are still listed and cannot be clicked.
|
|
29
|
+
|
|
30
|
+
## Extension points
|
|
31
|
+
|
|
32
|
+
None. The component only counts by the configured conditions and calls no outside tool; put industry judgements in logical properties on the knowledge network or computed columns of the data source, and refer to their values in rules.
|
|
33
|
+
|
|
34
|
+
## Interaction and links
|
|
35
|
+
|
|
36
|
+
- **Writes**: clicking a rule writes the objects it hits to the object-set filter set in "Write on click of rule" (click again to clear); clicking an object in the expanded list writes the selection filter set in "Write on click of object", for the object detail, related graph and others to read.
|
|
37
|
+
- **Reads**: follows the page's "Filters followed" and the base date.
|
|
38
|
+
- "Rows shown when expanded" is 3 to 20, the rest shown as "N more"; "Extra field shown for hit objects" puts one property beside the name.
|
|
39
|
+
- You can configure buttons on clicking a rule or an object: ask the Agent, or run an action on the hit objects (confirmation works as for the button \`actionButton\`).
|
|
40
|
+
|
|
41
|
+
## Recipes
|
|
42
|
+
|
|
43
|
+
### Work order overdue warning: which orders are late or about to be
|
|
44
|
+
|
|
45
|
+
| Role | Maps to |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| Checked object | Production work orders |
|
|
48
|
+
| Rules | Severe: progress status is overdue; watch: overdue days above 0 and below 3; hint: no owner recorded |
|
|
49
|
+
|
|
50
|
+
**What the knowledge network needs:** a planned finish date on the work order; progress set on the data source (it gives progress status and overdue days); an owner property.
|
|
51
|
+
|
|
52
|
+
**Checks:** move the base date later and the hit counts grow; click the severe rule and the object table shows only those orders; expand and click an order and the object detail opens.
|
|
53
|
+
|
|
54
|
+
### Orders with no shipment: placed but not shipped
|
|
55
|
+
|
|
56
|
+
| Role | Maps to |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| Checked object | Sales orders (condition: status equals confirmed) |
|
|
59
|
+
| Missing link | Shipment, path: order → shipment |
|
|
60
|
+
|
|
61
|
+
**What the knowledge network needs:** a relation from order to shipment.
|
|
62
|
+
|
|
63
|
+
**Checks:** add one shipment and that order leaves the hit list.
|
|
64
|
+
|
|
65
|
+
## Guidance for AI
|
|
66
|
+
|
|
67
|
+
1. Ask first: which situations to flag, which level each is, and which table should follow a click on a rule. Name each rule in business words.
|
|
68
|
+
2. Properties named in conditions must exist in the data source; when no property carries the business judgement, list the logical property to add instead of splitting a hard judgement into many conditions.
|
|
69
|
+
3. The page needs an object-set filter for "Write on click of rule" and a selection filter for "Write on click of object", or clicks do nothing; both must be read by an object table, object detail or similar.
|
|
70
|
+
4. Common mistakes:
|
|
71
|
+
- "No related records" with only the relation path or only the related object type.
|
|
72
|
+
- A rule with neither conditions nor a missing link.
|
|
73
|
+
- Taking several conditions as "or": all must hold, so split into two rules for "or".
|
|
74
|
+
- More than 8 rules, or putting alerts that need an owner and handling flow here; use the event list instead.
|
|
75
|
+
|
|
76
|
+
## Limits
|
|
77
|
+
|
|
78
|
+
- 1 to 8 rules; 3 to 20 rows when expanded.
|
|
79
|
+
- It computes only what hits now; it keeps no history and has no owner or handling state.
|
|
80
|
+
- Missing-link rules read relations, so the count shows a spinner while loading.
|
|
81
|
+
`;
|
|
82
|
+
export {
|
|
83
|
+
e as default
|
|
84
|
+
};
|