@almadar/std 16.245.0 → 16.246.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/behaviors/behaviors-registry.json +534 -176
  2. package/behaviors/lolo/agent/atoms/std-agent-context.lolo +9 -4
  3. package/behaviors/lolo/agent/atoms/std-agent-memory.lolo +9 -4
  4. package/behaviors/lolo/agent/atoms/std-agent-proposal.lolo +9 -4
  5. package/behaviors/lolo/agent/atoms/std-agent-session.lolo +9 -4
  6. package/behaviors/lolo/agent/atoms/std-agent-suggestions.lolo +9 -4
  7. package/behaviors/lolo/agent/atoms/std-agent-tool-loop.lolo +9 -4
  8. package/behaviors/lolo/agent/organisms/std-agent-assistant.lolo +9 -4
  9. package/behaviors/lolo/ui/core/atoms/ui-svg-flow.lolo +1 -1
  10. package/behaviors/lolo/ui/core/molecules/ui-import-progress.lolo +1 -1
  11. package/behaviors/lolo/ui/game/atoms/ui-canvas.lolo +3 -3
  12. package/behaviors/lolo/ui/game/atoms/ui-control-grid.lolo +3 -3
  13. package/behaviors/lolo/ui/game/atoms/ui-draw-group.lolo +1 -1
  14. package/behaviors/lolo/ui/game/atoms/ui-draw-mesh.lolo +1 -1
  15. package/behaviors/lolo/ui/game/atoms/ui-draw-skinned-mesh.lolo +3 -3
  16. package/behaviors/lolo/ui/learning/atoms/ui-biology-canvas.lolo +3 -3
  17. package/behaviors/lolo/ui/learning/atoms/ui-chemistry-canvas.lolo +3 -3
  18. package/behaviors/lolo/ui/learning/atoms/ui-physics-canvas.lolo +3 -3
  19. package/behaviors/lolo-behavior-contracts.json +1 -1
  20. package/behaviors/registry/agent/atoms/std-agent-context.orb +53 -67
  21. package/behaviors/registry/agent/atoms/std-agent-memory.orb +14 -51
  22. package/behaviors/registry/agent/atoms/std-agent-proposal.orb +50 -20
  23. package/behaviors/registry/agent/atoms/std-agent-session.orb +84 -91
  24. package/behaviors/registry/agent/atoms/std-agent-suggestions.orb +61 -24
  25. package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +61 -45
  26. package/behaviors/registry/agent/organisms/std-agent-assistant.orb +63 -26
  27. package/behaviors/registry/factory-signatures.json +1 -1
  28. package/behaviors/registry/ui/avl/atoms/ui-avl-state-machine.orb +2 -2
  29. package/behaviors/registry/ui/avl/atoms/ui-avl-transition-explainer.orb +2 -2
  30. package/behaviors/registry/ui/avl/atoms/ui-behavior-view.orb +2 -2
  31. package/behaviors/registry/ui/avl/atoms/ui-module-card.orb +2 -2
  32. package/behaviors/registry/ui/core/atoms/ui-svg-flow.orb +11 -4
  33. package/behaviors/registry/ui/core/molecules/ui-agent-chat-feed.orb +1 -1
  34. package/behaviors/registry/ui/core/molecules/ui-data-grid.orb +2 -2
  35. package/behaviors/registry/ui/core/molecules/ui-import-progress.orb +1 -1
  36. package/behaviors/registry/ui/core/molecules/ui-swipeable-row.orb +2 -2
  37. package/behaviors/registry/ui/core/molecules/ui-table-view.orb +2 -2
  38. package/behaviors/registry/ui/core/molecules/ui-wizard-container.orb +3 -3
  39. package/behaviors/registry/ui/core/organisms/ui-detail-panel.orb +4 -4
  40. package/behaviors/registry/ui/core/organisms/ui-form-section.orb +4 -4
  41. package/behaviors/registry/ui/core/organisms/ui-form.orb +4 -4
  42. package/behaviors/registry/ui/core/organisms/ui-state-machine-view.orb +136 -2
  43. package/behaviors/registry/ui/core/templates/ui-dashboard-layout.orb +3 -2
  44. package/behaviors/registry/ui/game/atoms/ui-canvas.orb +51 -18
  45. package/behaviors/registry/ui/game/atoms/ui-control-grid.orb +3 -3
  46. package/behaviors/registry/ui/game/atoms/ui-draw-group.orb +12 -5
  47. package/behaviors/registry/ui/game/atoms/ui-draw-mesh.orb +12 -5
  48. package/behaviors/registry/ui/game/atoms/ui-draw-skinned-mesh.orb +39 -14
  49. package/behaviors/registry/ui/learning/atoms/ui-biology-canvas.orb +51 -18
  50. package/behaviors/registry/ui/learning/atoms/ui-chemistry-canvas.orb +51 -18
  51. package/behaviors/registry/ui/learning/atoms/ui-physics-canvas.orb +51 -18
  52. package/canonical-operators.json +5 -5
  53. package/dist/behaviors/exports-reader.js +228 -218
  54. package/dist/behaviors/functions/index.d.ts +8 -8
  55. package/dist/behaviors/functions/index.js +228 -218
  56. package/dist/behaviors/index.js +274 -255
  57. package/dist/behaviors/knob-embeddings.d.ts +16 -2
  58. package/dist/behaviors/knob-embeddings.js +47 -38
  59. package/dist/behaviors/query.js +228 -218
  60. package/dist/behaviors-embeddings.hash.json +3 -3
  61. package/dist/behaviors-embeddings.json +1 -1
  62. package/dist/behaviors-registry.json +534 -176
  63. package/dist/index.js +278 -259
  64. package/dist/knob-embeddings.hash.json +3 -3
  65. package/dist/knob-embeddings.json +7 -3
  66. package/dist/modules/array.js +4 -4
  67. package/dist/modules/index.js +4 -4
  68. package/dist/registry/factory-signatures.json +1 -1
  69. package/dist/registry.js +4 -4
  70. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2206,9 +2206,9 @@ var ARRAY_OPERATORS = {
2206
2206
  category: "std-array",
2207
2207
  minArity: 1,
2208
2208
  maxArity: 2,
2209
- description: "Minimum value (optionally by field)",
2209
+ description: "Minimum value (optionally by field); null when no element counts",
2210
2210
  hasSideEffects: false,
2211
- returnType: "number",
2211
+ returnType: "number | null",
2212
2212
  params: [
2213
2213
  { name: "arr", type: "array", description: "The array" },
2214
2214
  { name: "key", type: "string", description: "Field to compare", optional: true }
@@ -2220,9 +2220,9 @@ var ARRAY_OPERATORS = {
2220
2220
  category: "std-array",
2221
2221
  minArity: 1,
2222
2222
  maxArity: 2,
2223
- description: "Maximum value (optionally by field)",
2223
+ description: "Maximum value (optionally by field); null when no element counts",
2224
2224
  hasSideEffects: false,
2225
- returnType: "number",
2225
+ returnType: "number | null",
2226
2226
  params: [
2227
2227
  { name: "arr", type: "array", description: "The array" },
2228
2228
  { name: "key", type: "string", description: "Field to compare", optional: true }
@@ -9453,26 +9453,49 @@ function stdAgentContextAgentContextOrbital(params = {}) {
9453
9453
  "description": "The ephemeral conversation's own tools, carried through a summarizing.",
9454
9454
  "items": {
9455
9455
  "properties": {
9456
- "event": {
9457
- "name": "event",
9458
- "required": false,
9459
- "type": "event"
9456
+ "AgentToolInput": {
9457
+ "name": "AgentToolInput",
9458
+ "properties": {
9459
+ "event": {
9460
+ "name": "event",
9461
+ "required": true,
9462
+ "type": "EventAddress"
9463
+ }
9464
+ },
9465
+ "type": "object"
9460
9466
  },
9461
- "read": {
9462
- "name": "read",
9463
- "required": false,
9464
- "type": "string"
9467
+ "AgentToolRead": {
9468
+ "name": "AgentToolRead",
9469
+ "properties": {
9470
+ "read": {
9471
+ "name": "read",
9472
+ "required": true,
9473
+ "type": "string"
9474
+ }
9475
+ },
9476
+ "type": "object"
9465
9477
  },
9466
- "scope": {
9467
- "name": "scope",
9468
- "required": false,
9469
- "type": "string",
9470
- "values": [
9471
- "declared"
9472
- ]
9478
+ "AgentToolScope": {
9479
+ "name": "AgentToolScope",
9480
+ "properties": {
9481
+ "scope": {
9482
+ "name": "scope",
9483
+ "required": true,
9484
+ "type": "string",
9485
+ "values": [
9486
+ "declared"
9487
+ ]
9488
+ }
9489
+ },
9490
+ "type": "object"
9473
9491
  }
9474
9492
  },
9475
- "type": "object"
9493
+ "type": "union",
9494
+ "values": [
9495
+ "AgentToolScope",
9496
+ "AgentToolInput",
9497
+ "AgentToolRead"
9498
+ ]
9476
9499
  },
9477
9500
  "name": "pendingTools",
9478
9501
  "type": "array"
@@ -9564,23 +9587,8 @@ function stdAgentContextAgentContextOrbital(params = {}) {
9564
9587
  "type": "string"
9565
9588
  },
9566
9589
  {
9567
- "entity": "AgentTool",
9568
9590
  "name": "tools",
9569
- "properties": [
9570
- {
9571
- "name": "event",
9572
- "type": "event"
9573
- },
9574
- {
9575
- "name": "read",
9576
- "type": "string"
9577
- },
9578
- {
9579
- "name": "scope",
9580
- "type": "string"
9581
- }
9582
- ],
9583
- "type": "[object]"
9591
+ "type": "[AgentTool]"
9584
9592
  },
9585
9593
  {
9586
9594
  "name": "ephemeral",
@@ -9654,21 +9662,7 @@ function stdAgentContextAgentContextOrbital(params = {}) {
9654
9662
  },
9655
9663
  {
9656
9664
  "name": "tools",
9657
- "properties": [
9658
- {
9659
- "name": "event",
9660
- "type": "event"
9661
- },
9662
- {
9663
- "name": "read",
9664
- "type": "string"
9665
- },
9666
- {
9667
- "name": "scope",
9668
- "type": "string"
9669
- }
9670
- ],
9671
- "type": "[object]"
9665
+ "type": "[AgentTool]"
9672
9666
  },
9673
9667
  {
9674
9668
  "name": "ephemeral",
@@ -9729,23 +9723,8 @@ function stdAgentContextAgentContextOrbital(params = {}) {
9729
9723
  "type": "string"
9730
9724
  },
9731
9725
  {
9732
- "entity": "AgentTool",
9733
9726
  "name": "tools",
9734
- "properties": [
9735
- {
9736
- "name": "event",
9737
- "type": "event"
9738
- },
9739
- {
9740
- "name": "read",
9741
- "type": "string"
9742
- },
9743
- {
9744
- "name": "scope",
9745
- "type": "string"
9746
- }
9747
- ],
9748
- "type": "[object]"
9727
+ "type": "[AgentTool]"
9749
9728
  },
9750
9729
  {
9751
9730
  "name": "ephemeral",
@@ -10870,23 +10849,8 @@ function stdAgentMemoryAgentMemoryOrbital(params = {}) {
10870
10849
  "type": "string"
10871
10850
  },
10872
10851
  {
10873
- "entity": "AgentTool",
10874
10852
  "name": "tools",
10875
- "properties": [
10876
- {
10877
- "name": "event",
10878
- "type": "event"
10879
- },
10880
- {
10881
- "name": "read",
10882
- "type": "string"
10883
- },
10884
- {
10885
- "name": "scope",
10886
- "type": "string"
10887
- }
10888
- ],
10889
- "type": "[object]"
10853
+ "type": "[AgentTool]"
10890
10854
  },
10891
10855
  {
10892
10856
  "name": "ephemeral",
@@ -11261,21 +11225,7 @@ function stdAgentMemoryAgentMemoryOrbital(params = {}) {
11261
11225
  },
11262
11226
  {
11263
11227
  "name": "tools",
11264
- "properties": [
11265
- {
11266
- "name": "event",
11267
- "type": "event"
11268
- },
11269
- {
11270
- "name": "read",
11271
- "type": "string"
11272
- },
11273
- {
11274
- "name": "scope",
11275
- "type": "string"
11276
- }
11277
- ],
11278
- "type": "[object]"
11228
+ "type": "[AgentTool]"
11279
11229
  },
11280
11230
  {
11281
11231
  "name": "ephemeral",
@@ -11431,23 +11381,8 @@ function stdAgentMemoryAgentMemoryOrbital(params = {}) {
11431
11381
  "type": "string"
11432
11382
  },
11433
11383
  {
11434
- "entity": "AgentTool",
11435
11384
  "name": "tools",
11436
- "properties": [
11437
- {
11438
- "name": "event",
11439
- "type": "event"
11440
- },
11441
- {
11442
- "name": "read",
11443
- "type": "string"
11444
- },
11445
- {
11446
- "name": "scope",
11447
- "type": "string"
11448
- }
11449
- ],
11450
- "type": "[object]"
11385
+ "type": "[AgentTool]"
11451
11386
  },
11452
11387
  {
11453
11388
  "name": "ephemeral",
@@ -14994,26 +14929,49 @@ function stdAgentSessionAgentSessionOrbital(params = {}) {
14994
14929
  "description": "The ephemeral conversation's own tools (empty: none).",
14995
14930
  "items": {
14996
14931
  "properties": {
14997
- "event": {
14998
- "name": "event",
14999
- "required": false,
15000
- "type": "event"
14932
+ "AgentToolInput": {
14933
+ "name": "AgentToolInput",
14934
+ "properties": {
14935
+ "event": {
14936
+ "name": "event",
14937
+ "required": true,
14938
+ "type": "EventAddress"
14939
+ }
14940
+ },
14941
+ "type": "object"
15001
14942
  },
15002
- "read": {
15003
- "name": "read",
15004
- "required": false,
15005
- "type": "string"
14943
+ "AgentToolRead": {
14944
+ "name": "AgentToolRead",
14945
+ "properties": {
14946
+ "read": {
14947
+ "name": "read",
14948
+ "required": true,
14949
+ "type": "string"
14950
+ }
14951
+ },
14952
+ "type": "object"
15006
14953
  },
15007
- "scope": {
15008
- "name": "scope",
15009
- "required": false,
15010
- "type": "string",
15011
- "values": [
15012
- "declared"
15013
- ]
14954
+ "AgentToolScope": {
14955
+ "name": "AgentToolScope",
14956
+ "properties": {
14957
+ "scope": {
14958
+ "name": "scope",
14959
+ "required": true,
14960
+ "type": "string",
14961
+ "values": [
14962
+ "declared"
14963
+ ]
14964
+ }
14965
+ },
14966
+ "type": "object"
15014
14967
  }
15015
14968
  },
15016
- "type": "object"
14969
+ "type": "union",
14970
+ "values": [
14971
+ "AgentToolScope",
14972
+ "AgentToolInput",
14973
+ "AgentToolRead"
14974
+ ]
15017
14975
  },
15018
14976
  "name": "chatTools",
15019
14977
  "type": "array"
@@ -15979,23 +15937,8 @@ function stdAgentSessionAgentSessionOrbital(params = {}) {
15979
15937
  "type": "string"
15980
15938
  },
15981
15939
  {
15982
- "entity": "AgentTool",
15983
15940
  "name": "tools",
15984
- "properties": [
15985
- {
15986
- "name": "event",
15987
- "type": "event"
15988
- },
15989
- {
15990
- "name": "read",
15991
- "type": "string"
15992
- },
15993
- {
15994
- "name": "scope",
15995
- "type": "string"
15996
- }
15997
- ],
15998
- "type": "[object]"
15941
+ "type": "[AgentTool]"
15999
15942
  },
16000
15943
  {
16001
15944
  "name": "ephemeral",
@@ -16240,21 +16183,7 @@ function stdAgentSessionAgentSessionOrbital(params = {}) {
16240
16183
  },
16241
16184
  {
16242
16185
  "name": "tools",
16243
- "properties": [
16244
- {
16245
- "name": "event",
16246
- "type": "event"
16247
- },
16248
- {
16249
- "name": "read",
16250
- "type": "string"
16251
- },
16252
- {
16253
- "name": "scope",
16254
- "type": "string"
16255
- }
16256
- ],
16257
- "type": "[object]"
16186
+ "type": "[AgentTool]"
16258
16187
  },
16259
16188
  {
16260
16189
  "name": "title",
@@ -16467,23 +16396,8 @@ function stdAgentSessionAgentSessionOrbital(params = {}) {
16467
16396
  "type": "string"
16468
16397
  },
16469
16398
  {
16470
- "entity": "AgentTool",
16471
16399
  "name": "tools",
16472
- "properties": [
16473
- {
16474
- "name": "event",
16475
- "type": "event"
16476
- },
16477
- {
16478
- "name": "read",
16479
- "type": "string"
16480
- },
16481
- {
16482
- "name": "scope",
16483
- "type": "string"
16484
- }
16485
- ],
16486
- "type": "[object]"
16400
+ "type": "[AgentTool]"
16487
16401
  },
16488
16402
  {
16489
16403
  "name": "ephemeral",
@@ -26453,26 +26367,49 @@ function stdAgentToolLoopAgentToolLoopOrbital(params = {}) {
26453
26367
  "description": "The declared inputs it may fire (`{ event: Trait.EVENT }`) and the entities it may read (`{ read: Entity }`), as the signed-in user.",
26454
26368
  "items": {
26455
26369
  "properties": {
26456
- "event": {
26457
- "name": "event",
26458
- "required": false,
26459
- "type": "event"
26370
+ "AgentToolInput": {
26371
+ "name": "AgentToolInput",
26372
+ "properties": {
26373
+ "event": {
26374
+ "name": "event",
26375
+ "required": true,
26376
+ "type": "EventAddress"
26377
+ }
26378
+ },
26379
+ "type": "object"
26460
26380
  },
26461
- "read": {
26462
- "name": "read",
26463
- "required": false,
26464
- "type": "string"
26381
+ "AgentToolRead": {
26382
+ "name": "AgentToolRead",
26383
+ "properties": {
26384
+ "read": {
26385
+ "name": "read",
26386
+ "required": true,
26387
+ "type": "string"
26388
+ }
26389
+ },
26390
+ "type": "object"
26465
26391
  },
26466
- "scope": {
26467
- "name": "scope",
26468
- "required": false,
26469
- "type": "string",
26470
- "values": [
26471
- "declared"
26472
- ]
26392
+ "AgentToolScope": {
26393
+ "name": "AgentToolScope",
26394
+ "properties": {
26395
+ "scope": {
26396
+ "name": "scope",
26397
+ "required": true,
26398
+ "type": "string",
26399
+ "values": [
26400
+ "declared"
26401
+ ]
26402
+ }
26403
+ },
26404
+ "type": "object"
26473
26405
  }
26474
26406
  },
26475
- "type": "object"
26407
+ "type": "union",
26408
+ "values": [
26409
+ "AgentToolScope",
26410
+ "AgentToolInput",
26411
+ "AgentToolRead"
26412
+ ]
26476
26413
  },
26477
26414
  "label": "What may the assistant do?",
26478
26415
  "synonyms": "allowlist, abilities, actions, permissions",
@@ -26857,21 +26794,7 @@ function stdAgentToolLoopAgentToolLoopOrbital(params = {}) {
26857
26794
  },
26858
26795
  {
26859
26796
  "name": "tools",
26860
- "properties": [
26861
- {
26862
- "name": "event",
26863
- "type": "event"
26864
- },
26865
- {
26866
- "name": "read",
26867
- "type": "string"
26868
- },
26869
- {
26870
- "name": "scope",
26871
- "type": "string"
26872
- }
26873
- ],
26874
- "type": "[object]"
26797
+ "type": "[AgentTool]"
26875
26798
  },
26876
26799
  {
26877
26800
  "name": "ephemeral",
@@ -194655,7 +194578,7 @@ function stdUiDetailPanelDetailPanelOrbital(params = {}) {
194655
194578
  "payload": {
194656
194579
  "name": "payload",
194657
194580
  "required": false,
194658
- "type": "object"
194581
+ "type": "SExpr"
194659
194582
  },
194660
194583
  "roles": {
194661
194584
  "items": {
@@ -194679,7 +194602,7 @@ function stdUiDetailPanelDetailPanelOrbital(params = {}) {
194679
194602
  "when": {
194680
194603
  "name": "when",
194681
194604
  "required": false,
194682
- "type": "object"
194605
+ "type": "SExpr"
194683
194606
  }
194684
194607
  },
194685
194608
  "type": "object"
@@ -194888,7 +194811,7 @@ function stdUiDetailPanelDetailPanelOrbital(params = {}) {
194888
194811
  "payload": {
194889
194812
  "name": "payload",
194890
194813
  "required": false,
194891
- "type": "object"
194814
+ "type": "SExpr"
194892
194815
  },
194893
194816
  "variant": {
194894
194817
  "name": "variant",
@@ -194904,7 +194827,7 @@ function stdUiDetailPanelDetailPanelOrbital(params = {}) {
194904
194827
  "when": {
194905
194828
  "name": "when",
194906
194829
  "required": false,
194907
- "type": "object"
194830
+ "type": "SExpr"
194908
194831
  }
194909
194832
  },
194910
194833
  "tier": "presentation",
@@ -197860,7 +197783,7 @@ function stdUiFormFormOrbital(params = {}) {
197860
197783
  "default": {},
197861
197784
  "description": "Inspection form extensions",
197862
197785
  "items": {
197863
- "type": "object"
197786
+ "type": "SExpr"
197864
197787
  },
197865
197788
  "label": "Conditional Fields",
197866
197789
  "tier": "presentation",
@@ -198535,7 +198458,7 @@ function stdUiFormFormOrbital(params = {}) {
198535
198458
  "expression": {
198536
198459
  "name": "expression",
198537
198460
  "required": true,
198538
- "type": "object"
198461
+ "type": "SExpr"
198539
198462
  },
198540
198463
  "triggerFields": {
198541
198464
  "items": {
@@ -198759,7 +198682,7 @@ function stdUiFormFormOrbital(params = {}) {
198759
198682
  "condition": {
198760
198683
  "name": "condition",
198761
198684
  "required": false,
198762
- "type": "object"
198685
+ "type": "SExpr"
198763
198686
  },
198764
198687
  "fields": {
198765
198688
  "items": {
@@ -199075,7 +198998,7 @@ function stdUiFormFormOrbital(params = {}) {
199075
198998
  "condition": {
199076
198999
  "name": "condition",
199077
199000
  "required": true,
199078
- "type": "object"
199001
+ "type": "SExpr"
199079
199002
  },
199080
199003
  "fieldId": {
199081
199004
  "name": "fieldId",
@@ -199931,7 +199854,7 @@ function stdUiFormSectionFormSectionOrbital(params = {}) {
199931
199854
  "default": {},
199932
199855
  "description": "Inspection form extensions",
199933
199856
  "items": {
199934
- "type": "object"
199857
+ "type": "SExpr"
199935
199858
  },
199936
199859
  "label": "Conditional Fields",
199937
199860
  "tier": "presentation",
@@ -200606,7 +200529,7 @@ function stdUiFormSectionFormSectionOrbital(params = {}) {
200606
200529
  "expression": {
200607
200530
  "name": "expression",
200608
200531
  "required": true,
200609
- "type": "object"
200532
+ "type": "SExpr"
200610
200533
  },
200611
200534
  "triggerFields": {
200612
200535
  "items": {
@@ -200830,7 +200753,7 @@ function stdUiFormSectionFormSectionOrbital(params = {}) {
200830
200753
  "condition": {
200831
200754
  "name": "condition",
200832
200755
  "required": false,
200833
- "type": "object"
200756
+ "type": "SExpr"
200834
200757
  },
200835
200758
  "fields": {
200836
200759
  "items": {
@@ -201146,7 +201069,7 @@ function stdUiFormSectionFormSectionOrbital(params = {}) {
201146
201069
  "condition": {
201147
201070
  "name": "condition",
201148
201071
  "required": true,
201149
- "type": "object"
201072
+ "type": "SExpr"
201150
201073
  },
201151
201074
  "fieldId": {
201152
201075
  "name": "fieldId",
@@ -206661,6 +206584,92 @@ function stdUiStateMachineViewStateMachineViewOrbital(params = {}) {
206661
206584
  "tier": "presentation",
206662
206585
  "type": "number"
206663
206586
  },
206587
+ "annotations": {
206588
+ "default": {
206589
+ "effects": {
206590
+ "persist": {
206591
+ "body": "Saves the order."
206592
+ }
206593
+ },
206594
+ "states": {
206595
+ "pending": {
206596
+ "body": "Every order starts here.",
206597
+ "title": "Unpaid"
206598
+ }
206599
+ },
206600
+ "transitions": {
206601
+ "PAY": {
206602
+ "body": "Only fires when the amount is positive."
206603
+ }
206604
+ }
206605
+ },
206606
+ "description": "Author explanations shown in a popover on hover: a note per state name, per transition event and per effect type.",
206607
+ "label": "Annotations",
206608
+ "properties": {
206609
+ "effects": {
206610
+ "items": {
206611
+ "properties": {
206612
+ "body": {
206613
+ "name": "body",
206614
+ "required": true,
206615
+ "type": "string"
206616
+ },
206617
+ "title": {
206618
+ "name": "title",
206619
+ "required": false,
206620
+ "type": "string"
206621
+ }
206622
+ },
206623
+ "type": "object"
206624
+ },
206625
+ "name": "effects",
206626
+ "required": false,
206627
+ "type": "object"
206628
+ },
206629
+ "states": {
206630
+ "items": {
206631
+ "properties": {
206632
+ "body": {
206633
+ "name": "body",
206634
+ "required": true,
206635
+ "type": "string"
206636
+ },
206637
+ "title": {
206638
+ "name": "title",
206639
+ "required": false,
206640
+ "type": "string"
206641
+ }
206642
+ },
206643
+ "type": "object"
206644
+ },
206645
+ "name": "states",
206646
+ "required": false,
206647
+ "type": "object"
206648
+ },
206649
+ "transitions": {
206650
+ "items": {
206651
+ "properties": {
206652
+ "body": {
206653
+ "name": "body",
206654
+ "required": true,
206655
+ "type": "string"
206656
+ },
206657
+ "title": {
206658
+ "name": "title",
206659
+ "required": false,
206660
+ "type": "string"
206661
+ }
206662
+ },
206663
+ "type": "object"
206664
+ },
206665
+ "name": "transitions",
206666
+ "required": false,
206667
+ "type": "object"
206668
+ }
206669
+ },
206670
+ "tier": "presentation",
206671
+ "type": "StateMachineViewAnnotations"
206672
+ },
206664
206673
  "ariaBusy": {
206665
206674
  "description": "This region is updating; assistive technology waits before announcing it.",
206666
206675
  "label": "Aria-busy",
@@ -207068,7 +207077,7 @@ function stdUiStateMachineViewStateMachineViewOrbital(params = {}) {
207068
207077
  "properties": {
207069
207078
  "args": {
207070
207079
  "items": {
207071
- "type": "object"
207080
+ "type": "SExpr"
207072
207081
  },
207073
207082
  "name": "args",
207074
207083
  "required": true,
@@ -207099,7 +207108,7 @@ function stdUiStateMachineViewStateMachineViewOrbital(params = {}) {
207099
207108
  "guard": {
207100
207109
  "name": "guard",
207101
207110
  "required": false,
207102
- "type": "object"
207111
+ "type": "SExpr"
207103
207112
  },
207104
207113
  "index": {
207105
207114
  "name": "index",
@@ -207315,6 +207324,7 @@ function stdUiStateMachineViewStateMachineViewOrbital(params = {}) {
207315
207324
  {
207316
207325
  "activeState": "@config.activeState",
207317
207326
  "activeTransition": "@config.activeTransition",
207327
+ "annotations": "@config.annotations",
207318
207328
  "aria-busy": "@config.ariaBusy",
207319
207329
  "aria-current": "@config.ariaCurrent",
207320
207330
  "aria-describedby": "@config.ariaDescribedby",
@@ -213016,29 +213026,56 @@ async function getFactorySignatureCatalog() {
213016
213026
 
213017
213027
  // behaviors/knob-embeddings.ts
213018
213028
  var pending4 = null;
213019
- function decodeVector2(stored) {
213020
- if (!("d" in stored)) return stored;
213021
- const bytes = Buffer.from(stored.d, "base64");
213022
- const out = new Array(bytes.length);
213023
- for (let i = 0; i < bytes.length; i++) {
213024
- out[i] = bytes.readInt8(i) * stored.s / 127;
213029
+ function writeVector(stored, slot) {
213030
+ if ("d" in stored) {
213031
+ const bytes = Buffer.from(stored.d, "base64");
213032
+ if (bytes.length !== slot.length) return false;
213033
+ slot.set(new Int8Array(bytes.buffer, bytes.byteOffset, bytes.length));
213034
+ return true;
213025
213035
  }
213026
- return out;
213036
+ if (stored.length !== slot.length) return false;
213037
+ let maxAbs = 0;
213038
+ for (const v of stored) maxAbs = Math.max(maxAbs, Math.abs(v));
213039
+ for (let i = 0; i < stored.length; i++) {
213040
+ slot[i] = maxAbs === 0 ? 0 : Math.round(stored[i] * 127 / maxAbs);
213041
+ }
213042
+ return true;
213027
213043
  }
213028
- function reconstructVectors(parsed) {
213044
+ function decodeKnobEmbeddingsFile(parsed) {
213045
+ const interned = typeof parsed?.table === "object" && typeof parsed?.keys === "object";
213046
+ const nonInterned = typeof parsed?.vectors === "object" && parsed.vectors !== null;
213047
+ if (typeof parsed?.model !== "string" || typeof parsed?.dimensions !== "number" || !interned && !nonInterned) {
213048
+ return null;
213049
+ }
213050
+ const dims = parsed.dimensions;
213051
+ const stored = interned ? parsed.table ?? [] : Object.values(parsed.vectors ?? {});
213052
+ const backing = new Int8Array(stored.length * dims);
213053
+ const slots = [];
213054
+ for (let i = 0; i < stored.length; i++) {
213055
+ const slot = backing.subarray(i * dims, (i + 1) * dims);
213056
+ if (!writeVector(stored[i], slot)) return null;
213057
+ slots.push(slot);
213058
+ }
213029
213059
  const vectors = {};
213030
- if (parsed.table && parsed.keys) {
213031
- const decoded = parsed.table.map(decodeVector2);
213032
- for (const [key, idx] of Object.entries(parsed.keys)) {
213033
- const vec = decoded[idx];
213034
- if (vec) vectors[key] = vec;
213060
+ if (interned) {
213061
+ for (const [key, idx] of Object.entries(parsed.keys ?? {})) {
213062
+ const slot = slots[idx];
213063
+ if (slot) vectors[key] = slot;
213035
213064
  }
213036
- return vectors;
213065
+ } else {
213066
+ Object.keys(parsed.vectors ?? {}).forEach((key, i) => {
213067
+ vectors[key] = slots[i];
213068
+ });
213037
213069
  }
213038
- for (const [key, stored] of Object.entries(parsed.vectors ?? {})) {
213039
- vectors[key] = decodeVector2(stored);
213070
+ return { version: parsed.version ?? "", model: parsed.model, dimensions: dims, vectors };
213071
+ }
213072
+ async function readKnobEmbeddingsFile(path) {
213073
+ try {
213074
+ const { readFileSync } = await import('fs');
213075
+ return decodeKnobEmbeddingsFile(JSON.parse(readFileSync(path, "utf-8")));
213076
+ } catch {
213077
+ return null;
213040
213078
  }
213041
- return vectors;
213042
213079
  }
213043
213080
  function loadManifest2() {
213044
213081
  pending4 ?? (pending4 = loadManifestUncached2().then((m) => {
@@ -213048,26 +213085,8 @@ function loadManifest2() {
213048
213085
  return pending4;
213049
213086
  }
213050
213087
  async function loadManifestUncached2() {
213051
- try {
213052
- const { readFileSync } = await import('fs');
213053
- const { resolve } = await import('path');
213054
- const dir = await resolveStdDataDir();
213055
- const raw = readFileSync(resolve(dir, "knob-embeddings.json"), "utf-8");
213056
- const parsed = JSON.parse(raw);
213057
- const interned = typeof parsed?.table === "object" && typeof parsed?.keys === "object";
213058
- const nonInterned = typeof parsed?.vectors === "object" && parsed.vectors !== null;
213059
- if (typeof parsed?.model !== "string" || typeof parsed?.dimensions !== "number" || !interned && !nonInterned) {
213060
- return null;
213061
- }
213062
- return {
213063
- version: parsed.version,
213064
- model: parsed.model,
213065
- dimensions: parsed.dimensions,
213066
- vectors: reconstructVectors(parsed)
213067
- };
213068
- } catch {
213069
- return null;
213070
- }
213088
+ const { resolve } = await import('path');
213089
+ return readKnobEmbeddingsFile(resolve(await resolveStdDataDir(), "knob-embeddings.json"));
213071
213090
  }
213072
213091
  async function getKnobEmbeddings() {
213073
213092
  return loadManifest2();