@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.
Files changed (61) hide show
  1. package/README.md +4 -0
  2. package/dist/lib/assets/kitEngine.worker-3iMvwtlI.js +12732 -0
  3. package/dist/lib/assets/loro_wasm_bg-Gulzks_0.wasm +0 -0
  4. package/dist/lib/embed-server/index.js +1 -1
  5. package/dist/lib/kit-dev-host/checkUiIds.mjs +1 -1
  6. package/dist/lib/kit-dev-host/modeSmoke.mjs +1 -1
  7. package/dist/lib/kit-editor/index.js +2 -10
  8. package/dist/lib/kit-editor/styles.css +1 -1
  9. package/dist/standalone/chunks/{collab-B5TbpTyO.js → collab-CTQZ9h7J.js} +1 -1
  10. package/dist/standalone/chunks/{document-CuIGSDsY.js → document-B5MMuYyN.js} +9 -9
  11. package/dist/standalone/chunks/{index-Blc_B6iX.js → index-EEl8hGbP.js} +3 -3
  12. package/dist/standalone/index.js +1 -1
  13. package/dist/standalone/script/index.js +2 -2
  14. package/dist/standalone/script/node.js +3 -3
  15. package/dist/types/convergence/src/engine.d.ts +1 -1
  16. package/dist/types/convergence/src/index.d.ts +2 -2
  17. package/dist/types/embed/src/agent.d.ts +1 -1
  18. package/dist/types/embed/src/types.d.ts +10 -10
  19. package/dist/types/embed-server/src/page.d.ts +1 -1
  20. package/dist/types/embed-server/src/server.d.ts +1 -1
  21. package/dist/types/extensions/src/host.d.ts +2 -2
  22. package/dist/types/extensions/src/index.d.ts +3 -3
  23. package/dist/types/extensions/src/runtime/document.d.ts +1 -1
  24. package/dist/types/extensions/src/runtime/index.d.ts +1 -1
  25. package/dist/types/kit-dev-host/src/memoryFiles.d.ts +1 -1
  26. package/dist/types/kit-editor/src/engine/kitModelRunner.d.ts +2 -2
  27. package/dist/types/kit-editor/src/engine/kitModule.d.ts +1 -1
  28. package/dist/types/kit-editor/src/index.d.ts +3 -3
  29. package/dist/types/kit-editor/src/workspaceTree.d.ts +1 -1
  30. package/dist/types/kit-engine/src/contract.d.ts +1 -1
  31. package/dist/types/kit-host/src/files.d.ts +1 -1
  32. package/dist/types/kit-ui-protocol/src/index.d.ts +1 -1
  33. package/dist/types/script/kits/board.d.ts +1 -1
  34. package/dist/types/script/kits/cad.d.ts +1 -1
  35. package/dist/types/script/kits/design.d.ts +1 -1
  36. package/dist/types/script/kits/doc.d.ts +1 -1
  37. package/dist/types/script/kits/film.d.ts +1 -1
  38. package/dist/types/script/kits/html.d.ts +1 -1
  39. package/dist/types/script/kits/layout.d.ts +1 -1
  40. package/dist/types/script/kits/motion.d.ts +1 -1
  41. package/dist/types/script/kits/note.d.ts +1 -1
  42. package/dist/types/script/kits/pdf.d.ts +1 -1
  43. package/dist/types/script/kits/photo.d.ts +1 -1
  44. package/dist/types/script/kits/scene.d.ts +1 -1
  45. package/dist/types/script/kits/sheet.d.ts +1 -1
  46. package/dist/types/script/kits/slide.d.ts +1 -1
  47. package/dist/types/script/kits/table.d.ts +1 -1
  48. package/dist/types/script/kits/vector.d.ts +1 -1
  49. package/dist/types/script/src/agentRelay.d.ts +1 -1
  50. package/dist/types/script/src/document.d.ts +4 -4
  51. package/dist/types/script/src/headless.d.ts +1 -1
  52. package/dist/types/script/src/index.d.ts +2 -2
  53. package/dist/types/script/src/kits.d.ts +1 -1
  54. package/dist/types/script/src/node.d.ts +1 -1
  55. package/dist/types/script/src/port.d.ts +1 -1
  56. package/dist/types/script/src/room.d.ts +1 -1
  57. package/dist/types/script/src/sources.d.ts +2 -2
  58. package/dist/types/sync/src/index.d.ts +2 -2
  59. package/dist/types/sync/src/relay.d.ts +1 -1
  60. package/package.json +1 -1
  61. package/dist/lib/assets/kitEngine.worker-9haDiVHZ.js +0 -13220
@@ -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.table: registered with @kition/script when this module loads. */
6
+ /** kit.table: registered with @kition/sdk/script when this module loads. */
7
7
  export declare const tableKit: KitDescriptor;
8
8
  /** The fields a new `Base` takes (`list.add(fields)`). */
9
9
  export type BaseFields = {
@@ -8,7 +8,7 @@ type BlobRef = {
8
8
  mime: string;
9
9
  size: number;
10
10
  };
11
- /** kit.vector: registered with @kition/script when this module loads. */
11
+ /** kit.vector: registered with @kition/sdk/script when this module loads. */
12
12
  export declare const vectorKit: KitDescriptor;
13
13
  /** The fields a new `Drawing` takes (`list.add(fields)`). */
14
14
  export type DrawingFields = {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The server's end of an agent relay to an editor open in a person's page (`@kition/embed`
2
+ * The server's end of an agent relay to an editor open in a person's page (`@kition/sdk/embed`
3
3
  * `editor.agentPort`, `KitEmbed 1.3`). The integrator's agent sends MCP messages (`request`); the
4
4
  * page takes them (`next`, for example over HTTP long polling or a WebSocket) into its editor's
5
5
  * agent port (`relayAgentPort`) and sends the replies back (`reply`). The relay renumbers requests,
@@ -18,7 +18,7 @@ export type OpenOptions = {
18
18
  /**
19
19
  * What answers a document's `model/describe` and `model/batch`: an `Exchange` over a `ModelPort`
20
20
  * (the object model on the host's side), or a kit that serves the object model itself (a
21
- * headless kit executable over the Kit Process Protocol, `@kition/script/node`'s `launchHeadlessKit`).
21
+ * headless kit executable over the Kit Process Protocol, `@kition/sdk/script/node`'s `launchHeadlessKit`).
22
22
  */
23
23
  export interface ModelBackend extends DocumentEventSource {
24
24
  readonly kitId: string;
@@ -65,7 +65,7 @@ export declare class ModelDocument<Root extends ModelObject = ModelObject, C ext
65
65
  };
66
66
  /**
67
67
  * Whether this document's source reports `event`: `changed` always; `saved`, `presence`,
68
- * `conflict`, and `selection` when its host or kit does (an `@kition/embed` editor reports
68
+ * `conflict`, and `selection` when its host or kit does (an `@kition/sdk/embed` editor reports
69
69
  * `saved` and `conflict`, and `presence` when it co-edits; a headless kit and a Node package
70
70
  * document report `saved`).
71
71
  */
@@ -79,8 +79,8 @@ export declare class ModelDocument<Root extends ModelObject = ModelObject, C ext
79
79
  private emit;
80
80
  }
81
81
  /**
82
- * Opens a document for scripting. `source` is a `ModelPort`, an `@kition/embed` editor, a
83
- * `KitConnection` (`@kition/kit-host`) whose kit has the `replica` or `model` capability, or a kit
82
+ * Opens a document for scripting. `source` is a `ModelPort`, an `@kition/sdk/embed` editor, a
83
+ * `KitConnection` (`@kition/sdk/host`) whose kit has the `replica` or `model` capability, or a kit
84
84
  * engine (`options.kit` names its kit). A kit that answers the object model itself (`port.model`)
85
85
  * runs each batch as one undo step of the person's history; otherwise the batch runs here.
86
86
  */
@@ -146,7 +146,7 @@ export declare class HeadlessDocument {
146
146
  refresh(): Promise<HeadlessDocumentState>;
147
147
  /**
148
148
  * The object model over this document, served by the kit (`model.describe`, `model.batch`).
149
- * The schema is the one registered for the kit (`@kition/script/kits/*`), else the kit's own
149
+ * The schema is the one registered for the kit (`@kition/sdk/script/kits/*`), else the kit's own
150
150
  * (`model.describe`).
151
151
  */
152
152
  model<Root extends ModelObject = ModelObject, C extends CommandMap = CommandMap>(options?: OpenOptions): Promise<ModelDocument<Root, C>>;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * `@kition/script`: the Kition object model (`KitObjectModel 1.0`). Open a document from an
3
- * `@kition/embed` editor, a `KitConnection`, or a kit engine; queue reads and writes on typed
2
+ * `@kition/sdk/script`: the Kition object model (`KitObjectModel 1.0`). Open a document from an
3
+ * `@kition/sdk/embed` editor, a `KitConnection`, or a kit engine; queue reads and writes on typed
4
4
  * proxies; `sync()` sends them as one batch. `openRoom` opens a document in a sync server's room.
5
5
  */
6
6
  export { advertiseCapabilitySets, CAPABILITY_SETS, capabilitySets, supports } from './capabilities.js';
@@ -3,6 +3,6 @@ export type KitDescriptor = {
3
3
  id: string;
4
4
  schema: object;
5
5
  };
6
- /** Makes a kit's schema known to `openDocument` (generated descriptors in `@kition/script/kits/*`). */
6
+ /** Makes a kit's schema known to `openDocument` (generated descriptors in `@kition/sdk/script/kits/*`). */
7
7
  export declare function registerKit(kit: KitDescriptor): KitDescriptor;
8
8
  export declare const kitDescriptor: (id: string) => KitDescriptor | undefined;
@@ -33,7 +33,7 @@ export type KitPackage = {
33
33
  /**
34
34
  * Loads the engine of the kit package in `dir` (the folder holding `kit-ui.json` and `engine/`).
35
35
  * A package that ships its KDM schema (`model/schema.json`) opens its documents with it, since it is
36
- * the schema its engine was built with; otherwise the bundled kit's (`@kition/script/kits`) is used.
36
+ * the schema its engine was built with; otherwise the bundled kit's (`@kition/sdk/script/kits`) is used.
37
37
  */
38
38
  export declare function openKitPackage(dir: string): Promise<KitPackage>;
39
39
  export { HeadlessDocument, KITS_SERVICE_VERSION, KitProtocolConnection, KitProtocolError, KitsService, openHeadless, type HeadlessDocumentState, type HeadlessOpenOptions, type KitStatus, type LaunchOptions, type OpenedHeadless, type OpenHeadlessOptions, } from './headless.js';
@@ -49,7 +49,7 @@ export interface DocumentEventSource {
49
49
  /**
50
50
  * A contract 2 document as the object model reaches it: the engine's change exchange and its
51
51
  * commands. Every kit editor (`KitConnection` with the `replica` capability), every kit engine
52
- * (`exportChanges`, `importChanges`, `executeAs`), and an `@kition/embed` editor give one.
52
+ * (`exportChanges`, `importChanges`, `executeAs`), and an `@kition/sdk/embed` editor give one.
53
53
  */
54
54
  export interface ModelPort extends DocumentEventSource {
55
55
  readonly kitId: string;
@@ -36,7 +36,7 @@ export type RoomOptions = {
36
36
  shareLink?: string;
37
37
  /** The room's kit id; required with `docId`, checked against the room's with `shareLink`. */
38
38
  kit?: string;
39
- /** The kit's schema; by default the one registered for the kit's id (`registerKit`, `@kition/script/kits`). */
39
+ /** The kit's schema; by default the one registered for the kit's id (`registerKit`, `@kition/sdk/script/kits`). */
40
40
  schema?: Schema | object;
41
41
  /** The origin every batch carries; `extension`/`script` by default. */
42
42
  origin?: Origin;
@@ -1,6 +1,6 @@
1
1
  import type { DocumentEventSource, ModelPort } from './port.js';
2
2
  export declare function isModelPort(value: unknown): value is ModelPort;
3
- /** The parts of a `KitConnection` (`@kition/kit-host`) the object model uses. */
3
+ /** The parts of a `KitConnection` (`@kition/sdk/host`) the object model uses. */
4
4
  export type ConnectionLike = {
5
5
  kit: {
6
6
  id: string;
@@ -69,5 +69,5 @@ export declare function portFromEngine(engine: EngineLike, kitId: string, option
69
69
  readOnly?: () => boolean;
70
70
  onChanged?: ModelPort['onChanged'];
71
71
  } & DocumentEventSource): ModelPort;
72
- /** An editor of `@kition/embed` (it gives its own port), a `KitConnection`, or an engine. */
72
+ /** An editor of `@kition/sdk/embed` (it gives its own port), a `KitConnection`, or an engine. */
73
73
  export declare function portFromSource(source: unknown, kit?: string): Promise<ModelPort>;
@@ -1,10 +1,10 @@
1
1
  /**
2
- * `@kition/sync`: the client for the open sync protocol `kition-sync/1` (Kition platform docs/platform/reference/sync-protocol.md).
2
+ * `@kition/sdk/sync`: the client for the open sync protocol `kition-sync/1` (Kition platform docs/platform/reference/sync-protocol.md).
3
3
  * `SyncClient` connects over an injectable `SyncTransport`, reconnects with backoff, re-joins
4
4
  * every joined room with the caller's latest local version, and queues pushes made while
5
5
  * offline, flushing them in order once reconnected. `startRelay` relays one document's KDM replica
6
6
  * to and from its room through it. `LORO_REPLICA_VERSIONS`, the version handling the relay needs,
7
- * is in `@kition/sync/replicaVersions`, loaded on demand, since it loads the CRDT engine.
7
+ * is in `@kition/sdk/sync/replicaVersions`, loaded on demand, since it loads the CRDT engine.
8
8
  */
9
9
  export { capabilitySetsOf, parseCapabilitySet, servesCapabilitySet } from './capabilities.js';
10
10
  export { blobHashCandidates, decodeBlobSection, encodeBlobSection, type BlobEntry } from './blobSection.js';
@@ -2,7 +2,7 @@ import type { SyncClient } from './client.js';
2
2
  import type { Presence, RoomJoinResult } from './protocol.js';
3
3
  import type { ReplicaVersions } from './replicaVersions.js';
4
4
  import type { ConnectionState } from './transport.js';
5
- /** The replica side: a mounted kit's `KitConnection.replica` (`@kition/kit-host`), or a host editor's. */
5
+ /** The replica side: a mounted kit's `KitConnection.replica` (`@kition/sdk/host`), or a host editor's. */
6
6
  export type RelayReplica = {
7
7
  version: () => Promise<ArrayBuffer>;
8
8
  exportChanges: (since: ArrayBuffer) => Promise<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitionstage/sdk",
3
- "version": "0.5.2-stage.1",
3
+ "version": "0.5.2-stage.2",
4
4
  "description": "The Kition SDK's TypeScript libraries in one package: embed editors, script documents, KDM, sync, kit editor and host, each a subpath (@kition/sdk/embed, @kition/sdk/script, ...).",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",