@arkitektio/bsx 4.2.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -18
- package/dist/bsx/parse.d.ts +13 -7
- package/dist/bsx/parse.d.ts.map +1 -1
- package/dist/bsx/parse.js +18 -57
- package/dist/bsx/parse.js.map +1 -1
- package/dist/bsx/print.d.ts.map +1 -1
- package/dist/bsx/print.js +22 -35
- package/dist/bsx/print.js.map +1 -1
- package/dist/bsx/references.d.ts +5 -5
- package/dist/bsx/references.d.ts.map +1 -1
- package/dist/bsx/references.js +124 -30
- package/dist/bsx/references.js.map +1 -1
- package/dist/catalogs/html.d.ts +1 -1
- package/dist/catalogs/html.d.ts.map +1 -1
- package/dist/catalogs/html.js +3 -3
- package/dist/catalogs/html.js.map +1 -1
- package/dist/catalogs/index.d.ts +209 -139
- package/dist/catalogs/index.d.ts.map +1 -1
- package/dist/catalogs/index.js +6 -2
- package/dist/catalogs/index.js.map +1 -1
- package/dist/catalogs/logo.d.ts +5 -5
- package/dist/catalogs/logo.d.ts.map +1 -1
- package/dist/catalogs/logo.js +3 -3
- package/dist/catalogs/logo.js.map +1 -1
- package/dist/catalogs/parts/data.d.ts +6 -6
- package/dist/catalogs/parts/feedback.d.ts +15 -15
- package/dist/catalogs/parts/forms.d.ts +55 -27
- package/dist/catalogs/parts/forms.d.ts.map +1 -1
- package/dist/catalogs/parts/forms.js +32 -0
- package/dist/catalogs/parts/forms.js.map +1 -1
- package/dist/catalogs/parts/html.d.ts +1 -1
- package/dist/catalogs/parts/html.d.ts.map +1 -1
- package/dist/catalogs/parts/html.js +1 -1
- package/dist/catalogs/parts/html.js.map +1 -1
- package/dist/catalogs/parts/icons.d.ts +11 -11
- package/dist/catalogs/parts/icons.js +1 -1
- package/dist/catalogs/parts/index.d.ts +183 -137
- package/dist/catalogs/parts/index.d.ts.map +1 -1
- package/dist/catalogs/parts/layout.d.ts +11 -1
- package/dist/catalogs/parts/layout.d.ts.map +1 -1
- package/dist/catalogs/parts/layout.js +9 -0
- package/dist/catalogs/parts/layout.js.map +1 -1
- package/dist/catalogs/parts/logo.d.ts +8 -8
- package/dist/catalogs/parts/logo.d.ts.map +1 -1
- package/dist/catalogs/parts/logo.js +2 -2
- package/dist/catalogs/parts/logo.js.map +1 -1
- package/dist/catalogs/parts/navigation.d.ts +20 -20
- package/dist/catalogs/parts/overlays.d.ts +55 -55
- package/dist/catalogs/parts/run.d.ts +13 -5
- package/dist/catalogs/parts/run.d.ts.map +1 -1
- package/dist/catalogs/parts/run.js +1 -1
- package/dist/catalogs/parts/scene.d.ts +12 -4
- package/dist/catalogs/parts/scene.d.ts.map +1 -1
- package/dist/catalogs/parts/scene.js +4 -0
- package/dist/catalogs/parts/scene.js.map +1 -1
- package/dist/catalogs/parts/structure.js +2 -2
- package/dist/catalogs/parts/toast.js +1 -1
- package/dist/catalogs/parts/toast.js.map +1 -1
- package/dist/catalogs/parts/typography.js +1 -1
- package/dist/catalogs/parts/typography.js.map +1 -1
- package/dist/catalogs/props.d.ts +3 -3
- package/dist/catalogs/scene.d.ts +13 -5
- package/dist/catalogs/scene.d.ts.map +1 -1
- package/dist/catalogs/scene.js +3 -3
- package/dist/catalogs/scene.js.map +1 -1
- package/dist/catalogs/shadcn.d.ts +106 -58
- package/dist/catalogs/shadcn.d.ts.map +1 -1
- package/dist/catalogs/shadcn.js +6 -4
- package/dist/catalogs/shadcn.js.map +1 -1
- package/dist/catalogs/structure.d.ts +1 -1
- package/dist/catalogs/structure.d.ts.map +1 -1
- package/dist/catalogs/structure.js +3 -3
- package/dist/catalogs/structure.js.map +1 -1
- package/dist/catalogs/ui.d.ts +83 -73
- package/dist/catalogs/ui.d.ts.map +1 -1
- package/dist/catalogs/ui.js +4 -3
- package/dist/catalogs/ui.js.map +1 -1
- package/dist/catalogs.d.ts +1 -1
- package/dist/catalogs.d.ts.map +1 -1
- package/dist/catalogs.js +2 -2
- package/dist/catalogs.js.map +1 -1
- package/dist/ports.js +1 -1
- package/dist/ports.js.map +1 -1
- package/dist/renderer/BlokRenderer.d.ts +4 -1
- package/dist/renderer/BlokRenderer.d.ts.map +1 -1
- package/dist/renderer/BlokRenderer.js +5 -1
- package/dist/renderer/BlokRenderer.js.map +1 -1
- package/dist/renderer/baseCatalog.d.ts +8 -6
- package/dist/renderer/baseCatalog.d.ts.map +1 -1
- package/dist/renderer/baseCatalog.js +7 -5
- package/dist/renderer/baseCatalog.js.map +1 -1
- package/dist/renderer/bloks/control.d.ts +14 -0
- package/dist/renderer/bloks/control.d.ts.map +1 -1
- package/dist/renderer/bloks/control.js +105 -6
- package/dist/renderer/bloks/control.js.map +1 -1
- package/dist/renderer/bloks/data.d.ts +6 -6
- package/dist/renderer/bloks/feedback.d.ts +15 -15
- package/dist/renderer/bloks/forms.d.ts +51 -27
- package/dist/renderer/bloks/forms.d.ts.map +1 -1
- package/dist/renderer/bloks/forms.js +56 -0
- package/dist/renderer/bloks/forms.js.map +1 -1
- package/dist/renderer/bloks/html.js +2 -2
- package/dist/renderer/bloks/icons.d.ts +5 -5
- package/dist/renderer/bloks/index.d.ts +166 -134
- package/dist/renderer/bloks/index.d.ts.map +1 -1
- package/dist/renderer/bloks/index.js +1 -1
- package/dist/renderer/bloks/layout.d.ts +9 -1
- package/dist/renderer/bloks/layout.d.ts.map +1 -1
- package/dist/renderer/bloks/layout.js +15 -0
- package/dist/renderer/bloks/layout.js.map +1 -1
- package/dist/renderer/bloks/logo/index.d.ts +5 -5
- package/dist/renderer/bloks/logo/index.d.ts.map +1 -1
- package/dist/renderer/bloks/logo/index.js +2 -2
- package/dist/renderer/bloks/logo/index.js.map +1 -1
- package/dist/renderer/bloks/navigation.d.ts +20 -20
- package/dist/renderer/bloks/overlays.d.ts +55 -55
- package/dist/renderer/bloks/run/components.d.ts +6 -2
- package/dist/renderer/bloks/run/components.d.ts.map +1 -1
- package/dist/renderer/bloks/run/components.js +1 -1
- package/dist/renderer/bloks/run/host.d.ts +32 -3
- package/dist/renderer/bloks/run/host.d.ts.map +1 -1
- package/dist/renderer/bloks/run/host.js.map +1 -1
- package/dist/renderer/bloks/scene/index.d.ts +6 -2
- package/dist/renderer/bloks/scene/index.d.ts.map +1 -1
- package/dist/renderer/bloks/toast.d.ts +1 -1
- package/dist/renderer/bloks/typography.js +1 -1
- package/dist/renderer/catalog.d.ts +4 -7
- package/dist/renderer/catalog.d.ts.map +1 -1
- package/dist/renderer/catalog.js +7 -31
- package/dist/renderer/catalog.js.map +1 -1
- package/dist/renderer/declare.d.ts +31 -19
- package/dist/renderer/declare.d.ts.map +1 -1
- package/dist/renderer/declare.js +44 -18
- package/dist/renderer/declare.js.map +1 -1
- package/dist/renderer/functions/v2/index.d.ts.map +1 -1
- package/dist/renderer/functions/v2/index.js +39 -0
- package/dist/renderer/functions/v2/index.js.map +1 -1
- package/dist/renderer/runtime/catalog.d.ts +27 -7
- package/dist/renderer/runtime/catalog.d.ts.map +1 -1
- package/dist/renderer/runtime/catalog.js +30 -3
- package/dist/renderer/runtime/catalog.js.map +1 -1
- package/dist/renderer/runtime/components.d.ts +7 -1
- package/dist/renderer/runtime/components.d.ts.map +1 -1
- package/dist/renderer/runtime/components.js +3 -0
- package/dist/renderer/runtime/components.js.map +1 -1
- package/dist/renderer/runtime/context.d.ts +2 -0
- package/dist/renderer/runtime/context.d.ts.map +1 -1
- package/dist/renderer/runtime/context.js +4 -0
- package/dist/renderer/runtime/context.js.map +1 -1
- package/dist/renderer/runtime/describe.d.ts +14 -4
- package/dist/renderer/runtime/describe.d.ts.map +1 -1
- package/dist/renderer/runtime/describe.js +3 -0
- package/dist/renderer/runtime/describe.js.map +1 -1
- package/dist/renderer/runtime/hooks.d.ts.map +1 -1
- package/dist/renderer/runtime/hooks.js +1 -0
- package/dist/renderer/runtime/hooks.js.map +1 -1
- package/dist/renderer/runtime/index.d.ts +1 -0
- package/dist/renderer/runtime/index.d.ts.map +1 -1
- package/dist/renderer/runtime/index.js +1 -0
- package/dist/renderer/runtime/index.js.map +1 -1
- package/dist/renderer/runtime/preflight.d.ts.map +1 -1
- package/dist/renderer/runtime/preflight.js +5 -2
- package/dist/renderer/runtime/preflight.js.map +1 -1
- package/dist/renderer/runtime/resolution.d.ts +2 -0
- package/dist/renderer/runtime/resolution.d.ts.map +1 -1
- package/dist/renderer/runtime/resolution.js +17 -1
- package/dist/renderer/runtime/resolution.js.map +1 -1
- package/dist/renderer/runtime/schemas.d.ts +5 -5
- package/dist/renderer/runtime/task.d.ts +25 -2
- package/dist/renderer/runtime/task.d.ts.map +1 -1
- package/dist/renderer/runtime/task.js +11 -2
- package/dist/renderer/runtime/task.js.map +1 -1
- package/dist/renderer/runtime/text.d.ts +28 -0
- package/dist/renderer/runtime/text.d.ts.map +1 -0
- package/dist/renderer/runtime/text.js +82 -0
- package/dist/renderer/runtime/text.js.map +1 -0
- package/dist/renderer/runtime/types.d.ts +7 -2
- package/dist/renderer/runtime/types.d.ts.map +1 -1
- package/dist/runtime.d.ts +0 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +0 -1
- package/dist/runtime.js.map +1 -1
- package/dist/scene.d.ts +1 -1
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +2 -2
- package/dist/scene.js.map +1 -1
- package/dist/shadcn.d.ts +169 -137
- package/dist/shadcn.d.ts.map +1 -1
- package/dist/shadcn.js +8 -5
- package/dist/shadcn.js.map +1 -1
- package/dist/spec/bsx_v2.json +3080 -2372
- package/dist/spec/catalogs/base@3.json +13029 -0
- package/dist/spec/catalogs/base@3.json.js +13029 -0
- package/dist/spec/catalogs/orkestrator@1.json +489 -0
- package/dist/spec/catalogs/orkestrator@1.json.js +489 -0
- package/dist/spec/catalogs.d.ts +109 -46
- package/dist/spec/catalogs.d.ts.map +1 -1
- package/dist/spec/catalogs.js +241 -73
- package/dist/spec/catalogs.js.map +1 -1
- package/dist/spec/vocabulary.d.ts +21 -3
- package/dist/spec/vocabulary.d.ts.map +1 -1
- package/dist/spec/vocabulary.js +16 -2
- package/dist/spec/vocabulary.js.map +1 -1
- package/dist/spec/vocabulary.json +73 -27
- package/dist/spec/vocabulary.json.js +73 -27
- package/dist/vendor/core/ui/button-group.d.ts +1 -1
- package/dist/vendor/core/ui/button.d.ts +1 -1
- package/dist/vendor/core/ui/field.d.ts +1 -1
- package/package.json +1 -1
- package/src/bsx/infer.test.ts +18 -26
- package/src/bsx/language.test.ts +2 -2
- package/src/bsx/parse.ts +18 -62
- package/src/bsx/partial.test.ts +1 -1
- package/src/bsx/print.ts +24 -34
- package/src/bsx/references.test.ts +71 -10
- package/src/bsx/references.ts +114 -35
- package/src/catalogs/catalogs.test.ts +45 -14
- package/src/catalogs/html.ts +3 -3
- package/src/catalogs/index.ts +6 -2
- package/src/catalogs/logo.ts +3 -3
- package/src/catalogs/parts/forms.ts +32 -0
- package/src/catalogs/parts/html.ts +1 -1
- package/src/catalogs/parts/icons.ts +1 -1
- package/src/catalogs/parts/layout.ts +11 -0
- package/src/catalogs/parts/logo.ts +2 -2
- package/src/catalogs/parts/run.ts +1 -1
- package/src/catalogs/parts/scene.ts +6 -0
- package/src/catalogs/parts/structure.ts +2 -2
- package/src/catalogs/parts/toast.ts +1 -1
- package/src/catalogs/parts/typography.ts +1 -1
- package/src/catalogs/scene.ts +3 -3
- package/src/catalogs/shadcn.ts +6 -4
- package/src/catalogs/structure.ts +3 -3
- package/src/catalogs/ui.ts +4 -3
- package/src/catalogs.ts +9 -2
- package/src/ports.ts +1 -1
- package/src/renderer/BlokRenderer.tsx +9 -0
- package/src/renderer/addBlokComponents.test.tsx +8 -22
- package/src/renderer/baseCatalog.ts +7 -5
- package/src/renderer/bloks/components.test.tsx +2 -2
- package/src/renderer/bloks/control.tsx +133 -6
- package/src/renderer/bloks/flow.test.tsx +1 -1
- package/src/renderer/bloks/forms.tsx +126 -0
- package/src/renderer/bloks/html.tsx +2 -2
- package/src/renderer/bloks/index.ts +1 -1
- package/src/renderer/bloks/layout.tsx +28 -0
- package/src/renderer/bloks/logo/index.tsx +2 -2
- package/src/renderer/bloks/run/components.tsx +1 -1
- package/src/renderer/bloks/run/host.tsx +33 -3
- package/src/renderer/bloks/run/space.test.tsx +76 -0
- package/src/renderer/bloks/time.test.tsx +1 -1
- package/src/renderer/bloks/toast.tsx +1 -1
- package/src/renderer/bloks/typography.tsx +1 -1
- package/src/renderer/catalog.tsx +7 -31
- package/src/renderer/declare.test.ts +41 -0
- package/src/renderer/declare.ts +70 -32
- package/src/renderer/functions/v2/functions.test.ts +40 -1
- package/src/renderer/functions/v2/index.ts +47 -0
- package/src/renderer/runtime/catalog.ts +35 -10
- package/src/renderer/runtime/components.tsx +10 -1
- package/src/renderer/runtime/context.tsx +6 -0
- package/src/renderer/runtime/describe.ts +17 -4
- package/src/renderer/runtime/hooks.ts +1 -0
- package/src/renderer/runtime/index.ts +1 -0
- package/src/renderer/runtime/preflight.ts +5 -2
- package/src/renderer/runtime/resolution.test.ts +14 -0
- package/src/renderer/runtime/resolution.ts +15 -1
- package/src/renderer/runtime/task.ts +33 -4
- package/src/renderer/runtime/text.test.tsx +65 -0
- package/src/renderer/runtime/text.ts +88 -0
- package/src/renderer/runtime/types.ts +7 -2
- package/src/runtime.ts +0 -1
- package/src/scene.ts +2 -2
- package/src/shadcn.ts +8 -5
- package/src/spec/bsx_v2.json +3080 -2372
- package/src/spec/catalogs/base@3.json +13029 -0
- package/src/spec/catalogs/orkestrator@1.json +489 -0
- package/src/spec/catalogs.ts +257 -101
- package/src/spec/spec.test.ts +107 -21
- package/src/spec/vocabulary.json +73 -27
- package/src/spec/vocabulary.ts +36 -7
- package/dist/renderer/modules.d.ts +0 -4
- package/dist/renderer/modules.d.ts.map +0 -1
- package/dist/renderer/modules.js +0 -11
- package/dist/renderer/modules.js.map +0 -1
- package/dist/spec/catalogs/base@2.json +0 -222
- package/dist/spec/catalogs/base@2.json.js +0 -222
- package/dist/spec/catalogs/html@1.json +0 -308
- package/dist/spec/catalogs/html@1.json.js +0 -308
- package/dist/spec/catalogs/logo@1.json +0 -1687
- package/dist/spec/catalogs/logo@1.json.js +0 -1687
- package/dist/spec/catalogs/scene@1.json +0 -858
- package/dist/spec/catalogs/scene@1.json.js +0 -858
- package/dist/spec/catalogs/shadcn@1.json +0 -3860
- package/dist/spec/catalogs/shadcn@1.json.js +0 -3860
- package/dist/spec/catalogs/structure@1.json +0 -185
- package/dist/spec/catalogs/structure@1.json.js +0 -185
- package/dist/spec/catalogs/ui@1.json +0 -5349
- package/dist/spec/catalogs/ui@1.json.js +0 -5349
- package/src/renderer/modules.ts +0 -12
- package/src/spec/catalogs/base@2.json +0 -222
- package/src/spec/catalogs/html@1.json +0 -308
- package/src/spec/catalogs/logo@1.json +0 -1687
- package/src/spec/catalogs/scene@1.json +0 -858
- package/src/spec/catalogs/shadcn@1.json +0 -3860
- package/src/spec/catalogs/structure@1.json +0 -185
- package/src/spec/catalogs/ui@1.json +0 -5349
package/src/spec/vocabulary.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"vocab": 2,
|
|
3
|
-
"
|
|
3
|
+
"minor": 1,
|
|
4
|
+
"description": "The blok language, version 2: what a blok may read, call and store. The spec's parser, the server (rekuest_core, takt) and the renderer (orkestrator) load this file or are generated from it. The design is the blok-vocab-v2 proposal of 2026-10-25. Three layers, each versioned on its own: this language (vocab, and minor for what it gained since); the base catalog, everything every renderer draws; and the app catalogs that extend it with what one frontend draws beyond (see catalogs). A server holds a blok to the language alone, never to a catalog: whoever draws a blok checks it against the catalog it has, and an author's tooling checks it when asked.",
|
|
4
5
|
"roots": {
|
|
5
6
|
"data": {
|
|
6
7
|
"self": "The agent the blok belongs to: the declaring agent (agent blok), the sending agent (task blok), the executing agent (action blok). Shorthand for deps.self.",
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
"subscriptions": "subscriptions.<name>: a declared subscription's record (status, value, error); value is the latest payload, or the last `keep` payloads.",
|
|
10
11
|
"args": "args.<key>: what the blok is opened on: the item for an agent or custom blok, the task's args for a task or action blok.",
|
|
11
12
|
"task": "The task this blok is about: the sending task, or the run. A task record.",
|
|
13
|
+
"assign": "The run an assign blok prepares: assign.given.<key> (true for an argument the caller decided, which is locked), assign.missing (the keys of required arguments still empty) and assign.ready (nothing is missing).",
|
|
12
14
|
"event": "The payload a component hands its callback. Only inside a callback.",
|
|
13
15
|
"viewer": "{user, org, roles} of whoever is looking.",
|
|
14
16
|
"then": "The moment being viewed while time-travelling (an ISO 8601 datetime), null while live. A blok never reads the wall clock: a query passes then as an ordinary variable (variables={at: \"then\"}), <Time> measures relative time from it, and while it is set subscriptions pause (their history query, or the value at travel start, stale)."
|
|
@@ -20,13 +22,13 @@
|
|
|
20
22
|
"functions": ["cmp", "logic", "math", "str", "list", "obj", "val", "fmt", "time", "ui", "query"],
|
|
21
23
|
"future": ["mutations"]
|
|
22
24
|
},
|
|
23
|
-
"reserved": ["self", "deps", "queries", "subscriptions", "args", "task", "event", "viewer", "then", "error", "cmp", "logic", "math", "str", "list", "obj", "val", "fmt", "time", "ui", "query", "mutations"],
|
|
25
|
+
"reserved": ["self", "deps", "queries", "subscriptions", "args", "task", "assign", "event", "viewer", "then", "error", "cmp", "logic", "math", "str", "list", "obj", "val", "fmt", "time", "ui", "query", "mutations"],
|
|
24
26
|
"agent_segments": {
|
|
25
27
|
"description": "What follows an agent (self or deps.<key>): .<state>.<field> is state, .tasks.<action> the latest task of that action, .assets.<name> one of the agent's assets; deps.<key>.<action>(...) calls it.",
|
|
26
28
|
"tasks": "tasks",
|
|
27
29
|
"assets": "assets",
|
|
28
|
-
"fields": {"id": "The agent's id (a query variable: deps.robot.id).", "name": "The agent's name."},
|
|
29
|
-
"reserved_state_names": ["tasks", "assets", "id", "name"]
|
|
30
|
+
"fields": {"id": "The agent's id (a query variable: deps.robot.id).", "name": "The agent's name.", "connected": "Whether the agent is connected right now (true or false)."},
|
|
31
|
+
"reserved_state_names": ["tasks", "assets", "id", "name", "connected"]
|
|
30
32
|
},
|
|
31
33
|
"kinds": {
|
|
32
34
|
"agent": {
|
|
@@ -55,7 +57,7 @@
|
|
|
55
57
|
},
|
|
56
58
|
"assign": {
|
|
57
59
|
"description": "An action's own blok for starting a run of it (assign_bloks): shown before there is a task, with the arguments being filled in as args and the agents a run would get as deps.",
|
|
58
|
-
"roots": ["self", "deps", "args", "queries", "subscriptions", "viewer"],
|
|
60
|
+
"roots": ["self", "deps", "args", "assign", "queries", "subscriptions", "viewer"],
|
|
59
61
|
"locals": true,
|
|
60
62
|
"contexts": ["HTML", "SCENE"]
|
|
61
63
|
},
|
|
@@ -80,8 +82,9 @@
|
|
|
80
82
|
"description": "One shape for task, deps.<key>.tasks.<action>, self.tasks.<action> and every into name.",
|
|
81
83
|
"fields": [
|
|
82
84
|
{"key": "id", "kind": "STRING", "nullable": true, "description": "The task's id; null before it was started."},
|
|
83
|
-
{"key": "status", "kind": "STRING", "choices": ["idle", "queued", "running", "asking", "done", "failed", "cancelled"], "description": "Lowercase."},
|
|
84
|
-
{"key": "running", "kind": "BOOL", "description": "queued, running or
|
|
85
|
+
{"key": "status", "kind": "STRING", "choices": ["idle", "queued", "running", "asking", "paused", "done", "failed", "cancelled"], "description": "Lowercase."},
|
|
86
|
+
{"key": "running", "kind": "BOOL", "description": "Started and not ended: queued, running, asking or paused."},
|
|
87
|
+
{"key": "paused", "kind": "BOOL", "description": "Waiting for someone to resume it."},
|
|
85
88
|
{"key": "done", "kind": "BOOL"},
|
|
86
89
|
{"key": "failed", "kind": "BOOL"},
|
|
87
90
|
{"key": "progress", "kind": "INT", "description": "0 to 100."},
|
|
@@ -90,9 +93,14 @@
|
|
|
90
93
|
{"key": "args", "kind": "DICT", "description": "What it was called with, filled in by the renderer at dispatch."},
|
|
91
94
|
{"key": "ask", "kind": "DICT", "nullable": true, "children": [{"key": "question", "kind": "STRING"}, {"key": "form", "kind": "DICT"}], "description": "The open ask, or null."},
|
|
92
95
|
{"key": "answer", "kind": "DICT", "nullable": true, "description": "The values returned for the ask."},
|
|
93
|
-
{"key": "returns", "kind": "DICT", "description": "The latest yield, by return port key."}
|
|
96
|
+
{"key": "returns", "kind": "DICT", "description": "The latest yield, by return port key."},
|
|
97
|
+
{"key": "started_at", "kind": "STRING", "nullable": true, "description": "When it was started (an ISO 8601 datetime); null before."},
|
|
98
|
+
{"key": "ended_at", "kind": "STRING", "nullable": true, "description": "When it ended; null while it has not."},
|
|
99
|
+
{"key": "duration", "kind": "FLOAT", "nullable": true, "description": "Seconds from start to end; null while it has not ended (a blok never reads the wall clock: <Time> measures a running task)."},
|
|
100
|
+
{"key": "log", "kind": "LIST", "children": [{"key": "...", "kind": "DICT", "children": [{"key": "at", "kind": "STRING", "nullable": true}, {"key": "kind", "kind": "STRING"}, {"key": "message", "kind": "STRING", "nullable": true}]}], "description": "What it reported, oldest first: {at, kind, message} per entry, the latest hundred."},
|
|
101
|
+
{"key": "can", "kind": "DICT", "children": [{"key": "cancel", "kind": "BOOL"}, {"key": "pause", "kind": "BOOL"}, {"key": "resume", "kind": "BOOL"}, {"key": "step", "kind": "BOOL"}, {"key": "interrupt", "kind": "BOOL"}], "description": "What the viewer may do to the task right now: can.cancel says whether task.cancel() would be taken, and so on. All false for a record the blok started itself (an into name)."}
|
|
94
102
|
],
|
|
95
|
-
"idle": {"id": null, "status": "idle", "running": false, "done": false, "failed": false, "progress": 0, "message": null, "error": null, "args": {}, "ask": null, "answer": null, "returns": {}}
|
|
103
|
+
"idle": {"id": null, "status": "idle", "running": false, "done": false, "paused": false, "failed": false, "progress": 0, "message": null, "error": null, "args": {}, "ask": null, "answer": null, "returns": {}, "started_at": null, "ended_at": null, "duration": null, "log": [], "can": {"cancel": false, "pause": false, "resume": false, "step": false, "interrupt": false}}
|
|
96
104
|
},
|
|
97
105
|
"query": {
|
|
98
106
|
"description": "A declared query's record.",
|
|
@@ -112,6 +120,16 @@
|
|
|
112
120
|
{"key": "error", "kind": "STRING", "nullable": true}
|
|
113
121
|
]
|
|
114
122
|
},
|
|
123
|
+
"assign": {
|
|
124
|
+
"description": "What an assign blok knows of the run it prepares, besides args and deps.",
|
|
125
|
+
"fields": [
|
|
126
|
+
{"key": "given", "kind": "DICT", "description": "given.<key>: true for an argument the caller decided before the blok opened (a preset from a menu); it is locked, and <args /> leaves it out."},
|
|
127
|
+
{"key": "missing", "kind": "LIST", "children": [{"key": "...", "kind": "STRING"}], "description": "The keys of the required arguments that are still empty."},
|
|
128
|
+
{"key": "ready", "kind": "BOOL", "description": "True when no required argument is missing."},
|
|
129
|
+
{"key": "starting", "kind": "BOOL", "description": "True while assign.start() is being taken."},
|
|
130
|
+
{"key": "blocked", "kind": "STRING", "nullable": true, "description": "Why the run cannot start now, as a sentence (a dependency is not met, no agent fits); null when it can."}
|
|
131
|
+
]
|
|
132
|
+
},
|
|
115
133
|
"viewer": {
|
|
116
134
|
"description": "Exposes nothing beyond what the viewer's own token says.",
|
|
117
135
|
"fields": [
|
|
@@ -147,7 +165,7 @@
|
|
|
147
165
|
]
|
|
148
166
|
},
|
|
149
167
|
"functions": {
|
|
150
|
-
"description": "Pure functions by namespace, snake_case. Positional arguments map onto params in order. `lazy`: arguments are read only as needed. `effect`: allowed only as a callback's one thing (ui.*, task
|
|
168
|
+
"description": "Pure functions by namespace, snake_case. Positional arguments map onto params in order. `lazy`: arguments are read only as needed. `effect`: allowed only as a callback's one thing (ui.*, task.*, assign.start, query.*). `command`: an effect that changes the world (it acts on a task or starts one, and is recorded with it); an effect without it only changes what the viewer sees. A blok does nothing else: every other function is pure. `sees_status`: sees pending/failed instead of suspending. No function reads the wall clock. `null` says what the function does with a null argument (known absence); a missing path reads as null.",
|
|
151
169
|
"cmp.eq": {"params": [["a", "ANY"], ["b", "ANY"]], "returns": "BOOL", "description": "Deep JSON equality.", "null": "null equals only null"},
|
|
152
170
|
"cmp.ne": {"params": [["a", "ANY"], ["b", "ANY"]], "returns": "BOOL", "description": "Not deep-equal.", "null": "null equals only null"},
|
|
153
171
|
"cmp.gt": {"params": [["a", "ANY"], ["b", "ANY"]], "returns": "BOOL", "description": "a > b, numbers or strings.", "null": "false"},
|
|
@@ -230,11 +248,18 @@
|
|
|
230
248
|
"list.pluck": {"params": [["value", "LIST"], ["key", "STRING"]], "returns": "LIST", "null": "[]"},
|
|
231
249
|
"list.sort": {"params": [["value", "LIST"], ["key", "STRING", false], ["descending", "BOOL", false]], "returns": "LIST", "null": "[]; null entries sort last"},
|
|
232
250
|
"list.range": {"params": [["start", "INT"], ["end", "INT"], ["step", "INT", false]], "returns": "LIST", "null": "[]"},
|
|
251
|
+
"list.where": {"params": [["value", "LIST"], ["key", "STRING"], ["equals", "ANY", false]], "returns": "LIST", "description": "The items whose `key` (a dotted path) deep-equals `equals`; with `equals` left out, the items whose `key` is truthy.", "null": "[]"},
|
|
252
|
+
"list.find": {"params": [["value", "LIST"], ["key", "STRING"], ["equals", "ANY", false]], "returns": "ANY", "description": "The first item list.where would keep, or null.", "null": "null"},
|
|
253
|
+
"list.count": {"params": [["value", "LIST"], ["key", "STRING"], ["equals", "ANY", false]], "returns": "INT", "description": "How many items list.where would keep.", "null": "0"},
|
|
254
|
+
"list.concat": {"params": [["value", "LIST"], ["other", "LIST"]], "returns": "LIST", "description": "Both lists, one after the other.", "null": "a null list reads as empty"},
|
|
233
255
|
"obj.get": {"params": [["value", "DICT"], ["key", "STRING"], ["default", "ANY", false]], "returns": "ANY", "description": "A dotted key reads a nested field.", "null": "default"},
|
|
234
256
|
"obj.has": {"params": [["value", "DICT"], ["key", "STRING"]], "returns": "BOOL", "null": "false"},
|
|
235
257
|
"obj.keys": {"params": [["value", "DICT"]], "returns": "LIST", "null": "[]"},
|
|
236
258
|
"obj.values": {"params": [["value", "DICT"]], "returns": "LIST", "null": "[]"},
|
|
237
259
|
"obj.entries": {"params": [["value", "DICT"]], "returns": "LIST", "description": "[{key, value}, ...].", "null": "[]"},
|
|
260
|
+
"obj.merge": {"params": [["value", "DICT"], ["other", "DICT"]], "returns": "DICT", "description": "Both dicts as one; `other` wins where both have a key. Not deep.", "null": "a null dict reads as empty"},
|
|
261
|
+
"obj.pick": {"params": [["value", "DICT"], ["keys", "LIST"]], "returns": "DICT", "description": "Only these keys.", "null": "{}"},
|
|
262
|
+
"obj.omit": {"params": [["value", "DICT"], ["keys", "LIST"]], "returns": "DICT", "description": "All but these keys.", "null": "{}"},
|
|
238
263
|
"val.is_null": {"params": [["value", "ANY"]], "returns": "BOOL", "null": "true"},
|
|
239
264
|
"val.is_set": {"params": [["value", "ANY"]], "returns": "BOOL", "null": "false"},
|
|
240
265
|
"val.is_empty": {"params": [["value", "ANY"]], "returns": "BOOL", "description": "null, an empty string, list or object.", "null": "true"},
|
|
@@ -255,9 +280,17 @@
|
|
|
255
280
|
"fmt.quantity": {"params": [["value", "ANY"], ["unit", "STRING", false]], "returns": "STRING", "description": "A quantity ({magnitude, unit} or a number in `unit`), in its unit.", "null": "empty string"},
|
|
256
281
|
"fmt.duration": {"params": [["seconds", "FLOAT"]], "returns": "STRING", "description": "90 -> 1m 30s; negative durations keep their sign.", "null": "empty string"},
|
|
257
282
|
"time.diff": {"params": [["start", "STRING"], ["end", "STRING"]], "returns": "FLOAT", "description": "Seconds from start to end (ISO 8601 datetimes); negative when end is earlier. Pure: relative time to the viewed moment is the <Time> component's.", "null": "null"},
|
|
283
|
+
"time.add": {"params": [["value", "STRING"], ["seconds", "FLOAT"]], "returns": "STRING", "description": "The moment `seconds` after `value` (before, when negative), as an ISO 8601 datetime in UTC.", "null": "null"},
|
|
284
|
+
"time.before": {"params": [["a", "STRING"], ["b", "STRING"]], "returns": "BOOL", "description": "Whether moment a is earlier than b.", "null": "false"},
|
|
285
|
+
"time.after": {"params": [["a", "STRING"], ["b", "STRING"]], "returns": "BOOL", "description": "Whether moment a is later than b.", "null": "false"},
|
|
258
286
|
"ui.copy": {"params": [["text", "ANY"]], "returns": "ANY", "effect": true, "description": "Copies text to the viewer's clipboard: the only non-task effect.", "null": "copies an empty string"},
|
|
259
|
-
"task.answer": {"params": [["values", "DICT"]], "returns": "ANY", "effect": true, "task_operation": true, "description": "Answers the open ask of `task`. Counts as a task operation.", "null": "answers with no values"},
|
|
260
|
-
"
|
|
287
|
+
"task.answer": {"params": [["values", "DICT"]], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Answers the open ask of `task`. Counts as a task operation.", "null": "answers with no values"},
|
|
288
|
+
"task.cancel": {"params": [], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Cancels the run `task` is about. Refused while `task.can.cancel` is false, and while the blok shows the past. Counts as a task operation.", "null": "takes no arguments"},
|
|
289
|
+
"task.pause": {"params": [], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Pauses the run `task` is about: it waits until someone resumes it. Refused while `task.can.pause` is false, and while the blok shows the past. Counts as a task operation.", "null": "takes no arguments"},
|
|
290
|
+
"task.resume": {"params": [], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Resumes the run `task` is about, after a pause. Refused while `task.can.resume` is false, and while the blok shows the past. Counts as a task operation.", "null": "takes no arguments"},
|
|
291
|
+
"task.step": {"params": [], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Resumes the run `task` is about until its next breakpoint. Refused while `task.can.step` is false, and while the blok shows the past. Counts as a task operation.", "null": "takes no arguments"},
|
|
292
|
+
"task.interrupt": {"params": [], "returns": "ANY", "effect": true, "command": true, "task_operation": true, "description": "Interrupts the run `task` is about: stopped at once, without waiting for it to wind down. Refused while `task.can.interrupt` is false, and while the blok shows the past. Counts as a task operation.", "null": "takes no arguments"},
|
|
293
|
+
"assign.start": {"params": [], "returns": "ANY", "effect": true, "command": true, "description": "Starts the run an assign blok prepares, with the arguments as they are filled in and the agents the blok was shown (deps) pinned. An assign blok only.", "null": "starts the run"},
|
|
261
294
|
"query.refetch": {"params": [["query", "STRING"]], "returns": "ANY", "effect": true, "description": "Re-reads the declared query named by the literal `query`; never suspends, queries.<name>.refetching is true meanwhile. BSX writes it queries.<name>.refetch().", "null": "refused: the query is named by a literal"},
|
|
262
295
|
"query.fetch_more": {"params": [["query", "STRING"], ["variables", "DICT", false]], "returns": "ANY", "effect": true, "description": "Reads the next page of the declared query named by the literal `query`, its variables overridden by `variables`, and appends the page's list at the query's `more` field to what is shown; queries.<name>.fetching_more is true meanwhile. BSX writes it queries.<name>.fetch_more(name: value, ...). Refused on a query without `more`.", "null": "refused: the query is named by a literal; null variables fetch with the query's own"}
|
|
263
296
|
},
|
|
@@ -283,12 +316,12 @@
|
|
|
283
316
|
},
|
|
284
317
|
"stored_tree": {
|
|
285
318
|
"description": "How a v2 blok is stored: ComponentNodeInput {id, component, props?, children?}; ComponentPropInput {key, static_value? | dynamic_value {path} | util_call | agent_call (+ declares_value)}; ActionArgumentInput {key?, value_literal? | value_path? | util_call? | value_list? | value_dict?}. A prop or argument with no value field is null.",
|
|
286
|
-
"ids": "An explicit id matches explicit_id; a derived id is the parent's id plus /<Component>[<n>] (n: occurrence among same-named siblings), the root's <Component>[0]. A derived id always ends in ']'.
|
|
319
|
+
"ids": "An explicit id matches explicit_id; a derived id is the parent's id plus /<Component>[<n>] (n: occurrence among same-named siblings), the root's <Component>[0]. A derived id always ends in ']'. A text node is <parent>/#<n> (n: text-run index) and nothing may target it.",
|
|
287
320
|
"explicit_id": "^[A-Za-z_][A-Za-z0-9_.:-]*$",
|
|
288
321
|
"foreach": "foreach props: items (expression), let (static_value and declares_value the name), key (expression, optional). With a key each item's subtree takes its runtime ids from it: <id>@<key>; without one, from its position: <id>@#<n> (n: the 0-based index). A foreach without key is stored with no key prop at all; the validator warns foreach.position_key when its items are known not to be scalars.",
|
|
289
322
|
"if": "if props: when; children: the then-branch, then the else nodes (component else, an else-if with a when prop; only the last else may lack when).",
|
|
290
323
|
"into": "agent_call prop with declares_value <name>: a task record only that call writes. Allowed inside foreach; one name is written by one call site.",
|
|
291
|
-
"text": "Text
|
|
324
|
+
"text": "Text is a child like any other: each run of text between elements is stored as a node {id: <parent>/#<n>, component: \"#text\", props: [value]}, its value a literal or an expression; several parts of one run desugar to str.template(template, values). No element can be called #text, so only text makes one. Parsing needs no catalog. What a component does with its text is its renderer's: one with a text_prop makes its text children that prop (a Button its label), any other that takes children draws them in place; a component that sets its text_prop as an attribute too, or takes neither text nor children, is a catalog finding (catalog.text). A tree stored before text was a node holds the text_prop itself, and implicit Text or span nodes under the same ids: a renderer draws both."
|
|
292
325
|
},
|
|
293
326
|
"locals": {
|
|
294
327
|
"description": "Blok-level form state that feeds a call: a local is an arg port (key, kind, identifier, nullable, default, children, choices, validators, description, ...) plus persist, written only through `bind` on controls, read bare. persist remembers the last input on this device. Its kind is a port kind or ANY; left out on the wire it is inferred (kind_inference) and the stored local always carries one.",
|
|
@@ -337,9 +370,22 @@
|
|
|
337
370
|
"logo_path_data_props": ["d", "points"]
|
|
338
371
|
},
|
|
339
372
|
"catalogs": {
|
|
340
|
-
"description": "
|
|
341
|
-
"base":
|
|
342
|
-
"
|
|
373
|
+
"description": "A catalog is a versioned set of components. The base catalog is what every renderer draws, whole, in the contexts it draws (HTML, SCENE, LOGO): a blok written for it runs everywhere. An app catalog extends another (in the end the base) with what one frontend draws beyond it; it is that frontend's to publish. A catalog is named by the address it is published at (its id); a blok names the one catalog it is written for (catalog), the base when it names none, and may record the minor it needs (catalog_minor). A version only ever gains components and props: each says the minor that added it (since), so a blok valid at v1.2 stays valid. A renderer reports the catalogs and minors it speaks; what it lacks it draws as a placeholder, and reports. A catalog never redefines a component of the one it extends. Nobody's server fetches a catalog: it holds what a frontend registered under the id, and an author's tooling resolves an id from what ships with it, from its cache, or by fetching it.",
|
|
374
|
+
"base": "https://arkitekt.live/catalogs/base/v3",
|
|
375
|
+
"bundled": {"https://arkitekt.live/catalogs/base/v3": "catalogs/base@3.json", "https://arkitekt.live/catalogs/orkestrator/v1": "catalogs/orkestrator@1.json"},
|
|
376
|
+
"id": "^https://[^\\s/]+(/[^\\s/]+)*/v[0-9]+$",
|
|
377
|
+
"name": "^[A-Za-z_][A-Za-z0-9_.-]*$",
|
|
378
|
+
"host_parts": {
|
|
379
|
+
"description": "Parts of the host's own interface a blok may place itself: placing one anywhere in the tree claims it, and the host then draws none of its own. The claim is read off the stored tree, so a part inside an inactive <if> still claims it (part.conditional). What a blok does not place, the host still draws, unless its root says chrome=\"none\".",
|
|
380
|
+
"parts": ["args", "arg", "deps", "dep", "ask", "returns", "status", "timeline"]
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"classes": {
|
|
384
|
+
"description": "The classes a blok may rely on in every renderer: the portable subset. A renderer without CSS (React Native) draws these and may ignore the rest, so a class outside the subset is a warning (class.not_portable), never an error. Listed is what is NOT portable: what changes the layout or the content when it is ignored. Every other utility and variant is portable, those a small touch renderer simply has no use for included (hover:, focus-visible:, cursor-*, the breakpoints sm: md: lg:): nothing is lost without them. Laying out in a grid is the Grid component's; space-x-* and space-y-* are drawn as the gap they come to.",
|
|
385
|
+
"variants": ["before", "after", "first-letter", "first-line", "marker", "selection", "file", "backdrop", "has", "group-has", "peer-has", "supports", "print", "target"],
|
|
386
|
+
"utilities": ["grid-cols", "grid-rows", "grid-flow", "col-span", "col-start", "col-end", "row-span", "row-start", "row-end", "auto-cols", "auto-rows", "divide-x", "divide-y", "float", "clear", "columns", "break-before", "break-after", "break-inside", "box-decoration", "table", "caption", "border-collapse", "border-separate", "border-spacing", "list", "snap", "mix-blend", "bg-blend", "backdrop", "filter", "blur", "brightness", "contrast", "grayscale", "hue-rotate", "invert", "saturate", "sepia", "drop-shadow", "mask"],
|
|
387
|
+
"arbitrary": "A value in brackets is portable on the utilities arbitrary_values lists (w-[12rem], gap-[6px], bg-[#1e293b]): a size, a spacing, a radius, a border, a font size, a colour, an opacity or a stacking order, written as a length (px, rem, %), a number or a colour (#hex, rgb(), hsl()). A renderer that compiles its classes ahead of time translates these itself. Nothing else in brackets is portable: an arbitrary property ([mask-type:luminance]), an arbitrary variant ([&>*]:p-2), or a value on any other utility (translate-x-[3px], grid-cols-[1fr_2fr]).",
|
|
388
|
+
"arbitrary_values": ["w", "h", "size", "min-w", "max-w", "min-h", "max-h", "basis", "p", "px", "py", "pt", "pr", "pb", "pl", "m", "mx", "my", "mt", "mr", "mb", "ml", "gap", "gap-x", "gap-y", "inset", "inset-x", "inset-y", "top", "right", "bottom", "left", "space-x", "space-y", "rounded", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl", "border", "border-t", "border-r", "border-b", "border-l", "border-x", "border-y", "text", "bg", "leading", "tracking", "opacity", "z", "flex", "grow", "shrink", "aspect"]
|
|
343
389
|
},
|
|
344
390
|
"diagnostics": {
|
|
345
391
|
"description": "One table of stable codes, the same in Python, Rust and TypeScript. level: error refuses the blok, warning is reported; runtime: true marks a code no checker raises, the renderer's error code of a record (deps.unbound). Messages are str.format templates; parity compares codes, never text.",
|
|
@@ -351,10 +397,6 @@
|
|
|
351
397
|
"bsx.duplicate_attribute": {"level": "error", "message": "<{component}> sets {key} twice.", "hint": "Keep one {key}; to choose between values, write one expression (c ? a : b)."},
|
|
352
398
|
"bsx.id": {"level": "error", "message": "id {id!r} is not an explicit id: letters, digits and _ . : -, starting with a letter or _."},
|
|
353
399
|
"bsx.duplicate_id": {"level": "error", "message": "Two components have the id {id!r}.", "hint": "Give each component its own id, or drop id= and let the structure name it."},
|
|
354
|
-
"bsx.text_not_accepted": {"level": "error", "message": "<{component}> takes no text (it declares no text_prop): {text!r}. Wrap the text in a component that does, such as <p>, <span> or <Text>."},
|
|
355
|
-
"bsx.text_unknown_component": {"level": "error", "message": "<{component}> is in no catalog the parser knows, so its text has nowhere to go: {text!r}. Pass it as a prop."},
|
|
356
|
-
"bsx.text_in_context": {"level": "error", "message": "Text in <{component}> is in the {context} context, which draws no text: {text!r}."},
|
|
357
|
-
"bsx.text_and_prop": {"level": "error", "message": "<{component}> sets {key} as an attribute and as its text.", "hint": "Set {key} once: either as the attribute or as the text between the tags."},
|
|
358
400
|
"bsx.text_callback": {"level": "error", "message": "Text holds a call or an effect; only a callback prop may.", "hint": "Put the call in a callback prop (onClick={{...}}), never between tags."},
|
|
359
401
|
"bsx.else_outside_if": {"level": "error", "message": "<else> is a child of <if>, after its then-branch.", "hint": "Move the <else> inside its <if>, after the then-branch children."},
|
|
360
402
|
"bsx.else_order": {"level": "error", "message": "<else> comes after the then-branch, and only the last <else> may lack when.", "hint": "Put the <else> branches last in the <if>; only the final one may leave out when."},
|
|
@@ -424,20 +466,24 @@
|
|
|
424
466
|
"context.root_unknown": {"level": "error", "message": "A blok's root names its context ({roots}), not <{component}>.", "hint": "Make the root one of {roots} and put <{component}> inside it."},
|
|
425
467
|
"context.kind": {"level": "error", "message": "A{n} {kind} blok is drawn in {contexts}, not {context}."},
|
|
426
468
|
"assign.kind": {"level": "error", "message": "{what} belongs to starting a run, so only an action's assign blok holds it, not a{n} {kind} blok.", "hint": "Declare it with the action: @app.workflow(assign_bloks=[...])."},
|
|
427
|
-
"space.kind": {"level": "error", "message": "<{component}> places the run's dependencies, so only an action's own blok holds it, not a{n} {kind} blok.", "hint": "Declare it with the action: @app.workflow(bloks=[...])."},
|
|
428
469
|
"logo.complexity": {"level": "error", "message": "{detail}"},
|
|
429
|
-
"catalog.unknown_component": {"level": "warning", "message": "<{component}> is in
|
|
430
|
-
"catalog.undeclared": {"level": "warning", "message": "<{component}> is from {catalog}, which the blok does not declare in its catalogs.", "hint": "Add {catalog} to the blok's catalogs."},
|
|
470
|
+
"catalog.unknown_component": {"level": "warning", "message": "<{component}> is not in the catalog the blok is written for ({catalogs}).", "hint": "Look the component up in the catalog; names are case-sensitive."},
|
|
431
471
|
"catalog.children": {"level": "warning", "message": "<{component}> takes no children.", "hint": "Close <{component}> without children (<{component} ... />), or put them beside it."},
|
|
472
|
+
"catalog.text": {"level": "warning", "message": "<{component}> {detail}", "hint": "Put the text in a component that draws it (<Text>, <p>, <span>), or set it once."},
|
|
432
473
|
"catalog.props": {"level": "warning", "message": "<{component}> {detail}", "hint": "Use the props the catalog lists for <{component}>, exactly as named."},
|
|
433
474
|
"catalog.placement": {"level": "warning", "message": "<{component}> {detail}", "hint": "Move <{component}> where the catalog places it (its inside / never inside rules)."},
|
|
434
475
|
"catalog.value": {"level": "warning", "message": "{key}=\"{value}\" is not a value <{component}> draws: one of {values}.", "hint": "Write one of {values}."},
|
|
435
476
|
"catalog.asset": {"level": "warning", "message": "{key} of <{component}> names an asset as <agent>.assets.<name>.", "hint": "Write {key}={{self.assets.<name>}} with an asset the app registered."},
|
|
436
|
-
"catalog.
|
|
437
|
-
"
|
|
477
|
+
"catalog.target": {"level": "error", "message": "<{component}> is of {catalog}, and this blok is written for {target}.", "hint": "Name the catalog it is written for (catalog=\"{catalog}\"), or use what {target} draws."},
|
|
478
|
+
"catalog.unknown": {"level": "warning", "message": "The catalog {catalog!r} is not known here ({catalogs}), so what it adds to the base catalog is not checked.", "hint": "Register the catalog with the tooling, or check the address."},
|
|
479
|
+
"catalog.kind": {"level": "error", "message": "<{component}> belongs to {kinds} bloks, not to a{n} {kind} blok.", "hint": "Declare it with the action: @app.workflow(bloks=[...]) for a run, assign_bloks=[...] for starting one."},
|
|
480
|
+
"catalog.context": {"level": "warning", "message": "<{component}> needs the {service} service where it is drawn; without it a notice shows in its place."},
|
|
481
|
+
"part.conditional": {"level": "warning", "message": "<{component}> is inside <{inside}>: placing it anywhere claims it, so the host draws none of its own even while this one does not show.", "hint": "Place <{component}> outside <{inside}>, or hide what is around it instead."},
|
|
482
|
+
"chrome.no_ask": {"level": "warning", "message": "chrome=\"none\" leaves the run's asks to the blok, and it places no <ask />: an ask can then only be answered elsewhere.", "hint": "Place <ask /> where the run's questions should show, or answer task.ask with task.answer(values: ...)."},
|
|
483
|
+
"class.not_portable": {"level": "warning", "message": "{token}: {what} is not in the portable subset, so a renderer without CSS ignores it.", "hint": "Keep what the class does optional, or use a component for it."},
|
|
438
484
|
"deps.unbound": {"level": "error", "runtime": true, "message": "deps.{key} is bound to no agent, so it reads as failed."},
|
|
439
485
|
"manifest.sent": {"level": "error", "message": "A blok is sent as its components or as its BSX source, {problem}."},
|
|
440
|
-
"manifest.catalog": {"level": "error", "message": "Catalog {catalog!r} is
|
|
486
|
+
"manifest.catalog": {"level": "error", "message": "Catalog {catalog!r} is neither the address a catalog is published at (https://arkitekt.live/catalogs/orkestrator/v1) nor the name of one registered in the organization."},
|
|
441
487
|
"manifest.duplicate": {"level": "error", "message": "{what}: {key!r} is declared twice."},
|
|
442
488
|
"manifest.name": {"level": "error", "message": "{what}: {key!r} is not a name."},
|
|
443
489
|
"manifest.action_logo": {"level": "error", "message": "An action logo reads only the task it is drawn against: no locals, queries, subscriptions or dependencies."},
|
package/src/spec/vocabulary.ts
CHANGED
|
@@ -25,6 +25,10 @@ export type VocabFunction = {
|
|
|
25
25
|
lazy: boolean;
|
|
26
26
|
/** Allowed only as a callback's one thing (`ui.copy`, `task.answer`, `query.refetch`). */
|
|
27
27
|
effect: boolean;
|
|
28
|
+
/** An effect that changes the world (acts on a task, or starts one); an effect without it only changes what the viewer sees. */
|
|
29
|
+
command: boolean;
|
|
30
|
+
/** Acts on the task the blok is about (`task.answer`, `task.cancel`): only where the blok reads one. */
|
|
31
|
+
taskOperation: boolean;
|
|
28
32
|
/** Sees a pending or failed argument instead of suspending. */
|
|
29
33
|
seesStatus: boolean;
|
|
30
34
|
/** The parameter names, in positional order. */
|
|
@@ -142,6 +146,8 @@ export type VocabLimits = {
|
|
|
142
146
|
|
|
143
147
|
export type BlokVocabulary = {
|
|
144
148
|
vocab: number;
|
|
149
|
+
/** How far the language has grown within `vocab`: it only ever gains. */
|
|
150
|
+
minor: number;
|
|
145
151
|
/** `self deps queries subscriptions args task event viewer then`, with what each means. */
|
|
146
152
|
dataRoots: Readonly<Record<string, string>>;
|
|
147
153
|
/** Roots bound only somewhere: `event` (a callback), `error` (an `<error>` slot). */
|
|
@@ -172,9 +178,21 @@ export type BlokVocabulary = {
|
|
|
172
178
|
theme: VocabTheme;
|
|
173
179
|
limits: VocabLimits;
|
|
174
180
|
locals: VocabLocals;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
catalogs
|
|
181
|
+
/** The id of the base catalog: what a blok is written for when it names no catalog. */
|
|
182
|
+
baseCatalog: string;
|
|
183
|
+
/** The catalogs that ship with the vocabulary, id → file (the base catalog first). */
|
|
184
|
+
bundledCatalogs: Readonly<Record<string, string>>;
|
|
185
|
+
/** What a published catalog's id looks like: the https address it is published at, ending in its version. */
|
|
186
|
+
catalogId: RegExp;
|
|
187
|
+
/** What the name of a catalog registered in an organization looks like. */
|
|
188
|
+
catalogName: RegExp;
|
|
189
|
+
/** The components that place a part of the host's own interface (`args`, `timeline`). */
|
|
190
|
+
hostParts: readonly string[];
|
|
191
|
+
/** Class variants and utility prefixes outside the portable subset (`class.not_portable`). */
|
|
192
|
+
unportableVariants: ReadonlySet<string>;
|
|
193
|
+
unportableUtilities: readonly string[];
|
|
194
|
+
/** The utilities whose value may be written in brackets (`w-[12rem]`) and stay portable. */
|
|
195
|
+
arbitraryValues: ReadonlySet<string>;
|
|
178
196
|
diagnostics: ReadonlyMap<string, VocabDiagnostic>;
|
|
179
197
|
};
|
|
180
198
|
|
|
@@ -257,6 +275,8 @@ const parseFunction = (name: string, raw: unknown): VocabFunction => {
|
|
|
257
275
|
null: typeof entry.null === 'string' ? entry.null : '',
|
|
258
276
|
lazy: entry.lazy === true,
|
|
259
277
|
effect: entry.effect === true,
|
|
278
|
+
command: entry.command === true,
|
|
279
|
+
taskOperation: entry.task_operation === true,
|
|
260
280
|
seesStatus: entry.sees_status === true,
|
|
261
281
|
keys: params.map(param => param.key),
|
|
262
282
|
requiredKeys: params.filter(param => param.required).map(param => param.key),
|
|
@@ -324,6 +344,10 @@ export const parseVocabulary = (raw: unknown): BlokVocabulary => {
|
|
|
324
344
|
const limits = object(root.limits, 'limits');
|
|
325
345
|
const catalogs = object(root.catalogs, 'catalogs');
|
|
326
346
|
const locals = object(root.locals, 'locals');
|
|
347
|
+
const classes = object(root.classes, 'classes');
|
|
348
|
+
const bundledCatalogs = stringMap(catalogs.bundled, 'catalogs.bundled');
|
|
349
|
+
const baseCatalog = string(catalogs.base, 'catalogs.base');
|
|
350
|
+
if (!(baseCatalog in bundledCatalogs)) throw new Error('vocabulary.json: the base catalog is not among the bundled ones');
|
|
327
351
|
|
|
328
352
|
const diagnosticsRaw = object(root.diagnostics, 'diagnostics');
|
|
329
353
|
const diagnostics = new Map<string, VocabDiagnostic>();
|
|
@@ -340,6 +364,7 @@ export const parseVocabulary = (raw: unknown): BlokVocabulary => {
|
|
|
340
364
|
|
|
341
365
|
return {
|
|
342
366
|
vocab: number(root.vocab, 'vocab'),
|
|
367
|
+
minor: root.minor === undefined ? 0 : number(root.minor, 'minor'),
|
|
343
368
|
dataRoots: stringMap(roots.data, 'roots.data'),
|
|
344
369
|
scopedRoots: stringMap(roots.scoped, 'roots.scoped'),
|
|
345
370
|
functionNamespaces: strings(roots.functions, 'roots.functions'),
|
|
@@ -388,10 +413,14 @@ export const parseVocabulary = (raw: unknown): BlokVocabulary => {
|
|
|
388
413
|
bindKinds: kindTable(locals.bind_kinds, 'locals.bind_kinds'),
|
|
389
414
|
argKinds: kindTable(locals.arg_kinds, 'locals.arg_kinds'),
|
|
390
415
|
},
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
),
|
|
416
|
+
baseCatalog,
|
|
417
|
+
bundledCatalogs,
|
|
418
|
+
catalogId: new RegExp(string(catalogs.id, 'catalogs.id')),
|
|
419
|
+
catalogName: new RegExp(string(catalogs.name, 'catalogs.name')),
|
|
420
|
+
hostParts: strings(object(catalogs.host_parts, 'catalogs.host_parts').parts, 'catalogs.host_parts.parts'),
|
|
421
|
+
unportableVariants: new Set(strings(classes.variants, 'classes.variants')),
|
|
422
|
+
unportableUtilities: strings(classes.utilities, 'classes.utilities'),
|
|
423
|
+
arbitraryValues: new Set(strings(classes.arbitrary_values, 'classes.arbitrary_values')),
|
|
395
424
|
diagnostics,
|
|
396
425
|
};
|
|
397
426
|
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { BlokCatalog } from './runtime';
|
|
2
|
-
/** Per catalog, the global component names a module drew over (`addBlokComponents`): those the module's own definition renders. */
|
|
3
|
-
export declare const moduleShadowsOf: (catalog: BlokCatalog) => Set<string>;
|
|
4
|
-
//# sourceMappingURL=modules.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/renderer/modules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAI3C,mIAAmI;AACnI,eAAO,MAAM,eAAe,GAAI,SAAS,WAAW,KAAG,GAAG,CAAC,MAAM,CAMhE,CAAC"}
|
package/dist/renderer/modules.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const moduleShadows = new WeakMap();
|
|
2
|
-
/** Per catalog, the global component names a module drew over (`addBlokComponents`): those the module's own definition renders. */
|
|
3
|
-
export const moduleShadowsOf = (catalog) => {
|
|
4
|
-
const found = moduleShadows.get(catalog);
|
|
5
|
-
if (found)
|
|
6
|
-
return found;
|
|
7
|
-
const created = new Set();
|
|
8
|
-
moduleShadows.set(catalog, created);
|
|
9
|
-
return created;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=modules.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../../src/renderer/modules.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,IAAI,OAAO,EAA4B,CAAC;AAE9D,mIAAmI;AACnI,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAoB,EAAe,EAAE;IACnE,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "base",
|
|
3
|
-
"version": 2,
|
|
4
|
-
"description": "The language: control flow, async boundaries and the task protocol. Every renderer implements it; functions and effects are in vocabulary.json.",
|
|
5
|
-
"components": [
|
|
6
|
-
{
|
|
7
|
-
"name": "Html",
|
|
8
|
-
"description": "The root of an html blok (a panel, a dashboard, a popout's page): lays its children out as a fragment does, and names the blok's context.",
|
|
9
|
-
"context": "HTML",
|
|
10
|
-
"children_context": null,
|
|
11
|
-
"inherits_context": false,
|
|
12
|
-
"accepts_children": true,
|
|
13
|
-
"downstream_of": [],
|
|
14
|
-
"not_downstream_of": [
|
|
15
|
-
"Html"
|
|
16
|
-
],
|
|
17
|
-
"text_prop": null,
|
|
18
|
-
"props": []
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "args",
|
|
22
|
-
"description": "The arguments of the run an assign blok starts, as the form the action's ports generate: filled in right here, and read as `args.<key>`. Without it the host shows the form beside the blok. An assign blok only.",
|
|
23
|
-
"context": "HTML",
|
|
24
|
-
"children_context": null,
|
|
25
|
-
"inherits_context": false,
|
|
26
|
-
"accepts_children": false,
|
|
27
|
-
"downstream_of": [],
|
|
28
|
-
"not_downstream_of": [],
|
|
29
|
-
"text_prop": null,
|
|
30
|
-
"props": []
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"name": "ask",
|
|
34
|
-
"description": "The open ask of the task this blok is about (`task.ask`), as the form its ports generate: answered right here, which resumes the task. Shows nothing while no ask is open. Replaces TaskAsk.",
|
|
35
|
-
"context": "HTML",
|
|
36
|
-
"children_context": null,
|
|
37
|
-
"inherits_context": false,
|
|
38
|
-
"accepts_children": false,
|
|
39
|
-
"downstream_of": [],
|
|
40
|
-
"not_downstream_of": [],
|
|
41
|
-
"text_prop": null,
|
|
42
|
-
"props": []
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"name": "case",
|
|
46
|
-
"description": "One branch of a `match`: its children render when the matched value is `is`.",
|
|
47
|
-
"context": "HTML",
|
|
48
|
-
"children_context": null,
|
|
49
|
-
"inherits_context": true,
|
|
50
|
-
"accepts_children": true,
|
|
51
|
-
"downstream_of": [
|
|
52
|
-
"match"
|
|
53
|
-
],
|
|
54
|
-
"not_downstream_of": [],
|
|
55
|
-
"text_prop": null,
|
|
56
|
-
"props": [
|
|
57
|
-
{
|
|
58
|
-
"key": "is",
|
|
59
|
-
"kind": "ANY",
|
|
60
|
-
"required": false,
|
|
61
|
-
"description": "The literal this case matches, or a list of them."
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"name": "default",
|
|
67
|
-
"description": "The branch of a `match` that renders when no `case` matches.",
|
|
68
|
-
"context": "HTML",
|
|
69
|
-
"children_context": null,
|
|
70
|
-
"inherits_context": true,
|
|
71
|
-
"accepts_children": true,
|
|
72
|
-
"downstream_of": [
|
|
73
|
-
"match"
|
|
74
|
-
],
|
|
75
|
-
"not_downstream_of": [],
|
|
76
|
-
"text_prop": null,
|
|
77
|
-
"props": []
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"name": "else",
|
|
81
|
-
"description": "A branch of its `if`: an else-if with `when`, the default without. Only the last `else` may go without `when`.",
|
|
82
|
-
"context": "HTML",
|
|
83
|
-
"children_context": null,
|
|
84
|
-
"inherits_context": true,
|
|
85
|
-
"accepts_children": true,
|
|
86
|
-
"downstream_of": [
|
|
87
|
-
"if"
|
|
88
|
-
],
|
|
89
|
-
"not_downstream_of": [],
|
|
90
|
-
"text_prop": null,
|
|
91
|
-
"props": [
|
|
92
|
-
{
|
|
93
|
-
"key": "when",
|
|
94
|
-
"kind": "BOOL",
|
|
95
|
-
"required": false,
|
|
96
|
-
"description": "The else-if condition; the default branch when absent."
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"name": "error",
|
|
102
|
-
"description": "What a `suspense` shows when a read inside it failed; the error is readable as `error` (`error.message`).",
|
|
103
|
-
"context": "HTML",
|
|
104
|
-
"children_context": null,
|
|
105
|
-
"inherits_context": true,
|
|
106
|
-
"accepts_children": true,
|
|
107
|
-
"downstream_of": [
|
|
108
|
-
"suspense"
|
|
109
|
-
],
|
|
110
|
-
"not_downstream_of": [],
|
|
111
|
-
"text_prop": null,
|
|
112
|
-
"props": []
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"name": "fallback",
|
|
116
|
-
"description": "What a `suspense` shows while a read inside it is pending.",
|
|
117
|
-
"context": "HTML",
|
|
118
|
-
"children_context": null,
|
|
119
|
-
"inherits_context": true,
|
|
120
|
-
"accepts_children": true,
|
|
121
|
-
"downstream_of": [
|
|
122
|
-
"suspense"
|
|
123
|
-
],
|
|
124
|
-
"not_downstream_of": [],
|
|
125
|
-
"text_prop": null,
|
|
126
|
-
"props": []
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"name": "foreach",
|
|
130
|
-
"description": "Renders its children once per item, the item bound to `let`; each item's subtree takes its ids from `key`, or from its position without one.",
|
|
131
|
-
"context": "HTML",
|
|
132
|
-
"children_context": null,
|
|
133
|
-
"inherits_context": true,
|
|
134
|
-
"accepts_children": true,
|
|
135
|
-
"downstream_of": [],
|
|
136
|
-
"not_downstream_of": [],
|
|
137
|
-
"text_prop": null,
|
|
138
|
-
"props": [
|
|
139
|
-
{
|
|
140
|
-
"key": "items",
|
|
141
|
-
"kind": "ANY",
|
|
142
|
-
"required": true,
|
|
143
|
-
"description": "The list to iterate."
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"key": "key",
|
|
147
|
-
"kind": "ANY",
|
|
148
|
-
"required": false,
|
|
149
|
-
"description": "A stable key per item (`key={p.id}`): what an item's ids, kept values and diffs follow. Left out, items are keyed by their position (<id>@#<n>), which suits scalars only."
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"key": "let",
|
|
153
|
-
"kind": "STRING",
|
|
154
|
-
"required": true,
|
|
155
|
-
"description": "The loop variable: a plain name, read bare inside."
|
|
156
|
-
}
|
|
157
|
-
]
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"name": "fragment",
|
|
161
|
-
"description": "Groups children without rendering anything of its own.",
|
|
162
|
-
"context": "HTML",
|
|
163
|
-
"children_context": null,
|
|
164
|
-
"inherits_context": true,
|
|
165
|
-
"accepts_children": true,
|
|
166
|
-
"downstream_of": [],
|
|
167
|
-
"not_downstream_of": [],
|
|
168
|
-
"text_prop": null,
|
|
169
|
-
"props": []
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"name": "if",
|
|
173
|
-
"description": "Renders its children (the then-branch) when `when` holds; its trailing `else` children are the else-if and default branches. Only the active branch is rendered and read.",
|
|
174
|
-
"context": "HTML",
|
|
175
|
-
"children_context": null,
|
|
176
|
-
"inherits_context": true,
|
|
177
|
-
"accepts_children": true,
|
|
178
|
-
"downstream_of": [],
|
|
179
|
-
"not_downstream_of": [],
|
|
180
|
-
"text_prop": null,
|
|
181
|
-
"props": [
|
|
182
|
-
{
|
|
183
|
-
"key": "when",
|
|
184
|
-
"kind": "BOOL",
|
|
185
|
-
"required": true,
|
|
186
|
-
"description": "The condition."
|
|
187
|
-
}
|
|
188
|
-
]
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
"name": "match",
|
|
192
|
-
"description": "Renders the first `case` whose `is` equals `value`, else its `default`.",
|
|
193
|
-
"context": "HTML",
|
|
194
|
-
"children_context": null,
|
|
195
|
-
"inherits_context": true,
|
|
196
|
-
"accepts_children": true,
|
|
197
|
-
"downstream_of": [],
|
|
198
|
-
"not_downstream_of": [],
|
|
199
|
-
"text_prop": null,
|
|
200
|
-
"props": [
|
|
201
|
-
{
|
|
202
|
-
"key": "value",
|
|
203
|
-
"kind": "ANY",
|
|
204
|
-
"required": true,
|
|
205
|
-
"description": "The value matched."
|
|
206
|
-
}
|
|
207
|
-
]
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"name": "suspense",
|
|
211
|
-
"description": "A boundary: while any read inside is pending it shows its `fallback`, when one failed its `error` (with the error as `error`); stale values render, dimmed. The nearest boundary catches.",
|
|
212
|
-
"context": "HTML",
|
|
213
|
-
"children_context": null,
|
|
214
|
-
"inherits_context": true,
|
|
215
|
-
"accepts_children": true,
|
|
216
|
-
"downstream_of": [],
|
|
217
|
-
"not_downstream_of": [],
|
|
218
|
-
"text_prop": null,
|
|
219
|
-
"props": []
|
|
220
|
-
}
|
|
221
|
-
]
|
|
222
|
-
}
|