@rho-workspace/rho 0.5.3 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -5
- package/dist/browser-access.js +3 -2
- package/dist/capabilities.d.ts +29 -2
- package/dist/capabilities.js +79 -2
- package/dist/cli.js +237 -99
- package/dist/contract.generated.d.ts +441 -16
- package/dist/contract.generated.js +1 -1
- package/dist/contracts/owners.generated.js +459 -10
- package/dist/conversation-presentation.d.ts +3 -1
- package/dist/conversation-presentation.js +16 -6
- package/dist/conversations.d.ts +10 -6
- package/dist/conversations.js +17 -13
- package/dist/discovery.d.ts +1 -0
- package/dist/discovery.js +3 -3
- package/dist/extension-contract.d.ts +99 -0
- package/dist/extension-contract.js +52 -0
- package/dist/extension-directory.d.ts +9 -0
- package/dist/extension-directory.js +11 -0
- package/dist/extension-worker.d.ts +1 -0
- package/dist/extension-worker.js +36 -0
- package/dist/extensions.d.ts +157 -0
- package/dist/extensions.js +349 -0
- package/dist/installs.d.ts +11 -0
- package/dist/installs.js +179 -0
- package/dist/plugin-cli.d.ts +1 -0
- package/dist/plugin-cli.js +139 -0
- package/dist/plugin-inventory.json +18 -0
- package/dist/plugins.d.ts +3 -3
- package/dist/project-notes.js +2 -0
- package/dist/project-work.d.ts +3 -1
- package/dist/project-work.js +15 -2
- package/dist/protocol.d.ts +7 -0
- package/dist/protocol.js +11 -7
- package/dist/screen-check-skill.d.ts +2 -0
- package/dist/screen-check-skill.js +39 -0
- package/dist/server.d.ts +6 -1
- package/dist/server.js +105 -15
- package/dist/web/.vite/manifest.json +65 -65
- package/dist/web/assets/{canvas-BXhC8RDZ.js → canvas-D8rDdfDz.js} +1 -1
- package/dist/web/assets/choices-b0XhrGQV.js +1 -0
- package/dist/web/assets/{console-e1P5qYQ5.js → console-BSjLGe0T.js} +1 -1
- package/dist/web/assets/{dist-Dd3iAGFy.js → dist-Buk0lwzI.js} +2 -2
- package/dist/web/assets/dist-Cw8hRIlT.js +1 -0
- package/dist/web/assets/dist-Tzoe_zm-.js +3 -0
- package/dist/web/assets/{dist-DEorbOW0.js → dist-foH9IKc6.js} +1 -1
- package/dist/web/assets/explore-in-BVUy3ZW_.js +1 -0
- package/dist/web/assets/graph-1OdIJ9l7.js +2 -0
- package/dist/web/assets/index-CsC3sTRq.css +1 -0
- package/dist/web/assets/{index-BYuKpyoi.js → index-CxmItXqa.js} +220 -121
- package/dist/web/assets/{notes-meaning-B3HFbh84.js → notes-meaning-pVbbQUGP.js} +1 -1
- package/dist/web/assets/overview-B9UtVJ32.js +6 -0
- package/dist/web/assets/preview-CksD_5KS.js +1 -0
- package/dist/web/assets/{review-BVh9jWMB.js → review-CMxQlQ-C.js} +1 -1
- package/dist/web/assets/{skills-DPaEYkln.js → skills-BFNSyrnD.js} +1 -1
- package/dist/web/assets/{skills-work-dvjfy_tu.js → skills-work-BGPSnF_I.js} +1 -1
- package/dist/web/assets/{studio-process-BYm8mjRJ.js → studio-process-CsRoTHOh.js} +2 -2
- package/dist/web/assets/{timeline-events-CDZ7wiJX.js → timeline-events-BbuuFWHV.js} +1 -1
- package/dist/web/assets/{work-turns-BeCt303c.js → work-turns-BvJlIMmA.js} +1 -1
- package/dist/web/assets/workspace-CWlkjLNx.js +5 -0
- package/dist/web/composition.json +80 -80
- package/dist/web/index.html +3 -3
- package/dist/web/renderer.json +1 -1
- package/dist/web-assets.d.ts +2 -1
- package/dist/web-assets.js +3 -2
- package/dist/work-contract.js +2 -2
- package/docs/FRONTEND.md +30 -14
- package/docs/HEADLESS.md +60 -14
- package/docs/PLUGIN-AUTHORING.md +4 -0
- package/docs/THIRD-PARTY-PLUGINS.md +190 -0
- package/example/pa14-qs/.rho/rho/conversations/c-67f77cfebaba2cea.json +1 -1
- package/example/pa14-qs/.rho/rho/conversations/c-91aa2e46b1ac1a6c.json +1 -1
- package/example/pa14-qs/.rho/rho/conversations/c-fa24dfd80dfe4bcb.json +1 -1
- package/node_modules/@hono/node-server/dist/index.js +11 -0
- package/node_modules/@hono/node-server/dist/index.mjs +11 -0
- package/node_modules/@hono/node-server/dist/listener.js +11 -0
- package/node_modules/@hono/node-server/dist/listener.mjs +11 -0
- package/node_modules/@hono/node-server/dist/request.js +11 -0
- package/node_modules/@hono/node-server/dist/request.mjs +11 -0
- package/node_modules/@hono/node-server/dist/server.js +11 -0
- package/node_modules/@hono/node-server/dist/server.mjs +11 -0
- package/node_modules/@hono/node-server/dist/vercel.js +11 -0
- package/node_modules/@hono/node-server/dist/vercel.mjs +11 -0
- package/node_modules/@hono/node-server/package.json +1 -1
- package/node_modules/@rho-workspace/plugin-agent/README.md +42 -1
- package/node_modules/@rho-workspace/plugin-agent/dist/acp-conversation.js +14 -3
- package/node_modules/@rho-workspace/plugin-agent/dist/activity-normalize.d.ts +1 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/activity-normalize.js +2 -2
- package/node_modules/@rho-workspace/plugin-agent/dist/conversation.d.ts +1 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/conversation.js +1 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/dsh-session.d.ts +6 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/dsh-session.js +174 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/external-session-contract.d.ts +82 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/external-session-contract.js +15 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/external-session.d.ts +73 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/external-session.js +190 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/generic-acp.d.ts +11 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/generic-acp.js +7 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/index.d.ts +373 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/index.js +1 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/mcp.js +5 -1
- package/node_modules/@rho-workspace/plugin-agent/dist/operations.d.ts +33 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/operations.js +3 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/presentation.d.ts +14 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/presentation.js +2 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/ui-external-session.d.ts +15 -0
- package/node_modules/@rho-workspace/plugin-agent/dist/ui-external-session.js +37 -0
- package/node_modules/@rho-workspace/plugin-agent/package.json +5 -1
- package/node_modules/@rho-workspace/plugin-annotations/package.json +1 -1
- package/node_modules/@rho-workspace/plugin-documents/README.md +4 -0
- package/node_modules/@rho-workspace/plugin-documents/dist/index.d.ts +3 -0
- package/node_modules/@rho-workspace/plugin-documents/dist/index.js +1 -1
- package/node_modules/@rho-workspace/plugin-documents/package.json +1 -1
- package/node_modules/@rho-workspace/plugin-kernel/README.md +71 -10
- package/node_modules/@rho-workspace/plugin-kernel/dist/code.d.ts +2 -0
- package/node_modules/@rho-workspace/plugin-kernel/dist/code.js +4 -1
- package/node_modules/@rho-workspace/plugin-kernel/dist/contract.js +5 -0
- package/node_modules/@rho-workspace/plugin-kernel/dist/index.d.ts +7 -0
- package/node_modules/@rho-workspace/plugin-kernel/dist/index.js +55 -8
- package/node_modules/@rho-workspace/plugin-kernel/dist/lineage.d.ts +9 -6
- package/node_modules/@rho-workspace/plugin-kernel/dist/lineage.js +18 -41
- package/node_modules/@rho-workspace/plugin-kernel/dist/operations.js +5 -2
- package/node_modules/@rho-workspace/plugin-kernel/dist/script-flow.d.ts +39 -0
- package/node_modules/@rho-workspace/plugin-kernel/dist/script-flow.js +661 -0
- package/node_modules/@rho-workspace/plugin-kernel/dist/ui-base.d.ts +3 -0
- package/node_modules/@rho-workspace/plugin-kernel/dist/ui-base.js +10 -0
- package/node_modules/@rho-workspace/plugin-kernel/dist/ui-flow.d.ts +38 -4
- package/node_modules/@rho-workspace/plugin-kernel/dist/ui-flow.js +194 -97
- package/node_modules/@rho-workspace/plugin-kernel/dist/ui-notebook-work.js +1 -2
- package/node_modules/@rho-workspace/plugin-kernel/dist/ui-notebook.d.ts +10 -2
- package/node_modules/@rho-workspace/plugin-kernel/dist/ui-notebook.js +79 -18
- package/node_modules/@rho-workspace/plugin-kernel/dist/ui-styles.js +115 -45
- package/node_modules/@rho-workspace/plugin-kernel/dist/ui.d.ts +1 -1
- package/node_modules/@rho-workspace/plugin-kernel/dist/ui.js +1 -1
- package/node_modules/@rho-workspace/plugin-kernel/dist/value-graph.d.ts +63 -0
- package/node_modules/@rho-workspace/plugin-kernel/dist/value-graph.js +344 -0
- package/node_modules/@rho-workspace/plugin-kernel/package.json +1 -1
- package/node_modules/@rho-workspace/plugin-kernel/runners/runner.R +6 -3
- package/node_modules/@rho-workspace/plugin-kernel/runners/runner.py +6 -3
- package/node_modules/express-rate-limit/dist/index.cjs +1 -1
- package/node_modules/express-rate-limit/dist/index.mjs +1 -1
- package/node_modules/express-rate-limit/package.json +1 -1
- package/node_modules/ip-address/dist/ipv6.js +1 -1
- package/node_modules/ip-address/package.json +1 -1
- package/node_modules/playwright-core/LICENSE +202 -0
- package/node_modules/playwright-core/NOTICE +5 -0
- package/node_modules/playwright-core/ThirdPartyNotices.txt +13 -0
- package/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
- package/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/node_modules/playwright-core/browsers.json +52 -0
- package/node_modules/playwright-core/cli.js +22 -0
- package/node_modules/playwright-core/index.js +17 -0
- package/node_modules/playwright-core/index.mjs +28 -0
- package/node_modules/playwright-core/lib/bootstrap.js +149 -0
- package/node_modules/playwright-core/lib/coreBundle.js +78041 -0
- package/node_modules/playwright-core/lib/entry/cliDaemon.js +5 -0
- package/node_modules/playwright-core/lib/entry/dashboardApp.js +3 -0
- package/node_modules/playwright-core/lib/entry/mcp.js +10 -0
- package/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +3 -0
- package/node_modules/playwright-core/lib/package.js +50 -0
- package/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- package/node_modules/playwright-core/lib/server/electron/loader.js +123 -0
- package/node_modules/playwright-core/lib/serverRegistry.js +1939 -0
- package/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +65 -0
- package/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +141 -0
- package/node_modules/playwright-core/lib/tools/cli-client/cli.js +7 -0
- package/node_modules/playwright-core/lib/tools/cli-client/help.json +808 -0
- package/node_modules/playwright-core/lib/tools/cli-client/minimist.js +128 -0
- package/node_modules/playwright-core/lib/tools/cli-client/output.js +352 -0
- package/node_modules/playwright-core/lib/tools/cli-client/program.js +422 -0
- package/node_modules/playwright-core/lib/tools/cli-client/registry.js +180 -0
- package/node_modules/playwright-core/lib/tools/cli-client/session.js +261 -0
- package/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
- package/node_modules/playwright-core/lib/tools/utils/extension.js +112 -0
- package/node_modules/playwright-core/lib/tools/utils/socketConnection.js +108 -0
- package/node_modules/playwright-core/lib/utilsBundle.js +86078 -0
- package/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +1890 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule-CQ8RZGBm.js +32 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/index.html +29 -0
- package/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +24 -0
- package/node_modules/playwright-core/lib/vite/htmlReport/index.html +16 -0
- package/node_modules/playwright-core/lib/vite/htmlReport/report.css +2 -0
- package/node_modules/playwright-core/lib/vite/htmlReport/report.js +32 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DK72OMRi.js +32 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-Cn0mmDuv.js +129 -0
- package/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
- package/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BEB2e8M3.js +32 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-D-g2vrvf.js +184 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-B794rD2Z.js +7 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.C8BeHuxd.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.html +44 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.oNry3Hjv.js +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +10 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +4 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CYwC_gH1.js +5 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CyMfwkXJ.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +18 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
- package/node_modules/playwright-core/lib/webp_codec.LICENSE +173 -0
- package/node_modules/playwright-core/lib/webp_codec.wasm +0 -0
- package/node_modules/playwright-core/lib/xdg-open +1267 -0
- package/node_modules/playwright-core/package.json +34 -0
- package/package.json +13 -7
- package/protocol/index.json +75 -21
- package/protocol/operations/agent.sessions.list.json +100 -0
- package/protocol/operations/agent.sessions.read.json +266 -0
- package/protocol/operations/conversation.settings.check.json +147 -4
- package/protocol/operations/conversation.settings.read.json +145 -3
- package/protocol/operations/conversation.settings.update.json +166 -4
- package/protocol/operations/conversation.start.json +2 -1
- package/protocol/operations/extension.call.json +132 -0
- package/protocol/operations/extension.content.json +78 -0
- package/protocol/operations/extension.describe.json +195 -0
- package/protocol/operations/extension.install.json +198 -0
- package/protocol/operations/extension.list.json +123 -0
- package/protocol/operations/extension.manage.json +55 -0
- package/protocol/operations/extension.read.json +112 -0
- package/protocol/operations/kernel.interrupt.json +20 -0
- package/protocol/operations/kernel.read.json +30 -0
- package/protocol/operations/kernel.run.json +36 -1
- package/protocol/operations/kernel.stop.json +10 -0
- package/protocol/operations/project.work.read.json +3 -2
- package/protocol/operations/session.grant.json +9 -0
- package/scripts/browser-checks.mjs +53 -0
- package/scripts/screen-check.mjs +193 -0
- package/scripts/third-party-acceptance.mjs +77 -0
- package/vendor/composition.json +111 -111
- package/vendor/rho-workspace-plugin-agent-0.4.29.tgz +0 -0
- package/vendor/rho-workspace-plugin-annotations-0.5.2.tgz +0 -0
- package/vendor/rho-workspace-plugin-documents-0.4.11.tgz +0 -0
- package/vendor/rho-workspace-plugin-kernel-0.5.5.tgz +0 -0
- package/web/theme.css +17 -2
- package/dist/web/assets/choices-B-y2OYvE.js +0 -1
- package/dist/web/assets/dist-CBM2oq6g.js +0 -1
- package/dist/web/assets/dist-CH56yNDn.js +0 -3
- package/dist/web/assets/explore-in-muWXOGOY.js +0 -1
- package/dist/web/assets/graph-CK-df5lh.js +0 -2
- package/dist/web/assets/index-DBd77u4a.css +0 -1
- package/dist/web/assets/overview-D1Ev2OC_.js +0 -6
- package/dist/web/assets/preview-HbmQKUGY.js +0 -1
- package/dist/web/assets/workspace-d5Hw_ClZ.js +0 -5
- package/vendor/rho-workspace-plugin-agent-0.4.27.tgz +0 -0
- package/vendor/rho-workspace-plugin-documents-0.4.10.tgz +0 -0
- package/vendor/rho-workspace-plugin-kernel-0.5.2.tgz +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export declare const externalSessionLimits: {
|
|
2
|
+
maxSessions: number;
|
|
3
|
+
maxTurns: number;
|
|
4
|
+
maxTools: number;
|
|
5
|
+
maxRecordBytes: number;
|
|
6
|
+
maxEvents: number;
|
|
7
|
+
maxSourceBytes: number;
|
|
8
|
+
maxTextChars: number;
|
|
9
|
+
maxDetailChars: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const externalResultSchema: {
|
|
12
|
+
type: string;
|
|
13
|
+
properties: Record<string, any>;
|
|
14
|
+
required: string[];
|
|
15
|
+
additionalProperties: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const externalToolSchema: {
|
|
18
|
+
type: string;
|
|
19
|
+
properties: Record<string, any>;
|
|
20
|
+
required: string[];
|
|
21
|
+
additionalProperties: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const externalTurnSchema: {
|
|
24
|
+
type: string;
|
|
25
|
+
properties: Record<string, any>;
|
|
26
|
+
required: string[];
|
|
27
|
+
additionalProperties: boolean;
|
|
28
|
+
};
|
|
29
|
+
export declare const externalSessionSummarySchema: {
|
|
30
|
+
type: string;
|
|
31
|
+
properties: Record<string, any>;
|
|
32
|
+
required: string[];
|
|
33
|
+
additionalProperties: boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare const externalSessionSchemas: {
|
|
36
|
+
summary: {
|
|
37
|
+
type: string;
|
|
38
|
+
properties: Record<string, any>;
|
|
39
|
+
required: string[];
|
|
40
|
+
additionalProperties: boolean;
|
|
41
|
+
};
|
|
42
|
+
turn: {
|
|
43
|
+
type: string;
|
|
44
|
+
properties: Record<string, any>;
|
|
45
|
+
required: string[];
|
|
46
|
+
additionalProperties: boolean;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export declare const externalSessionOperations: {
|
|
50
|
+
'agent.sessions.list': {
|
|
51
|
+
inputSchema: {
|
|
52
|
+
type: string;
|
|
53
|
+
properties: Record<string, any>;
|
|
54
|
+
required: string[];
|
|
55
|
+
additionalProperties: boolean;
|
|
56
|
+
};
|
|
57
|
+
outputSchema: {
|
|
58
|
+
type: string;
|
|
59
|
+
properties: Record<string, any>;
|
|
60
|
+
required: string[];
|
|
61
|
+
additionalProperties: boolean;
|
|
62
|
+
};
|
|
63
|
+
requires: never[];
|
|
64
|
+
effect: "read";
|
|
65
|
+
};
|
|
66
|
+
'agent.sessions.read': {
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: string;
|
|
69
|
+
properties: Record<string, any>;
|
|
70
|
+
required: string[];
|
|
71
|
+
additionalProperties: boolean;
|
|
72
|
+
};
|
|
73
|
+
outputSchema: {
|
|
74
|
+
type: string;
|
|
75
|
+
properties: Record<string, any>;
|
|
76
|
+
required: string[];
|
|
77
|
+
additionalProperties: boolean;
|
|
78
|
+
};
|
|
79
|
+
requires: never[];
|
|
80
|
+
effect: "read";
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// A retained observation of another client's conversation. It has no input operation.
|
|
2
|
+
const text = { type: 'string' }, count = { type: 'integer', minimum: 0 };
|
|
3
|
+
const obj = (properties, required = Object.keys(properties)) => ({ type: 'object', properties, required, additionalProperties: false });
|
|
4
|
+
const array = (items, maxItems) => ({ type: 'array', items, maxItems });
|
|
5
|
+
export const externalSessionLimits = { maxSessions: 64, maxTurns: 200, maxTools: 256, maxRecordBytes: 4194304, maxEvents: 32768, maxSourceBytes: 33554432, maxTextChars: 32768, maxDetailChars: 8192 };
|
|
6
|
+
const state = { enum: ['running', 'completed', 'failed', 'stopped', 'unknown'] };
|
|
7
|
+
export const externalResultSchema = obj({ path: text, id: text, version: text, projectId: text, toolId: text }, ['path', 'toolId']);
|
|
8
|
+
export const externalToolSchema = obj({ id: text, at: text, name: text, detail: text, output: text, outcome: { enum: ['requested', 'returned', 'failed', 'unknown'] }, exitCode: { type: 'integer' }, paths: array(text, 32) }, ['id', 'at', 'name', 'detail', 'output', 'outcome', 'paths']);
|
|
9
|
+
export const externalTurnSchema = obj({ id: text, at: text, endedAt: text, state, prompt: text, reply: text, messages: array(obj({ at: text, text }), 200), tools: array(externalToolSchema, externalSessionLimits.maxTools), results: array(externalResultSchema, 64), omittedTools: count, omittedChars: count }, ['id', 'at', 'state', 'prompt', 'reply', 'messages', 'tools', 'results', 'omittedTools', 'omittedChars']);
|
|
10
|
+
export const externalSessionSummarySchema = obj({ id: { type: 'string', pattern: '^x-[a-f0-9]{64}$' }, producer: text, sessionId: text, title: text, lastAt: text, observedAt: text, state, turns: count, sourceCursor: count, omittedTurns: count, problem: text, inputOwner: { const: 'external' } }, ['id', 'producer', 'sessionId', 'title', 'lastAt', 'observedAt', 'state', 'turns', 'sourceCursor', 'omittedTurns', 'inputOwner']);
|
|
11
|
+
export const externalSessionSchemas = { summary: externalSessionSummarySchema, turn: externalTurnSchema };
|
|
12
|
+
export const externalSessionOperations = {
|
|
13
|
+
'agent.sessions.list': { inputSchema: obj({}), outputSchema: obj({ sessions: array(externalSessionSummarySchema, 64), omitted: count }), requires: [], effect: 'read' },
|
|
14
|
+
'agent.sessions.read': { inputSchema: obj({ session: { type: 'string', pattern: '^x-[a-f0-9]{64}$' }, before: count, limit: { type: 'integer', minimum: 1, maximum: 20 } }, ['session']), outputSchema: obj({ session: externalSessionSummarySchema, first: count, turns: array(externalTurnSchema, 20) }), requires: [], effect: 'read' },
|
|
15
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export { externalSessionLimits } from './external-session-contract.js';
|
|
2
|
+
export interface ExternalTool {
|
|
3
|
+
id: string;
|
|
4
|
+
at: string;
|
|
5
|
+
name: string;
|
|
6
|
+
detail: string;
|
|
7
|
+
output: string;
|
|
8
|
+
outcome: 'requested' | 'returned' | 'failed' | 'unknown';
|
|
9
|
+
exitCode?: number;
|
|
10
|
+
paths: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface ExternalResult {
|
|
13
|
+
path: string;
|
|
14
|
+
toolId: string;
|
|
15
|
+
id?: string;
|
|
16
|
+
version?: string;
|
|
17
|
+
projectId?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ExternalTurn {
|
|
20
|
+
id: string;
|
|
21
|
+
at: string;
|
|
22
|
+
endedAt?: string;
|
|
23
|
+
state: 'running' | 'completed' | 'failed' | 'stopped' | 'unknown';
|
|
24
|
+
prompt: string;
|
|
25
|
+
reply: string;
|
|
26
|
+
messages: Array<{
|
|
27
|
+
at: string;
|
|
28
|
+
text: string;
|
|
29
|
+
}>;
|
|
30
|
+
tools: ExternalTool[];
|
|
31
|
+
results: ExternalResult[];
|
|
32
|
+
omittedTools: number;
|
|
33
|
+
omittedChars: number;
|
|
34
|
+
}
|
|
35
|
+
export interface ExternalSessionSummary {
|
|
36
|
+
id: string;
|
|
37
|
+
producer: string;
|
|
38
|
+
sessionId: string;
|
|
39
|
+
title: string;
|
|
40
|
+
lastAt: string;
|
|
41
|
+
observedAt: string;
|
|
42
|
+
state: ExternalTurn['state'];
|
|
43
|
+
turns: number;
|
|
44
|
+
sourceCursor: number;
|
|
45
|
+
omittedTurns: number;
|
|
46
|
+
problem?: string;
|
|
47
|
+
inputOwner: 'external';
|
|
48
|
+
}
|
|
49
|
+
export interface ExternalSessionRecord {
|
|
50
|
+
format: 1;
|
|
51
|
+
projectRoot: string;
|
|
52
|
+
summary: ExternalSessionSummary;
|
|
53
|
+
turns: ExternalTurn[];
|
|
54
|
+
sourceDigest: string;
|
|
55
|
+
}
|
|
56
|
+
export declare const externalSessionId: (producer: string, session: string) => string;
|
|
57
|
+
export declare function listExternalSessions(root: string): {
|
|
58
|
+
sessions: ExternalSessionSummary[];
|
|
59
|
+
omitted: number;
|
|
60
|
+
};
|
|
61
|
+
export declare function readExternalSession(root: string, input: {
|
|
62
|
+
session: string;
|
|
63
|
+
before?: number;
|
|
64
|
+
limit?: number;
|
|
65
|
+
}): {
|
|
66
|
+
session: ExternalSessionSummary;
|
|
67
|
+
first: number;
|
|
68
|
+
turns: ExternalTurn[];
|
|
69
|
+
};
|
|
70
|
+
/** Native adapters retain an observation under their existing filesystem authority.
|
|
71
|
+
* No managed execution, Agent input, grant change or runtime startup is involved. */
|
|
72
|
+
export declare function saveExternalSession(root: string, value: ExternalSessionRecord, previousDigest?: string): ExternalSessionSummary;
|
|
73
|
+
export declare function retainedExternalSession(root: string, producer: string, sessionId: string): ExternalSessionRecord | undefined;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import fs, { constants } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
4
|
+
import { Ajv } from 'ajv';
|
|
5
|
+
import { externalSessionLimits as limits, externalSessionSummarySchema, externalTurnSchema } from './external-session-contract.js';
|
|
6
|
+
export { externalSessionLimits } from './external-session-contract.js';
|
|
7
|
+
export const externalSessionId = (producer, session) => 'x-' + createHash('sha256').update(producer + '\0' + session).digest('hex');
|
|
8
|
+
const schema = new Ajv({ strict: false }).compile({ type: 'object', additionalProperties: false, required: ['format', 'projectRoot', 'summary', 'turns', 'sourceDigest'], properties: {
|
|
9
|
+
format: { const: 1 }, projectRoot: { type: 'string' }, summary: externalSessionSummarySchema,
|
|
10
|
+
turns: { type: 'array', maxItems: limits.maxTurns, items: externalTurnSchema }, sourceDigest: { type: 'string', pattern: '^[a-f0-9]{64}$' }
|
|
11
|
+
} });
|
|
12
|
+
function directory(root, create = false) {
|
|
13
|
+
let dir = fs.realpathSync(root);
|
|
14
|
+
for (const part of ['.rho', 'agent', 'external']) {
|
|
15
|
+
dir = path.join(dir, part);
|
|
16
|
+
if (create) {
|
|
17
|
+
try {
|
|
18
|
+
fs.mkdirSync(dir, { mode: 0o700 });
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
if (e.code !== 'EEXIST')
|
|
22
|
+
throw e;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const stat = fs.lstatSync(dir);
|
|
26
|
+
if (!stat.isDirectory() || stat.isSymbolicLink() || fs.realpathSync(dir) !== dir)
|
|
27
|
+
throw new Error('External session storage must stay in the project.');
|
|
28
|
+
}
|
|
29
|
+
return dir;
|
|
30
|
+
}
|
|
31
|
+
function read(file, root) {
|
|
32
|
+
const fd = fs.openSync(file, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
33
|
+
try {
|
|
34
|
+
const stat = fs.fstatSync(fd);
|
|
35
|
+
if (!stat.isFile() || stat.size > limits.maxRecordBytes)
|
|
36
|
+
throw new Error('External session record exceeds 4 MiB.');
|
|
37
|
+
const b = Buffer.alloc(stat.size + 1), n = fs.readSync(fd, b, 0, b.length, 0);
|
|
38
|
+
if (n !== stat.size)
|
|
39
|
+
throw new Error('External session changed during observation.');
|
|
40
|
+
const v = JSON.parse(b.subarray(0, n).toString('utf8'));
|
|
41
|
+
if (!schema(v) || v.projectRoot !== root || v.summary.id !== externalSessionId(v.summary.producer, v.summary.sessionId))
|
|
42
|
+
throw new Error('Invalid external session record.');
|
|
43
|
+
return v;
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
fs.closeSync(fd);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function observed(v) {
|
|
50
|
+
// No heartbeat proves the model or its native subprocess is alive.
|
|
51
|
+
if (v.summary.state !== 'running' || Date.now() - Date.parse(v.summary.observedAt) < 10000)
|
|
52
|
+
return v;
|
|
53
|
+
return { ...v, summary: { ...v.summary, state: 'unknown' }, turns: v.turns.map(t => t.state !== 'running' ? t : { ...t, state: 'unknown', tools: t.tools.map(tool => tool.outcome === 'requested' ? { ...tool, outcome: 'unknown' } : tool) }) };
|
|
54
|
+
}
|
|
55
|
+
export function listExternalSessions(root) {
|
|
56
|
+
root = fs.realpathSync(root);
|
|
57
|
+
const sessions = [];
|
|
58
|
+
let omitted = 0;
|
|
59
|
+
try {
|
|
60
|
+
const dir = directory(root), entries = fs.opendirSync(dir);
|
|
61
|
+
try {
|
|
62
|
+
let e, scanned = 0;
|
|
63
|
+
while ((e = entries.readSync())) {
|
|
64
|
+
if (++scanned > limits.maxSessions * 4) {
|
|
65
|
+
omitted++;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
if (!/^x-[a-f0-9]{64}\.json$/.test(e.name))
|
|
69
|
+
continue;
|
|
70
|
+
if (sessions.length >= limits.maxSessions) {
|
|
71
|
+
omitted++;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
sessions.push(observed(read(path.join(dir, e.name), root)).summary);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
omitted++;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
entries.closeSync();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (e) {
|
|
87
|
+
if (e.code !== 'ENOENT')
|
|
88
|
+
omitted++;
|
|
89
|
+
}
|
|
90
|
+
return { sessions: sessions.sort((a, b) => b.lastAt.localeCompare(a.lastAt)), omitted };
|
|
91
|
+
}
|
|
92
|
+
export function readExternalSession(root, input) {
|
|
93
|
+
if (!/^x-[a-f0-9]{64}$/.test(input.session))
|
|
94
|
+
throw new Error('Invalid external session identity.');
|
|
95
|
+
root = fs.realpathSync(root);
|
|
96
|
+
const v = observed(read(path.join(directory(root), input.session + '.json'), root));
|
|
97
|
+
const end = Math.min(v.turns.length, input.before ?? v.turns.length), first = Math.max(0, end - Math.min(20, Math.max(1, input.limit ?? 4)));
|
|
98
|
+
return { session: v.summary, first, turns: v.turns.slice(first, end) };
|
|
99
|
+
}
|
|
100
|
+
/** Native adapters retain an observation under their existing filesystem authority.
|
|
101
|
+
* No managed execution, Agent input, grant change or runtime startup is involved. */
|
|
102
|
+
export function saveExternalSession(root, value, previousDigest) {
|
|
103
|
+
root = fs.realpathSync(root);
|
|
104
|
+
if (value.projectRoot !== root || !schema(value) || value.summary.id !== externalSessionId(value.summary.producer, value.summary.sessionId))
|
|
105
|
+
throw new Error('Invalid external session observation.');
|
|
106
|
+
const bytes = JSON.stringify(value);
|
|
107
|
+
if (Buffer.byteLength(bytes) > limits.maxRecordBytes)
|
|
108
|
+
throw new Error('External session exceeds maxRecordBytes; previous observation retained.');
|
|
109
|
+
const dir = directory(root, true), file = path.join(dir, value.summary.id + '.json');
|
|
110
|
+
// The lock covers only a small local observation write; never steal a live writer's lock.
|
|
111
|
+
const lock = file + '.lock';
|
|
112
|
+
let fd;
|
|
113
|
+
try {
|
|
114
|
+
fd = fs.openSync(lock, 'wx', 0o600);
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
// Recover only a positively dead writer. Unknown owners and live PIDs retain the lock.
|
|
118
|
+
try {
|
|
119
|
+
const stat = fs.lstatSync(lock);
|
|
120
|
+
if (!stat.isFile() || stat.isSymbolicLink() || stat.size > 32)
|
|
121
|
+
throw new Error();
|
|
122
|
+
const pid = Number(fs.readFileSync(lock, 'utf8'));
|
|
123
|
+
if (!Number.isSafeInteger(pid) || pid <= 0)
|
|
124
|
+
throw new Error();
|
|
125
|
+
try {
|
|
126
|
+
process.kill(pid, 0);
|
|
127
|
+
throw new Error();
|
|
128
|
+
}
|
|
129
|
+
catch (e) {
|
|
130
|
+
if (e.code !== 'ESRCH')
|
|
131
|
+
throw e;
|
|
132
|
+
}
|
|
133
|
+
const now = fs.lstatSync(lock);
|
|
134
|
+
if (now.ino !== stat.ino || now.dev !== stat.dev)
|
|
135
|
+
throw new Error();
|
|
136
|
+
fs.unlinkSync(lock);
|
|
137
|
+
fd = fs.openSync(lock, 'wx', 0o600);
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
throw new Error('External session observation is busy; previous observation retained.');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
fs.writeFileSync(fd, String(process.pid));
|
|
144
|
+
const temp = file + '.' + randomUUID() + '.tmp';
|
|
145
|
+
try {
|
|
146
|
+
let old;
|
|
147
|
+
try {
|
|
148
|
+
old = read(file, root);
|
|
149
|
+
}
|
|
150
|
+
catch (e) {
|
|
151
|
+
if (e.code !== 'ENOENT')
|
|
152
|
+
throw e;
|
|
153
|
+
}
|
|
154
|
+
if (old) {
|
|
155
|
+
if (value.summary.sourceCursor < old.summary.sourceCursor)
|
|
156
|
+
throw new Error('External source moved backwards; previous observation retained.');
|
|
157
|
+
if (value.summary.sourceCursor === old.summary.sourceCursor && old.sourceDigest !== value.sourceDigest)
|
|
158
|
+
throw new Error('External source identity conflicts with retained content.');
|
|
159
|
+
if (value.summary.sourceCursor > old.summary.sourceCursor && previousDigest !== old.sourceDigest)
|
|
160
|
+
throw new Error('External source prefix conflicts with retained content.');
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
const entries = fs.readdirSync(dir).filter(n => /^x-[a-f0-9]{64}\.json$/.test(n));
|
|
164
|
+
if (entries.length >= limits.maxSessions)
|
|
165
|
+
throw new Error('External session maxSessions reached; previous observations retained.');
|
|
166
|
+
}
|
|
167
|
+
fs.writeFileSync(temp, bytes, { flag: 'wx', mode: 0o600 });
|
|
168
|
+
fs.renameSync(temp, file);
|
|
169
|
+
}
|
|
170
|
+
finally {
|
|
171
|
+
fs.closeSync(fd);
|
|
172
|
+
fs.unlinkSync(lock);
|
|
173
|
+
try {
|
|
174
|
+
fs.unlinkSync(temp);
|
|
175
|
+
}
|
|
176
|
+
catch { }
|
|
177
|
+
}
|
|
178
|
+
return value.summary;
|
|
179
|
+
}
|
|
180
|
+
export function retainedExternalSession(root, producer, sessionId) {
|
|
181
|
+
root = fs.realpathSync(root);
|
|
182
|
+
try {
|
|
183
|
+
return read(path.join(directory(root), externalSessionId(producer, sessionId) + '.json'), root);
|
|
184
|
+
}
|
|
185
|
+
catch (e) {
|
|
186
|
+
if (e.code === 'ENOENT')
|
|
187
|
+
return undefined;
|
|
188
|
+
throw e;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AcpConversation, type AcpConversationOptions } from './acp-conversation.js';
|
|
2
|
+
/** A generic ACP agent: any program that speaks ACP v1 over stdio. Rho starts the
|
|
3
|
+
* operator-selected command and drives it exactly as it drives Claude Code or Codex, so
|
|
4
|
+
* supporting another agent is configuration (`--acp-command`), not a new adapter. The
|
|
5
|
+
* command is a file plus its arguments and needs no per-agent environment. */
|
|
6
|
+
export interface GenericAcpOptions extends Omit<AcpConversationOptions, 'command' | 'sessionMeta'> {
|
|
7
|
+
command: AcpConversationOptions['command'];
|
|
8
|
+
}
|
|
9
|
+
export declare class GenericAcpConversation extends AcpConversation {
|
|
10
|
+
constructor(o: GenericAcpOptions);
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AcpConversation } from './acp-conversation.js';
|
|
2
|
+
export class GenericAcpConversation extends AcpConversation {
|
|
3
|
+
constructor(o) {
|
|
4
|
+
// A supplied command skips the missing-client check: the operator named the program.
|
|
5
|
+
super({ ...o, command: o.command });
|
|
6
|
+
}
|
|
7
|
+
}
|