@angflow/angular 0.0.13 → 0.0.15

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 (191) hide show
  1. package/README.md +14 -4
  2. package/dist/base.css +416 -411
  3. package/dist/esm/lib/agent/agent-bridge.service.d.ts +70 -0
  4. package/dist/esm/lib/agent/agent-bridge.service.d.ts.map +1 -0
  5. package/dist/esm/lib/agent/agent-bridge.service.js +331 -0
  6. package/dist/esm/lib/agent/agent-bridge.service.js.map +1 -0
  7. package/dist/esm/lib/agent/index.d.ts +7 -0
  8. package/dist/esm/lib/agent/index.d.ts.map +1 -0
  9. package/dist/esm/lib/agent/index.js +6 -0
  10. package/dist/esm/lib/agent/index.js.map +1 -0
  11. package/dist/esm/lib/agent/provide-agent-bridge.d.ts +27 -0
  12. package/dist/esm/lib/agent/provide-agent-bridge.d.ts.map +1 -0
  13. package/dist/esm/lib/agent/provide-agent-bridge.js +27 -0
  14. package/dist/esm/lib/agent/provide-agent-bridge.js.map +1 -0
  15. package/dist/esm/lib/agent/tool-schemas.d.ts +10 -0
  16. package/dist/esm/lib/agent/tool-schemas.d.ts.map +1 -0
  17. package/dist/esm/lib/agent/tool-schemas.js +234 -0
  18. package/dist/esm/lib/agent/tool-schemas.js.map +1 -0
  19. package/dist/esm/lib/agent/transports/websocket.d.ts +39 -0
  20. package/dist/esm/lib/agent/transports/websocket.d.ts.map +1 -0
  21. package/dist/esm/lib/agent/transports/websocket.js +95 -0
  22. package/dist/esm/lib/agent/transports/websocket.js.map +1 -0
  23. package/dist/esm/lib/agent/transports/window.d.ts +29 -0
  24. package/dist/esm/lib/agent/transports/window.d.ts.map +1 -0
  25. package/dist/esm/lib/agent/transports/window.js +65 -0
  26. package/dist/esm/lib/agent/transports/window.js.map +1 -0
  27. package/dist/esm/lib/agent/types.d.ts +66 -0
  28. package/dist/esm/lib/agent/types.d.ts.map +1 -0
  29. package/dist/esm/lib/agent/types.js +9 -0
  30. package/dist/esm/lib/agent/types.js.map +1 -0
  31. package/dist/esm/lib/components/a11y-descriptions/a11y-descriptions.component.d.ts +4 -0
  32. package/dist/esm/lib/components/a11y-descriptions/a11y-descriptions.component.d.ts.map +1 -1
  33. package/dist/esm/lib/components/a11y-descriptions/a11y-descriptions.component.js +24 -20
  34. package/dist/esm/lib/components/a11y-descriptions/a11y-descriptions.component.js.map +1 -1
  35. package/dist/esm/lib/components/attribution/attribution.component.d.ts +4 -0
  36. package/dist/esm/lib/components/attribution/attribution.component.d.ts.map +1 -1
  37. package/dist/esm/lib/components/attribution/attribution.component.js +22 -18
  38. package/dist/esm/lib/components/attribution/attribution.component.js.map +1 -1
  39. package/dist/esm/lib/components/background/background.component.d.ts +20 -0
  40. package/dist/esm/lib/components/background/background.component.d.ts.map +1 -1
  41. package/dist/esm/lib/components/background/background.component.js +159 -140
  42. package/dist/esm/lib/components/background/background.component.js.map +1 -1
  43. package/dist/esm/lib/components/connection-line/connection-line.component.d.ts +7 -0
  44. package/dist/esm/lib/components/connection-line/connection-line.component.d.ts.map +1 -1
  45. package/dist/esm/lib/components/connection-line/connection-line.component.js +7 -0
  46. package/dist/esm/lib/components/connection-line/connection-line.component.js.map +1 -1
  47. package/dist/esm/lib/components/controls/controls.component.d.ts +21 -0
  48. package/dist/esm/lib/components/controls/controls.component.d.ts.map +1 -1
  49. package/dist/esm/lib/components/controls/controls.component.js +21 -1
  50. package/dist/esm/lib/components/controls/controls.component.js.map +1 -1
  51. package/dist/esm/lib/components/edge-label-renderer/edge-label-renderer.component.d.ts +4 -0
  52. package/dist/esm/lib/components/edge-label-renderer/edge-label-renderer.component.d.ts.map +1 -1
  53. package/dist/esm/lib/components/edge-label-renderer/edge-label-renderer.component.js +4 -0
  54. package/dist/esm/lib/components/edge-label-renderer/edge-label-renderer.component.js.map +1 -1
  55. package/dist/esm/lib/components/edge-toolbar/edge-toolbar.component.d.ts +14 -2
  56. package/dist/esm/lib/components/edge-toolbar/edge-toolbar.component.d.ts.map +1 -1
  57. package/dist/esm/lib/components/edge-toolbar/edge-toolbar.component.js +12 -0
  58. package/dist/esm/lib/components/edge-toolbar/edge-toolbar.component.js.map +1 -1
  59. package/dist/esm/lib/components/edges/base-edge.component.d.ts +23 -0
  60. package/dist/esm/lib/components/edges/base-edge.component.d.ts.map +1 -1
  61. package/dist/esm/lib/components/edges/base-edge.component.js +63 -40
  62. package/dist/esm/lib/components/edges/base-edge.component.js.map +1 -1
  63. package/dist/esm/lib/components/edges/bezier-edge.component.d.ts +4 -0
  64. package/dist/esm/lib/components/edges/bezier-edge.component.d.ts.map +1 -1
  65. package/dist/esm/lib/components/edges/bezier-edge.component.js +4 -0
  66. package/dist/esm/lib/components/edges/bezier-edge.component.js.map +1 -1
  67. package/dist/esm/lib/components/edges/edge-text.component.d.ts +4 -0
  68. package/dist/esm/lib/components/edges/edge-text.component.d.ts.map +1 -1
  69. package/dist/esm/lib/components/edges/edge-text.component.js +30 -26
  70. package/dist/esm/lib/components/edges/edge-text.component.js.map +1 -1
  71. package/dist/esm/lib/components/edges/simple-bezier-edge.component.d.ts +4 -0
  72. package/dist/esm/lib/components/edges/simple-bezier-edge.component.d.ts.map +1 -1
  73. package/dist/esm/lib/components/edges/simple-bezier-edge.component.js +4 -0
  74. package/dist/esm/lib/components/edges/simple-bezier-edge.component.js.map +1 -1
  75. package/dist/esm/lib/components/edges/smooth-step-edge.component.d.ts +1 -0
  76. package/dist/esm/lib/components/edges/smooth-step-edge.component.d.ts.map +1 -1
  77. package/dist/esm/lib/components/edges/smooth-step-edge.component.js +1 -0
  78. package/dist/esm/lib/components/edges/smooth-step-edge.component.js.map +1 -1
  79. package/dist/esm/lib/components/edges/step-edge.component.d.ts +1 -0
  80. package/dist/esm/lib/components/edges/step-edge.component.d.ts.map +1 -1
  81. package/dist/esm/lib/components/edges/step-edge.component.js +1 -0
  82. package/dist/esm/lib/components/edges/step-edge.component.js.map +1 -1
  83. package/dist/esm/lib/components/edges/straight-edge.component.d.ts +1 -0
  84. package/dist/esm/lib/components/edges/straight-edge.component.d.ts.map +1 -1
  85. package/dist/esm/lib/components/edges/straight-edge.component.js +1 -0
  86. package/dist/esm/lib/components/edges/straight-edge.component.js.map +1 -1
  87. package/dist/esm/lib/components/handle/handle.component.d.ts +20 -1
  88. package/dist/esm/lib/components/handle/handle.component.d.ts.map +1 -1
  89. package/dist/esm/lib/components/handle/handle.component.js +25 -2
  90. package/dist/esm/lib/components/handle/handle.component.js.map +1 -1
  91. package/dist/esm/lib/components/minimap/minimap.component.d.ts +34 -0
  92. package/dist/esm/lib/components/minimap/minimap.component.d.ts.map +1 -1
  93. package/dist/esm/lib/components/minimap/minimap.component.js +30 -4
  94. package/dist/esm/lib/components/minimap/minimap.component.js.map +1 -1
  95. package/dist/esm/lib/components/ng-flow-provider/ng-flow-provider.component.d.ts +14 -0
  96. package/dist/esm/lib/components/ng-flow-provider/ng-flow-provider.component.d.ts.map +1 -1
  97. package/dist/esm/lib/components/ng-flow-provider/ng-flow-provider.component.js +14 -0
  98. package/dist/esm/lib/components/ng-flow-provider/ng-flow-provider.component.js.map +1 -1
  99. package/dist/esm/lib/components/node-resizer/node-resizer.component.d.ts +29 -0
  100. package/dist/esm/lib/components/node-resizer/node-resizer.component.d.ts.map +1 -1
  101. package/dist/esm/lib/components/node-resizer/node-resizer.component.js +153 -124
  102. package/dist/esm/lib/components/node-resizer/node-resizer.component.js.map +1 -1
  103. package/dist/esm/lib/components/node-toolbar/node-toolbar.component.d.ts +21 -1
  104. package/dist/esm/lib/components/node-toolbar/node-toolbar.component.d.ts.map +1 -1
  105. package/dist/esm/lib/components/node-toolbar/node-toolbar.component.js +21 -1
  106. package/dist/esm/lib/components/node-toolbar/node-toolbar.component.js.map +1 -1
  107. package/dist/esm/lib/components/nodes/default-node.component.d.ts +4 -0
  108. package/dist/esm/lib/components/nodes/default-node.component.d.ts.map +1 -1
  109. package/dist/esm/lib/components/nodes/default-node.component.js +13 -9
  110. package/dist/esm/lib/components/nodes/default-node.component.js.map +1 -1
  111. package/dist/esm/lib/components/nodes/group-node.component.d.ts +5 -0
  112. package/dist/esm/lib/components/nodes/group-node.component.d.ts.map +1 -1
  113. package/dist/esm/lib/components/nodes/group-node.component.js +5 -0
  114. package/dist/esm/lib/components/nodes/group-node.component.js.map +1 -1
  115. package/dist/esm/lib/components/nodes/input-node.component.d.ts +4 -0
  116. package/dist/esm/lib/components/nodes/input-node.component.d.ts.map +1 -1
  117. package/dist/esm/lib/components/nodes/input-node.component.js +11 -7
  118. package/dist/esm/lib/components/nodes/input-node.component.js.map +1 -1
  119. package/dist/esm/lib/components/nodes/output-node.component.d.ts +4 -0
  120. package/dist/esm/lib/components/nodes/output-node.component.d.ts.map +1 -1
  121. package/dist/esm/lib/components/nodes/output-node.component.js +11 -7
  122. package/dist/esm/lib/components/nodes/output-node.component.js.map +1 -1
  123. package/dist/esm/lib/components/panel/panel.component.d.ts +12 -0
  124. package/dist/esm/lib/components/panel/panel.component.d.ts.map +1 -1
  125. package/dist/esm/lib/components/panel/panel.component.js +12 -0
  126. package/dist/esm/lib/components/panel/panel.component.js.map +1 -1
  127. package/dist/esm/lib/components/viewport-portal/viewport-portal.component.d.ts +5 -0
  128. package/dist/esm/lib/components/viewport-portal/viewport-portal.component.d.ts.map +1 -1
  129. package/dist/esm/lib/components/viewport-portal/viewport-portal.component.js +5 -0
  130. package/dist/esm/lib/components/viewport-portal/viewport-portal.component.js.map +1 -1
  131. package/dist/esm/lib/container/edge-renderer/edge-renderer.component.d.ts.map +1 -1
  132. package/dist/esm/lib/container/edge-renderer/edge-renderer.component.js +35 -3
  133. package/dist/esm/lib/container/edge-renderer/edge-renderer.component.js.map +1 -1
  134. package/dist/esm/lib/container/ng-flow/ng-flow.component.d.ts +158 -5
  135. package/dist/esm/lib/container/ng-flow/ng-flow.component.d.ts.map +1 -1
  136. package/dist/esm/lib/container/ng-flow/ng-flow.component.js +167 -28
  137. package/dist/esm/lib/container/ng-flow/ng-flow.component.js.map +1 -1
  138. package/dist/esm/lib/container/node-renderer/node-renderer.component.d.ts +2 -0
  139. package/dist/esm/lib/container/node-renderer/node-renderer.component.d.ts.map +1 -1
  140. package/dist/esm/lib/container/node-renderer/node-renderer.component.js +40 -2
  141. package/dist/esm/lib/container/node-renderer/node-renderer.component.js.map +1 -1
  142. package/dist/esm/lib/container/pane/pane.component.d.ts +0 -1
  143. package/dist/esm/lib/container/pane/pane.component.d.ts.map +1 -1
  144. package/dist/esm/lib/container/pane/pane.component.js +18 -25
  145. package/dist/esm/lib/container/pane/pane.component.js.map +1 -1
  146. package/dist/esm/lib/container/viewport/viewport.component.d.ts +4 -0
  147. package/dist/esm/lib/container/viewport/viewport.component.d.ts.map +1 -1
  148. package/dist/esm/lib/container/viewport/viewport.component.js +4 -0
  149. package/dist/esm/lib/container/viewport/viewport.component.js.map +1 -1
  150. package/dist/esm/lib/directives/drag.directive.d.ts +17 -0
  151. package/dist/esm/lib/directives/drag.directive.d.ts.map +1 -1
  152. package/dist/esm/lib/directives/drag.directive.js +17 -0
  153. package/dist/esm/lib/directives/drag.directive.js.map +1 -1
  154. package/dist/esm/lib/directives/key-handler.directive.d.ts +13 -0
  155. package/dist/esm/lib/directives/key-handler.directive.d.ts.map +1 -1
  156. package/dist/esm/lib/directives/key-handler.directive.js +13 -0
  157. package/dist/esm/lib/directives/key-handler.directive.js.map +1 -1
  158. package/dist/esm/lib/public-api.d.ts +2 -0
  159. package/dist/esm/lib/public-api.d.ts.map +1 -1
  160. package/dist/esm/lib/public-api.js +4 -0
  161. package/dist/esm/lib/public-api.js.map +1 -1
  162. package/dist/esm/lib/services/flow-store.service.d.ts +3 -0
  163. package/dist/esm/lib/services/flow-store.service.d.ts.map +1 -1
  164. package/dist/esm/lib/services/flow-store.service.js +3 -0
  165. package/dist/esm/lib/services/flow-store.service.js.map +1 -1
  166. package/dist/esm/lib/services/ng-flow.service.d.ts +82 -0
  167. package/dist/esm/lib/services/ng-flow.service.d.ts.map +1 -1
  168. package/dist/esm/lib/services/ng-flow.service.js +114 -30
  169. package/dist/esm/lib/services/ng-flow.service.js.map +1 -1
  170. package/dist/esm/lib/services/tokens.d.ts +23 -0
  171. package/dist/esm/lib/services/tokens.d.ts.map +1 -1
  172. package/dist/esm/lib/services/tokens.js +22 -0
  173. package/dist/esm/lib/services/tokens.js.map +1 -1
  174. package/dist/esm/lib/types/edges.d.ts +6 -5
  175. package/dist/esm/lib/types/edges.d.ts.map +1 -1
  176. package/dist/esm/lib/types/nodes.d.ts +46 -3
  177. package/dist/esm/lib/types/nodes.d.ts.map +1 -1
  178. package/dist/esm/lib/utils/changes.d.ts +20 -0
  179. package/dist/esm/lib/utils/changes.d.ts.map +1 -1
  180. package/dist/esm/lib/utils/changes.js +20 -0
  181. package/dist/esm/lib/utils/changes.js.map +1 -1
  182. package/dist/esm/lib/utils/index.d.ts +1 -0
  183. package/dist/esm/lib/utils/index.d.ts.map +1 -1
  184. package/dist/esm/lib/utils/index.js +1 -0
  185. package/dist/esm/lib/utils/index.js.map +1 -1
  186. package/dist/esm/lib/utils/inject-ng-flow-node.d.ts +20 -0
  187. package/dist/esm/lib/utils/inject-ng-flow-node.d.ts.map +1 -0
  188. package/dist/esm/lib/utils/inject-ng-flow-node.js +28 -0
  189. package/dist/esm/lib/utils/inject-ng-flow-node.js.map +1 -0
  190. package/dist/style.css +416 -411
  191. package/package.json +6 -6
@@ -0,0 +1,234 @@
1
+ /**
2
+ * Canonical list of tools the agent bridge exposes. Pass this array straight
3
+ * to an LLM tool-use API (Anthropic `tools`, OpenAI `tools`) or use it to
4
+ * generate an MCP server.
5
+ *
6
+ * Every `name` here matches a method registered in `AngflowAgentBridge`.
7
+ */
8
+ export const AGENT_TOOL_SCHEMAS = [
9
+ {
10
+ name: 'list_flows',
11
+ description: 'List the ids of every flow currently registered with the bridge.',
12
+ inputSchema: { type: 'object', properties: {}, additionalProperties: false },
13
+ },
14
+ {
15
+ name: 'get_state',
16
+ description: 'Return a full snapshot of a flow: { nodes, edges, viewport }. ' +
17
+ 'Use this whenever you need to see the current canvas before deciding what to change.',
18
+ inputSchema: {
19
+ type: 'object',
20
+ properties: {
21
+ flowId: { type: 'string', description: 'Flow id. Omit if exactly one flow is registered.' },
22
+ },
23
+ additionalProperties: false,
24
+ },
25
+ },
26
+ {
27
+ name: 'get_nodes',
28
+ description: 'Return all nodes on a flow.',
29
+ inputSchema: {
30
+ type: 'object',
31
+ properties: { flowId: { type: 'string' } },
32
+ additionalProperties: false,
33
+ },
34
+ },
35
+ {
36
+ name: 'get_edges',
37
+ description: 'Return all edges on a flow.',
38
+ inputSchema: {
39
+ type: 'object',
40
+ properties: { flowId: { type: 'string' } },
41
+ additionalProperties: false,
42
+ },
43
+ },
44
+ {
45
+ name: 'get_node',
46
+ description: 'Return a single node by id, or null if absent.',
47
+ inputSchema: {
48
+ type: 'object',
49
+ properties: { flowId: { type: 'string' }, id: { type: 'string' } },
50
+ required: ['id'],
51
+ additionalProperties: false,
52
+ },
53
+ },
54
+ {
55
+ name: 'get_edge',
56
+ description: 'Return a single edge by id, or null if absent.',
57
+ inputSchema: {
58
+ type: 'object',
59
+ properties: { flowId: { type: 'string' }, id: { type: 'string' } },
60
+ required: ['id'],
61
+ additionalProperties: false,
62
+ },
63
+ },
64
+ {
65
+ name: 'add_node',
66
+ description: 'Append a node to the flow. The node must include id, position { x, y }, and data. ' +
67
+ 'Optional: type, width, height, draggable, selectable, hidden, etc.',
68
+ inputSchema: {
69
+ type: 'object',
70
+ properties: {
71
+ flowId: { type: 'string' },
72
+ node: {
73
+ type: 'object',
74
+ properties: {
75
+ id: { type: 'string' },
76
+ type: { type: 'string' },
77
+ position: {
78
+ type: 'object',
79
+ properties: { x: { type: 'number' }, y: { type: 'number' } },
80
+ required: ['x', 'y'],
81
+ },
82
+ data: { type: 'object' },
83
+ },
84
+ required: ['id', 'position', 'data'],
85
+ },
86
+ },
87
+ required: ['node'],
88
+ additionalProperties: false,
89
+ },
90
+ },
91
+ {
92
+ name: 'add_edge',
93
+ description: 'Append an edge to the flow. The edge must include id, source (node id), and target (node id). ' +
94
+ 'Optional: type, sourceHandle, targetHandle, label, animated, data.',
95
+ inputSchema: {
96
+ type: 'object',
97
+ properties: {
98
+ flowId: { type: 'string' },
99
+ edge: {
100
+ type: 'object',
101
+ properties: {
102
+ id: { type: 'string' },
103
+ source: { type: 'string' },
104
+ target: { type: 'string' },
105
+ sourceHandle: { type: ['string', 'null'] },
106
+ targetHandle: { type: ['string', 'null'] },
107
+ type: { type: 'string' },
108
+ animated: { type: 'boolean' },
109
+ label: { type: 'string' },
110
+ data: { type: 'object' },
111
+ },
112
+ required: ['id', 'source', 'target'],
113
+ },
114
+ },
115
+ required: ['edge'],
116
+ additionalProperties: false,
117
+ },
118
+ },
119
+ {
120
+ name: 'update_node',
121
+ description: 'Shallow-merge `patch` into the node with the given id. Use `patch.data` to update node data; ' +
122
+ 'use `patch.position` to move it. Other nodes are untouched.',
123
+ inputSchema: {
124
+ type: 'object',
125
+ properties: {
126
+ flowId: { type: 'string' },
127
+ id: { type: 'string' },
128
+ patch: { type: 'object' },
129
+ },
130
+ required: ['id', 'patch'],
131
+ additionalProperties: false,
132
+ },
133
+ },
134
+ {
135
+ name: 'update_edge',
136
+ description: 'Shallow-merge `patch` into the edge with the given id.',
137
+ inputSchema: {
138
+ type: 'object',
139
+ properties: {
140
+ flowId: { type: 'string' },
141
+ id: { type: 'string' },
142
+ patch: { type: 'object' },
143
+ },
144
+ required: ['id', 'patch'],
145
+ additionalProperties: false,
146
+ },
147
+ },
148
+ {
149
+ name: 'delete_elements',
150
+ description: 'Delete nodes and/or edges by id. Edges connected to deleted nodes are removed automatically. ' +
151
+ 'Returns { deletedNodes, deletedEdges }.',
152
+ inputSchema: {
153
+ type: 'object',
154
+ properties: {
155
+ flowId: { type: 'string' },
156
+ nodeIds: { type: 'array', items: { type: 'string' } },
157
+ edgeIds: { type: 'array', items: { type: 'string' } },
158
+ },
159
+ additionalProperties: false,
160
+ },
161
+ },
162
+ {
163
+ name: 'set_nodes',
164
+ description: 'Replace the entire nodes array. Prefer add_node / update_node / delete_elements for incremental edits.',
165
+ inputSchema: {
166
+ type: 'object',
167
+ properties: {
168
+ flowId: { type: 'string' },
169
+ nodes: { type: 'array', items: { type: 'object' } },
170
+ },
171
+ required: ['nodes'],
172
+ additionalProperties: false,
173
+ },
174
+ },
175
+ {
176
+ name: 'set_edges',
177
+ description: 'Replace the entire edges array. Prefer add_edge / update_edge / delete_elements for incremental edits.',
178
+ inputSchema: {
179
+ type: 'object',
180
+ properties: {
181
+ flowId: { type: 'string' },
182
+ edges: { type: 'array', items: { type: 'object' } },
183
+ },
184
+ required: ['edges'],
185
+ additionalProperties: false,
186
+ },
187
+ },
188
+ {
189
+ name: 'fit_view',
190
+ description: 'Zoom and pan so all (or the given) nodes are visible.',
191
+ inputSchema: {
192
+ type: 'object',
193
+ properties: {
194
+ flowId: { type: 'string' },
195
+ padding: { type: 'number' },
196
+ duration: { type: 'number' },
197
+ nodeIds: { type: 'array', items: { type: 'string' } },
198
+ },
199
+ additionalProperties: false,
200
+ },
201
+ },
202
+ {
203
+ name: 'set_viewport',
204
+ description: 'Set the viewport to an absolute { x, y, zoom }.',
205
+ inputSchema: {
206
+ type: 'object',
207
+ properties: {
208
+ flowId: { type: 'string' },
209
+ viewport: {
210
+ type: 'object',
211
+ properties: {
212
+ x: { type: 'number' },
213
+ y: { type: 'number' },
214
+ zoom: { type: 'number' },
215
+ },
216
+ required: ['x', 'y', 'zoom'],
217
+ },
218
+ duration: { type: 'number' },
219
+ },
220
+ required: ['viewport'],
221
+ additionalProperties: false,
222
+ },
223
+ },
224
+ {
225
+ name: 'get_viewport',
226
+ description: 'Return the current { x, y, zoom }.',
227
+ inputSchema: {
228
+ type: 'object',
229
+ properties: { flowId: { type: 'string' } },
230
+ additionalProperties: false,
231
+ },
232
+ },
233
+ ];
234
+ //# sourceMappingURL=tool-schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-schemas.js","sourceRoot":"","sources":["../../../../src/lib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,IAAI,EAAE,QAAQ,EAAE,EAAE;YAC1C,oBAAoB,EAAE,KAAK;SAC5B;KACF;CACF,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { AgentInbound, AgentOutbound, AgentResponse, AgentTransport } from '../types';
2
+ export interface WebSocketTransportOptions {
3
+ /** WS URL to dial. */
4
+ url: string;
5
+ /** Reconnect with exponential backoff on close. Defaults to `true`. */
6
+ reconnect?: boolean;
7
+ /** Initial reconnect delay in ms. Defaults to `1000`. */
8
+ initialReconnectDelayMs?: number;
9
+ /** Max reconnect delay in ms. Defaults to `30000`. */
10
+ maxReconnectDelayMs?: number;
11
+ /** Optional logger; defaults to no-op. */
12
+ onError?: (err: unknown) => void;
13
+ }
14
+ /**
15
+ * Browser→server WebSocket transport. The page dials `url`; whatever lives
16
+ * on the other end is expected to send `AgentInbound` frames and read
17
+ * `AgentOutbound` frames.
18
+ *
19
+ * Reconnects with exponential backoff on close unless `reconnect: false`.
20
+ */
21
+ export declare class WebSocketTransport implements AgentTransport {
22
+ private socket;
23
+ private handler;
24
+ private stopped;
25
+ private reconnectAttempts;
26
+ private reconnectTimer;
27
+ private readonly url;
28
+ private readonly reconnect;
29
+ private readonly initialDelay;
30
+ private readonly maxDelay;
31
+ private readonly onError;
32
+ constructor(options: WebSocketTransportOptions);
33
+ start(handler: (req: AgentInbound) => Promise<AgentResponse>): void;
34
+ send(frame: AgentOutbound): void;
35
+ stop(): void;
36
+ private connect;
37
+ private scheduleReconnect;
38
+ }
39
+ //# sourceMappingURL=websocket.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../../../src/lib/agent/transports/websocket.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,yBAAyB;IACxC,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yDAAyD;IACzD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0CAA0C;IAC1C,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC;AAED;;;;;;GAMG;AACH,qBAAa,kBAAmB,YAAW,cAAc;IACvD,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,OAAO,CAAgE;IAC/E,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,cAAc,CAA8C;IACpE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;IACpC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,OAAO,EAAE,yBAAyB;IAQ9C,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI;IAKnE,IAAI,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAUhC,IAAI,IAAI,IAAI;IAaZ,OAAO,CAAC,OAAO;IAsCf,OAAO,CAAC,iBAAiB;CAS1B"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Browser→server WebSocket transport. The page dials `url`; whatever lives
3
+ * on the other end is expected to send `AgentInbound` frames and read
4
+ * `AgentOutbound` frames.
5
+ *
6
+ * Reconnects with exponential backoff on close unless `reconnect: false`.
7
+ */
8
+ export class WebSocketTransport {
9
+ constructor(options) {
10
+ this.socket = null;
11
+ this.handler = null;
12
+ this.stopped = false;
13
+ this.reconnectAttempts = 0;
14
+ this.reconnectTimer = null;
15
+ this.url = options.url;
16
+ this.reconnect = options.reconnect ?? true;
17
+ this.initialDelay = options.initialReconnectDelayMs ?? 1000;
18
+ this.maxDelay = options.maxReconnectDelayMs ?? 30000;
19
+ this.onError = options.onError ?? (() => { });
20
+ }
21
+ start(handler) {
22
+ this.handler = handler;
23
+ this.connect();
24
+ }
25
+ send(frame) {
26
+ const sock = this.socket;
27
+ if (!sock || sock.readyState !== WebSocket.OPEN)
28
+ return;
29
+ try {
30
+ sock.send(JSON.stringify(frame));
31
+ }
32
+ catch (err) {
33
+ this.onError(err);
34
+ }
35
+ }
36
+ stop() {
37
+ this.stopped = true;
38
+ if (this.reconnectTimer) {
39
+ clearTimeout(this.reconnectTimer);
40
+ this.reconnectTimer = null;
41
+ }
42
+ if (this.socket) {
43
+ this.socket.close();
44
+ this.socket = null;
45
+ }
46
+ this.handler = null;
47
+ }
48
+ connect() {
49
+ if (this.stopped || typeof WebSocket === 'undefined')
50
+ return;
51
+ let sock;
52
+ try {
53
+ sock = new WebSocket(this.url);
54
+ }
55
+ catch (err) {
56
+ this.onError(err);
57
+ this.scheduleReconnect();
58
+ return;
59
+ }
60
+ this.socket = sock;
61
+ sock.addEventListener('open', () => {
62
+ this.reconnectAttempts = 0;
63
+ });
64
+ sock.addEventListener('message', async (msg) => {
65
+ if (!this.handler)
66
+ return;
67
+ let req;
68
+ try {
69
+ req = JSON.parse(typeof msg.data === 'string' ? msg.data : await msg.data.text());
70
+ }
71
+ catch (err) {
72
+ this.onError(err);
73
+ return;
74
+ }
75
+ const res = await this.handler(req);
76
+ this.send(res);
77
+ });
78
+ sock.addEventListener('error', (ev) => this.onError(ev));
79
+ sock.addEventListener('close', () => {
80
+ this.socket = null;
81
+ this.scheduleReconnect();
82
+ });
83
+ }
84
+ scheduleReconnect() {
85
+ if (this.stopped || !this.reconnect)
86
+ return;
87
+ const delay = Math.min(this.initialDelay * 2 ** this.reconnectAttempts, this.maxDelay);
88
+ this.reconnectAttempts += 1;
89
+ this.reconnectTimer = setTimeout(() => {
90
+ this.reconnectTimer = null;
91
+ this.connect();
92
+ }, delay);
93
+ }
94
+ }
95
+ //# sourceMappingURL=websocket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../../../src/lib/agent/transports/websocket.ts"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,MAAM,OAAO,kBAAkB;IAY7B,YAAY,OAAkC;QAXtC,WAAM,GAAqB,IAAI,CAAC;QAChC,YAAO,GAA2D,IAAI,CAAC;QACvE,YAAO,GAAG,KAAK,CAAC;QAChB,sBAAiB,GAAG,CAAC,CAAC;QACtB,mBAAc,GAAyC,IAAI,CAAC;QAQlE,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC;QAC3C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,uBAAuB,IAAI,IAAI,CAAC;QAC5D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,mBAAmB,IAAI,KAAK,CAAC;QACrD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,OAAsD;QAC1D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAED,IAAI,CAAC,KAAoB;QACvB,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;QACzB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,IAAI;YAAE,OAAO;QACxD,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACpB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AAG,CAAC,IAAa,CAAC,IAAI,EAAE,CAAiB,CAAC;YAC9G,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBAClB,OAAO;YACT,CAAC;YACD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QAEzD,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YAClC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,iBAAiB;QACvB,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,OAAO;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvF,IAAI,CAAC,iBAAiB,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,GAAG,EAAE;YACpC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;YAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC,EAAE,KAAK,CAAC,CAAC;IACZ,CAAC;CACF"}
@@ -0,0 +1,29 @@
1
+ import type { AgentInbound, AgentOutbound, AgentResponse, AgentTransport } from '../types';
2
+ export interface WindowTransportOptions {
3
+ /**
4
+ * Property name to expose on `window`. Defaults to `'angflow'`. The shape
5
+ * is `window[namespace] = { callTool, subscribe, toolSchemas }`.
6
+ */
7
+ namespace?: string;
8
+ }
9
+ /**
10
+ * Transport that exposes a global `window.angflow` API. Useful for:
11
+ * - devtools console snippets (`await window.angflow.callTool('add_node', {...})`)
12
+ * - same-page agent harnesses (Playwright `page.evaluate`, browser extensions)
13
+ * - bridging to a custom transport you control (e.g. CDP, postMessage)
14
+ *
15
+ * It does NOT open a network port. For cross-process agents use
16
+ * `WebSocketTransport`.
17
+ */
18
+ export declare class WindowTransport implements AgentTransport {
19
+ private readonly namespace;
20
+ private subscribers;
21
+ private requestHandler;
22
+ private nextId;
23
+ constructor(options?: WindowTransportOptions);
24
+ start(handler: (req: AgentInbound) => Promise<AgentResponse>): void;
25
+ send(frame: AgentOutbound): void;
26
+ stop(): void;
27
+ private handleCallTool;
28
+ }
29
+ //# sourceMappingURL=window.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../../../src/lib/agent/transports/window.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACf,MAAM,UAAU,CAAC;AAGlB,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAWD;;;;;;;;GAQG;AACH,qBAAa,eAAgB,YAAW,cAAc;IACpD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,WAAW,CAA2C;IAC9D,OAAO,CAAC,cAAc,CAAgE;IACtF,OAAO,CAAC,MAAM,CAAK;gBAEP,OAAO,GAAE,sBAA2B;IAIhD,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI;IAgBnE,IAAI,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAahC,IAAI,IAAI,IAAI;YAQE,cAAc;CAW7B"}
@@ -0,0 +1,65 @@
1
+ import { AGENT_TOOL_SCHEMAS } from '../tool-schemas';
2
+ /**
3
+ * Transport that exposes a global `window.angflow` API. Useful for:
4
+ * - devtools console snippets (`await window.angflow.callTool('add_node', {...})`)
5
+ * - same-page agent harnesses (Playwright `page.evaluate`, browser extensions)
6
+ * - bridging to a custom transport you control (e.g. CDP, postMessage)
7
+ *
8
+ * It does NOT open a network port. For cross-process agents use
9
+ * `WebSocketTransport`.
10
+ */
11
+ export class WindowTransport {
12
+ constructor(options = {}) {
13
+ this.subscribers = new Set();
14
+ this.requestHandler = null;
15
+ this.nextId = 1;
16
+ this.namespace = options.namespace ?? 'angflow';
17
+ }
18
+ start(handler) {
19
+ this.requestHandler = handler;
20
+ if (typeof window === 'undefined')
21
+ return;
22
+ const api = {
23
+ callTool: (method, params = {}) => this.handleCallTool(method, params),
24
+ subscribe: (h) => {
25
+ this.subscribers.add(h);
26
+ return () => this.subscribers.delete(h);
27
+ },
28
+ toolSchemas: AGENT_TOOL_SCHEMAS,
29
+ };
30
+ window[this.namespace] = api;
31
+ }
32
+ send(frame) {
33
+ // Only events get pushed to subscribers; responses are returned from callTool.
34
+ if ('event' in frame) {
35
+ for (const sub of this.subscribers) {
36
+ try {
37
+ sub(frame);
38
+ }
39
+ catch {
40
+ // Subscriber errors must not poison other subscribers.
41
+ }
42
+ }
43
+ }
44
+ }
45
+ stop() {
46
+ this.requestHandler = null;
47
+ this.subscribers.clear();
48
+ if (typeof window !== 'undefined') {
49
+ delete window[this.namespace];
50
+ }
51
+ }
52
+ async handleCallTool(method, params) {
53
+ if (!this.requestHandler)
54
+ throw new Error('Agent bridge not started');
55
+ const res = await this.requestHandler({ id: this.nextId++, method, params });
56
+ if ('error' in res) {
57
+ const err = new Error(res.error.message);
58
+ err.code = res.error.code;
59
+ err.data = res.error.data;
60
+ throw err;
61
+ }
62
+ return res.result;
63
+ }
64
+ }
65
+ //# sourceMappingURL=window.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window.js","sourceRoot":"","sources":["../../../../../src/lib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AC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAQ,MAA6C,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,MAAc,EAAE,MAA+B;QAC1E,IAAI,CAAC,IAAI,CAAC,cAAc;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QACtE,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7E,IAAI,OAAO,IAAI,GAAG,EAAE,CAAC;YACnB,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAA8C,CAAC;YACtF,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAC1B,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAC1B,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,OAAO,GAAG,CAAC,MAAM,CAAC;IACpB,CAAC;CACF"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Wire formats and transport contract for the agent bridge.
3
+ *
4
+ * The bridge speaks a small JSON-RPC-style protocol so a remote agent (an
5
+ * MCP server, a Playwright script, a browser extension, a console snippet)
6
+ * can call into `NgFlowService` and observe state changes uniformly.
7
+ */
8
+ /** A request from the agent to the bridge. `id` correlates the response. */
9
+ export interface AgentRequest {
10
+ id: number | string;
11
+ method: string;
12
+ params?: Record<string, unknown>;
13
+ }
14
+ /** A successful response to an `AgentRequest`. */
15
+ export interface AgentSuccessResponse {
16
+ id: number | string;
17
+ result: unknown;
18
+ }
19
+ /** An error response to an `AgentRequest`. */
20
+ export interface AgentErrorResponse {
21
+ id: number | string;
22
+ error: {
23
+ code: number;
24
+ message: string;
25
+ data?: unknown;
26
+ };
27
+ }
28
+ export type AgentResponse = AgentSuccessResponse | AgentErrorResponse;
29
+ /** A push-style event from the bridge to the agent (no id, no response expected). */
30
+ export interface AgentEvent {
31
+ event: string;
32
+ params?: Record<string, unknown>;
33
+ }
34
+ /** Frame sent from agent to bridge. */
35
+ export type AgentInbound = AgentRequest;
36
+ /** Frame sent from bridge to agent. */
37
+ export type AgentOutbound = AgentResponse | AgentEvent;
38
+ /**
39
+ * Transport contract: anything that can shuttle JSON frames between an
40
+ * external agent process and the in-browser bridge. The bridge calls
41
+ * `start(handler)` once; the transport invokes `handler` for every inbound
42
+ * frame and calls `send` for every outbound frame.
43
+ */
44
+ export interface AgentTransport {
45
+ /** Begin accepting incoming requests. Resolves once the transport is ready. */
46
+ start(handler: (req: AgentInbound) => Promise<AgentResponse>): void | Promise<void>;
47
+ /** Push an outbound frame (response or event) to the agent peer. */
48
+ send(frame: AgentOutbound): void;
49
+ /** Tear down resources; called when the bridge is destroyed. */
50
+ stop(): void;
51
+ }
52
+ /**
53
+ * Describes a single agent tool — name, human description, and a JSON Schema
54
+ * for params. Suitable for direct use as a Claude / OpenAI tool definition.
55
+ */
56
+ export interface AgentToolSchema {
57
+ name: string;
58
+ description: string;
59
+ inputSchema: {
60
+ type: 'object';
61
+ properties: Record<string, unknown>;
62
+ required?: string[];
63
+ additionalProperties?: boolean;
64
+ };
65
+ }
66
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/agent/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4EAA4E;AAC5E,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE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AAC;QACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;CACH"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Wire formats and transport contract for the agent bridge.
3
+ *
4
+ * The bridge speaks a small JSON-RPC-style protocol so a remote agent (an
5
+ * MCP server, a Playwright script, a browser extension, a console snippet)
6
+ * can call into `NgFlowService` and observe state changes uniformly.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/agent/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -1,4 +1,8 @@
1
1
  import * as i0 from "@angular/core";
2
+ /**
3
+ * Screen-reader-only descriptions referenced by node, edge, and handle
4
+ * `aria-describedby` attributes. Rendered internally by `<ng-flow>`.
5
+ */
2
6
  export declare class A11yDescriptionsComponent {
3
7
  private store;
4
8
  get rfId(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"a11y-descriptions.component.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/a11y-descriptions/a11y-descriptions.component.ts"],"names":[],"mappings":";AAGA,qBAmBa,yBAAyB;IACpC,OAAO,CAAC,KAAK,CAAqB;IAElC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;OAA8B;yCAPlC,yBAAyB;2CAAzB,yBAAyB;CAQrC"}
1
+ {"version":3,"file":"a11y-descriptions.component.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/a11y-descriptions/a11y-descriptions.component.ts"],"names":[],"mappings":";AAGA;;;GAGG;AACH,qBAmBa,yBAAyB;IACpC,OAAO,CAAC,KAAK,CAAqB;IAElC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;OAA8B;yCAPlC,yBAAyB;2CAAzB,yBAAyB;CAQrC"}