@open-artifact/protocol 0.2.1 → 0.9.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 +1 -1
- package/src/library.d.ts +6 -0
- package/src/prompt.js +1 -1
- package/src/shell.d.ts +35 -0
- package/src/shell.js +4 -0
- package/src/tools.js +1 -1
package/package.json
CHANGED
package/src/library.d.ts
CHANGED
|
@@ -193,6 +193,12 @@ export declare const LIBRARY_ROUTES: {
|
|
|
193
193
|
* object. The Shell reads it from `window.__OPEN_ARTIFACT_BOOT__`.
|
|
194
194
|
*/
|
|
195
195
|
export interface ShellBoot {
|
|
196
|
+
/** The same Shell served by a type server for CLI and LAN visits, without the daemon library. */
|
|
197
|
+
typeServer?: {
|
|
198
|
+
role: 'owner' | 'editor' | 'commenter' | 'viewer';
|
|
199
|
+
invite?: string;
|
|
200
|
+
sharePath?: string;
|
|
201
|
+
};
|
|
196
202
|
id: string;
|
|
197
203
|
url: string;
|
|
198
204
|
title: string;
|
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 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 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,6 +37,10 @@ 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. */
|
|
41
|
+
export declare const SLIDE_FRAGMENT: RegExp;
|
|
42
|
+
/** A Docs tab, optionally followed by a block id or heading slug in that tab. */
|
|
43
|
+
export declare const DOC_FRAGMENT: RegExp;
|
|
40
44
|
/** Version of the chrome protocol. */
|
|
41
45
|
export declare const CHROME_PROTOCOL = 1;
|
|
42
46
|
/** The page's save state. */
|
|
@@ -98,6 +102,8 @@ export type ChromeExportState = 'started' | 'done' | 'busy' | 'unsupported' | 'd
|
|
|
98
102
|
export declare const CHROME_REQUEST: RegExp;
|
|
99
103
|
/** What the page reports to the Shell. Every part is optional. */
|
|
100
104
|
export interface ChromeReport {
|
|
105
|
+
/** Current document title in a type-server shell. */
|
|
106
|
+
title?: string;
|
|
101
107
|
comments?: {
|
|
102
108
|
available: boolean;
|
|
103
109
|
on: boolean;
|
|
@@ -151,8 +157,18 @@ export interface ChromeExportItem {
|
|
|
151
157
|
}
|
|
152
158
|
/** Commands the Shell sends to the page. */
|
|
153
159
|
export type ChromeCommand = {
|
|
160
|
+
cmd: 'goto_doc';
|
|
161
|
+
hash: string;
|
|
162
|
+
} | {
|
|
163
|
+
cmd: 'goto_sheet';
|
|
164
|
+
page: string;
|
|
165
|
+
} | {
|
|
166
|
+
cmd: 'goto_slide';
|
|
167
|
+
hash: string;
|
|
168
|
+
} | {
|
|
154
169
|
cmd: 'comments_mode';
|
|
155
170
|
on?: boolean;
|
|
171
|
+
anchor?: string;
|
|
156
172
|
} | {
|
|
157
173
|
cmd: 'comments_list';
|
|
158
174
|
open?: boolean;
|
|
@@ -284,6 +300,25 @@ export type ShellToPage =
|
|
|
284
300
|
} | CapToPage;
|
|
285
301
|
/** Page → Shell. */
|
|
286
302
|
export type PageToShell = {
|
|
303
|
+
openArtifact: 'sheet_page' | 'copy_sheet_link';
|
|
304
|
+
page: string | null;
|
|
305
|
+
} | {
|
|
306
|
+
openArtifact: 'design_page';
|
|
307
|
+
page: string | null;
|
|
308
|
+
} | {
|
|
309
|
+
openArtifact: 'doc_place';
|
|
310
|
+
hash: string;
|
|
311
|
+
} | {
|
|
312
|
+
openArtifact: 'current_slide';
|
|
313
|
+
hash: string;
|
|
314
|
+
} | {
|
|
315
|
+
openArtifact: 'copy_slide_link';
|
|
316
|
+
hash: string;
|
|
317
|
+
} | {
|
|
318
|
+
openArtifact: 'request_comment_mode';
|
|
319
|
+
on: boolean;
|
|
320
|
+
anchor?: string;
|
|
321
|
+
} | {
|
|
287
322
|
openArtifact: 'chrome_report';
|
|
288
323
|
protocol: number;
|
|
289
324
|
report: ChromeReport;
|
package/src/shell.js
CHANGED
|
@@ -37,6 +37,10 @@ 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})$/;
|
|
42
|
+
/** A Docs tab, optionally followed by a block id or heading slug in that tab. */
|
|
43
|
+
export const DOC_FRAGMENT = /^#[0-9a-f]{8}-[0-9a-f]{4}(?:\.[^\s#]{1,500})?$/;
|
|
40
44
|
/** Version of the chrome protocol. */
|
|
41
45
|
export const CHROME_PROTOCOL = 1;
|
|
42
46
|
/** What the Shell draws, in the order it sends them. */
|
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, slides, whiteboard, document, data, other), or a few words about it.',
|
|
27
|
+
description: 'quickstart: what is being made (design, design-system, slides, whiteboard, document, data, sheets, other), or a few words about it.',
|
|
28
28
|
},
|
|
29
29
|
scope: {
|
|
30
30
|
type: 'string',
|