dsh-open-artifact 0.21.0 → 0.21.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 (48) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/lib/client.js +16 -3
  3. package/lib/index.js +141 -8
  4. package/package.json +1 -1
  5. package/skills/open-artifact/SKILL.md +1 -1
  6. package/vendor/artifact-types/design/SKILL.md +2 -1
  7. package/vendor/frame-host/frame-host.mjs +26 -4
  8. package/vendor/harnesses/antigravity.json +45 -0
  9. package/vendor/harnesses/devin.json +35 -0
  10. package/vendor/harnesses/grok.json +40 -0
  11. package/vendor/home/assets/{RuntimeUpdate-CmBVgpKd.js → RuntimeUpdate-CxkOwoTO.js} +11 -11
  12. package/vendor/home/assets/{browser-models-BJUjRwnz.js → browser-models-CpToObIT.js} +4 -4
  13. package/vendor/home/assets/{library-Bfi8A7fd.js → library-BUnXPZ9A.js} +1 -1
  14. package/vendor/home/assets/{main-CYBhroAD.js → main-C9KL9HCK.js} +2 -2
  15. package/vendor/home/assets/main-Dca6p1Xb.css +1 -0
  16. package/vendor/home/assets/{node.browser-CdnMipDo.js → node.browser-CofVKHY-.js} +1 -1
  17. package/vendor/home/assets/{node.browser-CLjqH8aC.js → node.browser-MWI6NmlK.js} +1 -1
  18. package/vendor/home/index.html +3 -3
  19. package/vendor/home/library/index.html +2 -2
  20. package/vendor/open-artifact.mjs +1414 -374
  21. package/vendor/runtime.json +1 -1
  22. package/vendor/{type-server/shell/assets/browser-models-lVIONCZ2.js → shell/assets/browser-models-BiY2C2Ue.js} +4 -4
  23. package/vendor/shell/assets/index-BDQHi1JS.js +52 -0
  24. package/vendor/shell/assets/index-Dca6p1Xb.css +1 -0
  25. package/vendor/shell/assets/{node.browser-CYQRVS5J.js → node.browser-C3kbbCf_.js} +1 -1
  26. package/vendor/shell/assets/{node.browser-Fn3j26dA.js → node.browser-Is-iChr4.js} +1 -1
  27. package/vendor/shell/index.html +2 -2
  28. package/vendor/type-server/cli.mjs +184 -38
  29. package/vendor/type-server/editors/design/assets/index-CJeZXim2.js +319 -0
  30. package/vendor/type-server/editors/design/assets/index-CxAdfVEh.css +1 -0
  31. package/vendor/type-server/editors/design/index.html +2 -2
  32. package/vendor/type-server/editors/whiteboard/assets/{gif-jobs-CSXWfYAh.js → gif-jobs-DotLwPR1.js} +1 -1
  33. package/vendor/type-server/editors/whiteboard/assets/{index-DR1eaICq.js → index-DJZnsHFP.js} +2 -2
  34. package/vendor/type-server/editors/whiteboard/assets/{index-D-xQam4e.js → index-DZuwdE-7.js} +82 -82
  35. package/vendor/type-server/editors/whiteboard/index.html +1 -1
  36. package/vendor/{shell/assets/browser-models-lVIONCZ2.js → type-server/shell/assets/browser-models-BiY2C2Ue.js} +4 -4
  37. package/vendor/type-server/shell/assets/index-BDQHi1JS.js +52 -0
  38. package/vendor/type-server/shell/assets/index-Dca6p1Xb.css +1 -0
  39. package/vendor/type-server/shell/assets/{node.browser-CYQRVS5J.js → node.browser-C3kbbCf_.js} +1 -1
  40. package/vendor/type-server/shell/assets/{node.browser-Fn3j26dA.js → node.browser-Is-iChr4.js} +1 -1
  41. package/vendor/type-server/shell/index.html +2 -2
  42. package/vendor/home/assets/main-DIR3uPRY.css +0 -1
  43. package/vendor/shell/assets/index-DIR3uPRY.css +0 -1
  44. package/vendor/shell/assets/index-DYxWC7kd.js +0 -52
  45. package/vendor/type-server/editors/design/assets/index-8neGOVT0.css +0 -1
  46. package/vendor/type-server/editors/design/assets/index-IlyUOyF7.js +0 -319
  47. package/vendor/type-server/shell/assets/index-DIR3uPRY.css +0 -1
  48. package/vendor/type-server/shell/assets/index-DYxWC7kd.js +0 -52
package/CHANGELOG.md CHANGED
@@ -6,6 +6,51 @@ 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.21.2] - 2026-12-03
10
+
11
+ Hand artifacts to another agent session and open Design at the intended zoom.
12
+
13
+ ### Added
14
+
15
+ - The Shell can hand an artifact to a live or recent agent session, or start a new one in a supported app. Choose a model and reasoning effort when the app offers them. Pending requests and comments follow the artifact to its new owner.
16
+
17
+ ### Changed
18
+
19
+ - Newly written artifacts can open automatically, and the Shell remembers Ask pane preferences.
20
+
21
+ ### Fixed
22
+
23
+ - A multi-page Design opens fitted to its launch page. Prototype and artboard links keep the linked artboard in view.
24
+ - The Orca plugin reports agent status changes that occur while a session connects.
25
+
26
+ ### Integrators
27
+
28
+ - Harness adapters can advertise `caps.sessions.start` and `caps.sessions.models` and answer `session.start` and `session.models`. Harness Kit exposes callbacks for both. Trusted profiles can also define a `start` command. DSH supports starting sessions through its adapter, and the shipped Antigravity profile uses a start command.
29
+ - The local harness listing can include recent sessions and available session starters. `artifacts.assign` and `artifacts.start` accept `move: true` to transfer ownership and pending messages.
30
+
31
+ ## [0.21.1] - 2026-12-03
32
+
33
+ Follow individual agent requests through completion, play Design prototypes one screen at a time, and use Open Artifact from Grok Build or local Devin sessions.
34
+
35
+ ### Added
36
+
37
+ - Design's Prototype view opens one screen at a time. Follow links between screens, fill the canvas with the current screen, or return to the previous canvas position.
38
+ - The Grok Build CLI and local Devin agents (CLI and Desktop) can open artifacts and receive comments through their plugins.
39
+
40
+ ### Changed
41
+
42
+ - Design's tools now sit at the bottom of the canvas. Artboard titles offer playback on the canvas or in full screen, export of individual artboards, and export of selected artboards together as a PDF.
43
+
44
+ ### Fixed
45
+
46
+ - Whiteboard and the Shell's Ask pane track each request by ID, so another request finishing cannot mark yours done. Requests and comments waiting for an agent follow the artifact when it changes owners. Hosted pages receive status updates when the owner's agent takes or finishes a request.
47
+ - The type server's command-line entry point is executable again.
48
+
49
+ ### Integrators
50
+
51
+ - `artifacts.ask` and `agent.send` return a request ID. Clients can subscribe to `request/state` and read per-request states from artifact presence after reconnecting. Hosts can negotiate `features.requests` to receive updates over `link.requests`.
52
+ - The new `grok` and `devin` harness profiles support their respective hook formats. The Devin integration uses `DEVIN_PROJECT_DIR` to locate the workspace.
53
+
9
54
  ## [0.21.0] - 2026-12-03
10
55
 
11
56
  Edit Motion films on a timeline, follow an agent around a canvas, and open artifacts directly from Orca terminals.
@@ -917,6 +962,8 @@ One version for every package, with Docs and Sheets in every plugin.
917
962
  - Plugins for Claude Code, Codex, Cursor, Copilot, ChatGPT and DeepSeek Harness.
918
963
  - English and Chinese READMEs, under Apache-2.0.
919
964
 
965
+ [0.21.2]: https://github.com/JimLiu/open-artifact/compare/v0.21.1...v0.21.2
966
+ [0.21.1]: https://github.com/JimLiu/open-artifact/compare/v0.21.0...v0.21.1
920
967
  [0.21.0]: https://github.com/JimLiu/open-artifact/compare/v0.20.0...v0.21.0
921
968
  [0.20.0]: https://github.com/JimLiu/open-artifact/compare/v0.19.3...v0.20.0
922
969
  [0.19.3]: https://github.com/JimLiu/open-artifact/compare/v0.19.2...v0.19.3
package/lib/client.js CHANGED
@@ -1,4 +1,4 @@
1
- // dsh-open-artifact 0.21.0: the DSH plugin (browser half). Built by scripts/build.mjs; do not edit.
1
+ // dsh-open-artifact 0.21.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) => {
@@ -245,9 +245,21 @@ window.__ModuleLoader__.load({
245
245
  relocate: "artifacts.relocate",
246
246
  /**
247
247
  * `POST { id, session }` ({@link AssignArtifactRequest}): an artifact no session owns goes to that online session,
248
- * which gets what was sent from it meanwhile. The person's call only.
248
+ * which gets what was sent from it meanwhile, or to a session `GET harnesses` lists as `recent`, which is woken for
249
+ * it first. With `move: true` the artifact may have an owner, which it leaves. The person's call only.
249
250
  */
250
251
  assign: "artifacts.assign",
252
+ /**
253
+ * `POST { id, adapter, text?, model?, effort? }` ({@link StartSessionRequest}): a connected app whose adapter declares
254
+ * `caps.sessions.start` starts a new session for an artifact no session owns (`session.start`). The person's call only.
255
+ */
256
+ start: "artifacts.start",
257
+ /**
258
+ * `GET ?adapter=<id>`: the models a new session of that connected app can run on (`SessionModelsResult`, from the
259
+ * adapter's `session.models`). `{ models: [] }` for an adapter whose caps do not declare `sessions.models`, or that
260
+ * did not answer: the person then starts the session on the app's default.
261
+ */
262
+ sessionModels: "harnesses.models",
251
263
  update: "artifacts.update",
252
264
  duplicate: "artifacts.duplicate",
253
265
  delete: "artifacts.delete",
@@ -333,7 +345,8 @@ window.__ModuleLoader__.load({
333
345
  };
334
346
 
335
347
  // packages/protocol/src/harness.ts
336
- 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", "wake.request.parts", "sample.create", "mcp.proxy", "wake.held"]);
348
+ 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", "wake.request.parts", "sample.create", "mcp.proxy", "wake.held", "session.start", "session.models"]);
349
+ var RECENT_SESSION_WINDOW_MS = 24 * 60 * 6e4;
337
350
 
338
351
  // packages/protocol/src/wake.ts
339
352
  var COMMENT_HEADER = "[Artifact comment sent to agent]";
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // dsh-open-artifact 0.21.0: the DSH plugin (server half). Built by scripts/build.mjs; do not edit.
1
+ // dsh-open-artifact 0.21.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";
@@ -181,9 +181,21 @@ var LIBRARY_ROUTES = {
181
181
  relocate: "artifacts.relocate",
182
182
  /**
183
183
  * `POST { id, session }` ({@link AssignArtifactRequest}): an artifact no session owns goes to that online session,
184
- * which gets what was sent from it meanwhile. The person's call only.
184
+ * which gets what was sent from it meanwhile, or to a session `GET harnesses` lists as `recent`, which is woken for
185
+ * it first. With `move: true` the artifact may have an owner, which it leaves. The person's call only.
185
186
  */
186
187
  assign: "artifacts.assign",
188
+ /**
189
+ * `POST { id, adapter, text?, model?, effort? }` ({@link StartSessionRequest}): a connected app whose adapter declares
190
+ * `caps.sessions.start` starts a new session for an artifact no session owns (`session.start`). The person's call only.
191
+ */
192
+ start: "artifacts.start",
193
+ /**
194
+ * `GET ?adapter=<id>`: the models a new session of that connected app can run on (`SessionModelsResult`, from the
195
+ * adapter's `session.models`). `{ models: [] }` for an adapter whose caps do not declare `sessions.models`, or that
196
+ * did not answer: the person then starts the session on the app's default.
197
+ */
198
+ sessionModels: "harnesses.models",
187
199
  update: "artifacts.update",
188
200
  duplicate: "artifacts.duplicate",
189
201
  delete: "artifacts.delete",
@@ -273,7 +285,7 @@ var HARNESS_PATH = "/__harness";
273
285
  var HARNESS_SUBPROTOCOL = "open-artifact-harness";
274
286
  var PROTOCOL_MIN = 1;
275
287
  var PROTOCOL_MAX = 1;
276
- 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", "wake.request.parts", "sample.create", "mcp.proxy", "wake.held"]);
288
+ 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", "wake.request.parts", "sample.create", "mcp.proxy", "wake.held", "session.start", "session.models"]);
277
289
  var RPC_ERRORS = {
278
290
  parse: -32700,
279
291
  methodNotFound: -32601,
@@ -283,6 +295,7 @@ var RPC_ERRORS = {
283
295
  function rpcErrorCode(code) {
284
296
  return code === "parse_error" ? RPC_ERRORS.parse : code === "method_not_found" ? RPC_ERRORS.methodNotFound : code === "invalid_argument" ? RPC_ERRORS.invalidParams : RPC_ERRORS.server;
285
297
  }
298
+ var RECENT_SESSION_WINDOW_MS = 24 * 60 * 6e4;
286
299
 
287
300
  // packages/protocol/src/wake.ts
288
301
  var COMMENT_HEADER = "[Artifact comment sent to agent]";
@@ -1973,7 +1986,7 @@ import { join as join3, resolve as resolve3 } from "node:path";
1973
1986
  // packages/harness-kit/package.json
1974
1987
  var package_default = {
1975
1988
  name: "@open-artifact/harness-kit",
1976
- version: "0.21.0",
1989
+ version: "0.21.2",
1977
1990
  private: true,
1978
1991
  type: "module",
1979
1992
  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.",
@@ -1983,7 +1996,7 @@ var package_default = {
1983
1996
  "./embed": "./src/embed/index.ts"
1984
1997
  },
1985
1998
  dependencies: {
1986
- "@open-artifact/protocol": "0.21.0"
1999
+ "@open-artifact/protocol": "0.21.2"
1987
2000
  },
1988
2001
  sideEffects: false,
1989
2002
  engines: {
@@ -2208,6 +2221,8 @@ function capsOf(options) {
2208
2221
  else delete caps.sample;
2209
2222
  if (options.mcp) caps.mcp = true;
2210
2223
  else delete caps.mcp;
2224
+ if (options.startSession) caps.sessions = options.sessionModels ? { start: true, models: true } : { start: true };
2225
+ else delete caps.sessions;
2211
2226
  return caps;
2212
2227
  }
2213
2228
  function profileOf(options, caps) {
@@ -2368,6 +2383,31 @@ async function createHarness(options) {
2368
2383
  rounds.delete(id);
2369
2384
  }
2370
2385
  };
2386
+ const startSession2 = async (params) => {
2387
+ const artifact = params?.artifact;
2388
+ try {
2389
+ const picked = (value) => typeof value === "string" && value ? value : void 0;
2390
+ const model = picked(params?.model);
2391
+ const effort = model ? picked(params?.effort) : void 0;
2392
+ const answer = await options.startSession({ text: String(params?.text ?? ""), artifact, ...model ? { model } : {}, ...effort ? { effort } : {} });
2393
+ if (answer === false) return { started: false };
2394
+ const session = answer && typeof answer.session === "string" && answer.session ? answer.session : void 0;
2395
+ const workspace = answer && typeof answer.workspace === "string" && answer.workspace ? answer.workspace : void 0;
2396
+ return { started: true, ...session ? { session } : {}, ...workspace ? { workspace } : {} };
2397
+ } catch (error) {
2398
+ log(`open-artifact session.start for ${artifact?.url ?? "an artifact"}: ${error?.message ?? error}`);
2399
+ return { started: false };
2400
+ }
2401
+ };
2402
+ const sessionModels = async () => {
2403
+ try {
2404
+ const answer = await options.sessionModels();
2405
+ return answer && typeof answer === "object" && Array.isArray(answer.models) ? answer : { models: [] };
2406
+ } catch (error) {
2407
+ log(`open-artifact session.models: ${error?.message ?? error}`);
2408
+ return { models: [] };
2409
+ }
2410
+ };
2371
2411
  const lender = options.mcp ? mcpLender(options.mcp, log) : null;
2372
2412
  const known = /* @__PURE__ */ new Map();
2373
2413
  let since = Date.now();
@@ -2469,6 +2509,8 @@ async function createHarness(options) {
2469
2509
  ...options.wake ? { "wake.deliver": (params) => wake(params) } : {},
2470
2510
  ...options.sample ? { "sample.create": sampleCreate } : {},
2471
2511
  ...lender ? lender.handlers : {},
2512
+ ...options.startSession ? { "session.start": startSession2 } : {},
2513
+ ...options.startSession && options.sessionModels ? { "session.models": sessionModels } : {},
2472
2514
  "shell.event": (params) => {
2473
2515
  emit("shell", params);
2474
2516
  return { ok: true };
@@ -3380,6 +3422,70 @@ function updateChecker(names, manager, fetcher = fetch) {
3380
3422
  };
3381
3423
  }
3382
3424
 
3425
+ // plugins/dsh/src/server/sessions.ts
3426
+ import { randomUUID as randomUUID3 } from "node:crypto";
3427
+ import { isAbsolute as isAbsolute2, relative as relative2 } from "node:path";
3428
+ var modelId = (selection) => `${selection.provider}/${selection.model}`;
3429
+ function sessionModelsOf(catalog) {
3430
+ const models = [];
3431
+ for (const group of catalog?.groups ?? []) {
3432
+ for (const model of group.models ?? []) {
3433
+ const efforts = (model.reasoning?.efforts ?? []).map((effort2) => ({ id: effort2.id, label: effort2.name || effort2.id }));
3434
+ const fallback = model.reasoning?.defaultEffort;
3435
+ models.push({
3436
+ id: modelId({ provider: group.id, model: model.id }),
3437
+ label: model.name || model.id,
3438
+ group: group.name || group.id,
3439
+ ...efforts.length ? { efforts } : {},
3440
+ ...fallback && efforts.some((effort2) => effort2.id === fallback) ? { defaultEffort: fallback } : {}
3441
+ });
3442
+ }
3443
+ }
3444
+ const usual = catalog?.default;
3445
+ const listed = usual ? models.find((model) => model.id === modelId(usual)) : void 0;
3446
+ if (!listed) return { models };
3447
+ const effort = usual?.reasoningEffort;
3448
+ return { models, default: { model: listed.id, ...effort && listed.efforts?.some((e) => e.id === effort) ? { effort } : {} } };
3449
+ }
3450
+ function selectionOf(catalog, id, effort) {
3451
+ for (const group of catalog?.groups ?? []) {
3452
+ for (const model of group.models ?? []) {
3453
+ if (modelId({ provider: group.id, model: model.id }) !== id) continue;
3454
+ const offered = !!effort && (model.reasoning?.efforts ?? []).some((e) => e.id === effort);
3455
+ return { provider: group.id, model: model.id, ...offered ? { reasoningEffort: effort } : {} };
3456
+ }
3457
+ }
3458
+ return void 0;
3459
+ }
3460
+ var holds = (root, folder) => {
3461
+ const rest = relative2(root, folder);
3462
+ return rest === "" || !rest.startsWith("..") && !isAbsolute2(rest);
3463
+ };
3464
+ function workspaceFor(workspaces, root) {
3465
+ const around = workspaces.filter((w) => !!w?.id && !!w.path && !!root && holds(w.path, root)).sort((a, b) => b.path.length - a.path.length);
3466
+ return around[0] ?? workspaces.find((w) => !!w?.id);
3467
+ }
3468
+ var startsSessions = (controller) => typeof controller?.create === "function" && typeof controller.prompt === "function";
3469
+ async function startSession(host, request) {
3470
+ const { controller } = host;
3471
+ let selection;
3472
+ if (request.model) {
3473
+ if (typeof controller.selectModel !== "function" || typeof controller.modelCatalog !== "function") throw new Error("This DSH cannot pick a session's model.");
3474
+ const catalog = await controller.modelCatalog();
3475
+ selection = selectionOf(catalog, request.model, request.effort);
3476
+ if (!selection) throw new Error(`DSH does not list the model ${request.model} now.`);
3477
+ if (request.effort && !selection.reasoningEffort) throw new Error(`The model ${request.model} does not offer the reasoning effort ${request.effort}.`);
3478
+ const usual = catalog.default;
3479
+ if (usual && modelId(usual) === request.model && (usual.reasoningEffort ?? "") === (selection.reasoningEffort ?? "")) selection = void 0;
3480
+ }
3481
+ const workspace = workspaceFor(host.workspaces, request.root);
3482
+ const { sessionId } = await controller.create(workspace ? { workspaceId: workspace.id } : host.cwd ? { cwd: host.cwd } : {});
3483
+ if (!sessionId) throw new Error("DSH started no session.");
3484
+ if (selection) await controller.selectModel({ sessionId, ...selection });
3485
+ await controller.prompt({ requestId: randomUUID3(), sessionId, mode: "queue", content: [{ type: "text", text: request.text }] }, new AbortController().signal);
3486
+ return sessionId;
3487
+ }
3488
+
3383
3489
  // plugins/dsh/src/server/skill.ts
3384
3490
  import { join as join5, sep as sep2 } from "node:path";
3385
3491
  var SKILL_NAME = "open-artifact";
@@ -3465,7 +3571,7 @@ function runtimeOf(root = packageRoot()) {
3465
3571
  }
3466
3572
 
3467
3573
  // plugins/dsh/src/server/wake.ts
3468
- import { randomUUID as randomUUID3 } from "node:crypto";
3574
+ import { randomUUID as randomUUID4 } from "node:crypto";
3469
3575
  var QUESTION_TOOL = "ask_user_question";
3470
3576
  function wakeMessage({ text, source }) {
3471
3577
  const firstLine = text.split("\n").find((line) => line !== "" && !line.startsWith("["));
@@ -3473,7 +3579,7 @@ function wakeMessage({ text, source }) {
3473
3579
  const extra = source && typeof source === "object" ? source : {};
3474
3580
  return Object.freeze({
3475
3581
  role: "user",
3476
- id: randomUUID3(),
3582
+ id: randomUUID4(),
3477
3583
  content: Object.freeze([Object.freeze({ type: "text", text })]),
3478
3584
  source: Object.freeze({ ...extra, kind: WAKE_SOURCE_KIND, form: "notice", summary })
3479
3585
  });
@@ -3594,7 +3700,12 @@ function setup(ctx, config = {}, deps = {}) {
3594
3700
  const live = service(ctx, "agents")?.get?.(session);
3595
3701
  if (live) return live;
3596
3702
  const controller = service(ctx, "sessionController");
3597
- return typeof controller?.resolveAgent === "function" ? await controller.resolveAgent(session) : void 0;
3703
+ if (typeof controller?.resolveAgent !== "function") return void 0;
3704
+ const found = await controller.resolveAgent(session);
3705
+ if (!found) return void 0;
3706
+ if ("followup" in found) return found;
3707
+ if (!found.agent) log("warn", `the session ${session} cannot be resumed: ${found.error instanceof Error ? found.error.message : String(found.error ?? "no agent")}`);
3708
+ return found.agent;
3598
3709
  };
3599
3710
  const questions = new QuestionTracker();
3600
3711
  const waitsOf = (agent) => {
@@ -3628,8 +3739,29 @@ function setup(ctx, config = {}, deps = {}) {
3628
3739
  }
3629
3740
  return fromOwner(params.source) ? deliverWake(agent, message, waitingOf(agent)) : deliverNotice(agent, message);
3630
3741
  };
3742
+ const onStartSession = async (request) => {
3743
+ const controller = service(ctx, "sessionController");
3744
+ if (!startsSessions(controller)) {
3745
+ log("warn", "this DSH has no way to start a session for an artifact");
3746
+ return false;
3747
+ }
3748
+ const session = await startSession(
3749
+ { controller, workspaces: service(ctx, "workspaceRegistry")?.list?.() ?? [], ...config.workspace ? { cwd: config.workspace } : {} },
3750
+ { text: request.text, root: request.artifact?.root ?? "", ...request.model ? { model: request.model, ...request.effort ? { effort: request.effort } : {} } : {} }
3751
+ );
3752
+ const status = service(ctx, "agents")?.get?.(session)?.status ?? "running";
3753
+ const workspace = await cwdOf({ agent: { id: session, status } });
3754
+ queueMicrotask(() => void track(session, workspace, status).catch((e) => log("warn", `session.attach: ${e.message}`)));
3755
+ return { session, ...workspace ? { workspace } : {} };
3756
+ };
3757
+ const onSessionModels = async () => {
3758
+ const controller = service(ctx, "sessionController");
3759
+ return sessionModelsOf(typeof controller?.modelCatalog === "function" ? await controller.modelCatalog() : null);
3760
+ };
3631
3761
  const connect = () => {
3632
3762
  const sample = dshSample(ctx);
3763
+ const controller = service(ctx, "sessionController");
3764
+ const starts = !controller || startsSessions(controller);
3633
3765
  const made = createHarness({
3634
3766
  harness: HARNESS,
3635
3767
  agentName,
@@ -3647,6 +3779,7 @@ function setup(ctx, config = {}, deps = {}) {
3647
3779
  wake: onWake,
3648
3780
  open: (request) => hostOpens.open(request.session, request.embedUrl, request.title ?? "", { ...request.view ? { view: request.view } : {}, agentName }),
3649
3781
  ...sample ? { sample } : {},
3782
+ ...starts ? { startSession: onStartSession, sessionModels: onSessionModels } : {},
3650
3783
  ...deps.harness
3651
3784
  });
3652
3785
  made.then(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-open-artifact",
3
- "version": "0.21.0",
3
+ "version": "0.21.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.21.0
5
+ generated-by: open-artifact 0.21.2
6
6
  etag: 8c07c13872fe8f42
7
7
  ---
8
8
 
@@ -41,7 +41,8 @@ Read `<root>/project/canvas.json`: none, or `boards` empty: if just made, see Cr
41
41
 
42
42
  Tell the person what happens on the canvas, never the mechanism.
43
43
  When your reply mentions an artboard or a canvas page, give its link: the editor's `url` followed by `#artboard-<name>` (the
44
- artboard selected and in view), `#play-<name>` (running on the canvas) or `#page-<id>` (a page id from the index).
44
+ artboard selected and in view), `#play-<name>` (running: an interactive artboard as a screen of Prototype view, any other
45
+ on the canvas) or `#page-<id>` (a page id from the index).
45
46
  `<name>` is its path under `project/` without `.dc.html`, in lower case, each run of other characters one `-`
46
47
  (`screens/Sign In.dc.html` → `screens-sign-in`). A name that fits two artboards opens nothing.
47
48
  Asked to send it to apps like Canva: there is no Send to here; point the person to **Share → Export** in the global frame shell to
@@ -274,9 +274,21 @@ var LIBRARY_ROUTES = {
274
274
  relocate: "artifacts.relocate",
275
275
  /**
276
276
  * `POST { id, session }` ({@link AssignArtifactRequest}): an artifact no session owns goes to that online session,
277
- * which gets what was sent from it meanwhile. The person's call only.
277
+ * which gets what was sent from it meanwhile, or to a session `GET harnesses` lists as `recent`, which is woken for
278
+ * it first. With `move: true` the artifact may have an owner, which it leaves. The person's call only.
278
279
  */
279
280
  assign: "artifacts.assign",
281
+ /**
282
+ * `POST { id, adapter, text?, model?, effort? }` ({@link StartSessionRequest}): a connected app whose adapter declares
283
+ * `caps.sessions.start` starts a new session for an artifact no session owns (`session.start`). The person's call only.
284
+ */
285
+ start: "artifacts.start",
286
+ /**
287
+ * `GET ?adapter=<id>`: the models a new session of that connected app can run on (`SessionModelsResult`, from the
288
+ * adapter's `session.models`). `{ models: [] }` for an adapter whose caps do not declare `sessions.models`, or that
289
+ * did not answer: the person then starts the session on the app's default.
290
+ */
291
+ sessionModels: "harnesses.models",
280
292
  update: "artifacts.update",
281
293
  duplicate: "artifacts.duplicate",
282
294
  delete: "artifacts.delete",
@@ -362,7 +374,8 @@ var LIBRARY_ROUTES = {
362
374
  };
363
375
 
364
376
  // packages/protocol/src/harness.ts
365
- 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", "wake.request.parts", "sample.create", "mcp.proxy", "wake.held"]);
377
+ 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", "wake.request.parts", "sample.create", "mcp.proxy", "wake.held", "session.start", "session.models"]);
378
+ var RECENT_SESSION_WINDOW_MS = 24 * 60 * 6e4;
366
379
 
367
380
  // packages/protocol/src/type-server.ts
368
381
  var TYPE_SERVER_ROUTES = {
@@ -383,6 +396,11 @@ var TYPE_API_ROUTES = {
383
396
  task: "task",
384
397
  /** `POST { id, at }`: the owner's view context of the artifact changed (the daemon tells adapters, throttled). */
385
398
  context: "context",
399
+ /**
400
+ * `POST { id }`: the agent's work on the artifact stopped (nothing was written to it for a while). What a session
401
+ * took of the artifact's requests is done then, when the daemon hears no turn ends of that session.
402
+ */
403
+ quiet: "quiet",
386
404
  /**
387
405
  * `POST` `TypeApiSampleRequest` (sample.ts, with every `sample` body): a page's `sample` call, streamed. The one Type API route whose answer is a
388
406
  * stream: NDJSON (`SAMPLE_STREAM_CONTENT_TYPE`) of `SampleStreamEvent`s, kept open until `done` or
@@ -5492,10 +5510,14 @@ var TypeApi = class {
5492
5510
  return this.call(TYPE_API_ROUTES.artifact, { query: { id } });
5493
5511
  }
5494
5512
  /** Hands comment threads and page requests to the owner's session. */
5495
- wake(id, { threads, requests } = {}) {
5496
- const body = { id, ...threads ? { threads } : {}, ...requests ? { requests } : {} };
5513
+ wake(id, { threads, requests, stage } = {}) {
5514
+ const body = { id, ...threads ? { threads } : {}, ...requests ? { requests } : {}, ...stage ? { stage: true } : {} };
5497
5515
  return this.call(TYPE_API_ROUTES.wake, { body });
5498
5516
  }
5517
+ /** Reports that the agent's work on the artifact stopped: nothing was written to it for a while. */
5518
+ quiet(id) {
5519
+ return this.call(TYPE_API_ROUTES.quiet, { body: { id } });
5520
+ }
5499
5521
  /** Whether an agent is there to receive, and whether it is busy. */
5500
5522
  presence(id) {
5501
5523
  return this.call(TYPE_API_ROUTES.presence, { query: { id } });
@@ -49,6 +49,51 @@
49
49
  "ANTIGRAVITY_CSRF_TOKEN": "${file.csrfToken}"
50
50
  }
51
51
  },
52
+ "start": {
53
+ "command": [
54
+ "${env:OPEN_ARTIFACT_ANTIGRAVITY_AGENTAPI}",
55
+ "~/.gemini/antigravity/bin/agentapi",
56
+ [
57
+ "/Applications/Antigravity.app/Contents/Resources/bin/language_server",
58
+ "agentapi"
59
+ ]
60
+ ],
61
+ "args": [
62
+ "new-conversation",
63
+ [
64
+ "--model=${model}"
65
+ ],
66
+ [
67
+ "--title=${title}"
68
+ ],
69
+ "--",
70
+ "${text}"
71
+ ],
72
+ "envFile": {
73
+ "dir": "~/.gemini/antigravity/daemon",
74
+ "pattern": "^hub_\\d+\\.json$",
75
+ "pid": "pid"
76
+ },
77
+ "env": {
78
+ "ANTIGRAVITY_LS_ADDRESS": "127.0.0.1:${file.httpPort}",
79
+ "ANTIGRAVITY_CSRF_TOKEN": "${file.csrfToken}"
80
+ },
81
+ "session": "response.newConversation.conversationId",
82
+ "models": [
83
+ {
84
+ "id": "flash_lite",
85
+ "label": "Flash Lite"
86
+ },
87
+ {
88
+ "id": "flash",
89
+ "label": "Flash"
90
+ },
91
+ {
92
+ "id": "pro",
93
+ "label": "Pro"
94
+ }
95
+ ]
96
+ },
52
97
  "caps": {
53
98
  "tools": "mcp",
54
99
  "commands": {
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "devin",
3
+ "title": "Devin",
4
+ "agentName": "Devin",
5
+ "level": "L2",
6
+ "entry": "mcp",
7
+ "plugin": "open-artifact",
8
+ "mcp": {
9
+ "command": "node",
10
+ "args": [
11
+ "${PLUGIN_ROOT}/skills/open-artifact/scripts/open-artifact.mjs",
12
+ "mcp",
13
+ "--harness",
14
+ "devin"
15
+ ]
16
+ },
17
+ "skillsDir": "~/.config/devin/skills",
18
+ "wake": [
19
+ "inbox"
20
+ ],
21
+ "open": "browser",
22
+ "wakesIdle": false,
23
+ "hookDialect": "claude-code",
24
+ "caps": {
25
+ "tools": "mcp",
26
+ "commands": {
27
+ "names": [
28
+ "open-artifact"
29
+ ]
30
+ }
31
+ },
32
+ "policy": {
33
+ "artifacts": "workspace"
34
+ }
35
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "grok",
3
+ "title": "Grok Build",
4
+ "agentName": "Grok",
5
+ "level": "L2",
6
+ "entry": "mcp",
7
+ "plugin": "open-artifact",
8
+ "mcp": {
9
+ "command": "node",
10
+ "args": [
11
+ "${GROK_PLUGIN_ROOT}/skills/open-artifact/scripts/open-artifact.mjs",
12
+ "mcp",
13
+ "--harness",
14
+ "grok"
15
+ ]
16
+ },
17
+ "sessionEnv": "GROK_SESSION_ID",
18
+ "skillsDir": "~/.grok/skills",
19
+ "wake": [
20
+ "inbox"
21
+ ],
22
+ "open": "browser",
23
+ "wakesIdle": false,
24
+ "markers": [
25
+ "GROK_AGENT",
26
+ "GROK_SESSION_ID"
27
+ ],
28
+ "hookDialect": "grok",
29
+ "caps": {
30
+ "tools": "mcp",
31
+ "commands": {
32
+ "names": [
33
+ "open-artifact"
34
+ ]
35
+ }
36
+ },
37
+ "policy": {
38
+ "artifacts": "workspace"
39
+ }
40
+ }