@open-artifact/protocol 0.10.0 → 0.12.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-artifact/protocol",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "The Open Artifact protocol: typed contracts shared by the daemon, harness adapters, type servers, the Shell and pages.",
5
5
  "type": "module",
6
6
  "exports": {
package/src/prompt.js CHANGED
@@ -44,7 +44,7 @@ export function typeLine(type, short = false) {
44
44
  const parts = [withStop(title), withStop(when), exports.length ? `Exports: ${exports.join(', ')}.` : ''].filter(Boolean);
45
45
  return `- ${type.id}: ${parts.join(' ')}`;
46
46
  }
47
- const INTRO = 'Open Artifact lets you make artifacts: typed folders of files (a slide deck, a design canvas, a whiteboard, a data dashboard, a spreadsheet, a doc and more) that open as live pages the person can view, edit, comment on and export. You make and change them with the Artifact, ArtifactData and ArtifactComments tools.';
47
+ const INTRO = 'Open Artifact lets you make artifacts: typed folders of files (a slide deck, a design canvas, a whiteboard, a data dashboard, a spreadsheet, a doc, an animated motion piece and more) that open as live pages the person can view, edit, comment on and export. You make and change them with the Artifact, ArtifactData and ArtifactComments tools.';
48
48
  const WHERE_OUTPUT_GOES = `<where_output_goes>
49
49
  Decide where your output will live before you make anything.
50
50
  - Something the person will read once and move on from (an answer, an explanation, a summary, a short report) goes in your reply, however long it is. A diagram or chart that explains your answer goes in the reply too, when you can show one there.
package/src/shell.d.ts CHANGED
@@ -37,8 +37,17 @@ export declare const SHELL_PARAMS: {
37
37
  /** A panel of the Shell to open on load: `share` (the Share panel) or `export` (its Export tab). */
38
38
  readonly panel: "panel";
39
39
  };
40
- /** Slide links use stable ids. Earlier versions used a one-based page number. */
40
+ /**
41
+ * Slide links use stable ids. Earlier versions used a one-based page number.
42
+ * `.only` after an id opens that slide on its own, every build shown; the page
43
+ * reports where it is as `.only.<position>.<count>`.
44
+ */
41
45
  export declare const SLIDE_FRAGMENT: RegExp;
46
+ /**
47
+ * Another page frames a deck at this fragment to show it read only, one
48
+ * slide at a time with a pager, and without the Shell's bar.
49
+ */
50
+ export declare const INLINE_VIEW_FRAGMENT = "#view-inline";
42
51
  /** A Docs tab, optionally followed by a block id or heading slug in that tab. */
43
52
  export declare const DOC_FRAGMENT: RegExp;
44
53
  /** Version of the chrome protocol. */
@@ -426,6 +435,11 @@ export type HostToShell = {
426
435
  openArtifact: 'host_hello';
427
436
  caps: HostCaps;
428
437
  agentName?: string;
438
+ }
439
+ /** Show this place of the artifact (a fragment from `place`, or a link's own); the Shell answers with `place`. */
440
+ | {
441
+ openArtifact: 'goto';
442
+ hash: string;
429
443
  };
430
444
  /** Shell → host. */
431
445
  export type ShellToHost =
@@ -459,6 +473,16 @@ export type ShellToHost =
459
473
  | {
460
474
  openArtifact: 'close';
461
475
  }
476
+ /**
477
+ * Where the artifact is now: a slide, a Docs tab or block, a sheet. The
478
+ * host can keep the fragment and send it back with `goto`. Sent after
479
+ * `shell_ready`, whenever the place changes, and in answer to `goto`.
480
+ */
481
+ | {
482
+ openArtifact: 'place';
483
+ artifact: string;
484
+ hash: string;
485
+ }
462
486
  /** A comment was sent to the agent; the host may show the session. */
463
487
  | {
464
488
  openArtifact: 'comment_summon';
package/src/shell.js CHANGED
@@ -37,8 +37,17 @@ export const SHELL_PARAMS = {
37
37
  /** A panel of the Shell to open on load: `share` (the Share panel) or `export` (its Export tab). */
38
38
  panel: 'panel',
39
39
  };
40
- /** Slide links use stable ids. Earlier versions used a one-based page number. */
41
- export const SLIDE_FRAGMENT = /^#slide-(?:~[A-Za-z0-9_-]{1,64}|[0-9]{1,4})$/;
40
+ /**
41
+ * Slide links use stable ids. Earlier versions used a one-based page number.
42
+ * `.only` after an id opens that slide on its own, every build shown; the page
43
+ * reports where it is as `.only.<position>.<count>`.
44
+ */
45
+ export const SLIDE_FRAGMENT = /^#slide-(?:~[A-Za-z0-9_-]{1,64}(?:\.only(?:\.[0-9]{1,4}\.[0-9]{1,4})?)?|[0-9]{1,4})$/;
46
+ /**
47
+ * Another page frames a deck at this fragment to show it read only, one
48
+ * slide at a time with a pager, and without the Shell's bar.
49
+ */
50
+ export const INLINE_VIEW_FRAGMENT = '#view-inline';
42
51
  /** A Docs tab, optionally followed by a block id or heading slug in that tab. */
43
52
  export const DOC_FRAGMENT = /^#[0-9a-f]{8}-[0-9a-f]{4}(?:\.[^\s#]{1,500})?$/;
44
53
  /** Version of the chrome protocol. */
package/src/tools.js CHANGED
@@ -24,7 +24,7 @@ const ARTIFACT_SCHEMA = {
24
24
  },
25
25
  intent: {
26
26
  type: 'string',
27
- description: 'quickstart: what is being made (design, design-system, slides, whiteboard, document, data, sheets, other), or a few words about it.',
27
+ description: 'quickstart: what is being made (design, design-system, slides, whiteboard, document, data, sheets, motion, other), or a few words about it.',
28
28
  },
29
29
  scope: {
30
30
  type: 'string',