dsh-open-artifact 0.16.1 → 0.16.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 +22 -0
- package/lib/client.js +2 -2
- package/lib/index.js +43 -11
- package/package.json +1 -1
- package/skills/open-artifact/SKILL.md +1 -1
- package/vendor/frame-host/frame-host.mjs +1 -1
- package/vendor/open-artifact.mjs +52 -7
- package/vendor/runtime.json +1 -1
- package/vendor/type-server/cli.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,14 +6,35 @@ Every release of Open Artifact: the `@open-artifact/*` libraries, `@open-artifac
|
|
|
6
6
|
Each entry is written from the commits since the previous tag (`node scripts/changelog.mjs` lists them); see
|
|
7
7
|
[Releasing](README.md#releasing).
|
|
8
8
|
|
|
9
|
+
## [0.16.2] - 2026-11-25
|
|
10
|
+
|
|
11
|
+
Update signed Open Artifact Desktop releases from GitHub, and keep undelivered messages when agents reconnect.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- macOS Apple Silicon desktop releases check stable desktop versions on GitHub after launch and every six hours. A button beside Settings in the sidebar appears only when an update is available; clicking it opens the update window and starts a download with actual byte progress, cancellation and retry. Automatic downloads are optional and separate from runtime update policy.
|
|
16
|
+
- Desktop downloads verify ZIP size and SHA-256, then pass the verified archive to the native macOS updater for code-signature verification and installation. Restart and Update waits for pending saves and asks about unsaved work; a staged update also installs on normal quit.
|
|
17
|
+
- Desktop releases include a static update feed generated from the final signed and notarized ZIP. Publication validates its version, download URL, byte count and digest, preserves immutable assets and verifies public downloads.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Comments, requests and notes that an agent could not take after reconnecting, a daemon restart, or the first DSH/Pi attach wait in its inbox again, so a later tool call, wait or attach can receive them instead of losing them with the host process.
|
|
22
|
+
|
|
23
|
+
### Integrators
|
|
24
|
+
|
|
25
|
+
- The optional `inbox.return` feature and method put undelivered messages back in the adapter's own session inbox, ahead of newer messages; an open wait receives them immediately. Each call accepts up to 500 messages, each up to 256 KB. The kit returns declined messages after automatic re-attachment; with an older daemon it adds retained messages to the next `call()` or wait. DSH and Pi also return messages their first attach could not hand on. The Harness protocol version remains 1.
|
|
26
|
+
|
|
9
27
|
## [0.16.1] - 2026-11-25
|
|
10
28
|
|
|
11
29
|
Keep an agent that runs in a sandbox to its session's workspace, even though the daemon runs with your full rights.
|
|
12
30
|
|
|
31
|
+
The first signed macOS desktop release uses the separate `desktop-v0.16.1` tag.
|
|
32
|
+
|
|
13
33
|
### Added
|
|
14
34
|
|
|
15
35
|
- A daemon started with `OPEN_ARTIFACT_WORKSPACE_FOLDERS_ONLY=1` works only inside the calling session's workspace: making, reading and listing artifacts, ArtifactData's `file_path` and `out_file`, file paths in type actions (an upload's `file`, docs import and export), and artifact pages and archives. Anything outside answers `not_granted`. A symbolic link out of the workspace, or a workspace folder replaced by another, is refused too. Without the variable nothing changes.
|
|
16
36
|
- A write refused because `if_match` no longer matches says `executionStatus: "not_executed"`, so an agent knows nothing was written.
|
|
37
|
+
- macOS Apple Silicon desktop releases ship as Developer ID signed, hardened, Apple notarized and stapled ZIP and DMG downloads, with SHA-256 checksums. GitHub Actions validates signing credentials, tests the signed app and publishes immutable assets from `desktop-v<version>` tags. Local ad hoc packaging remains available.
|
|
17
38
|
|
|
18
39
|
### Fixed
|
|
19
40
|
|
|
@@ -659,6 +680,7 @@ One version for every package, with Docs and Sheets in every plugin.
|
|
|
659
680
|
- Plugins for Claude Code, Codex, Cursor, Copilot, ChatGPT and DeepSeek Harness.
|
|
660
681
|
- English and Chinese READMEs, under Apache-2.0.
|
|
661
682
|
|
|
683
|
+
[0.16.2]: https://github.com/JimLiu/open-artifact/compare/v0.16.1...v0.16.2
|
|
662
684
|
[0.16.1]: https://github.com/JimLiu/open-artifact/compare/v0.16.0...v0.16.1
|
|
663
685
|
[0.16.0]: https://github.com/JimLiu/open-artifact/compare/v0.15.0...v0.16.0
|
|
664
686
|
[0.15.0]: https://github.com/JimLiu/open-artifact/compare/v0.14.7...v0.15.0
|
package/lib/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// dsh-open-artifact 0.16.
|
|
1
|
+
// dsh-open-artifact 0.16.2: the DSH plugin (browser half). Built by scripts/build.mjs; do not edit.
|
|
2
2
|
window.__ModuleLoader__.load({
|
|
3
3
|
id: "dsh-open-artifact",
|
|
4
4
|
factory: (require) => {
|
|
@@ -2199,7 +2199,7 @@ window.__ModuleLoader__.load({
|
|
|
2199
2199
|
var SITE_TYPE_STANDINGS = Object.freeze(["new", "installed", "update", "published-here", "clash"]);
|
|
2200
2200
|
|
|
2201
2201
|
// packages/protocol/src/harness.ts
|
|
2202
|
-
var HARNESS_FEATURES = Object.freeze(["hello.profile", "embed.origins", "shell.command", "shell.event", "view.context", "wake.from", "wake.drafted", "wake.session", "skill.get", "commands.list", "session.may", "tools.actions", "quickstart.steps", "types.remote", "hello.runtime", "runtime.update", "types.source", "view.open"]);
|
|
2202
|
+
var HARNESS_FEATURES = Object.freeze(["hello.profile", "embed.origins", "shell.command", "shell.event", "view.context", "wake.from", "wake.drafted", "wake.session", "skill.get", "commands.list", "session.may", "tools.actions", "quickstart.steps", "types.remote", "hello.runtime", "runtime.update", "types.source", "view.open", "inbox.return"]);
|
|
2203
2203
|
|
|
2204
2204
|
// packages/protocol/src/wake.ts
|
|
2205
2205
|
var COMMENT_HEADER = "[Artifact comment sent to agent]";
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// dsh-open-artifact 0.16.
|
|
1
|
+
// dsh-open-artifact 0.16.2: the DSH plugin (server half). Built by scripts/build.mjs; do not edit.
|
|
2
2
|
|
|
3
3
|
// packages/harness-kit/src/daemon.ts
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
@@ -152,7 +152,7 @@ var HARNESS_PATH = "/__harness";
|
|
|
152
152
|
var HARNESS_SUBPROTOCOL = "open-artifact-harness";
|
|
153
153
|
var PROTOCOL_MIN = 1;
|
|
154
154
|
var PROTOCOL_MAX = 1;
|
|
155
|
-
var HARNESS_FEATURES = Object.freeze(["hello.profile", "embed.origins", "shell.command", "shell.event", "view.context", "wake.from", "wake.drafted", "wake.session", "skill.get", "commands.list", "session.may", "tools.actions", "quickstart.steps", "types.remote", "hello.runtime", "runtime.update", "types.source", "view.open"]);
|
|
155
|
+
var HARNESS_FEATURES = Object.freeze(["hello.profile", "embed.origins", "shell.command", "shell.event", "view.context", "wake.from", "wake.drafted", "wake.session", "skill.get", "commands.list", "session.may", "tools.actions", "quickstart.steps", "types.remote", "hello.runtime", "runtime.update", "types.source", "view.open", "inbox.return"]);
|
|
156
156
|
var RPC_ERRORS = {
|
|
157
157
|
parse: -32700,
|
|
158
158
|
methodNotFound: -32601,
|
|
@@ -1666,7 +1666,7 @@ import { join as join3, resolve as resolve3 } from "node:path";
|
|
|
1666
1666
|
// packages/harness-kit/package.json
|
|
1667
1667
|
var package_default = {
|
|
1668
1668
|
name: "@open-artifact/harness-kit",
|
|
1669
|
-
version: "0.16.
|
|
1669
|
+
version: "0.16.2",
|
|
1670
1670
|
private: true,
|
|
1671
1671
|
type: "module",
|
|
1672
1672
|
description: "The SDK an agent app uses to integrate Open Artifact: find or start the local daemon, hold a Harness API connection that reconnects, register the tools, take comment wakes and page opens, and follow the artifacts its sessions make.",
|
|
@@ -1676,7 +1676,7 @@ var package_default = {
|
|
|
1676
1676
|
"./embed": "./src/embed/index.ts"
|
|
1677
1677
|
},
|
|
1678
1678
|
dependencies: {
|
|
1679
|
-
"@open-artifact/protocol": "0.16.
|
|
1679
|
+
"@open-artifact/protocol": "0.16.2"
|
|
1680
1680
|
},
|
|
1681
1681
|
sideEffects: false,
|
|
1682
1682
|
engines: {
|
|
@@ -2012,11 +2012,20 @@ async function createHarness(options) {
|
|
|
2012
2012
|
onState: (state) => emit("state", state),
|
|
2013
2013
|
onReattach: async (params, result) => {
|
|
2014
2014
|
const left = await handOver(params, result.inbox);
|
|
2015
|
-
if (left.length)
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2015
|
+
if (!left.length) return;
|
|
2016
|
+
const who = params.session ?? params.workspace;
|
|
2017
|
+
if (client.features.includes("inbox.return")) {
|
|
2018
|
+
try {
|
|
2019
|
+
await client.request("inbox.return", { session: params.session ?? null, workspace: params.workspace ?? null, messages: left });
|
|
2020
|
+
log(`open-artifact: ${left.length} message(s) for ${who} were not taken; they wait in its inbox again`);
|
|
2021
|
+
return;
|
|
2022
|
+
} catch (error) {
|
|
2023
|
+
log(`open-artifact inbox.return for ${who}: ${error?.message ?? error}`);
|
|
2024
|
+
}
|
|
2019
2025
|
}
|
|
2026
|
+
const key = sessionKey(params);
|
|
2027
|
+
leftovers.set(key, [...leftovers.get(key) ?? [], ...left]);
|
|
2028
|
+
log(`open-artifact: ${left.length} message(s) for ${who} were not taken; the session's next call or attach returns them`);
|
|
2020
2029
|
},
|
|
2021
2030
|
handlers: {
|
|
2022
2031
|
...options.wake ? { "wake.deliver": (params) => wake(params) } : {},
|
|
@@ -2119,7 +2128,23 @@ async function createHarness(options) {
|
|
|
2119
2128
|
}
|
|
2120
2129
|
return TOOL_DEFINITIONS.map((tool) => ({ ...tool }));
|
|
2121
2130
|
},
|
|
2122
|
-
call
|
|
2131
|
+
async call(name2, args, caller) {
|
|
2132
|
+
const key = caller && (caller.session || caller.workspace) ? sessionKey(caller) : null;
|
|
2133
|
+
const held = key ? leftovers.get(key) : void 0;
|
|
2134
|
+
if (!key || !held?.length) return client.callTool(name2, args, caller);
|
|
2135
|
+
leftovers.delete(key);
|
|
2136
|
+
const texts = held.map((message) => message.text);
|
|
2137
|
+
if (name2 === "ArtifactComments" && args.action === "wait") return { messages: texts };
|
|
2138
|
+
let result;
|
|
2139
|
+
try {
|
|
2140
|
+
result = await client.callTool(name2, args, caller);
|
|
2141
|
+
} catch (error) {
|
|
2142
|
+
leftovers.set(key, [...held, ...leftovers.get(key) ?? []]);
|
|
2143
|
+
throw error;
|
|
2144
|
+
}
|
|
2145
|
+
const more = Array.isArray(result.messages) ? result.messages : [];
|
|
2146
|
+
return { ...result, messages: [...texts, ...more] };
|
|
2147
|
+
},
|
|
2123
2148
|
wrote: (paths, caller) => client.request("agent.wrote", { paths, ...caller ? { caller } : {} }),
|
|
2124
2149
|
open: (url, opts) => client.request("artifact.open", { url, ...opts ? { caller: opts } : {} }),
|
|
2125
2150
|
owns: ownsCall,
|
|
@@ -3048,8 +3073,15 @@ function setup(ctx, config = {}, deps = {}) {
|
|
|
3048
3073
|
workspaces.add(workspace);
|
|
3049
3074
|
attached.set(session, workspaces);
|
|
3050
3075
|
try {
|
|
3051
|
-
const
|
|
3052
|
-
|
|
3076
|
+
const h = await harness();
|
|
3077
|
+
const { inbox } = await h.attach({ session, workspace, status: status === "idle" ? "idle" : "running" });
|
|
3078
|
+
if (inbox.length) {
|
|
3079
|
+
if (h.features.includes("inbox.return")) {
|
|
3080
|
+
await h.client.request("inbox.return", { session, workspace, messages: inbox }).then(() => log("warn", `${inbox.length} inbox message(s) for ${session} could not be handed to its agent; they wait for its next tool call`)).catch((error) => log("warn", `${inbox.length} inbox message(s) for ${session} could not be put back: ${error.message}`));
|
|
3081
|
+
} else {
|
|
3082
|
+
log("warn", `${inbox.length} inbox message(s) for ${session} could not be handed to its agent; an older daemon cannot take them back`);
|
|
3083
|
+
}
|
|
3084
|
+
}
|
|
3053
3085
|
} catch (error) {
|
|
3054
3086
|
attachedKeys.delete(key);
|
|
3055
3087
|
throw error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-open-artifact",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2",
|
|
4
4
|
"description": "Open Artifact in DeepSeek Harness: the Artifact, ArtifactData and ArtifactComments tools, comments on artifact pages waking the session that owns them, the Open Artifact page in the sidebar listing the open-artifact library, artifacts the agent opens shown in the session's Browser, and /open-artifact <type> to make a new one.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: open-artifact
|
|
3
3
|
description: Make an Open Artifact (a slide deck, a design canvas, a whiteboard, a data dashboard, a doc, a short animated motion piece, …) as a folder of files that opens as a live local page where the person views, edits, comments and exports, with their comments coming back to you. Use when the person types `/open-artifact <type> <what to make>`, or asks for something they will look at closely, keep, change, comment on or present - a presentation, pitch or talk deck; app screens, a mockup, a landing page, a poster, flyer or graphic, or "a few options" to look at; a brainstorm or retro board, a flowchart or an architecture sketch; a dashboard, metrics page, KPI tracker or recurring report from their data; a document, report, proposal, plan, spec, memo, notes or other writing to keep, share or comment on; a short animated video, an explainer, a promo, motion graphics or a GIF; a widget or mini game - or asks to keep or share a diagram you drew. Not for answers read once, code, or a file in a format they named.
|
|
4
4
|
argument-hint: <type> <what to make>
|
|
5
|
-
generated-by: open-artifact 0.16.
|
|
5
|
+
generated-by: open-artifact 0.16.2
|
|
6
6
|
etag: 4cfb8f99d733de16
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -49,7 +49,7 @@ function errorBody(error) {
|
|
|
49
49
|
var SITE_TYPE_STANDINGS = Object.freeze(["new", "installed", "update", "published-here", "clash"]);
|
|
50
50
|
|
|
51
51
|
// packages/protocol/src/harness.ts
|
|
52
|
-
var HARNESS_FEATURES = Object.freeze(["hello.profile", "embed.origins", "shell.command", "shell.event", "view.context", "wake.from", "wake.drafted", "wake.session", "skill.get", "commands.list", "session.may", "tools.actions", "quickstart.steps", "types.remote", "hello.runtime", "runtime.update", "types.source", "view.open"]);
|
|
52
|
+
var HARNESS_FEATURES = Object.freeze(["hello.profile", "embed.origins", "shell.command", "shell.event", "view.context", "wake.from", "wake.drafted", "wake.session", "skill.get", "commands.list", "session.may", "tools.actions", "quickstart.steps", "types.remote", "hello.runtime", "runtime.update", "types.source", "view.open", "inbox.return"]);
|
|
53
53
|
|
|
54
54
|
// packages/protocol/src/type-server.ts
|
|
55
55
|
var TYPE_SERVER_ROUTES = {
|
package/vendor/open-artifact.mjs
CHANGED
|
@@ -230,7 +230,7 @@ var init_library = __esm({
|
|
|
230
230
|
function rpcErrorCode(code) {
|
|
231
231
|
return code === "parse_error" ? RPC_ERRORS.parse : code === "method_not_found" ? RPC_ERRORS.methodNotFound : code === "invalid_argument" ? RPC_ERRORS.invalidParams : RPC_ERRORS.server;
|
|
232
232
|
}
|
|
233
|
-
var HARNESS_PATH, HARNESS_SUBPROTOCOL, PROTOCOL_MIN, PROTOCOL_MAX, HARNESS_FEATURES, PROFILE_RULES_MAX, RPC_ERRORS;
|
|
233
|
+
var HARNESS_PATH, HARNESS_SUBPROTOCOL, PROTOCOL_MIN, PROTOCOL_MAX, HARNESS_FEATURES, PROFILE_RULES_MAX, INBOX_RETURN_MAX, RPC_ERRORS;
|
|
234
234
|
var init_harness = __esm({
|
|
235
235
|
"packages/protocol/src/harness.ts"() {
|
|
236
236
|
"use strict";
|
|
@@ -238,8 +238,9 @@ var init_harness = __esm({
|
|
|
238
238
|
HARNESS_SUBPROTOCOL = "open-artifact-harness";
|
|
239
239
|
PROTOCOL_MIN = 1;
|
|
240
240
|
PROTOCOL_MAX = 1;
|
|
241
|
-
HARNESS_FEATURES = Object.freeze(["hello.profile", "embed.origins", "shell.command", "shell.event", "view.context", "wake.from", "wake.drafted", "wake.session", "skill.get", "commands.list", "session.may", "tools.actions", "quickstart.steps", "types.remote", "hello.runtime", "runtime.update", "types.source", "view.open"]);
|
|
241
|
+
HARNESS_FEATURES = Object.freeze(["hello.profile", "embed.origins", "shell.command", "shell.event", "view.context", "wake.from", "wake.drafted", "wake.session", "skill.get", "commands.list", "session.may", "tools.actions", "quickstart.steps", "types.remote", "hello.runtime", "runtime.update", "types.source", "view.open", "inbox.return"]);
|
|
242
242
|
PROFILE_RULES_MAX = 4e3;
|
|
243
|
+
INBOX_RETURN_MAX = 500;
|
|
243
244
|
RPC_ERRORS = {
|
|
244
245
|
parse: -32700,
|
|
245
246
|
methodNotFound: -32601,
|
|
@@ -3150,7 +3151,7 @@ var init_package = __esm({
|
|
|
3150
3151
|
"packages/daemon/package.json"() {
|
|
3151
3152
|
package_default = {
|
|
3152
3153
|
name: "@open-artifact/daemon",
|
|
3153
|
-
version: "0.16.
|
|
3154
|
+
version: "0.16.2",
|
|
3154
3155
|
private: true,
|
|
3155
3156
|
type: "module",
|
|
3156
3157
|
description: "The Open Artifact daemon (`open-artifact`): type registry, artifact library, type servers, agent tools, wake routing, the Harness API, MCP and the Shell.",
|
|
@@ -3162,9 +3163,9 @@ var init_package = __esm({
|
|
|
3162
3163
|
"./client": "./src/client.ts"
|
|
3163
3164
|
},
|
|
3164
3165
|
dependencies: {
|
|
3165
|
-
"@open-artifact/harness-kit": "0.16.
|
|
3166
|
-
"@open-artifact/protocol": "0.16.
|
|
3167
|
-
"@open-artifact/server-sdk": "0.16.
|
|
3166
|
+
"@open-artifact/harness-kit": "0.16.2",
|
|
3167
|
+
"@open-artifact/protocol": "0.16.2",
|
|
3168
|
+
"@open-artifact/server-sdk": "0.16.2"
|
|
3168
3169
|
},
|
|
3169
3170
|
license: "Apache-2.0"
|
|
3170
3171
|
};
|
|
@@ -4851,6 +4852,24 @@ var init_harness_view = __esm({
|
|
|
4851
4852
|
import { spawn as spawn2 } from "node:child_process";
|
|
4852
4853
|
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
4853
4854
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
4855
|
+
function returnedMessages(raw) {
|
|
4856
|
+
if (!Array.isArray(raw)) throw new OpenArtifactError("invalid_argument", "inbox.return needs messages (an array).");
|
|
4857
|
+
const kept = [];
|
|
4858
|
+
for (const item of raw.slice(0, INBOX_RETURN_MAX)) {
|
|
4859
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) continue;
|
|
4860
|
+
const message4 = item;
|
|
4861
|
+
if (typeof message4.text !== "string" || !message4.text) continue;
|
|
4862
|
+
const filled = {
|
|
4863
|
+
...message4,
|
|
4864
|
+
kind: typeof message4.kind === "string" && message4.kind ? message4.kind : "wake",
|
|
4865
|
+
text: message4.text,
|
|
4866
|
+
at: typeof message4.at === "string" && message4.at ? message4.at : (/* @__PURE__ */ new Date()).toISOString()
|
|
4867
|
+
};
|
|
4868
|
+
if (JSON.stringify(filled).length > INBOX_RETURN_MESSAGE_MAX) continue;
|
|
4869
|
+
kept.push(filled);
|
|
4870
|
+
}
|
|
4871
|
+
return kept;
|
|
4872
|
+
}
|
|
4854
4873
|
function recentSessionMaxAgeMs() {
|
|
4855
4874
|
const fromEnv = Number(process.env.OPEN_ARTIFACT_RECENT_SESSION_MS);
|
|
4856
4875
|
return Number.isFinite(fromEnv) && process.env.OPEN_ARTIFACT_RECENT_SESSION_MS ? fromEnv : RECENT_SESSION_MS;
|
|
@@ -4892,7 +4911,7 @@ function sessionMayOf(value) {
|
|
|
4892
4911
|
}
|
|
4893
4912
|
return may;
|
|
4894
4913
|
}
|
|
4895
|
-
var CALL_TIMEOUT_MS, POLL_GRACE_MS, POLL_MAX_MS, INBOX_WAIT_MAX_MS, RECENT_SESSION_MS, DESKTOP_HARNESS, SocketConnection, PollConnection, HarnessHub;
|
|
4914
|
+
var CALL_TIMEOUT_MS, POLL_GRACE_MS, POLL_MAX_MS, INBOX_WAIT_MAX_MS, INBOX_RETURN_MESSAGE_MAX, RECENT_SESSION_MS, DESKTOP_HARNESS, SocketConnection, PollConnection, HarnessHub;
|
|
4896
4915
|
var init_harness2 = __esm({
|
|
4897
4916
|
"packages/daemon/src/harness.ts"() {
|
|
4898
4917
|
"use strict";
|
|
@@ -4909,6 +4928,7 @@ var init_harness2 = __esm({
|
|
|
4909
4928
|
POLL_GRACE_MS = Number(process.env.OPEN_ARTIFACT_POLL_GRACE_MS ?? 2e4);
|
|
4910
4929
|
POLL_MAX_MS = 6e4;
|
|
4911
4930
|
INBOX_WAIT_MAX_MS = 36e5;
|
|
4931
|
+
INBOX_RETURN_MESSAGE_MAX = 256 * 1024;
|
|
4912
4932
|
RECENT_SESSION_MS = 2 * 60 * 6e4;
|
|
4913
4933
|
DESKTOP_HARNESS = "open-artifact-desktop";
|
|
4914
4934
|
SocketConnection = class {
|
|
@@ -5481,6 +5501,15 @@ var init_harness2 = __esm({
|
|
|
5481
5501
|
const timeout = Math.min(Number(params.timeoutMs) || 6e5, INBOX_WAIT_MAX_MS);
|
|
5482
5502
|
return { messages: await this.options.inbox.wait(key, timeout) };
|
|
5483
5503
|
}
|
|
5504
|
+
case "inbox.return": {
|
|
5505
|
+
const params = raw;
|
|
5506
|
+
const key = sessionKeyOf(this.callerOf(conn, params));
|
|
5507
|
+
if (!key) throw new OpenArtifactError("invalid_argument", "inbox.return needs session or workspace.");
|
|
5508
|
+
const messages = returnedMessages(params.messages);
|
|
5509
|
+
this.options.inbox.giveBack(key, messages);
|
|
5510
|
+
if (messages.length) this.options.log(`adapter ${harness}: ${messages.length} message(s) for ${key} put back in its inbox`);
|
|
5511
|
+
return { ok: true, returned: messages.length };
|
|
5512
|
+
}
|
|
5484
5513
|
case "subscribe":
|
|
5485
5514
|
conn.subscribed = raw.on !== false;
|
|
5486
5515
|
return { ok: true };
|
|
@@ -9469,6 +9498,22 @@ var init_inbox = __esm({
|
|
|
9469
9498
|
this.keep(key, items);
|
|
9470
9499
|
return taken;
|
|
9471
9500
|
}
|
|
9501
|
+
/**
|
|
9502
|
+
* Puts back messages that were taken but not delivered: an open wait takes them at once; otherwise they wait again,
|
|
9503
|
+
* ahead of what came since (they are older). Synchronous, as {@link takeWhere}.
|
|
9504
|
+
*/
|
|
9505
|
+
giveBack(key, messages) {
|
|
9506
|
+
if (!messages.length) return;
|
|
9507
|
+
const waiting = this.waiters.get(key);
|
|
9508
|
+
const first = waiting?.values().next().value;
|
|
9509
|
+
if (waiting && first) {
|
|
9510
|
+
waiting.delete(first);
|
|
9511
|
+
first(messages);
|
|
9512
|
+
return;
|
|
9513
|
+
}
|
|
9514
|
+
ensureDir(files.inbox());
|
|
9515
|
+
this.keep(key, [...messages, ...this.peek(key)]);
|
|
9516
|
+
}
|
|
9472
9517
|
/** Rewrites a key's file with `kept` only (removes it when empty). */
|
|
9473
9518
|
keep(key, kept) {
|
|
9474
9519
|
const file = this.fileOf(key);
|
package/vendor/runtime.json
CHANGED
|
@@ -203,7 +203,7 @@ var HARNESS_FEATURES;
|
|
|
203
203
|
var init_harness = __esm({
|
|
204
204
|
"packages/protocol/src/harness.ts"() {
|
|
205
205
|
"use strict";
|
|
206
|
-
HARNESS_FEATURES = Object.freeze(["hello.profile", "embed.origins", "shell.command", "shell.event", "view.context", "wake.from", "wake.drafted", "wake.session", "skill.get", "commands.list", "session.may", "tools.actions", "quickstart.steps", "types.remote", "hello.runtime", "runtime.update", "types.source", "view.open"]);
|
|
206
|
+
HARNESS_FEATURES = Object.freeze(["hello.profile", "embed.origins", "shell.command", "shell.event", "view.context", "wake.from", "wake.drafted", "wake.session", "skill.get", "commands.list", "session.may", "tools.actions", "quickstart.steps", "types.remote", "hello.runtime", "runtime.update", "types.source", "view.open", "inbox.return"]);
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
209
|
|