@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export default {
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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 @@ export default {
|
|
|
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."},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import { Separator } from "./separator";
|
|
3
3
|
declare const buttonGroupVariants: (props?: ({
|
|
4
|
-
orientation?: "
|
|
4
|
+
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): import("react").JSX.Element;
|
|
7
7
|
declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import type { PageActionPolicy } from "./actionPlan";
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
5
|
variant?: "default" | "secondary" | "destructive" | "outline" | "link" | "ghost" | null | undefined;
|
|
6
|
-
size?: "default" | "
|
|
6
|
+
size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
/**
|
|
9
9
|
* Collapse policy, read off the element by `PageActionBar` when a button sits
|
|
@@ -6,7 +6,7 @@ declare function FieldLegend({ className, variant, ...props }: React.ComponentPr
|
|
|
6
6
|
}): import("react").JSX.Element;
|
|
7
7
|
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
8
8
|
declare const fieldVariants: (props?: ({
|
|
9
|
-
orientation?: "
|
|
9
|
+
orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
|
|
10
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
11
|
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react").JSX.Element;
|
|
12
12
|
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
package/package.json
CHANGED
package/src/bsx/infer.test.ts
CHANGED
|
@@ -104,29 +104,20 @@ describe('new warnings', () => {
|
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
describe('
|
|
108
|
-
it(
|
|
109
|
-
|
|
107
|
+
describe('a catalog only adds', () => {
|
|
108
|
+
it('refuses one that redefines a component of the base catalog, the language included', () => {
|
|
109
|
+
const redefining = (name: string) => parseSpecCatalog({name: 'mine', components: [{name, context: 'HTML', props: [{key: 'bind', kind: 'STRING'}]}]}, 'mine');
|
|
110
|
+
expect(() => blokView(redefining('Slider'))).toThrow(/redefines <Slider> of base@3: a catalog only adds/);
|
|
111
|
+
expect(() => blokView(redefining('foreach'))).toThrow(/redefines <foreach>/);
|
|
110
112
|
});
|
|
111
113
|
|
|
112
|
-
it(
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
],
|
|
120
|
-
},
|
|
121
|
-
'mine',
|
|
122
|
-
);
|
|
123
|
-
const view = blokView([module]);
|
|
124
|
-
expect(view.components.get('Slider')?.catalog).toBe('mine');
|
|
125
|
-
expect(view.shadows.get('Slider')).toEqual({component: 'Slider', catalog: 'ui@1', module: 'mine', winner: 'mine'});
|
|
126
|
-
expect(view.components.get('foreach')?.catalog).toMatch(/^base@/);
|
|
127
|
-
expect(view.shadows.get('foreach')?.winner).toMatch(/^base@/);
|
|
128
|
-
const found = checkBlokTree(parseBsx('<Html><Card><Slider bind={l} /><Slider bind={l} /></Card></Html>').tree, {...emptyBlokScope('agent'), locals: [{key: 'l', kind: 'STRING'}]}, view);
|
|
129
|
-
expect(found.map(finding => finding.code)).toEqual(['catalog.shadow']);
|
|
114
|
+
it('draws what it adds on top of the base', () => {
|
|
115
|
+
const view = blokView(parseSpecCatalog({name: 'mine', components: [{name: 'Gauge', context: 'HTML', props: []}]}, 'mine'));
|
|
116
|
+
expect(view.components.get('Gauge')?.catalog).toBe('mine');
|
|
117
|
+
expect(view.components.get('Slider')?.catalog).toBe('base@3');
|
|
118
|
+
expect(view.label).toBe('base@3 + mine');
|
|
119
|
+
const found = checkBlokTree(parseBsx('<Html><Card><Gauge /></Card></Html>').tree, emptyBlokScope('agent'), view);
|
|
120
|
+
expect(found).toEqual([]);
|
|
130
121
|
});
|
|
131
122
|
});
|
|
132
123
|
|
|
@@ -137,13 +128,14 @@ describe('??', () => {
|
|
|
137
128
|
operation: 'logic.coalesce',
|
|
138
129
|
arguments: [{key: 'values', value_list: [{value_path: 'a'}, {value_path: 'b'}, {value_path: 'c'}]}],
|
|
139
130
|
});
|
|
140
|
-
expect(printBsx(tree)).toBe('<Text
|
|
131
|
+
expect(printBsx(tree)).toBe('<Text text={a ?? b ?? c} />');
|
|
132
|
+
expect(printBsx(parseBsx('<Text>{a ?? b ?? c}</Text>').tree)).toBe('<Text>{a ?? b ?? c}</Text>');
|
|
141
133
|
});
|
|
142
134
|
|
|
143
135
|
it('binds looser than || and tighter than a ternary', () => {
|
|
144
|
-
expect(printBsx(parseBsx('<Text
|
|
145
|
-
expect(printBsx(parseBsx('<Text
|
|
146
|
-
expect(printBsx(parseBsx('<Text
|
|
147
|
-
expect(printBsx(parseBsx('<Text
|
|
136
|
+
expect(printBsx(parseBsx('<Text>{(a || b) ?? c}</Text>').tree)).toBe('<Text>{a || b ?? c}</Text>');
|
|
137
|
+
expect(printBsx(parseBsx('<Text>{a || (b ?? c)}</Text>').tree)).toBe('<Text>{a || (b ?? c)}</Text>');
|
|
138
|
+
expect(printBsx(parseBsx('<Text>{(a ?? b) ? x : y}</Text>').tree)).toBe('<Text>{a ?? b ? x : y}</Text>');
|
|
139
|
+
expect(printBsx(parseBsx('<Text>{(a ?? b) ?? c}</Text>').tree)).toBe('<Text>{(a ?? b) ?? c}</Text>');
|
|
148
140
|
});
|
|
149
141
|
});
|
package/src/bsx/language.test.ts
CHANGED
|
@@ -106,7 +106,7 @@ describe('completeBsx: expressions', () => {
|
|
|
106
106
|
|
|
107
107
|
it('walks agents: states, tasks, assets, fields, and actions only in callbacks', () => {
|
|
108
108
|
expect(labels('<Text text={deps.|')).toEqual(['stage']);
|
|
109
|
-
expect(labels('<Text text={deps.stage.|')).toEqual(['position', 'tasks', 'assets', 'id', 'name']);
|
|
109
|
+
expect(labels('<Text text={deps.stage.|')).toEqual(['position', 'tasks', 'assets', 'id', 'name', 'connected']);
|
|
110
110
|
expect(labels('<Button onClick={deps.stage.|')).toContain('move');
|
|
111
111
|
expect(at('<Button onClick={deps.stage.|').find(item => item.label === 'move')?.insertText).toBe('move(x: ${1}, y: ${2})');
|
|
112
112
|
expect(labels('<Text text={deps.stage.position.|')).toEqual(['x', 'y']);
|
|
@@ -162,7 +162,7 @@ describe('hover and signatures', () => {
|
|
|
162
162
|
const source = '<Text text={str.upper(deps.stage.id)} />';
|
|
163
163
|
expect(hoverBsx(source, source.indexOf('upper') + 1, env())?.contents).toContain('str.upper(value)');
|
|
164
164
|
expect(hoverBsx(source, source.indexOf('deps') + 1, env())?.contents).toContain('**deps**');
|
|
165
|
-
expect(hoverBsx('<Time value={then} relative />', 2, env())?.contents).toContain('
|
|
165
|
+
expect(hoverBsx('<Time value={then} relative />', 2, env())?.contents).toContain('base@3');
|
|
166
166
|
const then = '<Time value={then} />';
|
|
167
167
|
expect(hoverBsx(then, then.indexOf('then') + 1, env())?.contents).toContain('**then**');
|
|
168
168
|
});
|
package/src/bsx/parse.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
BlokComponentProp,
|
|
6
6
|
BlokUtilCall,
|
|
7
7
|
} from '../renderer/runtime/types';
|
|
8
|
-
import {defaultBlokView,
|
|
8
|
+
import {defaultBlokView, type BlokView} from '../spec/catalogs';
|
|
9
9
|
import {isExplicitId, loadVocabulary, type BlokContextName} from '../spec/vocabulary';
|
|
10
10
|
import {
|
|
11
11
|
blokError,
|
|
@@ -30,8 +30,10 @@ import {BsxSyntaxError, type BsxRange} from './source';
|
|
|
30
30
|
*
|
|
31
31
|
* - `attr="..."` is always a literal string, `attr={...}` an expression, a bare
|
|
32
32
|
* `attr` is `true`.
|
|
33
|
-
* - Text
|
|
34
|
-
*
|
|
33
|
+
* - Text is a child like any other: each run of text between elements is
|
|
34
|
+
* stored as a `#text` node holding its `value`. What a component does with
|
|
35
|
+
* it (a `Button` makes it its label) is its renderer's to say, so no catalog
|
|
36
|
+
* is needed to parse. Several parts of one run desugar to `str.template`.
|
|
35
37
|
* Whitespace follows JSX.
|
|
36
38
|
* - `className={[...]}` and `className={{...}}` desugar to `str.classes`.
|
|
37
39
|
* - Operators desugar to `cmp.*` / `logic.*` calls; a callback holds one task
|
|
@@ -42,11 +44,15 @@ import {BsxSyntaxError, type BsxRange} from './source';
|
|
|
42
44
|
*/
|
|
43
45
|
|
|
44
46
|
export const MAX_SOURCE_BYTES = 256 * 1024;
|
|
45
|
-
/** The
|
|
46
|
-
export const
|
|
47
|
-
/**
|
|
48
|
-
export const
|
|
49
|
-
|
|
47
|
+
/** The node a run of text is stored as: no element can be called this, so only text makes one. */
|
|
48
|
+
export const TEXT_NODE = '#text';
|
|
49
|
+
/** The prop of a text node that holds its text: a literal, or an expression. */
|
|
50
|
+
export const TEXT_VALUE = 'value';
|
|
51
|
+
/**
|
|
52
|
+
* The components text between elements was stored as before it was a node of
|
|
53
|
+
* its own: a tree stored then still prints as text, and still renders.
|
|
54
|
+
*/
|
|
55
|
+
export const LEGACY_IMPLICIT_TEXTS: readonly string[] = ['Text', 'span'];
|
|
50
56
|
export const CLASS_NAME = 'className';
|
|
51
57
|
export const CLASSES_FUNCTION = 'str.classes';
|
|
52
58
|
export const TEMPLATE_FUNCTION = 'str.template';
|
|
@@ -378,24 +384,7 @@ class Lowering {
|
|
|
378
384
|
return blokError(this.locator, code, offset, fields);
|
|
379
385
|
}
|
|
380
386
|
|
|
381
|
-
node(
|
|
382
|
-
element: MarkupElement,
|
|
383
|
-
derivedId: string,
|
|
384
|
-
context: BlokContextName,
|
|
385
|
-
parent: string | null,
|
|
386
|
-
inheritedLooseText: string = IMPLICIT_TEXT,
|
|
387
|
-
): BlokComponentNode {
|
|
388
|
-
const spec = this.view.components.get(element.name);
|
|
389
|
-
// the component loose text becomes here, from the nearest non-language ancestor
|
|
390
|
-
const catalog = spec?.catalog;
|
|
391
|
-
const looseText =
|
|
392
|
-
spec === undefined
|
|
393
|
-
? inheritedLooseText
|
|
394
|
-
: catalog?.startsWith('html@')
|
|
395
|
-
? IMPLICIT_HTML_TEXT
|
|
396
|
-
: catalog?.startsWith('base@')
|
|
397
|
-
? inheritedLooseText
|
|
398
|
-
: IMPLICIT_TEXT;
|
|
387
|
+
node(element: MarkupElement, derivedId: string, parent: string | null): BlokComponentNode {
|
|
399
388
|
if (element.name === ELSE_COMPONENT && parent !== IF_COMPONENT) throw this.fail('bsx.else_outside_if', element.offset);
|
|
400
389
|
let nodeId = derivedId;
|
|
401
390
|
const explicit = element.attributes.find(attribute => attribute.name === 'id');
|
|
@@ -411,31 +400,15 @@ class Lowering {
|
|
|
411
400
|
const props = element.attributes.filter(attribute => attribute.name !== 'id').map(attribute => this.prop(element.name, attribute));
|
|
412
401
|
if (element.name === FOREACH_COMPONENT) this.checkForeach(element);
|
|
413
402
|
|
|
414
|
-
const inner = spec ? innerContext(spec, context) : context;
|
|
415
|
-
|
|
416
403
|
const children: BlokComponentNode[] = [];
|
|
417
404
|
const runs = this.runs(element);
|
|
418
|
-
const hasElements = element.children.some(child => child.kind === 'element');
|
|
419
|
-
const textRuns = runs.filter(isTextRun);
|
|
420
|
-
let implicitText = false;
|
|
421
|
-
if (textRuns.length > 0) {
|
|
422
|
-
const textProp = this.textTarget(element, inner, textRuns, hasElements);
|
|
423
|
-
implicitText = textProp === null;
|
|
424
|
-
if (textProp !== null) {
|
|
425
|
-
if (props.some(prop => prop.key === textProp)) {
|
|
426
|
-
throw this.fail('bsx.text_and_prop', element.offset, {component: element.name, key: textProp});
|
|
427
|
-
}
|
|
428
|
-
props.push(this.textProp(textProp, textRuns[0], element.offset));
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
405
|
let implicit = 0;
|
|
432
406
|
const counts = new Map<string, number>();
|
|
433
407
|
let seenElse = false;
|
|
434
408
|
for (const run of runs) {
|
|
435
409
|
if (isTextRun(run)) {
|
|
436
|
-
if (!implicitText) continue;
|
|
437
410
|
if (seenElse) throw this.fail('bsx.else_order', element.offset);
|
|
438
|
-
children.push({id: `${nodeId}/#${implicit}`, component:
|
|
411
|
+
children.push({id: `${nodeId}/#${implicit}`, component: TEXT_NODE, props: [this.textProp(TEXT_VALUE, run, element.offset)]});
|
|
439
412
|
implicit += 1;
|
|
440
413
|
continue;
|
|
441
414
|
}
|
|
@@ -446,7 +419,7 @@ class Lowering {
|
|
|
446
419
|
}
|
|
447
420
|
const index = counts.get(child.name) ?? 0;
|
|
448
421
|
counts.set(child.name, index + 1);
|
|
449
|
-
children.push(this.node(child, `${nodeId}/${child.name}[${index}]`,
|
|
422
|
+
children.push(this.node(child, `${nodeId}/${child.name}[${index}]`, element.name));
|
|
450
423
|
}
|
|
451
424
|
if (element.name === IF_COMPONENT) {
|
|
452
425
|
const elses = element.children.filter((child): child is MarkupElement => child.kind === 'element' && child.name === ELSE_COMPONENT);
|
|
@@ -535,23 +508,6 @@ class Lowering {
|
|
|
535
508
|
return runs;
|
|
536
509
|
}
|
|
537
510
|
|
|
538
|
-
/** Where text goes: the text_prop (returned), implicit Text nodes (null), or refused. */
|
|
539
|
-
private textTarget(element: MarkupElement, context: BlokContextName, runs: Part[][], hasElements: boolean): string | null {
|
|
540
|
-
const component = this.view.components.get(element.name);
|
|
541
|
-
const sample = runs[0].map(part => (typeof part === 'string' ? part : '{...}')).join('').slice(0, 60);
|
|
542
|
-
if (!component) throw this.fail('bsx.text_unknown_component', element.offset, {component: element.name, text: sample});
|
|
543
|
-
const drawsText = this.vocabulary.contexts[context];
|
|
544
|
-
if (drawsText && !drawsText.text) {
|
|
545
|
-
throw this.fail('bsx.text_in_context', element.offset, {component: element.name, context, text: sample});
|
|
546
|
-
}
|
|
547
|
-
if (component.textProp !== null && !hasElements) {
|
|
548
|
-
if (runs.length > 1) throw this.fail('bsx.text_not_accepted', element.offset, {component: element.name, text: sample});
|
|
549
|
-
return component.textProp;
|
|
550
|
-
}
|
|
551
|
-
if (component.textProp !== null || isLanguageContainer(component)) return null;
|
|
552
|
-
throw this.fail('bsx.text_not_accepted', element.offset, {component: element.name, text: sample});
|
|
553
|
-
}
|
|
554
|
-
|
|
555
511
|
private textProp(key: string, parts: Part[], offset: number): BlokComponentProp {
|
|
556
512
|
if (parts.length === 1) {
|
|
557
513
|
const only = parts[0];
|
|
@@ -827,7 +783,7 @@ export const parseBsx = (source: string, view: BlokView = defaultBlokView()): {t
|
|
|
827
783
|
const markup = new Markup(source, locator);
|
|
828
784
|
const root = markup.document();
|
|
829
785
|
const lowering = new Lowering(view, locator, markup);
|
|
830
|
-
const tree = lowering.node(root, `${root.name}[0]`,
|
|
786
|
+
const tree = lowering.node(root, `${root.name}[0]`, null);
|
|
831
787
|
return {tree, sources: lowering.sources};
|
|
832
788
|
};
|
|
833
789
|
|
package/src/bsx/partial.test.ts
CHANGED
|
@@ -60,7 +60,7 @@ describe('parseBsxPartial', () => {
|
|
|
60
60
|
const result = parseBsxPartial('<Html><Card><Text>Hel');
|
|
61
61
|
expect(result.complete).toBe(false);
|
|
62
62
|
expect(result.error?.code).toBe('bsx.unclosed');
|
|
63
|
-
expect(result.tree && [...ids(result.tree)]).toEqual(['Html[0]', 'Html[0]/Card[0]', 'Html[0]/Card[0]/Text[0]']);
|
|
63
|
+
expect(result.tree && [...ids(result.tree)]).toEqual(['Html[0]', 'Html[0]/Card[0]', 'Html[0]/Card[0]/Text[0]', 'Html[0]/Card[0]/Text[0]/#0']);
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
it('drops a tag that cannot draw until its attributes arrive', () => {
|