buckyos 0.7.180 → 0.7.183
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/LICENSE +202 -21
- package/NOTICE +35 -0
- package/README.md +4 -0
- package/cli/deno.json +3 -2
- package/cli/dist/cli.mjs +1534 -216
- package/cli/dist/cli.mjs.map +1 -1
- package/cli/modules/aiws.ts +761 -58
- package/cli/modules/aiws_place.ts +383 -0
- package/cli/modules/aiws_schedule.ts +256 -0
- package/cli/runtime/host.ts +18 -0
- package/cli/runtime/host_deno.ts +34 -0
- package/cli/runtime/host_node.ts +32 -1
- package/cli/runtime/node_entry.ts +1 -0
- package/cli/system_bootstrap.ts +1 -0
- package/cli/system_launcher.ts +1 -0
- package/cli/version.ts +1 -1
- package/dist/aicc_client.d.ts +1 -1
- package/dist/aicc_client.d.ts.map +1 -1
- package/dist/aiworkspace_client.d.ts +253 -2
- package/dist/aiworkspace_client.d.ts.map +1 -1
- package/dist/aiws_bind-3b874f77.mjs +2235 -0
- package/dist/aiws_bind-3b874f77.mjs.map +1 -0
- package/dist/aiws_bind-82bace11.js +2 -0
- package/dist/aiws_bind-82bace11.js.map +1 -0
- package/dist/aiws_bind.d.ts +233 -0
- package/dist/aiws_bind.d.ts.map +1 -0
- package/dist/aiws_ext.cjs +1 -1
- package/dist/aiws_ext.cjs.map +1 -1
- package/dist/aiws_ext.d.ts +9 -5
- package/dist/aiws_ext.d.ts.map +1 -1
- package/dist/aiws_ext.mjs +146 -11
- package/dist/aiws_ext.mjs.map +1 -1
- package/dist/aiws_rrule.d.ts +121 -0
- package/dist/aiws_rrule.d.ts.map +1 -0
- package/dist/aiws_schedule.d.ts +324 -0
- package/dist/aiws_schedule.d.ts.map +1 -0
- package/dist/aiws_write-89b5cc2a.js +13 -0
- package/dist/aiws_write-89b5cc2a.js.map +1 -0
- package/dist/{executor_client-bfc8a1e1.mjs → aiws_write-c2de498e.mjs} +724 -285
- package/dist/aiws_write-c2de498e.mjs.map +1 -0
- package/dist/aiws_write.d.ts +178 -0
- package/dist/aiws_write.d.ts.map +1 -0
- package/dist/browser.cjs +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +4 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.mjs +112 -21
- package/dist/browser.mjs.map +1 -1
- package/dist/{content_objid-9232bcaf.mjs → content_objid-a2cafba9.mjs} +2 -2
- package/dist/{content_objid-9232bcaf.mjs.map → content_objid-a2cafba9.mjs.map} +1 -1
- package/dist/content_objid-dff803ff.js +2 -0
- package/dist/{content_objid-1aff74b6.js.map → content_objid-dff803ff.js.map} +1 -1
- package/dist/{did_object_client-7fa36f90.mjs → did_object_client-cb2f9aba.mjs} +2 -2
- package/dist/{did_object_client-7fa36f90.mjs.map → did_object_client-cb2f9aba.mjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +113 -22
- package/dist/index.mjs.map +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.ts +5 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.mjs +99 -6
- package/dist/node.mjs.map +1 -1
- package/dist/{object_url-f72c1704.mjs → object_url-376c5222.mjs} +4 -4
- package/dist/{object_url-f72c1704.mjs.map → object_url-376c5222.mjs.map} +1 -1
- package/dist/xllm.mjs +2 -2
- package/package.json +5 -4
- package/dist/content_objid-1aff74b6.js +0 -2
- package/dist/executor_client-7ce0ddc7.js +0 -13
- package/dist/executor_client-7ce0ddc7.js.map +0 -1
- package/dist/executor_client-bfc8a1e1.mjs.map +0 -1
package/dist/aiws_ext.d.ts
CHANGED
|
@@ -23,11 +23,15 @@ export declare const AIWS_MANIFEST_FILE = "aiws-manifest.json";
|
|
|
23
23
|
export declare const AIWS_BUILD_STATE_FILE = ".aiws-build.json";
|
|
24
24
|
/** The newest component.json / AIWS manifest version this module reads (older ones stay readable, Q19). Version 2
|
|
25
25
|
* adds `kind: composite` and non-empty `deps`; version 3 `events`, the declarative `button`, composite `events` and
|
|
26
|
-
* Workspace templates
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
* Workspace templates; version 4 `actions` and the composite projections; version 5 a composite's declared
|
|
27
|
+
* `on_bind` / `on_init_control` (控件 on_bind TODO), and an HTML control's `"script"` for them. */
|
|
28
|
+
export declare const AIWS_MANIFEST_VERSION = 5;
|
|
29
|
+
/** The newest HTML Block host API (`window.aiws` v3: `emit`, `createBlock { parent, slot }`, `context.interactive`; v4:
|
|
30
|
+
* `onConfig`, `serverNow`, `userState`, `mediaUrl`; v5: `aiws.on('bind')` / `aiws.on('init_control')` run without a page
|
|
31
|
+
* before placing; v6: `aiws.query(sql, params?)` runs one SQL SELECT over the logical tables, answered as `doc.query
|
|
32
|
+
* { sql }` (`{ columns, rows, truncated, read, head_seq }`) — 5 and older have no `aiws.query`; hosts run every version
|
|
33
|
+
* from 2 on) and the declarative interpreter version. */
|
|
34
|
+
export declare const AIWS_HTML_API_VERSION = 6;
|
|
31
35
|
export declare const AIWS_DECLARATIVE_API_VERSION = 1;
|
|
32
36
|
/** The `format` of a Workspace template's `snapshot.json` (Q32). */
|
|
33
37
|
export declare const AIWS_TEMPLATE_FORMAT = "aiws-template/1";
|
package/dist/aiws_ext.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiws_ext.d.ts","sourceRoot":"","sources":["../src/aiws_ext.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC9F,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"aiws_ext.d.ts","sourceRoot":"","sources":["../src/aiws_ext.ts"],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,CAAC,EAAE,WAAW,CAAA;CAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAgC/L;AAID,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,WAAW,CAAA;IAC3C,8FAA8F;IAC9F,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;CAC9B;AAED;;mBAEmB;AACnB,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuEjF;AAED,kHAAkH;AAClH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAMxH"}
|
package/dist/aiws_ext.mjs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { av as checkBindSteps } from "./aiws_bind-3b874f77.mjs";
|
|
2
|
+
import "./object_url-376c5222.mjs";
|
|
3
|
+
import "./ndn_types-0fac2499.mjs";
|
|
1
4
|
const AIWS_COMPONENT_FILE = "component.json";
|
|
2
5
|
const AIWS_COMPOSITION_FILE = "composition.json";
|
|
3
6
|
const AIWS_MANIFEST_FILE = "aiws-manifest.json";
|
|
4
7
|
const AIWS_BUILD_STATE_FILE = ".aiws-build.json";
|
|
5
|
-
const AIWS_MANIFEST_VERSION =
|
|
6
|
-
const AIWS_HTML_API_VERSION =
|
|
8
|
+
const AIWS_MANIFEST_VERSION = 5;
|
|
9
|
+
const AIWS_HTML_API_VERSION = 6;
|
|
7
10
|
const AIWS_DECLARATIVE_API_VERSION = 1;
|
|
8
11
|
const AIWS_TEMPLATE_FORMAT = "aiws-template/1";
|
|
9
12
|
const AIWS_MAX_SOURCE_FILES = 64;
|
|
@@ -88,7 +91,7 @@ async function buildFiles(nfsp, files, upload) {
|
|
|
88
91
|
}
|
|
89
92
|
return packBuildFiles(inline, upload, byRef);
|
|
90
93
|
}
|
|
91
|
-
const COMPONENT_KEYS = ["manifest_version", "ident", "kind", "title", "description", "host_api", "accepts", "allow_no_source", "default_size", "config_schema", "bindings", "entry", "assets", "catalog", "agent", "deps", "events"];
|
|
94
|
+
const COMPONENT_KEYS = ["manifest_version", "ident", "kind", "title", "description", "host_api", "accepts", "allow_no_source", "default_size", "config_schema", "bindings", "entry", "assets", "catalog", "agent", "deps", "events", "actions", "on_bind", "on_init_control"];
|
|
92
95
|
const SCHEMA_KEYWORDS = ["type", "enum", "default", "required", "title", "description", "minimum", "maximum", "minLength", "maxLength", "properties", "items"];
|
|
93
96
|
const NAME = /^[a-z0-9][a-z0-9._-]{0,63}$/;
|
|
94
97
|
const DID = /^did:[a-z0-9]+:[^/#\s]+$/;
|
|
@@ -96,6 +99,8 @@ const BINDING = /^[a-z][a-z0-9_]{0,31}$/;
|
|
|
96
99
|
const IDENT = /^did:[a-z0-9]+:[^/#\s]+#[a-z0-9][a-z0-9._-]{0,63}$/;
|
|
97
100
|
const V2_HINT = "needs manifest_version 2 (raise it in component.json)";
|
|
98
101
|
const V3_HINT = "needs manifest_version 3 (raise it in component.json)";
|
|
102
|
+
const V4_HINT = "needs manifest_version 4 (raise it in component.json)";
|
|
103
|
+
const V5_HINT = "needs manifest_version 5 (raise it in component.json)";
|
|
99
104
|
const EVENT_PARAM_TYPES = ["string", "number", "boolean", "object", "entity"];
|
|
100
105
|
const ITEM_KINDS = ["text", "value", "metric", "bar", "list", "badge"];
|
|
101
106
|
const ITEM_KEYS = ["kind", "text", "label", "bind", "by", "format", "limit"];
|
|
@@ -333,9 +338,12 @@ function checkComposition(text, configSchema, file = AIWS_COMPOSITION_FILE, cont
|
|
|
333
338
|
}
|
|
334
339
|
error(`${at}: a number in [0, ${max}] or {{config.<key>}}`);
|
|
335
340
|
};
|
|
341
|
+
const before4 = context.manifestVersion !== void 0 && context.manifestVersion < 4;
|
|
336
342
|
for (const k of Object.keys(o)) {
|
|
337
|
-
if (!["layout", "slots", "chrome", "events"].includes(k))
|
|
338
|
-
error(`unknown key ${k} (a composition says layout, slots, chrome and
|
|
343
|
+
if (!["layout", "slots", "chrome", "events", "projections", "media"].includes(k))
|
|
344
|
+
error(`unknown key ${k} (a composition says layout, slots, chrome, events, projections and media)`);
|
|
345
|
+
else if ((k === "projections" || k === "media") && before4)
|
|
346
|
+
error(`${k} ${V4_HINT}`);
|
|
339
347
|
}
|
|
340
348
|
const layout = o.layout;
|
|
341
349
|
let algorithm = "stack";
|
|
@@ -426,6 +434,18 @@ function checkComposition(text, configSchema, file = AIWS_COMPOSITION_FILE, cont
|
|
|
426
434
|
} else if (k === "title") {
|
|
427
435
|
if (typeof v !== "string" || v.length > 256)
|
|
428
436
|
error(`${at}.title: at most 256 characters`);
|
|
437
|
+
} else if (k === "visible") {
|
|
438
|
+
if (before4) {
|
|
439
|
+
error(`${at}.visible ${V4_HINT}`);
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
const vis = v;
|
|
443
|
+
if (!isRecord(vis) || vis.from !== "first_open" || Object.keys(vis).some((x) => x !== "from" && x !== "for_ms"))
|
|
444
|
+
error(`${at}.visible: { from: "first_open", for_ms }`);
|
|
445
|
+
else if (typeof vis.for_ms === "string")
|
|
446
|
+
placeholders(vis.for_ms, `${at}.visible.for_ms`);
|
|
447
|
+
else if (!Number.isInteger(vis.for_ms) || vis.for_ms < 1 || vis.for_ms > 366 * 864e5)
|
|
448
|
+
error(`${at}.visible.for_ms: milliseconds (≤ a year) or {{config.<key>}}`);
|
|
429
449
|
} else
|
|
430
450
|
error(`${at}: unknown key ${k}`);
|
|
431
451
|
}
|
|
@@ -499,14 +519,35 @@ function checkComposition(text, configSchema, file = AIWS_COMPOSITION_FILE, cont
|
|
|
499
519
|
} else if (k === "description") {
|
|
500
520
|
if (typeof v !== "string" || v.length > 4e3)
|
|
501
521
|
error(`${at}.description: at most 4000 characters`);
|
|
522
|
+
} else if (k === "on") {
|
|
523
|
+
const list = Array.isArray(v) ? v : [v];
|
|
524
|
+
if (before4)
|
|
525
|
+
error(`${at}.on ${V4_HINT}`);
|
|
526
|
+
else if (list.length === 0 || list.length > 4 || list.some((h) => !isRecord(h) || !["write", "wish", "open", "notify"].includes(String(h.kind))))
|
|
527
|
+
error(`${at}.on: a handler (write, wish, open, notify) or 1…4 of them`);
|
|
502
528
|
} else if (k !== "from")
|
|
503
|
-
error(`${at}: unknown key ${k} (from, title, description)`);
|
|
529
|
+
error(`${at}: unknown key ${k} (from, title, description, on)`);
|
|
504
530
|
}
|
|
505
531
|
const from = raw.from;
|
|
506
532
|
if (!isRecord(from)) {
|
|
507
533
|
error(`${at}.from { slot, event } required: the child event it re-raises`);
|
|
508
534
|
continue;
|
|
509
535
|
}
|
|
536
|
+
if (from.projection !== void 0) {
|
|
537
|
+
if (before4) {
|
|
538
|
+
error(`${at}.from.projection ${V4_HINT}`);
|
|
539
|
+
continue;
|
|
540
|
+
}
|
|
541
|
+
const projections = isRecord(o.projections) ? o.projections : {};
|
|
542
|
+
if (typeof from.projection !== "string" || !(from.projection in projections))
|
|
543
|
+
error(`${at}.from.projection ${JSON.stringify(from.projection)}: a projection of this composition`);
|
|
544
|
+
if (from.role !== void 0 && !(typeof from.role === "string" && BINDING.test(from.role)))
|
|
545
|
+
error(`${at}.from.role: a role name of its template`);
|
|
546
|
+
for (const k of Object.keys(from))
|
|
547
|
+
if (k !== "projection" && k !== "role")
|
|
548
|
+
error(`${at}.from: unknown key ${k} (projection, role)`);
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
510
551
|
for (const k of Object.keys(from))
|
|
511
552
|
if (k !== "slot" && k !== "event")
|
|
512
553
|
error(`${at}.from: unknown key ${k} (slot, event)`);
|
|
@@ -534,6 +575,51 @@ function checkComposition(text, configSchema, file = AIWS_COMPOSITION_FILE, cont
|
|
|
534
575
|
}
|
|
535
576
|
}
|
|
536
577
|
}
|
|
578
|
+
if (o.projections !== void 0 && !before4) {
|
|
579
|
+
if (!isRecord(o.projections) || Object.keys(o.projections).length > 8)
|
|
580
|
+
error("projections: at most 8 of name → { source, template, layout }");
|
|
581
|
+
else
|
|
582
|
+
for (const [name, raw] of Object.entries(o.projections)) {
|
|
583
|
+
const at = `projections.${name}`;
|
|
584
|
+
if (!BINDING.test(name))
|
|
585
|
+
error(`${at}: a projection name is [a-z][a-z0-9_]{0,31}`);
|
|
586
|
+
if (!isRecord(raw)) {
|
|
587
|
+
error(`${at} must be an object`);
|
|
588
|
+
continue;
|
|
589
|
+
}
|
|
590
|
+
for (const k of Object.keys(raw))
|
|
591
|
+
if (!["source", "mark", "template", "layout", "placement", "max_items"].includes(k))
|
|
592
|
+
error(`${at}: unknown key ${k} (source, mark, template, layout, placement, max_items)`);
|
|
593
|
+
const src = raw.source;
|
|
594
|
+
const kind = isRecord(src) ? src.kind : void 0;
|
|
595
|
+
if (!isRecord(src) || !["records", "members", "counts", "viewer"].includes(String(kind)) || kind !== "viewer" && typeof src.binding !== "string" || kind === "counts" && typeof src.field !== "string") {
|
|
596
|
+
error(`${at}.source: { kind: records | members | counts | viewer, binding (a binding name), field? (counts) }`);
|
|
597
|
+
}
|
|
598
|
+
const nodes = isRecord(raw.template) && Array.isArray(raw.template.nodes) ? raw.template.nodes : null;
|
|
599
|
+
if (!nodes || nodes.length === 0 || nodes.length > 32)
|
|
600
|
+
error(`${at}.template: { nodes: [1…32 of { id, view: label | shape | asset, box?, config?, when?, role? }] }`);
|
|
601
|
+
else
|
|
602
|
+
nodes.forEach((n, i) => {
|
|
603
|
+
if (!isRecord(n) || typeof n.id !== "string" || !BINDING.test(n.id))
|
|
604
|
+
error(`${at}.template.nodes[${i}].id: a name [a-z][a-z0-9_]{0,31}`);
|
|
605
|
+
else if (!["label", "shape", "asset"].includes(String(n.view)))
|
|
606
|
+
error(`${at}.template.nodes[${i}].view: label, shape or asset`);
|
|
607
|
+
});
|
|
608
|
+
const lay = raw.layout;
|
|
609
|
+
if (!isRecord(lay) || lay.algorithm !== "list" && lay.algorithm !== "grid" || !isRecord(lay.item) || lay.item.h === void 0)
|
|
610
|
+
error(`${at}.layout: { algorithm: list | grid, columns? (grid), gap?, item: { w?, h } }`);
|
|
611
|
+
else if (lay.algorithm === "grid" && lay.columns === void 0)
|
|
612
|
+
error(`${at}.layout.columns required (grid)`);
|
|
613
|
+
if (raw.placement !== void 0 && !["top", "stack", "bottom"].includes(String(raw.placement)))
|
|
614
|
+
error(`${at}.placement: top, stack or bottom`);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
if (o.media !== void 0 && !before4) {
|
|
618
|
+
const m = o.media;
|
|
619
|
+
if (!isRecord(m) || typeof m.slot !== "string" || !slots || !(m.slot in slots) || typeof m.anchor !== "string" || Object.keys(props).length > 0 && !(m.anchor in props)) {
|
|
620
|
+
error("media: { slot (a slot of this composition), anchor (a config property), loop? (a config property) }");
|
|
621
|
+
}
|
|
622
|
+
}
|
|
537
623
|
return out;
|
|
538
624
|
}
|
|
539
625
|
function checkComponent(text, fileNames, readText, cellEvents) {
|
|
@@ -557,6 +643,22 @@ function checkComponent(text, fileNames, readText, cellEvents) {
|
|
|
557
643
|
error(`unknown key ${k}`);
|
|
558
644
|
const mv = c.manifest_version;
|
|
559
645
|
const version = typeof mv === "number" && Number.isInteger(mv) && mv >= 1 ? mv : 0;
|
|
646
|
+
if (c.actions !== void 0) {
|
|
647
|
+
if (version > 0 && version < 4)
|
|
648
|
+
error(`actions ${V4_HINT}`);
|
|
649
|
+
else if (!Array.isArray(c.actions) || c.actions.length > 16)
|
|
650
|
+
error("actions: at most 16 of { id, title, icon?, modes?, needs?, run }");
|
|
651
|
+
else
|
|
652
|
+
c.actions.forEach((a, i) => {
|
|
653
|
+
if (!isRecord(a) || typeof a.id !== "string" || !BINDING.test(a.id) || typeof a.title !== "string" || !a.title)
|
|
654
|
+
error(`actions[${i}]: { id, title, run } (id a name [a-z][a-z0-9_]{0,31})`);
|
|
655
|
+
else {
|
|
656
|
+
const run = Array.isArray(a.run) ? a.run : [a.run];
|
|
657
|
+
if (run.length === 0 || run.length > 4 || run.some((h) => !isRecord(h) || !["write", "wish", "open", "notify", "config", "forward"].includes(String(h.kind))))
|
|
658
|
+
error(`actions[${i}].run: a handler (write, wish, open, notify, config, forward) or 1…4 of them`);
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
}
|
|
560
662
|
if (!version)
|
|
561
663
|
error(`manifest_version (1…${AIWS_MANIFEST_VERSION}) required`);
|
|
562
664
|
else if (version > AIWS_MANIFEST_VERSION)
|
|
@@ -598,9 +700,38 @@ function checkComponent(text, fileNames, readText, cellEvents) {
|
|
|
598
700
|
if (!c.bindings || typeof c.bindings !== "object")
|
|
599
701
|
error("bindings must be an object");
|
|
600
702
|
else
|
|
601
|
-
for (const n of Object.
|
|
703
|
+
for (const [n, d] of Object.entries(c.bindings)) {
|
|
602
704
|
if (!BINDING.test(n) || n === "props")
|
|
603
705
|
error(`binding name ${n}: [a-z][a-z0-9_]{0,31}, not props`);
|
|
706
|
+
if (!isRecord(d)) {
|
|
707
|
+
error(`binding ${n} must be an object`);
|
|
708
|
+
continue;
|
|
709
|
+
}
|
|
710
|
+
for (const k of Object.keys(d))
|
|
711
|
+
if (!["accepts", "required", "many", "schema_id", "title", "description"].includes(k))
|
|
712
|
+
error(`binding ${n}: unknown key ${k}`);
|
|
713
|
+
if (d.many !== void 0 && typeof d.many !== "boolean")
|
|
714
|
+
error(`binding ${n}.many: true or false`);
|
|
715
|
+
if (d.schema_id !== void 0 && (typeof d.schema_id !== "string" || !d.schema_id || d.schema_id.length > 128))
|
|
716
|
+
error(`binding ${n}.schema_id: a schema id such as buckyos.todo@1`);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
if (c.on_bind !== void 0 || c.on_init_control !== void 0) {
|
|
720
|
+
if (version > 0 && version < 5)
|
|
721
|
+
error(`on_bind / on_init_control ${V5_HINT}`);
|
|
722
|
+
else if (c.kind === "html") {
|
|
723
|
+
for (const [k, ev] of [["on_bind", "bind"], ["on_init_control", "init_control"]]) {
|
|
724
|
+
if (c[k] !== void 0 && c[k] !== "script")
|
|
725
|
+
error(`${k}: an HTML control writes "script" (its behavior.js handles aiws.on('${ev}'))`);
|
|
726
|
+
}
|
|
727
|
+
if (!(typeof c.host_api === "number" && c.host_api >= 5))
|
|
728
|
+
error(`on_bind / on_init_control "script": aiws.on('bind') / aiws.on('init_control') need host_api 5`);
|
|
729
|
+
} else if (c.kind !== "composite")
|
|
730
|
+
error('on_bind / on_init_control: declared steps are for a composite, "script" for an HTML control');
|
|
731
|
+
else {
|
|
732
|
+
const actionIds = Array.isArray(c.actions) ? c.actions.filter(isRecord).map((a) => String(a.id)) : [];
|
|
733
|
+
checkBindSteps(c.on_bind, c.on_init_control, isRecord(c.bindings) ? c.bindings : {}, actionIds).forEach(error);
|
|
734
|
+
}
|
|
604
735
|
}
|
|
605
736
|
if (c.deps !== void 0) {
|
|
606
737
|
if (!Array.isArray(c.deps) || c.deps.length > 32)
|
|
@@ -647,12 +778,16 @@ function checkComponent(text, fileNames, readText, cellEvents) {
|
|
|
647
778
|
else
|
|
648
779
|
named.add(String(n));
|
|
649
780
|
}
|
|
650
|
-
if (c.host_api !== void 0 &&
|
|
651
|
-
error("host_api: the HTML Block host speaks API 2 and
|
|
781
|
+
if (c.host_api !== void 0 && ![2, 3, 4, 5, 6].includes(c.host_api))
|
|
782
|
+
error("host_api: the HTML Block host speaks API 2, 3, 4, 5 and 6");
|
|
783
|
+
else if ((c.host_api === 5 || c.host_api === 6) && version < 5)
|
|
784
|
+
error(`host_api ${c.host_api} ${V5_HINT}`);
|
|
785
|
+
else if (c.host_api === 4 && version < 4)
|
|
786
|
+
error(`host_api 4 ${V4_HINT}`);
|
|
652
787
|
else if (c.host_api === 3 && before3)
|
|
653
788
|
error(`host_api 3 ${V3_HINT}`);
|
|
654
|
-
if (events.length > 0 && c.host_api
|
|
655
|
-
out.push({ file: f, severity: "warning", message: "events: an HTML control raises them with aiws.emit, which is host API 3 (set host_api to 3)" });
|
|
789
|
+
if (events.length > 0 && !(typeof c.host_api === "number" && c.host_api >= 3))
|
|
790
|
+
out.push({ file: f, severity: "warning", message: "events: an HTML control raises them with aiws.emit, which is host API 3 (set host_api to 3 or later)" });
|
|
656
791
|
} else if (c.kind === "declarative" || composite) {
|
|
657
792
|
if (!has(c.entry))
|
|
658
793
|
error(`entry ${JSON.stringify(c.entry)} is not in the directory`);
|