@kitionstage/sdk 0.5.2-stage.1 → 0.5.2-stage.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/README.md +4 -0
- package/dist/lib/assets/kitEngine.worker-3iMvwtlI.js +12732 -0
- package/dist/lib/assets/loro_wasm_bg-Gulzks_0.wasm +0 -0
- package/dist/lib/embed-server/index.js +1 -1
- package/dist/lib/kit-dev-host/checkUiIds.mjs +1 -1
- package/dist/lib/kit-dev-host/modeSmoke.mjs +1 -1
- package/dist/lib/kit-editor/index.js +2 -10
- package/dist/lib/kit-editor/styles.css +1 -1
- package/dist/standalone/chunks/{collab-B5TbpTyO.js → collab-CTQZ9h7J.js} +1 -1
- package/dist/standalone/chunks/{document-CuIGSDsY.js → document-B5MMuYyN.js} +9 -9
- package/dist/standalone/chunks/{index-Blc_B6iX.js → index-EEl8hGbP.js} +3 -3
- package/dist/standalone/index.js +1 -1
- package/dist/standalone/script/index.js +2 -2
- package/dist/standalone/script/node.js +3 -3
- package/dist/types/convergence/src/engine.d.ts +1 -1
- package/dist/types/convergence/src/index.d.ts +2 -2
- package/dist/types/embed/src/agent.d.ts +1 -1
- package/dist/types/embed/src/types.d.ts +10 -10
- package/dist/types/embed-server/src/page.d.ts +1 -1
- package/dist/types/embed-server/src/server.d.ts +1 -1
- package/dist/types/extensions/src/host.d.ts +2 -2
- package/dist/types/extensions/src/index.d.ts +3 -3
- package/dist/types/extensions/src/runtime/document.d.ts +1 -1
- package/dist/types/extensions/src/runtime/index.d.ts +1 -1
- package/dist/types/kit-dev-host/src/memoryFiles.d.ts +1 -1
- package/dist/types/kit-editor/src/engine/kitModelRunner.d.ts +2 -2
- package/dist/types/kit-editor/src/engine/kitModule.d.ts +1 -1
- package/dist/types/kit-editor/src/index.d.ts +3 -3
- package/dist/types/kit-editor/src/workspaceTree.d.ts +1 -1
- package/dist/types/kit-engine/src/contract.d.ts +1 -1
- package/dist/types/kit-host/src/files.d.ts +1 -1
- package/dist/types/kit-ui-protocol/src/index.d.ts +1 -1
- package/dist/types/script/kits/board.d.ts +1 -1
- package/dist/types/script/kits/cad.d.ts +1 -1
- package/dist/types/script/kits/design.d.ts +1 -1
- package/dist/types/script/kits/doc.d.ts +1 -1
- package/dist/types/script/kits/film.d.ts +1 -1
- package/dist/types/script/kits/html.d.ts +1 -1
- package/dist/types/script/kits/layout.d.ts +1 -1
- package/dist/types/script/kits/motion.d.ts +1 -1
- package/dist/types/script/kits/note.d.ts +1 -1
- package/dist/types/script/kits/pdf.d.ts +1 -1
- package/dist/types/script/kits/photo.d.ts +1 -1
- package/dist/types/script/kits/scene.d.ts +1 -1
- package/dist/types/script/kits/sheet.d.ts +1 -1
- package/dist/types/script/kits/slide.d.ts +1 -1
- package/dist/types/script/kits/table.d.ts +1 -1
- package/dist/types/script/kits/vector.d.ts +1 -1
- package/dist/types/script/src/agentRelay.d.ts +1 -1
- package/dist/types/script/src/document.d.ts +4 -4
- package/dist/types/script/src/headless.d.ts +1 -1
- package/dist/types/script/src/index.d.ts +2 -2
- package/dist/types/script/src/kits.d.ts +1 -1
- package/dist/types/script/src/node.d.ts +1 -1
- package/dist/types/script/src/port.d.ts +1 -1
- package/dist/types/script/src/room.d.ts +1 -1
- package/dist/types/script/src/sources.d.ts +2 -2
- package/dist/types/sync/src/index.d.ts +2 -2
- package/dist/types/sync/src/relay.d.ts +1 -1
- package/package.json +1 -1
- package/dist/lib/assets/kitEngine.worker-9haDiVHZ.js +0 -13220
|
Binary file
|
|
@@ -105,7 +105,7 @@ function q() {
|
|
|
105
105
|
try {
|
|
106
106
|
return W(J(import.meta.resolve("@kition/sdk/embed")));
|
|
107
107
|
} catch {
|
|
108
|
-
throw new Error("@kition/embed is not installed next to @kition/embed
|
|
108
|
+
throw new Error("@kition/sdk/embed is not installed next to @kition/sdk/embed/server: install it, or set embedDir");
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
class a extends Error {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// options bar, tool rail, panels, workspace frames) sits in an element with an id, and every id drawn is one the editor lists in
|
|
4
4
|
// `ui/elements`.
|
|
5
5
|
//
|
|
6
|
-
// import { checkUiIds } from '@kition/
|
|
6
|
+
// import { checkUiIds } from '@kition/sdk/dev-host/check-ui-ids'
|
|
7
7
|
// const problems = await checkUiIds(frame, await page.evaluate(() => window.devHost.connection().elements()))
|
|
8
8
|
//
|
|
9
9
|
// With `{ strict: true }`, a panel's own id does not cover the controls inside its content: a
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
//
|
|
9
9
|
// import { chromium, webkit } from 'playwright'
|
|
10
10
|
// import { createServer } from 'vite'
|
|
11
|
-
// import { runModeSmoke } from '@kition/
|
|
11
|
+
// import { runModeSmoke } from '@kition/sdk/dev-host/mode-smoke'
|
|
12
12
|
// await runModeSmoke({ kit: 'kit.doc', config: new URL('../vite.config.ts', import.meta.url).pathname, browser: process.argv[2] === 'webkit' ? webkit : chromium, createServer })
|
|
13
13
|
//
|
|
14
14
|
// With `line: { tab, primary, min }` it also opens the editor with Single line chosen and Menus
|
|
@@ -488,11 +488,7 @@ class ot {
|
|
|
488
488
|
* they change only comment objects.
|
|
489
489
|
*/
|
|
490
490
|
static async open(t, n, r, i = null, o = null, a = !1, s = !1) {
|
|
491
|
-
const d = new Worker(new URL(
|
|
492
|
-
/* @vite-ignore */
|
|
493
|
-
"" + new URL("../assets/kitEngine.worker-9haDiVHZ.js", import.meta.url).href,
|
|
494
|
-
import.meta.url
|
|
495
|
-
), { type: "module" }), c = new ot(d, qt);
|
|
491
|
+
const d = new Worker(new URL("../assets/kitEngine.worker-3iMvwtlI.js", import.meta.url), { type: "module" }), c = new ot(d, qt);
|
|
496
492
|
d.onmessage = (l) => c.settle(l.data), d.onerror = (l) => c.fail(new Error(l.message || "the kit engine stopped"));
|
|
497
493
|
try {
|
|
498
494
|
const l = o?.stored;
|
|
@@ -506,11 +502,7 @@ class ot {
|
|
|
506
502
|
* `lent` lets it read other files, for example the clip a video project is made from.
|
|
507
503
|
*/
|
|
508
504
|
static async create(t, n, r, i, o = null, a = !1) {
|
|
509
|
-
const s = new Worker(new URL(
|
|
510
|
-
/* @vite-ignore */
|
|
511
|
-
"" + new URL("../assets/kitEngine.worker-9haDiVHZ.js", import.meta.url).href,
|
|
512
|
-
import.meta.url
|
|
513
|
-
), { type: "module" }), d = new ot(s, qt);
|
|
505
|
+
const s = new Worker(new URL("../assets/kitEngine.worker-3iMvwtlI.js", import.meta.url), { type: "module" }), d = new ot(s, qt);
|
|
514
506
|
s.onmessage = (c) => d.settle(c.data), s.onerror = (c) => d.fail(new Error(c.message || "the kit engine stopped"));
|
|
515
507
|
try {
|
|
516
508
|
return d.info = await d.call({ method: "create", manifest: t, name: n, width: r, height: i, lent: o, readOnly: a }), d;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @kition/
|
|
2
|
+
* @kition/sdk/editor: the editor shell's own styles (frame, tabs, tool rail, canvas, customize
|
|
3
3
|
* dialog). The shared components' styles and the theme tokens come from Kition Tessera, imported
|
|
4
4
|
* first; every color, radius, font, and shadow comes from the Kit UI protocol's theme tokens
|
|
5
5
|
* (Kition platform docs/platform/reference/ui-protocol.md, section 4), whose defaults are
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as fe } from "./envelope-GX4Cynkx.js";
|
|
2
2
|
import { R as re, r as we } from "./replica-Di2iCPiD.js";
|
|
3
|
-
import { b as ae, e as le, d as G, E as pe, R as me, l as ve, a as O, s as F, t as R, c as C, K as Q, L as ye, f as ee } from "./index-
|
|
3
|
+
import { b as ae, e as le, d as G, E as pe, R as me, l as ve, a as O, s as F, t as R, c as C, K as Q, L as ye, f as ee } from "./index-EEl8hGbP.js";
|
|
4
4
|
import { S as T, a as ge, l as be, D as Se } from "./client-B9xkOcvf.js";
|
|
5
5
|
import { LORO_REPLICA_VERSIONS as ke } from "./replicaVersions-C3rJxnk9.js";
|
|
6
6
|
import { commentSchema as Ee } from "./comments-uVDS8Wxp.js";
|
|
@@ -124,15 +124,15 @@ function B(t, e) {
|
|
|
124
124
|
}) : void 0
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
const
|
|
127
|
+
const d = (t) => typeof t == "object" && t !== null, h = (t) => typeof t == "function";
|
|
128
128
|
function M(t) {
|
|
129
|
-
return
|
|
129
|
+
return d(t) && typeof t.kitId == "string" && h(t.exportChanges) && h(t.importChanges) && h(t.command);
|
|
130
130
|
}
|
|
131
|
-
const m = (t) => t instanceof Uint8Array ? t : new Uint8Array(t), w = (t) => t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength), N = (t) =>
|
|
131
|
+
const m = (t) => t instanceof Uint8Array ? t : new Uint8Array(t), w = (t) => t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength), N = (t) => d(t) && d(t.kit) && Array.isArray(t.capabilities) && d(t.ai) && d(t.replica);
|
|
132
132
|
function D(t, e = {}) {
|
|
133
133
|
const s = t.capabilities.includes("model") ? t.model : void 0;
|
|
134
134
|
if (!t.capabilities.includes("replica") && !s)
|
|
135
|
-
throw new Error(`${t.kit.id} was opened without the replica capability: the host must offer replica (with @kition/embed, pass storage.replica or model: true)`);
|
|
135
|
+
throw new Error(`${t.kit.id} was opened without the replica capability: the host must offer replica (with @kition/sdk/embed, pass storage.replica or model: true)`);
|
|
136
136
|
const n = typeof t.onPresence == "function" ? t.onPresence.bind(t) : null;
|
|
137
137
|
return {
|
|
138
138
|
kitId: t.kit.id,
|
|
@@ -140,7 +140,7 @@ function D(t, e = {}) {
|
|
|
140
140
|
importChanges: async (r) => {
|
|
141
141
|
await t.replica.importChanges(w(r), new ArrayBuffer(0));
|
|
142
142
|
},
|
|
143
|
-
command: async (r, i) => (await t.ai.run([{ command: r, ...
|
|
143
|
+
command: async (r, i) => (await t.ai.run([{ command: r, ...d(i) ? { params: i } : {} }], !1)).completed[0]?.result ?? null,
|
|
144
144
|
commands: async () => await t.ai.commands(""),
|
|
145
145
|
readOnly: e.readOnly,
|
|
146
146
|
onChanged: (r) => t.replica.onChanged((i) => r(m(i))),
|
|
@@ -160,7 +160,7 @@ function D(t, e = {}) {
|
|
|
160
160
|
} : {}
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
const J = (t) =>
|
|
163
|
+
const J = (t) => d(t) && h(t.exportChanges) && h(t.importChanges) && h(t.execute) && h(t.commands), R = (t) => t === "" ? null : JSON.parse(t);
|
|
164
164
|
function $(t, e, s = {}) {
|
|
165
165
|
return {
|
|
166
166
|
events: s.events,
|
|
@@ -181,13 +181,13 @@ function $(t, e, s = {}) {
|
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
183
|
async function F(t, e) {
|
|
184
|
-
if (
|
|
184
|
+
if (d(t) && h(t.modelPort)) return await t.modelPort();
|
|
185
185
|
if (N(t)) return D(t);
|
|
186
186
|
if (J(t)) {
|
|
187
187
|
if (!e) throw new Error("an engine does not name its kit: pass options.kit");
|
|
188
188
|
return $(t, e);
|
|
189
189
|
}
|
|
190
|
-
throw new Error("openDocument takes a ModelPort, an @kition/embed editor, a KitConnection, or a kit engine");
|
|
190
|
+
throw new Error("openDocument takes a ModelPort, an @kition/sdk/embed editor, a KitConnection, or a kit engine");
|
|
191
191
|
}
|
|
192
192
|
function C(t) {
|
|
193
193
|
return {
|
|
@@ -251,7 +251,7 @@ class v {
|
|
|
251
251
|
};
|
|
252
252
|
/**
|
|
253
253
|
* Whether this document's source reports `event`: `changed` always; `saved`, `presence`,
|
|
254
|
-
* `conflict`, and `selection` when its host or kit does (an `@kition/embed` editor reports
|
|
254
|
+
* `conflict`, and `selection` when its host or kit does (an `@kition/sdk/embed` editor reports
|
|
255
255
|
* `saved` and `conflict`, and `presence` when it co-edits; a headless kit and a Node package
|
|
256
256
|
* document report `saved`).
|
|
257
257
|
*/
|
|
@@ -1668,7 +1668,7 @@ async function Bn(e, t, n = _n) {
|
|
|
1668
1668
|
C = { id: C.id, name: A.name };
|
|
1669
1669
|
}
|
|
1670
1670
|
if (t.identity?.permissions && (_ = le(_, (await t.identity.permissions(C.id))?.mode)), t.identity?.user && (T = await t.identity.user()), h.lend && ($ = Dn(await h.lend(C.id))), t.collaboration) {
|
|
1671
|
-
const { openCollabSession: A } = await import("./collab-
|
|
1671
|
+
const { openCollabSession: A } = await import("./collab-CTQZ9h7J.js"), L = await A({
|
|
1672
1672
|
kit: r,
|
|
1673
1673
|
file: C,
|
|
1674
1674
|
storage: h,
|
|
@@ -1813,7 +1813,7 @@ async function Bn(e, t, n = _n) {
|
|
|
1813
1813
|
},
|
|
1814
1814
|
commands: async () => await (await G()).ai.commands(""),
|
|
1815
1815
|
readOnly: () => _ !== "edit",
|
|
1816
|
-
// What the object model's documents hear from this editor (`@kition/script` `doc.on`).
|
|
1816
|
+
// What the object model's documents hear from this editor (`@kition/sdk/script` `doc.on`).
|
|
1817
1817
|
events: t.collaboration ? ["saved", "conflict", "presence"] : ["saved", "conflict"],
|
|
1818
1818
|
on: (R, K) => {
|
|
1819
1819
|
const X = K;
|
|
@@ -1830,7 +1830,7 @@ async function Bn(e, t, n = _n) {
|
|
|
1830
1830
|
document: async (p, A) => {
|
|
1831
1831
|
if (!p?.schema || p.id !== r.id) throw new Error(`document() takes ${r.id}'s typings, not ${p?.id ?? "none"}`);
|
|
1832
1832
|
await G();
|
|
1833
|
-
const { openDocument: L } = await import("./document-
|
|
1833
|
+
const { openDocument: L } = await import("./document-B5MMuYyN.js").then((R) => R.d);
|
|
1834
1834
|
return L(Ue.modelPort(), { schema: p.schema, ...A?.origin ? { origin: A.origin } : {} });
|
|
1835
1835
|
},
|
|
1836
1836
|
configure: (p) => {
|
package/dist/standalone/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as r, E as s, h as o, a as A, F as e, i as _, j as t, k as M, r as O } from "./chunks/index-
|
|
1
|
+
import { g as r, E as s, h as o, a as A, F as e, i as _, j as t, k as M, r as O } from "./chunks/index-EEl8hGbP.js";
|
|
2
2
|
export {
|
|
3
3
|
r as EMBED_CAPABILITY_SETS,
|
|
4
4
|
s as EMBED_VERSION,
|
|
@@ -2,8 +2,8 @@ import { s as g, a as u, H as b, S as E } from "../chunks/client-B9xkOcvf.js";
|
|
|
2
2
|
import { B as h, f as I, d as C } from "../chunks/batch-CAGYk6m4.js";
|
|
3
3
|
import { O as Y } from "../chunks/batch-CAGYk6m4.js";
|
|
4
4
|
import "../chunks/envelope-GX4Cynkx.js";
|
|
5
|
-
import { M as S } from "../chunks/document-
|
|
6
|
-
import { E as J, e as X, i as z, k as Q, o as V, a as Z, p as ee } from "../chunks/document-
|
|
5
|
+
import { M as S } from "../chunks/document-B5MMuYyN.js";
|
|
6
|
+
import { E as J, e as X, i as z, k as Q, o as V, a as Z, p as ee } from "../chunks/document-B5MMuYyN.js";
|
|
7
7
|
import { k as p } from "../chunks/kits-Cp51mDlw.js";
|
|
8
8
|
import { r as re } from "../chunks/kits-Cp51mDlw.js";
|
|
9
9
|
import { NotSyncedError as se, PropertyNotLoadedError as ne, RequestContext as ie } from "./proxy.js";
|
|
@@ -2,8 +2,8 @@ import { existsSync as S, readFileSync as g, readdirSync as q } from "node:fs";
|
|
|
2
2
|
import { relative as b, resolve as w, sep as P, dirname as D, join as k } from "node:path";
|
|
3
3
|
import { pathToFileURL as $ } from "node:url";
|
|
4
4
|
import "./kits/index.js";
|
|
5
|
-
import { M as T, o as C, p as O } from "../chunks/document-
|
|
6
|
-
import { E as oe, e as ce, i as ae, k as de, a as le } from "../chunks/document-
|
|
5
|
+
import { M as T, o as C, p as O } from "../chunks/document-B5MMuYyN.js";
|
|
6
|
+
import { E as oe, e as ce, i as ae, k as de, a as le } from "../chunks/document-B5MMuYyN.js";
|
|
7
7
|
import { spawn as j, execFile as L } from "node:child_process";
|
|
8
8
|
import { createInterface as N } from "node:readline";
|
|
9
9
|
import { s as A, B } from "../chunks/batch-CAGYk6m4.js";
|
|
@@ -134,7 +134,7 @@ class I {
|
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
136
|
* The object model over this document, served by the kit (`model.describe`, `model.batch`).
|
|
137
|
-
* The schema is the one registered for the kit (`@kition/script/kits/*`), else the kit's own
|
|
137
|
+
* The schema is the one registered for the kit (`@kition/sdk/script/kits/*`), else the kit's own
|
|
138
138
|
* (`model.describe`).
|
|
139
139
|
*/
|
|
140
140
|
async model(e = {}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* An adapter base for TypeScript engines made with `@kition/
|
|
2
|
+
* An adapter base for TypeScript engines made with `@kition/sdk/engine` (`kitEngineClass` over a
|
|
3
3
|
* `KitModel`): the replica members go through the contract 2 document class a host drives
|
|
4
4
|
* (`version`, `exportChanges`, `importChanges`, `snapshot`, `undo`, `redo`, `blobs`, `addBlobs`,
|
|
5
5
|
* `execute`), and a replica joins a snapshot as a new `KitSession` on its own actor. A kit adds
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@kition/convergence`: the convergence suite of the Kition kit platform (docs/platform/kits/levels.md) for
|
|
2
|
+
* `@kition/sdk/convergence`: the convergence suite of the Kition kit platform (docs/platform/kits/levels.md) for
|
|
3
3
|
* TypeScript engines, what a `ts-worker` kit runs to claim L6. The same 17 scenarios, pass and
|
|
4
4
|
* skip rules, and report as the Rust `kition-convergence` crate, driven through a `KitAdapter`;
|
|
5
|
-
* `KitEngineAdapter` does the replica part for engines made with `@kition/
|
|
5
|
+
* `KitEngineAdapter` does the replica part for engines made with `@kition/sdk/engine`.
|
|
6
6
|
*
|
|
7
7
|
* ```ts
|
|
8
8
|
* it('converges', () => {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* or discards it in the page (`editor.draft`); the agent can never merge (A14, UI-D1).
|
|
8
8
|
*
|
|
9
9
|
* The port is transport-neutral: `handle` answers one JSON-RPC 2.0 message. The page relays the
|
|
10
|
-
* messages between its server and the port (`relayAgentPort` pumps them; `@kition/script/node`'s
|
|
10
|
+
* messages between its server and the port (`relayAgentPort` pumps them; `@kition/sdk/script/node`'s
|
|
11
11
|
* `createAgentRelay` is the server's end), so the agent never reaches into the page by itself.
|
|
12
12
|
*/
|
|
13
13
|
import { type KitConnection } from '../../kit-host/src/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The public shapes of `@kition/embed` (`KitEmbed 1.3`, with EM25's opening and EM28): what an
|
|
2
|
+
* The public shapes of `@kition/sdk/embed` (`KitEmbed 1.3`, with EM25's opening and EM28): what an
|
|
3
3
|
* integrator passes to `KitionEmbed.mount`, the providers it implements, and the editor it gets
|
|
4
4
|
* back. Every member a later version added is optional, so a `KitEmbed 1.0` page works unchanged.
|
|
5
5
|
*/
|
|
@@ -21,9 +21,9 @@ export type EmbedKit = {
|
|
|
21
21
|
/** The UI entry inside the package; `index.html` by default. */
|
|
22
22
|
entry?: string;
|
|
23
23
|
/**
|
|
24
|
-
* The kit's KDM schema (`@kition/script/kits/<kit>`'s descriptor `schema`), for reviewing drafts
|
|
24
|
+
* The kit's KDM schema (`@kition/sdk/script/kits/<kit>`'s descriptor `schema`), for reviewing drafts
|
|
25
25
|
* and the agent's object-model calls when the kit's engine does not describe its own. When not
|
|
26
|
-
* given, the package's own `model/schema.json` is read, else `@kition/script`'s generated kit's
|
|
26
|
+
* given, the package's own `model/schema.json` is read, else `@kition/sdk/script`'s generated kit's
|
|
27
27
|
* (`KitEmbed 1.3`).
|
|
28
28
|
*/
|
|
29
29
|
schema?: object;
|
|
@@ -269,7 +269,7 @@ export type EmbedOptions = {
|
|
|
269
269
|
/** How long the kit may take to open the document; two minutes by default. */
|
|
270
270
|
timeoutMs?: number;
|
|
271
271
|
/**
|
|
272
|
-
* Lets the page edit the document through the object model (`@kition/script`'s
|
|
272
|
+
* Lets the page edit the document through the object model (`@kition/sdk/script`'s
|
|
273
273
|
* `openDocument(editor)`): the kit keeps a replica, in memory when `storage` has no `replica`
|
|
274
274
|
* store and the editor does not co-edit.
|
|
275
275
|
*/
|
|
@@ -467,7 +467,7 @@ export type EmbedNotice = {
|
|
|
467
467
|
message: string;
|
|
468
468
|
description?: string;
|
|
469
469
|
};
|
|
470
|
-
/** The `ModelPort` of `@kition/script`, given by an editor without depending on it. */
|
|
470
|
+
/** The `ModelPort` of `@kition/sdk/script`, given by an editor without depending on it. */
|
|
471
471
|
export type EmbedModelPort = {
|
|
472
472
|
readonly kitId: string;
|
|
473
473
|
exportChanges: (since: Uint8Array) => Promise<Uint8Array>;
|
|
@@ -476,7 +476,7 @@ export type EmbedModelPort = {
|
|
|
476
476
|
commands: () => Promise<EmbedCommand[]>;
|
|
477
477
|
readOnly: () => boolean;
|
|
478
478
|
onChanged: (listener: (version: Uint8Array | null) => void) => () => void;
|
|
479
|
-
/** The editor's events `@kition/script` reports on its documents: `saved`, `conflict`, and `presence` when it co-edits. */
|
|
479
|
+
/** The editor's events `@kition/sdk/script` reports on its documents: `saved`, `conflict`, and `presence` when it co-edits. */
|
|
480
480
|
events: ReadonlyArray<'saved' | 'presence' | 'conflict'>;
|
|
481
481
|
on: (event: 'saved' | 'presence' | 'conflict' | 'selection', listener: (value: never) => void) => () => void;
|
|
482
482
|
/**
|
|
@@ -509,7 +509,7 @@ export type EmbedCommand = {
|
|
|
509
509
|
enabled: boolean;
|
|
510
510
|
schema?: unknown;
|
|
511
511
|
};
|
|
512
|
-
/** A kit's object-model typings as `@kition/script/kits/<kit>` exports them (`noteKit`): its id and schema. */
|
|
512
|
+
/** A kit's object-model typings as `@kition/sdk/script/kits/<kit>` exports them (`noteKit`): its id and schema. */
|
|
513
513
|
export type EmbedKitTypings = {
|
|
514
514
|
id: string;
|
|
515
515
|
schema: object;
|
|
@@ -542,15 +542,15 @@ export type EmbedEditor = {
|
|
|
542
542
|
*/
|
|
543
543
|
replicaVersion: () => Promise<Uint8Array | null>;
|
|
544
544
|
/**
|
|
545
|
-
* The document as the object model reaches it (`@kition/script`: `openDocument(editor)` calls
|
|
545
|
+
* The document as the object model reaches it (`@kition/sdk/script`: `openDocument(editor)` calls
|
|
546
546
|
* this): its replica's changes and the kit's commands. Needs a replica (`model`, `storage.replica`,
|
|
547
547
|
* or collaboration).
|
|
548
548
|
*/
|
|
549
549
|
modelPort: () => EmbedModelPort;
|
|
550
550
|
/**
|
|
551
|
-
* The document as `@kition/script`'s object model (`KitEmbed 1.1`): `openDocument` over
|
|
551
|
+
* The document as `@kition/sdk/script`'s object model (`KitEmbed 1.1`): `openDocument` over
|
|
552
552
|
* `modelPort()` in one call, with the object model bundled in this package. `kit` is the kit's
|
|
553
|
-
* typings (`noteKit` of `@kition/script/kits/note`, whose root type is `Note`); they must be this
|
|
553
|
+
* typings (`noteKit` of `@kition/sdk/script/kits/note`, whose root type is `Note`); they must be this
|
|
554
554
|
* editor's kit's. Needs a replica, as `modelPort` does.
|
|
555
555
|
*/
|
|
556
556
|
document: <Root extends ModelObject = ModelObject, C extends CommandMap = CommandMap>(kit: EmbedKitTypings, options?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The editor page the service answers `GET /v1/open` with: `@kition/embed` mounting the kit for the
|
|
2
|
+
* The editor page the service answers `GET /v1/open` with: `@kition/sdk/embed` mounting the kit for the
|
|
3
3
|
* session's file, its storage provider the service's own `/v1/file` and `/v1/replica`, with the
|
|
4
4
|
* session as the bearer. Nothing in it is trusted by the service: every call is checked again.
|
|
5
5
|
*/
|
|
@@ -27,7 +27,7 @@ export type EmbedServerConfig = {
|
|
|
27
27
|
kits: KitRoute[];
|
|
28
28
|
/** Where kit packages are served: another origin than the service's (EM4). */
|
|
29
29
|
kitsUrl: string;
|
|
30
|
-
/** `@kition/embed`'s built module directory (its `dist`); default: the installed `@kition/embed`'s. */
|
|
30
|
+
/** `@kition/sdk/embed`'s built module directory (its `dist`); default: the installed `@kition/sdk/embed`'s. */
|
|
31
31
|
embedDir?: string;
|
|
32
32
|
/** A session's life, seconds (default 8 hours). */
|
|
33
33
|
sessionTtl?: number;
|
|
@@ -34,7 +34,7 @@ export type HostDocument = {
|
|
|
34
34
|
path?: string;
|
|
35
35
|
/** The document's object model port (`portFromConnection`, `portFromEngine`, …). */
|
|
36
36
|
port: ModelPort;
|
|
37
|
-
/** The kit's schema when the kit is not registered with `@kition/script` (`registerKit`). */
|
|
37
|
+
/** The kit's schema when the kit is not registered with `@kition/sdk/script` (`registerKit`). */
|
|
38
38
|
schema?: object;
|
|
39
39
|
};
|
|
40
40
|
export type ExtensionNotice = Notice & {
|
|
@@ -42,7 +42,7 @@ export type ExtensionNotice = Notice & {
|
|
|
42
42
|
};
|
|
43
43
|
export type ExtensionHostOptions = {
|
|
44
44
|
sandbox: SandboxFactory;
|
|
45
|
-
/** The kit's schema for documents that bring none; `@kition/script`'s registered kits otherwise. */
|
|
45
|
+
/** The kit's schema for documents that bring none; `@kition/sdk/script`'s registered kits otherwise. */
|
|
46
46
|
schema?: (kitId: string) => object | undefined;
|
|
47
47
|
/** `ctx.notify` of extensions, and the host's reports of their failures. */
|
|
48
48
|
notify?: (notice: ExtensionNotice) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@kition/extensions`: the extension host (`KitExtensions 1.0`). A host loads extensions
|
|
2
|
+
* `@kition/sdk/extensions`: the extension host (`KitExtensions 1.0`). A host loads extensions
|
|
3
3
|
* (`extension.json` + one ES module), runs each in a sandboxed worker on an opaque origin with only
|
|
4
|
-
* its declared network origins, and serves it the object model (`@kition/script`) of the documents it
|
|
5
|
-
* is active on, checked against its permissions. Extension authors: see `@kition/extensions/runtime`
|
|
4
|
+
* its declared network origins, and serves it the object model (`@kition/sdk/script`) of the documents it
|
|
5
|
+
* is active on, checked against its permissions. Extension authors: see `@kition/sdk/extensions/runtime`
|
|
6
6
|
* for `activate(ctx)`'s types.
|
|
7
7
|
*/
|
|
8
8
|
export { checkBatch, permissionDenied, requirePermission } from './gate.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `ctx.document` inside an extension's worker: `@kition/script`'s document API (`run`, `context`,
|
|
2
|
+
* `ctx.document` inside an extension's worker: `@kition/sdk/script`'s document API (`run`, `context`,
|
|
3
3
|
* proxies, `sync()`, `commands`, `changed`) over the host, which runs each batch on the document
|
|
4
4
|
* and checks it against the extension's permissions.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@kition/extensions/runtime`: the extension's side. `startRuntime` serves the host on a port
|
|
2
|
+
* `@kition/sdk/extensions/runtime`: the extension's side. `startRuntime` serves the host on a port
|
|
3
3
|
* (the sandbox worker runs it); `ExtensionContext` is what an extension's `activate(ctx)` gets.
|
|
4
4
|
* `WORKER_RUNTIME`, `SANDBOX_HTML`, and `PANEL_HTML` are the built worker, sandbox page, and panel
|
|
5
5
|
* page; `KitionPanel` is what a panel's scripts get as `window.kitionPanel`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The development host's in-memory folder as KitFiles storage (`@kition/
|
|
2
|
+
* The development host's in-memory folder as KitFiles storage (`@kition/sdk/host`'s
|
|
3
3
|
* `KitFilesStorage`): workspace-relative paths are its references, folders are the paths' prefixes
|
|
4
4
|
* (and any added empty), and a hidden segment (a leading dot) is never visible to the kit (LR2).
|
|
5
5
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The object model over a contract 2 engine's change exchange, run in the kit's engine worker
|
|
3
|
-
* (see `kitModel.ts`). Loaded on the first `model/*` request: it brings `@kition/kdm` and Loro.
|
|
3
|
+
* (see `kitModel.ts`). Loaded on the first `model/*` request: it brings `@kition/sdk/kdm` and Loro.
|
|
4
4
|
*
|
|
5
5
|
* It imports no value from the worker's other modules: a bundler puts those in the worker's
|
|
6
6
|
* entry chunk, and WebKit evaluates a module worker's entry script again when a chunk imports
|
|
@@ -63,7 +63,7 @@ export declare class ReplicaModel {
|
|
|
63
63
|
merge(changes: Uint8Array, origin: Origin, schema: object | null | undefined): StateDiff;
|
|
64
64
|
/**
|
|
65
65
|
* What changed in the document since the replica version `since` (C3b, as Kit Process Protocol's
|
|
66
|
-
* `model.changes`): the change set `@kition/kdm`'s `changesSince` answers, or no change set and
|
|
66
|
+
* `model.changes`): the change set `@kition/sdk/kdm`'s `changesSince` answers, or no change set and
|
|
67
67
|
* why when the replica's history does not hold `since` (never an empty one in its place).
|
|
68
68
|
*/
|
|
69
69
|
changesSince(since: Uint8Array, schema: object | null | undefined): {
|
|
@@ -30,7 +30,7 @@ export type KitCommand = {
|
|
|
30
30
|
/**
|
|
31
31
|
* How the engine is built (`engine.runtime` in kit.json, rule K11): `rust-wasm`, a wasm-pack
|
|
32
32
|
* module (`<module>.js` and `<module>_bg.wasm`), or `ts-worker`, an ES module `<module>.js` whose
|
|
33
|
-
* default export prepares it given `{ base }` (`@kition/
|
|
33
|
+
* default export prepares it given `{ base }` (`@kition/sdk/engine`'s `KitEngineInit`).
|
|
34
34
|
*/
|
|
35
35
|
export type KitModuleRuntime = 'rust-wasm' | 'ts-worker';
|
|
36
36
|
/** Where a kit's engine module lives: `<base>/<module>.js`, and `<module>_bg.wasm` for a Rust engine. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @kition/
|
|
2
|
+
* @kition/sdk/editor: build a kit's embedded editor (the Kition kit platform's kit editors, docs/platform/kits/ui.md). The host connection
|
|
3
3
|
* (`connectHost`) and document session (`useKitSession`), the engine client, canvas, and engine
|
|
4
|
-
* tools, and shared components styled with the host's theme. Import `@kition/
|
|
5
|
-
* once. The shared components come from Kition Tessera (`@kition/tessera
|
|
4
|
+
* tools, and shared components styled with the host's theme. Import `@kition/sdk/editor/styles.css`
|
|
5
|
+
* once. The shared components come from Kition Tessera (`@kition/tessera/ui`) and are re-exported
|
|
6
6
|
* here under the same names.
|
|
7
7
|
*/
|
|
8
8
|
export { connectHost, applyTheme, isMac, type HostConnection, type InitializeParams, type KitTheme } from './host.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The workspace frame tree, now in Kition Tessera. Kept as `@kition/
|
|
2
|
+
* The workspace frame tree, now in Kition Tessera. Kept as `@kition/sdk/editor/workspaceTree` for kits'
|
|
3
3
|
* plain-Node tests, which load the tree alone.
|
|
4
4
|
*/
|
|
5
5
|
export * from '@kition/tessera/ui/workspaceTree';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Engine contract 2 as TypeScript (Kition platform docs/platform/kits/engine.md, architecture 7.2): the document
|
|
3
3
|
* class a kit's engine worker drives. A WebAssembly engine made with `export_kit_document!` and
|
|
4
|
-
* `export_kit_session!` has exactly these members, so one worker (`@kition/
|
|
4
|
+
* `export_kit_session!` has exactly these members, so one worker (`@kition/sdk/editor`), the embed
|
|
5
5
|
* SDK, and the object model serve both runtimes.
|
|
6
6
|
*/
|
|
7
7
|
/** One historical coverage comparison from the kit's `covered` premise callback. */
|
|
@@ -110,7 +110,7 @@ export type KitFilesOptions = {
|
|
|
110
110
|
};
|
|
111
111
|
/** Every grant, for the host's session log. */
|
|
112
112
|
log?: (grant: KitFileGrant) => void;
|
|
113
|
-
/** Every `files/*` request the kit sends, before it is served (`@kition/
|
|
113
|
+
/** Every `files/*` request the kit sends, before it is served (`@kition/sdk/dev-host`'s `checkNoPaths`). */
|
|
114
114
|
trace?: (method: string, params: unknown) => void;
|
|
115
115
|
};
|
|
116
116
|
/** A `files/*` refusal: `-32000` with `error.data.reason` (KitFiles section 10). */
|
|
@@ -45,7 +45,7 @@ export type KitUiHostButton = {
|
|
|
45
45
|
place: string;
|
|
46
46
|
/** The label per locale; `en-US` is the fallback. */
|
|
47
47
|
label: Record<string, string>;
|
|
48
|
-
/** A `@kition/
|
|
48
|
+
/** A `@kition/sdk/editor` icon name, or a `data:image/…` URL. */
|
|
49
49
|
icon?: string;
|
|
50
50
|
/** As `Cmd+Enter`. */
|
|
51
51
|
shortcut?: string;
|
|
@@ -8,7 +8,7 @@ type BlobRef = {
|
|
|
8
8
|
mime: string;
|
|
9
9
|
size: number;
|
|
10
10
|
};
|
|
11
|
-
/** kit.board: registered with @kition/script when this module loads. */
|
|
11
|
+
/** kit.board: registered with @kition/sdk/script when this module loads. */
|
|
12
12
|
export declare const boardKit: KitDescriptor;
|
|
13
13
|
/** The fields a new `Board` takes (`list.add(fields)`). */
|
|
14
14
|
export type BoardFields = {
|
|
@@ -3,7 +3,7 @@ import { type KitDescriptor } from '../src/kits.js';
|
|
|
3
3
|
type Json = null | boolean | number | string | Json[] | {
|
|
4
4
|
[key: string]: Json;
|
|
5
5
|
};
|
|
6
|
-
/** kit.cad: registered with @kition/script when this module loads. */
|
|
6
|
+
/** kit.cad: registered with @kition/sdk/script when this module loads. */
|
|
7
7
|
export declare const cadKit: KitDescriptor;
|
|
8
8
|
/** The fields a new `Drawing` takes (`list.add(fields)`). */
|
|
9
9
|
export type DrawingFields = {
|
|
@@ -8,7 +8,7 @@ type BlobRef = {
|
|
|
8
8
|
mime: string;
|
|
9
9
|
size: number;
|
|
10
10
|
};
|
|
11
|
-
/** kit.design: registered with @kition/script when this module loads. */
|
|
11
|
+
/** kit.design: registered with @kition/sdk/script when this module loads. */
|
|
12
12
|
export declare const designKit: KitDescriptor;
|
|
13
13
|
/** The fields a new `Design` takes (`list.add(fields)`). */
|
|
14
14
|
export type DesignFields = {};
|
|
@@ -8,7 +8,7 @@ type BlobRef = {
|
|
|
8
8
|
mime: string;
|
|
9
9
|
size: number;
|
|
10
10
|
};
|
|
11
|
-
/** kit.doc: registered with @kition/script when this module loads. */
|
|
11
|
+
/** kit.doc: registered with @kition/sdk/script when this module loads. */
|
|
12
12
|
export declare const docKit: KitDescriptor;
|
|
13
13
|
/** The fields a new `Document` takes (`list.add(fields)`). */
|
|
14
14
|
export type DocumentFields = {
|
|
@@ -3,7 +3,7 @@ import { type KitDescriptor } from '../src/kits.js';
|
|
|
3
3
|
type Json = null | boolean | number | string | Json[] | {
|
|
4
4
|
[key: string]: Json;
|
|
5
5
|
};
|
|
6
|
-
/** kit.film: registered with @kition/script when this module loads. */
|
|
6
|
+
/** kit.film: registered with @kition/sdk/script when this module loads. */
|
|
7
7
|
export declare const filmKit: KitDescriptor;
|
|
8
8
|
/** The fields a new `SearchPremises` takes (`list.add(fields)`). */
|
|
9
9
|
export type SearchPremisesFields = {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CommandMap, ModelDocument, ModelObject, ModelText, RequestContext } from '../src/index.js';
|
|
2
2
|
import { type KitDescriptor } from '../src/kits.js';
|
|
3
|
-
/** kit.html: registered with @kition/script when this module loads. */
|
|
3
|
+
/** kit.html: registered with @kition/sdk/script when this module loads. */
|
|
4
4
|
export declare const htmlKit: KitDescriptor;
|
|
5
5
|
/** The fields a new `Page` takes (`list.add(fields)`). */
|
|
6
6
|
export type PageFields = {};
|
|
@@ -8,7 +8,7 @@ type BlobRef = {
|
|
|
8
8
|
mime: string;
|
|
9
9
|
size: number;
|
|
10
10
|
};
|
|
11
|
-
/** kit.layout: registered with @kition/script when this module loads. */
|
|
11
|
+
/** kit.layout: registered with @kition/sdk/script when this module loads. */
|
|
12
12
|
export declare const layoutKit: KitDescriptor;
|
|
13
13
|
/** The fields a new `Layout` takes (`list.add(fields)`). */
|
|
14
14
|
export type LayoutFields = {
|
|
@@ -3,7 +3,7 @@ import { type KitDescriptor } from '../src/kits.js';
|
|
|
3
3
|
type Json = null | boolean | number | string | Json[] | {
|
|
4
4
|
[key: string]: Json;
|
|
5
5
|
};
|
|
6
|
-
/** kit.motion: registered with @kition/script when this module loads. */
|
|
6
|
+
/** kit.motion: registered with @kition/sdk/script when this module loads. */
|
|
7
7
|
export declare const motionKit: KitDescriptor;
|
|
8
8
|
/** The fields a new `Project` takes (`list.add(fields)`). */
|
|
9
9
|
export type ProjectFields = {};
|
|
@@ -3,7 +3,7 @@ import { type KitDescriptor } from '../src/kits.js';
|
|
|
3
3
|
type Json = null | boolean | number | string | Json[] | {
|
|
4
4
|
[key: string]: Json;
|
|
5
5
|
};
|
|
6
|
-
/** kit.note: registered with @kition/script when this module loads. */
|
|
6
|
+
/** kit.note: registered with @kition/sdk/script when this module loads. */
|
|
7
7
|
export declare const noteKit: KitDescriptor;
|
|
8
8
|
/** The fields a new `Note` takes (`list.add(fields)`). */
|
|
9
9
|
export type NoteFields = {
|
|
@@ -8,7 +8,7 @@ type BlobRef = {
|
|
|
8
8
|
mime: string;
|
|
9
9
|
size: number;
|
|
10
10
|
};
|
|
11
|
-
/** kit.pdf: registered with @kition/script when this module loads. */
|
|
11
|
+
/** kit.pdf: registered with @kition/sdk/script when this module loads. */
|
|
12
12
|
export declare const pdfKit: KitDescriptor;
|
|
13
13
|
/** The fields a new `Pdf` takes (`list.add(fields)`). */
|
|
14
14
|
export type PdfFields = {
|
|
@@ -8,7 +8,7 @@ type BlobRef = {
|
|
|
8
8
|
mime: string;
|
|
9
9
|
size: number;
|
|
10
10
|
};
|
|
11
|
-
/** kit.photo: registered with @kition/script when this module loads. */
|
|
11
|
+
/** kit.photo: registered with @kition/sdk/script when this module loads. */
|
|
12
12
|
export declare const photoKit: KitDescriptor;
|
|
13
13
|
/** The fields a new `Image` takes (`list.add(fields)`). */
|
|
14
14
|
export type ImageFields = {
|
|
@@ -8,7 +8,7 @@ type BlobRef = {
|
|
|
8
8
|
mime: string;
|
|
9
9
|
size: number;
|
|
10
10
|
};
|
|
11
|
-
/** kit.scene: registered with @kition/script when this module loads. */
|
|
11
|
+
/** kit.scene: registered with @kition/sdk/script when this module loads. */
|
|
12
12
|
export declare const sceneKit: KitDescriptor;
|
|
13
13
|
/** The fields a new `Scene` takes (`list.add(fields)`). */
|
|
14
14
|
export type SceneFields = {
|
|
@@ -8,7 +8,7 @@ type BlobRef = {
|
|
|
8
8
|
mime: string;
|
|
9
9
|
size: number;
|
|
10
10
|
};
|
|
11
|
-
/** kit.sheet: registered with @kition/script when this module loads. */
|
|
11
|
+
/** kit.sheet: registered with @kition/sdk/script when this module loads. */
|
|
12
12
|
export declare const sheetKit: KitDescriptor;
|
|
13
13
|
/** The fields a new `Workbook` takes (`list.add(fields)`). */
|
|
14
14
|
export type WorkbookFields = {
|
|
@@ -8,7 +8,7 @@ type BlobRef = {
|
|
|
8
8
|
mime: string;
|
|
9
9
|
size: number;
|
|
10
10
|
};
|
|
11
|
-
/** kit.slide: registered with @kition/script when this module loads. */
|
|
11
|
+
/** kit.slide: registered with @kition/sdk/script when this module loads. */
|
|
12
12
|
export declare const slideKit: KitDescriptor;
|
|
13
13
|
/** The fields a new `SlideFile` takes (`list.add(fields)`). */
|
|
14
14
|
export type SlideFileFields = {
|