pim-agent 0.14.1 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/package.json +1 -1
  2. package/packages/core/src/session/SearchIndex.ts +4 -3
  3. package/packages/core/src/session/SessionDigest.ts +2 -2
  4. package/packages/core/src/session/UserPrompt.ts +34 -0
  5. package/packages/protocol/src/ServerEvent.ts +3 -0
  6. package/packages/server/src/SessionProjection.ts +3 -1
  7. package/packages/web/dist/client/assets/{abnfDiagram-O67JEVCF-w0u0UKcC.js → abnfDiagram-O67JEVCF-DDLsPl7M.js} +1 -1
  8. package/packages/web/dist/client/assets/{arc-C8AeY-3C.js → arc-Bfm9LZ_0.js} +1 -1
  9. package/packages/web/dist/client/assets/architecture-7GRP2DOG-DpwRvkmV.js +1 -0
  10. package/packages/web/dist/client/assets/{architectureDiagram-NJMV4G6O-CLdCZfsP.js → architectureDiagram-NJMV4G6O-CViHz0a3.js} +1 -1
  11. package/packages/web/dist/client/assets/{blockDiagram-BEXU5L5S-BgAbOzdH.js → blockDiagram-BEXU5L5S-CshoJ2jT.js} +1 -1
  12. package/packages/web/dist/client/assets/{c4Diagram-YGBWAQC7-DGRXXzDl.js → c4Diagram-YGBWAQC7-CGLODhJd.js} +1 -1
  13. package/packages/web/dist/client/assets/channel-DazHMyw-.js +1 -0
  14. package/packages/web/dist/client/assets/{chunk-3FUC2YCW-Dmz4_CY0.js → chunk-3FUC2YCW-BElZHdD7.js} +1 -1
  15. package/packages/web/dist/client/assets/{chunk-5DYCD2WN-D6q0r_NW.js → chunk-5DYCD2WN-xVF88TWx.js} +1 -1
  16. package/packages/web/dist/client/assets/{chunk-742MDFTN-biXvhzMn.js → chunk-742MDFTN-1xoGm6_h.js} +1 -1
  17. package/packages/web/dist/client/assets/{chunk-7INBJB4K-CtfPEr8P.js → chunk-7INBJB4K-C8cub8Hz.js} +1 -1
  18. package/packages/web/dist/client/assets/{chunk-7M6MHVWA-CTixWKLk.js → chunk-7M6MHVWA-DFVau2oW.js} +1 -1
  19. package/packages/web/dist/client/assets/{chunk-7PRAP22T-DijOiKl2.js → chunk-7PRAP22T-DB3rOKNz.js} +1 -1
  20. package/packages/web/dist/client/assets/{chunk-GTNCS2PH-DLId7dTl.js → chunk-GTNCS2PH-BpVHBDV7.js} +1 -1
  21. package/packages/web/dist/client/assets/{chunk-GWA4HPMP-YUQxYmiu.js → chunk-GWA4HPMP-BhLhdYL5.js} +1 -1
  22. package/packages/web/dist/client/assets/{chunk-MBY4JIJT-VWR3HSRr.js → chunk-MBY4JIJT-DvRGdfa-.js} +1 -1
  23. package/packages/web/dist/client/assets/{chunk-NETBCI7D-B8SeJoMY.js → chunk-NETBCI7D-CQNd8AmG.js} +1 -1
  24. package/packages/web/dist/client/assets/{chunk-O7XYJQB3-CeLpEz0Q.js → chunk-O7XYJQB3-DShLK-57.js} +1 -1
  25. package/packages/web/dist/client/assets/{chunk-UA2S7LBM-cBGKkXV_.js → chunk-UA2S7LBM-DpQOqtjg.js} +1 -1
  26. package/packages/web/dist/client/assets/{chunk-WEXAMYUT-BesXAOy9.js → chunk-WEXAMYUT-BduFhqwt.js} +1 -1
  27. package/packages/web/dist/client/assets/{chunk-XXDRQBXY-DiuGUc8m.js → chunk-XXDRQBXY-pli_xw5K.js} +1 -1
  28. package/packages/web/dist/client/assets/{chunk-Z7XXMR3K-Dr2W5_t1.js → chunk-Z7XXMR3K-x_3Xp2MR.js} +1 -1
  29. package/packages/web/dist/client/assets/{chunk-ZIGJFQKS-CwoMYXLJ.js → chunk-ZIGJFQKS-Cl42liG9.js} +1 -1
  30. package/packages/web/dist/client/assets/{classDiagram-v2-NBCMYWYE-Gc3jAsDf.js → classDiagram-v2-NBCMYWYE-DEXTvNNQ.js} +1 -1
  31. package/packages/web/dist/client/assets/{core-C27Q2ZSN.js → core-Cc31wJLH.js} +1 -1
  32. package/packages/web/dist/client/assets/{cose-bilkent-JH36ORCC-ox5QohTH.js → cose-bilkent-JH36ORCC-DtFDmYNR.js} +1 -1
  33. package/packages/web/dist/client/assets/{cynefin-OW5HDTMX-CjQ-AjuJ.js → cynefin-OW5HDTMX-C1n5zA6z.js} +1 -1
  34. package/packages/web/dist/client/assets/{cynefinDiagram-VND7K2PF-BVajmbbO.js → cynefinDiagram-VND7K2PF-BtkMmF6w.js} +1 -1
  35. package/packages/web/dist/client/assets/{dagre-6A5THRUB-BtXhDxGN.js → dagre-6A5THRUB-DSwGQnnB.js} +1 -1
  36. package/packages/web/dist/client/assets/{diagram-22UHCM2B-DwjrV0H_.js → diagram-22UHCM2B-B6kKp1l7.js} +1 -1
  37. package/packages/web/dist/client/assets/{diagram-3UASUU5V-DQ1E_6hO.js → diagram-3UASUU5V-BG5NVRSL.js} +1 -1
  38. package/packages/web/dist/client/assets/{diagram-ATOU4E4O-wVYWlHRV.js → diagram-ATOU4E4O-wTfKyE4x.js} +1 -1
  39. package/packages/web/dist/client/assets/{diagram-CDSNMT55-CMlxHWMz.js → diagram-CDSNMT55-CgWazooW.js} +1 -1
  40. package/packages/web/dist/client/assets/{diagram-MLGK6HIB-Cbiwo7t9.js → diagram-MLGK6HIB-C23kkY--.js} +1 -1
  41. package/packages/web/dist/client/assets/{diagram-MPIPVDR6-Cv4zIyW1.js → diagram-MPIPVDR6-0AIKkXyE.js} +1 -1
  42. package/packages/web/dist/client/assets/{dist-Dl4GbwtH.js → dist-D_jXzuJY.js} +1 -1
  43. package/packages/web/dist/client/assets/{ebnfDiagram-ZINNZB2B-Bd8xl8W2.js → ebnfDiagram-ZINNZB2B-SsipPvBE.js} +1 -1
  44. package/packages/web/dist/client/assets/{elk-276RUBZZ-DPRtUxgw.js → elk-276RUBZZ-UDHEztLV.js} +1 -1
  45. package/packages/web/dist/client/assets/{erDiagram-OPXOYQCR-BNoG4SxS.js → erDiagram-OPXOYQCR-ClTiR_Ec.js} +1 -1
  46. package/packages/web/dist/client/assets/eventmodeling-NTZA5JFV-Ca0QGSHT.js +1 -0
  47. package/packages/web/dist/client/assets/flowDiagram-KWPJA3E3-BK9Yt33I.js +1 -0
  48. package/packages/web/dist/client/assets/{ganttDiagram-FUAMR5RP-BtFYI7uw.js → ganttDiagram-FUAMR5RP-EQVlpLgF.js} +1 -1
  49. package/packages/web/dist/client/assets/{gitGraph-4MIJSDKK-Di6RG5Kg.js → gitGraph-4MIJSDKK-B1sicDxp.js} +1 -1
  50. package/packages/web/dist/client/assets/{gitGraphDiagram-X574FWY7-J4_JKGBH.js → gitGraphDiagram-X574FWY7-B7VGaCS6.js} +1 -1
  51. package/packages/web/dist/client/assets/{index-Cn66jcLF.js → index-C5zfYYPp.js} +5 -5
  52. package/packages/web/dist/client/assets/{index-BD7ptjuS.css → index-DqdUWMRQ.css} +1 -1
  53. package/packages/web/dist/client/assets/{info-A6RAGUB7-wk6vNDP4.js → info-A6RAGUB7-CIBaLxCu.js} +1 -1
  54. package/packages/web/dist/client/assets/{infoDiagram-VRGFBTTK-Zl7Uhlcj.js → infoDiagram-VRGFBTTK-BTSwzxKa.js} +1 -1
  55. package/packages/web/dist/client/assets/{ishikawaDiagram-OU5B5YK6-I0VVed8w.js → ishikawaDiagram-OU5B5YK6-Bm6CSaCE.js} +1 -1
  56. package/packages/web/dist/client/assets/{journeyDiagram-ZHPQQLJL-CLGZAy0Q.js → journeyDiagram-ZHPQQLJL-Boi1cndA.js} +1 -1
  57. package/packages/web/dist/client/assets/{kanban-definition-PNTS6WVX-D3Zv63YL.js → kanban-definition-PNTS6WVX-kUvWgapI.js} +1 -1
  58. package/packages/web/dist/client/assets/{line-C4_qzTJY.js → line-B_U2cP3K.js} +1 -1
  59. package/packages/web/dist/client/assets/{linear-Dbp9FWGm.js → linear-DeuHu4E-.js} +1 -1
  60. package/packages/web/dist/client/assets/{mermaid-parser.core-Cbd2Flfk.js → mermaid-parser.core-FXVUftR7.js} +3 -3
  61. package/packages/web/dist/client/assets/{mermaid.core-CPXk02t0.js → mermaid.core-mmY-00PI.js} +4 -4
  62. package/packages/web/dist/client/assets/{mindmap-definition-NLK3R4M7-hcjd2vg0.js → mindmap-definition-NLK3R4M7-cojTX4MV.js} +1 -1
  63. package/packages/web/dist/client/assets/{packet-AYTQ26CC-CLiY7MdL.js → packet-AYTQ26CC-Bd-cRuaI.js} +1 -1
  64. package/packages/web/dist/client/assets/{pegDiagram-GJSIUBJH-Or6L-npJ.js → pegDiagram-GJSIUBJH-Cvwsk4js.js} +1 -1
  65. package/packages/web/dist/client/assets/{pie-WAS4IAKB-DTF5qxhB.js → pie-WAS4IAKB-BdI3q3bb.js} +1 -1
  66. package/packages/web/dist/client/assets/{pieDiagram-5QR66LMP-wDNyDsTs.js → pieDiagram-5QR66LMP-CPB3b3IT.js} +1 -1
  67. package/packages/web/dist/client/assets/{quadrantDiagram-O4NWA36T-BL_0xWWi.js → quadrantDiagram-O4NWA36T-BUd2eApo.js} +1 -1
  68. package/packages/web/dist/client/assets/{radar-RG4KPBEZ-hK8uEd3E.js → radar-RG4KPBEZ-CxyJK7bg.js} +1 -1
  69. package/packages/web/dist/client/assets/{railroad-74A4TZTK-Cj1mtGfH.js → railroad-74A4TZTK-E5SCnFFE.js} +1 -1
  70. package/packages/web/dist/client/assets/railroad-abnf-HS5TGJTU-Cy4GbWLw.js +1 -0
  71. package/packages/web/dist/client/assets/railroad-ebnf-LZEXJU2U-C6CBSb9D.js +1 -0
  72. package/packages/web/dist/client/assets/railroad-peg-WCYAUIDC-DLEUBhTA.js +1 -0
  73. package/packages/web/dist/client/assets/{railroadDiagram-XR7U4H2S-BUXe7pvJ.js → railroadDiagram-XR7U4H2S-C0F-VdME.js} +1 -1
  74. package/packages/web/dist/client/assets/{requirementDiagram-PLB6GJNP-DBnKurFY.js → requirementDiagram-PLB6GJNP-B7MBOdoH.js} +1 -1
  75. package/packages/web/dist/client/assets/{sankeyDiagram-IPEJSGJF-BDlSxPY7.js → sankeyDiagram-IPEJSGJF-FBKbBDfy.js} +1 -1
  76. package/packages/web/dist/client/assets/{sequenceDiagram-PO4LG4MO-BcKSq_cS.js → sequenceDiagram-PO4LG4MO-CIf0Xk8r.js} +1 -1
  77. package/packages/web/dist/client/assets/{src-kcIgRrGC.js → src-Ng7mwp_r.js} +1 -1
  78. package/packages/web/dist/client/assets/{stateDiagram-v2-GCMORJYK-D-1tpyK1.js → stateDiagram-v2-GCMORJYK-BTtnWQlx.js} +1 -1
  79. package/packages/web/dist/client/assets/{swimlanes-2SLR337P-edQaMeEJ.js → swimlanes-2SLR337P-C5gISPnD.js} +1 -1
  80. package/packages/web/dist/client/assets/swimlanesDiagram-TC7HE7FX-CfMzBcXH.js +8 -0
  81. package/packages/web/dist/client/assets/{timeline-definition-EJHVYXUP-BHspcgaG.js → timeline-definition-EJHVYXUP-o4Qx4_l5.js} +1 -1
  82. package/packages/web/dist/client/assets/{treeView-Q6P3EWNA-Bvc71ryx.js → treeView-Q6P3EWNA-C8Lg6iol.js} +1 -1
  83. package/packages/web/dist/client/assets/{treemap-WGGIJYW6-CoZvoF_t.js → treemap-WGGIJYW6-DJwrsnbE.js} +1 -1
  84. package/packages/web/dist/client/assets/{usecaseDiagram-POWQR4AR-B203AiCD.js → usecaseDiagram-POWQR4AR-CUrjGCwM.js} +1 -1
  85. package/packages/web/dist/client/assets/{vennDiagram-UO4OBE2U-Cia3spa9.js → vennDiagram-UO4OBE2U-BjmRd40D.js} +1 -1
  86. package/packages/web/dist/client/assets/{wardley-WFR3VGLG-C7qHTXAu.js → wardley-WFR3VGLG-CtolBbgf.js} +1 -1
  87. package/packages/web/dist/client/assets/{wardleyDiagram-VNRHLVJA-CK2R_SgC.js → wardleyDiagram-VNRHLVJA-CV53tO-B.js} +1 -1
  88. package/packages/web/dist/client/assets/{xychartDiagram-PMCCYNJV-BBLqtYJ_.js → xychartDiagram-PMCCYNJV-36EYzFlh.js} +1 -1
  89. package/packages/web/dist/client/index.html +2 -2
  90. package/packages/web/dist/client/assets/architecture-7GRP2DOG-D-GDy9ga.js +0 -1
  91. package/packages/web/dist/client/assets/channel-BJtpIKaC.js +0 -1
  92. package/packages/web/dist/client/assets/eventmodeling-NTZA5JFV-Dh9l6A3t.js +0 -1
  93. package/packages/web/dist/client/assets/flowDiagram-KWPJA3E3-DoJ97uSW.js +0 -1
  94. package/packages/web/dist/client/assets/railroad-abnf-HS5TGJTU-t8ibqa0P.js +0 -1
  95. package/packages/web/dist/client/assets/railroad-ebnf-LZEXJU2U-B4RYlcUM.js +0 -1
  96. package/packages/web/dist/client/assets/railroad-peg-WCYAUIDC-DFqfvrfB.js +0 -1
  97. package/packages/web/dist/client/assets/swimlanesDiagram-TC7HE7FX-vI6XtOyR.js +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pim-agent",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "description": "A batteries-included distro of Pi, accessible in your terminal, browser and Telegram.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,5 @@
1
1
  import { parseSessionEntries } from "@earendil-works/pi-coding-agent";
2
2
 
3
- import { Attachments } from "../attachments/Attachments";
4
3
  import { Levenshtein } from "../shared/Levenshtein";
5
4
  import { Pool } from "../shared/Pool";
6
5
  import { MessageText } from "./MessageText";
@@ -12,6 +11,7 @@ import {
12
11
  type Durable,
13
12
  } from "./SessionDigest";
14
13
  import type { SessionSummary } from "./SessionRegistry";
14
+ import { UserPrompt } from "./UserPrompt";
15
15
 
16
16
  /** Half-open character offsets; non-overlapping and ascending. */
17
17
  export type SearchRange = readonly [start: number, end: number];
@@ -527,9 +527,10 @@ function turnOf(line: string, seq: number): Turn | undefined {
527
527
  if (message.role !== "user" && message.role !== "assistant") {
528
528
  return undefined;
529
529
  }
530
- const said = MessageText.textOf(message.content);
531
530
  const text = (
532
- message.role === "user" ? Attachments.parse(said).text : said
531
+ message.role === "user"
532
+ ? UserPrompt.of(message.content).text
533
+ : MessageText.textOf(message.content)
533
534
  ).trim();
534
535
  return text === "" ? undefined : { seq, role: message.role, text };
535
536
  }
@@ -1,7 +1,7 @@
1
1
  import { parseSessionEntries } from "@earendil-works/pi-coding-agent";
2
2
 
3
3
  import { Attachments } from "../attachments/Attachments";
4
- import { MessageText } from "./MessageText";
4
+ import { UserPrompt } from "./UserPrompt";
5
5
 
6
6
  /** Catalogue summary of a session file. */
7
7
  export type SessionDigest = {
@@ -138,7 +138,7 @@ function firstUserMessage(lines: readonly string[]): string | undefined {
138
138
  if (entry?.type !== "message" || entry.message.role !== "user") {
139
139
  continue;
140
140
  }
141
- const said = Attachments.parse(MessageText.textOf(entry.message.content));
141
+ const said = UserPrompt.of(entry.message.content);
142
142
  const text =
143
143
  said.text.trim() ||
144
144
  said.files.map((file) => Attachments.nameOf(file.path)).join(", ");
@@ -0,0 +1,34 @@
1
+ import type { UserMessage } from "@earendil-works/pi-ai";
2
+ import {
3
+ parseSkillBlock,
4
+ type ParsedSkillBlock,
5
+ } from "@earendil-works/pi-coding-agent";
6
+
7
+ import { Attachments, type PromptAttachment } from "../attachments/Attachments";
8
+ import { MessageText } from "./MessageText";
9
+
10
+ /** A skill pi expanded inline into the prompt. */
11
+ export type SkillUse = Pick<ParsedSkillBlock, "name" | "content">;
12
+
13
+ /** A stored user message as the user typed it, with what pi expanded into it set apart. */
14
+ export type UserPrompt = {
15
+ readonly text: string;
16
+ readonly files: readonly PromptAttachment[];
17
+ readonly skill?: SkillUse;
18
+ };
19
+
20
+ function of(content: UserMessage["content"]): UserPrompt {
21
+ const raw = MessageText.textOf(content);
22
+ const block = parseSkillBlock(raw);
23
+ if (block === null) {
24
+ return Attachments.parse(raw);
25
+ }
26
+ const said = Attachments.parse(block.userMessage ?? "");
27
+ return {
28
+ ...said,
29
+ text: [`/skill:${block.name}`, said.text].filter(Boolean).join(" "),
30
+ skill: { name: block.name, content: block.content },
31
+ };
32
+ }
33
+
34
+ export const UserPrompt = { of };
@@ -4,6 +4,7 @@ import type { PickerItem } from "#core/picker/PickerItem";
4
4
  import type { ExtensionEntry } from "#core/shared/PiExtensions";
5
5
  import type { SearchRange, SearchSnippet } from "#core/session/SearchIndex";
6
6
  import type { LeaseFrontend } from "#core/session/SessionLease";
7
+ import type { SkillUse } from "#core/session/UserPrompt";
7
8
  import type { UpdateSkip } from "#core/shared/Updater";
8
9
  import type { NoticeSeverity, ToolView } from "#core/view/ViewBlock";
9
10
  import type { ChangeList, FileDiff, FileLines } from "./Diff";
@@ -44,6 +45,8 @@ export type DurableEvent =
44
45
  readonly thinking?: string;
45
46
  /** User messages only. */
46
47
  readonly attachments?: readonly AttachmentView[];
48
+ /** User messages only; `text` then holds the command as typed. */
49
+ readonly skill?: SkillUse;
47
50
  readonly toolCalls?: readonly ToolCallView[];
48
51
  /** Model call error; assistant messages only. */
49
52
  readonly error?: string;
@@ -7,6 +7,7 @@ import type { FileEntry } from "@earendil-works/pi-coding-agent";
7
7
  import { Attachments } from "#core/attachments/Attachments";
8
8
  import { EventLog, type LoggedEntry } from "#core/session/EventLog";
9
9
  import { MessageText } from "#core/session/MessageText";
10
+ import { UserPrompt } from "#core/session/UserPrompt";
10
11
  import { Tools } from "#core/shared/Tools";
11
12
  import type {
12
13
  AttachmentView,
@@ -83,7 +84,7 @@ export class SessionProjection {
83
84
  const timestamp = Date.parse(entry.timestamp);
84
85
  switch (message.role) {
85
86
  case "user": {
86
- const said = Attachments.parse(MessageText.textOf(message.content));
87
+ const said = UserPrompt.of(message.content);
87
88
  const attachments: readonly AttachmentView[] = said.files.map(
88
89
  (file) => ({
89
90
  name: Attachments.nameOf(file.path),
@@ -99,6 +100,7 @@ export class SessionProjection {
99
100
  text: said.text,
100
101
  timestamp,
101
102
  ...(attachments.length === 0 ? {} : { attachments }),
103
+ ...(said.skill === undefined ? {} : { skill: said.skill }),
102
104
  };
103
105
  }
104
106
  case "assistant": {
@@ -1 +1 @@
1
- import{m as e,t}from"./mermaid-parser.core-Cbd2Flfk.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-kcIgRrGC.js";import"./chunk-O7XYJQB3-CeLpEz0Q.js";import{n as i,r as a,t as o}from"./chunk-GTNCS2PH-DLId7dTl.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-CPXk02t0.js";var c=e().RailroadAbnf.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=n(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=n(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=n(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=n(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:n(e=>{o.clear(),r.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new t(n);let i=n.value;r.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),r.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
1
+ import{m as e,t}from"./mermaid-parser.core-FXVUftR7.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-Ng7mwp_r.js";import"./chunk-O7XYJQB3-DShLK-57.js";import{n as i,r as a,t as o}from"./chunk-GTNCS2PH-BpVHBDV7.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-mmY-00PI.js";var c=e().RailroadAbnf.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=n(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=n(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=n(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=n(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:n(e=>{o.clear(),r.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new t(n);let i=n.value;r.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),r.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
@@ -1 +1 @@
1
- import{n as e,t}from"./path-fybaL0A-.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-Dl4GbwtH.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i){if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
1
+ import{n as e,t}from"./path-fybaL0A-.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-D_jXzuJY.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i){if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
@@ -0,0 +1 @@
1
+ import"./chunk-FOHPRMQF-CoA4358r.js";import{M as e}from"./mermaid-parser.core-FXVUftR7.js";export{e as createArchitectureServices};