@dsh-workbench/core 0.2.12 → 0.2.14

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 (27) hide show
  1. package/client.js +418 -114
  2. package/dist/client/client.body.js +418 -114
  3. package/dist/client/index.js +418 -114
  4. package/dist/host/index.js +78 -78
  5. package/dist/types/app/client.d.ts +87 -15
  6. package/dist/types/app/layouts/__tests__/kit-preview-nav.test.d.ts +1 -0
  7. package/dist/types/app/layouts/rightbar/kit-preview-controls.d.ts +1 -0
  8. package/dist/types/app/layouts/rightbar/kit-preview-frame.d.ts +4 -0
  9. package/dist/types/app/layouts/rightbar/kit-preview-hash.d.ts +1 -0
  10. package/dist/types/app/layouts/rightbar/kit-preview-rows.d.ts +1 -0
  11. package/dist/types/app/layouts/sidebar/ProjectSwitcher.d.ts +3 -1
  12. package/dist/types/app/layouts/sidebar/SidebarHeader.d.ts +12 -0
  13. package/dist/types/app/layouts/sidebar/WorkspaceAttentionDot.d.ts +9 -0
  14. package/dist/types/app/layouts/sidebar/WorkspaceAttentionTag.d.ts +7 -0
  15. package/dist/types/app/layouts/sidebar/__tests__/current-workspace.test.d.ts +1 -0
  16. package/dist/types/app/layouts/sidebar/current-workspace.d.ts +8 -0
  17. package/dist/types/app/layouts/sidebar/use-attention.d.ts +16 -0
  18. package/dist/types/app/layouts/sidebar/workspace-items.d.ts +2 -0
  19. package/dist/types/modules/sessions/index.d.ts +1 -0
  20. package/dist/types/modules/sessions/model/attention.d.ts +22 -0
  21. package/dist/types/modules/sessions/model/attention.test.d.ts +1 -0
  22. package/package.json +2 -2
  23. package/skills/workbench-module-diy/BUILD.md +1 -1
  24. package/skills/workbench-module-diy/DATASOURCE.md +1 -1
  25. package/skills/workbench-module-diy/KIT.md +57 -5
  26. package/skills/workbench-module-diy/PANEL.md +1 -1
  27. package/skills/workbench-module-diy/REVIEW.md +2 -2
@@ -435,84 +435,6 @@ function createPanelStateStore() {
435
435
  };
436
436
  }
437
437
  //#endregion
438
- //#region ../shared/dist/host/cli-error.js
439
- function unquote(raw) {
440
- const value = raw.trim();
441
- if (value.length >= 2 && (value.startsWith("\"") && value.endsWith("\"") || value.startsWith("'") && value.endsWith("'"))) return value.slice(1, -1);
442
- return value;
443
- }
444
- function joinBlock(previous, line, fold) {
445
- if (previous === "") return line;
446
- return fold ? `${previous} ${line}` : `${previous}\n${line}`;
447
- }
448
- function parseCliErrorEnvelope(text) {
449
- if (text === void 0 || text.trim() === "") return void 0;
450
- const lines = text.split("\n");
451
- const start = lines.findIndex((line) => /^error:\s*$/.test(line.trim()) || /^error:\s*\S/.test(line.trim()));
452
- if (start === -1) return void 0;
453
- const scalars = {};
454
- let current;
455
- let block;
456
- const errorIndent = lines[start]?.search(/\S/) ?? 0;
457
- for (const line of lines.slice(start + 1)) {
458
- if (line.trim() === "") continue;
459
- const indent = line.search(/\S/);
460
- if (block !== void 0 && indent > block.indent) {
461
- scalars[block.key] = joinBlock(scalars[block.key] ?? "", line.trim(), block.fold);
462
- continue;
463
- }
464
- block = void 0;
465
- if (indent <= errorIndent) break;
466
- const match = /^\s*(code|message|help|exitCode):\s*(.*)$/.exec(line);
467
- if (match === null) {
468
- if (current !== void 0) scalars[current] = `${scalars[current] ?? ""} ${line.trim()}`.trim();
469
- continue;
470
- }
471
- const [, key, value] = match;
472
- if (key === void 0) continue;
473
- const raw = (value ?? "").trim();
474
- const marker = /^([|>])[0-9]*([+-]?)$/.exec(raw);
475
- if (marker !== null) {
476
- scalars[key] = "";
477
- block = {
478
- key,
479
- fold: marker[1] === ">",
480
- indent
481
- };
482
- current = key;
483
- continue;
484
- }
485
- scalars[key] = unquote(raw);
486
- current = key;
487
- }
488
- const code = scalars["code"];
489
- const message = scalars["message"];
490
- if (code === void 0 || code === "") return void 0;
491
- const exitCode = scalars["exitCode"];
492
- return {
493
- code,
494
- message: message ?? code,
495
- ...scalars["help"] === void 0 || scalars["help"] === "" ? {} : { help: scalars["help"] },
496
- ...exitCode === void 0 || Number.isNaN(Number(exitCode)) ? {} : { exitCode: Number(exitCode) }
497
- };
498
- }
499
- function helpUrlOf(envelope) {
500
- return /https?:\/\/[^\s"'`]+/.exec(envelope.help ?? "")?.[0];
501
- }
502
- //#endregion
503
- //#region ../shared/dist/host/data-root.js
504
- function dshHome() {
505
- const configured = process.env.DSH_HOME?.trim();
506
- if (configured !== void 0 && configured !== "") return configured;
507
- return `${process.env.HOME ?? ""}/.dsh`;
508
- }
509
- function workbenchRoot() {
510
- return `${dshHome()}/workbench`;
511
- }
512
- function workspacesRoot() {
513
- return `${workbenchRoot()}/workspaces`;
514
- }
515
- //#endregion
516
438
  //#region ../shared/dist/host/opencli-window.js
517
439
  var OPENCLI_WINDOW_ENV = "OPENCLI_WINDOW=background";
518
440
  function backgroundPrefix() {
@@ -1023,6 +945,84 @@ async function browserFind(options) {
1023
945
  };
1024
946
  }
1025
947
  //#endregion
948
+ //#region ../shared/dist/host/cli-error.js
949
+ function unquote(raw) {
950
+ const value = raw.trim();
951
+ if (value.length >= 2 && (value.startsWith("\"") && value.endsWith("\"") || value.startsWith("'") && value.endsWith("'"))) return value.slice(1, -1);
952
+ return value;
953
+ }
954
+ function joinBlock(previous, line, fold) {
955
+ if (previous === "") return line;
956
+ return fold ? `${previous} ${line}` : `${previous}\n${line}`;
957
+ }
958
+ function parseCliErrorEnvelope(text) {
959
+ if (text === void 0 || text.trim() === "") return void 0;
960
+ const lines = text.split("\n");
961
+ const start = lines.findIndex((line) => /^error:\s*$/.test(line.trim()) || /^error:\s*\S/.test(line.trim()));
962
+ if (start === -1) return void 0;
963
+ const scalars = {};
964
+ let current;
965
+ let block;
966
+ const errorIndent = lines[start]?.search(/\S/) ?? 0;
967
+ for (const line of lines.slice(start + 1)) {
968
+ if (line.trim() === "") continue;
969
+ const indent = line.search(/\S/);
970
+ if (block !== void 0 && indent > block.indent) {
971
+ scalars[block.key] = joinBlock(scalars[block.key] ?? "", line.trim(), block.fold);
972
+ continue;
973
+ }
974
+ block = void 0;
975
+ if (indent <= errorIndent) break;
976
+ const match = /^\s*(code|message|help|exitCode):\s*(.*)$/.exec(line);
977
+ if (match === null) {
978
+ if (current !== void 0) scalars[current] = `${scalars[current] ?? ""} ${line.trim()}`.trim();
979
+ continue;
980
+ }
981
+ const [, key, value] = match;
982
+ if (key === void 0) continue;
983
+ const raw = (value ?? "").trim();
984
+ const marker = /^([|>])[0-9]*([+-]?)$/.exec(raw);
985
+ if (marker !== null) {
986
+ scalars[key] = "";
987
+ block = {
988
+ key,
989
+ fold: marker[1] === ">",
990
+ indent
991
+ };
992
+ current = key;
993
+ continue;
994
+ }
995
+ scalars[key] = unquote(raw);
996
+ current = key;
997
+ }
998
+ const code = scalars["code"];
999
+ const message = scalars["message"];
1000
+ if (code === void 0 || code === "") return void 0;
1001
+ const exitCode = scalars["exitCode"];
1002
+ return {
1003
+ code,
1004
+ message: message ?? code,
1005
+ ...scalars["help"] === void 0 || scalars["help"] === "" ? {} : { help: scalars["help"] },
1006
+ ...exitCode === void 0 || Number.isNaN(Number(exitCode)) ? {} : { exitCode: Number(exitCode) }
1007
+ };
1008
+ }
1009
+ function helpUrlOf(envelope) {
1010
+ return /https?:\/\/[^\s"'`]+/.exec(envelope.help ?? "")?.[0];
1011
+ }
1012
+ //#endregion
1013
+ //#region ../shared/dist/host/data-root.js
1014
+ function dshHome() {
1015
+ const configured = process.env.DSH_HOME?.trim();
1016
+ if (configured !== void 0 && configured !== "") return configured;
1017
+ return `${process.env.HOME ?? ""}/.dsh`;
1018
+ }
1019
+ function workbenchRoot() {
1020
+ return `${dshHome()}/workbench`;
1021
+ }
1022
+ function workspacesRoot() {
1023
+ return `${workbenchRoot()}/workspaces`;
1024
+ }
1025
+ //#endregion
1026
1026
  //#region ../shared/dist/host/facts.js
1027
1027
  function createFactLog(options = {}) {
1028
1028
  const epoch = options.epoch ?? `e${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;