@rho-workspace/rho 0.5.6 → 0.5.7

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 (211) hide show
  1. package/dist/agent-connect.d.ts +36 -2
  2. package/dist/agent-connect.js +64 -11
  3. package/dist/answer-board.js +3 -3
  4. package/dist/bridge.js +6 -1
  5. package/dist/browser-access.d.ts +1 -0
  6. package/dist/browser-access.js +5 -3
  7. package/dist/capabilities.d.ts +21 -5
  8. package/dist/capabilities.js +6 -4
  9. package/dist/cli.js +76 -11
  10. package/dist/composition.d.ts +1 -1
  11. package/dist/composition.js +13 -3
  12. package/dist/connect-cli.d.ts +50 -0
  13. package/dist/connect-cli.js +128 -0
  14. package/dist/contract.generated.d.ts +1191 -278
  15. package/dist/contract.generated.js +1 -1
  16. package/dist/contracts/owners.generated.js +845 -47
  17. package/dist/conversation-presentation.d.ts +9 -2
  18. package/dist/conversation-presentation.js +3 -1
  19. package/dist/conversations.d.ts +154 -8
  20. package/dist/conversations.js +147 -24
  21. package/dist/discovery.js +2 -2
  22. package/dist/extension-contract.d.ts +19 -0
  23. package/dist/extension-contract.js +15 -6
  24. package/dist/extension-markets.d.ts +74 -0
  25. package/dist/extension-markets.js +166 -0
  26. package/dist/extensions.d.ts +29 -1
  27. package/dist/extensions.js +13 -4
  28. package/dist/external-work.d.ts +22 -0
  29. package/dist/external-work.js +91 -0
  30. package/dist/plugin-cli.js +75 -3
  31. package/dist/plugin-inventory.d.ts +56 -0
  32. package/dist/plugin-inventory.js +41 -0
  33. package/dist/plugin-inventory.json +1581 -102
  34. package/dist/plugin-presentation.d.ts +105 -2
  35. package/dist/plugin-presentation.js +59 -5
  36. package/dist/plugins.d.ts +14 -3
  37. package/dist/plugins.js +12 -6
  38. package/dist/project-notes.js +1 -1
  39. package/dist/protocol.d.ts +6 -0
  40. package/dist/protocol.js +30 -12
  41. package/dist/replay.js +4 -0
  42. package/dist/response-contracts.js +26 -11
  43. package/dist/running.d.ts +10 -0
  44. package/dist/running.js +45 -0
  45. package/dist/server.d.ts +2 -0
  46. package/dist/server.js +71 -8
  47. package/dist/state.d.ts +8 -0
  48. package/dist/state.js +8 -0
  49. package/dist/studio-layout.js +3 -3
  50. package/dist/task-frame.d.ts +1 -1
  51. package/dist/timeline-events.d.ts +1 -0
  52. package/dist/timeline-events.js +8 -1
  53. package/dist/ui-context.d.ts +73 -0
  54. package/dist/ui-context.js +98 -0
  55. package/dist/ui-contract.d.ts +23 -0
  56. package/dist/web/.vite/manifest.json +133 -74
  57. package/dist/web/assets/answer-board-CeYS8k8y.js +1 -0
  58. package/dist/web/assets/choices-D8vGwsl2.js +1 -0
  59. package/dist/web/assets/{console-Trqc0swD.js → console-Dyuo1q4N.js} +4 -4
  60. package/dist/web/assets/{dist-pF902jHA.js → dist-CSiCyBml.js} +1 -1
  61. package/dist/web/assets/{dist-DpIHRk3B.js → dist-D9FLb9Hm.js} +1 -1
  62. package/dist/web/assets/{dist-eMx6b8N1.js → dist-FXbTBwML.js} +1 -1
  63. package/dist/web/assets/{dist-DZmszrjG.js → dist-l3DUhbw5.js} +1 -1
  64. package/dist/web/assets/{explore-in-BCHqjJ7B.js → explore-in-BfSFGRh2.js} +1 -1
  65. package/dist/web/assets/graph-BU2_o5uA.js +2 -0
  66. package/dist/web/assets/index-C16mXVvk.css +1 -0
  67. package/dist/web/assets/index-CWg9XYXx.js +952 -0
  68. package/dist/web/assets/markdown.reader-Ct2-e2Zt.png +0 -0
  69. package/dist/web/assets/{notes-meaning-DcVGUBBY.js → notes-meaning-T2m5zQfv.js} +1 -1
  70. package/dist/web/assets/overview-PzfLJCo-.js +6 -0
  71. package/dist/web/assets/preview-BguEdsza.js +1 -0
  72. package/dist/web/assets/previews-pWNik-2g.js +3 -0
  73. package/dist/web/assets/{review-DYP0aCXb.js → review-Dy_85lcH.js} +1 -1
  74. package/dist/web/assets/rho.editor-CCJeyHma.png +0 -0
  75. package/dist/web/assets/rho.flow-WkMj6fRS.png +0 -0
  76. package/dist/web/assets/rho.media-Cc6amodO.png +0 -0
  77. package/dist/web/assets/rho.notebook-6vsZKGDq.png +0 -0
  78. package/dist/web/assets/rho.object-BGoeXjte.png +0 -0
  79. package/dist/web/assets/rho.plots-yIiISCkb.png +0 -0
  80. package/dist/web/assets/rho.scatter-DwHxesCs.png +0 -0
  81. package/dist/web/assets/rho.servers-DKf_mnNq.png +0 -0
  82. package/dist/web/assets/rho.table-DWOGaWDa.png +0 -0
  83. package/dist/web/assets/rho.variables-CKcWczhQ.png +0 -0
  84. package/dist/web/assets/{skills-1ec0Z-jx.js → skills-Dyz7mBlc.js} +1 -1
  85. package/dist/web/assets/{skills-work-DNexV4OJ.js → skills-work-BEGqlCkx.js} +1 -1
  86. package/dist/web/assets/studio-process-D-ykbC4D.js +2 -0
  87. package/dist/web/assets/timeline-events-DKTho9fU.js +1 -0
  88. package/dist/web/assets/work-turns-DSabCogR.js +1 -0
  89. package/dist/web/assets/{workspace-COmCbGV3.js → workspace-DfjBL--r.js} +2 -2
  90. package/dist/web/composition.json +138 -83
  91. package/dist/web/index.html +3 -3
  92. package/dist/web/renderer.json +1 -1
  93. package/dist/web-assets.js +2 -2
  94. package/dist/work-graph.d.ts +11 -1
  95. package/dist/work-graph.js +16 -5
  96. package/dist/workspace.d.ts +2 -2
  97. package/dist/workspace.js +8 -7
  98. package/docs/FRONTEND.md +53 -11
  99. package/docs/HEADLESS.md +104 -11
  100. package/docs/THIRD-PARTY-PLUGINS.md +75 -3
  101. package/node_modules/@rho-workspace/plugin-agent/README.md +5 -0
  102. package/node_modules/@rho-workspace/plugin-agent/dist/acp-command.d.ts +31 -0
  103. package/node_modules/@rho-workspace/plugin-agent/dist/acp-command.js +45 -10
  104. package/node_modules/@rho-workspace/plugin-agent/dist/acp-conversation.js +19 -3
  105. package/node_modules/@rho-workspace/plugin-agent/dist/external-session-contract.js +3 -2
  106. package/node_modules/@rho-workspace/plugin-agent/dist/external-session.d.ts +1 -1
  107. package/node_modules/@rho-workspace/plugin-agent/dist/index.d.ts +8 -0
  108. package/node_modules/@rho-workspace/plugin-agent/dist/index.js +3 -2
  109. package/node_modules/@rho-workspace/plugin-agent/dist/mcp-entry.d.ts +13 -0
  110. package/node_modules/@rho-workspace/plugin-agent/dist/mcp-entry.js +13 -0
  111. package/node_modules/@rho-workspace/plugin-agent/dist/mcp.js +16 -8
  112. package/node_modules/@rho-workspace/plugin-agent/dist/native-sessions.d.ts +1 -1
  113. package/node_modules/@rho-workspace/plugin-agent/package.json +1 -1
  114. package/node_modules/@rho-workspace/plugin-figures/LICENSE +661 -0
  115. package/node_modules/@rho-workspace/plugin-figures/README.md +191 -0
  116. package/node_modules/@rho-workspace/plugin-figures/dist/index.d.ts +236 -0
  117. package/node_modules/@rho-workspace/plugin-figures/dist/index.js +165 -0
  118. package/node_modules/@rho-workspace/plugin-figures/dist/operations.d.ts +44 -0
  119. package/node_modules/@rho-workspace/plugin-figures/dist/operations.js +39 -0
  120. package/node_modules/@rho-workspace/plugin-figures/dist/presentation.d.ts +19 -0
  121. package/node_modules/@rho-workspace/plugin-figures/dist/presentation.js +26 -0
  122. package/node_modules/@rho-workspace/plugin-figures/dist/record.d.ts +188 -0
  123. package/node_modules/@rho-workspace/plugin-figures/dist/record.js +143 -0
  124. package/node_modules/@rho-workspace/plugin-figures/dist/ui-styles.d.ts +1 -0
  125. package/node_modules/@rho-workspace/plugin-figures/dist/ui-styles.js +68 -0
  126. package/node_modules/@rho-workspace/plugin-figures/dist/ui.d.ts +56 -0
  127. package/node_modules/@rho-workspace/plugin-figures/dist/ui.js +363 -0
  128. package/node_modules/@rho-workspace/plugin-figures/package.json +41 -0
  129. package/node_modules/@rho-workspace/plugin-figures/py/figures.py +856 -0
  130. package/node_modules/@rho-workspace/plugin-figures/r/figures.R +775 -0
  131. package/node_modules/@rho-workspace/plugin-kernel/README.md +27 -3
  132. package/node_modules/@rho-workspace/plugin-kernel/dist/contract.d.ts +12 -0
  133. package/node_modules/@rho-workspace/plugin-kernel/dist/contract.js +8 -1
  134. package/node_modules/@rho-workspace/plugin-kernel/dist/index.d.ts +61 -0
  135. package/node_modules/@rho-workspace/plugin-kernel/dist/index.js +125 -9
  136. package/node_modules/@rho-workspace/plugin-kernel/dist/session-scope.d.ts +14 -0
  137. package/node_modules/@rho-workspace/plugin-kernel/dist/session-scope.js +9 -0
  138. package/node_modules/@rho-workspace/plugin-kernel/dist/ui-base.d.ts +23 -5
  139. package/node_modules/@rho-workspace/plugin-kernel/dist/ui-notebook-work.js +1 -1
  140. package/node_modules/@rho-workspace/plugin-kernel/dist/ui-notebook.d.ts +6 -4
  141. package/node_modules/@rho-workspace/plugin-kernel/dist/ui-notebook.js +44 -17
  142. package/node_modules/@rho-workspace/plugin-kernel/dist/ui-styles.js +6 -0
  143. package/node_modules/@rho-workspace/plugin-kernel/package.json +1 -1
  144. package/node_modules/@rho-workspace/plugin-kernel/runners/runner.R +144 -4
  145. package/node_modules/@rho-workspace/plugin-kernel/runners/runner.py +106 -1
  146. package/node_modules/@rho-workspace/plugin-tables/README.md +5 -0
  147. package/node_modules/@rho-workspace/plugin-tables/dist/index.d.ts +1 -0
  148. package/node_modules/@rho-workspace/plugin-tables/dist/index.js +19 -3
  149. package/node_modules/@rho-workspace/plugin-tables/dist/ui.js +1 -1
  150. package/node_modules/@rho-workspace/plugin-tables/package.json +1 -1
  151. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +3 -2
  152. package/node_modules/jose/dist/webapi/jwks/remote.js +1 -1
  153. package/node_modules/jose/dist/webapi/jws/general/verify.js +2 -8
  154. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +11 -8
  155. package/node_modules/jose/dist/webapi/lib/key_management.js +0 -1
  156. package/node_modules/jose/package.json +1 -1
  157. package/package.json +6 -4
  158. package/protocol/index.json +91 -55
  159. package/protocol/operations/agent.sessions.list.json +13 -5
  160. package/protocol/operations/agent.sessions.read.json +13 -5
  161. package/protocol/operations/capability.list.json +382 -6
  162. package/protocol/operations/composition.apply.json +10 -2
  163. package/protocol/operations/composition.delete.json +845 -0
  164. package/protocol/operations/composition.read.json +10 -2
  165. package/protocol/operations/composition.undo.json +10 -2
  166. package/protocol/operations/conversation.agents.add.json +346 -0
  167. package/protocol/operations/conversation.agents.remove.json +340 -0
  168. package/protocol/operations/conversation.decide.json +196 -0
  169. package/protocol/operations/conversation.permission.json +196 -0
  170. package/protocol/operations/conversation.read.json +196 -0
  171. package/protocol/operations/conversation.send.json +265 -0
  172. package/protocol/operations/conversation.settings.check.json +213 -495
  173. package/protocol/operations/conversation.settings.read.json +211 -490
  174. package/protocol/operations/conversation.settings.update.json +235 -554
  175. package/protocol/operations/conversation.start.json +267 -5
  176. package/protocol/operations/conversation.stop.json +196 -0
  177. package/protocol/operations/extension.describe.json +39 -0
  178. package/protocol/operations/extension.install.json +62 -0
  179. package/protocol/operations/extension.list.json +164 -1
  180. package/protocol/operations/extension.market.change.json +210 -0
  181. package/protocol/operations/figure.read.json +265 -0
  182. package/protocol/operations/figure.select.json +157 -0
  183. package/protocol/operations/kernel.interrupt.json +119 -0
  184. package/protocol/operations/kernel.read.json +119 -0
  185. package/protocol/operations/kernel.run.json +119 -0
  186. package/protocol/operations/observation.snapshot.json +416 -8
  187. package/protocol/operations/project.openFile.json +10 -2
  188. package/protocol/operations/session.grant.json +4 -0
  189. package/protocol/operations/shared.json +1 -0
  190. package/protocol/operations/view.close.json +10 -2
  191. package/protocol/operations/view.protection.set.json +10 -2
  192. package/vendor/composition.json +177 -112
  193. package/vendor/rho-workspace-plugin-agent-0.4.33.tgz +0 -0
  194. package/vendor/rho-workspace-plugin-figures-0.5.1.tgz +0 -0
  195. package/vendor/rho-workspace-plugin-kernel-0.5.13.tgz +0 -0
  196. package/vendor/rho-workspace-plugin-tables-0.5.2.tgz +0 -0
  197. package/web/theme.css +5 -0
  198. package/dist/web/assets/answer-board-CBkGbSLD.js +0 -1
  199. package/dist/web/assets/canvas-D8rDdfDz.js +0 -1
  200. package/dist/web/assets/choices-D-YfnFP6.js +0 -1
  201. package/dist/web/assets/graph-lENgfQNH.js +0 -2
  202. package/dist/web/assets/index-B3_OVy91.css +0 -1
  203. package/dist/web/assets/index-BpL_Kl_s.js +0 -892
  204. package/dist/web/assets/overview-CDnVKlOt.js +0 -6
  205. package/dist/web/assets/preview-BEC1E9MK.js +0 -1
  206. package/dist/web/assets/studio-process-EYQgikxq.js +0 -2
  207. package/dist/web/assets/timeline-events-Chj2Gbx7.js +0 -1
  208. package/dist/web/assets/work-turns-CT9RVcWY.js +0 -1
  209. package/vendor/rho-workspace-plugin-agent-0.4.30.tgz +0 -0
  210. package/vendor/rho-workspace-plugin-kernel-0.5.5.tgz +0 -0
  211. package/vendor/rho-workspace-plugin-tables-0.5.0.tgz +0 -0
@@ -0,0 +1,128 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { parseArgs } from 'node:util';
4
+ import { RhoClient } from './client.js';
5
+ import { clientEntries, defaultStateDirectory, mcpCommand, mcpName } from './agent-connect.js';
6
+ import { running } from './running.js';
7
+ // `rho connect` is the one command a setup prompt gives an Agent. The Agent names the project
8
+ // folder and itself; Rho finds the project in the service running for the state folder, grants
9
+ // it, and tells the Agent in its reply how to add the MCP server and check it. Everything the
10
+ // prompt used to spell out (paths, rules, ready entries) is in that reply, for the Agent to read.
11
+ export const connectUsage = `Connect yourself, an Agent, to a project of the Rho running on this machine:
12
+ rho connect [PROJECT_FOLDER] --as NAME [--state-dir SERVICE_STATE] [--json]
13
+ PROJECT_FOLDER is the project's folder (the current folder without it). NAME is a short, stable
14
+ name for you, 1–128 characters from A–Z, a–z, 0–9, dot, underscore, colon, @ or hyphen; use the
15
+ same name when you run this again. Without --state-dir, Rho finds the running Rho that holds the
16
+ folder; give --state-dir and its state folder when more than one does.
17
+ The reply says how to add Rho's MCP server to your client; --json prints it as JSON.
18
+ `;
19
+ // The same reply `rho --grant` prints: the grant, the stdio MCP server it serves and the ready
20
+ // entries for clients whose own mechanism has been used with Rho.
21
+ export async function grantReply(client, project, session) {
22
+ const granted = await client.call('session.grant', { projectId: project.id, externalSessionId: session });
23
+ const command = mcpCommand(granted.connectionFile), name = mcpName(project.root);
24
+ return { projectId: project.id, session, connectionFile: granted.connectionFile, methods: granted.methods.length,
25
+ mcp: { name, command: command[0], args: command.slice(1) }, ...clientEntries(name, command, project.root) };
26
+ }
27
+ export function connectText(reply, root) {
28
+ return [
29
+ `Rho gave you access to the project ${JSON.stringify(path.basename(root))} (${root}) as ${reply.session}.`,
30
+ '',
31
+ '1. Add this MCP server to your own client, the way your client adds a local stdio MCP server. Keep the entry private, out of files under version control and, where your client allows it, for this project only. Leave your other settings, models and credentials as they are.',
32
+ ` name: ${reply.mcp.name}`,
33
+ ` command: ${reply.mcp.command}`,
34
+ ` args: ${JSON.stringify(reply.mcp.args)}`,
35
+ ' Ready entries for the clients Rho has been used with:',
36
+ ` - Claude Code, run in the project folder: ${reply.claude}`,
37
+ ` - Codex: ${reply.codex}`,
38
+ ` - OpenCode: merge into ${reply.opencode.file}: ${JSON.stringify(reply.opencode.merge)}`,
39
+ ` - DeepSeek Harness: append these lines to ${reply.dsh.file}, which it reloads by itself:`,
40
+ '```yaml', reply.dsh.append.trimEnd(), '```',
41
+ ' If your client cannot run a local stdio MCP server, tell the person so instead.',
42
+ '2. Reload your MCP tools if your client can. If it loads MCP servers only when a session starts, stop here and tell the person to open a new session in the project folder.',
43
+ `3. Call rho_index, with no arguments, through your client's own tools. In its reply, scopeHint.projectId must be ${reply.projectId}.`,
44
+ '',
45
+ 'You are connected only when rho_index answers through your own tools. Starting the MCP server yourself, for example over stdio, only tests the server; it does not connect your client, so do not report that as connected. Report what you configured and the rho_index result separately. If a step fails, report the error and run this command again with the same --as name.',
46
+ '',
47
+ 'The file in args is your credential: do not print it or copy it into the project. Rho is already running: do not start another.',
48
+ ].join('\n') + '\n';
49
+ }
50
+ const within = (folder, root) => folder === root || folder.startsWith(root.endsWith(path.sep) ? root : root + path.sep);
51
+ export async function connectCli(args) {
52
+ const fail = (code, message) => { process.stderr.write(message.trimEnd() + '\n'); return code; };
53
+ let parsed;
54
+ try {
55
+ parsed = parseArgs({ args, options: { as: { type: 'string' }, 'state-dir': { type: 'string' }, json: { type: 'boolean' }, help: { type: 'boolean' } }, allowPositionals: true });
56
+ }
57
+ catch (error) {
58
+ return fail(2, (error instanceof Error ? error.message : String(error)) + '\n\n' + connectUsage);
59
+ }
60
+ const { values, positionals } = parsed;
61
+ if (values.help) {
62
+ process.stdout.write(connectUsage);
63
+ return 0;
64
+ }
65
+ if (positionals.length > 1)
66
+ return fail(2, 'Give one project folder; quote it if it has spaces.\n\n' + connectUsage);
67
+ const session = values.as;
68
+ if (!session || session === 'NAME')
69
+ return fail(2, 'Add --as and a short, stable name for yourself, such as claude-code or hermes-agent, and use the same name when you run this again.');
70
+ if (!/^[A-Za-z0-9._:@-]{1,128}$/.test(session))
71
+ return fail(2, 'A name after --as has 1–128 characters from A–Z, a–z, 0–9, dot, underscore, colon, @ or hyphen.');
72
+ const asked = path.resolve(positionals[0] ?? process.cwd());
73
+ const folder = await fs.realpath(asked).catch(() => null);
74
+ if (!folder)
75
+ return fail(1, `There is no folder ${asked}.`);
76
+ // The Rho to ask: the state folder given, else each Rho that noted it is running and the
77
+ // default state, of which the one holding the folder as a project is the one meant.
78
+ const given = values['state-dir'] ? path.resolve(values['state-dir']) : null;
79
+ const states = given ? [given] : [...new Set([...(await running()).map(note => note.stateDirectory), defaultStateDirectory()])];
80
+ const held = [];
81
+ const stopped = [], other = [];
82
+ for (const state of states) {
83
+ let client;
84
+ try {
85
+ client = await RhoClient.fromFile(path.join(state, 'connection.json'));
86
+ }
87
+ catch {
88
+ if (given)
89
+ return fail(1, `No Rho has run with the state folder ${state}.`);
90
+ continue;
91
+ }
92
+ try {
93
+ const projects = await client.call('project.list', {});
94
+ // The innermost project holding the folder, so a project inside another's folder is itself.
95
+ const roots = await Promise.all(projects.map(async (p) => ({ project: p, root: await fs.realpath(p.root).catch(() => null) })));
96
+ const found = roots.filter(r => r.root && within(folder, r.root)).sort((a, b) => b.root.length - a.root.length)[0];
97
+ if (found)
98
+ held.push({ client, state, project: found.project, depth: found.root.length });
99
+ else
100
+ other.push(`${state} (${client.connection.url})`);
101
+ }
102
+ catch (error) {
103
+ const e = error;
104
+ if (e?.cause?.code === 'ECONNREFUSED') {
105
+ stopped.push(`${state} (last at ${client.connection.url})`);
106
+ continue;
107
+ }
108
+ return fail(1, e?.error?.message ?? e?.message ?? String(error));
109
+ }
110
+ }
111
+ if (held.length > 1)
112
+ return fail(1, `More than one running Rho has ${folder} as a project: ${held.map(h => `${h.state} (${h.client.connection.url})`).join(', ')}. Ask the person which one they use, and run this again with --state-dir and its state folder.`);
113
+ const chosen = held[0];
114
+ if (!chosen) {
115
+ if (other.length)
116
+ return fail(1, `${folder} is not a project of the Rho running for ${other.join(', ')}. Ask the person to open it in Rho, or give the folder of a project they opened.`);
117
+ return fail(1, `Rho is not running${stopped.length ? ` for ${stopped.join(', ')}` : ' on this machine'}. Ask the person to start it, then run this again.`);
118
+ }
119
+ try {
120
+ const reply = await grantReply(chosen.client, chosen.project, session);
121
+ process.stdout.write(values.json ? JSON.stringify(reply) + '\n' : connectText(reply, chosen.project.root));
122
+ return 0;
123
+ }
124
+ catch (error) {
125
+ const e = error;
126
+ return fail(1, e?.error?.message ?? e?.message ?? String(error));
127
+ }
128
+ }