@jarenjs/studio 0.83.3 → 0.85.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.
Files changed (90) hide show
  1. package/README.md +21 -6
  2. package/contracts/data.contract.json +243 -0
  3. package/dist/types/component/data/actions.d.ts +234 -0
  4. package/dist/types/component/data/index.d.ts +9 -0
  5. package/dist/types/component/data/mount.d.ts +87 -0
  6. package/dist/types/component/data/project-widget.d.ts +27 -0
  7. package/dist/types/component/data/viewmodel.d.ts +85 -0
  8. package/dist/types/component/data/views.d.ts +148 -0
  9. package/dist/types/component/document.d.ts +82 -0
  10. package/dist/types/component/flow/actions.d.ts +708 -0
  11. package/dist/types/component/flow/index.d.ts +7 -0
  12. package/dist/types/component/flow/mount.d.ts +66 -0
  13. package/dist/types/component/flow/project-widget.d.ts +8 -0
  14. package/dist/types/component/flow/runtime.d.ts +57 -0
  15. package/dist/types/component/flow/views.d.ts +242 -0
  16. package/dist/types/component/host.d.ts +2 -2
  17. package/dist/types/component/index.d.ts +21 -15
  18. package/dist/types/component/mount.d.ts +51 -0
  19. package/dist/types/component/project-actions.d.ts +302 -0
  20. package/dist/types/component/project-controller.d.ts +81 -0
  21. package/dist/types/component/project-state.d.ts +1 -0
  22. package/dist/types/component/project.d.ts +327 -0
  23. package/dist/types/component/shared/host-widget.d.ts +24 -0
  24. package/dist/types/component/shared/memo.d.ts +12 -0
  25. package/dist/types/component/shared/nodes.d.ts +92 -0
  26. package/dist/types/component/shared/schema-options.d.ts +28 -0
  27. package/dist/types/component/shared/studio-kit.d.ts +78 -0
  28. package/dist/types/component/shared/ui.d.ts +136 -0
  29. package/dist/types/component/view.d.ts +6 -6
  30. package/dist/types/data/boot-stages.d.ts +97 -0
  31. package/dist/types/data/browser-worker.d.ts +22 -0
  32. package/dist/types/data/contract.d.ts +9 -0
  33. package/dist/types/data/editor.d.ts +81 -0
  34. package/dist/types/data/handlers.d.ts +130 -0
  35. package/dist/types/data/host.d.ts +8 -0
  36. package/dist/types/data/project-worker.d.ts +8 -0
  37. package/dist/types/data/runtime.d.ts +46 -0
  38. package/dist/types/data/state.d.ts +33 -0
  39. package/dist/types/data/storage.d.ts +26 -0
  40. package/dist/types/data/transport.d.ts +69 -0
  41. package/dist/types/flow-document.d.ts +19 -0
  42. package/dist/types/flow-editor.d.ts +88 -0
  43. package/docs/EDITORS.md +158 -0
  44. package/docs/PROJECT-FORMAT.md +1 -11
  45. package/package.json +32 -15
  46. package/src/component/data/actions.js +138 -0
  47. package/src/component/data/index.js +10 -0
  48. package/src/component/data/mount.js +63 -0
  49. package/src/component/data/project-widget.js +164 -0
  50. package/src/component/data/viewmodel.js +185 -0
  51. package/src/component/data/views.js +241 -0
  52. package/src/component/document.js +344 -0
  53. package/src/component/flow/actions.js +331 -0
  54. package/src/component/flow/index.js +8 -0
  55. package/src/component/flow/mount.js +53 -0
  56. package/src/component/flow/project-widget.js +44 -0
  57. package/src/component/flow/runtime.js +481 -0
  58. package/src/component/flow/views.js +196 -0
  59. package/src/component/host.js +2 -2
  60. package/src/component/index.js +19 -9
  61. package/src/component/mount.js +43 -0
  62. package/src/component/project-actions.js +189 -0
  63. package/src/component/project-controller.js +248 -0
  64. package/src/component/project-state.js +30 -0
  65. package/src/component/project.js +308 -0
  66. package/src/component/shared/host-widget.js +35 -0
  67. package/src/component/shared/memo.js +28 -0
  68. package/src/component/shared/nodes.js +94 -0
  69. package/src/component/shared/schema-options.js +30 -0
  70. package/src/component/shared/studio-kit.js +59 -0
  71. package/src/component/shared/ui.js +134 -0
  72. package/src/data/boot-stages.js +202 -0
  73. package/src/data/browser-worker.js +247 -0
  74. package/src/data/contract.js +7 -0
  75. package/src/data/editor.js +95 -0
  76. package/src/data/handlers.js +349 -0
  77. package/src/data/host.js +8 -0
  78. package/src/data/project-worker.js +26 -0
  79. package/src/data/runtime.js +462 -0
  80. package/src/data/state.js +46 -0
  81. package/src/data/storage.js +61 -0
  82. package/src/data/transport.js +215 -0
  83. package/src/flow-document.js +24 -0
  84. package/src/flow-editor.js +98 -0
  85. package/styles/data.css +53 -0
  86. package/styles/editor.css +150 -0
  87. package/styles/flow.css +99 -0
  88. package/styles/studio.css +1 -0
  89. package/dist/types/author.d.ts +0 -27
  90. package/src/author.js +0 -55
package/README.md CHANGED
@@ -31,6 +31,19 @@ This package ships in two layers, the suite's convention:
31
31
  with query plans and live results. All ten file kinds can be created,
32
32
  renamed, deleted and opened from templates.
33
33
 
34
+ ## Complete reusable editors
35
+
36
+ `mountStudioEditor`, `mountFlowEditor` and `mountDataEditor` provide the same
37
+ project, Flow and Data interfaces used by the website. Each exposes document
38
+ reads, validation, revision-checked replacement/patching, execution, change
39
+ subscriptions and disposal. Hosts supply rendering, templates, task execution
40
+ and storage through explicit services.
41
+
42
+ Use `/component`, `/flow`, `/data` and `/data/host`, with their exported styles
43
+ and operation contract. The [host guide](docs/EDITORS.md) describes the complete
44
+ API, worker initialization, storage identity and lifecycle. A packed independent
45
+ host exercises all three editors without importing website source.
46
+
34
47
  ## The project document
35
48
 
36
49
  A thin envelope over typed files — the full contract is
@@ -63,11 +76,7 @@ tracks dependencies and writes diagram edits back into their source files.
63
76
  Explicit `input`, `model` and `collection` metadata route queries and model
64
77
  seeds; the [format](docs/PROJECT-FORMAT.md) specifies ownership and lifetimes.
65
78
 
66
- `@jarenjs/studio/author` exposes `createStudioFileAuthor({ client })`: generate
67
- one file under its authoring profile, validate with the full engine, and repair
68
- bounded failures before returning a candidate. The website assistant uses this
69
- path and protects edits made while generation is running. No provider quality
70
- claim is inferred from the mocked generation tests.
79
+ Hosts can propose validated candidates through the shared editor controllers. Model-assisted authoring is provided by [Tangle’s Jaren integration](https://github.com/jklarenbeek/tangleai/blob/main/packages/jaren/README.md).
71
80
 
72
81
  `@jarenjs/studio/export` exposes `exportProject(project, assets)` and
73
82
  `createProjectZip(files)`. The website's **Offline ZIP** includes a standalone
@@ -100,8 +109,14 @@ Every subpath a consumer can import, derived from the manifest by
100
109
  | `@jarenjs/studio/schemas/jaren-project.schema.json` | schema | — |
101
110
  | `@jarenjs/studio/styles/studio.css` | asset | — |
102
111
  | `@jarenjs/studio/package.json` | metadata | — |
103
- | `@jarenjs/studio/author` | JavaScript | declared |
104
112
  | `@jarenjs/studio/export` | JavaScript | declared |
113
+ | `@jarenjs/studio/flow` | JavaScript | declared |
114
+ | `@jarenjs/studio/styles/flow.css` | asset | — |
115
+ | `@jarenjs/studio/styles/editor.css` | asset | — |
116
+ | `@jarenjs/studio/data` | JavaScript | declared |
117
+ | `@jarenjs/studio/data/host` | JavaScript | declared |
118
+ | `@jarenjs/studio/contracts/data.contract.json` | asset | — |
119
+ | `@jarenjs/studio/styles/data.css` | asset | — |
105
120
  <!--/fact-->
106
121
 
107
122
  ## Install
@@ -0,0 +1,243 @@
1
+ {
2
+ "$contract": "0.1",
3
+ "id": "jaren-data-studio",
4
+ "version": "1",
5
+ "$defs": {
6
+ "DbError": {
7
+ "type": "object",
8
+ "required": ["code", "message"],
9
+ "properties": {
10
+ "code": {
11
+ "description": "The store or host code as a string (including numeric DOMException codes), null for an uncoded fault.",
12
+ "type": ["string", "null"]
13
+ },
14
+ "message": { "type": "string" }
15
+ }
16
+ },
17
+ "Collection": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ }
21
+ },
22
+ "operations": {
23
+ "data.init": {
24
+ "kind": "command",
25
+ "output": {
26
+ "type": "object",
27
+ "required": ["topology", "vfs", "version"],
28
+ "properties": {
29
+ "topology": { "enum": ["owner", "client", "memory"] },
30
+ "vfs": { "type": "string" },
31
+ "version": { "type": "string" },
32
+ "refusal": { "$ref": "#/$defs/DbError" },
33
+ "durable": { "type": "boolean" },
34
+ "failures": { "type": "array", "items": { "type": "object", "required": ["vfs", "reason"], "properties": { "vfs": { "type": "string" }, "reason": { "type": "string" } } } }
35
+ }
36
+ },
37
+ "errors": { "db": { "schema": { "$ref": "#/$defs/DbError" } } },
38
+ "doc": "Load the SQLite wasm build and decide the topology: owner (holds the selected durable storage), client (another context owns it — talk over the channel), or visibly non-durable memory. Probe order: isolated SharedArrayBuffer OPFS, SAH-pool OPFS, atomic IndexedDB snapshots, memory. failures names each rejected rung; refusal carries the visible downgrade."
39
+ },
40
+ "data.open": {
41
+ "kind": "command",
42
+ "input": {
43
+ "type": "object",
44
+ "required": ["model"],
45
+ "properties": {
46
+ "model": { "type": "object" },
47
+ "reset": { "type": "boolean" }
48
+ }
49
+ },
50
+ "output": {
51
+ "type": "object",
52
+ "required": ["vfs", "capabilities"],
53
+ "properties": {
54
+ "vfs": { "type": "string" },
55
+ "capabilities": { "type": "object" },
56
+ "model": { "type": "object" },
57
+ "collection": { "$ref": "#/$defs/Collection" },
58
+ "keyPointer": { "type": "string" }
59
+ }
60
+ },
61
+ "errors": { "db": { "schema": { "$ref": "#/$defs/DbError" } } },
62
+ "doc": "Open (or recreate, with reset) the store from a jaren-model document. Return its active model, collection, key pointer and capabilities. On the client channel, a non-reset open only attaches to the existing store and ignores the supplied model; reset is refused with the db failure."
63
+ },
64
+ "data.insert": {
65
+ "kind": "command",
66
+ "input": {
67
+ "type": "object",
68
+ "required": ["collection", "doc"],
69
+ "properties": {
70
+ "collection": { "$ref": "#/$defs/Collection" },
71
+ "doc": { "type": "object" }
72
+ }
73
+ },
74
+ "output": true,
75
+ "errors": { "db": { "schema": { "$ref": "#/$defs/DbError" } } },
76
+ "doc": "Insert one document. The output is the store's own insert result — the driver decides its shape, so it is deliberately open."
77
+ },
78
+ "data.delete": {
79
+ "kind": "command",
80
+ "input": {
81
+ "type": "object",
82
+ "required": ["collection", "key"],
83
+ "properties": {
84
+ "collection": { "$ref": "#/$defs/Collection" },
85
+ "key": true
86
+ }
87
+ },
88
+ "output": true,
89
+ "errors": { "db": { "schema": { "$ref": "#/$defs/DbError" } } },
90
+ "doc": "Delete by key. Keys may be strings, numbers or the model's own key shape, so the member is deliberately open, like the output."
91
+ },
92
+ "data.rows": {
93
+ "kind": "read",
94
+ "input": {
95
+ "type": "object",
96
+ "required": ["collection"],
97
+ "properties": {
98
+ "collection": { "$ref": "#/$defs/Collection" }
99
+ }
100
+ },
101
+ "output": { "type": "array" },
102
+ "errors": { "db": { "schema": { "$ref": "#/$defs/DbError" } } },
103
+ "doc": "Every document of the collection, as the canonical scan query returns them."
104
+ },
105
+ "data.execute": {
106
+ "kind": "read",
107
+ "input": {
108
+ "type": "object",
109
+ "required": ["collection", "document"],
110
+ "properties": {
111
+ "collection": { "$ref": "#/$defs/Collection" },
112
+ "document": true,
113
+ "externals": { "type": "object" }
114
+ }
115
+ },
116
+ "output": true,
117
+ "errors": { "db": { "schema": { "$ref": "#/$defs/DbError" } } },
118
+ "doc": "Run a query document. The query decides the output shape — an array pack answers rows, a bare FLWOR a sequence, an aggregate a scalar — so the output is deliberately open."
119
+ },
120
+ "data.explain": {
121
+ "kind": "read",
122
+ "input": {
123
+ "type": "object",
124
+ "required": ["collection", "document"],
125
+ "properties": {
126
+ "collection": { "$ref": "#/$defs/Collection" },
127
+ "document": true,
128
+ "externals": { "type": "object" }
129
+ }
130
+ },
131
+ "output": {
132
+ "type": "object",
133
+ "properties": {
134
+ "sql": { "type": "string" },
135
+ "params": { "type": "array" },
136
+ "indexes": { "type": "array" },
137
+ "residual": { "type": ["object", "null"] }
138
+ }
139
+ },
140
+ "errors": { "db": { "schema": { "$ref": "#/$defs/DbError" } } },
141
+ "doc": "The store's explain record for a query document: the SQL pushed down, its parameters, the indexes chosen and the residual (null when fully pushed)."
142
+ },
143
+ "data.oracle": {
144
+ "kind": "read",
145
+ "input": {
146
+ "type": "object",
147
+ "required": ["model", "collection", "documents", "query"],
148
+ "properties": {
149
+ "model": { "type": "object" },
150
+ "collection": { "$ref": "#/$defs/Collection" },
151
+ "documents": { "type": "array", "items": { "type": "object" } },
152
+ "query": true,
153
+ "externals": { "type": "object" },
154
+ "explain": {
155
+ "description": "Also answer the store's explain record for the query — the SQL pushed down, the pre-filters and the database's own scan narrative — so a reader can see the plan the throwaway store ran, not only its answer.",
156
+ "type": "boolean"
157
+ }
158
+ }
159
+ },
160
+ "output": {
161
+ "type": "object",
162
+ "required": ["answer", "empty"],
163
+ "properties": {
164
+ "answer": true,
165
+ "empty": {
166
+ "description": "The query answered the empty sequence, which JSON cannot spell and null must not stand in for — answer is null then, and means nothing.",
167
+ "type": "boolean"
168
+ },
169
+ "explain": {
170
+ "description": "Present only when asked for: the same record data.explain answers, over the throwaway store.",
171
+ "type": "object",
172
+ "properties": {
173
+ "sql": { "type": "string" },
174
+ "params": { "type": "array" },
175
+ "indexes": { "type": "array" },
176
+ "prefilters": { "type": "array" },
177
+ "residual": { "type": ["object", "null"] },
178
+ "scanNarrative": { "type": "string" }
179
+ }
180
+ }
181
+ }
182
+ },
183
+ "errors": { "db": { "schema": { "$ref": "#/$defs/DbError" } } },
184
+ "doc": "Run one query over a THROWAWAY store: a fresh in-memory store on the model, the documents inserted, the query executed (and explained, when explain is asked for), the store closed — whatever happened. The store this context holds is untouched: no registration, no announcement, and it works with no store open at all. It is how a second executor is held to the spatial corpus from a real browser tab, in every engine: the corpus needs execution, not persistence, so a tab whose OPFS pool is absent answers it exactly as an owner does."
185
+ },
186
+ "data.live": {
187
+ "kind": "subscribe",
188
+ "input": {
189
+ "type": "object",
190
+ "required": ["collection", "document"],
191
+ "properties": {
192
+ "collection": { "$ref": "#/$defs/Collection" },
193
+ "document": true,
194
+ "externals": { "type": "object" }
195
+ }
196
+ },
197
+ "output": {
198
+ "type": "object",
199
+ "required": ["rows"],
200
+ "properties": {
201
+ "rows": { "type": "array" }
202
+ }
203
+ },
204
+ "errors": { "db": { "schema": { "$ref": "#/$defs/DbError" } } },
205
+ "doc": "Subscribe to a live query: the snapshot is LIVE's result document and every committed write follows as a { patch, seq } emission over the stream binding — RFC 6902 end to end. Unsubscribing is the wire's (the port unsubscribe frame)."
206
+ },
207
+ "data.lives": {
208
+ "kind": "read",
209
+ "output": {
210
+ "type": "object",
211
+ "required": ["count"],
212
+ "properties": {
213
+ "count": { "type": "integer", "minimum": 0 }
214
+ }
215
+ },
216
+ "errors": { "db": { "schema": { "$ref": "#/$defs/DbError" } } },
217
+ "doc": "The number of live registrations this store currently holds — the studio's status surface, and how a test observes that a departed tab's subscription was released."
218
+ },
219
+ "data.migrate": {
220
+ "kind": "command",
221
+ "input": {
222
+ "type": "object",
223
+ "required": ["to"],
224
+ "properties": {
225
+ "to": { "type": "object" },
226
+ "id": { "type": "string" }
227
+ }
228
+ },
229
+ "output": {
230
+ "type": "object",
231
+ "required": ["planned", "losses", "applied"],
232
+ "properties": {
233
+ "planned": { "type": "array", "items": { "type": "string" } },
234
+ "losses": { "type": "array" },
235
+ "applied": { "type": "array", "items": { "type": "string" } },
236
+ "note": { "type": "string" }
237
+ }
238
+ },
239
+ "errors": { "db": { "schema": { "$ref": "#/$defs/DbError" } } },
240
+ "doc": "From the owning context, plan a migration to a new model, shadow-verify and apply it (memory stores recreate instead — note says so), and reopen the store on the new model. A refused migration reopens the baseline. Both paths announce the active model so every tab resubscribes. Client-channel migrations are refused with the db failure."
241
+ }
242
+ }
243
+ }
@@ -0,0 +1,234 @@
1
+ /** Shared Data transitions for composed and independently mounted editors. */
2
+ export declare const DATA_ACTIONS: {
3
+ 'data/boot': {
4
+ effects: {
5
+ run: string;
6
+ }[];
7
+ };
8
+ 'data/seed': {
9
+ patch: {
10
+ op: string;
11
+ path: string;
12
+ value: string;
13
+ }[];
14
+ };
15
+ 'data/pane': {
16
+ patch: {
17
+ op: string;
18
+ path: string;
19
+ value: string;
20
+ }[];
21
+ };
22
+ 'data/model-text': {
23
+ patch: {
24
+ op: string;
25
+ path: string;
26
+ value: string;
27
+ }[];
28
+ };
29
+ 'data/query-text': {
30
+ patch: {
31
+ op: string;
32
+ path: string;
33
+ value: string;
34
+ }[];
35
+ };
36
+ 'data/open': {
37
+ effects: {
38
+ run: string;
39
+ with: {
40
+ text: string;
41
+ };
42
+ }[];
43
+ };
44
+ 'data/run': {
45
+ effects: {
46
+ run: string;
47
+ with: {
48
+ text: string;
49
+ };
50
+ }[];
51
+ };
52
+ 'data/insert-draft': {
53
+ patch: {
54
+ op: string;
55
+ path: string;
56
+ value: string;
57
+ }[];
58
+ };
59
+ 'data/insert': {
60
+ patch: {
61
+ op: string;
62
+ path: string;
63
+ value: string;
64
+ }[];
65
+ effects: {
66
+ run: string;
67
+ with: {
68
+ title: string;
69
+ };
70
+ }[];
71
+ };
72
+ 'data/delete': {
73
+ effects: {
74
+ run: string;
75
+ with: {
76
+ key: string;
77
+ };
78
+ }[];
79
+ };
80
+ 'data/migrate': {
81
+ effects: {
82
+ run: string;
83
+ }[];
84
+ };
85
+ 'data/oracle-run': {
86
+ effects: {
87
+ run: string;
88
+ }[];
89
+ };
90
+ 'data/oracle': {
91
+ patch: {
92
+ op: string;
93
+ path: string;
94
+ value: string;
95
+ }[];
96
+ };
97
+ 'data/trip-csv': {
98
+ patch: {
99
+ op: string;
100
+ path: string;
101
+ value: string;
102
+ }[];
103
+ };
104
+ 'data/trip-run': {
105
+ effects: {
106
+ run: string;
107
+ with: {
108
+ csv: string;
109
+ };
110
+ }[];
111
+ };
112
+ 'data/trip': {
113
+ patch: {
114
+ op: string;
115
+ path: string;
116
+ value: string;
117
+ }[];
118
+ };
119
+ 'data/status': {
120
+ patch: ({
121
+ op: string;
122
+ path: string;
123
+ value: string;
124
+ } | {
125
+ op: string;
126
+ path: string;
127
+ value: {
128
+ $default: (string | null)[];
129
+ };
130
+ })[];
131
+ };
132
+ 'data/opened': {
133
+ patch: ({
134
+ op: string;
135
+ path: string;
136
+ value: string;
137
+ } | {
138
+ op: string;
139
+ path: string;
140
+ value: {
141
+ $default: (string | never[])[];
142
+ };
143
+ })[];
144
+ };
145
+ 'data/rows': {
146
+ patch: {
147
+ op: string;
148
+ path: string;
149
+ value: string;
150
+ }[];
151
+ };
152
+ 'data/results': {
153
+ patch: ({
154
+ op: string;
155
+ path: string;
156
+ value: string;
157
+ } | {
158
+ op: string;
159
+ path: string;
160
+ value: null;
161
+ })[];
162
+ };
163
+ 'data/live': {
164
+ patch: ({
165
+ op: string;
166
+ path: string;
167
+ value: string;
168
+ } | {
169
+ op: string;
170
+ path: string;
171
+ value: null;
172
+ })[];
173
+ };
174
+ 'data/live-event': {
175
+ patch: {
176
+ op: string;
177
+ path: string;
178
+ value: string;
179
+ }[];
180
+ };
181
+ 'data/lives': {
182
+ patch: {
183
+ op: string;
184
+ path: string;
185
+ value: string;
186
+ }[];
187
+ };
188
+ 'data/migrated': {
189
+ patch: {
190
+ op: string;
191
+ path: string;
192
+ value: string;
193
+ }[];
194
+ };
195
+ 'data/error': {
196
+ patch: {
197
+ op: string;
198
+ path: string;
199
+ value: string;
200
+ }[];
201
+ };
202
+ 'data/ready': {
203
+ patch: {
204
+ op: string;
205
+ path: string;
206
+ value: string;
207
+ }[];
208
+ };
209
+ 'data/boot-error': {
210
+ patch: ({
211
+ op: string;
212
+ path: string;
213
+ value: string;
214
+ } | {
215
+ op: string;
216
+ path: string;
217
+ value: null;
218
+ })[];
219
+ };
220
+ 'data/retry': {
221
+ patch: ({
222
+ op: string;
223
+ path: string;
224
+ value: string;
225
+ } | {
226
+ op: string;
227
+ path: string;
228
+ value: null;
229
+ })[];
230
+ effects: {
231
+ run: string;
232
+ }[];
233
+ };
234
+ };
@@ -0,0 +1,9 @@
1
+ export { createTransport } from '../../data/transport.js';
2
+ export { createDataRuntime } from '../../data/runtime.js';
3
+ export { createDataState } from '../../data/state.js';
4
+ export { DATA_ACTIONS } from './actions.js';
5
+ export { DATA_RULES } from './views.js';
6
+ export { dataViewModel, oracleSummary } from './viewmodel.js';
7
+ export { createProjectDataRuntime } from './project-widget.js';
8
+ export { createDataController } from '../../data/editor.js';
9
+ export { mountDataEditor } from './mount.js';
@@ -0,0 +1,87 @@
1
+ /**
2
+ * @param {HTMLElement|null} node
3
+ * @param {{ model: any, query: any, transport: () => ReturnType<typeof import('../../data/transport.js').createTransport>,
4
+ * seeds?: any[], createRow?: (text: string) => any, migration?: (model: any, collection: string) => { to: any, id: string },
5
+ * trip?: any, corpus?: () => Promise<any>, executor?: string, operators?: { toOptions: () => any }, lifecycleTarget?: any,
6
+ * schedule?: (flush: () => void) => void, onError?: (error: Error) => void }} options
7
+ */
8
+ export declare function mountDataEditor(node: HTMLElement | null, options: {
9
+ model: any;
10
+ query: any;
11
+ transport: () => ReturnType<typeof import('../../data/transport.js').createTransport>;
12
+ seeds?: any[];
13
+ createRow?: (text: string) => any;
14
+ migration?: (model: any, collection: string) => {
15
+ to: any;
16
+ id: string;
17
+ };
18
+ trip?: any;
19
+ corpus?: () => Promise<any>;
20
+ executor?: string;
21
+ operators?: {
22
+ toOptions: () => any;
23
+ };
24
+ lifecycleTarget?: any;
25
+ schedule?: (flush: () => void) => void;
26
+ onError?: (error: Error) => void;
27
+ }): {
28
+ readonly ready: Promise<{
29
+ ok: boolean;
30
+ error?: string | {
31
+ code: string;
32
+ stage: string;
33
+ message: string;
34
+ };
35
+ }>;
36
+ read: () => import("../../data/editor.js").DataSnapshot;
37
+ validate: (candidate: {
38
+ model: any;
39
+ query: any;
40
+ }) => {
41
+ valid: boolean;
42
+ total: number;
43
+ errors: {
44
+ code: string | null;
45
+ message: string;
46
+ docPath?: string;
47
+ member: string;
48
+ }[];
49
+ } | {
50
+ valid: boolean;
51
+ total: number;
52
+ errors: {
53
+ code: any;
54
+ message: any;
55
+ }[];
56
+ };
57
+ replace: (candidate: {
58
+ model: any;
59
+ query: any;
60
+ }, options?: {
61
+ expectedRevision?: string;
62
+ }) => Promise<import("../../data/editor.js").EditorReceipt>;
63
+ apply: (patch: Parameters<typeof import("@jarenjs/json").applyJSONPatch>[1], options?: {
64
+ expectedRevision?: string;
65
+ }) => Promise<import("../../data/editor.js").EditorReceipt>;
66
+ /** @param {Parameters<typeof controller.run>[0]} [options] */
67
+ run(options?: Parameters<(options?: {
68
+ operation?: 'query' | 'open';
69
+ externals?: Record<string, any>;
70
+ }) => Promise<import("../../data/editor.js").EditorReceipt>>[0]): Promise<import("../../data/editor.js").EditorReceipt> | Promise<{
71
+ ok: boolean;
72
+ error: string;
73
+ }>;
74
+ subscribe: (listener: (snapshot: import("../../data/editor.js").DataSnapshot) => void) => () => void;
75
+ /** Release ownership on route exit while retaining every raw editing buffer.
76
+ * Reactivation reopens the last accepted model and never seeds over typing.
77
+ * @param {boolean} next */
78
+ setActive(next: boolean): Promise<{
79
+ ok: boolean;
80
+ error?: string | {
81
+ code: string;
82
+ stage: string;
83
+ message: string;
84
+ };
85
+ }>;
86
+ dispose(): void;
87
+ };
@@ -0,0 +1,27 @@
1
+ export declare function createProjectDataRuntime(options?: {}): {
2
+ widget: {
3
+ mount(host: any, props: any): {
4
+ dead: boolean;
5
+ generation: number;
6
+ draft: string;
7
+ deleteDraft: string;
8
+ result: null;
9
+ plan: null;
10
+ live: null;
11
+ props: any;
12
+ };
13
+ update(h: any, props: any): void;
14
+ unmount(h: any): void;
15
+ };
16
+ sync: (project: any, reset?: boolean) => void;
17
+ dispose: () => void;
18
+ acquire: (project: any, file: any) => {
19
+ entry: any;
20
+ collection: string;
21
+ modelName: any;
22
+ };
23
+ execute: (project: any, name: any) => Promise<{
24
+ result: any;
25
+ plan: any;
26
+ }>;
27
+ };