dsh-open-artifact 0.19.0 → 0.19.2

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 (44) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/lib/client.js +1 -1
  3. package/lib/index.js +3 -3
  4. package/package.json +1 -1
  5. package/skills/open-artifact/SKILL.md +1 -1
  6. package/vendor/home/assets/RuntimeUpdate-kcFXr6yv.js +43 -0
  7. package/vendor/home/assets/{browser-models-CwzcLdx1.js → browser-models-CEM3keW0.js} +10 -10
  8. package/vendor/home/assets/library-BYyzKdnk.js +221 -0
  9. package/vendor/home/assets/main-CD6mLXro.js +5 -0
  10. package/vendor/home/assets/main-CudjUC-z.css +1 -0
  11. package/vendor/home/assets/node.browser-5FosC0Jx.js +1 -0
  12. package/vendor/home/assets/node.browser-DZzq1E_m.js +1 -0
  13. package/vendor/home/index.html +3 -2
  14. package/vendor/home/library/index.html +13 -0
  15. package/vendor/open-artifact.mjs +58 -14
  16. package/vendor/runtime.json +1 -1
  17. package/vendor/{type-server/shell/assets/browser-models-D6sLTStW.js → shell/assets/browser-models-DiCdSmg7.js} +4 -4
  18. package/vendor/shell/assets/index-CudjUC-z.css +1 -0
  19. package/vendor/{type-server/shell/assets/index-DUlkQIc2.js → shell/assets/index-K1SKNjv-.js} +19 -19
  20. package/vendor/{home/assets/node.browser-aB_4aVNC.js → shell/assets/node.browser-DF3wedOZ.js} +1 -1
  21. package/vendor/shell/assets/{node.browser-JBLNXGXd.js → node.browser-mz1-CgQF.js} +1 -1
  22. package/vendor/shell/index.html +2 -2
  23. package/vendor/type-server/cli.mjs +26 -4
  24. package/vendor/type-server/editors/design/assets/{index-CWVS8sEC.js → index-UWsnN0RP.js} +118 -118
  25. package/vendor/type-server/editors/design/index.html +1 -1
  26. package/vendor/type-server/editors/slides/assets/{index-DNd0a5AT.js → index-Cd8_0xQf.js} +103 -103
  27. package/vendor/type-server/editors/slides/assets/{src-QKaUghQ7.js → src-YYMn9WN3.js} +1 -1
  28. package/vendor/type-server/editors/slides/index.html +1 -1
  29. package/vendor/type-server/editors/whiteboard/assets/{gif-jobs-CvntHyno.js → gif-jobs-D1FISsUT.js} +1 -1
  30. package/vendor/type-server/editors/whiteboard/assets/{index-ifqwq1AR.js → index-BfYFnyuU.js} +89 -89
  31. package/vendor/type-server/editors/whiteboard/assets/{index-BIiUMoHl.js → index-C7gRSC0a.js} +2 -2
  32. package/vendor/type-server/editors/whiteboard/index.html +1 -1
  33. package/vendor/{shell/assets/browser-models-D6sLTStW.js → type-server/shell/assets/browser-models-DiCdSmg7.js} +4 -4
  34. package/vendor/type-server/shell/assets/index-CudjUC-z.css +1 -0
  35. package/vendor/{shell/assets/index-DUlkQIc2.js → type-server/shell/assets/index-K1SKNjv-.js} +19 -19
  36. package/vendor/{shell/assets/node.browser-Dom693pr.js → type-server/shell/assets/node.browser-DF3wedOZ.js} +1 -1
  37. package/vendor/type-server/shell/assets/{node.browser-JBLNXGXd.js → node.browser-mz1-CgQF.js} +1 -1
  38. package/vendor/type-server/shell/index.html +2 -2
  39. package/vendor/home/assets/index-D2T3Huww.js +0 -46
  40. package/vendor/home/assets/index-DK7ftEF8.css +0 -1
  41. package/vendor/home/assets/node.browser-CQTMP2wJ.js +0 -1
  42. package/vendor/shell/assets/index-DK7ftEF8.css +0 -1
  43. package/vendor/type-server/shell/assets/index-DK7ftEF8.css +0 -1
  44. package/vendor/type-server/shell/assets/node.browser-Dom693pr.js +0 -1
@@ -5,8 +5,9 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>Open Artifact</title>
7
7
  <script>window.__OPEN_ARTIFACT_HOME__ = /*__OPEN_ARTIFACT_HOME__*/null;</script>
8
- <script type="module" crossorigin src="/_open-artifact/home/assets/index-D2T3Huww.js"></script>
9
- <link rel="stylesheet" crossorigin href="/_open-artifact/home/assets/index-DK7ftEF8.css">
8
+ <script type="module" crossorigin src="/_open-artifact/home/assets/main-CD6mLXro.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/_open-artifact/home/assets/RuntimeUpdate-kcFXr6yv.js">
10
+ <link rel="stylesheet" crossorigin href="/_open-artifact/home/assets/main-CudjUC-z.css">
10
11
  </head>
11
12
  <body>
12
13
  <div id="root"></div>
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>Open Artifact</title>
7
+ <script type="module" crossorigin src="/_open-artifact/home/assets/library-BYyzKdnk.js"></script>
8
+ <link rel="modulepreload" crossorigin href="/_open-artifact/home/assets/RuntimeUpdate-kcFXr6yv.js">
9
+ </head>
10
+ <body>
11
+ <div id="root"></div>
12
+ </body>
13
+ </html>
@@ -403,7 +403,14 @@ function askRequestText(value) {
403
403
  if (utf8Bytes(text3) > MAX_ASK_BYTES) throw new OpenArtifactError("too_large", `Shorten the message to ${MAX_ASK_BYTES} bytes (UTF-8) or fewer.`);
404
404
  return text3;
405
405
  }
406
- var SITE_TYPE_STANDINGS, MAX_ASK_BYTES, utf82, LIBRARY_ROUTES;
406
+ function hasScreen(platform, env) {
407
+ return platform === "darwin" || platform === "win32" || !!env.DISPLAY || !!env.WAYLAND_DISPLAY;
408
+ }
409
+ function shellComputer(platform, env) {
410
+ const asked = (env[DOWNLOADS_ENV] ?? "").trim().toLowerCase();
411
+ return { platform, screen: hasScreen(platform, env), ...asked === "browser" || asked === "folder" ? { downloads: asked } : {} };
412
+ }
413
+ var SITE_TYPE_STANDINGS, MAX_ASK_BYTES, utf82, LIBRARY_ROUTES, DOWNLOADS_ENV;
407
414
  var init_library = __esm({
408
415
  "packages/protocol/src/library.ts"() {
409
416
  "use strict";
@@ -537,6 +544,7 @@ var init_library = __esm({
537
544
  */
538
545
  ...SAMPLE_LIBRARY_ROUTES
539
546
  };
547
+ DOWNLOADS_ENV = "OPEN_ARTIFACT_DOWNLOADS";
540
548
  }
541
549
  });
542
550
 
@@ -3749,7 +3757,7 @@ var init_package = __esm({
3749
3757
  "packages/daemon/package.json"() {
3750
3758
  package_default = {
3751
3759
  name: "@open-artifact/daemon",
3752
- version: "0.19.0",
3760
+ version: "0.19.2",
3753
3761
  private: true,
3754
3762
  type: "module",
3755
3763
  description: "The Open Artifact daemon (`open-artifact`): type registry, artifact library, type servers, agent tools, wake routing, the Harness API, MCP and the Shell.",
@@ -3761,10 +3769,10 @@ var init_package = __esm({
3761
3769
  "./client": "./src/client.ts"
3762
3770
  },
3763
3771
  dependencies: {
3764
- "@open-artifact/harness-kit": "0.19.0",
3765
- "@open-artifact/model-gateway": "0.19.0",
3766
- "@open-artifact/protocol": "0.19.0",
3767
- "@open-artifact/server-sdk": "0.19.0"
3772
+ "@open-artifact/harness-kit": "0.19.2",
3773
+ "@open-artifact/model-gateway": "0.19.2",
3774
+ "@open-artifact/protocol": "0.19.2",
3775
+ "@open-artifact/server-sdk": "0.19.2"
3768
3776
  },
3769
3777
  license: "Apache-2.0"
3770
3778
  };
@@ -5620,7 +5628,7 @@ function systemBrowse(url) {
5620
5628
  if (/^(none|off|0|false)$/i.test(process.env.OPEN_ARTIFACT_BROWSER ?? "")) return false;
5621
5629
  if (!/^https?:\/\//.test(url)) return false;
5622
5630
  const platform = process.platform;
5623
- if (platform !== "darwin" && platform !== "win32" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY) return false;
5631
+ if (!hasScreen(platform, process.env)) return false;
5624
5632
  const [command, args] = platform === "darwin" ? ["open", [url]] : platform === "win32" ? ["cmd", ["/c", "start", '""', url]] : ["xdg-open", [url]];
5625
5633
  try {
5626
5634
  const child = spawn2(command, args, { detached: true, stdio: "ignore", windowsHide: true });
@@ -6506,6 +6514,7 @@ iframe:not([src]){display:none}
6506
6514
  <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color:var(--accent)" aria-hidden="true"><path d="M15 9V6a3 3 0 0 0-3-3H6a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h3"/><rect x="9" y="9" width="12" height="12" rx="3"/><circle cx="15" cy="15" r="2" fill="currentColor" stroke="none"/></svg>
6507
6515
  <div class="text"><div class="title" id="title">Open Artifact</div><div class="meta" id="meta">Loading…</div></div>
6508
6516
  <div class="actions">
6517
+ <button id="back" hidden title="Back to the Open Artifact library">Library</button>
6509
6518
  <button id="full" hidden>Full screen</button>
6510
6519
  <button id="open" disabled title="Open the page in your browser">Open in browser</button>
6511
6520
  <button id="send" class="primary" disabled title="Ask the agent to read the comments you left on the page">Send comments</button>
@@ -6522,7 +6531,7 @@ iframe:not([src]){display:none}
6522
6531
  var VERSION=__OPEN_ARTIFACT_VERSION__;
6523
6532
  /* How long the page has to greet the view once its frame loaded, to load at all, and the host to open a link. */
6524
6533
  var HELLO_MS=4000,LOAD_MS=15000,LINK_MS=3000;
6525
- var data=null,nextId=1,pending={},mode='inline',modes=[],told=0,caps=null,library=false;
6534
+ var data=null,home=null,libOrigin='',nextId=1,pending={},mode='inline',modes=[],told=0,caps=null,library=false;
6526
6535
  var shown=false,stuck=false,blocked=false,linkOff=false,timer=0;
6527
6536
  var root=document.documentElement,$=function(id){return document.getElementById(id);};
6528
6537
  function post(m){window.parent.postMessage(m,'*');}
@@ -6537,9 +6546,19 @@ iframe:not([src]){display:none}
6537
6546
  $('send').hidden=!(data&&data.url)||(!!caps&&!caps.message);
6538
6547
  }
6539
6548
  function setMode(m){mode=m||'inline';told=0;document.body.classList.toggle('full',mode==='fullscreen');$('full').textContent=mode==='fullscreen'?'Exit full screen':'Full screen';size();}
6549
+ function scheme(){
6550
+ var th=root.getAttribute('data-theme');
6551
+ if(th==='light'||th==='dark')return th;
6552
+ return window.matchMedia&&matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';
6553
+ }
6554
+ /* The library page's host_hello: it shows artifacts here (open_artifact), in this view's theme. */
6555
+ function helloLibrary(){
6556
+ var f=$('page').contentWindow;
6557
+ if(f&&libOrigin)f.postMessage({openArtifact:'host_hello',caps:{artifacts:true},protocol:1,theme:{scheme:scheme()}},libOrigin);
6558
+ }
6540
6559
  function context(c){
6541
6560
  if(!c)return;
6542
- if(c.theme==='light'||c.theme==='dark')root.setAttribute('data-theme',c.theme);
6561
+ if(c.theme==='light'||c.theme==='dark'){root.setAttribute('data-theme',c.theme);if(library)helloLibrary();}
6543
6562
  if(Array.isArray(c.availableDisplayModes))modes=c.availableDisplayModes;
6544
6563
  $('full').hidden=modes.indexOf('fullscreen')<0;
6545
6564
  if(c.displayMode)setMode(c.displayMode);
@@ -6589,6 +6608,8 @@ iframe:not([src]){display:none}
6589
6608
  if(!d||(!d.url&&!d.view_url))return;
6590
6609
  data=d;
6591
6610
  library=!d.url;
6611
+ if(library){home=d;libOrigin='';}
6612
+ $('back').hidden=library||!home;
6592
6613
  document.body.classList.toggle('library',library);
6593
6614
  $('title').textContent=d.title||(library?'Open Artifact':'Untitled artifact');
6594
6615
  $('meta').textContent=(d.type?d.type+' · ':'')+(d.view_url||d.url);
@@ -6609,7 +6630,17 @@ iframe:not([src]){display:none}
6609
6630
  }
6610
6631
  window.addEventListener('message',function(e){
6611
6632
  var m=e.data;
6612
- if(e.source&&e.source===$('page').contentWindow){if(m&&typeof m.openArtifact==='string')landed();return;}
6633
+ if(e.source&&e.source===$('page').contentWindow){
6634
+ if(!m||typeof m.openArtifact!=='string')return;
6635
+ landed();
6636
+ if(!library||!data||!data.view_url||e.origin!==new URL(data.view_url,location.href).origin)return;
6637
+ /* The library page: it says hello, then asks for the artifacts a card or a tile opens. */
6638
+ if(m.openArtifact==='home_hello'){libOrigin=e.origin;helloLibrary();}
6639
+ else if(m.openArtifact==='open_artifact'&&typeof m.id==='string'&&/^art_[0-9a-z]+$/.test(m.id)){
6640
+ show({url:'open-artifact://artifact/'+m.id,view_url:new URL('/a/'+m.id,data.view_url).href,title:typeof m.title==='string'?m.title:'',type:typeof m.type==='string'?m.type:''});
6641
+ }
6642
+ return;
6643
+ }
6613
6644
  if(e.source!==window.parent)return;
6614
6645
  if(!m||m.jsonrpc!=='2.0')return;
6615
6646
  if(m.method===undefined){var p=pending[m.id];if(p){delete pending[m.id];if(m.error)p.fail(m.error);else p.ok(m.result);}return;}
@@ -6626,6 +6657,7 @@ iframe:not([src]){display:none}
6626
6657
  $('full').onclick=function(){
6627
6658
  rpc('ui/request-display-mode',{mode:mode==='fullscreen'?'inline':'fullscreen'}).then(function(r){if(r&&r.mode)setMode(r.mode);},function(){});
6628
6659
  };
6660
+ $('back').onclick=function(){if(home)show(home);};
6629
6661
  $('open').onclick=openPage;
6630
6662
  $('open2').onclick=openPage;
6631
6663
  $('retry').onclick=function(){if(data&&data.view_url)frame(data.view_url);};
@@ -54366,6 +54398,7 @@ var daemon_exports = {};
54366
54398
  __export(daemon_exports, {
54367
54399
  BOOT_PLACEHOLDER: () => BOOT_PLACEHOLDER,
54368
54400
  Daemon: () => Daemon,
54401
+ LIBRARY_PATH: () => LIBRARY_PATH,
54369
54402
  UI_PATHS: () => UI_PATHS,
54370
54403
  VERSION: () => VERSION5,
54371
54404
  defaultUiDir: () => defaultUiDir,
@@ -54504,7 +54537,7 @@ async function startDaemon(options = {}) {
54504
54537
  await daemon3.start();
54505
54538
  return daemon3;
54506
54539
  }
54507
- var DATA_REFRESH_MS, here, VERSION5, BOOT_PLACEHOLDER, UI_PATHS, PAGE_IDLE_MS, TASK_TTL_MS, ACTING_GRACE_MS, OPEN_POLL_MS, OPEN_SETTLE_MS, OPEN_GIVE_UP_MS, BOOT_REUSE_MS, CONTENT_TYPES, FRAME_HOST, TYPE_ICON_ROUTE, contentType, restrictedStatic, langOf, isLoopback, escapeHtml, scriptJson, FALLBACK_SHELL, Daemon;
54540
+ var DATA_REFRESH_MS, here, VERSION5, BOOT_PLACEHOLDER, UI_PATHS, LIBRARY_PATH, PAGE_IDLE_MS, TASK_TTL_MS, ACTING_GRACE_MS, OPEN_POLL_MS, OPEN_SETTLE_MS, OPEN_GIVE_UP_MS, BOOT_REUSE_MS, CONTENT_TYPES, FRAME_HOST, TYPE_ICON_ROUTE, contentType, restrictedStatic, langOf, isLoopback, escapeHtml, scriptJson, FALLBACK_SHELL, Daemon;
54508
54541
  var init_daemon2 = __esm({
54509
54542
  "packages/daemon/src/daemon.ts"() {
54510
54543
  "use strict";
@@ -54548,6 +54581,7 @@ var init_daemon2 = __esm({
54548
54581
  VERSION5 = package_default.version ?? "0.0.0";
54549
54582
  BOOT_PLACEHOLDER = "/*__OPEN_ARTIFACT_BOOT__*/null";
54550
54583
  UI_PATHS = { shell: "/_open-artifact/shell/", home: "/_open-artifact/home/" };
54584
+ LIBRARY_PATH = `${UI_PATHS.home}library/`;
54551
54585
  PAGE_IDLE_MS = Number(process.env.OPEN_ARTIFACT_PAGE_IDLE_MS ?? 15 * 6e4);
54552
54586
  TASK_TTL_MS = 24 * 60 * 6e4;
54553
54587
  ACTING_GRACE_MS = Number(process.env.OPEN_ARTIFACT_ACTING_GRACE_MS ?? 3e3);
@@ -54821,7 +54855,8 @@ var init_daemon2 = __esm({
54821
54855
  settings: () => this.settings,
54822
54856
  workspaceFoldersOnly: options.workspaceFoldersOnly === true,
54823
54857
  viewUrl: (id) => this.viewUrl(id),
54824
- homeUrl: () => `${this.origin}/`,
54858
+ // The library page, or the home page when this build has none.
54859
+ homeUrl: () => `${this.origin}${existsSync20(join39(this.homeDir, "library", "index.html")) ? LIBRARY_PATH : "/"}`,
54825
54860
  openPage: (record) => this.openPage(record),
54826
54861
  reopenPage: (record) => this.reopenPage(record),
54827
54862
  reach: (type) => this.servers.reach(type),
@@ -55530,7 +55565,10 @@ ${rows}
55530
55565
  // for a frame type's page, inside its own page).
55531
55566
  ...restrictedStatic(type) ? { sandbox: RESTRICTED_FRAME_SANDBOX } : {},
55532
55567
  // The models panel is named for connectors too once the page declares one or has a connector permission.
55533
- ...declaredMcpServers(record.capabilities ?? null).length || Object.keys(this.models.grants.read().artifacts?.[record.id]?.mcp ?? {}).length ? { connectors: true } : {}
55568
+ ...declaredMcpServers(record.capabilities ?? null).length || Object.keys(this.models.grants.read().artifacts?.[record.id]?.mcp ?? {}).length ? { connectors: true } : {},
55569
+ // A browser on another device reaches the daemon as the owner too (a forwarded port, a proxy): the Shell tells
55570
+ // from this whether a file saved in this computer's Downloads folder would be out of the person's reach.
55571
+ computer: shellComputer(process.platform, process.env)
55534
55572
  };
55535
55573
  }
55536
55574
  /**
@@ -55789,6 +55827,12 @@ ${rows}
55789
55827
  thumbnailOf(id) {
55790
55828
  return readJson(join39(files.thumbnails(), `${id}.json`), null)?.v ?? null;
55791
55829
  }
55830
+ /** The thumbnail's Library API address (carrying its content stamp as `v=`), or `null` when none exists. */
55831
+ thumbnailUrlOf(id) {
55832
+ const v = this.thumbnailOf(id);
55833
+ if (!v || !existsSync20(this.thumbnailFile(id))) return null;
55834
+ return `/api/open-artifact.${LIBRARY_ROUTES.thumbnail}?id=${encodeURIComponent(id)}&v=${encodeURIComponent(v)}`;
55835
+ }
55792
55836
  /** One artifact as lists show it. */
55793
55837
  artifactView(record) {
55794
55838
  const type = this.typeOf(record);
@@ -55812,7 +55856,7 @@ ${rows}
55812
55856
  updatedAt: record.updatedAt,
55813
55857
  openedAt: record.openedAt ?? null,
55814
55858
  contentAt: this.contentAt(record),
55815
- thumbnail: this.thumbnailOf(record.id),
55859
+ thumbnail: this.thumbnailUrlOf(record.id),
55816
55860
  shared: this.sharedOnLan(record),
55817
55861
  open: this.pages.has(record.id),
55818
55862
  remote: record.remote ? { name: record.remote.name, host: record.remote.host, url: record.remote.url, syncedAt: record.remote.syncedAt } : null,
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.19.0",
2
+ "version": "0.19.2",
3
3
  "protocols": {
4
4
  "min": 1,
5
5
  "max": 1