@celljs/ta 4.15.1 → 4.16.0
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/dist/cli.mjs +7 -3
- package/dist/gateway.mjs +2047 -288
- package/dist/pi/CHANGELOG.md +15 -0
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-3d/package.json +1 -1
- package/dist/pi/packages/ta-agents/extension/index.mjs +8 -6
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js +5 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +0 -2
- package/dist/pi/packages/ta-agents/lib/agent-session.js +1 -5
- package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts +7 -2
- package/dist/pi/packages/ta-agents/lib/agent-turn.js +8 -4
- package/dist/pi/packages/ta-agents/package.json +1 -1
- package/dist/pi/packages/ta-bots/host/index.mjs +40 -3
- package/dist/pi/packages/ta-bots/package.json +1 -1
- package/dist/pi/packages/ta-changes/package.json +1 -1
- package/dist/pi/packages/ta-channels/host/index.mjs +41 -3
- package/dist/pi/packages/ta-channels/package.json +1 -1
- package/dist/pi/packages/ta-computer-use/package.json +1 -1
- package/dist/pi/packages/ta-cron/package.json +1 -1
- package/dist/pi/packages/ta-extensions/package.json +1 -1
- package/dist/pi/packages/ta-extensions/web/index.js +40 -3
- package/dist/pi/packages/ta-games/package.json +1 -1
- package/dist/pi/packages/ta-glance/README.en.md +2 -0
- package/dist/pi/packages/ta-glance/README.md +2 -0
- package/dist/pi/packages/ta-glance/extension/index.mjs +110 -21
- package/dist/pi/packages/ta-glance/lib/card.js +88 -8
- package/dist/pi/packages/ta-glance/lib/glance-prompt.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/glance-prompt.js +7 -4
- package/dist/pi/packages/ta-glance/lib/glance-protocol.d.ts +34 -2
- package/dist/pi/packages/ta-glance/lib/glance-protocol.js +39 -1
- package/dist/pi/packages/ta-glance/lib/glance-spec.js +93 -19
- package/dist/pi/packages/ta-glance/lib/glance-util.d.ts +13 -0
- package/dist/pi/packages/ta-glance/lib/glance-util.js +28 -0
- package/dist/pi/packages/ta-glance/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/style.js +65 -2
- package/dist/pi/packages/ta-glance/package.json +1 -1
- package/dist/pi/packages/ta-glance/web/index.js +330 -34
- package/dist/pi/packages/ta-initiative/package.json +1 -1
- package/dist/pi/packages/ta-launcher/package.json +1 -1
- package/dist/pi/packages/ta-manual/package.json +1 -1
- package/dist/pi/packages/ta-moments/extension/index.mjs +40 -3
- package/dist/pi/packages/ta-moments/host/index.mjs +40 -3
- package/dist/pi/packages/ta-moments/package.json +1 -1
- package/dist/pi/packages/ta-moments/web/index.js +40 -3
- package/dist/pi/packages/ta-nearby/package.json +1 -1
- package/dist/pi/packages/ta-notify/package.json +1 -1
- package/dist/pi/packages/ta-plot/package.json +1 -1
- package/dist/pi/packages/ta-recall/package.json +1 -1
- package/dist/pi/packages/ta-rooms/package.json +1 -1
- package/dist/pi/packages/ta-share/package.json +1 -1
- package/dist/pi/packages/ta-sync/package.json +1 -1
- package/dist/pi/packages/ta-sync-cloud/package.json +1 -1
- package/dist/pi/packages/ta-team/package.json +1 -1
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/pi/packages/ta-workspace/web/index.js +40 -3
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-CD8CaArq.js → abnfDiagram-S7VZAUFO-FSEuUCgT.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-f2a9bodL.js → architecture-WOLXFQ4H-Do_DyWCg.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-BCWH9CwO.js → architectureDiagram-YGSQEFNW-D-N2qDs4.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-fUamQMeJ.js → blockDiagram-APKKGZFW-Ds6DzHNZ.js} +1 -1
- package/dist/public/assets/{browser-CrMa174j.js → browser-KlrZxPbE.js} +1 -1
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-CkLtnwp1.js → c4Diagram-KJ2TOQU5-D5ZdqxrP.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-cwcGPuAH.js → chunk-6MUBBAK2-CWOwhB3b.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-DNkmkYfC.js → chunk-AXFCVDMN-Dr6p2RGg.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-C8qbbr2Z.js → chunk-BG4553SI-DUCV_pmW.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-C-PJ2CrJ.js → chunk-DQASFODM-Yxd3jIXM.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-BYcgxNEL.js → chunk-HFQBQIA3-C24I15MF.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-BTDNzrRl.js → chunk-KQLB2F66-Dxk-aejD.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-1sGg1pKP.js → chunk-KS47KZWR-DPyr7gb8.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-7lAsFwHT.js → chunk-LEVMRMFU-D_mEFJGR.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-C8K-ltig.js → chunk-M57EVK23-DfMFxQib.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-CBe1QL_V.js → chunk-OY52VR5R-O9W83Laa.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-COhYyyE_.js → chunk-QB3YPZ4I-IdikGcw1.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-CREAgaSS.js → chunk-R3KSYZAL-DLpaFCvz.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-CTl0P8_C.js → chunk-STOXU5M4-Lx-CZ4Ql.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-B_GG7baF.js → chunk-TU62E6Q5-DCnr5NsA.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-CDrSpVOj.js → chunk-X4PVCEUW-Ct7aUJFY.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-sKeiDEnC.js → chunk-XXDRQBXY-CQhxfoYw.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-Cqo1O5FQ.js → classDiagram-v2-L25IHNXF-DPSu5qYq.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-CTSKeRBe.js → cose-bilkent-JH36ORCC-CFimsFsN.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-Dcc0sCHf.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-67xEPyP9.js → cynefinDiagram-L36ESFBY-CiAWhkVp.js} +1 -1
- package/dist/public/assets/{d3-selection-BUiX-3qh.js → d3-selection-C8RIDfkO.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-DDw-u3Kg.js → dagre-SPEB5RXH-l1nRD1Fx.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-BBFInaCs.js → diagram-3B7GL73J-ipqtnhoX.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-ZdnFKM7-.js → diagram-DNEMPZML-VpIcHRUP.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-CPb04hOv.js → diagram-L3MUGCDN-8VdVmcS6.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-P9wHFGDS.js → diagram-LA4NIPWU-Bej-aiF0.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-Ce_Cr-t6.js → diagram-MHCOC4E2-D8gW4bVQ.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-CfS34OHW.js → diagram-XPFHEONP-BMevAJ1M.js} +1 -1
- package/dist/public/assets/{dist-6pZqZEaM.js → dist-DBKJcjvW.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-BkHabCn2.js → ebnfDiagram-UZSYDL2S-C3HDTOzn.js} +1 -1
- package/dist/public/assets/{editor.api-CO4Q0NKb.js → editor.api-BMWdjwhK.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-JpreOVeR.js → elk-XV6XMXQE-XOOPrVin.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-DDFJwzHx.js → erDiagram-EYBAPDEH-Cr-vwx1l.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-DsnkF6Zc.js → eventmodeling-K75KTNOO-DbPhpfxn.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-CDXqnHAQ.js +1 -0
- package/dist/public/assets/{freemarker2-Cm4NK652.js → freemarker2-6h_1-8qB.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-C7eedoYb.js → ganttDiagram-23REXITY-C7kNPXx3.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-KPsoB6Z1.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-Cuh3ih-z.js → gitGraphDiagram-STJD7YCW-CVnEJEZr.js} +1 -1
- package/dist/public/assets/{handlebars-BnE51DUi.js → handlebars-F4lp3oLr.js} +1 -1
- package/dist/public/assets/{html-7koekDfa.js → html-Dj6f8B_g.js} +1 -1
- package/dist/public/assets/{index-CQG1XddL.js → index-DnNrrk68.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-CtM6s0SQ.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-BY3iq7I8.js → infoDiagram-KBXO4MBG-DcttQWdp.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-COjlz24y.js → ishikawaDiagram-M35NCXHK-BSUYTZf6.js} +1 -1
- package/dist/public/assets/{javascript-BUZgUhdn.js → javascript-b_BkOE5Y.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-DReJE04Q.js → journeyDiagram-OPLOXDXO-BCfd5-6n.js} +1 -1
- package/dist/public/assets/{jsonMode-qPeVDBDp.js → jsonMode-Cq5QJbVZ.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-BB0_ePvg.js → kanban-definition-BZKZHSQY-B3nenaw_.js} +1 -1
- package/dist/public/assets/{liquid-CNKL9dLX.js → liquid-CGuZI_Aa.js} +1 -1
- package/dist/public/assets/{mdx-D1_UzrBc.js → mdx-Dt9yTqnf.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-DiE3z_tV.js → mermaid-parser.core-CquzROwT.js} +3 -3
- package/dist/public/assets/{mermaid.core-CBCRrLdl.js → mermaid.core-Bx-e_Scq.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-D-Y5fKl1.js → mindmap-definition-I2QAS2VK-DyeewbnH.js} +1 -1
- package/dist/public/assets/module-C-ofp7U4.js +1 -0
- package/dist/public/assets/module-dnDlIzeV.js +2616 -0
- package/dist/public/assets/{monaco--czRbHhk.js → monaco-nvIdDTWu.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-XKjiwdar.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-1jx5jc73.js → pegDiagram-FD4XPPHP-B884_KoR.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-MuCMavHL.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-DGv_WCCu.js → pieDiagram-J4AKIIQI-I40wRwyy.js} +1 -1
- package/dist/public/assets/{python-DNZu5LjV.js → python-Djw4wvG9.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-BgY0lf8V.js → quadrantDiagram-XTYBLID2-DyNOImfk.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-Cq12GHJS.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-CfeMswZU.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-tZ7rJxwM.js → railroad-abnf-LNEFI6M7-3G0zWzgf.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-JO6n_1TK.js → railroad-ebnf-DWYD2UWJ-B5XRDRWS.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-Bf0PG2YJ.js → railroad-peg-JR7BVNR7-rcIioIyH.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-BMjog84X.js → railroadDiagram-MRQ6NCDL-CDM2ahQM.js} +1 -1
- package/dist/public/assets/{razor-DU-x8qSP.js → razor-CStezNUn.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-CktbbWjr.js → requirementDiagram-Y7LWUY3S-hbb6WtfM.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-CQonOre7.js → sankeyDiagram-WGJFYUXA-DLV3Aoae.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-CAe8-JvA.js → sequenceDiagram-5NDRBG5M-BWxOV5U9.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-BrkqOuRm.js → stateDiagram-v2-FJ4FJNEA-C-TaUPaQ.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-sLpgHBKo.js → swimlanes-UMQ2AFYF-CJY0BFmc.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-DdFDl6aK.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-CHE0x-WN.js → timeline-definition-SEUHKTQE-CUfQb8Gv.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-BQ4uUy4s.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-BFTTkjF9.js +1 -0
- package/dist/public/assets/{typescript-BrNT2oWW.js → typescript-B7kmi8MF.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-DwkFRI5R.js → usecaseDiagram-AFA6YXN4-BKTVAp-G.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-BquQVmJq.js → vennDiagram-NNMJR3RB-CN1RxNTS.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-BbyzsA8S.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-sNYFUfMe.js → wardleyDiagram-S7YFUSEH-JJ6qcpu1.js} +1 -1
- package/dist/public/assets/{xml-BY65QKv7.js → xml-DVamlHEU.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-CnWEYuid.js → xychartDiagram-GGNKY7IX-BNakYgUZ.js} +1 -1
- package/dist/public/assets/{yaml-BMovUwzO.js → yaml-BihGeFrM.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/serve/index.mjs +5965 -5227
- package/package.json +39 -39
- package/dist/public/assets/cynefin-EF2NZ3EQ-CP12ndt7.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-Djxeacjw.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-qlWN7ijl.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-jN69V28z.js +0 -1
- package/dist/public/assets/module-BEbKICB1.js +0 -2475
- package/dist/public/assets/module-Egyx6Otv.js +0 -1
- package/dist/public/assets/packet-JDAUHWVQ-Cl8QuXQJ.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-kVGJsGZe.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-Dw71L-n8.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-DkaUvI4_.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-amBdr5Wc.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-DKLyFqZk.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-CRG6ogj8.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-D2jQfflX.js +0 -1
|
@@ -177,9 +177,44 @@ var GlanceJson;
|
|
|
177
177
|
// web-src/glance-protocol.ts
|
|
178
178
|
var NAME = "@celljs/ta-glance";
|
|
179
179
|
var LANGUAGE = "ta-glance";
|
|
180
|
+
var GLANCE_ICONS = [
|
|
181
|
+
"Zap",
|
|
182
|
+
"Gauge",
|
|
183
|
+
"Timer",
|
|
184
|
+
"Cpu",
|
|
185
|
+
"MemoryStick",
|
|
186
|
+
"HardDrive",
|
|
187
|
+
"TrendingUp",
|
|
188
|
+
"TrendingDown",
|
|
189
|
+
"Code",
|
|
190
|
+
"GitBranch",
|
|
191
|
+
"Bug",
|
|
192
|
+
"FlaskConical",
|
|
193
|
+
"Package",
|
|
194
|
+
"SquareTerminal",
|
|
195
|
+
"Database",
|
|
196
|
+
"Server",
|
|
197
|
+
"Globe",
|
|
198
|
+
"Shield",
|
|
199
|
+
"Lock",
|
|
200
|
+
"KeyRound",
|
|
201
|
+
"Users",
|
|
202
|
+
"MessageCircle",
|
|
203
|
+
"Smartphone",
|
|
204
|
+
"Laptop",
|
|
205
|
+
"Rocket",
|
|
206
|
+
"Wrench",
|
|
207
|
+
"Lightbulb",
|
|
208
|
+
"Coins",
|
|
209
|
+
"Calendar",
|
|
210
|
+
"FileText",
|
|
211
|
+
"Sparkles"
|
|
212
|
+
];
|
|
180
213
|
|
|
181
214
|
// web-src/glance-spec.ts
|
|
182
215
|
var ITEMS = 12;
|
|
216
|
+
var POINTS = 24;
|
|
217
|
+
var SERIES = 4;
|
|
183
218
|
var BLOCKS = 8;
|
|
184
219
|
var TEXT = 400;
|
|
185
220
|
var MARKDOWN = 8000;
|
|
@@ -208,7 +243,7 @@ function oneOf(value, values) {
|
|
|
208
243
|
const lower = typeof value === "string" ? value.trim().toLowerCase() : undefined;
|
|
209
244
|
return values.find((candidate) => candidate === lower);
|
|
210
245
|
}
|
|
211
|
-
function items(value, read) {
|
|
246
|
+
function items(value, read, max = ITEMS) {
|
|
212
247
|
if (!Array.isArray(value)) {
|
|
213
248
|
return [];
|
|
214
249
|
}
|
|
@@ -218,14 +253,41 @@ function items(value, read) {
|
|
|
218
253
|
if (made !== undefined) {
|
|
219
254
|
out.push(made);
|
|
220
255
|
}
|
|
221
|
-
if (out.length ===
|
|
256
|
+
if (out.length === max) {
|
|
222
257
|
break;
|
|
223
258
|
}
|
|
224
259
|
}
|
|
225
260
|
return out;
|
|
226
261
|
}
|
|
262
|
+
function icon(value) {
|
|
263
|
+
if (typeof value !== "string") {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const words = value.trim().replace(/^lucide[:\-_\s]*/i, "").split(/[-_\s.:]+/).filter(Boolean);
|
|
267
|
+
const name = words.map((word) => word[0].toUpperCase() + word.slice(1)).join("");
|
|
268
|
+
return /^[A-Z][A-Za-z0-9]{0,39}$/.test(name) ? name : undefined;
|
|
269
|
+
}
|
|
270
|
+
function withIcon(value) {
|
|
271
|
+
const name = icon(value?.icon);
|
|
272
|
+
return name ? { icon: name } : {};
|
|
273
|
+
}
|
|
227
274
|
function strings(value, max = ITEMS) {
|
|
228
|
-
return items(value, (item) => text(item) ?? text(object(item)?.label) ?? text(object(item)?.text)
|
|
275
|
+
return items(value, (item) => text(item) ?? text(object(item)?.label) ?? text(object(item)?.text), max);
|
|
276
|
+
}
|
|
277
|
+
function numbers(value, max = POINTS) {
|
|
278
|
+
return items(value, number, max);
|
|
279
|
+
}
|
|
280
|
+
function amount(entry) {
|
|
281
|
+
const value = object(entry);
|
|
282
|
+
const label = text(value?.label);
|
|
283
|
+
const shown = number(value?.value);
|
|
284
|
+
return label && shown !== undefined ? { label, value: shown } : undefined;
|
|
285
|
+
}
|
|
286
|
+
function series(entry) {
|
|
287
|
+
const value = object(entry);
|
|
288
|
+
const values = numbers(Array.isArray(entry) ? entry : value?.values ?? value?.data);
|
|
289
|
+
const label = text(value?.label ?? value?.name);
|
|
290
|
+
return values.length ? { values, ...label ? { label } : {} } : undefined;
|
|
229
291
|
}
|
|
230
292
|
function stat(item) {
|
|
231
293
|
const value = object(item);
|
|
@@ -236,11 +298,12 @@ function stat(item) {
|
|
|
236
298
|
}
|
|
237
299
|
const tone = oneOf(value?.tone, TONES);
|
|
238
300
|
const delta = text(value?.delta);
|
|
239
|
-
|
|
301
|
+
const trend = numbers(value?.trend);
|
|
302
|
+
return { label, value: shown, ...tone ? { tone } : {}, ...delta ? { delta } : {}, ...withIcon(value), ...trend.length > 1 ? { trend } : {} };
|
|
240
303
|
}
|
|
241
304
|
function change(item) {
|
|
242
305
|
const value = object(item);
|
|
243
|
-
const path = text(value?.path ?? item);
|
|
306
|
+
const path = text(value?.path ?? value?.file ?? item);
|
|
244
307
|
if (!path) {
|
|
245
308
|
return;
|
|
246
309
|
}
|
|
@@ -273,13 +336,28 @@ function option(item) {
|
|
|
273
336
|
...detail ? { detail } : {},
|
|
274
337
|
pros: strings(value?.pros, 4),
|
|
275
338
|
cons: strings(value?.cons, 4),
|
|
276
|
-
...value?.recommended === true ? { recommended: true } : {}
|
|
339
|
+
...value?.recommended === true ? { recommended: true } : {},
|
|
340
|
+
...withIcon(value)
|
|
277
341
|
};
|
|
278
342
|
}
|
|
279
343
|
function note(item) {
|
|
280
344
|
const value = object(item);
|
|
281
345
|
const shown = text(value?.text ?? item);
|
|
282
|
-
return shown ? { text: shown, tone: oneOf(value?.tone, NOTES) ?? "info" } : undefined;
|
|
346
|
+
return shown ? { text: shown, tone: oneOf(value?.tone, NOTES) ?? "info", ...withIcon(value) } : undefined;
|
|
347
|
+
}
|
|
348
|
+
function listItem(entry) {
|
|
349
|
+
const value = object(entry);
|
|
350
|
+
const shown = text(entry) ?? text(value?.text) ?? text(value?.label);
|
|
351
|
+
return shown ? { text: shown, ...withIcon(value) } : undefined;
|
|
352
|
+
}
|
|
353
|
+
function point(item) {
|
|
354
|
+
const value = object(item);
|
|
355
|
+
const head = text(value?.title ?? value?.label);
|
|
356
|
+
const body = text(value?.detail ?? value?.note ?? value?.text ?? value?.description);
|
|
357
|
+
if (!value || !head) {
|
|
358
|
+
return note(value ? { text: body } : item);
|
|
359
|
+
}
|
|
360
|
+
return { text: body ? `**${head}** ${body}` : head, tone: "info" };
|
|
283
361
|
}
|
|
284
362
|
function isPath(value) {
|
|
285
363
|
return !/[,。;!?、]/.test(value) && (!/\s/.test(value) || /[\\/]/.test(value));
|
|
@@ -296,8 +374,9 @@ function block(item, partial, labels) {
|
|
|
296
374
|
}
|
|
297
375
|
case "changes": {
|
|
298
376
|
const raw = Array.isArray(value?.items) ? value.items : [];
|
|
299
|
-
|
|
300
|
-
|
|
377
|
+
const pathless = (entry) => typeof entry === "string" ? !isPath(entry) : !!object(entry) && !text(object(entry)?.path ?? object(entry)?.file);
|
|
378
|
+
if (raw.length && raw.every(pathless)) {
|
|
379
|
+
const list2 = items(raw, point);
|
|
301
380
|
return list2.length ? { type: "notes", items: list2 } : undefined;
|
|
302
381
|
}
|
|
303
382
|
const list = items(value?.items, change);
|
|
@@ -329,16 +408,23 @@ function block(item, partial, labels) {
|
|
|
329
408
|
return rows.length ? { type: "table", columns: ["", labels.before, labels.after], rows } : undefined;
|
|
330
409
|
}
|
|
331
410
|
case "bars": {
|
|
332
|
-
const list = items(value?.items,
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
});
|
|
411
|
+
const list = items(value?.items, amount);
|
|
412
|
+
return list.length ? { type, items: list, ...unit ? { unit } : {} } : undefined;
|
|
413
|
+
}
|
|
414
|
+
case "line": {
|
|
415
|
+
const points = items(value?.items, amount, POINTS);
|
|
416
|
+
const lines = points.length ? [{ values: points.map((point2) => point2.value) }] : Array.isArray(value?.series) ? items(value.series, series, SERIES) : [series(value)].filter((line) => !!line);
|
|
417
|
+
const labels2 = points.length ? points.map((point2) => point2.label) : strings(value?.labels, POINTS);
|
|
418
|
+
const better = oneOf(value?.better, ["lower", "higher"]);
|
|
419
|
+
const drawn = lines.filter((line) => partial || line.values.length > 1);
|
|
420
|
+
return drawn.length ? { type, labels: labels2, series: drawn, ...unit ? { unit } : {}, ...better ? { better } : {} } : undefined;
|
|
421
|
+
}
|
|
422
|
+
case "share": {
|
|
423
|
+
const list = items(value?.items, amount, 6).filter((part) => part.value > 0);
|
|
338
424
|
return list.length ? { type, items: list, ...unit ? { unit } : {} } : undefined;
|
|
339
425
|
}
|
|
340
426
|
case "flow": {
|
|
341
|
-
const list =
|
|
427
|
+
const list = items(value?.items, listItem);
|
|
342
428
|
return list.length ? { type, items: list } : undefined;
|
|
343
429
|
}
|
|
344
430
|
case "diagram": {
|
|
@@ -360,7 +446,7 @@ function block(item, partial, labels) {
|
|
|
360
446
|
return list.length ? { type, items: list } : undefined;
|
|
361
447
|
}
|
|
362
448
|
case "next": {
|
|
363
|
-
const list =
|
|
449
|
+
const list = items(value?.items, listItem).slice(0, 3);
|
|
364
450
|
return list.length ? { type, items: list } : undefined;
|
|
365
451
|
}
|
|
366
452
|
case "details": {
|
|
@@ -492,18 +578,21 @@ How to reply:
|
|
|
492
578
|
The card: {"status": "done" | "partial" | "failed" | "blocked" | "info", "title"?: string, "blocks": [...]}
|
|
493
579
|
status: done = finished, partial = done in part, failed, blocked = waiting for the user, info = an answer, no work. Leave out title: the first line already says it.
|
|
494
580
|
Blocks, 1 to 4 of them, the most important first, each with only the fields shown. Every text a few words, in the user's language; inline Markdown works (**bold**, \`path/to/file\` opens the file).
|
|
495
|
-
- {"type":"stats","items":[{"label":"Tests","value":"128/128","tone":"good"},{"label":"Startup","value":"210 ms","delta":"-34%","tone":"good"}]}: key numbers, at most 6; tone good | bad | warn.
|
|
496
|
-
- {"type":"changes","items":[{"path":"src/a.ts","kind":"edit","add":12,"del":3,"note":"why, in a few words"}]}: files changed, a path each (
|
|
581
|
+
- {"type":"stats","items":[{"label":"Tests","value":"128/128","tone":"good"},{"label":"Startup","value":"210 ms","delta":"-34%","tone":"good","trend":[320,290,210]}]}: key numbers, at most 6; tone good | bad | warn; trend, its values over time when known, draws a small line.
|
|
582
|
+
- {"type":"changes","items":[{"path":"src/a.ts","kind":"edit","add":12,"del":3,"note":"why, in a few words"}]}: files changed, a path each (what changed without a file goes in notes); kind add | edit | delete.
|
|
497
583
|
- {"type":"steps","items":[{"text":"...","status":"done"}]}: progress or a plan; status done | doing | todo | failed | skipped.
|
|
498
584
|
- {"type":"compare","unit":"ms","better":"lower","items":[{"label":"Startup","before":320,"after":210}]}: before and after, numbers only (words go in a table).
|
|
499
585
|
- {"type":"bars","unit":"MB","items":[{"label":"ta","value":66},{"label":"pi","value":129}]}: amounts side by side.
|
|
500
|
-
- {"type":"
|
|
586
|
+
- {"type":"line","unit":"ms","better":"lower","labels":["11-01","11-08","11-15"],"series":[{"label":"Startup","values":[320,260,210]}]}: how values went over time, at most 4 series of 24 points.
|
|
587
|
+
- {"type":"share","unit":"MB","items":[{"label":"pi","value":129},{"label":"ta","value":66}]}: the parts of a whole.
|
|
588
|
+
- {"type":"flow","items":["Request",{"text":"Gateway","icon":"Server"},"Session","Model"]}: a sequence or a path.
|
|
501
589
|
- {"type":"diagram","mermaid":"graph LR; A-->B"}: relations a flow cannot show, under 12 nodes.
|
|
502
590
|
- {"type":"table","columns":["",""],"rows":[["",""]]}: a few rows that compare things on several points.
|
|
503
591
|
- {"type":"options","question":"Which one?","items":[{"label":"A","detail":"one line","pros":["..."],"cons":["..."],"recommended":true}]}: when the user must choose; each is a button that answers with its label.
|
|
504
592
|
- {"type":"notes","items":[{"text":"...","tone":"risk"}]}: risks, caveats, what the user must do; tone risk | info | todo.
|
|
505
593
|
- {"type":"next","items":["Run the e2e tests"]}: at most 3 things the user may well ask next, each a button that sends it.
|
|
506
|
-
- {"type":"details","title":"How","markdown":"..."}: what few will read, folded
|
|
594
|
+
- {"type":"details","title":"How","markdown":"..."}: what few will read, folded.
|
|
595
|
+
An item of stats, flow, options, notes or next may have "icon", where it tells items apart at a glance (an item of flow or next then {"text","icon"}): one of ${GLANCE_ICONS.join(", ")}; else leave it out. Never write an emoji, in a card or out of it.`;
|
|
507
596
|
|
|
508
597
|
// web-src/extension.ts
|
|
509
598
|
function activate(pi) {
|
|
@@ -11,6 +11,9 @@ const MARKS = /[*_`[\]$\\]/;
|
|
|
11
11
|
/** The squares of the bar of a changed file, as a forge draws them; a change of fewer lines than LINES fills fewer. */
|
|
12
12
|
const SQUARES = 5;
|
|
13
13
|
const LINES = 20;
|
|
14
|
+
/** The box charts are drawn in; the SVG stretches it to the width of the card, its strokes keep their width. */
|
|
15
|
+
const WIDTH = 300;
|
|
16
|
+
const HEIGHT = 100;
|
|
14
17
|
/** The last part of a path, its name. */
|
|
15
18
|
function fileName(path) {
|
|
16
19
|
return path.replace(/\/+$/, '').split('/').pop() || path;
|
|
@@ -38,16 +41,85 @@ function glanceCard(pi) {
|
|
|
38
41
|
return MARKS.test(text) ? (react_1.React.createElement("span", { className: "tag-inline" },
|
|
39
42
|
react_1.React.createElement(Markdown, { text: text }))) : (text);
|
|
40
43
|
}
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
/** An icon of the page by name; one it does not have (an older app, a name made up) is not drawn, or `fallback` instead. */
|
|
45
|
+
function Icon({ name, fallback, size = 14 }) {
|
|
46
|
+
const Found = (name && icons[name]) || (fallback && icons[fallback]);
|
|
43
47
|
return Found ? react_1.React.createElement(Found, { size: size, strokeWidth: 2 }) : null;
|
|
44
48
|
}
|
|
49
|
+
/** Whether the page draws the icon an item names. */
|
|
50
|
+
const has = (name) => !!name && !!icons[name];
|
|
51
|
+
/** A line of values in a box of the chart's size, with a faint area under the first line of a chart. */
|
|
52
|
+
function Polyline({ values, count, scale, area, index, }) {
|
|
53
|
+
const at = (0, glance_util_1.points)(values, count, scale, WIDTH, HEIGHT);
|
|
54
|
+
const line = at.map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`).join(' ');
|
|
55
|
+
const last = at[at.length - 1];
|
|
56
|
+
return (react_1.React.createElement("g", { className: "tag-series", "data-index": index },
|
|
57
|
+
area && at.length > 1 && react_1.React.createElement("polygon", { className: "tag-series-area", points: `0,${HEIGHT} ${line} ${last[0].toFixed(1)},${HEIGHT}` }),
|
|
58
|
+
react_1.React.createElement("polyline", { points: line, fill: "none", vectorEffect: "non-scaling-stroke" })));
|
|
59
|
+
}
|
|
60
|
+
/** The values of a key number over time, under it: no axes, the last one now. */
|
|
61
|
+
function Sparkline({ values }) {
|
|
62
|
+
return (react_1.React.createElement("svg", { className: "tag-spark", viewBox: `0 0 ${WIDTH} ${HEIGHT}`, preserveAspectRatio: "none", "aria-hidden": "true" },
|
|
63
|
+
react_1.React.createElement(Polyline, { values: values, count: values.length, scale: (0, glance_util_1.range)(values), area: true, index: 0 })));
|
|
64
|
+
}
|
|
65
|
+
function Line({ block }) {
|
|
66
|
+
const size = Math.max(block.labels.length, ...block.series.map(line => line.values.length));
|
|
67
|
+
const scale = (0, glance_util_1.range)(block.series.flatMap(line => line.values));
|
|
68
|
+
const unit = block.unit ? ` ${block.unit}` : '';
|
|
69
|
+
// The labels under it: the first, the last and one between, where they are.
|
|
70
|
+
const marks = [...new Set(size >= 5 ? [0, Math.round((size - 1) / 2), size - 1] : [0, size - 1])].filter(index => block.labels[index] !== undefined);
|
|
71
|
+
const where = (index) => (size > 1 ? (index / (size - 1)) * 100 : 50);
|
|
72
|
+
return (react_1.React.createElement("div", { className: "tag-line" },
|
|
73
|
+
react_1.React.createElement("div", { className: "tag-section-head tag-legend" }, block.series.map((line, index) => {
|
|
74
|
+
const first = line.values[0];
|
|
75
|
+
const last = line.values[line.values.length - 1];
|
|
76
|
+
const change = line.values.length > 1 ? (0, glance_util_1.percent)(first, last) : '';
|
|
77
|
+
const better = block.better === 'higher' ? last > first : last < first;
|
|
78
|
+
const tone = !block.better || last === first ? 'neutral' : better ? 'good' : 'bad';
|
|
79
|
+
return (react_1.React.createElement("span", { key: index, className: "tag-line-key", "data-index": index },
|
|
80
|
+
react_1.React.createElement("i", null),
|
|
81
|
+
line.label && react_1.React.createElement(Text, { text: line.label }),
|
|
82
|
+
react_1.React.createElement("b", null,
|
|
83
|
+
count(last),
|
|
84
|
+
unit),
|
|
85
|
+
change && (react_1.React.createElement("span", { className: "tag-delta", "data-tone": tone }, change))));
|
|
86
|
+
})),
|
|
87
|
+
react_1.React.createElement("div", { className: "tag-plot" },
|
|
88
|
+
react_1.React.createElement("div", { className: "tag-plot-area" },
|
|
89
|
+
react_1.React.createElement("svg", { viewBox: `0 0 ${WIDTH} ${HEIGHT}`, preserveAspectRatio: "none", "aria-hidden": "true" },
|
|
90
|
+
[0, HEIGHT / 2, HEIGHT].map(y => (react_1.React.createElement("line", { key: y, className: "tag-grid", x1: 0, x2: WIDTH, y1: y, y2: y, vectorEffect: "non-scaling-stroke" }))),
|
|
91
|
+
block.series.map((line, index) => (react_1.React.createElement(Polyline, { key: index, values: line.values, count: size, scale: scale, area: index === 0 && block.series.length === 1, index: index })))),
|
|
92
|
+
block.series.map((line, index) => {
|
|
93
|
+
const [x, y] = (0, glance_util_1.points)(line.values, size, scale, WIDTH, HEIGHT)[line.values.length - 1];
|
|
94
|
+
return (react_1.React.createElement("i", { key: index, className: "tag-plot-dot", "data-index": index, style: { left: `${(x / WIDTH) * 100}%`, top: `${(y / HEIGHT) * 100}%` } }));
|
|
95
|
+
})),
|
|
96
|
+
react_1.React.createElement("div", { className: "tag-plot-axis", "aria-hidden": "true" },
|
|
97
|
+
react_1.React.createElement("span", null, count(Math.max(...block.series.flatMap(line => line.values)))),
|
|
98
|
+
react_1.React.createElement("span", null, count(Math.min(...block.series.flatMap(line => line.values))))),
|
|
99
|
+
marks.length > 0 && (react_1.React.createElement("div", { className: "tag-plot-labels" }, marks.map(index => (react_1.React.createElement("span", { key: index, "data-at": index === 0 ? 'start' : index === size - 1 ? 'end' : 'middle', style: { left: `${where(index)}%` } }, block.labels[index]))))))));
|
|
100
|
+
}
|
|
101
|
+
function Share({ block }) {
|
|
102
|
+
const total = block.items.reduce((sum, item) => sum + item.value, 0);
|
|
103
|
+
const unit = block.unit ? ` ${block.unit}` : '';
|
|
104
|
+
return (react_1.React.createElement("div", { className: "tag-share" },
|
|
105
|
+
react_1.React.createElement("div", { className: "tag-share-bar", "aria-hidden": "true" }, block.items.map((item, index) => (react_1.React.createElement("i", { key: index, "data-index": index, style: { flexGrow: item.value } })))),
|
|
106
|
+
react_1.React.createElement("div", { className: "tag-share-keys" }, block.items.map((item, index) => (react_1.React.createElement("div", { key: index, className: "tag-share-key", "data-index": index },
|
|
107
|
+
react_1.React.createElement("i", null),
|
|
108
|
+
react_1.React.createElement("span", { className: "tag-share-label" },
|
|
109
|
+
react_1.React.createElement(Text, { text: item.label })),
|
|
110
|
+
react_1.React.createElement("span", { className: "tag-share-value" },
|
|
111
|
+
count(item.value),
|
|
112
|
+
unit),
|
|
113
|
+
react_1.React.createElement("b", null, (0, glance_util_1.share)(item.value, total))))))));
|
|
114
|
+
}
|
|
45
115
|
function Stats({ block }) {
|
|
46
116
|
return (react_1.React.createElement("div", { className: "tag-stats", "data-count": block.items.length }, block.items.map((item, index) => (react_1.React.createElement("div", { key: index, className: "tag-stat", "data-tone": item.tone },
|
|
47
117
|
react_1.React.createElement("div", { className: "tag-stat-value" },
|
|
48
118
|
react_1.React.createElement(Text, { text: item.value })),
|
|
119
|
+
item.trend && react_1.React.createElement(Sparkline, { values: item.trend }),
|
|
49
120
|
react_1.React.createElement("div", { className: "tag-stat-label" },
|
|
50
|
-
item.
|
|
121
|
+
has(item.icon) ? (react_1.React.createElement("span", { className: "tag-item-icon" },
|
|
122
|
+
react_1.React.createElement(Icon, { name: item.icon, size: 12 }))) : (item.tone && !item.delta && react_1.React.createElement("i", { className: "tag-tone-dot" })),
|
|
51
123
|
react_1.React.createElement(Text, { text: item.label }),
|
|
52
124
|
item.delta && react_1.React.createElement("span", { className: "tag-delta" }, item.delta)))))));
|
|
53
125
|
}
|
|
@@ -149,7 +221,9 @@ function glanceCard(pi) {
|
|
|
149
221
|
index > 0 && (react_1.React.createElement("span", { className: "tag-flow-arrow", "aria-hidden": "true" },
|
|
150
222
|
react_1.React.createElement(Icon, { name: "ArrowRight", size: 13 }))),
|
|
151
223
|
react_1.React.createElement("span", { className: "tag-flow-node" },
|
|
152
|
-
react_1.React.createElement(
|
|
224
|
+
has(item.icon) && (react_1.React.createElement("span", { className: "tag-item-icon" },
|
|
225
|
+
react_1.React.createElement(Icon, { name: item.icon, size: 13 }))),
|
|
226
|
+
react_1.React.createElement(Text, { text: item.text })))))));
|
|
153
227
|
}
|
|
154
228
|
function Table({ block }) {
|
|
155
229
|
return (react_1.React.createElement("div", { className: "ta-table tag-table" },
|
|
@@ -191,6 +265,8 @@ function glanceCard(pi) {
|
|
|
191
265
|
return (react_1.React.createElement("div", { key: index, className: "tag-option", "data-recommended": item.recommended || undefined, "data-chosen": picked || undefined, "data-other": (done && !picked) || undefined },
|
|
192
266
|
react_1.React.createElement("div", { className: "tag-option-main" },
|
|
193
267
|
react_1.React.createElement("div", { className: "tag-option-head" },
|
|
268
|
+
has(item.icon) && (react_1.React.createElement("span", { className: "tag-item-icon" },
|
|
269
|
+
react_1.React.createElement(Icon, { name: item.icon, size: 14 }))),
|
|
194
270
|
react_1.React.createElement("span", { className: "tag-option-label" },
|
|
195
271
|
react_1.React.createElement(Text, { text: item.label })),
|
|
196
272
|
item.recommended && react_1.React.createElement("span", { className: "tag-badge" }, words.recommended)),
|
|
@@ -210,15 +286,15 @@ function glanceCard(pi) {
|
|
|
210
286
|
function Notes({ block }) {
|
|
211
287
|
return (react_1.React.createElement("ul", { className: "tag-notes" }, block.items.map((item, index) => (react_1.React.createElement("li", { key: index, "data-tone": item.tone },
|
|
212
288
|
react_1.React.createElement("span", { className: "tag-note-mark" },
|
|
213
|
-
react_1.React.createElement(Icon, { name: NOTE_ICON[item.tone], size: 14 })),
|
|
289
|
+
react_1.React.createElement(Icon, { name: item.icon, fallback: NOTE_ICON[item.tone], size: 14 })),
|
|
214
290
|
react_1.React.createElement("span", null,
|
|
215
291
|
react_1.React.createElement(Text, { text: item.text })))))));
|
|
216
292
|
}
|
|
217
293
|
function Next({ block, closed }) {
|
|
218
294
|
const send = react_1.React.useContext(Reply);
|
|
219
|
-
return (react_1.React.createElement("div", { className: "tag-next" }, block.items.map((item, index) => (react_1.React.createElement("button", { key: index, type: "button", className: "tag-chip", disabled: !closed || !send, onClick: () => void (send === null || send === void 0 ? void 0 : send(item).catch(error => pi.ui.notify(error instanceof Error ? error.message : String(error), 'error'))) },
|
|
220
|
-
react_1.React.createElement(Icon, { name: "CornerDownRight", size: 13 }),
|
|
221
|
-
react_1.React.createElement("span", null, item.replace(/\*\*|`/g, '')))))));
|
|
295
|
+
return (react_1.React.createElement("div", { className: "tag-next" }, block.items.map((item, index) => (react_1.React.createElement("button", { key: index, type: "button", className: "tag-chip", disabled: !closed || !send, onClick: () => void (send === null || send === void 0 ? void 0 : send(item.text).catch(error => pi.ui.notify(error instanceof Error ? error.message : String(error), 'error'))) },
|
|
296
|
+
react_1.React.createElement(Icon, { name: item.icon, fallback: "CornerDownRight", size: 13 }),
|
|
297
|
+
react_1.React.createElement("span", null, item.text.replace(/\*\*|`/g, '')))))));
|
|
222
298
|
}
|
|
223
299
|
function Details({ block, words }) {
|
|
224
300
|
var _a;
|
|
@@ -242,6 +318,10 @@ function glanceCard(pi) {
|
|
|
242
318
|
return react_1.React.createElement(Compare, { block: block, words: words });
|
|
243
319
|
case 'bars':
|
|
244
320
|
return react_1.React.createElement(Bars, { block: block });
|
|
321
|
+
case 'line':
|
|
322
|
+
return react_1.React.createElement(Line, { block: block });
|
|
323
|
+
case 'share':
|
|
324
|
+
return react_1.React.createElement(Share, { block: block });
|
|
245
325
|
case 'flow':
|
|
246
326
|
return react_1.React.createElement(Flow, { block: block });
|
|
247
327
|
case 'diagram':
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* `ta-glance` block) rather than paragraphs. In English, as the rest of the system prompt; the model answers in the
|
|
4
4
|
* user's language. Kept the same from turn to turn, so that the cache of the prompt holds.
|
|
5
5
|
*/
|
|
6
|
-
export declare const GLANCE_PROMPT
|
|
6
|
+
export declare const GLANCE_PROMPT: string;
|
|
7
7
|
//# sourceMappingURL=glance-prompt.d.ts.map
|
|
@@ -20,16 +20,19 @@ How to reply:
|
|
|
20
20
|
The card: {"status": "done" | "partial" | "failed" | "blocked" | "info", "title"?: string, "blocks": [...]}
|
|
21
21
|
status: done = finished, partial = done in part, failed, blocked = waiting for the user, info = an answer, no work. Leave out title: the first line already says it.
|
|
22
22
|
Blocks, 1 to 4 of them, the most important first, each with only the fields shown. Every text a few words, in the user's language; inline Markdown works (**bold**, \`path/to/file\` opens the file).
|
|
23
|
-
- {"type":"stats","items":[{"label":"Tests","value":"128/128","tone":"good"},{"label":"Startup","value":"210 ms","delta":"-34%","tone":"good"}]}: key numbers, at most 6; tone good | bad | warn.
|
|
24
|
-
- {"type":"changes","items":[{"path":"src/a.ts","kind":"edit","add":12,"del":3,"note":"why, in a few words"}]}: files changed, a path each (
|
|
23
|
+
- {"type":"stats","items":[{"label":"Tests","value":"128/128","tone":"good"},{"label":"Startup","value":"210 ms","delta":"-34%","tone":"good","trend":[320,290,210]}]}: key numbers, at most 6; tone good | bad | warn; trend, its values over time when known, draws a small line.
|
|
24
|
+
- {"type":"changes","items":[{"path":"src/a.ts","kind":"edit","add":12,"del":3,"note":"why, in a few words"}]}: files changed, a path each (what changed without a file goes in notes); kind add | edit | delete.
|
|
25
25
|
- {"type":"steps","items":[{"text":"...","status":"done"}]}: progress or a plan; status done | doing | todo | failed | skipped.
|
|
26
26
|
- {"type":"compare","unit":"ms","better":"lower","items":[{"label":"Startup","before":320,"after":210}]}: before and after, numbers only (words go in a table).
|
|
27
27
|
- {"type":"bars","unit":"MB","items":[{"label":"ta","value":66},{"label":"pi","value":129}]}: amounts side by side.
|
|
28
|
-
- {"type":"
|
|
28
|
+
- {"type":"line","unit":"ms","better":"lower","labels":["11-01","11-08","11-15"],"series":[{"label":"Startup","values":[320,260,210]}]}: how values went over time, at most 4 series of 24 points.
|
|
29
|
+
- {"type":"share","unit":"MB","items":[{"label":"pi","value":129},{"label":"ta","value":66}]}: the parts of a whole.
|
|
30
|
+
- {"type":"flow","items":["Request",{"text":"Gateway","icon":"Server"},"Session","Model"]}: a sequence or a path.
|
|
29
31
|
- {"type":"diagram","mermaid":"graph LR; A-->B"}: relations a flow cannot show, under 12 nodes.
|
|
30
32
|
- {"type":"table","columns":["",""],"rows":[["",""]]}: a few rows that compare things on several points.
|
|
31
33
|
- {"type":"options","question":"Which one?","items":[{"label":"A","detail":"one line","pros":["..."],"cons":["..."],"recommended":true}]}: when the user must choose; each is a button that answers with its label.
|
|
32
34
|
- {"type":"notes","items":[{"text":"...","tone":"risk"}]}: risks, caveats, what the user must do; tone risk | info | todo.
|
|
33
35
|
- {"type":"next","items":["Run the e2e tests"]}: at most 3 things the user may well ask next, each a button that sends it.
|
|
34
|
-
- {"type":"details","title":"How","markdown":"..."}: what few will read, folded
|
|
36
|
+
- {"type":"details","title":"How","markdown":"..."}: what few will read, folded.
|
|
37
|
+
An item of stats, flow, options, notes or next may have "icon", where it tells items apart at a glance (an item of flow or next then {"text","icon"}): one of ${glance_protocol_1.GLANCE_ICONS.join(', ')}; else leave it out. Never write an emoji, in a card or out of it.`;
|
|
35
38
|
//# sourceMappingURL=glance-prompt.js.map
|
|
@@ -4,6 +4,12 @@ export declare const NAME = "@celljs/ta-glance";
|
|
|
4
4
|
export declare const LANGUAGE = "ta-glance";
|
|
5
5
|
/** Languages a model has written a card in by mistake, drawn as one too. */
|
|
6
6
|
export declare const ALIASES: string[];
|
|
7
|
+
/**
|
|
8
|
+
* The icons a card is told it may give an item (GLANCE_PROMPT), lucide's names, each of the page's `pi.ui.icons`:
|
|
9
|
+
* a few for what results are about, so that the prompt stays short. A card may name another of `pi.ui.icons`; one
|
|
10
|
+
* the page does not have is not drawn.
|
|
11
|
+
*/
|
|
12
|
+
export declare const GLANCE_ICONS: readonly ['Zap', 'Gauge', 'Timer', 'Cpu', 'MemoryStick', 'HardDrive', 'TrendingUp', 'TrendingDown', 'Code', 'GitBranch', 'Bug', 'FlaskConical', 'Package', 'SquareTerminal', 'Database', 'Server', 'Globe', 'Shield', 'Lock', 'KeyRound', 'Users', 'MessageCircle', 'Smartphone', 'Laptop', 'Rocket', 'Wrench', 'Lightbulb', 'Coins', 'Calendar', 'FileText', 'Sparkles'];
|
|
7
13
|
/** How the work of a reply ended: done, done in part, failed, waiting for the user, or no work (an answer). */
|
|
8
14
|
export type GlanceStatus = 'done' | 'partial' | 'failed' | 'blocked' | 'info';
|
|
9
15
|
/** Good, bad or to mind: the color of a number or a note. */
|
|
@@ -15,6 +21,10 @@ export interface GlanceStat {
|
|
|
15
21
|
tone?: GlanceTone;
|
|
16
22
|
/** A change, as written: `-35%`, `+2`. */
|
|
17
23
|
delta?: string;
|
|
24
|
+
/** The name of an icon of `pi.ui.icons`, as of every item that may have one. */
|
|
25
|
+
icon?: string;
|
|
26
|
+
/** The values it had over time, the last of them now: a small line under it. */
|
|
27
|
+
trend?: number[];
|
|
18
28
|
}
|
|
19
29
|
export interface GlanceChange {
|
|
20
30
|
path: string;
|
|
@@ -42,10 +52,22 @@ export interface GlanceOption {
|
|
|
42
52
|
pros: string[];
|
|
43
53
|
cons: string[];
|
|
44
54
|
recommended?: boolean;
|
|
55
|
+
icon?: string;
|
|
45
56
|
}
|
|
46
57
|
export interface GlanceNote {
|
|
47
58
|
text: string;
|
|
48
59
|
tone: 'risk' | 'info' | 'todo';
|
|
60
|
+
icon?: string;
|
|
61
|
+
}
|
|
62
|
+
/** A line of a chart over time: a value at each label of the chart; fewer when the line starts later or streams. */
|
|
63
|
+
export interface GlanceSeries {
|
|
64
|
+
label?: string;
|
|
65
|
+
values: number[];
|
|
66
|
+
}
|
|
67
|
+
/** A node of a flow, a thing to ask next. */
|
|
68
|
+
export interface GlanceItem {
|
|
69
|
+
text: string;
|
|
70
|
+
icon?: string;
|
|
49
71
|
}
|
|
50
72
|
/** A part of a card; the first ones matter most. */
|
|
51
73
|
export type GlanceBlock = {
|
|
@@ -66,9 +88,19 @@ export type GlanceBlock = {
|
|
|
66
88
|
type: 'bars';
|
|
67
89
|
unit?: string;
|
|
68
90
|
items: GlanceAmount[];
|
|
91
|
+
} | {
|
|
92
|
+
type: 'line';
|
|
93
|
+
unit?: string;
|
|
94
|
+
better?: 'lower' | 'higher';
|
|
95
|
+
labels: string[];
|
|
96
|
+
series: GlanceSeries[];
|
|
97
|
+
} | {
|
|
98
|
+
type: 'share';
|
|
99
|
+
unit?: string;
|
|
100
|
+
items: GlanceAmount[];
|
|
69
101
|
} | {
|
|
70
102
|
type: 'flow';
|
|
71
|
-
items:
|
|
103
|
+
items: GlanceItem[];
|
|
72
104
|
} | {
|
|
73
105
|
type: 'diagram';
|
|
74
106
|
mermaid: string;
|
|
@@ -85,7 +117,7 @@ export type GlanceBlock = {
|
|
|
85
117
|
items: GlanceNote[];
|
|
86
118
|
} | {
|
|
87
119
|
type: 'next';
|
|
88
|
-
items:
|
|
120
|
+
items: GlanceItem[];
|
|
89
121
|
} | {
|
|
90
122
|
type: 'details';
|
|
91
123
|
title?: string;
|
|
@@ -1,10 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ALIASES = exports.LANGUAGE = exports.NAME = void 0;
|
|
3
|
+
exports.GLANCE_ICONS = exports.ALIASES = exports.LANGUAGE = exports.NAME = void 0;
|
|
4
4
|
/** The name of the package. */
|
|
5
5
|
exports.NAME = '@celljs/ta-glance';
|
|
6
6
|
/** The language of the fenced block of a card in a reply: ```ta-glance, with JSON in it. */
|
|
7
7
|
exports.LANGUAGE = 'ta-glance';
|
|
8
8
|
/** Languages a model has written a card in by mistake, drawn as one too. */
|
|
9
9
|
exports.ALIASES = ['glance', 'glance-choice'];
|
|
10
|
+
/**
|
|
11
|
+
* The icons a card is told it may give an item (GLANCE_PROMPT), lucide's names, each of the page's `pi.ui.icons`:
|
|
12
|
+
* a few for what results are about, so that the prompt stays short. A card may name another of `pi.ui.icons`; one
|
|
13
|
+
* the page does not have is not drawn.
|
|
14
|
+
*/
|
|
15
|
+
exports.GLANCE_ICONS = [
|
|
16
|
+
'Zap',
|
|
17
|
+
'Gauge',
|
|
18
|
+
'Timer',
|
|
19
|
+
'Cpu',
|
|
20
|
+
'MemoryStick',
|
|
21
|
+
'HardDrive',
|
|
22
|
+
'TrendingUp',
|
|
23
|
+
'TrendingDown',
|
|
24
|
+
'Code',
|
|
25
|
+
'GitBranch',
|
|
26
|
+
'Bug',
|
|
27
|
+
'FlaskConical',
|
|
28
|
+
'Package',
|
|
29
|
+
'SquareTerminal',
|
|
30
|
+
'Database',
|
|
31
|
+
'Server',
|
|
32
|
+
'Globe',
|
|
33
|
+
'Shield',
|
|
34
|
+
'Lock',
|
|
35
|
+
'KeyRound',
|
|
36
|
+
'Users',
|
|
37
|
+
'MessageCircle',
|
|
38
|
+
'Smartphone',
|
|
39
|
+
'Laptop',
|
|
40
|
+
'Rocket',
|
|
41
|
+
'Wrench',
|
|
42
|
+
'Lightbulb',
|
|
43
|
+
'Coins',
|
|
44
|
+
'Calendar',
|
|
45
|
+
'FileText',
|
|
46
|
+
'Sparkles',
|
|
47
|
+
];
|
|
10
48
|
//# sourceMappingURL=glance-protocol.js.map
|