dsh-open-artifact 0.8.1 → 0.8.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/lib/client.js +2 -2
- package/lib/index.js +41 -4
- package/package.json +1 -1
- package/skills/open-artifact/SKILL.md +1 -1
- package/vendor/artifact-types/data/scripts/cli.mjs +1 -1
- package/vendor/artifact-types/data/scripts/editors/data/assets/{index-CZiM2XTm.js → index-B041Zu27.js} +1 -1
- package/vendor/artifact-types/data/scripts/editors/data/index.html +1 -1
- package/vendor/artifact-types/{design/scripts/editors/design/assets/index-jhwXmpbV.js → data/scripts/editors/design/assets/index-D6-vjsn9.js} +1 -1
- package/vendor/artifact-types/data/scripts/editors/design/index.html +1 -1
- package/vendor/artifact-types/{design/scripts/editors/design-system/assets/index-7LPrsXBY.js → data/scripts/editors/design-system/assets/index-BoT2v4hc.js} +1 -1
- package/vendor/artifact-types/data/scripts/editors/design-system/index.html +1 -1
- package/vendor/artifact-types/{design/scripts/editors/slides/assets/index-y09Z-wXP.js → data/scripts/editors/slides/assets/index-b9M479Ro.js} +2 -2
- package/vendor/artifact-types/data/scripts/editors/slides/assets/{src-C48N4IXt.js → src-CxNLgI5_.js} +1 -1
- package/vendor/artifact-types/data/scripts/editors/slides/index.html +1 -1
- package/vendor/artifact-types/{design/scripts/editors/whiteboard/assets/index-DbekE4ru.js → data/scripts/editors/whiteboard/assets/index-TrzGo_VR.js} +1 -1
- package/vendor/artifact-types/data/scripts/editors/whiteboard/index.html +1 -1
- package/vendor/artifact-types/design/scripts/cli.mjs +1 -1
- package/vendor/artifact-types/{slides/scripts/editors/data/assets/index-CZiM2XTm.js → design/scripts/editors/data/assets/index-B041Zu27.js} +1 -1
- package/vendor/artifact-types/design/scripts/editors/data/index.html +1 -1
- package/vendor/artifact-types/{data/scripts/editors/design/assets/index-jhwXmpbV.js → design/scripts/editors/design/assets/index-D6-vjsn9.js} +1 -1
- package/vendor/artifact-types/design/scripts/editors/design/index.html +1 -1
- package/vendor/artifact-types/{design-system/scripts/editors/design-system/assets/index-7LPrsXBY.js → design/scripts/editors/design-system/assets/index-BoT2v4hc.js} +1 -1
- package/vendor/artifact-types/design/scripts/editors/design-system/index.html +1 -1
- package/vendor/artifact-types/{slides/scripts/editors/slides/assets/index-y09Z-wXP.js → design/scripts/editors/slides/assets/index-b9M479Ro.js} +2 -2
- package/vendor/artifact-types/{slides/scripts/editors/slides/assets/src-C48N4IXt.js → design/scripts/editors/slides/assets/src-CxNLgI5_.js} +1 -1
- package/vendor/artifact-types/design/scripts/editors/slides/index.html +1 -1
- package/vendor/artifact-types/{design-system/scripts/editors/whiteboard/assets/index-DbekE4ru.js → design/scripts/editors/whiteboard/assets/index-TrzGo_VR.js} +1 -1
- package/vendor/artifact-types/design/scripts/editors/whiteboard/index.html +1 -1
- package/vendor/artifact-types/design-system/scripts/cli.mjs +1 -1
- package/vendor/artifact-types/{design/scripts/editors/data/assets/index-CZiM2XTm.js → design-system/scripts/editors/data/assets/index-B041Zu27.js} +1 -1
- package/vendor/artifact-types/design-system/scripts/editors/data/index.html +1 -1
- package/vendor/artifact-types/{slides/scripts/editors/design/assets/index-jhwXmpbV.js → design-system/scripts/editors/design/assets/index-D6-vjsn9.js} +1 -1
- package/vendor/artifact-types/design-system/scripts/editors/design/index.html +1 -1
- package/vendor/artifact-types/{data/scripts/editors/design-system/assets/index-7LPrsXBY.js → design-system/scripts/editors/design-system/assets/index-BoT2v4hc.js} +1 -1
- package/vendor/artifact-types/design-system/scripts/editors/design-system/index.html +1 -1
- package/vendor/artifact-types/design-system/scripts/editors/slides/assets/{index-y09Z-wXP.js → index-b9M479Ro.js} +2 -2
- package/vendor/artifact-types/{design/scripts/editors/slides/assets/src-C48N4IXt.js → design-system/scripts/editors/slides/assets/src-CxNLgI5_.js} +1 -1
- package/vendor/artifact-types/design-system/scripts/editors/slides/index.html +1 -1
- package/vendor/artifact-types/{data/scripts/editors/whiteboard/assets/index-DbekE4ru.js → design-system/scripts/editors/whiteboard/assets/index-TrzGo_VR.js} +1 -1
- package/vendor/artifact-types/design-system/scripts/editors/whiteboard/index.html +1 -1
- package/vendor/artifact-types/slides/scripts/cli.mjs +1 -1
- package/vendor/artifact-types/{design-system/scripts/editors/data/assets/index-CZiM2XTm.js → slides/scripts/editors/data/assets/index-B041Zu27.js} +1 -1
- package/vendor/artifact-types/slides/scripts/editors/data/index.html +1 -1
- package/vendor/artifact-types/{design-system/scripts/editors/design/assets/index-jhwXmpbV.js → slides/scripts/editors/design/assets/index-D6-vjsn9.js} +1 -1
- package/vendor/artifact-types/slides/scripts/editors/design/index.html +1 -1
- package/vendor/artifact-types/slides/scripts/editors/design-system/assets/{index-7LPrsXBY.js → index-BoT2v4hc.js} +1 -1
- package/vendor/artifact-types/slides/scripts/editors/design-system/index.html +1 -1
- package/vendor/artifact-types/{data/scripts/editors/slides/assets/index-y09Z-wXP.js → slides/scripts/editors/slides/assets/index-b9M479Ro.js} +2 -2
- package/vendor/artifact-types/{design-system/scripts/editors/slides/assets/src-C48N4IXt.js → slides/scripts/editors/slides/assets/src-CxNLgI5_.js} +1 -1
- package/vendor/artifact-types/slides/scripts/editors/slides/index.html +1 -1
- package/vendor/artifact-types/slides/scripts/editors/whiteboard/assets/{index-DbekE4ru.js → index-TrzGo_VR.js} +1 -1
- package/vendor/artifact-types/slides/scripts/editors/whiteboard/index.html +1 -1
- package/vendor/artifact-types/whiteboard/scripts/cli.mjs +1 -1
- package/vendor/artifact-types/whiteboard/scripts/editors/data/assets/index-B041Zu27.js +126 -0
- package/vendor/artifact-types/whiteboard/scripts/editors/data/index.html +1 -1
- package/vendor/artifact-types/whiteboard/scripts/editors/design/assets/index-D6-vjsn9.js +215 -0
- package/vendor/artifact-types/whiteboard/scripts/editors/design/index.html +1 -1
- package/vendor/artifact-types/whiteboard/scripts/editors/design-system/assets/index-BoT2v4hc.js +139 -0
- package/vendor/artifact-types/whiteboard/scripts/editors/design-system/index.html +1 -1
- package/vendor/artifact-types/whiteboard/scripts/editors/slides/assets/index-b9M479Ro.js +569 -0
- package/vendor/artifact-types/whiteboard/scripts/editors/slides/assets/src-CxNLgI5_.js +1 -0
- package/vendor/artifact-types/whiteboard/scripts/editors/slides/index.html +1 -1
- package/vendor/artifact-types/whiteboard/scripts/editors/whiteboard/assets/index-TrzGo_VR.js +141 -0
- package/vendor/artifact-types/whiteboard/scripts/editors/whiteboard/index.html +1 -1
- package/vendor/frame-host/client/comments.js +1 -1
- package/vendor/frame-host/frame-host.mjs +1 -1
- package/vendor/home/assets/{index-CPvXdSVh.js → index-aY1m8xEm.js} +1 -1
- package/vendor/home/index.html +1 -1
- package/vendor/open-artifact.mjs +56 -38
- package/vendor/shell/assets/{index-DE0jNtst.js → index-ElpFysv2.js} +1 -1
- package/vendor/shell/index.html +1 -1
- package/vendor/artifact-types/whiteboard/scripts/editors/data/assets/index-CZiM2XTm.js +0 -126
- package/vendor/artifact-types/whiteboard/scripts/editors/design/assets/index-jhwXmpbV.js +0 -215
- package/vendor/artifact-types/whiteboard/scripts/editors/design-system/assets/index-7LPrsXBY.js +0 -139
- package/vendor/artifact-types/whiteboard/scripts/editors/slides/assets/index-y09Z-wXP.js +0 -569
- package/vendor/artifact-types/whiteboard/scripts/editors/slides/assets/src-C48N4IXt.js +0 -1
- package/vendor/artifact-types/whiteboard/scripts/editors/whiteboard/assets/index-DbekE4ru.js +0 -141
package/vendor/home/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>Open Artifact</title>
|
|
7
|
-
<script type="module" crossorigin src="/_open-artifact/home/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/_open-artifact/home/assets/index-aY1m8xEm.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/_open-artifact/home/assets/index-CdURiCbF.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/vendor/open-artifact.mjs
CHANGED
|
@@ -306,7 +306,7 @@ var init_tools = __esm({
|
|
|
306
306
|
},
|
|
307
307
|
intent: {
|
|
308
308
|
type: "string",
|
|
309
|
-
description: "quickstart: what is being made (design, slides, whiteboard, document, data, other), or a few words about it."
|
|
309
|
+
description: "quickstart: what is being made (design, design-system, slides, whiteboard, document, data, other), or a few words about it."
|
|
310
310
|
},
|
|
311
311
|
scope: {
|
|
312
312
|
type: "string",
|
|
@@ -657,6 +657,31 @@ var init_paths = __esm({
|
|
|
657
657
|
}
|
|
658
658
|
});
|
|
659
659
|
|
|
660
|
+
// packages/daemon/package.json
|
|
661
|
+
var package_default;
|
|
662
|
+
var init_package = __esm({
|
|
663
|
+
"packages/daemon/package.json"() {
|
|
664
|
+
package_default = {
|
|
665
|
+
name: "@open-artifact/daemon",
|
|
666
|
+
version: "0.2.2",
|
|
667
|
+
private: true,
|
|
668
|
+
type: "module",
|
|
669
|
+
description: "The Open Artifact daemon (`open-artifact`): type registry, artifact library, type servers, agent tools, wake routing, the Harness API, MCP and the Shell.",
|
|
670
|
+
bin: {
|
|
671
|
+
"open-artifact": "./src/bin/open-artifact.ts"
|
|
672
|
+
},
|
|
673
|
+
exports: {
|
|
674
|
+
".": "./src/index.ts",
|
|
675
|
+
"./client": "./src/client.ts"
|
|
676
|
+
},
|
|
677
|
+
dependencies: {
|
|
678
|
+
"@open-artifact/protocol": "0.2.2"
|
|
679
|
+
},
|
|
680
|
+
license: "Apache-2.0"
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
|
|
660
685
|
// packages/daemon/src/codex.ts
|
|
661
686
|
import { closeSync as closeSync2, existsSync, openSync as openSync2, readdirSync, readSync } from "node:fs";
|
|
662
687
|
import { homedir as homedir2 } from "node:os";
|
|
@@ -1619,7 +1644,7 @@ var init_types = __esm({
|
|
|
1619
1644
|
"use strict";
|
|
1620
1645
|
init_src();
|
|
1621
1646
|
init_paths();
|
|
1622
|
-
BUILTIN_TYPE_IDS = ["design", "whiteboard", "slides", "data"];
|
|
1647
|
+
BUILTIN_TYPE_IDS = ["design", "design-system", "whiteboard", "slides", "data"];
|
|
1623
1648
|
stripFrontmatter = (text) => text.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/, "");
|
|
1624
1649
|
LOOPBACK = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]", "::1"]);
|
|
1625
1650
|
DECLARATION_LINE = /(^|\n)[ \t]*\/\/ artifact\.json[ \t]*\r?\n/;
|
|
@@ -3774,38 +3799,13 @@ var init_ws = __esm({
|
|
|
3774
3799
|
}
|
|
3775
3800
|
});
|
|
3776
3801
|
|
|
3777
|
-
// packages/daemon/package.json
|
|
3778
|
-
var package_default;
|
|
3779
|
-
var init_package = __esm({
|
|
3780
|
-
"packages/daemon/package.json"() {
|
|
3781
|
-
package_default = {
|
|
3782
|
-
name: "@open-artifact/daemon",
|
|
3783
|
-
version: "0.2.1",
|
|
3784
|
-
private: true,
|
|
3785
|
-
type: "module",
|
|
3786
|
-
description: "The Open Artifact daemon (`open-artifact`): type registry, artifact library, type servers, agent tools, wake routing, the Harness API, MCP and the Shell.",
|
|
3787
|
-
bin: {
|
|
3788
|
-
"open-artifact": "./src/bin/open-artifact.ts"
|
|
3789
|
-
},
|
|
3790
|
-
exports: {
|
|
3791
|
-
".": "./src/index.ts",
|
|
3792
|
-
"./client": "./src/client.ts"
|
|
3793
|
-
},
|
|
3794
|
-
dependencies: {
|
|
3795
|
-
"@open-artifact/protocol": "0.2.1"
|
|
3796
|
-
},
|
|
3797
|
-
license: "Apache-2.0"
|
|
3798
|
-
};
|
|
3799
|
-
}
|
|
3800
|
-
});
|
|
3801
|
-
|
|
3802
3802
|
// packages/daemon/src/daemon.ts
|
|
3803
3803
|
var daemon_exports = {};
|
|
3804
3804
|
__export(daemon_exports, {
|
|
3805
3805
|
BOOT_PLACEHOLDER: () => BOOT_PLACEHOLDER,
|
|
3806
3806
|
Daemon: () => Daemon,
|
|
3807
3807
|
UI_PATHS: () => UI_PATHS,
|
|
3808
|
-
VERSION: () =>
|
|
3808
|
+
VERSION: () => VERSION2,
|
|
3809
3809
|
defaultUiDir: () => defaultUiDir,
|
|
3810
3810
|
startDaemon: () => startDaemon,
|
|
3811
3811
|
takeOverPrompt: () => takeOverPrompt
|
|
@@ -3939,7 +3939,7 @@ async function startDaemon(options = {}) {
|
|
|
3939
3939
|
await daemon2.start();
|
|
3940
3940
|
return daemon2;
|
|
3941
3941
|
}
|
|
3942
|
-
var here,
|
|
3942
|
+
var here, VERSION2, BOOT_PLACEHOLDER, UI_PATHS, PAGE_IDLE_MS, TASK_TTL_MS, ACTING_GRACE_MS, OPEN_POLL_MS, OPEN_SETTLE_MS, OPEN_GIVE_UP_MS, CONTENT_TYPES, FRAME_HOST, contentType, langOf, isLoopback, escapeHtml, scriptJson, FALLBACK_SHELL, Daemon;
|
|
3943
3943
|
var init_daemon = __esm({
|
|
3944
3944
|
"packages/daemon/src/daemon.ts"() {
|
|
3945
3945
|
"use strict";
|
|
@@ -3958,7 +3958,7 @@ var init_daemon = __esm({
|
|
|
3958
3958
|
init_ws();
|
|
3959
3959
|
init_package();
|
|
3960
3960
|
here = dirname7(fileURLToPath4(import.meta.url));
|
|
3961
|
-
|
|
3961
|
+
VERSION2 = package_default.version ?? "0.0.0";
|
|
3962
3962
|
BOOT_PLACEHOLDER = "/*__OPEN_ARTIFACT_BOOT__*/null";
|
|
3963
3963
|
UI_PATHS = { shell: "/_open-artifact/shell/", home: "/_open-artifact/home/" };
|
|
3964
3964
|
PAGE_IDLE_MS = Number(process.env.OPEN_ARTIFACT_PAGE_IDLE_MS ?? 15 * 6e4);
|
|
@@ -4136,7 +4136,7 @@ var init_daemon = __esm({
|
|
|
4136
4136
|
});
|
|
4137
4137
|
this.harnesses = new HarnessHub({
|
|
4138
4138
|
token: this.token,
|
|
4139
|
-
version:
|
|
4139
|
+
version: VERSION2,
|
|
4140
4140
|
tools: this.tools,
|
|
4141
4141
|
inbox: this.inbox,
|
|
4142
4142
|
log,
|
|
@@ -4223,11 +4223,11 @@ var init_daemon = __esm({
|
|
|
4223
4223
|
}
|
|
4224
4224
|
}
|
|
4225
4225
|
this.hosts = /* @__PURE__ */ new Set([`127.0.0.1:${this.port}`, `localhost:${this.port}`, `[::1]:${this.port}`]);
|
|
4226
|
-
const state = { url: this.origin, port: this.port, pid: process.pid, token: this.token, version:
|
|
4226
|
+
const state = { url: this.origin, port: this.port, pid: process.pid, token: this.token, version: VERSION2, startedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
4227
4227
|
writeJson(files.daemon(), state, 384);
|
|
4228
4228
|
this.timer = setInterval(() => this.tick(), 3e4);
|
|
4229
4229
|
this.timer.unref?.();
|
|
4230
|
-
this.log(`daemon ${
|
|
4230
|
+
this.log(`daemon ${VERSION2} listening at ${this.origin} (home ${openArtifactHome()})`);
|
|
4231
4231
|
void this.remountShared();
|
|
4232
4232
|
return this;
|
|
4233
4233
|
}
|
|
@@ -4433,7 +4433,7 @@ var init_daemon = __esm({
|
|
|
4433
4433
|
}
|
|
4434
4434
|
if (!isLoopback(req.socket.remoteAddress)) return this.notFound(req, res);
|
|
4435
4435
|
if (p === "/__open-artifact/health") {
|
|
4436
|
-
const health = { openArtifact: 1, version:
|
|
4436
|
+
const health = { openArtifact: 1, version: VERSION2 };
|
|
4437
4437
|
return sendJson(res, 200, health);
|
|
4438
4438
|
}
|
|
4439
4439
|
if (p === "/favicon.ico") {
|
|
@@ -4561,7 +4561,7 @@ ${rows}
|
|
|
4561
4561
|
owner: record.owner ? { harness: record.owner.harness, key: sessionKeyOf(record.owner) } : null,
|
|
4562
4562
|
agentName: this.agentNameOf(record),
|
|
4563
4563
|
userName: safeUserName(),
|
|
4564
|
-
version:
|
|
4564
|
+
version: VERSION2
|
|
4565
4565
|
};
|
|
4566
4566
|
}
|
|
4567
4567
|
/** `GET /a/<id>`: the Shell's `index.html` with the boot object in place. */
|
|
@@ -5233,7 +5233,7 @@ ${takeOverPrompt(record, view.typeTitle)}` : takeOverPrompt(record, view.typeTit
|
|
|
5233
5233
|
return sendJson(res, 400, { jsonrpc: "2.0", id: null, error: { code: -32700, message: "Parse error" } });
|
|
5234
5234
|
}
|
|
5235
5235
|
const caller2 = callerFromRequest(req, this.harnesses);
|
|
5236
|
-
const one = (message) => handleMcp(message, { tools: this.tools, caller: caller2, version:
|
|
5236
|
+
const one = (message) => handleMcp(message, { tools: this.tools, caller: caller2, version: VERSION2, workspaceOf: (ref) => this.harnesses.workspaceOf(ref) });
|
|
5237
5237
|
if (Array.isArray(body)) {
|
|
5238
5238
|
const out3 = (await Promise.all(body.map(one))).filter((reply) => reply !== null);
|
|
5239
5239
|
if (out3.length) return sendJson(res, 200, out3);
|
|
@@ -5277,10 +5277,18 @@ import { createInterface } from "node:readline";
|
|
|
5277
5277
|
// packages/daemon/src/client.ts
|
|
5278
5278
|
init_src();
|
|
5279
5279
|
init_paths();
|
|
5280
|
+
init_package();
|
|
5280
5281
|
import { spawn } from "node:child_process";
|
|
5281
5282
|
import { closeSync, mkdirSync as mkdirSync2, openSync } from "node:fs";
|
|
5282
5283
|
import { dirname as dirname2, join as join2, resolve as resolve2 } from "node:path";
|
|
5283
5284
|
import { fileURLToPath } from "node:url";
|
|
5285
|
+
var VERSION = package_default.version ?? "0.0.0";
|
|
5286
|
+
function isOlderVersion(a, b) {
|
|
5287
|
+
const parts = (v) => v.split("-")[0].split(".").map((n) => Number.parseInt(n, 10) || 0);
|
|
5288
|
+
const [x, y] = [parts(a), parts(b)];
|
|
5289
|
+
for (let i = 0; i < 3; i++) if ((x[i] ?? 0) !== (y[i] ?? 0)) return (x[i] ?? 0) < (y[i] ?? 0);
|
|
5290
|
+
return false;
|
|
5291
|
+
}
|
|
5284
5292
|
function defaultDaemonBin() {
|
|
5285
5293
|
return process.env.OPEN_ARTIFACT_DAEMON_BIN || resolve2(dirname2(fileURLToPath(import.meta.url)), "bin", "open-artifact.ts");
|
|
5286
5294
|
}
|
|
@@ -5303,10 +5311,20 @@ async function readDaemon() {
|
|
|
5303
5311
|
return null;
|
|
5304
5312
|
}
|
|
5305
5313
|
}
|
|
5314
|
+
async function replaceDaemon(state, timeoutMs) {
|
|
5315
|
+
try {
|
|
5316
|
+
process.kill(state.pid, "SIGTERM");
|
|
5317
|
+
} catch {
|
|
5318
|
+
return;
|
|
5319
|
+
}
|
|
5320
|
+
const deadline = Date.now() + timeoutMs;
|
|
5321
|
+
while (alive(state.pid) && Date.now() < deadline) await new Promise((done) => setTimeout(done, 100));
|
|
5322
|
+
}
|
|
5306
5323
|
async function ensureDaemon(options = {}) {
|
|
5307
|
-
const running = await readDaemon();
|
|
5308
|
-
if (running) return running;
|
|
5309
5324
|
const { timeoutMs = 15e3, env = process.env, bin = defaultDaemonBin() } = options;
|
|
5325
|
+
const running = await readDaemon();
|
|
5326
|
+
if (running && !isOlderVersion(running.version ?? "0.0.0", VERSION)) return running;
|
|
5327
|
+
if (running) await replaceDaemon(running, 5e3);
|
|
5310
5328
|
mkdirSync2(files.logs(), { recursive: true });
|
|
5311
5329
|
const logFile = join2(files.logs(), "daemon.out");
|
|
5312
5330
|
const fd = openSync(logFile, "a");
|