@schlenkr/ragents 0.1.18 → 0.1.20

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 (209) hide show
  1. package/apps/server/src/host-api.json +6 -2
  2. package/apps/server/src/host-api.ts +3 -2
  3. package/apps/server/src/host-web.ts +3 -0
  4. package/apps/server/src/plugin-support/actor-programs/contract.ts +0 -3
  5. package/apps/server/src/plugin-support/removed-layout.ts +94 -0
  6. package/apps/server/src/ragents/engine.ts +2 -1
  7. package/apps/server/src/title-compactor.ts +5 -7
  8. package/apps/web/dist/assets/highlighted-body-KPVGNVTW-k67VKdbw.js +1 -0
  9. package/apps/web/dist/assets/main-CVjIz7BS.js +674 -0
  10. package/apps/web/dist/help/guide-clients.html +22 -42
  11. package/apps/web/dist/help/guide-clients.md +24 -45
  12. package/apps/web/dist/help/guide-functions.html +1 -1
  13. package/apps/web/dist/help/guide-functions.md +1 -1
  14. package/apps/web/dist/help/guide-getting-started.html +14 -22
  15. package/apps/web/dist/help/guide-getting-started.md +17 -24
  16. package/apps/web/dist/help/guide-ideas.html +1 -1
  17. package/apps/web/dist/help/guide-ideas.md +1 -1
  18. package/apps/web/dist/help/guide-plugins.html +1 -1
  19. package/apps/web/dist/help/guide-plugins.md +1 -1
  20. package/apps/web/dist/help/guide-programs.html +1 -1
  21. package/apps/web/dist/help/guide-programs.md +1 -1
  22. package/apps/web/dist/help/index.html +12 -79
  23. package/apps/web/dist/help/mini-app.css +8 -502
  24. package/apps/web/dist/host-web.json +28 -23
  25. package/apps/web/dist/index.html +2 -3
  26. package/apps/web/dist/run-panel.html +3 -4
  27. package/apps/web/src/Overview.tsx +4 -143
  28. package/apps/web/src/PluginChat.tsx +22 -116
  29. package/apps/web/src/PluginRegistry.tsx +4 -9
  30. package/apps/web/src/RunPreparationChat.tsx +4 -1
  31. package/apps/web/src/host-modules.ts +2 -0
  32. package/apps/web/src/main.tsx +23 -3
  33. package/apps/web/src/panel/RunLine.tsx +5 -2
  34. package/apps/web/src/panel/RunsPage.tsx +6 -6
  35. package/apps/web/src/panel/StartPage.tsx +6 -5
  36. package/apps/web/src/panel/contract.ts +3 -0
  37. package/apps/web/src/panel/page-props.ts +2 -0
  38. package/apps/web/src/run-apps.ts +34 -0
  39. package/apps/web/src/run-overview.ts +0 -27
  40. package/apps/web/src/run-panel/PanelContributions.tsx +41 -0
  41. package/apps/web/src/run-panel/RunPanelApp.tsx +172 -91
  42. package/apps/web/src/run-panel/RunPanelMenu.tsx +4 -3
  43. package/apps/web/src/run-panel/RunPanelWorkspace.tsx +8 -2
  44. package/apps/web/src/run-panel/clipboard.ts +17 -14
  45. package/apps/web/src/run-panel/host-contract.ts +8 -9
  46. package/apps/web/src/run-panel/host.ts +5 -31
  47. package/apps/web/src/run-panel/input-bridge.ts +15 -7
  48. package/bundles/ragents.activity/ragents-bundle.json +2 -2
  49. package/bundles/ragents.actor-programs/prompt.hbs +4 -5
  50. package/bundles/ragents.actor-programs/ragents-bundle.json +4 -14
  51. package/bundles/ragents.actor-programs/server/index.js +2 -14
  52. package/bundles/ragents.actor-programs/server/index.js.map +2 -2
  53. package/bundles/ragents.actor-programs/web/classes.json +1 -1
  54. package/bundles/ragents.actor-programs/web/index.js +1 -3
  55. package/bundles/ragents.actor-programs/web/index.js.map +4 -4
  56. package/bundles/ragents.ask/ragents-bundle.json +2 -2
  57. package/bundles/ragents.browser/ragents-bundle.json +2 -2
  58. package/bundles/ragents.documents/ragents-bundle.json +2 -2
  59. package/bundles/ragents.lsp-fsharp/ragents-bundle.json +2 -2
  60. package/bundles/ragents.lsp-roslyn/ragents-bundle.json +2 -2
  61. package/bundles/ragents.lsp-typescript/ragents-bundle.json +2 -2
  62. package/bundles/ragents.model-relay/ragents-bundle.json +2 -2
  63. package/bundles/ragents.orchestration/ragents-bundle.json +15 -41
  64. package/bundles/ragents.orchestration/server/index.js +10 -249
  65. package/bundles/ragents.orchestration/server/index.js.map +4 -4
  66. package/bundles/ragents.orchestration/web/chunks/chunk-KU7O6MEX.js +2 -0
  67. package/bundles/ragents.orchestration/web/chunks/chunk-KU7O6MEX.js.map +7 -0
  68. package/bundles/ragents.orchestration/web/classes.json +1 -1
  69. package/bundles/ragents.orchestration/web/exports/web/program-slot.js +1 -1
  70. package/bundles/ragents.orchestration/web/index.js +10 -18
  71. package/bundles/ragents.orchestration/web/index.js.map +4 -4
  72. package/bundles/ragents.overseer/ragents-bundle.json +3 -3
  73. package/bundles/ragents.overseer/server/index.js +0 -1
  74. package/bundles/ragents.overseer/server/index.js.map +2 -2
  75. package/bundles/ragents.processes/ragents-bundle.json +2 -2
  76. package/bundles/ragents.product/ragents-bundle.json +2 -2
  77. package/bundles/ragents.profile-distribution/ragents-bundle.json +2 -2
  78. package/bundles/ragents.reference/ragents-bundle.json +3 -3
  79. package/bundles/ragents.reference/run-scripts/balcony-wizard/RUN.md +1 -1
  80. package/bundles/ragents.reference/run-scripts/balcony-wizard/src/server.ts +1 -2
  81. package/bundles/ragents.reference/run-scripts/balcony-wizard/tests/program.test.ts +6 -7
  82. package/bundles/ragents.reference/run-scripts/conversation-circle/RUN.md +3 -3
  83. package/bundles/ragents.reference/run-scripts/conversation-circle/src/server.ts +3 -13
  84. package/bundles/ragents.reference/run-scripts/conversation-circle/tests/helpers.ts +1 -1
  85. package/bundles/ragents.reference/run-scripts/conversation-circle/tests/program.test.ts +1 -6
  86. package/bundles/ragents.reference/run-scripts/learning-afternoon/src/server.ts +1 -15
  87. package/bundles/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +1 -1
  88. package/bundles/ragents.reference/run-scripts/moderated-round/tests/helpers.ts +1 -1
  89. package/bundles/ragents.reference/run-scripts/quick-note/RUN.md +1 -1
  90. package/bundles/ragents.reference/run-scripts/quick-note/src/server.ts +1 -2
  91. package/bundles/ragents.reference/run-scripts/quick-note/tests/program.test.ts +0 -2
  92. package/bundles/ragents.reference/run-scripts/run-roster/RUN.md +2 -2
  93. package/bundles/ragents.reference/run-scripts/run-roster/src/server.ts +1 -2
  94. package/bundles/ragents.reference/run-scripts/run-roster/tests/program.test.ts +0 -2
  95. package/bundles/ragents.reference/run-scripts/shared-actor-list/src/server.ts +1 -1
  96. package/bundles/ragents.reference/run-scripts/shared-actor-list/tests/helpers.ts +1 -1
  97. package/bundles/ragents.reference/run-scripts/word-game/src/contract.ts +1 -1
  98. package/bundles/ragents.reference/run-scripts/word-game/src/server.ts +0 -1
  99. package/bundles/ragents.reference/run-scripts/word-game/tests/program.test.ts +1 -2
  100. package/bundles/ragents.reference/skills/80-actor-text-analysis/SKILL.md +1 -1
  101. package/bundles/ragents.reference/skills/90-actor-notes/SKILL.md +1 -1
  102. package/bundles/ragents.todo/ragents-bundle.json +2 -2
  103. package/bundles/ragents.transcript/ragents-bundle.json +2 -2
  104. package/bundles/ragents.watch/ragents-bundle.json +2 -2
  105. package/bundles/ragents.workspace/ragents-bundle.json +2 -2
  106. package/package.json +8 -8
  107. package/packages/agent/dist/core/agent-settings.d.ts +1 -1
  108. package/packages/agent/src/core/agent-settings.ts +2 -2
  109. package/packages/ai/dist/types.d.ts +2 -1
  110. package/packages/ai/src/api/ai-sdk.ts +15 -2
  111. package/packages/ai/src/types.ts +2 -1
  112. package/packages/ragents/src/runtime/journal.ts +4 -0
  113. package/plugins/ragents.actor-programs/prompt.hbs +4 -5
  114. package/plugins/ragents.actor-programs/server/access-projections.ts +1 -1
  115. package/plugins/ragents.actor-programs/server/index.ts +0 -2
  116. package/plugins/ragents.actor-programs/server/runtime.ts +2 -10
  117. package/plugins/ragents.actor-programs/web/ActorViewFrame.tsx +5 -20
  118. package/plugins/ragents.actor-programs/web/AppsPanel.tsx +3 -79
  119. package/plugins/ragents.actor-programs/web/EmbeddedApps.tsx +0 -9
  120. package/plugins/ragents.actor-programs/web/api.ts +0 -20
  121. package/plugins/ragents.actor-programs/web/context.ts +0 -3
  122. package/plugins/ragents.actor-programs/web/index.tsx +0 -9
  123. package/plugins/ragents.orchestration/ragents-plugin.json +1 -2
  124. package/plugins/ragents.orchestration/server/index.ts +1 -11
  125. package/plugins/ragents.orchestration/web/ActorChat.tsx +1 -1
  126. package/plugins/ragents.orchestration/web/ActorChatControls.tsx +1 -1
  127. package/plugins/ragents.orchestration/web/FlowInspector.tsx +2 -4
  128. package/plugins/ragents.orchestration/web/InspectionPanel.tsx +21 -0
  129. package/plugins/ragents.orchestration/web/index.tsx +13 -9
  130. package/plugins/ragents.orchestration/web/program-slot.ts +0 -3
  131. package/plugins/ragents.orchestration/web/run-panel/AddresseeControl.tsx +15 -36
  132. package/plugins/ragents.orchestration/web/run-panel/RunPanel.tsx +76 -451
  133. package/plugins/ragents.orchestration/web/run-panel/run-panel-actors.ts +0 -27
  134. package/plugins/ragents.orchestration/web/run-panel/run-panel-state.ts +7 -40
  135. package/plugins/ragents.overseer/server/coordinator-prompt.ts +0 -1
  136. package/plugins/ragents.reference/examples.ts +1 -2
  137. package/plugins/ragents.reference/run-scripts/balcony-wizard/RUN.md +1 -1
  138. package/plugins/ragents.reference/run-scripts/balcony-wizard/src/server.ts +1 -2
  139. package/plugins/ragents.reference/run-scripts/balcony-wizard/tests/program.test.ts +6 -7
  140. package/plugins/ragents.reference/run-scripts/conversation-circle/RUN.md +3 -3
  141. package/plugins/ragents.reference/run-scripts/conversation-circle/src/server.ts +3 -13
  142. package/plugins/ragents.reference/run-scripts/conversation-circle/tests/helpers.ts +1 -1
  143. package/plugins/ragents.reference/run-scripts/conversation-circle/tests/program.test.ts +1 -6
  144. package/plugins/ragents.reference/run-scripts/learning-afternoon/src/server.ts +1 -15
  145. package/plugins/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +1 -1
  146. package/plugins/ragents.reference/run-scripts/moderated-round/tests/helpers.ts +1 -1
  147. package/plugins/ragents.reference/run-scripts/quick-note/RUN.md +1 -1
  148. package/plugins/ragents.reference/run-scripts/quick-note/src/server.ts +1 -2
  149. package/plugins/ragents.reference/run-scripts/quick-note/tests/program.test.ts +0 -2
  150. package/plugins/ragents.reference/run-scripts/run-roster/RUN.md +2 -2
  151. package/plugins/ragents.reference/run-scripts/run-roster/src/server.ts +1 -2
  152. package/plugins/ragents.reference/run-scripts/run-roster/tests/program.test.ts +0 -2
  153. package/plugins/ragents.reference/run-scripts/shared-actor-list/src/server.ts +1 -1
  154. package/plugins/ragents.reference/run-scripts/shared-actor-list/tests/helpers.ts +1 -1
  155. package/plugins/ragents.reference/run-scripts/word-game/src/contract.ts +1 -1
  156. package/plugins/ragents.reference/run-scripts/word-game/src/server.ts +0 -1
  157. package/plugins/ragents.reference/run-scripts/word-game/tests/program.test.ts +1 -2
  158. package/plugins/ragents.reference/skills/80-actor-text-analysis/SKILL.md +1 -1
  159. package/plugins/ragents.reference/skills/90-actor-notes/SKILL.md +1 -1
  160. package/plugins/ragents.reference/walkthroughs.ts +13 -14
  161. package/apps/web/dist/assets/highlighted-body-KPVGNVTW-BwD4uYEe.js +0 -1
  162. package/apps/web/dist/assets/main-KBrc5Q77.js +0 -11
  163. package/apps/web/dist/assets/mermaid-HWGCJPDP-CSCkaArr.js +0 -608
  164. package/apps/web/dist/assets/runPanel-BjG5NBKm.js +0 -26
  165. package/apps/web/src/App.tsx +0 -318
  166. package/apps/web/src/SessionList.tsx +0 -157
  167. package/apps/web/src/SurfaceShortcuts.tsx +0 -60
  168. package/apps/web/src/WorkspacePanel.tsx +0 -309
  169. package/apps/web/src/run-panel.tsx +0 -52
  170. package/bundles/ragents.orchestration/server/chunks/chunk-QS3WJ3D7.js +0 -11
  171. package/bundles/ragents.orchestration/server/chunks/chunk-QS3WJ3D7.js.map +0 -7
  172. package/bundles/ragents.orchestration/server/exports/server/contract.js +0 -9
  173. package/bundles/ragents.orchestration/server/exports/server/contract.js.map +0 -7
  174. package/bundles/ragents.orchestration/surface.hbs +0 -39
  175. package/bundles/ragents.orchestration/web/chunks/chunk-CFMJD5ZI.js +0 -2
  176. package/bundles/ragents.orchestration/web/chunks/chunk-CFMJD5ZI.js.map +0 -7
  177. package/bundles/ragents.orchestration/web/chunks/chunk-HOBLI364.js +0 -2
  178. package/bundles/ragents.orchestration/web/chunks/chunk-HOBLI364.js.map +0 -7
  179. package/bundles/ragents.orchestration/web/chunks/chunk-UCIMT2R4.js +0 -2
  180. package/bundles/ragents.orchestration/web/chunks/chunk-UCIMT2R4.js.map +0 -7
  181. package/bundles/ragents.orchestration/web/chunks/chunk-XGPPQCZR.js +0 -2
  182. package/bundles/ragents.orchestration/web/chunks/chunk-XGPPQCZR.js.map +0 -7
  183. package/bundles/ragents.orchestration/web/exports/web/surface-entities.js +0 -2
  184. package/bundles/ragents.orchestration/web/exports/web/surface-entities.js.map +0 -7
  185. package/bundles/ragents.orchestration/web/exports/web/tile-docking.js +0 -2
  186. package/bundles/ragents.orchestration/web/exports/web/tile-docking.js.map +0 -7
  187. package/plugins/ragents.actor-programs/web/ExpandIcon.tsx +0 -5
  188. package/plugins/ragents.actor-programs/web/FullscreenHost.tsx +0 -31
  189. package/plugins/ragents.orchestration/contract.ts +0 -51
  190. package/plugins/ragents.orchestration/server/contract.ts +0 -14
  191. package/plugins/ragents.orchestration/server/surface-tool.ts +0 -198
  192. package/plugins/ragents.orchestration/surface.hbs +0 -39
  193. package/plugins/ragents.orchestration/tiled-layout.ts +0 -55
  194. package/plugins/ragents.orchestration/web/ActorChatPreview.tsx +0 -29
  195. package/plugins/ragents.orchestration/web/ActorShortcut.tsx +0 -74
  196. package/plugins/ragents.orchestration/web/ActorSurfaceControls.tsx +0 -130
  197. package/plugins/ragents.orchestration/web/ActorTile.tsx +0 -23
  198. package/plugins/ragents.orchestration/web/Center.tsx +0 -133
  199. package/plugins/ragents.orchestration/web/SurfaceTiles.tsx +0 -47
  200. package/plugins/ragents.orchestration/web/TiledSurface.tsx +0 -280
  201. package/plugins/ragents.orchestration/web/actor-header-settings.ts +0 -41
  202. package/plugins/ragents.orchestration/web/run-panel/RunPanelSettings.tsx +0 -50
  203. package/plugins/ragents.orchestration/web/run-panel/run-panel-settings.ts +0 -47
  204. package/plugins/ragents.orchestration/web/run-panel/sheet-status.ts +0 -30
  205. package/plugins/ragents.orchestration/web/surface-entities.ts +0 -21
  206. package/plugins/ragents.orchestration/web/surface-view-settings.ts +0 -42
  207. package/plugins/ragents.orchestration/web/tile-docking.ts +0 -105
  208. package/plugins/ragents.orchestration/web/tiled-view-settings.ts +0 -74
  209. /package/apps/web/dist/assets/{mermaid-HWGCJPDP-BPn4aV2r.css → main-BPn4aV2r.css} +0 -0
@@ -1,309 +0,0 @@
1
- import { cn } from "cn";
2
- import { Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui";
3
- import { useCallback, useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type KeyboardEvent, type PointerEvent } from "react";
4
- import { createPortal } from "react-dom";
5
- import type { SessionContext, SessionNavigation, WorkspaceTabContribution } from "./PluginRegistry";
6
-
7
- export type WorkspacePanelState = "expanded" | "collapsed";
8
-
9
- export function useWorkspacePanelState(runId: string) {
10
- const storageKey = `ragents.workspacePanelState:${encodeURIComponent(runId)}`;
11
- const [state, setState] = useState<WorkspacePanelState>(() =>
12
- localStorage.getItem(storageKey) === "collapsed" ? "collapsed" : "expanded");
13
- const update = useCallback((next: WorkspacePanelState) => {
14
- localStorage.setItem(storageKey, next);
15
- setState(next);
16
- }, [storageKey]);
17
- return [state, update] as const;
18
- }
19
- /** Counts in a tab shrink to a plain dot: the number belongs to the panel, not to the button. */
20
- const tabClass = "flex min-h-9 min-w-9 flex-shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-lg px-[7px] py-[5px] text-[0.72rem] [&_[data-slot=badge]]:size-[5px] [&_[data-slot=badge]]:min-w-[5px] [&_[data-slot=badge]]:border-0 [&_[data-slot=badge]]:bg-current [&_[data-slot=badge]]:p-0 [&_[data-slot=badge]]:text-[0px]";
21
-
22
- const WORKSPACE_WIDTH_DEFAULT = 560;
23
- const WORKSPACE_WIDTH_MIN = 360;
24
- const WORKSPACE_WIDTH_MAX = 960;
25
-
26
- interface WorkspacePanelProps {
27
- headerContainer: HTMLElement | null;
28
- navigation: SessionNavigation;
29
- pendingTabIds: readonly string[];
30
- session: SessionContext;
31
- onToggleState: () => void;
32
- state: WorkspacePanelState;
33
- tabs: readonly WorkspaceTabContribution[];
34
- }
35
-
36
- export function WorkspacePanel(props: WorkspacePanelProps) {
37
- const widthStorageKey = `ragents.workspacePanelWidth:${encodeURIComponent(props.session.session.id)}`;
38
- const panelRef = useRef<HTMLElement>(null);
39
- const [visited, setVisited] = useState<readonly string[]>([]);
40
- const resizeCleanupRef = useRef<(() => void) | undefined>(undefined);
41
- const [normalWidth, setNormalWidth] = useState(() => {
42
- const stored = Number(localStorage.getItem(widthStorageKey));
43
- return stored >= WORKSPACE_WIDTH_MIN && stored <= WORKSPACE_WIDTH_MAX ? stored : WORKSPACE_WIDTH_DEFAULT;
44
- });
45
- const [layoutBounds, setLayoutBounds] = useState({ min: WORKSPACE_WIDTH_MIN, max: WORKSPACE_WIDTH_MAX });
46
- const normalWidthRef = useRef(normalWidth);
47
- const collapsed = props.state === "collapsed";
48
- const tabs = props.tabs;
49
- const activeTab = tabs.find((tab) => tab.id === props.navigation.activeTabId) ?? tabs[0];
50
- const activeTabId = activeTab?.id;
51
- const stateAction = collapsed ? "Expand sidebar" : "Collapse sidebar";
52
-
53
- useLayoutEffect(() => {
54
- const panel = panelRef.current;
55
- const header = props.headerContainer?.parentElement;
56
- if (!panel || !header) return;
57
- const update = () => header.style.setProperty("--workspace-panel-width", `${panel.getBoundingClientRect().width}px`);
58
- const observer = new ResizeObserver(update);
59
- observer.observe(panel);
60
- update();
61
- return () => {
62
- observer.disconnect();
63
- header.style.removeProperty("--workspace-panel-width");
64
- };
65
- }, [props.headerContainer]);
66
-
67
- useEffect(() => {
68
- if (activeTabId === undefined) return;
69
- setVisited((current) => current.includes(activeTabId) ? current : [...current, activeTabId]);
70
- }, [activeTabId]);
71
-
72
- useEffect(() => {
73
- const workspace = panelRef.current?.parentElement;
74
- if (!workspace) return;
75
-
76
- const update = () => {
77
- const next = boundsFor(workspace.clientWidth);
78
- setLayoutBounds((current) => current.min === next.min && current.max === next.max ? current : next);
79
- };
80
- const observer = new ResizeObserver(update);
81
- observer.observe(workspace);
82
- update();
83
- return () => observer.disconnect();
84
- }, []);
85
-
86
- useEffect(() => () => resizeCleanupRef.current?.(), []);
87
- useEffect(() => { if (collapsed) resizeCleanupRef.current?.(); }, [collapsed]);
88
-
89
- const boundsFor = (available: number) => {
90
- const reserved = available <= 960 ? 52 : 360;
91
- const max = Math.min(WORKSPACE_WIDTH_MAX, Math.max(0, available - reserved));
92
- return { min: Math.min(WORKSPACE_WIDTH_MIN, max), max };
93
- };
94
-
95
- const maximumWidth = () => {
96
- const available = panelRef.current?.parentElement?.clientWidth ?? WORKSPACE_WIDTH_MAX;
97
- return boundsFor(available).max;
98
- };
99
-
100
- const clampWidth = (width: number) => {
101
- const available = panelRef.current?.parentElement?.clientWidth ?? WORKSPACE_WIDTH_MAX;
102
- const bounds = boundsFor(available);
103
- return Math.min(bounds.max, Math.max(bounds.min, width));
104
- };
105
-
106
- const applyWidth = (width: number) => {
107
- panelRef.current?.style.setProperty("--workspace-panel-width", `${width}px`);
108
- };
109
-
110
- const commitWidth = (width: number) => {
111
- normalWidthRef.current = width;
112
- setNormalWidth(width);
113
- localStorage.setItem(widthStorageKey, String(width));
114
- };
115
-
116
- const startResize = (start: PointerEvent<HTMLDivElement>) => {
117
- start.preventDefault();
118
- resizeCleanupRef.current?.();
119
- const panel = panelRef.current;
120
- const workspace = panel?.parentElement;
121
- const target = start.currentTarget;
122
- const startX = start.clientX;
123
- const startWidth = panel?.getBoundingClientRect().width ?? normalWidthRef.current;
124
- let currentWidth = startWidth;
125
- let frame: number | undefined;
126
- let active = true;
127
- workspace?.setAttribute("data-resizing", "true");
128
- target.setPointerCapture(start.pointerId);
129
-
130
- function cleanup() {
131
- if (!active) return;
132
- active = false;
133
- if (frame !== undefined) cancelAnimationFrame(frame);
134
- window.removeEventListener("pointermove", move);
135
- window.removeEventListener("pointerup", up);
136
- window.removeEventListener("pointercancel", cancel);
137
- workspace?.removeAttribute("data-resizing");
138
- if (target.hasPointerCapture(start.pointerId)) target.releasePointerCapture(start.pointerId);
139
- resizeCleanupRef.current = undefined;
140
- }
141
-
142
- function move(event: globalThis.PointerEvent) {
143
- if (event.pointerId !== start.pointerId) return;
144
- currentWidth = clampWidth(startWidth + startX - event.clientX);
145
- if (frame !== undefined) return;
146
- frame = requestAnimationFrame(() => {
147
- frame = undefined;
148
- applyWidth(currentWidth);
149
- target.setAttribute("aria-valuenow", String(Math.round(currentWidth)));
150
- target.setAttribute("aria-valuetext", `${Math.round(currentWidth)} pixels`);
151
- });
152
- }
153
-
154
- function up(event: globalThis.PointerEvent) {
155
- if (event.pointerId !== start.pointerId) return;
156
- currentWidth = clampWidth(startWidth + startX - event.clientX);
157
- cleanup();
158
- applyWidth(currentWidth);
159
- commitWidth(currentWidth);
160
- }
161
-
162
- function cancel(event?: globalThis.PointerEvent) {
163
- if (event && event.pointerId !== start.pointerId) return;
164
- cleanup();
165
- applyWidth(normalWidthRef.current);
166
- const effective = clampWidth(normalWidthRef.current);
167
- target.setAttribute("aria-valuenow", String(Math.round(effective)));
168
- target.setAttribute("aria-valuetext", `${Math.round(effective)} pixels`);
169
- }
170
-
171
- window.addEventListener("pointermove", move);
172
- window.addEventListener("pointerup", up);
173
- window.addEventListener("pointercancel", cancel);
174
- resizeCleanupRef.current = cancel;
175
- };
176
-
177
- const resizeWithKeyboard = (event: KeyboardEvent<HTMLDivElement>) => {
178
- const current = panelRef.current?.getBoundingClientRect().width ?? normalWidthRef.current;
179
- const next = event.key === "ArrowLeft"
180
- ? clampWidth(current + 16)
181
- : event.key === "ArrowRight"
182
- ? clampWidth(current - 16)
183
- : event.key === "Home"
184
- ? clampWidth(WORKSPACE_WIDTH_MIN)
185
- : event.key === "End"
186
- ? maximumWidth()
187
- : undefined;
188
- if (next === undefined) return;
189
- event.preventDefault();
190
- applyWidth(next);
191
- commitWidth(next);
192
- };
193
-
194
- const effectiveWidth = Math.min(layoutBounds.max, Math.max(layoutBounds.min, normalWidth));
195
- const resizable = layoutBounds.max > layoutBounds.min;
196
-
197
- return (
198
- <aside
199
- aria-label="Sidebar"
200
- className={cn(
201
- "relative z-20 flex min-h-0 min-w-0 flex-col @max-[960px]/chat-content:absolute @max-[960px]/chat-content:inset-y-0 @max-[960px]/chat-content:right-0 @max-[960px]/chat-content:left-auto",
202
- collapsed
203
- ? "w-0 max-w-0 flex-[0_0_0]"
204
- : "w-[var(--workspace-panel-width,560px)] max-w-[calc(100%-360px)] flex-[0_0_var(--workspace-panel-width,560px)] border-l border-border-strong bg-shell shadow-workspace @max-[960px]/chat-content:w-[min(var(--workspace-panel-width,560px),calc(100%-var(--spacing-header)))] @max-[960px]/chat-content:max-w-none @max-[960px]/chat-content:flex-none",
205
- )}
206
- id="workspace-panel"
207
- ref={panelRef}
208
- style={{ "--workspace-panel-width": `${normalWidth}px` } as CSSProperties}
209
- >
210
- {!collapsed && (
211
- <div
212
- aria-controls="workspace-panel"
213
- aria-disabled={!resizable}
214
- aria-label="Sidebar width"
215
- aria-orientation="vertical"
216
- aria-valuemax={Math.round(layoutBounds.max)}
217
- aria-valuemin={Math.round(layoutBounds.min)}
218
- aria-valuenow={Math.round(effectiveWidth)}
219
- aria-valuetext={`${Math.round(effectiveWidth)} pixels`}
220
- className={cn(
221
- "absolute inset-y-0 right-auto -left-1 z-30 w-2 touch-none",
222
- resizable
223
- ? "cursor-col-resize after:absolute after:top-[calc(50%-18px)] after:left-[3px] after:h-9 after:w-[3px] after:rounded-[3px] after:bg-border-strong after:content-[''] hover:bg-primary/25 in-data-[resizing=true]:bg-primary/25 focus-visible:outline-2 focus-visible:outline-primary/58 focus-visible:outline-offset-2"
224
- : "cursor-default",
225
- )}
226
- onKeyDown={resizable ? resizeWithKeyboard : undefined}
227
- onPointerDown={resizable ? startResize : undefined}
228
- role="separator"
229
- tabIndex={resizable ? 0 : -1}
230
- title="Drag to resize"
231
- />
232
- )}
233
- {props.headerContainer && createPortal(<TooltipProvider><div className="flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden pr-[7px] pl-[9px]" data-workspace-state={props.state}>
234
- <nav aria-label="Sidebar" className="flex min-w-0 flex-1 flex-nowrap gap-[3px] overflow-x-auto no-scrollbar" hidden={collapsed} role="tablist">
235
- {tabs.map((tab) => (
236
- <Tooltip key={tab.id}>
237
- <TooltipTrigger
238
- aria-label={tab.label}
239
- aria-controls="workspace-panel-content"
240
- aria-selected={activeTab?.id === tab.id}
241
- className={cn(tabClass, activeTab?.id === tab.id ? "bg-accent text-primary" : "text-muted-foreground hover:bg-foreground/6 hover:text-foreground")}
242
- onClick={() => props.navigation.openTab(tab.id)}
243
- role="tab"
244
- type="button"
245
- >
246
- <tab.Icon />
247
- {props.pendingTabIds.includes(tab.id) ? <span aria-hidden className="size-1.5 flex-none rounded-full bg-primary" /> : tab.Badge && (
248
- <tab.Badge
249
- active={activeTab?.id === tab.id}
250
- navigation={props.navigation}
251
- selection={props.navigation.selectionFor(tab.id)}
252
- session={props.session}
253
- />
254
- )}
255
- </TooltipTrigger>
256
- <TooltipContent side="bottom">{props.pendingTabIds.includes(tab.id) ? `${tab.label} - new activity` : tab.label}</TooltipContent>
257
- </Tooltip>
258
- ))}
259
- </nav>
260
- <Tooltip>
261
- <TooltipTrigger
262
- aria-controls="workspace-panel-content"
263
- aria-expanded={!collapsed}
264
- aria-label={stateAction}
265
- className="relative flex-shrink-0"
266
- onClick={props.onToggleState}
267
- render={<Button size="icon-lg" variant="ghost" />}
268
- >
269
- <IconPanelState state={props.state} />
270
- </TooltipTrigger>
271
- <TooltipContent side="bottom">{stateAction}</TooltipContent>
272
- </Tooltip>
273
- </div></TooltipProvider>, props.headerContainer)}
274
- <div className="relative min-h-0 flex-1 overflow-hidden" hidden={collapsed} inert={collapsed} id="workspace-panel-content">
275
- {mountedTabs(tabs, activeTabId, visited).map((tab) => (
276
- <div
277
- className={cn("absolute inset-0 flex min-h-0 flex-col", tab.id !== activeTabId && "pointer-events-none invisible")}
278
- key={tab.id}
279
- >
280
- <tab.Panel
281
- active={!collapsed && tab.id === activeTabId}
282
- navigation={props.navigation}
283
- selection={props.navigation.selectionFor(tab.id)}
284
- session={props.session}
285
- />
286
- </div>
287
- ))}
288
- </div>
289
- </aside>
290
- );
291
- }
292
-
293
- export const mountedTabs = (
294
- tabs: readonly WorkspaceTabContribution[],
295
- activeTabId: string | undefined,
296
- visited: readonly string[],
297
- ): readonly WorkspaceTabContribution[] =>
298
- tabs.filter((tab) => tab.id === activeTabId || tab.keepMounted === true && visited.includes(tab.id));
299
-
300
- function IconPanelState({ state }: { state: WorkspacePanelState }) {
301
- return (
302
- <svg aria-hidden fill="none" height="22" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" viewBox="0 0 24 24" width="22">
303
- <rect height="16" rx="2" width="18" x="3" y="4" />
304
- <path d="M16 4v16" />
305
- {state === "collapsed" && <path d="m13 8-4 4 4 4" />}
306
- {state === "expanded" && <path d="m7 8 4 4-4 4" />}
307
- </svg>
308
- );
309
- }
@@ -1,52 +0,0 @@
1
- // Foreign classes of highlight.js and react-diff-view; here instead of in the components that mini-apps also bundle.
2
- import "./highlighting.css";
3
- import "./diff-view.css";
4
- import { StrictMode } from "react";
5
- import { createRoot } from "react-dom/client";
6
- import { Button } from "./ui";
7
- import { AccessGate, AccessScreen } from "./AccessContext";
8
- import { QuasselHost } from "./chat/QuasselHost";
9
- import { installAccessToken } from "./access-token";
10
- import { installRunPanelInputBridge } from "./run-panel/input-bridge";
11
- import { RunPanelApp, HostLogin } from "./run-panel/RunPanelApp";
12
- import { parseRunPanelLocation } from "./run-panel/run-panel-location";
13
- import { RunPanelHostProvider, createRunPanelHost } from "./run-panel/host";
14
- import { PageOpenerProvider } from "./page-opener";
15
- import { initializeTheme } from "./theme";
16
- import { installHostModules } from "./host-modules";
17
-
18
- installHostModules();
19
- const root = document.getElementById("root");
20
- if (!root) throw new Error("Root element is missing");
21
-
22
- const reactRoot = createRoot(root);
23
- try {
24
- const location = parseRunPanelLocation(window.location.search);
25
- if (location.access !== undefined) installAccessToken(location.access);
26
- const host = createRunPanelHost(location.host, window);
27
- if (location.host === "vscode") {
28
- const disposeInput = installRunPanelInputBridge(window);
29
- import.meta.hot?.dispose(disposeInput);
30
- }
31
- const theme = initializeTheme(window);
32
- if (location.theme !== undefined) theme.setPreference(location.theme);
33
- host.onCommand((message) => { if (message.type === "theme") theme.setPreference(message.theme); });
34
- import.meta.hot?.dispose(() => theme.dispose());
35
- reactRoot.render(
36
- <StrictMode>
37
- <QuasselHost>
38
- <RunPanelHostProvider value={host}>
39
- <PageOpenerProvider value={location.host === "vscode" ? { open: host.openPage } : undefined}>
40
- <AccessGate Login={location.host === "vscode" ? HostLogin : undefined}><RunPanelApp location={location} /></AccessGate>
41
- </PageOpenerProvider>
42
- </RunPanelHostProvider>
43
- </QuasselHost>
44
- </StrictMode>,
45
- );
46
- } catch (cause) {
47
- reactRoot.render(<AccessScreen>
48
- <h1 className="my-3 text-[1.5rem]">The RAgents panel could not be loaded</h1>
49
- <p className="mb-6 leading-normal" role="alert">{cause instanceof Error ? cause.message : String(cause)}</p>
50
- <Button onClick={() => window.location.reload()} variant="outline">Reload</Button>
51
- </AccessScreen>);
52
- }
@@ -1,11 +0,0 @@
1
- import { createRequire as __ragentsCreateRequire } from "node:module";
2
- const require = __ragentsCreateRequire(import.meta.url);
3
-
4
- // server/contract.ts
5
- import { serviceToken } from "@ragents/engine";
6
- var surfacePlacementToken = serviceToken("ragents.orchestration.surface-placement");
7
-
8
- export {
9
- surfacePlacementToken
10
- };
11
- //# sourceMappingURL=chunk-QS3WJ3D7.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../plugins/ragents.orchestration/server/contract.ts"],
4
- "sourcesContent": ["import { serviceToken, type CommandContext, type ServiceToken } from \"@ragents/engine\";\n\nexport interface SurfacePlacementRequest {\n entity: string;\n direction?: \"horizontal\" | \"vertical\";\n weight?: number;\n}\n\n/** Places an entity next to a run's surface layout, as canvas_layout_place does; an entity the layout shows already stays. */\nexport interface SurfacePlacement {\n place: (context: CommandContext, runId: string, request: SurfacePlacementRequest) => { placed: boolean };\n}\n\nexport const surfacePlacementToken: ServiceToken<SurfacePlacement> = serviceToken(\"ragents.orchestration.surface-placement\");\n"],
5
- "mappings": ";;;;AAAA,SAAS,oBAA4D;AAa9D,IAAM,wBAAwD,aAAa,yCAAyC;",
6
- "names": []
7
- }
@@ -1,9 +0,0 @@
1
- import { createRequire as __ragentsCreateRequire } from "node:module";
2
- const require = __ragentsCreateRequire(import.meta.url);
3
- import {
4
- surfacePlacementToken
5
- } from "../../chunks/chunk-QS3WJ3D7.js";
6
- export {
7
- surfacePlacementToken
8
- };
9
- //# sourceMappingURL=contract.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,39 +0,0 @@
1
- ## Arranging the tiled work surface
2
-
3
- The work surface of a run is a grid of tiles that fills the viewport. Each tile shows one actor or
4
- one activated mini-app. There is no other arrangement and no pan, zoom or free placement. Use
5
- `context.functions.canvas_layout_replace` from TypeScript to set the arrangement, and read its exact
6
- input type with `typescript_api` before the first call.
7
-
8
- `root` is the whole arrangement and replaces the stored one; it is the only parameter. A tile is
9
- {entity:"@helper"} or {entity:"app:@workspace/main"}. A split is {direction, weights, children} with
10
- direction "horizontal" (left/right) or "vertical" (top/bottom), two positive weights and exactly two
11
- children, each of which may be a split again. `root:null` clears the surface.
12
-
13
- App left, chat right at 50:50:
14
- {root:{direction:"horizontal",weights:[1,1],children:[
15
- {entity:"app:@workspace/main"},{entity:"@helper"}
16
- ]}}. One tile above two tiles at 2:1:
17
- {root:{direction:"vertical",weights:[2,1],children:[{entity:"@lead"},
18
- {direction:"horizontal",weights:[1,1],children:[{entity:"@first"},{entity:"@second"}]}
19
- ]}}. Resolve the actual actor and app names before calling; the example names are not existing
20
- participants.
21
-
22
- To add one tile without replacing what is arranged, `context.functions.canvas_layout_place({ entity })`
23
- splits the current layout once and puts the entity to its right, or below with `direction: "vertical"`;
24
- `weight` is its share against the existing arrangement's weight 1. An entity the layout shows already
25
- stays where it is. A run script started inside a running run (`start.embedded`) uses place, not replace.
26
-
27
- An actor tile carries {entity:"@helper",chatInput:false} when its chat composer should stay hidden.
28
- That changes neither permissions nor the inspector. Mini-app tiles have no chatInput.
29
-
30
- Activate actor programs before placing their views. Reference a view as `app:@handle/view-key` or
31
- `app:program-name/view-key`, using the handle, program name and view key you chose. The server
32
- resolves the actual view ID and rejects unknown views before storing the layout. Do not invent or
33
- copy generated view IDs. `actor_view_set_visibility` uses the same names without the `app:` prefix.
34
-
35
- Place what the user needs to see side by side and update the arrangement when the work changes.
36
- Participants you do not place stay reachable through the run header and can be dragged onto a tile
37
- there. Users can move, resize and remove tiles themselves; their personal arrangement takes
38
- precedence until they reset it, so do not resend a layout to fight it. The user takes part through
39
- the chat and needs no tile of their own.
@@ -1,2 +0,0 @@
1
- import{n as r}from"/plugins/ragents.orchestration/web/chunks/chunk-HOBLI364.js";var n=new Map,s=new Set,i=new Set,a=e=>(s.add(e),()=>s.delete(e));function d(e,t){t?n.set(e,t):n.delete(e),s.forEach(o=>o())}function u(e){let t=()=>n.get(e)??i;return r(a,t,t)}export{d as a,u as b};
2
- //# sourceMappingURL=/plugins/ragents.orchestration/web/chunks/chunk-CFMJD5ZI.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../plugins/ragents.orchestration/web/surface-entities.ts"],
4
- "sourcesContent": ["import { useSyncExternalStore } from \"react\";\n\nconst stages = new Map<string, ReadonlySet<string>>();\nconst listeners = new Set<() => void>();\nconst empty: ReadonlySet<string> = new Set();\n\nconst subscribe = (listener: () => void) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n};\n\nexport function publishSurfaceEntities(runId: string, entities: ReadonlySet<string> | undefined) {\n if (entities) stages.set(runId, entities);\n else stages.delete(runId);\n listeners.forEach((listener) => listener());\n}\n\nexport function useSurfaceEntities(runId: string): ReadonlySet<string> {\n const read = () => stages.get(runId) ?? empty;\n return useSyncExternalStore(subscribe, read, read);\n}\n"],
5
- "mappings": "gFAEA,IAAMA,EAAS,IAAI,IACbC,EAAY,IAAI,IAChBC,EAA6B,IAAI,IAEjCC,EAAaC,IACjBH,EAAU,IAAIG,CAAQ,EACf,IAAMH,EAAU,OAAOG,CAAQ,GAGjC,SAASC,EAAuBC,EAAeC,EAA2C,CAC3FA,EAAUP,EAAO,IAAIM,EAAOC,CAAQ,EACnCP,EAAO,OAAOM,CAAK,EACxBL,EAAU,QAASG,GAAaA,EAAS,CAAC,CAC5C,CAEO,SAASI,EAAmBF,EAAoC,CACrE,IAAMG,EAAO,IAAMT,EAAO,IAAIM,CAAK,GAAKJ,EACxC,OAAOQ,EAAqBP,EAAWM,EAAMA,CAAI,CACnD",
6
- "names": ["stages", "listeners", "empty", "subscribe", "listener", "publishSurfaceEntities", "runId", "entities", "useSurfaceEntities", "read", "react_useSyncExternalStore_default"]
7
- }
@@ -1,2 +0,0 @@
1
- var e=(t,r)=>{let o=globalThis.__ragentsHostModules?.[t];if(o===void 0)throw new Error(`The host does not provide ${t}`);if(!(r in o))throw new Error(`The host does not provide ${r} from ${t}; the bundle was built against a newer host`);return o[r]};var a=e("react","createContext");var f=e("react","useContext");var u=e("react","useEffect");var s=e("react","useState");var d=e("react","useSyncExternalStore");var m=e("react","createElement");var l=e("react","forwardRef");var p=e("react","memo");var x=e("react","useCallback");var n=e("react","useId");var c=e("react","useLayoutEffect");var i=e("react","useMemo");var E=e("react","useRef");export{e as a,a as b,m as c,l as d,p as e,x as f,f as g,u as h,n as i,c as j,i as k,E as l,s as m,d as n};
2
- //# sourceMappingURL=/plugins/ragents.orchestration/web/chunks/chunk-HOBLI364.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["ragents-host-read:read", "ragents-host-value:react#createContext", "ragents-host-value:react#useContext", "ragents-host-value:react#useEffect", "ragents-host-value:react#useState", "ragents-host-value:react#useSyncExternalStore", "ragents-host-value:react#createElement", "ragents-host-value:react#forwardRef", "ragents-host-value:react#memo", "ragents-host-value:react#useCallback", "ragents-host-value:react#useId", "ragents-host-value:react#useLayoutEffect", "ragents-host-value:react#useMemo", "ragents-host-value:react#useRef"],
4
- "sourcesContent": ["export const read = (specifier, name) => {\n const module = globalThis[\"__ragentsHostModules\"]?.[specifier];\n if (module === undefined) throw new Error(`The host does not provide ${specifier}`);\n if (!(name in module)) throw new Error(`The host does not provide ${name} from ${specifier}; the bundle was built against a newer host`);\n return module[name];\n};", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"createContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useEffect\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useState\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useSyncExternalStore\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"createElement\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"forwardRef\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"memo\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useCallback\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useId\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useLayoutEffect\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useMemo\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useRef\");\n"],
5
- "mappings": "AAAO,IAAMA,EAAO,CAACC,EAAWC,IAAS,CACvC,IAAMC,EAAS,WAAW,uBAA0BF,CAAS,EAC7D,GAAIE,IAAW,OAAW,MAAM,IAAI,MAAM,6BAA6BF,CAAS,EAAE,EAClF,GAAI,EAAEC,KAAQC,GAAS,MAAM,IAAI,MAAM,6BAA6BD,CAAI,SAASD,CAAS,6CAA6C,EACvI,OAAOE,EAAOD,CAAI,CACpB,ECJA,IAAOE,EAAQC,EAAK,QAAS,eAAe,ECA5C,IAAOC,EAAQC,EAAK,QAAS,YAAY,ECAzC,IAAOC,EAAQC,EAAK,QAAS,WAAW,ECAxC,IAAOC,EAAQC,EAAK,QAAS,UAAU,ECAvC,IAAOC,EAAQC,EAAK,QAAS,sBAAsB,ECAnD,IAAOC,EAAQC,EAAK,QAAS,eAAe,ECA5C,IAAOC,EAAQC,EAAK,QAAS,YAAY,ECAzC,IAAOC,EAAQC,EAAK,QAAS,MAAM,ECAnC,IAAOC,EAAQC,EAAK,QAAS,aAAa,ECA1C,IAAOC,EAAQC,EAAK,QAAS,OAAO,ECApC,IAAOC,EAAQC,EAAK,QAAS,iBAAiB,ECA9C,IAAOC,EAAQC,EAAK,QAAS,SAAS,ECAtC,IAAOC,EAAQC,EAAK,QAAS,QAAQ",
6
- "names": ["read", "specifier", "name", "module", "react_createContext_default", "read", "react_useContext_default", "read", "react_useEffect_default", "read", "react_useState_default", "read", "react_useSyncExternalStore_default", "read", "react_createElement_default", "read", "react_forwardRef_default", "read", "react_memo_default", "read", "react_useCallback_default", "read", "react_useId_default", "read", "react_useLayoutEffect_default", "read", "react_useMemo_default", "read", "react_useRef_default", "read"]
7
- }
@@ -1,2 +0,0 @@
1
- import{b as e,g as t}from"/plugins/ragents.orchestration/web/chunks/chunk-HOBLI364.js";var o=e(void 0),n=()=>t(o);export{o as a,n as b};
2
- //# sourceMappingURL=/plugins/ragents.orchestration/web/chunks/chunk-UCIMT2R4.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../plugins/ragents.orchestration/web/program-slot.ts"],
4
- "sourcesContent": ["import { createContext, useContext, type ReactNode } from \"react\";\nimport type { SessionContext } from \"@ragents/web/PluginRegistry\";\nimport type { RunView } from \"@ragents/web/run-view\";\n\n/** What an actor-program extension adds to the run panel and the inspector; without one both show no programs. */\nexport interface ProgramSlot {\n runId: string;\n needsAnswer: (session: SessionContext, appId: string) => boolean;\n openFullscreen: (appId: string) => void;\n source: (view: RunView, actorId: string) => ReactNode;\n}\n\nexport const ProgramSlotContext = createContext<ProgramSlot | undefined>(undefined);\nexport const useProgramSlot = () => useContext(ProgramSlotContext);\n"],
5
- "mappings": "uFAYO,IAAMA,EAAqBC,EAAuC,MAAS,EACrEC,EAAiB,IAAMC,EAAWH,CAAkB",
6
- "names": ["ProgramSlotContext", "react_createContext_default", "useProgramSlot", "react_useContext_default"]
7
- }
@@ -1,2 +0,0 @@
1
- var N="application/x-ragents-surface-tile",x=8,M=220,b=160;function w(e){return e===null?[]:"entity"in e?[e.entity]:e.children.flatMap(w)}function m(e,i){if(e!==null)return"entity"in e?e.entity===i?e:void 0:m(e.children[0],i)??m(e.children[1],i)}function I(e,i){if(e===null||"entity"in e)return e?.entity===i?null:e;let t=I(e.children[0],i),r=I(e.children[1],i);return t?r?t===e.children[0]&&r===e.children[1]?e:{...e,children:[t,r]}:t:r}function R(e,i,t,r){if(e&&"entity"in e&&e.entity===i&&t===null||i===t||t!==null&&!w(e).includes(t))return e;let c=I(e,i),l=m(e,i)??{entity:i};if(!c)return l;let h=n=>({direction:r==="left"||r==="right"?"horizontal":"vertical",weights:[1,1],children:r==="left"||r==="top"?[l,n]:[n,l]});if(t===null)return h(c);let s=n=>"entity"in n?n.entity===t?h(n):n:{...n,children:[s(n.children[0]),s(n.children[1])]};return s(c)}function f(e){if("entity"in e)return{width:220,height:160};let i=f(e.children[0]),t=f(e.children[1]);return e.direction==="horizontal"?{width:i.width+t.width+8,height:Math.max(i.height,t.height)}:{width:Math.max(i.width,t.width),height:i.height+t.height+8}}function D(e,i,t){if("entity"in e)return e;if(i.length===0){let l=Math.max(.001,Math.min(.999,t));return{...e,weights:[l,1-l]}}let r=i[0];if(r!==0&&r!==1)return e;let c=[...e.children];return c[r]=D(c[r],i.slice(1),t),{...e,children:c}}function L(e,i){let t=new Map,r=[],c=(l,h,s)=>{if("entity"in l){t.set(l.entity,h);return}let n=l.direction==="horizontal",u=Math.max(0,(n?h.width:h.height)-8),E=f(l.children[0]),o=f(l.children[1]),a=u>0?(n?E.width:E.height)/u:.5,T=u>0?1-(n?o.width:o.height)/u:.5,g=Math.max(...l.weights),S=l.weights[0]/g,p=S/(S+l.weights[1]/g),_=a<=T?Math.max(a,Math.min(T,p)):p,d=u*_;r.push({left:h.left+(n?d:0),top:h.top+(n?0:d),width:n?8:h.width,height:n?h.height:8,path:s,direction:l.direction,ratio:_,minimum:a,maximum:T,span:u}),c(l.children[0],{...h,width:n?d:h.width,height:n?h.height:d},[...s,0]),c(l.children[1],{left:h.left+(n?d+8:0),top:h.top+(n?0:d+8),width:n?u-d:h.width,height:n?h.height:u-d},[...s,1])};return c(e,i,[]),{leaves:t,dividers:r}}export{N as a,x as b,M as c,b as d,w as e,I as f,R as g,f as h,D as i,L as j};
2
- //# sourceMappingURL=/plugins/ragents.orchestration/web/chunks/chunk-XGPPQCZR.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../plugins/ragents.orchestration/web/tile-docking.ts"],
4
- "sourcesContent": ["import type { SurfaceTileNode } from \"../tiled-layout\";\n\nexport const SURFACE_TILE_DRAG_TYPE = \"application/x-ragents-surface-tile\";\nexport const TILE_DIVIDER_SIZE = 8;\nexport const TILE_MIN_WIDTH = 220;\nexport const TILE_MIN_HEIGHT = 160;\nexport type TileDockSide = \"left\" | \"right\" | \"top\" | \"bottom\";\nexport interface TileRect { left: number; top: number; width: number; height: number }\nexport interface TileDivider extends TileRect {\n path: readonly number[];\n direction: \"horizontal\" | \"vertical\";\n ratio: number;\n minimum: number;\n maximum: number;\n span: number;\n}\n\nexport function tileEntities(root: SurfaceTileNode | null): string[] {\n return root === null ? [] : \"entity\" in root ? [root.entity] : root.children.flatMap(tileEntities);\n}\n\nfunction tileLeaf(root: SurfaceTileNode | null, entity: string): SurfaceTileNode | undefined {\n if (root === null) return undefined;\n if (\"entity\" in root) return root.entity === entity ? root : undefined;\n return tileLeaf(root.children[0], entity) ?? tileLeaf(root.children[1], entity);\n}\n\nexport function removeTile(root: SurfaceTileNode | null, entity: string): SurfaceTileNode | null {\n if (root === null || \"entity\" in root) return root?.entity === entity ? null : root;\n const first = removeTile(root.children[0], entity);\n const second = removeTile(root.children[1], entity);\n if (!first) return second;\n if (!second) return first;\n return first === root.children[0] && second === root.children[1] ? root : { ...root, children: [first, second] };\n}\n\nexport function dockTile(root: SurfaceTileNode | null, entity: string, target: string | null, side: TileDockSide): SurfaceTileNode | null {\n if ((root && \"entity\" in root && root.entity === entity && target === null) || entity === target || (target !== null && !tileEntities(root).includes(target))) return root;\n const remaining = removeTile(root, entity);\n const leaf: SurfaceTileNode = tileLeaf(root, entity) ?? { entity };\n if (!remaining) return leaf;\n const wrap = (node: SurfaceTileNode): SurfaceTileNode => ({\n direction: side === \"left\" || side === \"right\" ? \"horizontal\" : \"vertical\",\n weights: [1, 1],\n children: side === \"left\" || side === \"top\" ? [leaf, node] : [node, leaf],\n });\n if (target === null) return wrap(remaining);\n const insert = (node: SurfaceTileNode): SurfaceTileNode => \"entity\" in node\n ? node.entity === target ? wrap(node) : node\n : { ...node, children: [insert(node.children[0]), insert(node.children[1])] };\n return insert(remaining);\n}\n\nexport function tileMinimum(root: SurfaceTileNode): { width: number; height: number } {\n if (\"entity\" in root) return { width: TILE_MIN_WIDTH, height: TILE_MIN_HEIGHT };\n const first = tileMinimum(root.children[0]);\n const second = tileMinimum(root.children[1]);\n return root.direction === \"horizontal\"\n ? { width: first.width + second.width + TILE_DIVIDER_SIZE, height: Math.max(first.height, second.height) }\n : { width: Math.max(first.width, second.width), height: first.height + second.height + TILE_DIVIDER_SIZE };\n}\n\nexport function resizeTile(root: SurfaceTileNode, path: readonly number[], ratio: number): SurfaceTileNode {\n if (\"entity\" in root) return root;\n if (path.length === 0) {\n const bounded = Math.max(0.001, Math.min(0.999, ratio));\n return { ...root, weights: [bounded, 1 - bounded] };\n }\n const branch = path[0];\n if (branch !== 0 && branch !== 1) return root;\n const children: [SurfaceTileNode, SurfaceTileNode] = [...root.children];\n children[branch] = resizeTile(children[branch], path.slice(1), ratio);\n return { ...root, children };\n}\n\nexport function tileGeometry(root: SurfaceTileNode, bounds: TileRect): { leaves: Map<string, TileRect>; dividers: TileDivider[] } {\n const leaves = new Map<string, TileRect>();\n const dividers: TileDivider[] = [];\n const visit = (node: SurfaceTileNode, rect: TileRect, path: readonly number[]) => {\n if (\"entity\" in node) { leaves.set(node.entity, rect); return; }\n const horizontal = node.direction === \"horizontal\";\n const span = Math.max(0, (horizontal ? rect.width : rect.height) - TILE_DIVIDER_SIZE);\n const firstMinimum = tileMinimum(node.children[0]);\n const secondMinimum = tileMinimum(node.children[1]);\n const minimum = span > 0 ? (horizontal ? firstMinimum.width : firstMinimum.height) / span : 0.5;\n const maximum = span > 0 ? 1 - (horizontal ? secondMinimum.width : secondMinimum.height) / span : 0.5;\n const scale = Math.max(...node.weights);\n const firstWeight = node.weights[0] / scale;\n const requested = firstWeight / (firstWeight + node.weights[1] / scale);\n const ratio = minimum <= maximum ? Math.max(minimum, Math.min(maximum, requested)) : requested;\n const first = span * ratio;\n dividers.push({\n left: rect.left + (horizontal ? first : 0), top: rect.top + (horizontal ? 0 : first),\n width: horizontal ? TILE_DIVIDER_SIZE : rect.width, height: horizontal ? rect.height : TILE_DIVIDER_SIZE,\n path, direction: node.direction, ratio, minimum, maximum, span,\n });\n visit(node.children[0], { ...rect, width: horizontal ? first : rect.width, height: horizontal ? rect.height : first }, [...path, 0]);\n visit(node.children[1], {\n left: rect.left + (horizontal ? first + TILE_DIVIDER_SIZE : 0), top: rect.top + (horizontal ? 0 : first + TILE_DIVIDER_SIZE),\n width: horizontal ? span - first : rect.width, height: horizontal ? rect.height : span - first,\n }, [...path, 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AK,SAAS,CAAC,EAAG,CAAE,GAAGc,EAAM,MAAOC,EAAavB,EAAQsB,EAAK,MAAO,OAAQC,EAAaD,EAAK,OAAStB,CAAM,EAAG,CAAC,GAAGY,EAAM,CAAC,CAAC,EACnIS,EAAMb,EAAK,SAAS,CAAC,EAAG,CACtB,KAAMc,EAAK,MAAQC,EAAavB,EAAQ,EAAoB,GAAI,IAAKsB,EAAK,KAAOC,EAAa,EAAIvB,EAAQ,GAC1G,MAAOuB,EAAaC,EAAOxB,EAAQsB,EAAK,MAAO,OAAQC,EAAaD,EAAK,OAASE,EAAOxB,CAC3F,EAAG,CAAC,GAAGY,EAAM,CAAC,CAAC,CACjB,EACA,OAAAS,EAAMzB,EAAMsB,EAAQ,CAAC,CAAC,EACf,CAAE,OAAAC,EAAQ,SAAAC,CAAS,CAC5B",
6
- "names": ["SURFACE_TILE_DRAG_TYPE", "TILE_DIVIDER_SIZE", "TILE_MIN_WIDTH", "TILE_MIN_HEIGHT", "tileEntities", "root", "tileLeaf", "entity", "removeTile", "first", "second", "dockTile", "target", "side", "remaining", "leaf", "wrap", "node", "insert", "tileMinimum", "resizeTile", "path", "ratio", "bounded", "branch", "children", "tileGeometry", "bounds", "leaves", "dividers", "visit", "rect", "horizontal", "span", "firstMinimum", "secondMinimum", "minimum", "maximum", "scale", "firstWeight", "requested"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a,b}from"/plugins/ragents.orchestration/web/chunks/chunk-CFMJD5ZI.js";import"/plugins/ragents.orchestration/web/chunks/chunk-HOBLI364.js";export{a as publishSurfaceEntities,b as useSurfaceEntities};
2
- //# sourceMappingURL=/plugins/ragents.orchestration/web/exports/web/surface-entities.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,2 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j}from"/plugins/ragents.orchestration/web/chunks/chunk-XGPPQCZR.js";export{a as SURFACE_TILE_DRAG_TYPE,b as TILE_DIVIDER_SIZE,d as TILE_MIN_HEIGHT,c as TILE_MIN_WIDTH,g as dockTile,f as removeTile,i as resizeTile,e as tileEntities,j as tileGeometry,h as tileMinimum};
2
- //# sourceMappingURL=/plugins/ragents.orchestration/web/exports/web/tile-docking.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
1
- export function ExpandIcon() {
2
- return <svg aria-hidden fill="none" height="14" stroke="currentColor" strokeWidth="1.7" viewBox="0 0 24 24" width="14">
3
- <path d="M9 3H3v6M15 3h6v6M3 15v6h6M21 15v6h-6" />
4
- </svg>;
5
- }
@@ -1,31 +0,0 @@
1
- import { useRef } from "react";
2
- import { XIcon } from "lucide-react";
3
- import type { SessionContext } from "@ragents/web/PluginRegistry";
4
- import { Button, Dialog, DialogContent, DialogTitle } from "@ragents/web/ui";
5
- import { HostConfirmation, pendingConfirmationFor, actorProgramApps, useActorPrograms } from "./AppsPanel";
6
- import { ActorViewFrame } from "./ActorViewFrame";
7
-
8
- export function FullscreenHost({ session }: { session: SessionContext }) {
9
- const { api, closeFullscreen, error, fullscreenAppId, invoke, listing, runId } = useActorPrograms();
10
- const closeRef = useRef<HTMLButtonElement>(null);
11
- if (!fullscreenAppId) return null;
12
- const entry = actorProgramApps(session).find((candidate) => candidate.id === fullscreenAppId && candidate.app.visible !== false);
13
- if (!entry) return null;
14
- const app = listing?.apps.find((candidate) => candidate.id === fullscreenAppId);
15
- const title = entry.title;
16
- const confirmation = app ? pendingConfirmationFor(session, app) : undefined;
17
- return <Dialog key={`${runId}:${fullscreenAppId}`} open onOpenChange={(open) => { if (!open) closeFullscreen(); }}>
18
- <DialogContent className="h-[calc(100%-2*clamp(16px,2vw,24px))] w-[calc(100%-2*clamp(16px,2vw,24px))] gap-0 bg-background p-0" initialFocus={closeRef} scope="surface" showCloseButton={false} size="full">
19
- <header className="flex flex-none items-center gap-3 border-b border-border bg-card py-2 pr-3 pl-4">
20
- <DialogTitle className="min-w-0 flex-1 truncate text-[0.9rem]" render={<h2 />}>{title}</DialogTitle>
21
- <Button aria-label={`Close ${title} full view`} className="rounded-full" onClick={closeFullscreen} ref={closeRef} size="icon" title={`Close ${title} full view`} variant="outline"><XIcon /></Button>
22
- </header>
23
- <div className="flex min-h-0 flex-1 flex-col overflow-hidden [&>[data-slot=host-confirmation]]:max-h-[65%] [&>[data-slot=host-confirmation]]:flex-[0_1_auto] [&>[data-slot=host-confirmation]]:overflow-auto">
24
- {confirmation && <HostConfirmation action={confirmation} key={confirmation.id} session={session} />}
25
- {app ? <ActorViewFrame api={api} app={app} invoke={invoke} pendingConfirmationInvocationId={confirmation?.parameters.invocationId}
26
- presentation="fullscreen" runId={runId} session={session} />
27
- : <p className="flex flex-1 items-center justify-center gap-2 text-[0.7rem] text-muted-foreground" role={error ? "alert" : "status"}>{error ?? "Loading actor view"}</p>}
28
- </div>
29
- </DialogContent>
30
- </Dialog>;
31
- }