dsh-open-artifact 0.19.1 → 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.
- package/CHANGELOG.md +23 -0
- package/lib/client.js +1 -1
- package/lib/index.js +3 -3
- package/package.json +1 -1
- package/skills/open-artifact/SKILL.md +1 -1
- package/vendor/home/assets/{browser-models-CuvEg0Hm.js → browser-models-CEM3keW0.js} +4 -4
- package/vendor/home/assets/{main-Bfz_QbAb.js → main-CD6mLXro.js} +2 -2
- package/vendor/home/assets/main-CudjUC-z.css +1 -0
- package/vendor/home/assets/{node.browser-Dg3f5wnV.js → node.browser-5FosC0Jx.js} +1 -1
- package/vendor/home/assets/{node.browser-CA5eNPFK.js → node.browser-DZzq1E_m.js} +1 -1
- package/vendor/home/index.html +2 -2
- package/vendor/open-artifact.mjs +19 -8
- package/vendor/runtime.json +1 -1
- package/vendor/shell/assets/{browser-models-D6sLTStW.js → browser-models-DiCdSmg7.js} +4 -4
- package/vendor/shell/assets/index-CudjUC-z.css +1 -0
- package/vendor/{type-server/shell/assets/index-DUlkQIc2.js → shell/assets/index-K1SKNjv-.js} +19 -19
- package/vendor/shell/assets/{node.browser-Dom693pr.js → node.browser-DF3wedOZ.js} +1 -1
- package/vendor/shell/assets/{node.browser-JBLNXGXd.js → node.browser-mz1-CgQF.js} +1 -1
- package/vendor/shell/index.html +2 -2
- package/vendor/type-server/cli.mjs +26 -4
- package/vendor/type-server/editors/design/assets/{index-CWVS8sEC.js → index-UWsnN0RP.js} +118 -118
- package/vendor/type-server/editors/design/index.html +1 -1
- package/vendor/type-server/editors/slides/assets/{index-DNd0a5AT.js → index-Cd8_0xQf.js} +103 -103
- package/vendor/type-server/editors/slides/assets/{src-QKaUghQ7.js → src-YYMn9WN3.js} +1 -1
- package/vendor/type-server/editors/slides/index.html +1 -1
- package/vendor/type-server/editors/whiteboard/assets/{gif-jobs-CvntHyno.js → gif-jobs-D1FISsUT.js} +1 -1
- package/vendor/type-server/editors/whiteboard/assets/{index-ifqwq1AR.js → index-BfYFnyuU.js} +89 -89
- package/vendor/type-server/editors/whiteboard/assets/{index-BIiUMoHl.js → index-C7gRSC0a.js} +2 -2
- package/vendor/type-server/editors/whiteboard/index.html +1 -1
- package/vendor/type-server/shell/assets/{browser-models-D6sLTStW.js → browser-models-DiCdSmg7.js} +4 -4
- package/vendor/type-server/shell/assets/index-CudjUC-z.css +1 -0
- package/vendor/{shell/assets/index-DUlkQIc2.js → type-server/shell/assets/index-K1SKNjv-.js} +19 -19
- package/vendor/type-server/shell/assets/{node.browser-Dom693pr.js → node.browser-DF3wedOZ.js} +1 -1
- package/vendor/type-server/shell/assets/{node.browser-JBLNXGXd.js → node.browser-mz1-CgQF.js} +1 -1
- package/vendor/type-server/shell/index.html +2 -2
- package/vendor/home/assets/main-DK7ftEF8.css +0 -1
- package/vendor/shell/assets/index-DK7ftEF8.css +0 -1
- package/vendor/type-server/shell/assets/index-DK7ftEF8.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as s}from"./browser-models-
|
|
1
|
+
import{A as s}from"./browser-models-DiCdSmg7.js";import{D as R,M as N}from"./browser-models-DiCdSmg7.js";import"./index-K1SKNjv-.js";function e(o){throw new s(`${o} requires Node.js or a Node-compatible runtime`)}const u=3e4,c=".anthropic-memory-store";var l=(()=>{class o extends s{constructor(t,n){super(t),n!==void 0&&(this.cause=n)}}return o._errorName="SessionMemoryError",o})();class S{constructor(r,t){e("SessionMemoryStores")}get roots(){return e("SessionMemoryStores")}get readOnlyRoots(){return e("SessionMemoryStores")}download(r){return e("SessionMemoryStores")}finish(){return e("SessionMemoryStores")}syncAll(r){return e("SessionMemoryStores")}syncIfDue(){return e("SessionMemoryStores")}flushWrites(r){return e("SessionMemoryStores")}dispose(){return e("SessionMemoryStores")}}function _(o){return e("setupSkills")}function m(o,r){return e("extractSkillArchive")}function M(o){return e("betaAgentToolset20260401")}function T(o,r){return e("resolvePath")}var h=(()=>{class o extends s{constructor(t){super(`bash command timed out after ${t}ms`),this.timeoutMs=t}}return o._errorName="BashTimeoutError",o})();class d{constructor(r,t){e("BashSession")}get closed(){return e("BashSession")}exec(r,t={}){return e("BashSession")}close(){e("BashSession")}}function f(o){return e("betaBashTool")}function b(o){return e("betaReadTool")}function p(o){return e("betaWriteTool")}function y(o){return e("betaEditTool")}function E(o){return e("betaGlobTool")}function x(o){return e("betaGrepTool")}export{d as BashSession,h as BashTimeoutError,R as DEFAULT_MEMORY_SYNC_INTERVAL_MS,c as MARKER_PATH,u as MEMORY_FLUSH_TIMEOUT_MS,N as MIN_MEMORY_SYNC_INTERVAL_MS,l as SessionMemoryError,S as SessionMemoryStores,M as betaAgentToolset20260401,f as betaBashTool,y as betaEditTool,E as betaGlobTool,x as betaGrepTool,b as betaReadTool,p as betaWriteTool,m as extractSkillArchive,T as resolvePath,_ as setupSkills};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as o}from"./browser-models-
|
|
1
|
+
import{A as o}from"./browser-models-DiCdSmg7.js";import"./index-K1SKNjv-.js";function n(e){return new Proxy({},{get(i,t){if(typeof t!="symbol")throw new o(`\`${e}.${t}\` is not available in this environment; it needs a Node.js-compatible runtime`)}})}const s=n("fs"),f=n("path");export{s as fs,f as path};
|
package/vendor/shell/index.html
CHANGED
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
color: var(--oa-preboot-fg);
|
|
115
115
|
}
|
|
116
116
|
</style>
|
|
117
|
-
<script type="module" crossorigin src="/_open-artifact/shell/assets/index-
|
|
118
|
-
<link rel="stylesheet" crossorigin href="/_open-artifact/shell/assets/index-
|
|
117
|
+
<script type="module" crossorigin src="/_open-artifact/shell/assets/index-K1SKNjv-.js"></script>
|
|
118
|
+
<link rel="stylesheet" crossorigin href="/_open-artifact/shell/assets/index-CudjUC-z.css">
|
|
119
119
|
</head>
|
|
120
120
|
<body>
|
|
121
121
|
<div id="root"></div>
|
|
@@ -270,7 +270,14 @@ var init_sample = __esm({
|
|
|
270
270
|
});
|
|
271
271
|
|
|
272
272
|
// packages/protocol/src/library.ts
|
|
273
|
-
|
|
273
|
+
function hasScreen(platform, env) {
|
|
274
|
+
return platform === "darwin" || platform === "win32" || !!env.DISPLAY || !!env.WAYLAND_DISPLAY;
|
|
275
|
+
}
|
|
276
|
+
function shellComputer(platform, env) {
|
|
277
|
+
const asked = (env[DOWNLOADS_ENV] ?? "").trim().toLowerCase();
|
|
278
|
+
return { platform, screen: hasScreen(platform, env), ...asked === "browser" || asked === "folder" ? { downloads: asked } : {} };
|
|
279
|
+
}
|
|
280
|
+
var SITE_TYPE_STANDINGS, utf82, LIBRARY_ROUTES, DOWNLOADS_ENV;
|
|
274
281
|
var init_library = __esm({
|
|
275
282
|
"packages/protocol/src/library.ts"() {
|
|
276
283
|
"use strict";
|
|
@@ -403,6 +410,7 @@ var init_library = __esm({
|
|
|
403
410
|
*/
|
|
404
411
|
...SAMPLE_LIBRARY_ROUTES
|
|
405
412
|
};
|
|
413
|
+
DOWNLOADS_ENV = "OPEN_ARTIFACT_DOWNLOADS";
|
|
406
414
|
}
|
|
407
415
|
});
|
|
408
416
|
|
|
@@ -53414,8 +53422,13 @@ function createTypeServer(options) {
|
|
|
53414
53422
|
...options.lanAddresses ? { addresses: options.lanAddresses } : {},
|
|
53415
53423
|
...options.isLocal ? { isLocal: options.isLocal } : {}
|
|
53416
53424
|
});
|
|
53425
|
+
const isAnonymousViewer = (who2) => who2.kind === "anonymous" || who2.id === "anonymous";
|
|
53417
53426
|
const peerList = (artifact) => [...artifact.peers.values()];
|
|
53418
53427
|
const peerViewers = /* @__PURE__ */ new Map();
|
|
53428
|
+
const mayHoldClient = (artifact, client, viewer2) => {
|
|
53429
|
+
const holder = artifact.clients.get(client)?.viewer.id;
|
|
53430
|
+
return holder === void 0 || holder === viewer2.id;
|
|
53431
|
+
};
|
|
53419
53432
|
const makeDbHost = (artifact) => {
|
|
53420
53433
|
const host = new DbHost({
|
|
53421
53434
|
root: artifact.root,
|
|
@@ -53523,6 +53536,10 @@ function createTypeServer(options) {
|
|
|
53523
53536
|
client.end();
|
|
53524
53537
|
return () => void 0;
|
|
53525
53538
|
}
|
|
53539
|
+
if (!mayHoldClient(artifact, id, client.viewer)) {
|
|
53540
|
+
client.end();
|
|
53541
|
+
return () => void 0;
|
|
53542
|
+
}
|
|
53526
53543
|
let closed = false;
|
|
53527
53544
|
let closeSheet = null;
|
|
53528
53545
|
let expiry;
|
|
@@ -54021,6 +54038,7 @@ function createTypeServer(options) {
|
|
|
54021
54038
|
}
|
|
54022
54039
|
case API.events: {
|
|
54023
54040
|
const client = url.searchParams.get("client") || randomBytes15(8).toString("hex");
|
|
54041
|
+
if (!mayHoldClient(artifact, client, who2)) throw new HttpError(403, "not_granted", "That client is someone else.");
|
|
54024
54042
|
res.writeHead(200, {
|
|
54025
54043
|
"content-type": "text/event-stream; charset=utf-8",
|
|
54026
54044
|
"cache-control": "no-store",
|
|
@@ -54112,6 +54130,7 @@ data: ${JSON.stringify(payload)}
|
|
|
54112
54130
|
if (typeof body.client !== "string" || !body.patch || typeof body.patch !== "object") throw new HttpError(400, "invalid", "client and patch are required.");
|
|
54113
54131
|
const holder = artifact.clients.get(body.client)?.viewer.id ?? peerViewers.get(`${artifact.id}\0${body.client}`);
|
|
54114
54132
|
if (holder && holder !== who2.id) throw new HttpError(403, "not_granted", "That client is someone else.");
|
|
54133
|
+
if (isAnonymousViewer(who2)) return sendJson(res, 200, { ok: true });
|
|
54115
54134
|
peerViewers.set(`${artifact.id}\0${body.client}`, who2.id);
|
|
54116
54135
|
if (artifact.clients.has(body.client)) artifact.usedAt.set(body.client, Date.now());
|
|
54117
54136
|
const peer = { ...artifact.peers.get(body.client) ?? { id: body.client, kind: "person", state: {} }, name: who2.name };
|
|
@@ -54811,7 +54830,10 @@ data: ${JSON.stringify(payload)}
|
|
|
54811
54830
|
userName: who2.role === "owner" ? who2.name : "",
|
|
54812
54831
|
agentName: "Agent",
|
|
54813
54832
|
version: SERVER_VERSION,
|
|
54814
|
-
typeServer: { role: who2.role, invite, ...canManageFrameShare && { sharePath: FRAME_SHARE_PATH } }
|
|
54833
|
+
typeServer: { role: who2.role, invite, ...canManageFrameShare && { sharePath: FRAME_SHARE_PATH } },
|
|
54834
|
+
// The owner's Shell alone: it may be in a browser on another device (a forwarded port), where this computer's
|
|
54835
|
+
// Downloads folder is out of reach. A guest's page never saves here, and a host has no folder.
|
|
54836
|
+
...who2.role === "owner" && !hosting && { computer: shellComputer(process.platform, process.env) }
|
|
54815
54837
|
};
|
|
54816
54838
|
const html = template.replace("/*__OPEN_ARTIFACT_BOOT__*/null", () => JSON.stringify(boot).replace(/</g, "\\u003c"));
|
|
54817
54839
|
return send(res, 200, who2.role === "owner" ? html : withShim(html), mimeOf("index.html"), {
|
|
@@ -54906,7 +54928,7 @@ Content-Length: 0\r
|
|
|
54906
54928
|
if (hosting) {
|
|
54907
54929
|
if (!isTypeName(type) || !hosted.has(type) || !token2 || rest.join("/") !== API.events) return 404;
|
|
54908
54930
|
return resolveHosted(token2, type, req, "socket").then(
|
|
54909
|
-
(found) => !found || !originAllowed(found.artifact) ? 403 : { artifact: found.artifact, who: found.who, client },
|
|
54931
|
+
(found) => !found || !originAllowed(found.artifact) || !mayHoldClient(found.artifact, client, found.who) ? 403 : { artifact: found.artifact, who: found.who, client },
|
|
54910
54932
|
(error) => {
|
|
54911
54933
|
log(`events ${token2.slice(0, 12)}\u2026: ${error instanceof Error ? error.message : String(error)}`);
|
|
54912
54934
|
return 500;
|
|
@@ -54917,7 +54939,7 @@ Content-Length: 0\r
|
|
|
54917
54939
|
if (!isTypeName(type) || !artifact || artifact.type !== type || rest.join("/") !== API.events) return 404;
|
|
54918
54940
|
if (!originAllowed(artifact)) return 403;
|
|
54919
54941
|
const who2 = localViewerOf(artifact, req);
|
|
54920
|
-
if (!who2) return 403;
|
|
54942
|
+
if (!who2 || !mayHoldClient(artifact, client, who2)) return 403;
|
|
54921
54943
|
return { artifact, who: who2, client };
|
|
54922
54944
|
}
|
|
54923
54945
|
async function connect3(req, socket) {
|