@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.
- package/dist/browser-access.js +3 -2
- package/dist/capabilities.d.ts +2 -2
- package/dist/capabilities.js +6 -1
- package/dist/cli.js +186 -173
- package/dist/contract.generated.d.ts +329 -4
- package/dist/contract.generated.js +1 -1
- package/dist/contracts/owners.generated.js +360 -6
- 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/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-work.d.ts +3 -1
- package/dist/project-work.js +15 -2
- package/dist/protocol.d.ts +7 -0
- package/dist/protocol.js +4 -2
- package/dist/server.d.ts +4 -1
- package/dist/server.js +55 -8
- package/dist/web/.vite/manifest.json +61 -61
- 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-Dbdo-5oO.js → console-BSjLGe0T.js} +1 -1
- package/dist/web/assets/{dist-B2V0VDO0.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-D25Vn17i.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-BHQIaDsx.js → index-CxmItXqa.js} +85 -85
- package/dist/web/assets/{notes-meaning-DdPbtNzJ.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-CmWou4Iv.js → review-CMxQlQ-C.js} +1 -1
- package/dist/web/assets/{skills-Dy7n3L9d.js → skills-BFNSyrnD.js} +1 -1
- package/dist/web/assets/{skills-work-Cj0W6b-I.js → skills-work-BGPSnF_I.js} +1 -1
- package/dist/web/assets/{studio-process-QOY_n2_8.js → studio-process-CsRoTHOh.js} +2 -2
- package/dist/web/assets/{timeline-events-DmX1BCh3.js → timeline-events-BbuuFWHV.js} +1 -1
- package/dist/web/assets/{work-turns-Co0C71rJ.js → work-turns-BvJlIMmA.js} +1 -1
- package/dist/web/assets/workspace-CWlkjLNx.js +5 -0
- package/dist/web/composition.json +67 -67
- 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/HEADLESS.md +1 -1
- package/docs/PLUGIN-AUTHORING.md +4 -0
- package/docs/THIRD-PARTY-PLUGINS.md +190 -0
- package/node_modules/@rho-workspace/plugin-agent/README.md +39 -0
- 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/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/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/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/package.json +5 -3
- package/protocol/index.json +58 -4
- package/protocol/operations/agent.sessions.list.json +100 -0
- package/protocol/operations/agent.sessions.read.json +266 -0
- 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/project.work.read.json +3 -2
- package/protocol/operations/session.grant.json +9 -0
- package/scripts/third-party-acceptance.mjs +77 -0
- package/vendor/composition.json +85 -85
- package/vendor/rho-workspace-plugin-agent-0.4.29.tgz +0 -0
- package/dist/web/assets/choices-DU9kHlyQ.js +0 -1
- package/dist/web/assets/dist-BV3hWfn_.js +0 -3
- package/dist/web/assets/dist-CLNF2g-E.js +0 -1
- package/dist/web/assets/explore-in-8Q5ftt-E.js +0 -1
- package/dist/web/assets/graph-hS2kvHTI.js +0 -2
- package/dist/web/assets/index-Cj1_iqyK.css +0 -1
- package/dist/web/assets/overview-BV6ZO5TO.js +0 -6
- package/dist/web/assets/preview-n5lOOdjN.js +0 -1
- package/dist/web/assets/workspace-BKFefRfJ.js +0 -5
- package/vendor/rho-workspace-plugin-agent-0.4.28.tgz +0 -0
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
]
|
|
254
254
|
},
|
|
255
255
|
"../node_modules/@codemirror/lang-markdown/dist/index.js": {
|
|
256
|
-
"file": "assets/dist-
|
|
256
|
+
"file": "assets/dist-Buk0lwzI.js",
|
|
257
257
|
"name": "dist",
|
|
258
258
|
"src": "../node_modules/@codemirror/lang-markdown/dist/index.js",
|
|
259
259
|
"isDynamicEntry": true,
|
|
@@ -261,22 +261,22 @@
|
|
|
261
261
|
"index.html",
|
|
262
262
|
"_dist-DCtcCJPs.js",
|
|
263
263
|
"../node_modules/@codemirror/language/dist/index.js",
|
|
264
|
-
"_dist-
|
|
264
|
+
"_dist-Cw8hRIlT.js"
|
|
265
265
|
]
|
|
266
266
|
},
|
|
267
267
|
"../node_modules/@codemirror/lang-python/dist/index.js": {
|
|
268
|
-
"file": "assets/dist-
|
|
268
|
+
"file": "assets/dist-foH9IKc6.js",
|
|
269
269
|
"name": "dist",
|
|
270
270
|
"src": "../node_modules/@codemirror/lang-python/dist/index.js",
|
|
271
271
|
"isDynamicEntry": true,
|
|
272
272
|
"imports": [
|
|
273
273
|
"_dist-DCtcCJPs.js",
|
|
274
274
|
"../node_modules/@codemirror/language/dist/index.js",
|
|
275
|
-
"_dist-
|
|
275
|
+
"_dist-Cw8hRIlT.js"
|
|
276
276
|
]
|
|
277
277
|
},
|
|
278
278
|
"../node_modules/@codemirror/language/dist/index.js": {
|
|
279
|
-
"file": "assets/dist-
|
|
279
|
+
"file": "assets/dist-Tzoe_zm-.js",
|
|
280
280
|
"name": "dist",
|
|
281
281
|
"src": "../node_modules/@codemirror/language/dist/index.js",
|
|
282
282
|
"isDynamicEntry": true,
|
|
@@ -295,8 +295,8 @@
|
|
|
295
295
|
"file": "assets/answer-board-CBkGbSLD.js",
|
|
296
296
|
"name": "answer-board"
|
|
297
297
|
},
|
|
298
|
-
"_canvas-
|
|
299
|
-
"file": "assets/canvas-
|
|
298
|
+
"_canvas-D8rDdfDz.js": {
|
|
299
|
+
"file": "assets/canvas-D8rDdfDz.js",
|
|
300
300
|
"name": "canvas",
|
|
301
301
|
"imports": [
|
|
302
302
|
"_rolldown-runtime-XKyaHtl9.js",
|
|
@@ -308,44 +308,44 @@
|
|
|
308
308
|
"file": "assets/choices-DLah50GC.css",
|
|
309
309
|
"src": "_choices-DLah50GC.css"
|
|
310
310
|
},
|
|
311
|
-
"_choices-
|
|
312
|
-
"file": "assets/choices-
|
|
311
|
+
"_choices-b0XhrGQV.js": {
|
|
312
|
+
"file": "assets/choices-b0XhrGQV.js",
|
|
313
313
|
"name": "choices",
|
|
314
314
|
"imports": [
|
|
315
315
|
"_rolldown-runtime-XKyaHtl9.js",
|
|
316
316
|
"_react-Dss-ouuy.js",
|
|
317
317
|
"_markdown-0ngRuTpW.js",
|
|
318
|
-
"_canvas-
|
|
318
|
+
"_canvas-D8rDdfDz.js",
|
|
319
319
|
"index.html",
|
|
320
|
-
"_notes-meaning-
|
|
320
|
+
"_notes-meaning-pVbbQUGP.js"
|
|
321
321
|
],
|
|
322
322
|
"css": [
|
|
323
323
|
"assets/choices-DLah50GC.css"
|
|
324
324
|
]
|
|
325
325
|
},
|
|
326
|
-
"_console-
|
|
327
|
-
"file": "assets/console-
|
|
328
|
-
"src": "_console-By4Mvn1y.css"
|
|
329
|
-
},
|
|
330
|
-
"_console-Dbdo-5oO.js": {
|
|
331
|
-
"file": "assets/console-Dbdo-5oO.js",
|
|
326
|
+
"_console-BSjLGe0T.js": {
|
|
327
|
+
"file": "assets/console-BSjLGe0T.js",
|
|
332
328
|
"name": "console",
|
|
333
329
|
"imports": [
|
|
334
330
|
"_rolldown-runtime-XKyaHtl9.js",
|
|
335
331
|
"_react-Dss-ouuy.js",
|
|
336
332
|
"_home-CCbP6kS-.js",
|
|
337
333
|
"_markdown-0ngRuTpW.js",
|
|
338
|
-
"_canvas-
|
|
334
|
+
"_canvas-D8rDdfDz.js",
|
|
339
335
|
"index.html",
|
|
340
336
|
"_facts-BMO6V3-3.js",
|
|
341
|
-
"_work-turns-
|
|
337
|
+
"_work-turns-BvJlIMmA.js"
|
|
342
338
|
],
|
|
343
339
|
"css": [
|
|
344
340
|
"assets/console-By4Mvn1y.css"
|
|
345
341
|
]
|
|
346
342
|
},
|
|
347
|
-
"
|
|
348
|
-
"file": "assets/
|
|
343
|
+
"_console-By4Mvn1y.css": {
|
|
344
|
+
"file": "assets/console-By4Mvn1y.css",
|
|
345
|
+
"src": "_console-By4Mvn1y.css"
|
|
346
|
+
},
|
|
347
|
+
"_dist-Cw8hRIlT.js": {
|
|
348
|
+
"file": "assets/dist-Cw8hRIlT.js",
|
|
349
349
|
"name": "dist",
|
|
350
350
|
"imports": [
|
|
351
351
|
"index.html",
|
|
@@ -360,8 +360,8 @@
|
|
|
360
360
|
"_rolldown-runtime-XKyaHtl9.js"
|
|
361
361
|
]
|
|
362
362
|
},
|
|
363
|
-
"_explore-in-
|
|
364
|
-
"file": "assets/explore-in-
|
|
363
|
+
"_explore-in-BVUy3ZW_.js": {
|
|
364
|
+
"file": "assets/explore-in-BVUy3ZW_.js",
|
|
365
365
|
"name": "explore-in",
|
|
366
366
|
"imports": [
|
|
367
367
|
"_react-Dss-ouuy.js",
|
|
@@ -402,8 +402,8 @@
|
|
|
402
402
|
"_react-Dss-ouuy.js"
|
|
403
403
|
]
|
|
404
404
|
},
|
|
405
|
-
"_notes-meaning-
|
|
406
|
-
"file": "assets/notes-meaning-
|
|
405
|
+
"_notes-meaning-pVbbQUGP.js": {
|
|
406
|
+
"file": "assets/notes-meaning-pVbbQUGP.js",
|
|
407
407
|
"name": "notes-meaning",
|
|
408
408
|
"imports": [
|
|
409
409
|
"index.html"
|
|
@@ -420,8 +420,8 @@
|
|
|
420
420
|
"file": "assets/rolldown-runtime-XKyaHtl9.js",
|
|
421
421
|
"name": "rolldown-runtime"
|
|
422
422
|
},
|
|
423
|
-
"_skills-work-
|
|
424
|
-
"file": "assets/skills-work-
|
|
423
|
+
"_skills-work-BGPSnF_I.js": {
|
|
424
|
+
"file": "assets/skills-work-BGPSnF_I.js",
|
|
425
425
|
"name": "skills-work",
|
|
426
426
|
"imports": [
|
|
427
427
|
"_rolldown-runtime-XKyaHtl9.js",
|
|
@@ -439,8 +439,8 @@
|
|
|
439
439
|
"_react-Dss-ouuy.js"
|
|
440
440
|
]
|
|
441
441
|
},
|
|
442
|
-
"_timeline-events-
|
|
443
|
-
"file": "assets/timeline-events-
|
|
442
|
+
"_timeline-events-BbuuFWHV.js": {
|
|
443
|
+
"file": "assets/timeline-events-BbuuFWHV.js",
|
|
444
444
|
"name": "timeline-events",
|
|
445
445
|
"imports": [
|
|
446
446
|
"_rolldown-runtime-XKyaHtl9.js",
|
|
@@ -448,8 +448,8 @@
|
|
|
448
448
|
"index.html"
|
|
449
449
|
]
|
|
450
450
|
},
|
|
451
|
-
"_work-turns-
|
|
452
|
-
"file": "assets/work-turns-
|
|
451
|
+
"_work-turns-BvJlIMmA.js": {
|
|
452
|
+
"file": "assets/work-turns-BvJlIMmA.js",
|
|
453
453
|
"name": "work-turns",
|
|
454
454
|
"imports": [
|
|
455
455
|
"_rolldown-runtime-XKyaHtl9.js",
|
|
@@ -458,7 +458,7 @@
|
|
|
458
458
|
]
|
|
459
459
|
},
|
|
460
460
|
"graph.tsx": {
|
|
461
|
-
"file": "assets/graph-
|
|
461
|
+
"file": "assets/graph-1OdIJ9l7.js",
|
|
462
462
|
"name": "graph",
|
|
463
463
|
"src": "graph.tsx",
|
|
464
464
|
"isDynamicEntry": true,
|
|
@@ -466,19 +466,19 @@
|
|
|
466
466
|
"_rolldown-runtime-XKyaHtl9.js",
|
|
467
467
|
"_react-Dss-ouuy.js",
|
|
468
468
|
"_markdown-0ngRuTpW.js",
|
|
469
|
-
"_canvas-
|
|
469
|
+
"_canvas-D8rDdfDz.js",
|
|
470
470
|
"index.html",
|
|
471
|
-
"_work-turns-
|
|
471
|
+
"_work-turns-BvJlIMmA.js",
|
|
472
472
|
"_snapshot-CAxBYPvV.js",
|
|
473
|
-
"_timeline-events-
|
|
474
|
-
"_choices-
|
|
473
|
+
"_timeline-events-BbuuFWHV.js",
|
|
474
|
+
"_choices-b0XhrGQV.js"
|
|
475
475
|
],
|
|
476
476
|
"css": [
|
|
477
477
|
"assets/graph-BYKN84J3.css"
|
|
478
478
|
]
|
|
479
479
|
},
|
|
480
480
|
"index.html": {
|
|
481
|
-
"file": "assets/index-
|
|
481
|
+
"file": "assets/index-CxmItXqa.js",
|
|
482
482
|
"name": "index",
|
|
483
483
|
"src": "index.html",
|
|
484
484
|
"isEntry": true,
|
|
@@ -487,7 +487,7 @@
|
|
|
487
487
|
"_react-Dss-ouuy.js",
|
|
488
488
|
"_home-CCbP6kS-.js",
|
|
489
489
|
"_markdown-0ngRuTpW.js",
|
|
490
|
-
"_canvas-
|
|
490
|
+
"_canvas-D8rDdfDz.js"
|
|
491
491
|
],
|
|
492
492
|
"dynamicImports": [
|
|
493
493
|
"_dist-DCtcCJPs.js",
|
|
@@ -501,17 +501,17 @@
|
|
|
501
501
|
"overview.tsx",
|
|
502
502
|
"preview.tsx",
|
|
503
503
|
"graph.tsx",
|
|
504
|
-
"_console-
|
|
504
|
+
"_console-BSjLGe0T.js",
|
|
505
505
|
"index.html",
|
|
506
506
|
"skills.tsx",
|
|
507
507
|
"studio-process.tsx"
|
|
508
508
|
],
|
|
509
509
|
"css": [
|
|
510
|
-
"assets/index-
|
|
510
|
+
"assets/index-CsC3sTRq.css"
|
|
511
511
|
]
|
|
512
512
|
},
|
|
513
513
|
"overview.tsx": {
|
|
514
|
-
"file": "assets/overview-
|
|
514
|
+
"file": "assets/overview-B9UtVJ32.js",
|
|
515
515
|
"name": "overview",
|
|
516
516
|
"src": "overview.tsx",
|
|
517
517
|
"isDynamicEntry": true,
|
|
@@ -520,13 +520,13 @@
|
|
|
520
520
|
"_react-Dss-ouuy.js",
|
|
521
521
|
"_home-CCbP6kS-.js",
|
|
522
522
|
"_markdown-0ngRuTpW.js",
|
|
523
|
-
"_canvas-
|
|
523
|
+
"_canvas-D8rDdfDz.js",
|
|
524
524
|
"index.html",
|
|
525
525
|
"_facts-BMO6V3-3.js",
|
|
526
|
-
"_work-turns-
|
|
527
|
-
"_choices-
|
|
528
|
-
"_skills-work-
|
|
529
|
-
"_explore-in-
|
|
526
|
+
"_work-turns-BvJlIMmA.js",
|
|
527
|
+
"_choices-b0XhrGQV.js",
|
|
528
|
+
"_skills-work-BGPSnF_I.js",
|
|
529
|
+
"_explore-in-BVUy3ZW_.js",
|
|
530
530
|
"_answer-board-CBkGbSLD.js"
|
|
531
531
|
],
|
|
532
532
|
"dynamicImports": [
|
|
@@ -537,7 +537,7 @@
|
|
|
537
537
|
]
|
|
538
538
|
},
|
|
539
539
|
"preview.tsx": {
|
|
540
|
-
"file": "assets/preview-
|
|
540
|
+
"file": "assets/preview-CksD_5KS.js",
|
|
541
541
|
"name": "preview",
|
|
542
542
|
"src": "preview.tsx",
|
|
543
543
|
"isDynamicEntry": true,
|
|
@@ -545,13 +545,13 @@
|
|
|
545
545
|
"_rolldown-runtime-XKyaHtl9.js",
|
|
546
546
|
"_react-Dss-ouuy.js",
|
|
547
547
|
"_markdown-0ngRuTpW.js",
|
|
548
|
-
"_canvas-
|
|
548
|
+
"_canvas-D8rDdfDz.js",
|
|
549
549
|
"index.html",
|
|
550
|
-
"_explore-in-
|
|
550
|
+
"_explore-in-BVUy3ZW_.js"
|
|
551
551
|
]
|
|
552
552
|
},
|
|
553
553
|
"review.tsx": {
|
|
554
|
-
"file": "assets/review-
|
|
554
|
+
"file": "assets/review-CMxQlQ-C.js",
|
|
555
555
|
"name": "review",
|
|
556
556
|
"src": "review.tsx",
|
|
557
557
|
"isDynamicEntry": true,
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
]
|
|
565
565
|
},
|
|
566
566
|
"shell/workspace.tsx": {
|
|
567
|
-
"file": "assets/workspace-
|
|
567
|
+
"file": "assets/workspace-CWlkjLNx.js",
|
|
568
568
|
"name": "workspace",
|
|
569
569
|
"src": "shell/workspace.tsx",
|
|
570
570
|
"isDynamicEntry": true,
|
|
@@ -572,16 +572,16 @@
|
|
|
572
572
|
"_rolldown-runtime-XKyaHtl9.js",
|
|
573
573
|
"_react-Dss-ouuy.js",
|
|
574
574
|
"_markdown-0ngRuTpW.js",
|
|
575
|
-
"_canvas-
|
|
575
|
+
"_canvas-D8rDdfDz.js",
|
|
576
576
|
"index.html",
|
|
577
|
-
"_console-
|
|
577
|
+
"_console-BSjLGe0T.js",
|
|
578
578
|
"_facts-BMO6V3-3.js",
|
|
579
579
|
"_snapshot-CAxBYPvV.js",
|
|
580
|
-
"_explore-in-
|
|
580
|
+
"_explore-in-BVUy3ZW_.js"
|
|
581
581
|
]
|
|
582
582
|
},
|
|
583
583
|
"skills.tsx": {
|
|
584
|
-
"file": "assets/skills-
|
|
584
|
+
"file": "assets/skills-BFNSyrnD.js",
|
|
585
585
|
"name": "skills",
|
|
586
586
|
"src": "skills.tsx",
|
|
587
587
|
"isDynamicEntry": true,
|
|
@@ -591,14 +591,14 @@
|
|
|
591
591
|
"_home-CCbP6kS-.js",
|
|
592
592
|
"_markdown-0ngRuTpW.js",
|
|
593
593
|
"index.html",
|
|
594
|
-
"_skills-work-
|
|
594
|
+
"_skills-work-BGPSnF_I.js"
|
|
595
595
|
],
|
|
596
596
|
"css": [
|
|
597
597
|
"assets/skills-WkE0KCzn.css"
|
|
598
598
|
]
|
|
599
599
|
},
|
|
600
600
|
"studio-process.tsx": {
|
|
601
|
-
"file": "assets/studio-process-
|
|
601
|
+
"file": "assets/studio-process-CsRoTHOh.js",
|
|
602
602
|
"name": "studio-process",
|
|
603
603
|
"src": "studio-process.tsx",
|
|
604
604
|
"isDynamicEntry": true,
|
|
@@ -606,11 +606,11 @@
|
|
|
606
606
|
"_rolldown-runtime-XKyaHtl9.js",
|
|
607
607
|
"_react-Dss-ouuy.js",
|
|
608
608
|
"_markdown-0ngRuTpW.js",
|
|
609
|
-
"_canvas-
|
|
609
|
+
"_canvas-D8rDdfDz.js",
|
|
610
610
|
"index.html",
|
|
611
|
-
"_console-
|
|
612
|
-
"_timeline-events-
|
|
613
|
-
"_notes-meaning-
|
|
611
|
+
"_console-BSjLGe0T.js",
|
|
612
|
+
"_timeline-events-BbuuFWHV.js",
|
|
613
|
+
"_notes-meaning-pVbbQUGP.js",
|
|
614
614
|
"_answer-board-CBkGbSLD.js",
|
|
615
615
|
"shell/workspace.tsx"
|
|
616
616
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-Dss-ouuy.js";import{c as n}from"./home-CCbP6kS-.js";var r=e(t(),1),i=new Map(Object.entries({data:`csv.tsv.tab.xlsx.xls.json.parquet.feather.arrow.rds.rda.rdata.h5.h5ad.hdf5.loom.mtx.sav.dta.sas7bdat.fasta.fa.fastq.fq.bam.sam.vcf.bed.gtf.gff.gff3.nwk.tre.newick`.split(`.`),code:`r.rmd.qmd.py.ipynb.sh.bash.zsh.jl.sql.js.mjs.ts.stan.smk.nf.wdl.cpp.c.h.rs.go.java.pl.awk.sas.do.m`.split(`.`),figures:[`png`,`jpg`,`jpeg`,`svg`,`pdf`,`gif`,`tif`,`tiff`,`webp`,`eps`],notes:[`md`,`markdown`,`txt`,`rst`,`org`,`tex`,`bib`,`docx`,`html`]}).flatMap(([e,t])=>t.map(t=>[t,e]))),a=new Set([`results`,`result`,`output`,`outputs`,`out`,`figures`,`figs`,`plots`,`reports`]);function o(e){let t=e.split(`/`),n=t.at(-1).toLowerCase().split(`.`);n.length>2&&[`gz`,`bz2`,`xz`,`zst`].includes(n.at(-1))&&n.pop();let r=n.length>1?i.get(n.at(-1))??null:null;return r===`data`&&t.slice(0,-1).some(e=>a.has(e.toLowerCase()))?`results`:r}var s=e=>/\.(csv|png|jpe?g|svg)$/i.test(e),c=new Set([`node_modules`,`renv`,`packrat`,`__pycache__`,`venv`,`.venv`,`site-library`,`.ipynb_checkpoints`,`.Rproj.user`,`.snakemake`,`.nextflow`]),l={maxFolders:48,maxDepth:5,maxFiles:4e3};async function u(e,t,n){let r=[],i=[{path:``,depth:0}],a=0,s=!1;for(;i.length;){if(n.aborted)throw new DOMException(`aborted`,`AbortError`);if(a>=l.maxFolders){s=!0;break}let u=i.shift();a++;let d=await e.call(`project.entries`,{projectId:t,...u.path?{path:u.path}:{}},n);d.truncated&&(s=!0);for(let e of d.entries)if(!e.hidden){if(e.kind===`folder`){if(c.has(e.name))continue;if(u.depth+1>l.maxDepth){s=!0;continue}i.push({path:e.path,depth:u.depth+1})}else{if(r.length>=l.maxFiles){s=!0;break}r.push({...e,category:o(e.path)})}}}return{files:r,truncated:s}}function d(e,t,n){let[i,a]=(0,r.useState)({files:[],truncated:!1,reading:!1,problem:``,readAt:0}),[o,s]=(0,r.useState)(0),c=(0,r.useRef)(0),l=(0,r.useRef)(void 0),[d,f]=(0,r.useState)(0);return(0,r.useEffect)(()=>{a({files:[],truncated:!1,reading:!1,problem:``,readAt:0}),c.current=0},[t]),(0,r.useEffect)(()=>{if(!t)return;let e=Math.max(0,c.current+5e3-Date.now());return clearTimeout(l.current),l.current=setTimeout(()=>f(e=>e+1),e),()=>clearTimeout(l.current)},[t,n,o]),(0,r.useEffect)(()=>{if(!t||!d)return;let n=new AbortController;return c.current=Date.now(),a(e=>({...e,reading:!0})),u(e,t,n.signal).then(e=>a({...e,reading:!1,problem:``,readAt:Date.now()}),e=>{n.signal.aborted||a(t=>({...t,reading:!1,problem:e instanceof Error?e.message:`The project folder could not be read.`}))}),()=>n.abort()},[e,t,d]),{...i,refresh:()=>{c.current=0,s(e=>e+1)}}}var f=[`data`,`code`,`results`,`notes`],p=[`data`,`code`,`workflows`,`results`,`reports`,`notes`,`references`,`environment`],ee=new Set([`renv.lock`,`description`,`environment.yml`,`environment.yaml`,`pyproject.toml`,`setup.py`,`setup.cfg`,`pipfile`,`pipfile.lock`,`poetry.lock`,`uv.lock`,`conda-lock.yml`,`dockerfile`,`containerfile`,`apptainer.def`,`singularity.def`,`install.r`,`project.toml`,`manifest.toml`]),te=new Set([`snakefile`,`makefile`,`gnumakefile`,`justfile`,`_targets.r`,`nextflow.config`,`dvc.yaml`]),ne=new Set([`refs`,`references`,`literature`,`papers`,`reading`,`bibliography`]),m=e=>e.toLowerCase().replace(/\.[^./]+$/,``),re=e=>new Set(e.filter(e=>/\.(rmd|qmd|rnw)$/i.test(e.path)).map(e=>m(e.path))),ie=e=>new Set(e.filter(e=>/\.html?$/i.test(e.path)).map(e=>e.path.toLowerCase().split(`/`).slice(0,-1).join(`/`))),ae=/^[a-z][\w.]*(-[a-z][\w.]*)*-\d+(\.\d+)+$/,oe=/^(lib|libs|site_libs|.+_files)$/;function se(e,t,n=new Set){let r=e.path.toLowerCase().split(`/`),i=r.at(-1),a=i.includes(`.`)?i.split(`.`).at(-1):``;return r.slice(0,-1).some((e,n)=>e.endsWith(`_files`)&&t.has([...r.slice(0,n),e.slice(0,-6)].join(`/`)))||r.slice(0,-1).some((e,t)=>t>0&&ae.test(e)&&oe.test(r[t-1])&&n.has(r.slice(0,t-1).join(`/`)))?null:ee.has(i)||/^requirements([-_.][^/]*)?\.txt$/.test(i)||a===`rproj`?`environment`:te.has(i)||[`smk`,`nf`,`wdl`,`cwl`].includes(a)?`workflows`:[`rmd`,`qmd`,`rnw`].includes(a)||[`html`,`pdf`,`docx`].includes(a)&&t.has(m(e.path))?`reports`:[`bib`,`ris`,`nbib`,`enw`].includes(a)||a===`pdf`&&r.slice(0,-1).some(e=>ne.has(e))?`references`:e.category===`figures`||e.category===`results`?`results`:e.category}var h=e=>e.split(`/`).filter(Boolean).at(-1)??e;function g(e,t){let n=e.split(`/`);if(n.pop(),!n.length)return t.name??h(t.root);let r=n[0].startsWith(`@`)?t.sources?.find(e=>`@`+e.id===n[0]):void 0;return[r?r.name:n[0],...n.slice(1)].join(`/`)}var _=e=>![`current-filesystem-observation`,`captured-observation`].includes(e.provenance?.source??``),v=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function y(e,t,n,r,i=[]){let a=new Map,o=new Map(i.map(e=>[e.operationId,e.acceptedAt])),s=e=>o.get(String(e.provenance?.operationId??``))??``,c=new Map;if(e===`results`)for(let e of n){let t=c.get(e.path);_(e)&&(!t||s(e).localeCompare(s(t))>0||s(e)===s(t)&&e.version.localeCompare(t.version)>0)&&c.set(e.path,e)}for(let e of c.values())a.set(e.path,{key:`result:`+e.path,path:e.path,name:h(e.path),folder:g(e.path,r),bytes:e.bytes??null,category:e.kind===`media`?`figures`:`results`,resource:{id:e.id,version:e.version,kind:e.kind,path:e.path}});let l=re(t),u=ie(t);for(let n of t)se(n,l,u)===e&&!a.has(n.path)&&a.set(n.path,{key:`file:`+n.path,path:n.path,name:n.name,folder:g(n.path,r),bytes:n.bytes,category:n.category});let d=e=>Number(e.path.includes(`/`));return[...a.values()].sort((e,t)=>d(e)-d(t)||v.compare(e.folder,t.folder)||v.compare(e.name,t.name))}function ce(e){let t=new Set(e.views.map(e=>e.id)),n=new Set,r=new Map((e.nodes??[]).map(e=>[e.id,e])),i=e=>{let n=r.get(e);return n?n.kind===`view`?t.has(n.id)?[n.id]:[]:n.children.flatMap(i):[]},a=e=>{let o=r.get(e);if(!o)return null;if(o.kind===`view`)return t.has(o.id)?(n.add(o.id),{kind:`tabs`,id:`tabs:`+o.id,views:[o.id]}):null;let s=o.presentation?.mode===`split`?o.presentation:null;if(s){let e=o.children.map((e,t)=>({region:a(e),weight:s.weights[t]??1})).filter(e=>e.region);return e.length?e.length===1?e[0].region:{kind:`split`,id:o.id,axis:s.axis,weights:e.map(e=>e.weight),children:e.map(e=>e.region)}:null}let c=i(o.id);return c.forEach(e=>n.add(e)),c.length?{kind:`tabs`,id:o.id,views:c}:null},o=e.rootId&&r.size?a(e.rootId):null,s=e.views.map(e=>e.id).filter(e=>!n.has(e));if(!s.length)return o;if(!o)return{kind:`tabs`,id:`tabs:root`,views:s};let c=b(o),l=c[c.length-1];return o=x(o,l.id,{...l,views:[...l.views,...s]}),o}function b(e){return e.kind===`tabs`?[e]:e.children.flatMap(b)}function le(e){return e?b(e).flatMap(e=>e.views):[]}function ue(e,t){return e?b(e).find(e=>e.views.includes(t))??null:null}function x(e,t,n){return e.id===t?n:e.kind===`split`?{...e,children:e.children.map(e=>x(e,t,n))}:e}function S(e,t,n,r=.12){let i=e.reduce((e,t)=>e+t,0),a=[...e],o=i*r,s=a[t]+a[t+1],c=Math.min(s-o,Math.max(o,a[t]+n*i));return a[t]=c,a[t+1]=s-c,a}function de(e){let t=e.bindings?.data,n=e=>e.replace(/[^A-Za-z0-9._-]/g,`_`).slice(0,40);return typeof t?.id==`string`&&typeof t.version==`string`?{kind:`shared`,id:`linked:${n(t.id)}@${n(t.version)}`}:{kind:`shared`,id:e.id}}var C=e=>e?.presentation?.mode===`split`,w=(e,t)=>e.find(e=>e.kind===`group`&&e.children?.includes(t));function T(e,t){let n=t;for(;;){let t=w(e,n);if(!t||C(t))return n;n=t.id}}function E(e,t){let n=e.find(e=>e.id===t);return n?n.kind===`view`?[t]:(n.children??[]).flatMap(t=>E(e,t)):[]}function D(e){let t=e.nodes,n=e.rootId;for(let e=!0;e;){e=!1;for(let r of t){if(r.kind!==`group`||r.id===n)continue;let i=w(t,r.id);if(!r.children?.length){let n=i.children.indexOf(r.id);i.children=i.children.filter(e=>e!==r.id),C(i)&&(i.presentation={...i.presentation,weights:(i.presentation.weights??[]).filter((e,t)=>t!==n)}),t=t.filter(e=>e.id!==r.id),e=!0;break}if(C(r)&&r.children.length===1){let n=r.children[0];i.children=i.children.map(e=>e===r.id?n:e),t=t.filter(e=>e.id!==r.id),e=!0;break}}let r=t.find(e=>e.id===n);if(r&&C(r)&&r.children?.length===1){let i=r.children[0];t.find(e=>e.id===i).kind===`group`&&(t=t.filter(e=>e.id!==n),n=i,e=!0)}}return{rootId:n,nodes:t}}var O=e=>({rootId:e.rootId,nodes:structuredClone(e.nodes)});function k(e,t){let n=w(e.nodes,t),r=n.children.indexOf(t);n.children=n.children.filter(e=>e!==t),C(n)&&(n.presentation={...n.presentation,weights:(n.presentation.weights??[]).filter((e,t)=>t!==r)})}function fe(e,t,n,r){if(!e.nodes.some(e=>e.id===t&&e.kind===`view`)||!w(e.nodes,t))return null;let i=T(e.nodes,t);if(i===t||E(e.nodes,i).length<2)return null;let a=O(e);k(a,t);let o={id:r(`group`),kind:`group`,children:[t]};a.nodes.push(o);let s=w(a.nodes,i);if(s&&C(s)&&s.presentation.axis===n){let e=s.children.indexOf(i),t=[...s.presentation.weights??s.children.map(()=>1)],n=(t[e]??1)/2;s.children.splice(e+1,0,o.id),t.splice(e,1,n,n),s.presentation={...s.presentation,weights:t}}else{let e={id:r(`split`),kind:`group`,children:[i,o.id],presentation:{mode:`split`,axis:n,weights:[1,1]}};a.nodes.push(e),s?s.children=s.children.map(t=>t===i?e.id:t):a.rootId=e.id}return D(a)}function A(e){let t=[],n=(r,i)=>{let a=e.nodes.find(e=>e.id===r);if(a){if(C(a))for(let e of a.children??[])n(e,!0);else(i||r===e.rootId)&&t.push(r)}};return n(e.rootId,!1),t}function j(e,t,n){let r=e.nodes.find(e=>e.id===t.id);if(r)return r.kind===`view`&&r.component===t.component&&r.version===t.version&&JSON.stringify(r.bindings)===JSON.stringify(t.bindings)?e:null;let i=O(e),a=A(i).at(-1),o=i.nodes.find(e=>e.id===a);if(!o)return null;if(i.nodes.push({id:t.id,kind:`view`,component:t.component,version:t.version,props:structuredClone(t.props),bindings:structuredClone(t.bindings)}),o.kind===`group`)o.children=[...o.children??[],t.id];else{let e={id:n(`group`),kind:`group`,children:[o.id,t.id]};i.nodes.push(e);let r=w(i.nodes,o.id);r?r.children=r.children.map(t=>t===o.id?e.id:t):i.rootId=e.id}return i}function pe(e,t,n,r){if(!w(e.nodes,t))return null;let i=A(e),a=T(e.nodes,t),o=i[i.indexOf(a)+n];if(!o||o===a)return null;let s=O(e);k(s,t);let c=s.nodes.find(e=>e.id===o);if(c.kind===`group`)c.children=[...c.children??[],t];else{let e={id:r(`group`),kind:`group`,children:[o,t]};s.nodes.push(e);let n=w(s.nodes,o);n.children=n.children.map(t=>t===o?e.id:t)}return D(s)}function me(e,t,n){if(!e.nodes.find(e=>e.id===t&&e.kind===`view`))return null;let r=O(e),i=r.nodes.find(e=>e.id===t);return i.props={...i.props,...n},r}function he(e,t){if(!w(e.nodes,t))return null;let n=O(e);return k(n,t),n.nodes=n.nodes.filter(e=>e.id!==t),D(n)}function M(e,t,n){let r=e.nodes.find(e=>e.id===t);if(!C(r)||r.children.length!==n.length)return null;let i=O(e),a=i.nodes.find(e=>e.id===t);return a.presentation={...a.presentation,weights:n.map(e=>Math.round(e*1e3)/1e3)},i}var N=e=>e.startsWith(`tabs:`)?e.slice(5):e;function P(e,t,n,r,i){let a=e.nodes.find(e=>e.id===n);if(!a||C(a)||n===t||!w(e.nodes,t))return null;if(T(e.nodes,t)===n){let i=E(e.nodes,n),a=i.filter(e=>e!==t),o=r&&a.includes(r)?a.indexOf(r):a.length;if(i.indexOf(t)===o)return null}let o=O(e);k(o,t);let s=o.nodes.find(e=>e.id===n);if(s.kind===`group`){let e=s.children??[],n=r?e.find(e=>e===r||E(o.nodes,e).includes(r)):void 0;e.splice(n?e.indexOf(n):e.length,0,t),s.children=e}else{let e={id:i(`group`),kind:`group`,children:r===n?[t,n]:[n,t]};o.nodes.push(e);let a=w(o.nodes,n);a?a.children=a.children.map(t=>t===n?e.id:t):o.rootId=e.id}return D(o)}function F(e,t,n,r,i){if(e.nodes.some(e=>e.id===t.id))return null;let a=n&&w(e.nodes,n)?n:E(e.nodes,A(e).at(-1)??e.rootId)[0]??null,o=j(e,t,i);return!o||!a?o:z(o,t.id,T(o.nodes,a),r,i)??o}function I(e,t,n,r,i=.4){if(e.nodes.some(e=>e.id===t.id))return null;let a=j(e,t,r);if(!a||E(a.nodes,a.rootId).length<2)return a;let o=O(a);k(o,t.id);let s={id:r(`group`),kind:`group`,children:[t.id]};return o.nodes.push(s),L(o,s.id,n,i,r),D(o)}function L(e,t,n,r,i){let a=n===`left`||n===`right`?`horizontal`:`vertical`,o=n===`right`||n===`bottom`,s=e.nodes.find(t=>t.id===e.rootId);if(C(s)&&s.presentation.axis===a){let e=[...s.presentation.weights??s.children.map(()=>1)],n=e.reduce((e,t)=>e+t,0)*r/(1-r);o?(s.children.push(t),e.push(n)):(s.children.unshift(t),e.unshift(n)),s.presentation={...s.presentation,weights:e}}else{let n={id:i(`split`),kind:`group`,children:o?[e.rootId,t]:[t,e.rootId],presentation:{mode:`split`,axis:a,weights:o?[1-r,r]:[r,1-r]}};e.nodes.push(n),e.rootId=n.id}}function R(e,t){let n=1;for(let r=T(e.nodes,t),i=w(e.nodes,r);i;r=i.id,i=w(e.nodes,r)){if(!C(i)||i.presentation.axis!==`horizontal`)continue;let e=i.presentation.weights??i.children.map(()=>1),t=e.reduce((e,t)=>e+t,0);n*=(e[i.children.indexOf(r)]??1)/(t||1)}return n}function ge(e,t,n,r,i,a){let o=T(e.nodes,n),s=w(e.nodes,o);if(r&&s&&R(e,n)*r<2*i){let n=s.children.indexOf(o),r=s.children[n+1]??s.children[n-1];for(let t=e.nodes.find(e=>e.id===r);t&&C(t);t=e.nodes.find(e=>e.id===r))r=t.children?.[0];let i=r?j(e,t,a):null;if(i)return P(i,t.id,r,null,a)??i}return F(e,t,n,`right`,a)}function z(e,t,n,r,i){let a=e.nodes.find(e=>e.id===n);if(!a||C(a)||n===t||!w(e.nodes,t)||T(e.nodes,t)===n&&E(e.nodes,n).length<2)return null;let o=O(e);k(o,t);let s={id:i(`group`),kind:`group`,children:[t]};return o.nodes.push(s),B(o,s.id,n,r,i),D(o)}function B(e,t,n,r,i){let a=r===`left`||r===`right`?`horizontal`:`vertical`,o=r===`right`||r===`bottom`,s=w(e.nodes,n);if(s&&C(s)&&s.presentation.axis===a){let e=s.children.indexOf(n),r=[...s.presentation.weights??s.children.map(()=>1)],i=(r[e]??1)/2;s.children.splice(o?e+1:e,0,t),r.splice(e,1,i,i),s.presentation={...s.presentation,weights:r}}else{let r={id:i(`split`),kind:`group`,children:o?[n,t]:[t,n],presentation:{mode:`split`,axis:a,weights:[1,1]}};e.nodes.push(r),s?s.children=s.children.map(e=>e===n?r.id:e):e.rootId=r.id}}function V(e,t){let n=(e,t)=>{let r=e.nodes.find(e=>e.id===t);return!r||r.kind===`view`?t:[t,r.presentation?.mode===`split`?r.presentation.axis:`tabs`,(r.children??[]).map(t=>n(e,t))]};return JSON.stringify(n(e,e.rootId))===JSON.stringify(n(t,t.rootId))}function _e(e,t,n,r,i,a){let o=A(e),s=e.nodes.find(e=>e.id===t);if(!s||t===n||t===e.rootId||!o.includes(t)||!o.includes(n))return null;if(s.kind===`view`)return r===`center`?P(e,t,n,i,a):z(e,t,n,r,a);let c=O(e);if(k(c,t),r!==`center`){B(c,t,n,r,a);let i=D(c);return V(e,i)?null:i}let l=E(c.nodes,t),u=new Set,d=e=>{let t=c.nodes.find(t=>t.id===e);t?.kind===`group`&&(u.add(e),t.children?.forEach(d))};d(t),c.nodes=c.nodes.filter(e=>!u.has(e.id));let f=c.nodes.find(e=>e.id===n);if(f.kind===`group`){let e=f.children??[],t=i?e.find(e=>e===i||E(c.nodes,e).includes(i)):void 0;e.splice(t?e.indexOf(t):e.length,0,...l),f.children=e}else{let e={id:a(`group`),kind:`group`,children:i===n?[...l,n]:[n,...l]};c.nodes.push(e);let t=w(c.nodes,n);t?t.children=t.children.map(t=>t===n?e.id:t):c.rootId=e.id}return D(c)}function H(e,t,n,r,i=1/3){let a=e.nodes.find(e=>e.id===t);if(!a||!w(e.nodes,t)||a.kind!==`view`&&!A(e).includes(t))return null;let o=T(e.nodes,t);if(o!==t&&E(e.nodes,o).length===1)return H(e,o,n,r,i);let s=O(e);k(s,t);let c=t;if(!A(e).includes(t)){let e={id:r(`group`),kind:`group`,children:[t]};s.nodes.push(e),c=e.id}L(s,c,n,i,r);let l=D(s);return V(e,l)?null:l}function U(e,t,n,r){if(e.nodes.some(e=>e.id===t.id))return null;let i=j(e,t,r);return i&&(P(i,t.id,n,null,r)??i)}var W=`workspace`,ve={workspace:`Workspace`,"agent-canvas":`Agent canvas`,"observed-outputs":`Observed outputs`};function ye(e){return ve[e]??(/^workspace-(\d+)$/.exec(e)?`Workspace `+e.slice(10):e)}var be=e=>`conversation-`+e,xe=e=>e.startsWith(`conversation-`)?e.slice(13):null;function G(e){let t=2166136261,n=16777619;for(let r of e){let e=r.codePointAt(0);t=Math.imul(t^e,16777619)>>>0,n=Math.imul(n^e,2166136261)>>>0}return`file-`+(t.toString(16).padStart(8,`0`)+n.toString(16).padStart(8,`0`)).slice(0,12)+`-`}var Se={maxViewsPerSide:6},K=`canvas-`,q=`markdown.reader`,J=`html.reader`,Ce=e=>e.kind===`view`?e.component===`rho.editor`||e.component===q||e.component===J?`code`:e.component===`rho.table`||e.component===`rho.media`?`data`:null:null,Y=/\.(png|jpe?g|svg|gif|pdf|tiff?|webp|xlsx?|rds|rda|rdata|parquet|feather|h5|h5ad|bam|zip|gz)$/i,we=e=>s(e)||!Y.test(e),Te=(e,t)=>e.catalog.operations.some(e=>e.method===t&&e.authorized&&e.state===`available`),X=(e,t)=>e.catalog.components.find(e=>e.id===t),Z=e=>Te(e,`agent.activity.capture`)&&!!X(e,`rho.table`)&&!!X(e,`rho.media`);async function Q(e,t,n){if(typeof n!=`string`){let e=X(t,n.kind===`table`?`rho.table`:`rho.media`);if(!e||![`table`,`media`].includes(n.kind))return null;let r=Object.keys(e.bindings)[0]??`data`;return{side:`data`,node:{id:`result-`+n.id.slice(0,12)+`-`+n.version.slice(0,12),kind:`view`,component:e.id,version:e.version,props:{title:n.path.split(`/`).at(-1)??n.path},bindings:{[r]:{id:n.id,version:n.version}}}}}let r=n,i=t.project.id,a=r.split(`/`).at(-1)??r;if(s(r)&&Z(t)){let n=await e.call(`agent.activity.capture`,{projectId:i,path:r}),o=X(t,n.kind===`table`?`rho.table`:`rho.media`),s=Object.keys(o.bindings)[0]??`data`;return{side:`data`,node:{id:G(r)+n.version.slice(0,12),kind:`view`,component:o.id,version:o.version,props:{title:a},bindings:{[s]:{id:n.id,version:n.version}}}}}if(Y.test(r))return null;let o=(/\.(md|markdown)$/i.test(r)?X(t,q):/\.html?$/i.test(r)?X(t,J):void 0)??X(t,`rho.editor`);if(!o)return null;let c=await e.call(`document.open`,{projectId:i,path:r});return{side:`code`,node:{id:`doc-`+c.id.slice(0,12),kind:`view`,component:o.id,version:o.version,props:{title:a},bindings:{document:{kind:`live-document`,documentId:c.id}}}}}function Ee(e,t,n,r){let i=structuredClone(e?.nodes??[]),a=e?.rootId??`root`;if(i.some(e=>e.id===t.id))return null;let o=e=>i.find(t=>t.id===e),s=e=>i.find(t=>t.kind===`group`&&t.children?.includes(e)),c=e=>!!e&&e.kind===`group`&&e.presentation?.mode!==`split`,l=t.id.startsWith(`file-`)?t.id.slice(0,18):``,u=l?i.find(e=>e.kind===`view`&&e.id.startsWith(l)):void 0;if(u){let e=s(u.id);if(e)return e.children=e.children.map(e=>e===u.id?t.id:e),{rootId:a,nodes:[...i.filter(e=>e.id!==u.id),t]}}if(r&&e?.rootId&&i.length)return U({rootId:a,nodes:i},t,r,e=>`${e}-${crypto.randomUUID().slice(0,8)}`);let d=o(a);d||(d={id:a,kind:`group`,children:[]},i.push(d));let f=new Map;for(let e of i)if(Ce(e)===n){let t=s(e.id);c(t)&&f.set(t,(f.get(t)??0)+1)}let p=i.find(e=>e.id===K+n&&e.kind===`group`)??[...f].sort((e,t)=>t[1]-e[1])[0]?.[0]??(d.children?.length?void 0:d);if(!p){p={id:K+n,kind:`group`,children:[]},i.push(p);let e=e=>n===`code`?0:e;if(d.presentation?.mode===`split`&&d.presentation.axis===`horizontal`){let t=d.presentation.weights?.length===d.children.length?[...d.presentation.weights]:d.children.map(()=>1),n=e(d.children.length);d.children.splice(n,0,p.id),t.splice(n,0,t.reduce((e,t)=>e+t,0)/t.length),d.presentation={...d.presentation,weights:t}}else{let t=`split`,n=1;for(;o(t);)t=`split-`+ ++n;let r=[a];r.splice(e(1),0,p.id),i.push({id:t,kind:`group`,children:r,presentation:{mode:`split`,axis:`horizontal`,weights:[1,1]}}),a=t}}if(p.children=[...p.children??[],t.id],i.push(t),p.id.startsWith(K))for(;p.children.length>Se.maxViewsPerSide;){let e=p.children.shift(),t=i.findIndex(t=>t.id===e);t>=0&&i.splice(t,1)}return{rootId:a,nodes:i}}var $=new Map;function De(e,t,r,i,a){let o=t.project.id+`/`+r,s=($.get(o)??Promise.resolve()).catch(()=>void 0).then(async()=>{let o=await Q(e,t,i);if(!o)return null;let s=t.project.id;for(let t=0;;t++){let i=await e.call(`composition.read`,{projectId:s,compositionId:r}).catch(e=>{if(e instanceof n&&e.error.kind===`not_found`)return null;throw e}),c=(i?.nodes)?.find(e=>e.id===o.node.id);if(c)return{compositionId:r,viewId:c.id};let l=Ee(i,o.node,o.side,a);if(!l)return{compositionId:r,viewId:o.node.id};try{return await e.call(`composition.apply`,{projectId:s,compositionId:r,expectedVersion:i?.version??0,changeId:`open-`+crypto.randomUUID(),operations:[{op:`replace`,rootId:l.rootId,nodes:l.nodes}]}),{compositionId:r,viewId:o.node.id}}catch(e){if(t===0&&e instanceof n&&e.error.kind===`stale`)continue;throw e}}});return $.set(o,s),s}export{le as A,ce as C,me as D,de as E,p as F,d as I,l as L,s as M,o as N,fe as O,y as P,j as S,M as T,ue as _,De as a,H as b,we as c,F as d,U as f,N as g,z as h,G as i,f as j,b as k,Q as l,he as m,ye as n,be as o,ge as p,W as r,xe as s,Z as t,I as u,_e as v,S as w,pe as x,P as y};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-Dss-ouuy.js";import{c as n}from"./home-CCbP6kS-.js";var r=e(t(),1),i=new Map(Object.entries({data:`csv.tsv.tab.xlsx.xls.json.parquet.feather.arrow.rds.rda.rdata.h5.h5ad.hdf5.loom.mtx.sav.dta.sas7bdat.fasta.fa.fastq.fq.bam.sam.vcf.bed.gtf.gff.gff3.nwk.tre.newick`.split(`.`),code:`r.rmd.qmd.py.ipynb.sh.bash.zsh.jl.sql.js.mjs.ts.stan.smk.nf.wdl.cpp.c.h.rs.go.java.pl.awk.sas.do.m`.split(`.`),figures:[`png`,`jpg`,`jpeg`,`svg`,`pdf`,`gif`,`tif`,`tiff`,`webp`,`eps`],notes:[`md`,`markdown`,`txt`,`rst`,`org`,`tex`,`bib`,`docx`,`html`]}).flatMap(([e,t])=>t.map(t=>[t,e]))),a=new Set([`results`,`result`,`output`,`outputs`,`out`,`figures`,`figs`,`plots`,`reports`]);function o(e){let t=e.split(`/`),n=t.at(-1).toLowerCase().split(`.`);n.length>2&&[`gz`,`bz2`,`xz`,`zst`].includes(n.at(-1))&&n.pop();let r=n.length>1?i.get(n.at(-1))??null:null;return r===`data`&&t.slice(0,-1).some(e=>a.has(e.toLowerCase()))?`results`:r}var s=e=>/\.(csv|png|jpe?g|svg)$/i.test(e),c=new Set([`node_modules`,`renv`,`packrat`,`__pycache__`,`venv`,`.venv`,`site-library`,`.ipynb_checkpoints`,`.Rproj.user`,`.snakemake`,`.nextflow`]),l={maxFolders:48,maxDepth:5,maxFiles:4e3};async function u(e,t,n){let r=[],i=[{path:``,depth:0}],a=0,s=!1;for(;i.length;){if(n.aborted)throw new DOMException(`aborted`,`AbortError`);if(a>=l.maxFolders){s=!0;break}let u=i.shift();a++;let d=await e.call(`project.entries`,{projectId:t,...u.path?{path:u.path}:{}},n);d.truncated&&(s=!0);for(let e of d.entries)if(!e.hidden){if(e.kind===`folder`){if(c.has(e.name))continue;if(u.depth+1>l.maxDepth){s=!0;continue}i.push({path:e.path,depth:u.depth+1})}else{if(r.length>=l.maxFiles){s=!0;break}r.push({...e,category:o(e.path)})}}}return{files:r,truncated:s}}function d(e,t,n){let[i,a]=(0,r.useState)({files:[],truncated:!1,reading:!1,problem:``,readAt:0}),[o,s]=(0,r.useState)(0),c=(0,r.useRef)(0),l=(0,r.useRef)(void 0),[d,f]=(0,r.useState)(0);return(0,r.useEffect)(()=>{a({files:[],truncated:!1,reading:!1,problem:``,readAt:0}),c.current=0},[t]),(0,r.useEffect)(()=>{if(!t)return;let e=Math.max(0,c.current+5e3-Date.now());return clearTimeout(l.current),l.current=setTimeout(()=>f(e=>e+1),e),()=>clearTimeout(l.current)},[t,n,o]),(0,r.useEffect)(()=>{if(!t||!d)return;let n=new AbortController;return c.current=Date.now(),a(e=>({...e,reading:!0})),u(e,t,n.signal).then(e=>a({...e,reading:!1,problem:``,readAt:Date.now()}),e=>{n.signal.aborted||a(t=>({...t,reading:!1,problem:e instanceof Error?e.message:`The project folder could not be read.`}))}),()=>n.abort()},[e,t,d]),{...i,refresh:()=>{c.current=0,s(e=>e+1)}}}var f=[`data`,`code`,`results`,`notes`],p=[`data`,`code`,`workflows`,`results`,`reports`,`notes`,`references`,`environment`],ee=new Set([`renv.lock`,`description`,`environment.yml`,`environment.yaml`,`pyproject.toml`,`setup.py`,`setup.cfg`,`pipfile`,`pipfile.lock`,`poetry.lock`,`uv.lock`,`conda-lock.yml`,`dockerfile`,`containerfile`,`apptainer.def`,`singularity.def`,`install.r`,`project.toml`,`manifest.toml`]),te=new Set([`snakefile`,`makefile`,`gnumakefile`,`justfile`,`_targets.r`,`nextflow.config`,`dvc.yaml`]),ne=new Set([`refs`,`references`,`literature`,`papers`,`reading`,`bibliography`]),m=e=>e.toLowerCase().replace(/\.[^./]+$/,``),re=e=>new Set(e.filter(e=>/\.(rmd|qmd|rnw)$/i.test(e.path)).map(e=>m(e.path))),ie=e=>new Set(e.filter(e=>/\.html?$/i.test(e.path)).map(e=>e.path.toLowerCase().split(`/`).slice(0,-1).join(`/`))),ae=/^[a-z][\w.]*(-[a-z][\w.]*)*-\d+(\.\d+)+$/,oe=/^(lib|libs|site_libs|.+_files)$/;function se(e,t,n=new Set){let r=e.path.toLowerCase().split(`/`),i=r.at(-1),a=i.includes(`.`)?i.split(`.`).at(-1):``;return r.slice(0,-1).some((e,n)=>e.endsWith(`_files`)&&t.has([...r.slice(0,n),e.slice(0,-6)].join(`/`)))||r.slice(0,-1).some((e,t)=>t>0&&ae.test(e)&&oe.test(r[t-1])&&n.has(r.slice(0,t-1).join(`/`)))?null:ee.has(i)||/^requirements([-_.][^/]*)?\.txt$/.test(i)||a===`rproj`?`environment`:te.has(i)||[`smk`,`nf`,`wdl`,`cwl`].includes(a)?`workflows`:[`rmd`,`qmd`,`rnw`].includes(a)||[`html`,`pdf`,`docx`].includes(a)&&t.has(m(e.path))?`reports`:[`bib`,`ris`,`nbib`,`enw`].includes(a)||a===`pdf`&&r.slice(0,-1).some(e=>ne.has(e))?`references`:e.category===`figures`||e.category===`results`?`results`:e.category}var h=e=>e.split(`/`).filter(Boolean).at(-1)??e;function g(e,t){let n=e.split(`/`);if(n.pop(),!n.length)return t.name??h(t.root);let r=n[0].startsWith(`@`)?t.sources?.find(e=>`@`+e.id===n[0]):void 0;return[r?r.name:n[0],...n.slice(1)].join(`/`)}var _=e=>![`current-filesystem-observation`,`captured-observation`].includes(e.provenance?.source??``),v=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function y(e,t,n,r,i=[]){let a=new Map,o=new Map(i.map(e=>[e.operationId,e.acceptedAt])),s=e=>o.get(String(e.provenance?.operationId??``))??``,c=new Map;if(e===`results`)for(let e of n){let t=c.get(e.path);_(e)&&(!t||s(e).localeCompare(s(t))>0||s(e)===s(t)&&e.version.localeCompare(t.version)>0)&&c.set(e.path,e)}for(let e of c.values())a.set(e.path,{key:`result:`+e.path,path:e.path,name:h(e.path),folder:g(e.path,r),bytes:e.bytes??null,category:e.kind===`media`?`figures`:`results`,resource:{id:e.id,version:e.version,kind:e.kind,path:e.path}});let l=re(t),u=ie(t);for(let n of t)se(n,l,u)===e&&!a.has(n.path)&&a.set(n.path,{key:`file:`+n.path,path:n.path,name:n.name,folder:g(n.path,r),bytes:n.bytes,category:n.category});let d=e=>Number(e.path.includes(`/`));return[...a.values()].sort((e,t)=>d(e)-d(t)||v.compare(e.folder,t.folder)||v.compare(e.name,t.name))}function ce(e){let t=new Set(e.views.map(e=>e.id)),n=new Set,r=new Map((e.nodes??[]).map(e=>[e.id,e])),i=e=>{let n=r.get(e);return n?n.kind===`view`?t.has(n.id)?[n.id]:[]:n.children.flatMap(i):[]},a=e=>{let o=r.get(e);if(!o)return null;if(o.kind===`view`)return t.has(o.id)?(n.add(o.id),{kind:`tabs`,id:`tabs:`+o.id,views:[o.id]}):null;let s=o.presentation?.mode===`split`?o.presentation:null;if(s){let e=o.children.map((e,t)=>({region:a(e),weight:s.weights[t]??1})).filter(e=>e.region);return e.length?e.length===1?e[0].region:{kind:`split`,id:o.id,axis:s.axis,weights:e.map(e=>e.weight),children:e.map(e=>e.region)}:null}let c=i(o.id);return c.forEach(e=>n.add(e)),c.length?{kind:`tabs`,id:o.id,views:c}:null},o=e.rootId&&r.size?a(e.rootId):null,s=e.views.map(e=>e.id).filter(e=>!n.has(e));if(!s.length)return o;if(!o)return{kind:`tabs`,id:`tabs:root`,views:s};let c=b(o),l=c[c.length-1];return o=x(o,l.id,{...l,views:[...l.views,...s]}),o}function b(e){return e.kind===`tabs`?[e]:e.children.flatMap(b)}function le(e){return e?b(e).flatMap(e=>e.views):[]}function ue(e,t){return e?b(e).find(e=>e.views.includes(t))??null:null}function x(e,t,n){return e.id===t?n:e.kind===`split`?{...e,children:e.children.map(e=>x(e,t,n))}:e}function S(e,t,n,r=.12){let i=e.reduce((e,t)=>e+t,0),a=[...e],o=i*r,s=a[t]+a[t+1],c=Math.min(s-o,Math.max(o,a[t]+n*i));return a[t]=c,a[t+1]=s-c,a}function de(e){let t=e.bindings?.data,n=e=>e.replace(/[^A-Za-z0-9._-]/g,`_`).slice(0,40);return typeof t?.id==`string`&&typeof t.version==`string`?{kind:`shared`,id:`linked:${n(t.id)}@${n(t.version)}`}:{kind:`shared`,id:e.id}}var C=e=>e?.presentation?.mode===`split`,w=(e,t)=>e.find(e=>e.kind===`group`&&e.children?.includes(t));function T(e,t){let n=t;for(;;){let t=w(e,n);if(!t||C(t))return n;n=t.id}}function E(e,t){let n=e.find(e=>e.id===t);return n?n.kind===`view`?[t]:(n.children??[]).flatMap(t=>E(e,t)):[]}function D(e){let t=e.nodes,n=e.rootId;for(let e=!0;e;){e=!1;for(let r of t){if(r.kind!==`group`||r.id===n)continue;let i=w(t,r.id);if(!r.children?.length){let n=i.children.indexOf(r.id);i.children=i.children.filter(e=>e!==r.id),C(i)&&(i.presentation={...i.presentation,weights:(i.presentation.weights??[]).filter((e,t)=>t!==n)}),t=t.filter(e=>e.id!==r.id),e=!0;break}if(C(r)&&r.children.length===1){let n=r.children[0];i.children=i.children.map(e=>e===r.id?n:e),t=t.filter(e=>e.id!==r.id),e=!0;break}}let r=t.find(e=>e.id===n);if(r&&C(r)&&r.children?.length===1){let i=r.children[0];t.find(e=>e.id===i).kind===`group`&&(t=t.filter(e=>e.id!==n),n=i,e=!0)}}return{rootId:n,nodes:t}}var O=e=>({rootId:e.rootId,nodes:structuredClone(e.nodes)});function k(e,t){let n=w(e.nodes,t),r=n.children.indexOf(t);n.children=n.children.filter(e=>e!==t),C(n)&&(n.presentation={...n.presentation,weights:(n.presentation.weights??[]).filter((e,t)=>t!==r)})}function fe(e,t,n,r){if(!e.nodes.some(e=>e.id===t&&e.kind===`view`)||!w(e.nodes,t))return null;let i=T(e.nodes,t);if(i===t||E(e.nodes,i).length<2)return null;let a=O(e);k(a,t);let o={id:r(`group`),kind:`group`,children:[t]};a.nodes.push(o);let s=w(a.nodes,i);if(s&&C(s)&&s.presentation.axis===n){let e=s.children.indexOf(i),t=[...s.presentation.weights??s.children.map(()=>1)],n=(t[e]??1)/2;s.children.splice(e+1,0,o.id),t.splice(e,1,n,n),s.presentation={...s.presentation,weights:t}}else{let e={id:r(`split`),kind:`group`,children:[i,o.id],presentation:{mode:`split`,axis:n,weights:[1,1]}};a.nodes.push(e),s?s.children=s.children.map(t=>t===i?e.id:t):a.rootId=e.id}return D(a)}function A(e){let t=[],n=(r,i)=>{let a=e.nodes.find(e=>e.id===r);if(a){if(C(a))for(let e of a.children??[])n(e,!0);else(i||r===e.rootId)&&t.push(r)}};return n(e.rootId,!1),t}function j(e,t,n){let r=e.nodes.find(e=>e.id===t.id);if(r)return r.kind===`view`&&r.component===t.component&&r.version===t.version&&JSON.stringify(r.bindings)===JSON.stringify(t.bindings)?e:null;let i=O(e),a=A(i).at(-1),o=i.nodes.find(e=>e.id===a);if(!o)return null;if(i.nodes.push({id:t.id,kind:`view`,component:t.component,version:t.version,props:structuredClone(t.props),bindings:structuredClone(t.bindings)}),o.kind===`group`)o.children=[...o.children??[],t.id];else{let e={id:n(`group`),kind:`group`,children:[o.id,t.id]};i.nodes.push(e);let r=w(i.nodes,o.id);r?r.children=r.children.map(t=>t===o.id?e.id:t):i.rootId=e.id}return i}function pe(e,t,n,r){if(!w(e.nodes,t))return null;let i=A(e),a=T(e.nodes,t),o=i[i.indexOf(a)+n];if(!o||o===a)return null;let s=O(e);k(s,t);let c=s.nodes.find(e=>e.id===o);if(c.kind===`group`)c.children=[...c.children??[],t];else{let e={id:r(`group`),kind:`group`,children:[o,t]};s.nodes.push(e);let n=w(s.nodes,o);n.children=n.children.map(t=>t===o?e.id:t)}return D(s)}function me(e,t,n){if(!e.nodes.find(e=>e.id===t&&e.kind===`view`))return null;let r=O(e),i=r.nodes.find(e=>e.id===t);return i.props={...i.props,...n},r}function he(e,t){if(!w(e.nodes,t))return null;let n=O(e);return k(n,t),n.nodes=n.nodes.filter(e=>e.id!==t),D(n)}function M(e,t,n){let r=e.nodes.find(e=>e.id===t);if(!C(r)||r.children.length!==n.length)return null;let i=O(e),a=i.nodes.find(e=>e.id===t);return a.presentation={...a.presentation,weights:n.map(e=>Math.round(e*1e3)/1e3)},i}var N=e=>e.startsWith(`tabs:`)?e.slice(5):e;function P(e,t,n,r,i){let a=e.nodes.find(e=>e.id===n);if(!a||C(a)||n===t||!w(e.nodes,t))return null;if(T(e.nodes,t)===n){let i=E(e.nodes,n),a=i.filter(e=>e!==t),o=r&&a.includes(r)?a.indexOf(r):a.length;if(i.indexOf(t)===o)return null}let o=O(e);k(o,t);let s=o.nodes.find(e=>e.id===n);if(s.kind===`group`){let e=s.children??[],n=r?e.find(e=>e===r||E(o.nodes,e).includes(r)):void 0;e.splice(n?e.indexOf(n):e.length,0,t),s.children=e}else{let e={id:i(`group`),kind:`group`,children:r===n?[t,n]:[n,t]};o.nodes.push(e);let a=w(o.nodes,n);a?a.children=a.children.map(t=>t===n?e.id:t):o.rootId=e.id}return D(o)}function F(e,t,n,r,i){if(e.nodes.some(e=>e.id===t.id))return null;let a=n&&w(e.nodes,n)?n:E(e.nodes,A(e).at(-1)??e.rootId)[0]??null,o=j(e,t,i);return!o||!a?o:z(o,t.id,T(o.nodes,a),r,i)??o}function I(e,t,n,r,i=.4){if(e.nodes.some(e=>e.id===t.id))return null;let a=j(e,t,r);if(!a||E(a.nodes,a.rootId).length<2)return a;let o=O(a);k(o,t.id);let s={id:r(`group`),kind:`group`,children:[t.id]};return o.nodes.push(s),L(o,s.id,n,i,r),D(o)}function L(e,t,n,r,i){let a=n===`left`||n===`right`?`horizontal`:`vertical`,o=n===`right`||n===`bottom`,s=e.nodes.find(t=>t.id===e.rootId);if(C(s)&&s.presentation.axis===a){let e=[...s.presentation.weights??s.children.map(()=>1)],n=e.reduce((e,t)=>e+t,0)*r/(1-r);o?(s.children.push(t),e.push(n)):(s.children.unshift(t),e.unshift(n)),s.presentation={...s.presentation,weights:e}}else{let n={id:i(`split`),kind:`group`,children:o?[e.rootId,t]:[t,e.rootId],presentation:{mode:`split`,axis:a,weights:o?[1-r,r]:[r,1-r]}};e.nodes.push(n),e.rootId=n.id}}function R(e,t){let n=1;for(let r=T(e.nodes,t),i=w(e.nodes,r);i;r=i.id,i=w(e.nodes,r)){if(!C(i)||i.presentation.axis!==`horizontal`)continue;let e=i.presentation.weights??i.children.map(()=>1),t=e.reduce((e,t)=>e+t,0);n*=(e[i.children.indexOf(r)]??1)/(t||1)}return n}function ge(e,t,n,r,i,a){let o=T(e.nodes,n),s=w(e.nodes,o);if(r&&s&&R(e,n)*r<2*i){let n=s.children.indexOf(o),r=s.children[n+1]??s.children[n-1];for(let t=e.nodes.find(e=>e.id===r);t&&C(t);t=e.nodes.find(e=>e.id===r))r=t.children?.[0];let i=r?j(e,t,a):null;if(i)return P(i,t.id,r,null,a)??i}return F(e,t,n,`right`,a)}function z(e,t,n,r,i){let a=e.nodes.find(e=>e.id===n);if(!a||C(a)||n===t||!w(e.nodes,t)||T(e.nodes,t)===n&&E(e.nodes,n).length<2)return null;let o=O(e);k(o,t);let s={id:i(`group`),kind:`group`,children:[t]};return o.nodes.push(s),B(o,s.id,n,r,i),D(o)}function B(e,t,n,r,i){let a=r===`left`||r===`right`?`horizontal`:`vertical`,o=r===`right`||r===`bottom`,s=w(e.nodes,n);if(s&&C(s)&&s.presentation.axis===a){let e=s.children.indexOf(n),r=[...s.presentation.weights??s.children.map(()=>1)],i=(r[e]??1)/2;s.children.splice(o?e+1:e,0,t),r.splice(e,1,i,i),s.presentation={...s.presentation,weights:r}}else{let r={id:i(`split`),kind:`group`,children:o?[n,t]:[t,n],presentation:{mode:`split`,axis:a,weights:[1,1]}};e.nodes.push(r),s?s.children=s.children.map(e=>e===n?r.id:e):e.rootId=r.id}}function V(e,t){let n=(e,t)=>{let r=e.nodes.find(e=>e.id===t);return!r||r.kind===`view`?t:[t,r.presentation?.mode===`split`?r.presentation.axis:`tabs`,(r.children??[]).map(t=>n(e,t))]};return JSON.stringify(n(e,e.rootId))===JSON.stringify(n(t,t.rootId))}function _e(e,t,n,r,i,a){let o=A(e),s=e.nodes.find(e=>e.id===t);if(!s||t===n||t===e.rootId||!o.includes(t)||!o.includes(n))return null;if(s.kind===`view`)return r===`center`?P(e,t,n,i,a):z(e,t,n,r,a);let c=O(e);if(k(c,t),r!==`center`){B(c,t,n,r,a);let i=D(c);return V(e,i)?null:i}let l=E(c.nodes,t),u=new Set,d=e=>{let t=c.nodes.find(t=>t.id===e);t?.kind===`group`&&(u.add(e),t.children?.forEach(d))};d(t),c.nodes=c.nodes.filter(e=>!u.has(e.id));let f=c.nodes.find(e=>e.id===n);if(f.kind===`group`){let e=f.children??[],t=i?e.find(e=>e===i||E(c.nodes,e).includes(i)):void 0;e.splice(t?e.indexOf(t):e.length,0,...l),f.children=e}else{let e={id:a(`group`),kind:`group`,children:i===n?[...l,n]:[n,...l]};c.nodes.push(e);let t=w(c.nodes,n);t?t.children=t.children.map(t=>t===n?e.id:t):c.rootId=e.id}return D(c)}function H(e,t,n,r,i=1/3){let a=e.nodes.find(e=>e.id===t);if(!a||!w(e.nodes,t)||a.kind!==`view`&&!A(e).includes(t))return null;let o=T(e.nodes,t);if(o!==t&&E(e.nodes,o).length===1)return H(e,o,n,r,i);let s=O(e);k(s,t);let c=t;if(!A(e).includes(t)){let e={id:r(`group`),kind:`group`,children:[t]};s.nodes.push(e),c=e.id}L(s,c,n,i,r);let l=D(s);return V(e,l)?null:l}function U(e,t,n,r){if(e.nodes.some(e=>e.id===t.id))return null;let i=j(e,t,r);return i&&(P(i,t.id,n,null,r)??i)}var W=`workspace`,ve={workspace:`Workspace`,"agent-canvas":`Agent canvas`,"observed-outputs":`Observed outputs`,"external-results":`External results`};function ye(e){return ve[e]??(/^workspace-(\d+)$/.exec(e)?`Workspace `+e.slice(10):e)}var be=e=>`conversation-`+e,xe=e=>e.startsWith(`conversation-`)?e.slice(13):null;function G(e){let t=2166136261,n=16777619;for(let r of e){let e=r.codePointAt(0);t=Math.imul(t^e,16777619)>>>0,n=Math.imul(n^e,2166136261)>>>0}return`file-`+(t.toString(16).padStart(8,`0`)+n.toString(16).padStart(8,`0`)).slice(0,12)+`-`}var Se={maxViewsPerSide:6},K=`canvas-`,q=`markdown.reader`,J=`html.reader`,Ce=e=>e.kind===`view`?e.component===`rho.editor`||e.component===q||e.component===J?`code`:e.component===`rho.table`||e.component===`rho.media`?`data`:null:null,Y=/\.(png|jpe?g|svg|gif|pdf|tiff?|webp|xlsx?|rds|rda|rdata|parquet|feather|h5|h5ad|bam|zip|gz)$/i,we=e=>s(e)||!Y.test(e),Te=(e,t)=>e.catalog.operations.some(e=>e.method===t&&e.authorized&&e.state===`available`),X=(e,t)=>e.catalog.components.find(e=>e.id===t),Z=e=>Te(e,`agent.activity.capture`)&&!!X(e,`rho.table`)&&!!X(e,`rho.media`);async function Q(e,t,n){if(typeof n!=`string`){let e=X(t,n.kind===`table`?`rho.table`:`rho.media`);if(!e||![`table`,`media`].includes(n.kind))return null;let r=Object.keys(e.bindings)[0]??`data`;return{side:`data`,node:{id:`result-`+n.id.slice(0,12)+`-`+n.version.slice(0,12),kind:`view`,component:e.id,version:e.version,props:{title:n.path.split(`/`).at(-1)??n.path},bindings:{[r]:{id:n.id,version:n.version}}}}}let r=n,i=t.project.id,a=r.split(`/`).at(-1)??r;if(s(r)&&Z(t)){let n=await e.call(`agent.activity.capture`,{projectId:i,path:r}),o=X(t,n.kind===`table`?`rho.table`:`rho.media`),s=Object.keys(o.bindings)[0]??`data`;return{side:`data`,node:{id:G(r)+n.version.slice(0,12),kind:`view`,component:o.id,version:o.version,props:{title:a},bindings:{[s]:{id:n.id,version:n.version}}}}}if(Y.test(r))return null;let o=(/\.(md|markdown)$/i.test(r)?X(t,q):/\.html?$/i.test(r)?X(t,J):void 0)??X(t,`rho.editor`);if(!o)return null;let c=await e.call(`document.open`,{projectId:i,path:r});return{side:`code`,node:{id:`doc-`+c.id.slice(0,12),kind:`view`,component:o.id,version:o.version,props:{title:a},bindings:{document:{kind:`live-document`,documentId:c.id}}}}}function Ee(e,t,n,r){let i=structuredClone(e?.nodes??[]),a=e?.rootId??`root`;if(i.some(e=>e.id===t.id))return null;let o=e=>i.find(t=>t.id===e),s=e=>i.find(t=>t.kind===`group`&&t.children?.includes(e)),c=e=>!!e&&e.kind===`group`&&e.presentation?.mode!==`split`,l=t.id.startsWith(`file-`)?t.id.slice(0,18):``,u=l?i.find(e=>e.kind===`view`&&e.id.startsWith(l)):void 0;if(u){let e=s(u.id);if(e)return e.children=e.children.map(e=>e===u.id?t.id:e),{rootId:a,nodes:[...i.filter(e=>e.id!==u.id),t]}}if(r&&e?.rootId&&i.length)return U({rootId:a,nodes:i},t,r,e=>`${e}-${crypto.randomUUID().slice(0,8)}`);let d=o(a);d||(d={id:a,kind:`group`,children:[]},i.push(d));let f=new Map;for(let e of i)if(Ce(e)===n){let t=s(e.id);c(t)&&f.set(t,(f.get(t)??0)+1)}let p=i.find(e=>e.id===K+n&&e.kind===`group`)??[...f].sort((e,t)=>t[1]-e[1])[0]?.[0]??(d.children?.length?void 0:d);if(!p){p={id:K+n,kind:`group`,children:[]},i.push(p);let e=e=>n===`code`?0:e;if(d.presentation?.mode===`split`&&d.presentation.axis===`horizontal`){let t=d.presentation.weights?.length===d.children.length?[...d.presentation.weights]:d.children.map(()=>1),n=e(d.children.length);d.children.splice(n,0,p.id),t.splice(n,0,t.reduce((e,t)=>e+t,0)/t.length),d.presentation={...d.presentation,weights:t}}else{let t=`split`,n=1;for(;o(t);)t=`split-`+ ++n;let r=[a];r.splice(e(1),0,p.id),i.push({id:t,kind:`group`,children:r,presentation:{mode:`split`,axis:`horizontal`,weights:[1,1]}}),a=t}}if(p.children=[...p.children??[],t.id],i.push(t),p.id.startsWith(K))for(;p.children.length>Se.maxViewsPerSide;){let e=p.children.shift(),t=i.findIndex(t=>t.id===e);t>=0&&i.splice(t,1)}return{rootId:a,nodes:i}}var $=new Map;function De(e,t,r,i,a){let o=t.project.id+`/`+r,s=($.get(o)??Promise.resolve()).catch(()=>void 0).then(async()=>{let o=await Q(e,t,i);if(!o)return null;let s=t.project.id;for(let t=0;;t++){let i=await e.call(`composition.read`,{projectId:s,compositionId:r}).catch(e=>{if(e instanceof n&&e.error.kind===`not_found`)return null;throw e}),c=(i?.nodes)?.find(e=>e.id===o.node.id);if(c)return{compositionId:r,viewId:c.id};let l=Ee(i,o.node,o.side,a);if(!l)return{compositionId:r,viewId:o.node.id};try{return await e.call(`composition.apply`,{projectId:s,compositionId:r,expectedVersion:i?.version??0,changeId:`open-`+crypto.randomUUID(),operations:[{op:`replace`,rootId:l.rootId,nodes:l.nodes}]}),{compositionId:r,viewId:o.node.id}}catch(e){if(t===0&&e instanceof n&&e.error.kind===`stale`)continue;throw e}}});return $.set(o,s),s}export{le as A,ce as C,me as D,de as E,p as F,d as I,l as L,s as M,o as N,fe as O,y as P,j as S,M as T,ue as _,De as a,H as b,we as c,F as d,U as f,N as g,z as h,G as i,f as j,b as k,Q as l,he as m,ye as n,be as o,ge as p,W as r,xe as s,Z as t,I as u,_e as v,S as w,pe as x,P as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./react-Dss-ouuy.js";import{r}from"./markdown-0ngRuTpW.js";import{N as i}from"./canvas-D8rDdfDz.js";import{J as a,K as o,_t as s,mt as c,pt as l}from"./index-CxmItXqa.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./notes-meaning-pVbbQUGP.js";var g=e(n(),1),_=(e,t)=>e.length>t?e.slice(0,t-1).trimEnd()+`…`:e;function v(e){let{process:t,meanings:n,traces:r}=e,i=new Map(e.files.map(e=>[e.path,e])),o=f(n),s=e.described??new Map,l=new Map,u=new Map,d=new Map,p=[],m=(e,t,n,r,i,a,o)=>{let s=t+`>`+n+`:`+r;e.has(s)||e.set(s,{id:s,from:t,to:n,label:r,basis:i,at:a,turn:o})},h=e=>t.nodes.filter(t=>t.kind===`file`&&t.path===e).flatMap(e=>e.versions??(e.resource?[{resource:e.resource,capturedAt:e.capturedAt??e.at}]:[])).sort((e,t)=>e.capturedAt-t.capturedAt),g=(e,n)=>t.nodes.find(t=>t.kind===`file`&&t.path===e&&(!n||t.resource?.version===n||t.versions?.some(e=>e.resource.version===n))),v=(t,n,a,u)=>{let d=`m:f:`+t,f=l.get(d);if(!f){let p=i.get(t),m=u?.files.find(e=>e.path===t)?.kept??null,g=h(t).at(-1),_=m??(g?{resource:g.resource,at:g.capturedAt}:null),v=c(t,o,s),y=o.get(t);f={id:d,kind:`file`,title:t.split(`/`).at(-1)??t,path:t,at:a,category:p?.category??e.kindOf(t),exists:!!p,bytes:p?.bytes,modifiedAt:p?.modifiedAt,..._?{resource:_.resource,capturedAt:_.at}:{gap:`No version of this file was kept in the Agent's record.`},events:[{key:d,at:a,node:d,turn:n,action:`write`,label:`Named in the notes`}],meaning:{session:``,conversationId:null,...v?{description:{...v,...v.source===`notes`&&y?{trace:r.get(y.statement)}:{}}}:{}}},l.set(d,f)}return f};n.forEach(n=>{let a=n.statements;if(!a.length)return;let o=`m:`+(n.conversationId??`notes-`+n.line),s=t.turns.find(e=>e.conversationId===n.conversationId),c=a.map(e=>r.get(e)?.written?.at).filter(e=>e!==void 0),f=c.length?Math.min(...c):s?.start??0;p.push({id:o,conversationId:n.conversationId??``,title:n.title,agent:s?.agent??`Notes`,start:f,end:Math.max(f,...c),running:!1});let h=e=>r.get(e)?.written?.at??f,g=e=>({session:n.title,conversationId:n.conversationId,...e?{statement:e,trace:r.get(e)}:{}}),y=a.filter(e=>e.kind===`todo`),b=a.find(e=>e.kind===`question`),C={id:`q:`+o,kind:`question`,title:_(b?.text||n.title,160),text:b?.text||n.title,at:b?h(b):f,turn:o,conversationId:n.conversationId??void 0,agent:s?.agent,events:[],meaning:{...g(b),...y.length?{todos:{done:y.filter(e=>e.done).length,total:y.length}}:{}}};l.set(C.id,C);let w=new Map;a.forEach((e,i)=>{if(e.kind!==`finding`&&e.kind!==`choice`)return;let a={id:`m:s:`+o+`:`+e.line,kind:e.kind,title:_(e.text,220),text:e.text,at:h(e),turn:o,conversationId:n.conversationId??void 0,events:[{key:`m:s:`+o+`:`+e.line,at:h(e),node:`m:s:`+o+`:`+e.line,turn:o,action:`write`,label:`Written in the notes`}],meaning:g(e)};l.set(a.id,a),w.set(i,a),m(u,C.id,a.id,e.kind===`finding`?`found`:`chose`,`declared`,h(e),o);for(let t of e.links)m(u,a.id,v(t,o,h(e),r.get(e)).id,e.kind===`finding`?`rests on`:`gives`,`declared`,h(e),o);for(let t of e.alternatives??[])for(let n of t.links)m(u,a.id,v(n,o,h(e),r.get(e)).id,`instead gives`,`declared`,h(e),o);let s=r.get(e)?.written;s&&t.nodes.some(e=>e.id===`q:`+s.turn)&&m(d,a.id,`q:`+s.turn,`written in`,`observed`,s.at,o)}),a.forEach(e=>{if(e.kind!==`figure`)return;let t=e.of===void 0?void 0:w.get(e.of);for(let n of e.links)m(u,(t??C).id,v(n,o,h(e),r.get(e)).id,t?`shown in`:`shows`,`declared`,h(e),o)});let T=()=>new Set([...u.values()].map(e=>e.to));for(let e of a)if(e.kind===`file`)for(let t of e.links){let n=v(t,o,h(e),r.get(e));!T().has(n.id)&&n.category!==`code`&&n.category!==`data`&&m(u,C.id,n.id,`made`,`declared`,h(e),o)}let E=a.filter(e=>e.kind===`method`||e.kind===`file`);for(let t of E){let n=t.links.filter(t=>(i.get(t)?.category??e.kindOf(t))===`code`),a=t.links.filter(t=>(i.get(t)?.category??e.kindOf(t))===`data`);for(let e of n)for(let n of a)m(u,v(e,o,h(t),r.get(t)).id,v(n,o,h(t),r.get(t)).id,`reads`,`declared`,h(t),o)}n.conversationId&&x(o,C,n.conversationId),S(o,n.conversationId);for(let e of E)for(let t of e.links){let n=v(t,o,h(e),r.get(e));T().has(n.id)||m(u,C.id,n.id,n.category===`data`?`uses data`:`uses`,`declared`,h(e),o)}});let y=new Set(n.map(e=>e.conversationId));for(let e of new Set([...s.values()].map(e=>e.conversationId))){if(y.has(e)||!b(e).length)continue;let n=`m:`+e,r=t.turns.find(t=>t.conversationId===e),i=t.nodes.find(t=>t.kind===`question`&&t.conversationId===e),a=b(e).map(e=>Date.parse(e.observedAt)),o=r?.start??Math.min(...a);p.push({id:n,conversationId:e,title:r?.title??`Conversation`,agent:r?.agent??`Agent`,start:o,end:Math.max(o,...a),running:!1});let s={id:`q:`+n,kind:`question`,title:_(i?.text??r?.title??`Conversation`,160),text:i?.text??r?.title??``,at:o,turn:n,conversationId:e,agent:r?.agent,events:[],meaning:{session:r?.title??`Conversation`,conversationId:e,...i?{message:{id:i.id,at:i.at}}:{}}};l.set(s.id,s),x(n,s,e),S(n,e)}function b(t){return[...s.values()].filter(n=>n.conversationId===t&&[`results`,`figures`].includes(i.get(n.path)?.category??e.kindOf(n.path)??``))}function x(e,t,n){for(let r of b(n)){if(l.has(`m:f:`+r.path))continue;let n=Date.parse(r.observedAt),i=v(r.path,e,n);m(u,t.id,i.id,`made`,`observed`,n,e)}}function S(e,n){let r=e=>!n||e.turn.startsWith(n+`/`),i=new Map(t.nodes.map(e=>[e.id,e])),a=!0;for(;a;){a=!1;for(let n of[...l.values()])if(n.kind===`file`&&n.path&&n.events[0]?.turn===e){for(let o of t.edges.filter(e=>r(e)&&i.get(e.to)?.path===n.path)){let r=i.get(o.from);if(r?.kind===`run`)for(let s of t.edges.filter(e=>e.to===r.id&&(e.label===`runs`||e.label===`named`))){let t=i.get(s.from);if(!t?.path||t.path===n.path)continue;let r=l.size,c=v(t.path,e,s.at);m(u,n.id,c.id,s.label===`runs`?`made by`:`named with`,o.basis,o.at,e),l.size>r&&(a=!0)}}if(n.category===`code`)for(let o of t.edges.filter(e=>r(e)&&e.label===`runs`&&i.get(e.from)?.path===n.path))for(let r of t.edges.filter(e=>e.to===o.to&&e.label===`named`)){let t=i.get(r.from);if(!t?.path||t.path===n.path)continue;let o=l.size;m(u,n.id,v(t.path,e,r.at).id,`reads`,`named`,r.at,e),l.size>o&&(a=!0)}}}}for(let e of l.values()){if(e.kind!==`file`||!e.path)continue;let t=g(e.path,e.resource?.version)??g(e.path);t&&m(d,e.id,t.id,`kept as`,`observed`,e.capturedAt??e.at,e.events[0].turn)}let C=`m:f:`+a,w=e=>e.from!==C&&e.to!==C;return{nodes:[...l.values()].filter(e=>e.id!==C),edges:[...u.values()].filter(w),turns:p,traces:[...d.values()].filter(w)}}function y(e,t,n){return n===`process`||!t||!t.nodes.length?e:n===`meaning`?{...e,nodes:t.nodes,edges:t.edges,turns:t.turns,events:[],live:null,omittedNodes:0}:{...e,nodes:[...t.nodes,...e.nodes],edges:[...t.edges,...t.traces,...e.edges],turns:[...t.turns,...e.turns]}}var b={versions:24},x=new Map;function S(e,t,n,r,a,d=[]){let p=t.project.id,h=(0,g.useMemo)(()=>n.nodes.filter(e=>e.kind===`file`&&e.path===`project-notes.md`).flatMap(e=>(e.versions??(e.resource?[{resource:e.resource,capturedAt:e.capturedAt??e.at}]:[])).map(t=>({...t,turn:e.events.find(e=>e.action===`capture`&&e.key.endsWith(`:`+t.resource.id))?.turn??e.events[0]?.turn??``}))).sort((e,t)=>e.capturedAt-t.capturedAt).slice(-b.versions),[n]),_=h.map(e=>e.resource.version).join(`,`),[y,S]=(0,g.useState)([]);return(0,g.useEffect)(()=>{let t=!0;return Promise.all(h.map(t=>{let n=p+`:`+t.resource.id+`@`+t.resource.version;return x.has(n)||x.set(n,s(e,p,t.resource,o.maxTitleBytes).then(e=>new TextDecoder().decode(e)).catch(()=>(x.delete(n),``))),x.get(n).then(e=>({text:e,at:t.capturedAt,turn:t.turn,conversationId:t.turn.split(`/`)[0]??``,resource:t.resource}))})).then(e=>{t&&S(e.filter(e=>e.text))}),()=>{t=!1}},[e,p,_]),(0,g.useMemo)(()=>{let e=m(a.length>o.maxTitleBytes?``:a),t=e=>n.nodes.filter(t=>t.kind===`file`&&t.path===e).flatMap(e=>e.versions??(e.resource?[{resource:e.resource,capturedAt:e.capturedAt??e.at}]:[])).map(e=>({at:e.capturedAt,resource:e.resource})),s=e=>{let t=r.find(t=>t.path===e);return t?.modifiedAt?Date.parse(t.modifiedAt):null},p=new Map;for(let n of e)for(let e of n.statements)p.set(e,u(e,y,t,s));let g=l(d),_=f(e);return{meanings:e,traces:p,layer:v({process:n,meanings:e,traces:p,files:r,kindOf:e=>i(e),described:g}),descriptions:_,versions:{read:y.length,kept:h.length},holds:e=>c(e,_,g)}},[a,y,n,r,d])}var C=t();function w({statement:e,trace:t,conversationId:n,client:i,projectId:a,onPath:o,onSent:s}){let[c,l]=(0,g.useState)(null),u=e=>t?.files.find(t=>t.path===e)?.later,f=e=>e.map(e=>(0,C.jsxs)(`button`,{className:`work-file`,title:e+(u(e)===`kept`?` · a newer version was kept since this was written`:u(e)===`written`?` · written again since this was written`:``),onClick:()=>o(e),children:[(0,C.jsx)(r,{name:/\.(png|jpe?g|svg)$/i.test(e)?`image`:/\.(csv|tsv)$/i.test(e)?`table`:`file`,size:13}),(0,C.jsx)(`span`,{children:e.split(`/`).at(-1)}),u(e)&&(0,C.jsx)(`small`,{children:`changed since`})]},e)),{topic:m,rest:_}=d(p(e.text,e.links)),v=e.alternatives??[];return(0,C.jsx)(`div`,{className:`choice`+(m?``:` untitled`),children:(0,C.jsxs)(`div`,{className:`choice-grid`,children:[m&&(0,C.jsx)(`p`,{className:`choice-topic`,children:m}),(0,C.jsxs)(`div`,{className:`choice-body`,children:[(0,C.jsx)(`p`,{className:`choice-taken`,children:_}),e.links.length>0&&(0,C.jsx)(`div`,{className:`choice-foot`,children:f(e.links)}),v.map((t,r)=>(0,C.jsxs)(`div`,{className:`choice-other`,children:[(0,C.jsxs)(`p`,{children:[(0,C.jsx)(`span`,{className:`choice-other-label`,children:`Other option`}),h(p(t.text,t.links))]}),t.links.length>0&&(0,C.jsx)(`div`,{className:`choice-foot`,children:f(t.links)}),n&&c!==r&&(0,C.jsx)(`button`,{className:`text-button choice-instead`,onClick:()=>l(r),children:`Use this instead…`}),n&&c===r&&(0,C.jsx)(T,{conversationId:n,client:i,projectId:a,taken:e.text,option:t.text,onCancel:()=>l(null),onSent:e=>{l(null),s?.(e)}})]},r))]})]})})}function T({conversationId:e,client:t,projectId:n,taken:r,option:i,onCancel:a,onSent:o}){let[s,c]=(0,g.useState)(`Use this option instead: “${i}” (in place of “${r}”). Redo what depends on it and update the notes.`),[l,u]=(0,g.useState)(!1),[d,f]=(0,g.useState)(``),p=(0,g.useRef)(null);async function m(){if(s.trim()&&!l){p.current?.text!==s&&(p.current={text:s,changeId:`choice-`+crypto.randomUUID()}),u(!0),f(``);try{await t.call(`conversation.send`,{projectId:n,conversationId:e,changeId:p.current.changeId,text:s}),p.current=null,o(e)}catch(e){f(e instanceof Error?e.message:`The message could not be sent.`)}finally{u(!1)}}}return(0,C.jsxs)(`form`,{className:`choice-send`,onSubmit:e=>{e.preventDefault(),m()},onKeyDown:e=>{e.key===`Escape`&&a()},children:[(0,C.jsx)(`textarea`,{rows:3,value:s,"aria-label":`Message to the Agent`,onChange:e=>c(e.target.value),autoFocus:!0}),d&&(0,C.jsx)(`p`,{className:`inline-error`,role:`alert`,children:d}),(0,C.jsxs)(`div`,{className:`choice-send-actions`,children:[(0,C.jsx)(`button`,{type:`button`,onClick:a,children:`Cancel`}),(0,C.jsx)(`button`,{type:`submit`,className:`primary`,disabled:l||!s.trim(),children:l?`Sending…`:`Send to the Agent`})]})]})}export{S as n,y as r,w as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{n,t as r}from"./react-Dss-ouuy.js";import{a as i}from"./home-CCbP6kS-.js";import{r as a}from"./markdown-0ngRuTpW.js";import{N as o,i as s}from"./canvas-
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{n,t as r}from"./react-Dss-ouuy.js";import{a as i}from"./home-CCbP6kS-.js";import{r as a}from"./markdown-0ngRuTpW.js";import{N as o,i as s}from"./canvas-D8rDdfDz.js";import{At as c,Gt as l,Ht as u,Nt as d,Ut as f,Wt as p,kt as m}from"./index-CxmItXqa.js";import{c as h,l as g,t as _}from"./facts-BMO6V3-3.js";import{t as v}from"./work-turns-BvJlIMmA.js";var y=n(),b=t(r(),1),x={shownBytes:262144,pollMs:700,listed:50},S=e=>e instanceof Error?e.message:`The Console could not be reached.`,C=e=>[`unavailable`,`unauthorized`].includes(e?.error?.kind??``),w=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`});function T(e){if(e<1e4)return(Math.max(e,100)/1e3).toFixed(1)+` s`;if(e<6e4)return Math.round(e/1e3)+` s`;let t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return t+` min`+(n?` `+n+` s`:``)}function E(e,t,n){N();let[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)({off:!1,problem:``}),s=(0,b.useCallback)(()=>e.call(`console.list`,{projectId:t,limit:x.listed}).then(e=>{i(e.commands),o({off:!1,problem:``})},e=>o({off:C(e),problem:S(e)})),[e,t]);return(0,b.useEffect)(()=>{s()},[s,n]),{commands:r,...a,read:s}}function D(e,t,{onRan:n,center:r=!1}={}){let[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(``),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(``),f=(0,b.useRef)(null),p=(0,b.useRef)(null);async function m(r){if(r.trim()&&!c){f.current?.command!==r&&(f.current={command:r,changeId:`console-`+crypto.randomUUID()}),l(!0),d(``);try{await e.call(`console.run`,{projectId:t,command:r,changeId:f.current.changeId}),f.current=null,a(``),s(``),n?.()}catch(e){d(S(e))}finally{l(!1)}}}async function h(r){try{await e.call(`console.stop`,{projectId:t,commandId:r.commandId,changeId:`stop-`+r.commandId}),n?.()}catch(e){d(S(e))}}function g(e,t){a(e),s(`From `+t+`. Check it, then press Run.`),d(``),r&&p.current?.scrollIntoView({block:`center`}),p.current?.focus()}return{draft:i,setDraft:e=>{a(e),e||s(``)},note:o,busy:c,problem:u,input:p,start:m,stop:h,prepare:g}}function O({folder:e,line:t,problem:n}){N();let{draft:r,setDraft:i,note:a,busy:o,input:s}=t,c=Math.min(8,r.split(`
|
|
2
2
|
`).length),l=(0,b.useId)(),u=t.problem||n;return(0,y.jsxs)(`form`,{className:`console-prompt`,onSubmit:e=>{e.preventDefault(),t.start(r)},children:[(0,y.jsxs)(`label`,{htmlFor:l,className:`console-prompt-label`,children:[`Run a command in `,(0,y.jsx)(`strong`,{children:e})]}),(0,y.jsxs)(`div`,{className:`console-line`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,children:`$`}),(0,y.jsx)(`textarea`,{id:l,ref:s,rows:c,value:r,spellCheck:!1,autoComplete:`off`,autoCapitalize:`off`,placeholder:`python3 analysis.py`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),t.start(r))}}),(0,y.jsx)(`button`,{type:`submit`,className:`primary`,disabled:o||!r.trim(),children:o?`Starting…`:`Run`})]}),a&&(0,y.jsx)(`p`,{className:`console-note`,children:a}),u&&(0,y.jsx)(`p`,{className:`inline-error`,role:`alert`,children:u})]})}function k(e,t,n,r){let[i,a]=(0,b.useState)({text:``,more:!1,problem:``}),o=(0,b.useRef)(0);return(0,b.useEffect)(()=>{if(!r)return;let i=!0,s,c=async()=>{try{for(;;){if(o.current>=x.shownBytes){a(e=>({...e,more:!0}));return}let r=await e.call(`console.output`,{projectId:t,commandId:n.commandId,offset:o.current,maxBytes:65536});if(!i)return;if(o.current=r.nextOffset,a(e=>({text:e.text+r.text,more:!1,problem:``})),!r.more)break}}catch(e){i&&a(t=>({...t,problem:S(e)}))}i&&n.state===`running`&&(s=setTimeout(c,x.pollMs))};return c(),()=>{i=!1,clearTimeout(s)}},[e,t,n.commandId,n.state,r]),i}var A=e=>e.state===`running`?`Running`:e.state===`stopped`?`Stopped`:e.state===`continuing`?`Still running outside Rho`:e.state===`unknown`?`Outcome unknown`:e.state===`not-started`?`Did not start`:e.exit?.signal?`Ended by `+e.exit.signal:`Exit `+(e.exit?.code??`?`);function j({record:e,client:t,projectId:n,made:r,after:i,onRunAgain:a,onStop:o}){N();let[s,c]=(0,b.useState)(e.state===`running`),[l,u]=(0,b.useState)(Date.now()),d=k(t,n,e,s),f=e.state===`running`;(0,b.useEffect)(()=>{if(!f)return;let e=setInterval(()=>u(Date.now()),1e3);return()=>clearInterval(e)},[f]);let p=(e.endedAt?Date.parse(e.endedAt):l)-Date.parse(e.startedAt),m=e.state===`exited`&&e.exit?.code===0,h=[m?``:A(e),p>=1e3?T(p):``].filter(Boolean).join(` · `);return(0,y.jsxs)(`li`,{className:`console-command mine`+(r||f?` made`:``)+(!m&&!f?` problem`:``),children:[(0,y.jsxs)(`details`,{open:s,onToggle:e=>c(e.currentTarget.open),children:[(0,y.jsxs)(`summary`,{children:[(0,y.jsx)(`span`,{className:`console-time`,children:w(Date.parse(e.startedAt))}),(0,y.jsx)(`span`,{className:`console-what`,title:e.command,children:(0,y.jsx)(`code`,{className:`alone`,children:e.command})}),(0,y.jsx)(`span`,{className:`console-end`+(f?` running`:m?``:` problem`),children:h})]}),(0,y.jsxs)(`div`,{className:`console-detail`,children:[e.cwd&&(0,y.jsxs)(`p`,{className:`console-note`,children:[`In `,e.cwd,`/`]}),d.text?(0,y.jsx)(`pre`,{className:`console-output`,ref:e=>{e&&f&&(e.scrollTop=e.scrollHeight)},children:d.text}):(0,y.jsx)(`p`,{className:`console-note`,children:f?`Waiting for output…`:d.problem?``:`It printed nothing.`}),d.more&&(0,y.jsxs)(`p`,{className:`console-note`,children:[`Showing the first `,(x.shownBytes/1024).toFixed(0),` KiB of `,e.kept.toLocaleString(`en-US`),` kept bytes.`]}),e.cut&&!f&&(0,y.jsxs)(`p`,{className:`console-note`,children:[`It printed `,e.bytes.toLocaleString(`en-US`),` bytes; the middle was not kept.`]}),e.problem&&(0,y.jsx)(`p`,{className:`console-note`,children:e.problem}),d.problem&&(0,y.jsx)(`p`,{className:`inline-error`,role:`alert`,children:d.problem}),!f&&e.state!==`continuing`&&(0,y.jsx)(`div`,{className:`console-actions`,children:(0,y.jsx)(`button`,{className:`text-button console-again`,onClick:()=>a(e),children:`Run again`})})]})]}),i,f&&(0,y.jsx)(`div`,{className:`console-actions`,children:(0,y.jsx)(`button`,{className:`text-button console-again`,disabled:!!e.stop,onClick:()=>o(e),children:e.stop?`Stopping…`:`Stop`})})]})}var M=`.console-command { border-top: 1px solid var(--color-divider); }
|
|
3
3
|
.console-command summary { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 6px; margin: 0 -6px; border-radius: 6px; cursor: pointer; list-style: none; }
|
|
4
4
|
.console-command summary:hover { background: var(--color-hover); }
|