@rho-workspace/rho 0.5.4 → 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.
Files changed (102) hide show
  1. package/dist/browser-access.js +3 -2
  2. package/dist/capabilities.d.ts +2 -2
  3. package/dist/capabilities.js +6 -1
  4. package/dist/cli.js +186 -173
  5. package/dist/contract.generated.d.ts +329 -4
  6. package/dist/contract.generated.js +1 -1
  7. package/dist/contracts/owners.generated.js +360 -6
  8. package/dist/discovery.d.ts +1 -0
  9. package/dist/discovery.js +3 -3
  10. package/dist/extension-contract.d.ts +99 -0
  11. package/dist/extension-contract.js +52 -0
  12. package/dist/extension-directory.d.ts +9 -0
  13. package/dist/extension-directory.js +11 -0
  14. package/dist/extension-worker.d.ts +1 -0
  15. package/dist/extension-worker.js +36 -0
  16. package/dist/extensions.d.ts +157 -0
  17. package/dist/extensions.js +349 -0
  18. package/dist/plugin-cli.d.ts +1 -0
  19. package/dist/plugin-cli.js +139 -0
  20. package/dist/plugin-inventory.json +18 -0
  21. package/dist/plugins.d.ts +3 -3
  22. package/dist/project-work.d.ts +3 -1
  23. package/dist/project-work.js +15 -2
  24. package/dist/protocol.d.ts +7 -0
  25. package/dist/protocol.js +4 -2
  26. package/dist/server.d.ts +4 -1
  27. package/dist/server.js +55 -8
  28. package/dist/web/.vite/manifest.json +61 -61
  29. package/dist/web/assets/{canvas-BXhC8RDZ.js → canvas-D8rDdfDz.js} +1 -1
  30. package/dist/web/assets/choices-b0XhrGQV.js +1 -0
  31. package/dist/web/assets/{console-Dbdo-5oO.js → console-BSjLGe0T.js} +1 -1
  32. package/dist/web/assets/{dist-B2V0VDO0.js → dist-Buk0lwzI.js} +2 -2
  33. package/dist/web/assets/dist-Cw8hRIlT.js +1 -0
  34. package/dist/web/assets/dist-Tzoe_zm-.js +3 -0
  35. package/dist/web/assets/{dist-D25Vn17i.js → dist-foH9IKc6.js} +1 -1
  36. package/dist/web/assets/explore-in-BVUy3ZW_.js +1 -0
  37. package/dist/web/assets/graph-1OdIJ9l7.js +2 -0
  38. package/dist/web/assets/index-CsC3sTRq.css +1 -0
  39. package/dist/web/assets/{index-BHQIaDsx.js → index-CxmItXqa.js} +85 -85
  40. package/dist/web/assets/{notes-meaning-DdPbtNzJ.js → notes-meaning-pVbbQUGP.js} +1 -1
  41. package/dist/web/assets/overview-B9UtVJ32.js +6 -0
  42. package/dist/web/assets/preview-CksD_5KS.js +1 -0
  43. package/dist/web/assets/{review-CmWou4Iv.js → review-CMxQlQ-C.js} +1 -1
  44. package/dist/web/assets/{skills-Dy7n3L9d.js → skills-BFNSyrnD.js} +1 -1
  45. package/dist/web/assets/{skills-work-Cj0W6b-I.js → skills-work-BGPSnF_I.js} +1 -1
  46. package/dist/web/assets/{studio-process-QOY_n2_8.js → studio-process-CsRoTHOh.js} +2 -2
  47. package/dist/web/assets/{timeline-events-DmX1BCh3.js → timeline-events-BbuuFWHV.js} +1 -1
  48. package/dist/web/assets/{work-turns-Co0C71rJ.js → work-turns-BvJlIMmA.js} +1 -1
  49. package/dist/web/assets/workspace-CWlkjLNx.js +5 -0
  50. package/dist/web/composition.json +67 -67
  51. package/dist/web/index.html +3 -3
  52. package/dist/web/renderer.json +1 -1
  53. package/dist/web-assets.d.ts +2 -1
  54. package/dist/web-assets.js +3 -2
  55. package/dist/work-contract.js +2 -2
  56. package/docs/HEADLESS.md +1 -1
  57. package/docs/PLUGIN-AUTHORING.md +4 -0
  58. package/docs/THIRD-PARTY-PLUGINS.md +190 -0
  59. package/node_modules/@rho-workspace/plugin-agent/README.md +39 -0
  60. package/node_modules/@rho-workspace/plugin-agent/dist/activity-normalize.d.ts +1 -0
  61. package/node_modules/@rho-workspace/plugin-agent/dist/activity-normalize.js +2 -2
  62. package/node_modules/@rho-workspace/plugin-agent/dist/dsh-session.d.ts +6 -0
  63. package/node_modules/@rho-workspace/plugin-agent/dist/dsh-session.js +174 -0
  64. package/node_modules/@rho-workspace/plugin-agent/dist/external-session-contract.d.ts +82 -0
  65. package/node_modules/@rho-workspace/plugin-agent/dist/external-session-contract.js +15 -0
  66. package/node_modules/@rho-workspace/plugin-agent/dist/external-session.d.ts +73 -0
  67. package/node_modules/@rho-workspace/plugin-agent/dist/external-session.js +190 -0
  68. package/node_modules/@rho-workspace/plugin-agent/dist/index.d.ts +373 -0
  69. package/node_modules/@rho-workspace/plugin-agent/dist/index.js +1 -0
  70. package/node_modules/@rho-workspace/plugin-agent/dist/operations.d.ts +33 -0
  71. package/node_modules/@rho-workspace/plugin-agent/dist/operations.js +3 -0
  72. package/node_modules/@rho-workspace/plugin-agent/dist/presentation.d.ts +14 -0
  73. package/node_modules/@rho-workspace/plugin-agent/dist/presentation.js +2 -0
  74. package/node_modules/@rho-workspace/plugin-agent/dist/ui-external-session.d.ts +15 -0
  75. package/node_modules/@rho-workspace/plugin-agent/dist/ui-external-session.js +37 -0
  76. package/node_modules/@rho-workspace/plugin-agent/package.json +5 -1
  77. package/package.json +5 -3
  78. package/protocol/index.json +58 -4
  79. package/protocol/operations/agent.sessions.list.json +100 -0
  80. package/protocol/operations/agent.sessions.read.json +266 -0
  81. package/protocol/operations/extension.call.json +132 -0
  82. package/protocol/operations/extension.content.json +78 -0
  83. package/protocol/operations/extension.describe.json +195 -0
  84. package/protocol/operations/extension.install.json +198 -0
  85. package/protocol/operations/extension.list.json +123 -0
  86. package/protocol/operations/extension.manage.json +55 -0
  87. package/protocol/operations/extension.read.json +112 -0
  88. package/protocol/operations/project.work.read.json +3 -2
  89. package/protocol/operations/session.grant.json +9 -0
  90. package/scripts/third-party-acceptance.mjs +77 -0
  91. package/vendor/composition.json +85 -85
  92. package/vendor/rho-workspace-plugin-agent-0.4.29.tgz +0 -0
  93. package/dist/web/assets/choices-DU9kHlyQ.js +0 -1
  94. package/dist/web/assets/dist-BV3hWfn_.js +0 -3
  95. package/dist/web/assets/dist-CLNF2g-E.js +0 -1
  96. package/dist/web/assets/explore-in-8Q5ftt-E.js +0 -1
  97. package/dist/web/assets/graph-hS2kvHTI.js +0 -2
  98. package/dist/web/assets/index-Cj1_iqyK.css +0 -1
  99. package/dist/web/assets/overview-BV6ZO5TO.js +0 -6
  100. package/dist/web/assets/preview-n5lOOdjN.js +0 -1
  101. package/dist/web/assets/workspace-BKFefRfJ.js +0 -5
  102. package/vendor/rho-workspace-plugin-agent-0.4.28.tgz +0 -0
@@ -7259,6 +7259,360 @@ export const ownerContracts = {
7259
7259
  },
7260
7260
  "requires": []
7261
7261
  },
7262
+ "agent.sessions.list": {
7263
+ "effect": "read",
7264
+ "inputSchema": {
7265
+ "additionalProperties": false,
7266
+ "properties": {},
7267
+ "required": [],
7268
+ "type": "object"
7269
+ },
7270
+ "outputSchema": {
7271
+ "additionalProperties": false,
7272
+ "properties": {
7273
+ "omitted": {
7274
+ "minimum": 0,
7275
+ "type": "integer"
7276
+ },
7277
+ "sessions": {
7278
+ "items": {
7279
+ "additionalProperties": false,
7280
+ "properties": {
7281
+ "id": {
7282
+ "pattern": "^x-[a-f0-9]{64}$",
7283
+ "type": "string"
7284
+ },
7285
+ "inputOwner": {
7286
+ "const": "external"
7287
+ },
7288
+ "lastAt": {
7289
+ "type": "string"
7290
+ },
7291
+ "observedAt": {
7292
+ "type": "string"
7293
+ },
7294
+ "omittedTurns": {
7295
+ "minimum": 0,
7296
+ "type": "integer"
7297
+ },
7298
+ "problem": {
7299
+ "type": "string"
7300
+ },
7301
+ "producer": {
7302
+ "type": "string"
7303
+ },
7304
+ "sessionId": {
7305
+ "type": "string"
7306
+ },
7307
+ "sourceCursor": {
7308
+ "minimum": 0,
7309
+ "type": "integer"
7310
+ },
7311
+ "state": {
7312
+ "enum": [
7313
+ "running",
7314
+ "completed",
7315
+ "failed",
7316
+ "stopped",
7317
+ "unknown"
7318
+ ]
7319
+ },
7320
+ "title": {
7321
+ "type": "string"
7322
+ },
7323
+ "turns": {
7324
+ "minimum": 0,
7325
+ "type": "integer"
7326
+ }
7327
+ },
7328
+ "required": [
7329
+ "id",
7330
+ "producer",
7331
+ "sessionId",
7332
+ "title",
7333
+ "lastAt",
7334
+ "observedAt",
7335
+ "state",
7336
+ "turns",
7337
+ "sourceCursor",
7338
+ "omittedTurns",
7339
+ "inputOwner"
7340
+ ],
7341
+ "type": "object"
7342
+ },
7343
+ "maxItems": 64,
7344
+ "type": "array"
7345
+ }
7346
+ },
7347
+ "required": [
7348
+ "sessions",
7349
+ "omitted"
7350
+ ],
7351
+ "type": "object"
7352
+ },
7353
+ "requires": []
7354
+ },
7355
+ "agent.sessions.read": {
7356
+ "effect": "read",
7357
+ "inputSchema": {
7358
+ "additionalProperties": false,
7359
+ "properties": {
7360
+ "before": {
7361
+ "minimum": 0,
7362
+ "type": "integer"
7363
+ },
7364
+ "limit": {
7365
+ "maximum": 20,
7366
+ "minimum": 1,
7367
+ "type": "integer"
7368
+ },
7369
+ "session": {
7370
+ "pattern": "^x-[a-f0-9]{64}$",
7371
+ "type": "string"
7372
+ }
7373
+ },
7374
+ "required": [
7375
+ "session"
7376
+ ],
7377
+ "type": "object"
7378
+ },
7379
+ "outputSchema": {
7380
+ "additionalProperties": false,
7381
+ "properties": {
7382
+ "first": {
7383
+ "minimum": 0,
7384
+ "type": "integer"
7385
+ },
7386
+ "session": {
7387
+ "additionalProperties": false,
7388
+ "properties": {
7389
+ "id": {
7390
+ "pattern": "^x-[a-f0-9]{64}$",
7391
+ "type": "string"
7392
+ },
7393
+ "inputOwner": {
7394
+ "const": "external"
7395
+ },
7396
+ "lastAt": {
7397
+ "type": "string"
7398
+ },
7399
+ "observedAt": {
7400
+ "type": "string"
7401
+ },
7402
+ "omittedTurns": {
7403
+ "minimum": 0,
7404
+ "type": "integer"
7405
+ },
7406
+ "problem": {
7407
+ "type": "string"
7408
+ },
7409
+ "producer": {
7410
+ "type": "string"
7411
+ },
7412
+ "sessionId": {
7413
+ "type": "string"
7414
+ },
7415
+ "sourceCursor": {
7416
+ "minimum": 0,
7417
+ "type": "integer"
7418
+ },
7419
+ "state": {
7420
+ "enum": [
7421
+ "running",
7422
+ "completed",
7423
+ "failed",
7424
+ "stopped",
7425
+ "unknown"
7426
+ ]
7427
+ },
7428
+ "title": {
7429
+ "type": "string"
7430
+ },
7431
+ "turns": {
7432
+ "minimum": 0,
7433
+ "type": "integer"
7434
+ }
7435
+ },
7436
+ "required": [
7437
+ "id",
7438
+ "producer",
7439
+ "sessionId",
7440
+ "title",
7441
+ "lastAt",
7442
+ "observedAt",
7443
+ "state",
7444
+ "turns",
7445
+ "sourceCursor",
7446
+ "omittedTurns",
7447
+ "inputOwner"
7448
+ ],
7449
+ "type": "object"
7450
+ },
7451
+ "turns": {
7452
+ "items": {
7453
+ "additionalProperties": false,
7454
+ "properties": {
7455
+ "at": {
7456
+ "type": "string"
7457
+ },
7458
+ "endedAt": {
7459
+ "type": "string"
7460
+ },
7461
+ "id": {
7462
+ "type": "string"
7463
+ },
7464
+ "messages": {
7465
+ "items": {
7466
+ "additionalProperties": false,
7467
+ "properties": {
7468
+ "at": {
7469
+ "type": "string"
7470
+ },
7471
+ "text": {
7472
+ "type": "string"
7473
+ }
7474
+ },
7475
+ "required": [
7476
+ "at",
7477
+ "text"
7478
+ ],
7479
+ "type": "object"
7480
+ },
7481
+ "maxItems": 200,
7482
+ "type": "array"
7483
+ },
7484
+ "omittedChars": {
7485
+ "minimum": 0,
7486
+ "type": "integer"
7487
+ },
7488
+ "omittedTools": {
7489
+ "minimum": 0,
7490
+ "type": "integer"
7491
+ },
7492
+ "prompt": {
7493
+ "type": "string"
7494
+ },
7495
+ "reply": {
7496
+ "type": "string"
7497
+ },
7498
+ "results": {
7499
+ "items": {
7500
+ "additionalProperties": false,
7501
+ "properties": {
7502
+ "id": {
7503
+ "type": "string"
7504
+ },
7505
+ "path": {
7506
+ "type": "string"
7507
+ },
7508
+ "projectId": {
7509
+ "type": "string"
7510
+ },
7511
+ "toolId": {
7512
+ "type": "string"
7513
+ },
7514
+ "version": {
7515
+ "type": "string"
7516
+ }
7517
+ },
7518
+ "required": [
7519
+ "path",
7520
+ "toolId"
7521
+ ],
7522
+ "type": "object"
7523
+ },
7524
+ "maxItems": 64,
7525
+ "type": "array"
7526
+ },
7527
+ "state": {
7528
+ "enum": [
7529
+ "running",
7530
+ "completed",
7531
+ "failed",
7532
+ "stopped",
7533
+ "unknown"
7534
+ ]
7535
+ },
7536
+ "tools": {
7537
+ "items": {
7538
+ "additionalProperties": false,
7539
+ "properties": {
7540
+ "at": {
7541
+ "type": "string"
7542
+ },
7543
+ "detail": {
7544
+ "type": "string"
7545
+ },
7546
+ "exitCode": {
7547
+ "type": "integer"
7548
+ },
7549
+ "id": {
7550
+ "type": "string"
7551
+ },
7552
+ "name": {
7553
+ "type": "string"
7554
+ },
7555
+ "outcome": {
7556
+ "enum": [
7557
+ "requested",
7558
+ "returned",
7559
+ "failed",
7560
+ "unknown"
7561
+ ]
7562
+ },
7563
+ "output": {
7564
+ "type": "string"
7565
+ },
7566
+ "paths": {
7567
+ "items": {
7568
+ "type": "string"
7569
+ },
7570
+ "maxItems": 32,
7571
+ "type": "array"
7572
+ }
7573
+ },
7574
+ "required": [
7575
+ "id",
7576
+ "at",
7577
+ "name",
7578
+ "detail",
7579
+ "output",
7580
+ "outcome",
7581
+ "paths"
7582
+ ],
7583
+ "type": "object"
7584
+ },
7585
+ "maxItems": 256,
7586
+ "type": "array"
7587
+ }
7588
+ },
7589
+ "required": [
7590
+ "id",
7591
+ "at",
7592
+ "state",
7593
+ "prompt",
7594
+ "reply",
7595
+ "messages",
7596
+ "tools",
7597
+ "results",
7598
+ "omittedTools",
7599
+ "omittedChars"
7600
+ ],
7601
+ "type": "object"
7602
+ },
7603
+ "maxItems": 20,
7604
+ "type": "array"
7605
+ }
7606
+ },
7607
+ "required": [
7608
+ "session",
7609
+ "first",
7610
+ "turns"
7611
+ ],
7612
+ "type": "object"
7613
+ },
7614
+ "requires": []
7615
+ },
7262
7616
  "binding.activity": {
7263
7617
  "effect": "read",
7264
7618
  "inputSchema": {
@@ -24849,17 +25203,17 @@ export const ownerContracts = {
24849
25203
  },
24850
25204
  "agent": {
24851
25205
  "package": "@rho-workspace/plugin-agent",
24852
- "packageVersion": "0.4.28",
25206
+ "packageVersion": "0.4.29",
24853
25207
  "entry": "./operations",
24854
25208
  "entryPath": "@rho-workspace/plugin-agent/dist/operations.js",
24855
- "entrySha256": "08bb1c852cb89a17a2e307831ed2df5d6d16cbccaaf2971ec251bb9a1a34261f",
25209
+ "entrySha256": "3fd6d6999950895852bea81e744e74a5c9104c8f97c2c90ff0d4dbd54a990a57",
24856
25210
  "exports": {
24857
- "operationContracts": "59b4465ecd7f62a59fc19c9bb49143c0c587fc9f3ca06839b8c73ee6dc9e8902"
25211
+ "operationContracts": "0286460194d99bf9ca79abd2a088317dad41f4dd3a7f3a02d75f047aed4238fb"
24858
25212
  }
24859
25213
  },
24860
25214
  "agent-feedback": {
24861
25215
  "package": "@rho-workspace/plugin-agent",
24862
- "packageVersion": "0.4.28",
25216
+ "packageVersion": "0.4.29",
24863
25217
  "entry": "./feedback-contract",
24864
25218
  "entryPath": "@rho-workspace/plugin-agent/dist/feedback-contract.js",
24865
25219
  "entrySha256": "ecb1561d92b5953d2b786d29cfb57f6f8085d214dc1dec76f6e7bd7a5257cb75",
@@ -24869,7 +25223,7 @@ export const ownerContracts = {
24869
25223
  },
24870
25224
  "agent-native": {
24871
25225
  "package": "@rho-workspace/plugin-agent",
24872
- "packageVersion": "0.4.28",
25226
+ "packageVersion": "0.4.29",
24873
25227
  "entry": "./contract",
24874
25228
  "entryPath": "@rho-workspace/plugin-agent/dist/contract.js",
24875
25229
  "entrySha256": "9e926081cb755a98d2b00d2a8488d8f4c6d25b3d5f1ec526d334ade633fe8a65",
@@ -24879,7 +25233,7 @@ export const ownerContracts = {
24879
25233
  },
24880
25234
  "agent-session": {
24881
25235
  "package": "@rho-workspace/plugin-agent",
24882
- "packageVersion": "0.4.28",
25236
+ "packageVersion": "0.4.29",
24883
25237
  "entry": "./session-contract",
24884
25238
  "entryPath": "@rho-workspace/plugin-agent/dist/session-contract.js",
24885
25239
  "entrySha256": "bb5b118f965e208617781af3e8ad6b6739869bcc19f0092eab14468824693123",
@@ -1,5 +1,6 @@
1
1
  import type { Principal, Project } from './state.js';
2
2
  import type { Plugins } from './plugins.js';
3
+ export declare const applicationEffects: Record<string, string>;
3
4
  export declare class Discovery {
4
5
  plugins: Plugins;
5
6
  project: Project;
package/dist/discovery.js CHANGED
@@ -3,11 +3,11 @@ import { Capabilities, rhoWorkspaceSkill } from './capabilities.js';
3
3
  import { protocol } from './protocol.js';
4
4
  import { schemaClosure } from './protocol-discovery.js';
5
5
  const size = (v) => Buffer.byteLength(JSON.stringify(v)) + 64;
6
- const applicationEffects = Object.fromEntries([
7
- ...['protocol.describe', 'protocol.validate', 'project.entries', 'capability.list', 'skill.list', 'skill.read', 'action.lookup', 'action.observe', 'action.output', 'action.list', 'composition.read', 'observation.snapshot', 'interaction.selection.read', 'workspace.observe', 'task.map.read'].map(m => [m, 'read']),
6
+ export const applicationEffects = Object.fromEntries([
7
+ ...['extension.list', 'extension.describe', 'extension.content', 'extension.read', 'protocol.describe', 'protocol.validate', 'project.entries', 'capability.list', 'skill.list', 'skill.read', 'action.lookup', 'action.observe', 'action.output', 'action.list', 'composition.read', 'observation.snapshot', 'interaction.selection.read', 'workspace.observe', 'task.map.read'].map(m => [m, 'read']),
8
8
  ...['composition.put', 'view.close', 'capability.configure', 'composition.apply', 'composition.undo', 'view.protection.set', 'interaction.selection.set', 'selection.set', 'workspace.enhance', 'task.map.declare', 'task.map.present', 'task.map.respond'].map(m => [m, 'metadata']),
9
9
  ...['workspace.save', 'workspace.export', 'workspace.restore', 'action.export'].map(m => [m, 'file']),
10
- ...['action.retry', 'action.cancel'].map(m => [m, 'native']),
10
+ ...['extension.call', 'extension.install', 'extension.manage', 'action.retry', 'action.cancel'].map(m => [m, 'native']),
11
11
  ]);
12
12
  const rhoSummary = 'The project in Rho: its folder\'s entries, managed runs, the views on the person\'s screen and what is selected in them, the task map, and which plugins are on.';
13
13
  const metadata = new Set(['capability.index', 'capability.resolve', 'binding.activity.append', 'task.routing.put', 'feedback.submit', 'view.observe', 'view.observations.read']);
@@ -0,0 +1,99 @@
1
+ export declare const extensionOperations: {
2
+ 'extension.list': {
3
+ type: string;
4
+ properties: Record<string, unknown>;
5
+ required: string[];
6
+ additionalProperties: boolean;
7
+ };
8
+ 'extension.describe': {
9
+ type: string;
10
+ properties: Record<string, unknown>;
11
+ required: string[];
12
+ additionalProperties: boolean;
13
+ };
14
+ 'extension.content': {
15
+ type: string;
16
+ properties: Record<string, unknown>;
17
+ required: string[];
18
+ additionalProperties: boolean;
19
+ };
20
+ 'extension.call': {
21
+ type: string;
22
+ properties: Record<string, unknown>;
23
+ required: string[];
24
+ additionalProperties: boolean;
25
+ };
26
+ 'extension.read': {
27
+ type: string;
28
+ properties: Record<string, unknown>;
29
+ required: string[];
30
+ additionalProperties: boolean;
31
+ };
32
+ 'extension.install': {
33
+ type: string;
34
+ properties: Record<string, unknown>;
35
+ required: string[];
36
+ additionalProperties: boolean;
37
+ };
38
+ 'extension.manage': {
39
+ type: string;
40
+ properties: Record<string, unknown>;
41
+ required: string[];
42
+ additionalProperties: boolean;
43
+ };
44
+ };
45
+ export declare const extensionResponses: {
46
+ 'extension.list': {
47
+ type: string;
48
+ properties: Record<string, unknown>;
49
+ required: string[];
50
+ additionalProperties: boolean;
51
+ };
52
+ 'extension.describe': {
53
+ type: string;
54
+ properties: Record<string, unknown>;
55
+ required: string[];
56
+ additionalProperties: boolean;
57
+ };
58
+ 'extension.install': {
59
+ type: string;
60
+ properties: Record<string, unknown>;
61
+ required: string[];
62
+ additionalProperties: boolean;
63
+ };
64
+ 'extension.content': {
65
+ type: string;
66
+ properties: Record<string, unknown>;
67
+ required: string[];
68
+ additionalProperties: boolean;
69
+ };
70
+ 'extension.call': {
71
+ type: string;
72
+ properties: Record<string, unknown>;
73
+ required: string[];
74
+ additionalProperties: boolean;
75
+ };
76
+ 'extension.read': {
77
+ type: string;
78
+ properties: Record<string, unknown>;
79
+ required: string[];
80
+ additionalProperties: boolean;
81
+ };
82
+ 'extension.manage': {
83
+ type: string;
84
+ properties: Record<string, unknown>;
85
+ required: string[];
86
+ additionalProperties: boolean;
87
+ };
88
+ };
89
+ export declare const extensionDescriptions: {
90
+ 'extension.list': string;
91
+ 'extension.describe': string;
92
+ 'extension.content': string;
93
+ 'extension.call': string;
94
+ 'extension.read': string;
95
+ 'extension.install': string;
96
+ 'extension.manage': string;
97
+ };
98
+ export declare const extensionManagement: string[];
99
+ export declare const extensionMethods: string[];
@@ -0,0 +1,52 @@
1
+ // Installed third-party packages are application assembly, independent of the
2
+ // functional owners compiled into Rho. This protocol never imports their code.
3
+ const str = { type: 'string', minLength: 1, maxLength: 1024 };
4
+ const id = { type: 'string', pattern: '^[a-z0-9][a-z0-9._-]{0,95}$' };
5
+ const sha = { type: 'string', pattern: '^[a-f0-9]{64}$' };
6
+ const object = (properties, required = Object.keys(properties)) => ({ type: 'object', properties, required, additionalProperties: false });
7
+ const json = { type: 'object', additionalProperties: true };
8
+ const project = { projectId: str };
9
+ const selected = { ...project, pluginId: id, expectedDigest: sha };
10
+ export const extensionOperations = {
11
+ 'extension.list': object(project, []),
12
+ 'extension.describe': object({ ...project, pluginId: id }),
13
+ 'extension.content': object({ ...selected, kind: { enum: ['skill', 'view'] }, entryId: id }),
14
+ 'extension.call': object({ ...selected, operation: id, input: json, changeId: { type: 'string', pattern: '^[A-Za-z0-9._:@-]{1,128}$' } }),
15
+ 'extension.read': object({ ...project, invocationId: sha }),
16
+ 'extension.install': object({ source: str, replace: id, expectedDigest: sha }, ['source']),
17
+ 'extension.manage': object({ pluginId: id, expectedDigest: sha, action: { enum: ['enable', 'disable', 'remove'] } }),
18
+ };
19
+ const array = (items) => ({ type: 'array', items });
20
+ const text = { type: 'string' };
21
+ const entry = { ...object({ id, title: text, file: text }), additionalProperties: true };
22
+ const manifest = { ...object({ apiVersion: { const: 1 }, id, title: text, description: text, host: text,
23
+ operations: array({ ...object({ id, title: text, description: text, effect: { enum: ['read', 'native'] }, methods: array(text), inputSchema: json }), additionalProperties: true }),
24
+ skills: array(entry), views: array(entry),
25
+ }, ['apiVersion', 'id', 'title', 'description', 'operations', 'skills', 'views']), additionalProperties: true };
26
+ const installed = { id, name: text, version: text, title: text, description: text, digest: sha, source: text, sourceCommit: text, enabled: { type: 'boolean' }, installedAt: text };
27
+ const installedRequired = Object.keys(installed).filter(key => key !== 'sourceCommit');
28
+ const descriptor = object({ ...installed, manifest }, [...installedRequired, 'manifest']);
29
+ const receipt = object({ invocationId: sha, caller: text, projectId: text, pluginId: id, packageDigest: sha, operation: id, requestDigest: sha,
30
+ state: { enum: ['pending', 'completed', 'unknown'] }, startedAt: text, endedAt: text, value: {}, error: text,
31
+ delegations: array(object({ method: text, request: {}, state: { enum: ['pending', 'completed', 'unknown'] }, value: {}, error: text }, ['method', 'request', 'state'])),
32
+ }, ['invocationId', 'caller', 'projectId', 'pluginId', 'packageDigest', 'operation', 'requestDigest', 'state', 'startedAt']);
33
+ export const extensionResponses = {
34
+ 'extension.list': object({ plugins: array(object(installed, installedRequired)), directory: array(object({ id, title: text, version: text, description: text, source: text, repository: text, needs: text })), limits: json }),
35
+ 'extension.describe': descriptor,
36
+ 'extension.install': descriptor,
37
+ 'extension.content': object({ pluginId: id, packageDigest: sha, entryId: id, kind: { enum: ['skill', 'view'] }, title: text, text }),
38
+ 'extension.call': receipt,
39
+ 'extension.read': receipt,
40
+ 'extension.manage': object({ pluginId: id, action: { enum: ['enable', 'disable', 'remove'] }, retained: text }),
41
+ };
42
+ export const extensionDescriptions = {
43
+ 'extension.list': 'List independently installed third-party packages and their enabled state, source and immutable digest. Reads start no plugin or runtime. Use extension.describe to discover operation schemas and Skills.',
44
+ 'extension.describe': 'Read an installed third-party package manifest, operation input schemas, required Rho methods, Skills and views. Read its Skill with extension.content before use. Disabled packages cannot run.',
45
+ 'extension.content': 'Read one installed plugin Skill or standalone HTML view at its selected package digest. Reading starts no plugin or runtime.',
46
+ 'extension.call': 'Call an enabled third-party operation at the described package digest, under the caller and project. The package runs trusted native code. Non-read calls retain the original changeId: repeat observes that invocation, including unknown outcomes, without re-execution. Completion is not scientific validity.',
47
+ 'extension.read': 'Observe an original plugin invocation, including pending or unknown outcomes. Never reruns code. Only its original caller can read it.',
48
+ 'extension.install': 'Local person/operator: install a trusted prebuilt npm package, local folder, tarball, or Git source. Lifecycle scripts are disabled. Replacement stages and checks the new package before switching; use replace and expectedDigest for updates.',
49
+ 'extension.manage': 'Local person/operator: enable, disable or remove an installed third-party package at the expected digest. Existing native tasks, R sessions, project files and retained receipts are preserved.',
50
+ };
51
+ export const extensionManagement = ['extension.install', 'extension.manage'];
52
+ export const extensionMethods = Object.keys(extensionOperations);
@@ -0,0 +1,9 @@
1
+ export declare const extensionDirectory: {
2
+ id: string;
3
+ title: string;
4
+ version: string;
5
+ description: string;
6
+ source: string;
7
+ repository: string;
8
+ needs: string;
9
+ }[];
@@ -0,0 +1,11 @@
1
+ // Optional discovery, not a registration requirement. Packages keep their own
2
+ // repositories/releases; an entry records the source a maintainer actually checked.
3
+ export const extensionDirectory = [
4
+ {
5
+ id: 'yulab.sclet', title: 'sclet', version: '0.1.0',
6
+ description: 'State-aware single-cell analysis using sclet in your shared R Notebook.',
7
+ source: 'git+https://github.com/YuLab-SMU/Rho-plugins.git#82df99f8cbab868c30949692172c6cf11db2f5c0:examples/sclet-plugin',
8
+ repository: 'https://github.com/YuLab-SMU/Rho-plugins/tree/82df99f8cbab868c30949692172c6cf11db2f5c0/examples/sclet-plugin',
9
+ needs: 'R, sclet, SingleCellExperiment and jsonlite in the selected R environment.',
10
+ },
11
+ ];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ // A process boundary for crashes/timeouts, NOT an OS sandbox. An installed host
2
+ // has this user's native permissions. Never send it service credentials.
3
+ import { pathToFileURL } from 'node:url';
4
+ const pending = new Map();
5
+ let next = 0;
6
+ process.on('message', async (message) => {
7
+ if (message.type === 'reply') {
8
+ const waiter = pending.get(message.id);
9
+ pending.delete(message.id);
10
+ if (message.error)
11
+ waiter?.reject(new Error(message.error));
12
+ else
13
+ waiter?.resolve(message.value);
14
+ }
15
+ if (message.type !== 'start')
16
+ return;
17
+ try {
18
+ const plugin = await import(pathToFileURL(message.entry).href);
19
+ if (typeof plugin.run !== 'function')
20
+ throw new Error('The plugin host must export run(operation, input, context).');
21
+ const value = await plugin.run(message.operation, message.input, {
22
+ projectRoot: message.projectRoot,
23
+ invocationId: message.invocationId,
24
+ changeId: (label) => 'ext:' + message.invocationId + ':' + String(label).slice(0, 40),
25
+ call: (method, body) => new Promise((resolve, reject) => {
26
+ const id = ++next;
27
+ pending.set(id, { resolve, reject });
28
+ process.send?.({ type: 'call', id, method, body });
29
+ }),
30
+ });
31
+ process.send?.({ type: 'result', value }, () => process.exit(0));
32
+ }
33
+ catch (error) {
34
+ process.send?.({ type: 'error', error: error instanceof Error ? error.message : String(error) }, () => process.exit(1));
35
+ }
36
+ });