@almadar/std 16.213.0 → 16.215.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.
@@ -117,7 +117,7 @@ var CORE_OPERATORS = {
117
117
  { name: "a", type: ANY, description: "Left operand" },
118
118
  { name: "b", type: ANY, description: "Right operand" }
119
119
  ],
120
- example: '["=", "@entity.status", "active"]'
120
+ example: '["=", "active", "active"]'
121
121
  },
122
122
  "==": {
123
123
  module: "core",
@@ -131,7 +131,7 @@ var CORE_OPERATORS = {
131
131
  { name: "a", type: ANY, description: "Left operand" },
132
132
  { name: "b", type: ANY, description: "Right operand" }
133
133
  ],
134
- example: '["==", "@entity.status", "active"]'
134
+ example: '["==", "active", "active"]'
135
135
  },
136
136
  "!=": {
137
137
  module: "core",
@@ -145,7 +145,7 @@ var CORE_OPERATORS = {
145
145
  { name: "a", type: ANY, description: "Left operand" },
146
146
  { name: "b", type: ANY, description: "Right operand" }
147
147
  ],
148
- example: '["!=", "@entity.id", null]'
148
+ example: '["!=", 1, null]'
149
149
  },
150
150
  "<": {
151
151
  module: "core",
@@ -159,7 +159,7 @@ var CORE_OPERATORS = {
159
159
  { name: "a", type: NUMBER, description: "Left operand" },
160
160
  { name: "b", type: NUMBER, description: "Right operand" }
161
161
  ],
162
- example: '["<", "@entity.health", 10]'
162
+ example: '["<", 5, 10]'
163
163
  },
164
164
  ">": {
165
165
  module: "core",
@@ -173,7 +173,7 @@ var CORE_OPERATORS = {
173
173
  { name: "a", type: NUMBER, description: "Left operand" },
174
174
  { name: "b", type: NUMBER, description: "Right operand" }
175
175
  ],
176
- example: '[">", "@entity.score", 0]'
176
+ example: '[">", 10, 0]'
177
177
  },
178
178
  "<=": {
179
179
  module: "core",
@@ -187,7 +187,7 @@ var CORE_OPERATORS = {
187
187
  { name: "a", type: NUMBER, description: "Left operand" },
188
188
  { name: "b", type: NUMBER, description: "Right operand" }
189
189
  ],
190
- example: '["<=", "@entity.count", 100]'
190
+ example: '["<=", 100, 100]'
191
191
  },
192
192
  ">=": {
193
193
  module: "core",
@@ -201,7 +201,7 @@ var CORE_OPERATORS = {
201
201
  { name: "a", type: NUMBER, description: "Left operand" },
202
202
  { name: "b", type: NUMBER, description: "Right operand" }
203
203
  ],
204
- example: '[">=", "@entity.age", 18]'
204
+ example: '[">=", 18, 18]'
205
205
  },
206
206
  // --- logic ------------------------------------------------------------------
207
207
  and: {
@@ -214,7 +214,7 @@ var CORE_OPERATORS = {
214
214
  returnType: "boolean",
215
215
  returnSemantics: "last-truthy-of-args",
216
216
  params: [{ name: "...conds", type: BOOLEAN, description: "Boolean expressions to AND" }],
217
- example: '["and", ["=", "@entity.active", true], [">", "@entity.score", 0]]'
217
+ example: '["and", ["=", "active", "active"], [">", 5, 0]]'
218
218
  },
219
219
  or: {
220
220
  module: "core",
@@ -226,7 +226,7 @@ var CORE_OPERATORS = {
226
226
  returnType: "boolean",
227
227
  returnSemantics: "first-truthy-of-args",
228
228
  params: [{ name: "...conds", type: BOOLEAN, description: "Boolean expressions to OR" }],
229
- example: '["or", ["=", "@entity.role", "admin"], ["=", "@entity.role", "owner"]]'
229
+ example: '["or", ["=", "admin", "user"], ["=", "admin", "owner"]]'
230
230
  },
231
231
  not: {
232
232
  module: "core",
@@ -237,7 +237,7 @@ var CORE_OPERATORS = {
237
237
  hasSideEffects: false,
238
238
  returnType: "boolean",
239
239
  params: [{ name: "cond", type: BOOLEAN, description: "Boolean to negate" }],
240
- example: '["not", "@entity.disabled"]'
240
+ example: '["not", false]'
241
241
  },
242
242
  if: {
243
243
  module: "core",
@@ -253,7 +253,7 @@ var CORE_OPERATORS = {
253
253
  { name: "then", type: ANY, description: "Value or effect if true" },
254
254
  { name: "else", type: ANY, description: "Value or effect if false" }
255
255
  ],
256
- example: '["if", [">", "@entity.health", 0], "alive", "dead"]'
256
+ example: '["if", [">", 5, 0], "alive", "dead"]'
257
257
  },
258
258
  // --- control ----------------------------------------------------------------
259
259
  let: {
@@ -361,7 +361,7 @@ var CORE_OPERATORS = {
361
361
  { name: "event", type: EVENT_KEY, description: "Event key" },
362
362
  { name: "payload", type: ENTITY_REF, description: "Optional payload", optional: true }
363
363
  ],
364
- example: '["emit", "PLAYER_DIED", { "playerId": "@entity.id" }]',
364
+ example: '["emit", "PLAYER_DIED", { "playerId": "p1" }]',
365
365
  effect: {
366
366
  kind: "emit",
367
367
  produces: {
@@ -396,7 +396,7 @@ var CORE_OPERATORS = {
396
396
  optional: true
397
397
  }
398
398
  ],
399
- example: '["persist", "create", "Task", { "title": "@payload.title" }, { "emit": { "success": "TASK_CREATED" } }]',
399
+ example: '["persist", "create", "Task", { "title": "Buy milk" }, { "emit": { "success": "TASK_CREATED" } }]',
400
400
  effect: {
401
401
  kind: "persist",
402
402
  // Action-discriminated union. The compiler narrows at the call site
@@ -450,7 +450,7 @@ var CORE_OPERATORS = {
450
450
  optional: true
451
451
  }
452
452
  ],
453
- example: '["navigate", "/tasks/:id", { "id": "@entity.id" }]',
453
+ example: '["navigate", "/tasks/:id", { "id": "t1" }]',
454
454
  effect: { kind: "navigate" }
455
455
  },
456
456
  "navigate-back": {
@@ -507,7 +507,7 @@ var CORE_OPERATORS = {
507
507
  optional: true
508
508
  }
509
509
  ],
510
- example: '["spawn", "Bullet", { "x": "@entity.x", "y": "@entity.y" }]',
510
+ example: '["spawn", "Bullet", { "x": 10, "y": 20 }]',
511
511
  effect: { kind: "spawn" }
512
512
  },
513
513
  despawn: {
@@ -552,18 +552,22 @@ var CORE_OPERATORS = {
552
552
  optional: true
553
553
  }
554
554
  ],
555
- example: '["fetch", "Task", { "id": "@payload.taskId", "emit": { "success": "TASK_LOADED" } }]',
555
+ example: '["fetch", "Task", { "id": "t1", "emit": { "success": "TASK_LOADED" } }]',
556
556
  effect: {
557
557
  kind: "fetch",
558
- // Call-site-discriminated union: options.id present -> single entity;
559
- // otherwise -> array of entity. The compiler narrows at the call site
560
- // when checking emit.success against the declared event payload.
561
558
  produces: {
562
- kind: "union",
563
- of: [
564
- { kind: "entity" },
565
- { kind: "array", of: { kind: "entity" } }
566
- ]
559
+ kind: "object",
560
+ fields: {
561
+ data: {
562
+ kind: "union",
563
+ of: [
564
+ { kind: "entity" },
565
+ { kind: "array", of: { kind: "entity" } }
566
+ ]
567
+ },
568
+ totalCount: "number"
569
+ },
570
+ open: false
567
571
  }
568
572
  }
569
573
  },
@@ -615,7 +619,7 @@ var CORE_OPERATORS = {
615
619
  optional: true
616
620
  }
617
621
  ],
618
- example: '["send-server", "CHAT_MESSAGE", { "text": "@input.text" }]',
622
+ example: '["send-server", "CHAT_MESSAGE", { "text": "hello" }]',
619
623
  effect: { kind: "send-server" }
620
624
  },
621
625
  ref: {
@@ -647,14 +651,21 @@ var CORE_OPERATORS = {
647
651
  example: '["ref", "Task"]',
648
652
  effect: {
649
653
  kind: "ref",
650
- // Same call-site shape as fetch. Kept for the V2 transition period;
654
+ // Same wrapper fetch emits. Kept for the V2 transition period;
651
655
  // scheduled for deprecation in a later phase (see Almadar_Entity_V2_Plan.md).
652
656
  produces: {
653
- kind: "union",
654
- of: [
655
- { kind: "entity" },
656
- { kind: "array", of: { kind: "entity" } }
657
- ]
657
+ kind: "object",
658
+ fields: {
659
+ data: {
660
+ kind: "union",
661
+ of: [
662
+ { kind: "entity" },
663
+ { kind: "array", of: { kind: "entity" } }
664
+ ]
665
+ },
666
+ totalCount: "number"
667
+ },
668
+ open: false
658
669
  }
659
670
  }
660
671
  },
@@ -682,7 +693,7 @@ var CORE_OPERATORS = {
682
693
  optional: true
683
694
  }
684
695
  ],
685
- example: '["call-service", "llm", "generate", { "userPrompt": "@entity.inputText" }, { "emit": { "success": "LlmCompleted", "failure": "LlmFailed" } }]',
696
+ example: '["call-service", "llm", "generate", { "userPrompt": "Hello" }, { "emit": { "success": "LlmCompleted", "failure": "LlmFailed" } }]',
686
697
  effect: {
687
698
  kind: "call-service",
688
699
  // TODO(entity-v2): narrow to the declared service return type once
@@ -1107,7 +1118,7 @@ var STR_OPERATORS = {
1107
1118
  hasSideEffects: false,
1108
1119
  returnType: "string",
1109
1120
  params: [{ name: "strings", type: "string", description: "Strings to concatenate" }],
1110
- example: '["str/concat", "/users/", "@entity.id"] // => "/users/123"'
1121
+ example: '["str/concat", "/users/", "123"] // => "/users/123"'
1111
1122
  },
1112
1123
  "str/upper": {
1113
1124
  module: "str",
@@ -1625,7 +1636,7 @@ var ARRAY_OPERATORS = {
1625
1636
  { name: "key", type: "string", description: "Field to sort by (for objects)", optional: true },
1626
1637
  { name: "dir", type: "string", description: '"asc" or "desc"', optional: true, defaultValue: "asc" }
1627
1638
  ],
1628
- example: '["array/sort", "@items", "price", "desc"]'
1639
+ example: '["array/sort", [{"price": 3}, {"price": 9}, {"price": 5}], "price", "desc"]'
1629
1640
  },
1630
1641
  "array/shuffle": {
1631
1642
  module: "array",
@@ -1717,7 +1728,7 @@ var ARRAY_OPERATORS = {
1717
1728
  { name: "arr", type: "array", description: "The array" },
1718
1729
  { name: "pred", type: "lambda", description: "Predicate function" }
1719
1730
  ],
1720
- example: '["array/find", "@items", ["fn", "x", ["=", "@x.status", "active"]]]'
1731
+ example: '["array/find", [{"status": "active"}, {"status": "archived"}], ["fn", "x", ["=", "@x.status", "active"]]]'
1721
1732
  },
1722
1733
  "array/findIndex": {
1723
1734
  module: "array",
@@ -1733,7 +1744,7 @@ var ARRAY_OPERATORS = {
1733
1744
  { name: "arr", type: "array", description: "The array" },
1734
1745
  { name: "pred", type: "lambda", description: "Predicate function" }
1735
1746
  ],
1736
- example: '["array/findIndex", "@items", ["fn", "x", ["=", "@x.status", "active"]]]'
1747
+ example: '["array/findIndex", [{"status": "active"}, {"status": "archived"}], ["fn", "x", ["=", "@x.status", "active"]]]'
1737
1748
  },
1738
1749
  "array/filter": {
1739
1750
  module: "array",
@@ -1750,7 +1761,7 @@ var ARRAY_OPERATORS = {
1750
1761
  { name: "arr", type: "array", description: "The array" },
1751
1762
  { name: "pred", type: "lambda", description: "Predicate function" }
1752
1763
  ],
1753
- example: '["array/filter", "@items", ["fn", "x", [">", "@x.price", 100]]]'
1764
+ example: '["array/filter", [{"price": 50}, {"price": 150}], ["fn", "x", [">", "@x.price", 100]]]'
1754
1765
  },
1755
1766
  "array/reject": {
1756
1767
  module: "array",
@@ -1767,7 +1778,7 @@ var ARRAY_OPERATORS = {
1767
1778
  { name: "arr", type: "array", description: "The array" },
1768
1779
  { name: "pred", type: "lambda", description: "Predicate function" }
1769
1780
  ],
1770
- example: '["array/reject", "@items", ["fn", "x", ["=", "@x.status", "deleted"]]]'
1781
+ example: '["array/reject", [{"status": "active"}, {"status": "deleted"}], ["fn", "x", ["=", "@x.status", "deleted"]]]'
1771
1782
  },
1772
1783
  "array/map": {
1773
1784
  module: "array",
@@ -1784,7 +1795,7 @@ var ARRAY_OPERATORS = {
1784
1795
  { name: "arr", type: "array", description: "The array" },
1785
1796
  { name: "fn", type: "lambda", description: "Transform function" }
1786
1797
  ],
1787
- example: '["array/map", "@items", ["fn", "x", ["*", "@x.price", 1.1]]]'
1798
+ example: '["array/map", [{"price": 100}, {"price": 200}], ["fn", "x", ["*", "@x.price", 1.1]]]'
1788
1799
  },
1789
1800
  "array/reduce": {
1790
1801
  module: "array",
@@ -1802,7 +1813,7 @@ var ARRAY_OPERATORS = {
1802
1813
  { name: "init", type: "any", description: "Initial accumulator value" },
1803
1814
  { name: "fn", type: "lambda", description: "Reducer function (acc, item) => newAcc" }
1804
1815
  ],
1805
- example: '["array/reduce", "@items", 0, ["fn", ["acc", "x"], ["+", "@acc", "@x.price"]]]'
1816
+ example: '["array/reduce", [{"price": 10}, {"price": 25}], 0, ["fn", ["acc", "x"], ["+", "@acc", "@x.price"]]]'
1806
1817
  },
1807
1818
  "array/every": {
1808
1819
  module: "array",
@@ -1818,7 +1829,7 @@ var ARRAY_OPERATORS = {
1818
1829
  { name: "arr", type: "array", description: "The array" },
1819
1830
  { name: "pred", type: "lambda", description: "Predicate function" }
1820
1831
  ],
1821
- example: '["array/every", "@items", ["fn", "x", [">", "@x.price", 0]]]'
1832
+ example: '["array/every", [{"price": 5}, {"price": 10}], ["fn", "x", [">", "@x.price", 0]]]'
1822
1833
  },
1823
1834
  "array/some": {
1824
1835
  module: "array",
@@ -1834,7 +1845,7 @@ var ARRAY_OPERATORS = {
1834
1845
  { name: "arr", type: "array", description: "The array" },
1835
1846
  { name: "pred", type: "lambda", description: "Predicate function" }
1836
1847
  ],
1837
- example: '["array/some", "@items", ["fn", "x", ["=", "@x.status", "active"]]]'
1848
+ example: '["array/some", [{"status": "archived"}, {"status": "active"}], ["fn", "x", ["=", "@x.status", "active"]]]'
1838
1849
  },
1839
1850
  "array/count": {
1840
1851
  module: "array",
@@ -1850,7 +1861,7 @@ var ARRAY_OPERATORS = {
1850
1861
  { name: "arr", type: "array", description: "The array" },
1851
1862
  { name: "pred", type: "lambda", description: "Predicate function", optional: true }
1852
1863
  ],
1853
- example: '["array/count", "@tasks", ["fn", "t", ["=", "@t.status", "done"]]]'
1864
+ example: '["array/count", [{"status": "done"}, {"status": "todo"}], ["fn", "t", ["=", "@t.status", "done"]]]'
1854
1865
  },
1855
1866
  "array/sum": {
1856
1867
  module: "array",
@@ -1864,7 +1875,7 @@ var ARRAY_OPERATORS = {
1864
1875
  { name: "arr", type: "array", description: "The array" },
1865
1876
  { name: "key", type: "string", description: "Field to sum", optional: true }
1866
1877
  ],
1867
- example: '["array/sum", "@cart.items", "price"]'
1878
+ example: '["array/sum", [{"price": 10}, {"price": 25}], "price"]'
1868
1879
  },
1869
1880
  "array/avg": {
1870
1881
  module: "array",
@@ -1878,7 +1889,7 @@ var ARRAY_OPERATORS = {
1878
1889
  { name: "arr", type: "array", description: "The array" },
1879
1890
  { name: "key", type: "string", description: "Field to average", optional: true }
1880
1891
  ],
1881
- example: '["array/avg", "@ratings", "score"]'
1892
+ example: '["array/avg", [{"score": 80}, {"score": 90}], "score"]'
1882
1893
  },
1883
1894
  "array/min": {
1884
1895
  module: "array",
@@ -1892,7 +1903,7 @@ var ARRAY_OPERATORS = {
1892
1903
  { name: "arr", type: "array", description: "The array" },
1893
1904
  { name: "key", type: "string", description: "Field to compare", optional: true }
1894
1905
  ],
1895
- example: '["array/min", "@products", "price"]'
1906
+ example: '["array/min", [{"price": 3}, {"price": 9}], "price"]'
1896
1907
  },
1897
1908
  "array/max": {
1898
1909
  module: "array",
@@ -1906,7 +1917,7 @@ var ARRAY_OPERATORS = {
1906
1917
  { name: "arr", type: "array", description: "The array" },
1907
1918
  { name: "key", type: "string", description: "Field to compare", optional: true }
1908
1919
  ],
1909
- example: '["array/max", "@products", "price"]'
1920
+ example: '["array/max", [{"price": 3}, {"price": 9}], "price"]'
1910
1921
  },
1911
1922
  "array/groupBy": {
1912
1923
  module: "array",
@@ -1920,7 +1931,7 @@ var ARRAY_OPERATORS = {
1920
1931
  { name: "arr", type: "array", description: "The array" },
1921
1932
  { name: "key", type: "string", description: "Field to group by" }
1922
1933
  ],
1923
- example: '["array/groupBy", "@orders", "status"]'
1934
+ example: '["array/groupBy", [{"status": "new"}, {"status": "done"}], "status"]'
1924
1935
  },
1925
1936
  "array/partition": {
1926
1937
  module: "array",
@@ -1936,7 +1947,7 @@ var ARRAY_OPERATORS = {
1936
1947
  { name: "arr", type: "array", description: "The array" },
1937
1948
  { name: "pred", type: "lambda", description: "Predicate function" }
1938
1949
  ],
1939
- example: '["array/partition", "@items", ["fn", "x", [">", "@x.price", 50]]]'
1950
+ example: '["array/partition", [{"price": 30}, {"price": 80}], ["fn", "x", [">", "@x.price", 50]]]'
1940
1951
  },
1941
1952
  "array/take": {
1942
1953
  module: "array",
@@ -1950,7 +1961,7 @@ var ARRAY_OPERATORS = {
1950
1961
  { name: "arr", type: "array", description: "The array" },
1951
1962
  { name: "n", type: "number", description: "Number of elements" }
1952
1963
  ],
1953
- example: '["array/take", "@items", 5]'
1964
+ example: '["array/take", [1, 2, 3, 4, 5, 6, 7], 5]'
1954
1965
  },
1955
1966
  "array/drop": {
1956
1967
  module: "array",
@@ -1964,7 +1975,7 @@ var ARRAY_OPERATORS = {
1964
1975
  { name: "arr", type: "array", description: "The array" },
1965
1976
  { name: "n", type: "number", description: "Number of elements to skip" }
1966
1977
  ],
1967
- example: '["array/drop", "@items", 5]'
1978
+ example: '["array/drop", [1, 2, 3, 4, 5, 6, 7], 5]'
1968
1979
  },
1969
1980
  "array/takeLast": {
1970
1981
  module: "array",
@@ -1978,7 +1989,7 @@ var ARRAY_OPERATORS = {
1978
1989
  { name: "arr", type: "array", description: "The array" },
1979
1990
  { name: "n", type: "number", description: "Number of elements" }
1980
1991
  ],
1981
- example: '["array/takeLast", "@items", 3]'
1992
+ example: '["array/takeLast", [1, 2, 3, 4, 5], 3]'
1982
1993
  },
1983
1994
  "array/dropLast": {
1984
1995
  module: "array",
@@ -1992,7 +2003,7 @@ var ARRAY_OPERATORS = {
1992
2003
  { name: "arr", type: "array", description: "The array" },
1993
2004
  { name: "n", type: "number", description: "Number of elements to skip" }
1994
2005
  ],
1995
- example: '["array/dropLast", "@items", 2]'
2006
+ example: '["array/dropLast", [1, 2, 3, 4, 5], 2]'
1996
2007
  },
1997
2008
  "array/cosine": {
1998
2009
  module: "array",
@@ -2006,7 +2017,7 @@ var ARRAY_OPERATORS = {
2006
2017
  { name: "a", type: { kind: "array", of: "number" }, description: "First vector" },
2007
2018
  { name: "b", type: { kind: "array", of: "number" }, description: "Second vector" }
2008
2019
  ],
2009
- example: '["array/cosine", "@entity.answerEmbedding", "@entity.referenceEmbedding"]'
2020
+ example: '["array/cosine", [1, 0], [0, 1]]'
2010
2021
  },
2011
2022
  "array/nearest": {
2012
2023
  module: "array",
@@ -2020,7 +2031,7 @@ var ARRAY_OPERATORS = {
2020
2031
  { name: "query", type: { kind: "array", of: "number" }, description: "Query vector" },
2021
2032
  { name: "candidates", type: { kind: "array", of: { kind: "array", of: "number" } }, description: "Candidate vectors to search" }
2022
2033
  ],
2023
- example: '["array/nearest", "@entity.queryEmbedding", "@entity.candidateEmbeddings"]'
2034
+ example: '["array/nearest", [1, 0], [[1, 0], [0, 1]]]'
2024
2035
  }
2025
2036
  };
2026
2037
  function getArrayOperators() {
@@ -2090,7 +2101,7 @@ var OBJECT_OPERATORS = {
2090
2101
  { name: "path", type: "string", description: 'Dot-separated path (e.g., "user.name")' },
2091
2102
  { name: "default", type: "any", description: "Default if path not found", optional: true }
2092
2103
  ],
2093
- example: '["object/get", "@user", "profile.name", "Anonymous"]'
2104
+ example: '["object/get", {"profile": {"name": "Ann"}}, "profile.name", "Anonymous"]'
2094
2105
  },
2095
2106
  "object/set": {
2096
2107
  module: "object",
@@ -2105,7 +2116,7 @@ var OBJECT_OPERATORS = {
2105
2116
  { name: "path", type: "string", description: "Dot-separated path" },
2106
2117
  { name: "value", type: "any", description: "Value to set" }
2107
2118
  ],
2108
- example: '["object/set", "@user", "profile.name", "John"]'
2119
+ example: '["object/set", {"profile": {"name": "Ann"}}, "profile.name", "John"]'
2109
2120
  },
2110
2121
  "object/has": {
2111
2122
  module: "object",
@@ -2119,7 +2130,7 @@ var OBJECT_OPERATORS = {
2119
2130
  { name: "obj", type: "object", description: "The object" },
2120
2131
  { name: "path", type: "string", description: "Dot-separated path" }
2121
2132
  ],
2122
- example: '["object/has", "@user", "profile.name"]'
2133
+ example: '["object/has", {"profile": {"name": "Ann"}}, "profile.name"]'
2123
2134
  },
2124
2135
  "object/merge": {
2125
2136
  module: "object",
@@ -2156,7 +2167,7 @@ var OBJECT_OPERATORS = {
2156
2167
  { name: "obj", type: "object", description: "The object" },
2157
2168
  { name: "keys", type: "array", description: "Keys to keep" }
2158
2169
  ],
2159
- example: '["object/pick", "@entity", ["name", "email"]]'
2170
+ example: '["object/pick", {"name": "Ann", "email": "ann@example.com", "age": 30}, ["name", "email"]]'
2160
2171
  },
2161
2172
  "object/omit": {
2162
2173
  module: "object",
@@ -2170,7 +2181,7 @@ var OBJECT_OPERATORS = {
2170
2181
  { name: "obj", type: "object", description: "The object" },
2171
2182
  { name: "keys", type: "array", description: "Keys to exclude" }
2172
2183
  ],
2173
- example: '["object/omit", "@entity", ["password", "secret"]]'
2184
+ example: '["object/omit", {"name": "Ann", "password": "x"}, ["password"]]'
2174
2185
  },
2175
2186
  "object/mapValues": {
2176
2187
  module: "object",
@@ -2186,7 +2197,7 @@ var OBJECT_OPERATORS = {
2186
2197
  { name: "obj", type: "object", description: "The object" },
2187
2198
  { name: "fn", type: "lambda", description: "Transform function" }
2188
2199
  ],
2189
- example: '["object/mapValues", "@stats", ["fn", "v", ["*", "@v", 100]]]'
2200
+ example: '["object/mapValues", {"a": 0.5, "b": 0.25}, ["fn", "v", ["*", "@v", 100]]]'
2190
2201
  },
2191
2202
  "object/mapKeys": {
2192
2203
  module: "object",
@@ -2202,7 +2213,7 @@ var OBJECT_OPERATORS = {
2202
2213
  { name: "obj", type: "object", description: "The object" },
2203
2214
  { name: "fn", type: "lambda", description: "Transform function" }
2204
2215
  ],
2205
- example: '["object/mapKeys", "@data", ["fn", "k", ["str/upper", "@k"]]]'
2216
+ example: '["object/mapKeys", {"a": 1, "b": 2}, ["fn", "k", ["str/upper", "@k"]]]'
2206
2217
  },
2207
2218
  "object/filter": {
2208
2219
  module: "object",
@@ -2218,7 +2229,7 @@ var OBJECT_OPERATORS = {
2218
2229
  { name: "obj", type: "object", description: "The object" },
2219
2230
  { name: "pred", type: "lambda", description: "Predicate (key, value) => boolean" }
2220
2231
  ],
2221
- example: '["object/filter", "@data", ["fn", ["k", "v"], ["!=", "@v", null]]]'
2232
+ example: '["object/filter", {"a": 1, "b": null}, ["fn", ["k", "v"], ["!=", "@v", null]]]'
2222
2233
  },
2223
2234
  "object/equals": {
2224
2235
  module: "object",
@@ -2243,7 +2254,7 @@ var OBJECT_OPERATORS = {
2243
2254
  hasSideEffects: false,
2244
2255
  returnType: "any",
2245
2256
  params: [{ name: "obj", type: "object", description: "The object" }],
2246
- example: '["object/clone", "@entity"]'
2257
+ example: '["object/clone", {"a": 1, "b": 2}]'
2247
2258
  },
2248
2259
  "object/deepClone": {
2249
2260
  module: "object",
@@ -2254,7 +2265,7 @@ var OBJECT_OPERATORS = {
2254
2265
  hasSideEffects: false,
2255
2266
  returnType: "any",
2256
2267
  params: [{ name: "obj", type: "object", description: "The object" }],
2257
- example: '["object/deepClone", "@entity"]'
2268
+ example: '["object/deepClone", {"a": {"b": 2}}]'
2258
2269
  },
2259
2270
  "path": {
2260
2271
  module: "object",
@@ -2268,7 +2279,7 @@ var OBJECT_OPERATORS = {
2268
2279
  params: [
2269
2280
  { name: "...segments", type: "string[]", description: "Path segments to join with dots" }
2270
2281
  ],
2271
- example: '["path", "formValues", "@payload.fieldId"] // => "formValues.customerName"'
2282
+ example: '["path", "formValues", "customerName"] // => "formValues.customerName"'
2272
2283
  }
2273
2284
  };
2274
2285
  function getObjectOperators() {
@@ -2325,7 +2336,7 @@ var TIME_OPERATORS = {
2325
2336
  { name: "date", type: "number", description: "Timestamp" },
2326
2337
  { name: "format", type: "string", description: "Format pattern" }
2327
2338
  ],
2328
- example: '["time/format", "@entity.createdAt", "MMM DD, YYYY"]'
2339
+ example: '["time/format", 1700000000000, "MMM DD, YYYY"]'
2329
2340
  },
2330
2341
  "time/year": {
2331
2342
  module: "time",
@@ -2336,7 +2347,7 @@ var TIME_OPERATORS = {
2336
2347
  hasSideEffects: false,
2337
2348
  returnType: "number",
2338
2349
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2339
- example: '["time/year", "@entity.createdAt"] // => 2024'
2350
+ example: '["time/year", 1700000000000] // => 2023'
2340
2351
  },
2341
2352
  "time/month": {
2342
2353
  module: "time",
@@ -2347,7 +2358,7 @@ var TIME_OPERATORS = {
2347
2358
  hasSideEffects: false,
2348
2359
  returnType: "number",
2349
2360
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2350
- example: '["time/month", "@entity.createdAt"] // => 1'
2361
+ example: '["time/month", 1700000000000] // => 11'
2351
2362
  },
2352
2363
  "time/day": {
2353
2364
  module: "time",
@@ -2358,7 +2369,7 @@ var TIME_OPERATORS = {
2358
2369
  hasSideEffects: false,
2359
2370
  returnType: "number",
2360
2371
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2361
- example: '["time/day", "@entity.createdAt"] // => 18'
2372
+ example: '["time/day", 1700000000000] // => 14'
2362
2373
  },
2363
2374
  "time/weekday": {
2364
2375
  module: "time",
@@ -2369,7 +2380,7 @@ var TIME_OPERATORS = {
2369
2380
  hasSideEffects: false,
2370
2381
  returnType: "number",
2371
2382
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2372
- example: '["time/weekday", "@entity.createdAt"] // => 4 (Thursday)'
2383
+ example: '["time/weekday", 1700000000000] // => 2 (Tuesday)'
2373
2384
  },
2374
2385
  "time/hour": {
2375
2386
  module: "time",
@@ -2380,7 +2391,7 @@ var TIME_OPERATORS = {
2380
2391
  hasSideEffects: false,
2381
2392
  returnType: "number",
2382
2393
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2383
- example: '["time/hour", "@entity.createdAt"] // => 14'
2394
+ example: '["time/hour", 1700000000000]'
2384
2395
  },
2385
2396
  "time/minute": {
2386
2397
  module: "time",
@@ -2391,7 +2402,7 @@ var TIME_OPERATORS = {
2391
2402
  hasSideEffects: false,
2392
2403
  returnType: "number",
2393
2404
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2394
- example: '["time/minute", "@entity.createdAt"] // => 30'
2405
+ example: '["time/minute", 1700000000000]'
2395
2406
  },
2396
2407
  "time/second": {
2397
2408
  module: "time",
@@ -2402,7 +2413,7 @@ var TIME_OPERATORS = {
2402
2413
  hasSideEffects: false,
2403
2414
  returnType: "number",
2404
2415
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2405
- example: '["time/second", "@entity.createdAt"] // => 45'
2416
+ example: '["time/second", 1700000000000]'
2406
2417
  },
2407
2418
  "time/add": {
2408
2419
  module: "time",
@@ -2447,7 +2458,7 @@ var TIME_OPERATORS = {
2447
2458
  { name: "b", type: "number", description: "Second timestamp" },
2448
2459
  { name: "unit", type: "string", description: "Result unit", optional: true, defaultValue: "ms" }
2449
2460
  ],
2450
- example: '["time/diff", "@entity.birthDate", ["time/now"], "year"]'
2461
+ example: '["time/diff", 1700000000000, ["time/now"], "year"]'
2451
2462
  },
2452
2463
  "time/startOf": {
2453
2464
  module: "time",
@@ -2489,7 +2500,7 @@ var TIME_OPERATORS = {
2489
2500
  { name: "a", type: "number", description: "First timestamp" },
2490
2501
  { name: "b", type: "number", description: "Second timestamp" }
2491
2502
  ],
2492
- example: '["time/isBefore", "@entity.startDate", "@entity.endDate"]'
2503
+ example: '["time/isBefore", 1700000000000, 1700086400000]'
2493
2504
  },
2494
2505
  "time/isAfter": {
2495
2506
  module: "time",
@@ -2503,7 +2514,7 @@ var TIME_OPERATORS = {
2503
2514
  { name: "a", type: "number", description: "First timestamp" },
2504
2515
  { name: "b", type: "number", description: "Second timestamp" }
2505
2516
  ],
2506
- example: '["time/isAfter", ["time/now"], "@entity.deadline"]'
2517
+ example: '["time/isAfter", ["time/now"], 1700000000000]'
2507
2518
  },
2508
2519
  "time/isBetween": {
2509
2520
  module: "time",
@@ -2518,7 +2529,7 @@ var TIME_OPERATORS = {
2518
2529
  { name: "start", type: "number", description: "Range start" },
2519
2530
  { name: "end", type: "number", description: "Range end" }
2520
2531
  ],
2521
- example: '["time/isBetween", ["time/now"], "@entity.startDate", "@entity.endDate"]'
2532
+ example: '["time/isBetween", ["time/now"], 1700000000000, 2000000000000]'
2522
2533
  },
2523
2534
  "time/isSame": {
2524
2535
  module: "time",
@@ -2533,7 +2544,7 @@ var TIME_OPERATORS = {
2533
2544
  { name: "b", type: "number", description: "Second timestamp" },
2534
2545
  { name: "unit", type: "string", description: "Comparison unit", optional: true }
2535
2546
  ],
2536
- example: '["time/isSame", "@a", "@b", "day"]'
2547
+ example: '["time/isSame", 1700000000000, 1700001000000, "day"]'
2537
2548
  },
2538
2549
  "time/isPast": {
2539
2550
  module: "time",
@@ -2544,7 +2555,7 @@ var TIME_OPERATORS = {
2544
2555
  hasSideEffects: false,
2545
2556
  returnType: "boolean",
2546
2557
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2547
- example: '["time/isPast", "@entity.expiresAt"]'
2558
+ example: '["time/isPast", 1700000000000]'
2548
2559
  },
2549
2560
  "time/isFuture": {
2550
2561
  module: "time",
@@ -2555,7 +2566,7 @@ var TIME_OPERATORS = {
2555
2566
  hasSideEffects: false,
2556
2567
  returnType: "boolean",
2557
2568
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2558
- example: '["time/isFuture", "@entity.scheduledAt"]'
2569
+ example: '["time/isFuture", 2000000000000]'
2559
2570
  },
2560
2571
  "time/isToday": {
2561
2572
  module: "time",
@@ -2566,7 +2577,7 @@ var TIME_OPERATORS = {
2566
2577
  hasSideEffects: false,
2567
2578
  returnType: "boolean",
2568
2579
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2569
- example: '["time/isToday", "@entity.createdAt"]'
2580
+ example: '["time/isToday", ["time/now"]]'
2570
2581
  },
2571
2582
  "time/relative": {
2572
2583
  module: "time",
@@ -2577,7 +2588,7 @@ var TIME_OPERATORS = {
2577
2588
  hasSideEffects: false,
2578
2589
  returnType: "string",
2579
2590
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2580
- example: '["time/relative", "@entity.lastActivityAt"] // => "2 hours ago"'
2591
+ example: '["time/relative", 1700000000000] // => "2 years ago"'
2581
2592
  },
2582
2593
  "time/duration": {
2583
2594
  module: "time",
@@ -2606,7 +2617,7 @@ var VALIDATE_OPERATORS = {
2606
2617
  hasSideEffects: false,
2607
2618
  returnType: "boolean",
2608
2619
  params: [{ name: "value", type: "any", description: "Value to check" }],
2609
- example: '["validate/required", "@payload.name"]'
2620
+ example: '["validate/required", "Ann"]'
2610
2621
  },
2611
2622
  "validate/string": {
2612
2623
  module: "validate",
@@ -2617,7 +2628,7 @@ var VALIDATE_OPERATORS = {
2617
2628
  hasSideEffects: false,
2618
2629
  returnType: "boolean",
2619
2630
  params: [{ name: "value", type: "any", description: "Value to check" }],
2620
- example: '["validate/string", "@payload.name"]'
2631
+ example: '["validate/string", "Ann"]'
2621
2632
  },
2622
2633
  "validate/number": {
2623
2634
  module: "validate",
@@ -2628,7 +2639,7 @@ var VALIDATE_OPERATORS = {
2628
2639
  hasSideEffects: false,
2629
2640
  returnType: "boolean",
2630
2641
  params: [{ name: "value", type: "any", description: "Value to check" }],
2631
- example: '["validate/number", "@payload.age"]'
2642
+ example: '["validate/number", 42]'
2632
2643
  },
2633
2644
  "validate/boolean": {
2634
2645
  module: "validate",
@@ -2639,7 +2650,7 @@ var VALIDATE_OPERATORS = {
2639
2650
  hasSideEffects: false,
2640
2651
  returnType: "boolean",
2641
2652
  params: [{ name: "value", type: "any", description: "Value to check" }],
2642
- example: '["validate/boolean", "@payload.active"]'
2653
+ example: '["validate/boolean", true]'
2643
2654
  },
2644
2655
  "validate/array": {
2645
2656
  module: "validate",
@@ -2650,7 +2661,7 @@ var VALIDATE_OPERATORS = {
2650
2661
  hasSideEffects: false,
2651
2662
  returnType: "boolean",
2652
2663
  params: [{ name: "value", type: "any", description: "Value to check" }],
2653
- example: '["validate/array", "@payload.items"]'
2664
+ example: '["validate/array", [1, 2]]'
2654
2665
  },
2655
2666
  "validate/object": {
2656
2667
  module: "validate",
@@ -2661,7 +2672,7 @@ var VALIDATE_OPERATORS = {
2661
2672
  hasSideEffects: false,
2662
2673
  returnType: "boolean",
2663
2674
  params: [{ name: "value", type: "any", description: "Value to check" }],
2664
- example: '["validate/object", "@payload.data"]'
2675
+ example: '["validate/object", {"a": 1}]'
2665
2676
  },
2666
2677
  "validate/email": {
2667
2678
  module: "validate",
@@ -2672,7 +2683,7 @@ var VALIDATE_OPERATORS = {
2672
2683
  hasSideEffects: false,
2673
2684
  returnType: "boolean",
2674
2685
  params: [{ name: "value", type: "string", description: "Email to validate" }],
2675
- example: '["validate/email", "@payload.email"]'
2686
+ example: '["validate/email", "ann@example.com"]'
2676
2687
  },
2677
2688
  "validate/url": {
2678
2689
  module: "validate",
@@ -2683,7 +2694,7 @@ var VALIDATE_OPERATORS = {
2683
2694
  hasSideEffects: false,
2684
2695
  returnType: "boolean",
2685
2696
  params: [{ name: "value", type: "string", description: "URL to validate" }],
2686
- example: '["validate/url", "@payload.website"]'
2697
+ example: '["validate/url", "https://example.com"]'
2687
2698
  },
2688
2699
  "validate/uuid": {
2689
2700
  module: "validate",
@@ -2694,7 +2705,7 @@ var VALIDATE_OPERATORS = {
2694
2705
  hasSideEffects: false,
2695
2706
  returnType: "boolean",
2696
2707
  params: [{ name: "value", type: "string", description: "UUID to validate" }],
2697
- example: '["validate/uuid", "@payload.id"]'
2708
+ example: '["validate/uuid", "550e8400-e29b-41d4-a716-446655440000"]'
2698
2709
  },
2699
2710
  "validate/phone": {
2700
2711
  module: "validate",
@@ -2705,7 +2716,7 @@ var VALIDATE_OPERATORS = {
2705
2716
  hasSideEffects: false,
2706
2717
  returnType: "boolean",
2707
2718
  params: [{ name: "value", type: "string", description: "Phone number to validate" }],
2708
- example: '["validate/phone", "@payload.phone"]'
2719
+ example: '["validate/phone", "+15551234567"]'
2709
2720
  },
2710
2721
  "validate/creditCard": {
2711
2722
  module: "validate",
@@ -2716,7 +2727,7 @@ var VALIDATE_OPERATORS = {
2716
2727
  hasSideEffects: false,
2717
2728
  returnType: "boolean",
2718
2729
  params: [{ name: "value", type: "string", description: "Card number to validate" }],
2719
- example: '["validate/creditCard", "@payload.cardNumber"]'
2730
+ example: '["validate/creditCard", "4111111111111111"]'
2720
2731
  },
2721
2732
  "validate/date": {
2722
2733
  module: "validate",
@@ -2727,7 +2738,7 @@ var VALIDATE_OPERATORS = {
2727
2738
  hasSideEffects: false,
2728
2739
  returnType: "boolean",
2729
2740
  params: [{ name: "value", type: "any", description: "Value to check" }],
2730
- example: '["validate/date", "@payload.birthDate"]'
2741
+ example: '["validate/date", "2024-01-18"]'
2731
2742
  },
2732
2743
  "validate/minLength": {
2733
2744
  module: "validate",
@@ -2741,7 +2752,7 @@ var VALIDATE_OPERATORS = {
2741
2752
  { name: "value", type: "string | array", description: "Value to check" },
2742
2753
  { name: "min", type: "number", description: "Minimum length" }
2743
2754
  ],
2744
- example: '["validate/minLength", "@payload.password", 8]'
2755
+ example: '["validate/minLength", "password123", 8]'
2745
2756
  },
2746
2757
  "validate/maxLength": {
2747
2758
  module: "validate",
@@ -2755,7 +2766,7 @@ var VALIDATE_OPERATORS = {
2755
2766
  { name: "value", type: "string | array", description: "Value to check" },
2756
2767
  { name: "max", type: "number", description: "Maximum length" }
2757
2768
  ],
2758
- example: '["validate/maxLength", "@payload.name", 50]'
2769
+ example: '["validate/maxLength", "Ann", 50]'
2759
2770
  },
2760
2771
  "validate/length": {
2761
2772
  module: "validate",
@@ -2769,7 +2780,7 @@ var VALIDATE_OPERATORS = {
2769
2780
  { name: "value", type: "string | array", description: "Value to check" },
2770
2781
  { name: "exact", type: "number", description: "Required length" }
2771
2782
  ],
2772
- example: '["validate/length", "@payload.code", 6]'
2783
+ example: '["validate/length", "ABC123", 6]'
2773
2784
  },
2774
2785
  "validate/min": {
2775
2786
  module: "validate",
@@ -2783,7 +2794,7 @@ var VALIDATE_OPERATORS = {
2783
2794
  { name: "value", type: "number", description: "Number to check" },
2784
2795
  { name: "min", type: "number", description: "Minimum value" }
2785
2796
  ],
2786
- example: '["validate/min", "@payload.age", 18]'
2797
+ example: '["validate/min", 21, 18]'
2787
2798
  },
2788
2799
  "validate/max": {
2789
2800
  module: "validate",
@@ -2797,7 +2808,7 @@ var VALIDATE_OPERATORS = {
2797
2808
  { name: "value", type: "number", description: "Number to check" },
2798
2809
  { name: "max", type: "number", description: "Maximum value" }
2799
2810
  ],
2800
- example: '["validate/max", "@payload.quantity", 100]'
2811
+ example: '["validate/max", 50, 100]'
2801
2812
  },
2802
2813
  "validate/range": {
2803
2814
  module: "validate",
@@ -2812,7 +2823,7 @@ var VALIDATE_OPERATORS = {
2812
2823
  { name: "min", type: "number", description: "Minimum value" },
2813
2824
  { name: "max", type: "number", description: "Maximum value" }
2814
2825
  ],
2815
- example: '["validate/range", "@payload.rating", 1, 5]'
2826
+ example: '["validate/range", 4, 1, 5]'
2816
2827
  },
2817
2828
  "validate/pattern": {
2818
2829
  module: "validate",
@@ -2826,7 +2837,7 @@ var VALIDATE_OPERATORS = {
2826
2837
  { name: "value", type: "string", description: "String to check" },
2827
2838
  { name: "regex", type: "string", description: "Regex pattern" }
2828
2839
  ],
2829
- example: '["validate/pattern", "@payload.code", "^[A-Z]{3}[0-9]{3}$"]'
2840
+ example: '["validate/pattern", "ABC123", "^[A-Z]{3}[0-9]{3}$"]'
2830
2841
  },
2831
2842
  "validate/oneOf": {
2832
2843
  module: "validate",
@@ -2840,7 +2851,7 @@ var VALIDATE_OPERATORS = {
2840
2851
  { name: "value", type: "any", description: "Value to check" },
2841
2852
  { name: "options", type: "array", description: "Allowed values" }
2842
2853
  ],
2843
- example: '["validate/oneOf", "@payload.role", ["admin", "user", "guest"]]'
2854
+ example: '["validate/oneOf", "admin", ["admin", "user", "guest"]]'
2844
2855
  },
2845
2856
  "validate/noneOf": {
2846
2857
  module: "validate",
@@ -2854,7 +2865,7 @@ var VALIDATE_OPERATORS = {
2854
2865
  { name: "value", type: "any", description: "Value to check" },
2855
2866
  { name: "options", type: "array", description: "Disallowed values" }
2856
2867
  ],
2857
- example: '["validate/noneOf", "@payload.username", ["admin", "root", "system"]]'
2868
+ example: '["validate/noneOf", "alice", ["admin", "root", "system"]]'
2858
2869
  },
2859
2870
  "validate/equals": {
2860
2871
  module: "validate",
@@ -2868,7 +2879,7 @@ var VALIDATE_OPERATORS = {
2868
2879
  { name: "a", type: "any", description: "First value" },
2869
2880
  { name: "b", type: "any", description: "Second value" }
2870
2881
  ],
2871
- example: '["validate/equals", "@payload.password", "@payload.confirmPassword"]'
2882
+ example: '["validate/equals", "secret", "secret"]'
2872
2883
  },
2873
2884
  "validate/check": {
2874
2885
  module: "validate",
@@ -2882,11 +2893,7 @@ var VALIDATE_OPERATORS = {
2882
2893
  { name: "value", type: "any", description: "Value or object to validate" },
2883
2894
  { name: "rules", type: "object", description: "Validation rules by field" }
2884
2895
  ],
2885
- example: `["validate/check", "@payload.data", {
2886
- "name": [["required"], ["minLength", 2], ["maxLength", 50]],
2887
- "email": [["required"], ["email"]],
2888
- "age": [["number"], ["min", 18]]
2889
- }]`
2896
+ example: '["validate/check", {"name": "Ann", "email": "ann@example.com", "age": 20}, {"name": [["required"], ["minLength", 2], ["maxLength", 50]], "email": [["required"], ["email"]], "age": [["number"]]}]'
2890
2897
  }
2891
2898
  };
2892
2899
  function getValidateOperators() {
@@ -3271,7 +3278,7 @@ var NN_OPERATORS = {
3271
3278
  { name: "module", type: "nn/module", description: "The neural network module" },
3272
3279
  { name: "input", type: "tensor", description: "Input tensor" }
3273
3280
  ],
3274
- example: '["nn/forward", "@entity.architecture", "@entity.sensors"]'
3281
+ example: '["nn/forward", {"layers": [{"type": "dense", "units": 2}]}, [0.1, 0.2]]'
3275
3282
  },
3276
3283
  "nn/getWeights": {
3277
3284
  module: "nn",
@@ -3284,7 +3291,7 @@ var NN_OPERATORS = {
3284
3291
  params: [
3285
3292
  { name: "module", type: "nn/module", description: "The neural network module" }
3286
3293
  ],
3287
- example: '["nn/getWeights", "@entity.architecture"]'
3294
+ example: '["nn/getWeights", {"layers": [{"type": "dense", "units": 2}]}]'
3288
3295
  },
3289
3296
  "nn/setWeights": {
3290
3297
  module: "nn",
@@ -3298,7 +3305,7 @@ var NN_OPERATORS = {
3298
3305
  { name: "module", type: "nn/module", description: "The neural network module" },
3299
3306
  { name: "weights", type: "tensor", description: "New weights as flat tensor" }
3300
3307
  ],
3301
- example: '["nn/setWeights", "@entity.architecture", "@payload.newWeights"]'
3308
+ example: '["nn/setWeights", {"layers": [{"type": "dense", "units": 2}]}, [0.1, 0.2, 0.3]]'
3302
3309
  },
3303
3310
  "nn/paramCount": {
3304
3311
  module: "nn",
@@ -3311,7 +3318,7 @@ var NN_OPERATORS = {
3311
3318
  params: [
3312
3319
  { name: "module", type: "nn/module", description: "The neural network module" }
3313
3320
  ],
3314
- example: '["nn/paramCount", "@entity.architecture"] // => 3300'
3321
+ example: '["nn/paramCount", {"layers": [{"type": "dense", "units": 2}]}]'
3315
3322
  },
3316
3323
  "nn/clone": {
3317
3324
  module: "nn",
@@ -3324,7 +3331,7 @@ var NN_OPERATORS = {
3324
3331
  params: [
3325
3332
  { name: "module", type: "nn/module", description: "The neural network module to clone" }
3326
3333
  ],
3327
- example: '["nn/clone", "@entity.architecture"]'
3334
+ example: '["nn/clone", {"layers": [{"type": "dense", "units": 2}]}]'
3328
3335
  },
3329
3336
  // ============================================================================
3330
3337
  // ML lifecycle effect (bare alias invoked by std ML behaviors)
@@ -3341,7 +3348,7 @@ var NN_OPERATORS = {
3341
3348
  { name: "model", type: "nn/module", description: "The neural network module" },
3342
3349
  { name: "input", type: "tensor", description: "Input tensor" }
3343
3350
  ],
3344
- example: '["forward", "@entity.model", "@entity.input"]'
3351
+ example: '["forward", {"layers": [{"type": "dense", "units": 2}]}, [0.5]]'
3345
3352
  }
3346
3353
  };
3347
3354
  function getNnOperators() {
@@ -3432,7 +3439,7 @@ var TENSOR_OPERATORS = {
3432
3439
  params: [
3433
3440
  { name: "tensor", type: "tensor", description: "The tensor" }
3434
3441
  ],
3435
- example: '["tensor/shape", "@entity.sensors"] // => [16]'
3442
+ example: '["tensor/shape", [[1, 2], [3, 4]]] // => [2, 2]'
3436
3443
  },
3437
3444
  "tensor/get": {
3438
3445
  module: "tensor",
@@ -3446,7 +3453,7 @@ var TENSOR_OPERATORS = {
3446
3453
  { name: "tensor", type: "tensor", description: "The tensor" },
3447
3454
  { name: "index", type: "number | number[]", description: "Index (single for 1D, array for multi-D)" }
3448
3455
  ],
3449
- example: '["tensor/get", "@entity.output", 3] // Get 4th element'
3456
+ example: '["tensor/get", [10, 20, 30, 40], 3] // Get 4th element'
3450
3457
  },
3451
3458
  "tensor/slice": {
3452
3459
  module: "tensor",
@@ -3461,7 +3468,7 @@ var TENSOR_OPERATORS = {
3461
3468
  { name: "start", type: "number", description: "Start index" },
3462
3469
  { name: "end", type: "number", description: "End index (exclusive)" }
3463
3470
  ],
3464
- example: '["tensor/slice", "@entity.output", 0, 3] // First 3 elements'
3471
+ example: '["tensor/slice", [10, 20, 30, 40], 0, 3] // First 3 elements'
3465
3472
  },
3466
3473
  "tensor/reshape": {
3467
3474
  module: "tensor",
@@ -3475,7 +3482,7 @@ var TENSOR_OPERATORS = {
3475
3482
  { name: "tensor", type: "tensor", description: "The tensor" },
3476
3483
  { name: "shape", type: "number[]", description: "New shape" }
3477
3484
  ],
3478
- example: '["tensor/reshape", "@entity.data", [4, 4]] // Reshape to 4x4'
3485
+ example: '["tensor/reshape", [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 4]] // Reshape to 4x4'
3479
3486
  },
3480
3487
  "tensor/flatten": {
3481
3488
  module: "tensor",
@@ -3488,7 +3495,7 @@ var TENSOR_OPERATORS = {
3488
3495
  params: [
3489
3496
  { name: "tensor", type: "tensor", description: "The tensor" }
3490
3497
  ],
3491
- example: '["tensor/flatten", "@entity.data"]'
3498
+ example: '["tensor/flatten", [[1, 2], [3, 4]]]'
3492
3499
  },
3493
3500
  // ============================================================================
3494
3501
  // Math Operations
@@ -3505,7 +3512,7 @@ var TENSOR_OPERATORS = {
3505
3512
  { name: "a", type: "tensor", description: "First tensor" },
3506
3513
  { name: "b", type: "tensor | number", description: "Second tensor or scalar" }
3507
3514
  ],
3508
- example: '["tensor/add", "@entity.a", "@entity.b"]'
3515
+ example: '["tensor/add", [1, 2], [3, 4]]'
3509
3516
  },
3510
3517
  "tensor/sub": {
3511
3518
  module: "tensor",
@@ -3519,7 +3526,7 @@ var TENSOR_OPERATORS = {
3519
3526
  { name: "a", type: "tensor", description: "First tensor" },
3520
3527
  { name: "b", type: "tensor | number", description: "Second tensor or scalar" }
3521
3528
  ],
3522
- example: '["tensor/sub", "@entity.a", "@entity.b"]'
3529
+ example: '["tensor/sub", [1, 2], [3, 4]]'
3523
3530
  },
3524
3531
  "tensor/mul": {
3525
3532
  module: "tensor",
@@ -3533,7 +3540,7 @@ var TENSOR_OPERATORS = {
3533
3540
  { name: "a", type: "tensor", description: "First tensor" },
3534
3541
  { name: "b", type: "tensor | number", description: "Second tensor or scalar" }
3535
3542
  ],
3536
- example: '["tensor/mul", "@entity.weights", 0.99] // Decay weights'
3543
+ example: '["tensor/mul", [0.5, 0.7], 0.99] // Decay weights'
3537
3544
  },
3538
3545
  "tensor/div": {
3539
3546
  module: "tensor",
@@ -3547,7 +3554,7 @@ var TENSOR_OPERATORS = {
3547
3554
  { name: "a", type: "tensor", description: "First tensor" },
3548
3555
  { name: "b", type: "tensor | number", description: "Second tensor or scalar" }
3549
3556
  ],
3550
- example: '["tensor/div", "@entity.gradient", "@entity.batchSize"]'
3557
+ example: '["tensor/div", [10, 20], 2]'
3551
3558
  },
3552
3559
  "tensor/matmul": {
3553
3560
  module: "tensor",
@@ -3561,7 +3568,7 @@ var TENSOR_OPERATORS = {
3561
3568
  { name: "a", type: "tensor", description: "First tensor (NxM)" },
3562
3569
  { name: "b", type: "tensor", description: "Second tensor (MxK)" }
3563
3570
  ],
3564
- example: '["tensor/matmul", "@entity.input", "@entity.weights"]'
3571
+ example: '["tensor/matmul", [[1, 2], [3, 4]], [[5, 6], [7, 8]]]'
3565
3572
  },
3566
3573
  "tensor/dot": {
3567
3574
  module: "tensor",
@@ -3575,7 +3582,7 @@ var TENSOR_OPERATORS = {
3575
3582
  { name: "a", type: "tensor", description: "First vector" },
3576
3583
  { name: "b", type: "tensor", description: "Second vector" }
3577
3584
  ],
3578
- example: '["tensor/dot", "@entity.a", "@entity.b"]'
3585
+ example: '["tensor/dot", [1, 2], [3, 4]]'
3579
3586
  },
3580
3587
  // ============================================================================
3581
3588
  // Reductions
@@ -3592,7 +3599,7 @@ var TENSOR_OPERATORS = {
3592
3599
  { name: "tensor", type: "tensor", description: "The tensor" },
3593
3600
  { name: "dim", type: "number", description: "Dimension to reduce", optional: true }
3594
3601
  ],
3595
- example: '["tensor/sum", "@entity.rewards"] // Total reward'
3602
+ example: '["tensor/sum", [1, 0, 1]] // Total reward'
3596
3603
  },
3597
3604
  "tensor/mean": {
3598
3605
  module: "tensor",
@@ -3606,7 +3613,7 @@ var TENSOR_OPERATORS = {
3606
3613
  { name: "tensor", type: "tensor", description: "The tensor" },
3607
3614
  { name: "dim", type: "number", description: "Dimension to reduce", optional: true }
3608
3615
  ],
3609
- example: '["tensor/mean", "@entity.losses"]'
3616
+ example: '["tensor/mean", [0.2, 0.4, 0.6]]'
3610
3617
  },
3611
3618
  "tensor/max": {
3612
3619
  module: "tensor",
@@ -3620,7 +3627,7 @@ var TENSOR_OPERATORS = {
3620
3627
  { name: "tensor", type: "tensor", description: "The tensor" },
3621
3628
  { name: "dim", type: "number", description: "Dimension to reduce", optional: true }
3622
3629
  ],
3623
- example: '["tensor/max", "@entity.qValues"]'
3630
+ example: '["tensor/max", [0.1, 0.9, 0.3]]'
3624
3631
  },
3625
3632
  "tensor/min": {
3626
3633
  module: "tensor",
@@ -3634,7 +3641,7 @@ var TENSOR_OPERATORS = {
3634
3641
  { name: "tensor", type: "tensor", description: "The tensor" },
3635
3642
  { name: "dim", type: "number", description: "Dimension to reduce", optional: true }
3636
3643
  ],
3637
- example: '["tensor/min", "@entity.distances"]'
3644
+ example: '["tensor/min", [3, 1, 2]]'
3638
3645
  },
3639
3646
  "tensor/argmax": {
3640
3647
  module: "tensor",
@@ -3648,7 +3655,7 @@ var TENSOR_OPERATORS = {
3648
3655
  { name: "tensor", type: "tensor", description: "The tensor" },
3649
3656
  { name: "dim", type: "number", description: "Dimension to reduce", optional: true }
3650
3657
  ],
3651
- example: '["tensor/argmax", "@entity.qValues"] // Best action index'
3658
+ example: '["tensor/argmax", [0.1, 0.9, 0.3]] // Best action index'
3652
3659
  },
3653
3660
  "tensor/norm": {
3654
3661
  module: "tensor",
@@ -3662,7 +3669,7 @@ var TENSOR_OPERATORS = {
3662
3669
  { name: "tensor", type: "tensor", description: "The tensor" },
3663
3670
  { name: "p", type: "number", description: "Norm order (default 2)", optional: true, defaultValue: 2 }
3664
3671
  ],
3665
- example: '["tensor/norm", "@entity.gradient"]'
3672
+ example: '["tensor/norm", [3, 4]]'
3666
3673
  },
3667
3674
  // ============================================================================
3668
3675
  // Range Validation (for contracts)
@@ -3679,7 +3686,7 @@ var TENSOR_OPERATORS = {
3679
3686
  { name: "tensor", type: "tensor", description: "The tensor" },
3680
3687
  { name: "range", type: "[number, number]", description: "Range as [min, max]" }
3681
3688
  ],
3682
- example: '["tensor/allInRange", "@payload.input", [-1.0, 1.0]]'
3689
+ example: '["tensor/allInRange", [0.5, -0.2], [-1.0, 1.0]]'
3683
3690
  },
3684
3691
  "tensor/outOfRangeIndices": {
3685
3692
  module: "tensor",
@@ -3693,7 +3700,7 @@ var TENSOR_OPERATORS = {
3693
3700
  { name: "tensor", type: "tensor", description: "The tensor" },
3694
3701
  { name: "range", type: "[number, number]", description: "Range as [min, max]" }
3695
3702
  ],
3696
- example: '["tensor/outOfRangeIndices", "@payload.input", [-1.0, 1.0]]'
3703
+ example: '["tensor/outOfRangeIndices", [0.5, 1.5], [-1.0, 1.0]]'
3697
3704
  },
3698
3705
  "tensor/clamp": {
3699
3706
  module: "tensor",
@@ -3708,7 +3715,7 @@ var TENSOR_OPERATORS = {
3708
3715
  { name: "min", type: "number", description: "Minimum value" },
3709
3716
  { name: "max", type: "number", description: "Maximum value" }
3710
3717
  ],
3711
- example: '["tensor/clamp", "@entity.output", -10.0, 10.0]'
3718
+ example: '["tensor/clamp", [5, -15, 3], -10.0, 10.0]'
3712
3719
  },
3713
3720
  "tensor/clampPerDim": {
3714
3721
  module: "tensor",
@@ -3722,7 +3729,7 @@ var TENSOR_OPERATORS = {
3722
3729
  { name: "tensor", type: "tensor", description: "The tensor" },
3723
3730
  { name: "ranges", type: "object", description: 'Per-dimension ranges { "0": {min, max}, ... }' }
3724
3731
  ],
3725
- example: '["tensor/clampPerDim", "@entity.rawOutput", "@entity.outputContract.ranges"]'
3732
+ example: '["tensor/clampPerDim", [5, -15], {"0": {"min": 0, "max": 10}, "1": {"min": -10, "max": 10}}]'
3726
3733
  },
3727
3734
  "tensor/outOfRangeDims": {
3728
3735
  module: "tensor",
@@ -3736,7 +3743,7 @@ var TENSOR_OPERATORS = {
3736
3743
  { name: "tensor", type: "tensor", description: "The tensor" },
3737
3744
  { name: "ranges", type: "object", description: 'Per-dimension ranges { "0": {min, max}, ... }' }
3738
3745
  ],
3739
- example: '["tensor/outOfRangeDims", "@entity.rawOutput", "@entity.outputContract.ranges"]'
3746
+ example: '["tensor/outOfRangeDims", [5, -15], {"0": {"min": 0, "max": 10}, "1": {"min": -10, "max": 10}}]'
3740
3747
  },
3741
3748
  // ============================================================================
3742
3749
  // Conversion
@@ -3752,7 +3759,7 @@ var TENSOR_OPERATORS = {
3752
3759
  params: [
3753
3760
  { name: "tensor", type: "tensor", description: "The tensor" }
3754
3761
  ],
3755
- example: '["tensor/toArray", "@entity.output"]'
3762
+ example: '["tensor/toArray", [[1, 2], [3, 4]]]'
3756
3763
  },
3757
3764
  "tensor/toList": {
3758
3765
  module: "tensor",
@@ -3765,7 +3772,7 @@ var TENSOR_OPERATORS = {
3765
3772
  params: [
3766
3773
  { name: "tensor", type: "tensor", description: "The tensor (must be 1D)" }
3767
3774
  ],
3768
- example: '["tensor/toList", "@entity.output"]'
3775
+ example: '["tensor/toList", [1, 2, 3]]'
3769
3776
  },
3770
3777
  // ============================================================================
3771
3778
  // Concatenation / stacking / shape manipulation
@@ -3782,7 +3789,7 @@ var TENSOR_OPERATORS = {
3782
3789
  { name: "a", type: "tensor", description: "First tensor" },
3783
3790
  { name: "b", type: "tensor", description: "Second tensor" }
3784
3791
  ],
3785
- example: '["tensor/cat", "@entity.a", "@entity.b"]'
3792
+ example: '["tensor/cat", [1, 2], [3, 4]]'
3786
3793
  },
3787
3794
  "tensor/stack": {
3788
3795
  module: "tensor",
@@ -3796,7 +3803,7 @@ var TENSOR_OPERATORS = {
3796
3803
  { name: "a", type: "tensor", description: "First tensor" },
3797
3804
  { name: "b", type: "tensor", description: "Second tensor" }
3798
3805
  ],
3799
- example: '["tensor/stack", "@entity.a", "@entity.b"]'
3806
+ example: '["tensor/stack", [1, 2], [3, 4]]'
3800
3807
  },
3801
3808
  "tensor/transpose": {
3802
3809
  module: "tensor",
@@ -3811,7 +3818,7 @@ var TENSOR_OPERATORS = {
3811
3818
  { name: "dim0", type: "number", description: "First dimension to swap (optional)" },
3812
3819
  { name: "dim1", type: "number", description: "Second dimension to swap (optional)" }
3813
3820
  ],
3814
- example: '["tensor/transpose", "@entity.matrix", 0, 1]'
3821
+ example: '["tensor/transpose", [[1, 2], [3, 4]], 0, 1]'
3815
3822
  },
3816
3823
  "tensor/unsqueeze": {
3817
3824
  module: "tensor",
@@ -3825,7 +3832,7 @@ var TENSOR_OPERATORS = {
3825
3832
  { name: "tensor", type: "tensor", description: "The tensor" },
3826
3833
  { name: "dim", type: "number", description: "Position to insert the new dimension" }
3827
3834
  ],
3828
- example: '["tensor/unsqueeze", "@entity.vector", 0]'
3835
+ example: '["tensor/unsqueeze", [1, 2, 3], 0]'
3829
3836
  },
3830
3837
  "tensor/squeeze": {
3831
3838
  module: "tensor",
@@ -3838,7 +3845,7 @@ var TENSOR_OPERATORS = {
3838
3845
  params: [
3839
3846
  { name: "tensor", type: "tensor", description: "The tensor" }
3840
3847
  ],
3841
- example: '["tensor/squeeze", "@entity.output"]'
3848
+ example: '["tensor/squeeze", [[1, 2, 3]]]'
3842
3849
  }
3843
3850
  };
3844
3851
  function getTensorOperators() {
@@ -3863,7 +3870,7 @@ var TRAIN_OPERATORS = {
3863
3870
  { name: "data", type: "array", description: "Training data (array of {input, target} or experiences)" },
3864
3871
  { name: "config", type: "train/config", description: "Training configuration with constraints" }
3865
3872
  ],
3866
- example: '["train/loop", "@entity.architecture", "@entity.buffer", "@entity.trainingConfig"]'
3873
+ example: '["train/loop", {"layers": [{"type": "dense", "units": 2}]}, [{"state": [0], "action": 1, "reward": 1}], {"epochs": 10}]'
3867
3874
  },
3868
3875
  "train/step": {
3869
3876
  module: "train",
@@ -3879,7 +3886,7 @@ var TRAIN_OPERATORS = {
3879
3886
  { name: "target", type: "tensor", description: "Target tensor" },
3880
3887
  { name: "config", type: "train/config", description: "Training configuration" }
3881
3888
  ],
3882
- example: '["train/step", "@entity.architecture", "@batch.input", "@batch.target", "@entity.config"]'
3889
+ example: '["train/step", {"layers": [{"type": "dense", "units": 2}]}, [0.1, 0.2], [1], {"lr": 0.01}]'
3883
3890
  },
3884
3891
  // ============================================================================
3885
3892
  // Validation
@@ -3896,7 +3903,7 @@ var TRAIN_OPERATORS = {
3896
3903
  { name: "module", type: "nn/module", description: "The neural network" },
3897
3904
  { name: "testCases", type: "array", description: "Array of {input, expected, tolerance?}" }
3898
3905
  ],
3899
- example: '["train/validate", "@entity.architecture", "@entity.validationSet"]'
3906
+ example: '["train/validate", {"layers": [{"type": "dense", "units": 2}]}, [{"input": [0], "expected": [1]}]]'
3900
3907
  },
3901
3908
  "train/checkRegression": {
3902
3909
  module: "train",
@@ -3911,7 +3918,7 @@ var TRAIN_OPERATORS = {
3911
3918
  { name: "oldModule", type: "nn/module", description: "Previous network" },
3912
3919
  { name: "invariants", type: "array", description: "Test cases that must not regress" }
3913
3920
  ],
3914
- example: '["train/checkRegression", "@payload.newWeights", "@entity.architecture", "@entity.requiredInvariants"]'
3921
+ example: '["train/checkRegression", [0.1, 0.2], {"layers": [{"type": "dense", "units": 2}]}, [{"input": [0], "expected": [1]}]]'
3915
3922
  },
3916
3923
  // ============================================================================
3917
3924
  // Constraint Checking
@@ -3928,7 +3935,7 @@ var TRAIN_OPERATORS = {
3928
3935
  { name: "module", type: "nn/module", description: "The neural network" },
3929
3936
  { name: "constraints", type: "train/constraints", description: "Constraint specification" }
3930
3937
  ],
3931
- example: '["train/checkConstraints", "@payload.newWeights", "@entity.constraints"]'
3938
+ example: '["train/checkConstraints", [0.1, 0.2], {"maxMagnitude": 10}]'
3932
3939
  },
3933
3940
  "train/checkWeightMagnitude": {
3934
3941
  module: "train",
@@ -3942,7 +3949,7 @@ var TRAIN_OPERATORS = {
3942
3949
  { name: "module", type: "nn/module", description: "The neural network" },
3943
3950
  { name: "maxMagnitude", type: "number", description: "Maximum allowed weight magnitude" }
3944
3951
  ],
3945
- example: '["train/checkWeightMagnitude", "@entity.architecture", 10.0]'
3952
+ example: '["train/checkWeightMagnitude", {"layers": [{"type": "dense", "units": 2}]}, 10.0]'
3946
3953
  },
3947
3954
  "train/checkForbiddenOutputs": {
3948
3955
  module: "train",
@@ -3957,7 +3964,7 @@ var TRAIN_OPERATORS = {
3957
3964
  { name: "testInputs", type: "array", description: "Inputs to test" },
3958
3965
  { name: "forbiddenRegions", type: "array", description: "Forbidden output regions" }
3959
3966
  ],
3960
- example: '["train/checkForbiddenOutputs", "@entity.architecture", "@entity.testInputs", "@entity.forbiddenOutputRegions"]'
3967
+ example: '["train/checkForbiddenOutputs", {"layers": [{"type": "dense", "units": 2}]}, [[0], [1]], {"0": {"min": 100, "max": 200}}]'
3961
3968
  },
3962
3969
  // ============================================================================
3963
3970
  // Gradient Operations
@@ -3974,7 +3981,7 @@ var TRAIN_OPERATORS = {
3974
3981
  { name: "module", type: "nn/module", description: "The neural network" },
3975
3982
  { name: "maxNorm", type: "number", description: "Maximum gradient norm" }
3976
3983
  ],
3977
- example: '["train/clipGradients", "@entity.architecture", 1.0]'
3984
+ example: '["train/clipGradients", {"layers": [{"type": "dense", "units": 2}]}, 1.0]'
3978
3985
  },
3979
3986
  "train/getGradientNorm": {
3980
3987
  module: "train",
@@ -3987,7 +3994,7 @@ var TRAIN_OPERATORS = {
3987
3994
  params: [
3988
3995
  { name: "module", type: "nn/module", description: "The neural network" }
3989
3996
  ],
3990
- example: '["train/getGradientNorm", "@entity.architecture"]'
3997
+ example: '["train/getGradientNorm", {"layers": [{"type": "dense", "units": 2}]}]'
3991
3998
  },
3992
3999
  // ============================================================================
3993
4000
  // Weight Operations
@@ -4004,7 +4011,7 @@ var TRAIN_OPERATORS = {
4004
4011
  { name: "module", type: "nn/module", description: "The neural network" },
4005
4012
  { name: "maxMagnitude", type: "number", description: "Maximum weight magnitude" }
4006
4013
  ],
4007
- example: '["train/clipWeights", "@entity.architecture", 10.0]'
4014
+ example: '["train/clipWeights", {"layers": [{"type": "dense", "units": 2}]}, 10.0]'
4008
4015
  },
4009
4016
  "train/getMaxWeightMagnitude": {
4010
4017
  module: "train",
@@ -4017,7 +4024,7 @@ var TRAIN_OPERATORS = {
4017
4024
  params: [
4018
4025
  { name: "module", type: "nn/module", description: "The neural network" }
4019
4026
  ],
4020
- example: '["train/getMaxWeightMagnitude", "@entity.architecture"]'
4027
+ example: '["train/getMaxWeightMagnitude", {"layers": [{"type": "dense", "units": 2}]}]'
4021
4028
  },
4022
4029
  // ============================================================================
4023
4030
  // Loss Functions
@@ -4034,7 +4041,7 @@ var TRAIN_OPERATORS = {
4034
4041
  { name: "predicted", type: "tensor", description: "Predicted values" },
4035
4042
  { name: "target", type: "tensor", description: "Target values" }
4036
4043
  ],
4037
- example: '["train/mse", "@entity.output", "@batch.target"]'
4044
+ example: '["train/mse", [0.5, 0.7], [1, 0]]'
4038
4045
  },
4039
4046
  "train/crossEntropy": {
4040
4047
  module: "train",
@@ -4048,7 +4055,7 @@ var TRAIN_OPERATORS = {
4048
4055
  { name: "logits", type: "tensor", description: "Raw model outputs (logits)" },
4049
4056
  { name: "labels", type: "tensor", description: "Target class labels" }
4050
4057
  ],
4051
- example: '["train/crossEntropy", "@entity.logits", "@batch.labels"]'
4058
+ example: '["train/crossEntropy", [2.0, 0.5], [1, 0]]'
4052
4059
  },
4053
4060
  "train/huber": {
4054
4061
  module: "train",
@@ -4063,7 +4070,7 @@ var TRAIN_OPERATORS = {
4063
4070
  { name: "target", type: "tensor", description: "Target values" },
4064
4071
  { name: "delta", type: "number", description: "Threshold for quadratic vs linear", optional: true, defaultValue: 1 }
4065
4072
  ],
4066
- example: '["train/huber", "@entity.qValues", "@batch.targets", 1.0]'
4073
+ example: '["train/huber", [0.5, 1.2], [1, 0], 1.0]'
4067
4074
  },
4068
4075
  // ============================================================================
4069
4076
  // Optimizers
@@ -4081,7 +4088,7 @@ var TRAIN_OPERATORS = {
4081
4088
  { name: "lr", type: "number", description: "Learning rate" },
4082
4089
  { name: "momentum", type: "number", description: "Momentum factor", optional: true, defaultValue: 0 }
4083
4090
  ],
4084
- example: '["train/sgd", "@entity.architecture", 0.01, 0.9]'
4091
+ example: '["train/sgd", {"layers": [{"type": "dense", "units": 2}]}, 0.01, 0.9]'
4085
4092
  },
4086
4093
  "train/adam": {
4087
4094
  module: "train",
@@ -4097,7 +4104,7 @@ var TRAIN_OPERATORS = {
4097
4104
  { name: "beta1", type: "number", description: "First moment decay", optional: true, defaultValue: 0.9 },
4098
4105
  { name: "beta2", type: "number", description: "Second moment decay", optional: true, defaultValue: 0.999 }
4099
4106
  ],
4100
- example: '["train/adam", "@entity.architecture", 0.001]'
4107
+ example: '["train/adam", {"layers": [{"type": "dense", "units": 2}]}, 0.001]'
4101
4108
  },
4102
4109
  // ============================================================================
4103
4110
  // Experience Replay (for RL)
@@ -4114,7 +4121,7 @@ var TRAIN_OPERATORS = {
4114
4121
  { name: "buffer", type: "array", description: "Experience buffer" },
4115
4122
  { name: "batchSize", type: "number", description: "Number of samples" }
4116
4123
  ],
4117
- example: '["train/sampleBatch", "@entity.experienceBuffer", 32]'
4124
+ example: '["train/sampleBatch", [{"state": [0], "reward": 1}, {"state": [1], "reward": 0}], 2]'
4118
4125
  },
4119
4126
  "train/computeReturns": {
4120
4127
  module: "train",
@@ -4128,7 +4135,7 @@ var TRAIN_OPERATORS = {
4128
4135
  { name: "rewards", type: "array", description: "Array of rewards" },
4129
4136
  { name: "gamma", type: "number", description: "Discount factor" }
4130
4137
  ],
4131
- example: '["train/computeReturns", "@episode.rewards", 0.99]'
4138
+ example: '["train/computeReturns", [1, 0, 1], 0.99]'
4132
4139
  },
4133
4140
  "train/computeAdvantages": {
4134
4141
  module: "train",
@@ -4143,7 +4150,7 @@ var TRAIN_OPERATORS = {
4143
4150
  { name: "values", type: "tensor", description: "Value estimates" },
4144
4151
  { name: "config", type: "object", description: "Config with gamma, lambda" }
4145
4152
  ],
4146
- example: '["train/computeAdvantages", "@episode.rewards", "@episode.values", { "gamma": 0.99, "lambda": 0.95 }]'
4153
+ example: '["train/computeAdvantages", [1, 0, 1], [0.5, 0.4, 0.3], { "gamma": 0.99, "lambda": 0.95 }]'
4147
4154
  },
4148
4155
  // ============================================================================
4149
4156
  // ML lifecycle effects (bare aliases invoked by std ML behaviors)
@@ -4161,7 +4168,7 @@ var TRAIN_OPERATORS = {
4161
4168
  { name: "data", type: "array", description: "Training data (optional)" },
4162
4169
  { name: "config", type: "object", description: "Training config (optional)" }
4163
4170
  ],
4164
- example: '["train", "@entity.model", "@entity.data", { "epochs": 100 }]'
4171
+ example: '["train", {"layers": [{"type": "dense", "units": 2}]}, [[0, 1], [1, 0]], { "epochs": 100 }]'
4165
4172
  },
4166
4173
  "evaluate": {
4167
4174
  module: "train",
@@ -4175,7 +4182,7 @@ var TRAIN_OPERATORS = {
4175
4182
  { name: "model", type: "nn/module", description: "The neural network module" },
4176
4183
  { name: "testCases", type: "array", description: "Test cases (optional)" }
4177
4184
  ],
4178
- example: '["evaluate", "@entity.model", "@entity.testCases"]'
4185
+ example: '["evaluate", {"layers": [{"type": "dense", "units": 2}]}, [{"input": [0], "expected": [1]}]]'
4179
4186
  },
4180
4187
  "checkpoint/save": {
4181
4188
  module: "train",
@@ -4189,7 +4196,7 @@ var TRAIN_OPERATORS = {
4189
4196
  { name: "model", type: "nn/module", description: "The neural network module" },
4190
4197
  { name: "key", type: "string", description: "Checkpoint identifier" }
4191
4198
  ],
4192
- example: '["checkpoint/save", "@entity.model", "@entity.checkpointKey"]'
4199
+ example: '["checkpoint/save", {"layers": [{"type": "dense", "units": 2}]}, "ckpt-1"]'
4193
4200
  },
4194
4201
  "checkpoint/load": {
4195
4202
  module: "train",
@@ -4202,7 +4209,7 @@ var TRAIN_OPERATORS = {
4202
4209
  params: [
4203
4210
  { name: "key", type: "string", description: "Checkpoint identifier" }
4204
4211
  ],
4205
- example: '["checkpoint/load", "@entity.checkpointKey"]'
4212
+ example: '["checkpoint/load", "ckpt-1"]'
4206
4213
  }
4207
4214
  };
4208
4215
  function getTrainOperators() {
@@ -4225,7 +4232,7 @@ var GRAPH_OPERATORS = {
4225
4232
  params: [
4226
4233
  { name: "config", type: "object", description: "Graph construction config (nodes, edges, node-features, edge-features, directed)" }
4227
4234
  ],
4228
- example: '["graph/from-entities", { "nodes": "User", "edges": "Follows" }]'
4235
+ example: '["graph/from-entities", [{ "age": 30, "score": 0.5 }, { "age": 25, "score": 0.7 }]]'
4229
4236
  },
4230
4237
  "graph/from-adjacency": {
4231
4238
  module: "graph",
@@ -4239,7 +4246,7 @@ var GRAPH_OPERATORS = {
4239
4246
  { name: "adjacency", type: "tensor", description: "Adjacency matrix" },
4240
4247
  { name: "features", type: "tensor", description: "Node feature matrix" }
4241
4248
  ],
4242
- example: '["graph/from-adjacency", "@entity.adj", "@entity.features"]'
4249
+ example: '["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]'
4243
4250
  },
4244
4251
  "graph/from-edge-list": {
4245
4252
  module: "graph",
@@ -4253,7 +4260,7 @@ var GRAPH_OPERATORS = {
4253
4260
  { name: "edges", type: "tensor", description: "Edge index tensor [2, num_edges]" },
4254
4261
  { name: "features", type: "tensor", description: "Node feature matrix" }
4255
4262
  ],
4256
- example: '["graph/from-edge-list", "@entity.edges", "@entity.features"]'
4263
+ example: '["graph/from-edge-list", [[0, 1]], [[1.0], [2.0]]]'
4257
4264
  },
4258
4265
  // ============================================================================
4259
4266
  // Transforms
@@ -4269,7 +4276,7 @@ var GRAPH_OPERATORS = {
4269
4276
  params: [
4270
4277
  { name: "graph", type: "graph", description: "Input graph" }
4271
4278
  ],
4272
- example: '["graph/add-self-loops", "@entity.graph"]'
4279
+ example: '["graph/add-self-loops", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4273
4280
  },
4274
4281
  "graph/to-undirected": {
4275
4282
  module: "graph",
@@ -4282,7 +4289,7 @@ var GRAPH_OPERATORS = {
4282
4289
  params: [
4283
4290
  { name: "graph", type: "graph", description: "Input graph" }
4284
4291
  ],
4285
- example: '["graph/to-undirected", "@entity.graph"]'
4292
+ example: '["graph/to-undirected", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4286
4293
  },
4287
4294
  "graph/subgraph": {
4288
4295
  module: "graph",
@@ -4296,7 +4303,7 @@ var GRAPH_OPERATORS = {
4296
4303
  { name: "graph", type: "graph", description: "Input graph" },
4297
4304
  { name: "mask", type: "tensor", description: "Boolean node mask" }
4298
4305
  ],
4299
- example: '["graph/subgraph", "@entity.graph", "@entity.mask"]'
4306
+ example: '["graph/subgraph", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]], [true, false]]'
4300
4307
  },
4301
4308
  "graph/k-hop": {
4302
4309
  module: "graph",
@@ -4311,7 +4318,7 @@ var GRAPH_OPERATORS = {
4311
4318
  { name: "node", type: "number", description: "Center node index" },
4312
4319
  { name: "k", type: "number", description: "Number of hops" }
4313
4320
  ],
4314
- example: '["graph/k-hop", "@entity.graph", 0, 2]'
4321
+ example: '["graph/k-hop", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]], 0, 2]'
4315
4322
  },
4316
4323
  // ============================================================================
4317
4324
  // Accessors
@@ -4327,7 +4334,7 @@ var GRAPH_OPERATORS = {
4327
4334
  params: [
4328
4335
  { name: "graph", type: "graph", description: "Input graph" }
4329
4336
  ],
4330
- example: '["graph/node-features", "@entity.graph"]'
4337
+ example: '["graph/node-features", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4331
4338
  },
4332
4339
  "graph/edge-index": {
4333
4340
  module: "graph",
@@ -4340,7 +4347,7 @@ var GRAPH_OPERATORS = {
4340
4347
  params: [
4341
4348
  { name: "graph", type: "graph", description: "Input graph" }
4342
4349
  ],
4343
- example: '["graph/edge-index", "@entity.graph"]'
4350
+ example: '["graph/edge-index", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4344
4351
  },
4345
4352
  "graph/edge-features": {
4346
4353
  module: "graph",
@@ -4353,7 +4360,7 @@ var GRAPH_OPERATORS = {
4353
4360
  params: [
4354
4361
  { name: "graph", type: "graph", description: "Input graph" }
4355
4362
  ],
4356
- example: '["graph/edge-features", "@entity.graph"]'
4363
+ example: '["graph/edge-features", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4357
4364
  },
4358
4365
  "graph/num-nodes": {
4359
4366
  module: "graph",
@@ -4366,7 +4373,7 @@ var GRAPH_OPERATORS = {
4366
4373
  params: [
4367
4374
  { name: "graph", type: "graph", description: "Input graph" }
4368
4375
  ],
4369
- example: '["graph/num-nodes", "@entity.graph"]'
4376
+ example: '["graph/num-nodes", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4370
4377
  },
4371
4378
  "graph/num-edges": {
4372
4379
  module: "graph",
@@ -4379,7 +4386,7 @@ var GRAPH_OPERATORS = {
4379
4386
  params: [
4380
4387
  { name: "graph", type: "graph", description: "Input graph" }
4381
4388
  ],
4382
- example: '["graph/num-edges", "@entity.graph"]'
4389
+ example: '["graph/num-edges", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4383
4390
  },
4384
4391
  "graph/degree": {
4385
4392
  module: "graph",
@@ -4392,7 +4399,7 @@ var GRAPH_OPERATORS = {
4392
4399
  params: [
4393
4400
  { name: "graph", type: "graph", description: "Input graph" }
4394
4401
  ],
4395
- example: '["graph/degree", "@entity.graph"]'
4402
+ example: '["graph/degree", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4396
4403
  },
4397
4404
  // ============================================================================
4398
4405
  // Batching
@@ -4408,7 +4415,7 @@ var GRAPH_OPERATORS = {
4408
4415
  params: [
4409
4416
  { name: "graphs", type: "array", description: "List of graphs" }
4410
4417
  ],
4411
- example: '["graph/batch", "@entity.graphs"]'
4418
+ example: '["graph/batch", [["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]]'
4412
4419
  }
4413
4420
  };
4414
4421
  function getGraphOperators() {
@@ -4432,7 +4439,7 @@ var CONTRACT_OPERATORS = {
4432
4439
  { name: "tensor", type: "tensor", description: "Input tensor" },
4433
4440
  { name: "contract", type: "object", description: "Input contract spec" }
4434
4441
  ],
4435
- example: '["contract/validate-input", "@payload.input", "@entity.inputContract"]'
4442
+ example: '["contract/validate-input", [0.5, 0.7], {"ranges": {"0": {"min": 0, "max": 1}, "1": {"min": 0, "max": 1}}}]'
4436
4443
  },
4437
4444
  "contract/validate-output": {
4438
4445
  module: "contract",
@@ -4446,7 +4453,7 @@ var CONTRACT_OPERATORS = {
4446
4453
  { name: "tensor", type: "tensor", description: "Output tensor" },
4447
4454
  { name: "contract", type: "object", description: "Output contract spec" }
4448
4455
  ],
4449
- example: '["contract/validate-output", "@entity.output", "@entity.outputContract"]'
4456
+ example: '["contract/validate-output", [0.5, 0.7], {"ranges": {"0": {"min": 0, "max": 1}, "1": {"min": 0, "max": 1}}}]'
4450
4457
  },
4451
4458
  "contract/clamp-output": {
4452
4459
  module: "contract",
@@ -4460,7 +4467,7 @@ var CONTRACT_OPERATORS = {
4460
4467
  { name: "tensor", type: "tensor", description: "Output tensor" },
4461
4468
  { name: "contract", type: "object", description: "Output contract spec" }
4462
4469
  ],
4463
- example: '["contract/clamp-output", "@entity.output", "@entity.outputContract"]'
4470
+ example: '["contract/clamp-output", [0.5, 1.7], {"ranges": {"0": {"min": 0, "max": 1}, "1": {"min": 0, "max": 1}}}]'
4464
4471
  },
4465
4472
  "contract/violations": {
4466
4473
  module: "contract",
@@ -4474,7 +4481,7 @@ var CONTRACT_OPERATORS = {
4474
4481
  { name: "tensor", type: "tensor", description: "Tensor to check" },
4475
4482
  { name: "contract", type: "object", description: "Contract spec" }
4476
4483
  ],
4477
- example: '["contract/violations", "@entity.output", "@entity.outputContract"]'
4484
+ example: '["contract/violations", [0.5, 1.7], {"ranges": {"0": {"min": 0, "max": 1}, "1": {"min": 0, "max": 1}}}]'
4478
4485
  },
4479
4486
  // ============================================================================
4480
4487
  // Conversion
@@ -4491,7 +4498,7 @@ var CONTRACT_OPERATORS = {
4491
4498
  { name: "entity", type: "object", description: "Entity data" },
4492
4499
  { name: "contract", type: "object", description: "Input contract mapping fields to dims" }
4493
4500
  ],
4494
- example: '["contract/entity-to-tensor", "@entity", "@entity.inputContract"]'
4501
+ example: '["contract/entity-to-tensor", {"price": 10, "qty": 2}, {"fields": ["price", "qty"]}]'
4495
4502
  },
4496
4503
  "contract/tensor-to-payload": {
4497
4504
  module: "contract",
@@ -4505,7 +4512,7 @@ var CONTRACT_OPERATORS = {
4505
4512
  { name: "tensor", type: "tensor", description: "Output tensor" },
4506
4513
  { name: "contract", type: "object", description: "Output contract mapping dims to fields" }
4507
4514
  ],
4508
- example: '["contract/tensor-to-payload", "@entity.output", "@entity.outputContract"]'
4515
+ example: '["contract/tensor-to-payload", [0.5, 0.7], {"fields": ["price", "qty"]}]'
4509
4516
  }
4510
4517
  };
4511
4518
  function getContractOperators() {
@@ -4529,7 +4536,7 @@ var DATA_OPERATORS = {
4529
4536
  { name: "entities", type: "array", description: "Entity collection" },
4530
4537
  { name: "contracts", type: "object", description: "Input/output contract pair" }
4531
4538
  ],
4532
- example: '["data/dataset", "@entity.trainingData", "@entity.contracts"]'
4539
+ example: '["data/dataset", [{"x": 1, "y": 2}], {"input": {"fields": ["x"]}, "output": {"fields": ["y"]}}]'
4533
4540
  },
4534
4541
  "data/dataloader": {
4535
4542
  module: "data",
@@ -4543,7 +4550,7 @@ var DATA_OPERATORS = {
4543
4550
  { name: "dataset", type: "object", description: "Dataset" },
4544
4551
  { name: "config", type: "object", description: "Config with batch_size, shuffle, etc." }
4545
4552
  ],
4546
- example: '["data/dataloader", "@entity.dataset", { "batch-size": 32, "shuffle": true }]'
4553
+ example: '["data/dataloader", ["data/dataset", [[1, 2], [3, 4], [5, 6]], {}], { "batch-size": 2, "shuffle": true }]'
4547
4554
  },
4548
4555
  "data/split": {
4549
4556
  module: "data",
@@ -4557,7 +4564,7 @@ var DATA_OPERATORS = {
4557
4564
  { name: "dataset", type: "object", description: "Dataset" },
4558
4565
  { name: "config", type: "object", description: "Split config, e.g. { trainRatio: 0.8 }" }
4559
4566
  ],
4560
- example: '["data/split", "@entity.dataset", { "trainRatio": 0.8 }]'
4567
+ example: '["data/split", ["data/dataset", [1, 2, 3, 4, 5], {}], { "trainRatio": 0.8 }]'
4561
4568
  },
4562
4569
  // ============================================================================
4563
4570
  // Preprocessing
@@ -4574,7 +4581,7 @@ var DATA_OPERATORS = {
4574
4581
  { name: "tensor", type: "tensor", description: "Feature tensor" },
4575
4582
  { name: "config", type: "object", description: "Normalization config (method, per_dim, etc.)" }
4576
4583
  ],
4577
- example: '["data/normalize", "@entity.features", { "method": "standard" }]'
4584
+ example: '["data/normalize", [[1, 2], [3, 4]], { "method": "standard" }]'
4578
4585
  },
4579
4586
  "data/augment": {
4580
4587
  module: "data",
@@ -4588,7 +4595,7 @@ var DATA_OPERATORS = {
4588
4595
  { name: "dataset", type: "object", description: "Dataset" },
4589
4596
  { name: "config", type: "object", description: "Augmentation config" }
4590
4597
  ],
4591
- example: '["data/augment", "@entity.dataset", { "flip": true, "rotate": 15 }]'
4598
+ example: '["data/augment", [[1.0, 2.0], [3.0, 4.0]], { "flip": true, "rotate": 15 }]'
4592
4599
  },
4593
4600
  // ============================================================================
4594
4601
  // Tokenization & Padding
@@ -4605,7 +4612,7 @@ var DATA_OPERATORS = {
4605
4612
  { name: "text", type: "string", description: "Text to tokenize" },
4606
4613
  { name: "config", type: "object", description: "Tokenizer config (method, vocab_size, max_length)" }
4607
4614
  ],
4608
- example: '["data/tokenize", "@entity.text", { "method": "bpe", "max-length": 512 }]'
4615
+ example: '["data/tokenize", "hello world", { "method": "bpe", "max-length": 512 }]'
4609
4616
  },
4610
4617
  "data/pad": {
4611
4618
  module: "data",
@@ -4619,7 +4626,7 @@ var DATA_OPERATORS = {
4619
4626
  { name: "sequences", type: "array", description: "List of token sequences" },
4620
4627
  { name: "config", type: "object", description: "Padding config (max_length, pad_value)" }
4621
4628
  ],
4622
- example: '["data/pad", "@entity.sequences", { "max-length": 512, "pad-value": 0 }]'
4629
+ example: '["data/pad", [[1, 2, 3], [4, 5]], { "max-length": 4, "pad-value": 0 }]'
4623
4630
  }
4624
4631
  };
4625
4632
  function getDataOperators() {
@@ -4732,7 +4739,7 @@ var PROB_OPERATORS = {
4732
4739
  hasSideEffects: true,
4733
4740
  returnType: "void",
4734
4741
  params: [{ name: "predicate", type: "boolean", description: "Condition that must hold" }],
4735
- example: '["prob/condition", [">", "@entity.x", 0]]'
4742
+ example: '["prob/condition", [">", 5, 0]]'
4736
4743
  },
4737
4744
  "prob/sample": {
4738
4745
  module: "prob",
@@ -4762,7 +4769,7 @@ var PROB_OPERATORS = {
4762
4769
  { name: "query", type: "SExpr", description: "Query expression (lazy, value to collect)" },
4763
4770
  { name: "n", type: "number", description: "Number of samples to attempt" }
4764
4771
  ],
4765
- example: '["prob/posterior", model, evidence, query, 5000]'
4772
+ example: '["prob/posterior", ["prob/gaussian", 0, 1], [0.5], "mu", 5000]'
4766
4773
  },
4767
4774
  "prob/infer": {
4768
4775
  module: "prob",
@@ -4778,7 +4785,7 @@ var PROB_OPERATORS = {
4778
4785
  { name: "query", type: "SExpr", description: "Query expression (lazy)" },
4779
4786
  { name: "n", type: "number", description: "Number of samples to attempt" }
4780
4787
  ],
4781
- example: '["prob/infer", model, evidence, query, 5000]'
4788
+ example: '["prob/infer", ["prob/gaussian", 0, 1], [0.5], "mu", 5000]'
4782
4789
  },
4783
4790
  // ========================================
4784
4791
  // Statistics
@@ -4845,7 +4852,7 @@ var PROB_OPERATORS = {
4845
4852
  { name: "samples", type: "number[]", description: "Array of numeric samples" },
4846
4853
  { name: "alpha", type: "number", description: "Significance level (e.g., 0.05 for 95% interval)" }
4847
4854
  ],
4848
- example: '["prob/credible-interval", samples, 0.05] // => [lo, hi]'
4855
+ example: '["prob/credible-interval", [1, 2, 3, 4, 5], 0.05] // => [lo, hi]'
4849
4856
  }
4850
4857
  };
4851
4858
  function getProbOperators() {
@@ -5036,7 +5043,7 @@ var BROWSER_OPERATORS = {
5036
5043
  kind: "custom",
5037
5044
  produces: "string"
5038
5045
  },
5039
- example: '["browser/clipboard-write", "@entity.inviteUrl", { "emit": { "success": "COPIED", "failure": "COPY_DENIED" } }]'
5046
+ example: '["browser/clipboard-write", "https://example.com/invite/abc", { "emit": { "success": "COPIED", "failure": "COPY_DENIED" } }]'
5040
5047
  },
5041
5048
  "browser/push-subscribe": {
5042
5049
  module: "browser",
@@ -5857,7 +5864,7 @@ var LLM_OPERATORS = {
5857
5864
  { name: "messages", type: { kind: "array", of: "LlmMessage" }, description: "Conversation messages" },
5858
5865
  { name: "tools", type: { kind: "array", of: "LlmToolDef" }, description: "Tool definitions available to the LLM" }
5859
5866
  ],
5860
- example: '["llm/call-tools", @entity.messages, @entity.tools]'
5867
+ example: '["llm/call-tools", [{"role": "user", "content": "What time is it?"}], [{"name": "getTime", "description": "Get current time", "parameters": {}}]]'
5861
5868
  },
5862
5869
  "llm/embed": {
5863
5870
  module: "llm",
@@ -5881,7 +5888,7 @@ var LLM_OPERATORS = {
5881
5888
  hasSideEffects: false,
5882
5889
  returnType: "number",
5883
5890
  params: [],
5884
- example: '["llm/token-count"] => 12450'
5891
+ example: '["llm/token-count"] // => 12450'
5885
5892
  },
5886
5893
  "llm/switch": {
5887
5894
  module: "llm",
@@ -5940,7 +5947,7 @@ var WORKSPACE_OPERATORS = {
5940
5947
  { name: "name", type: "string", description: "Orbital name" },
5941
5948
  { name: "def", type: { kind: "entityRef" }, description: "Orbital definition to write" }
5942
5949
  ],
5943
- example: '["workspace/write-orbital", "ProductOrbital", @entity.def]'
5950
+ example: '["workspace/write-orbital", "ProductOrbital", {"name": "ProductOrbital"}]'
5944
5951
  },
5945
5952
  "workspace/read-file": {
5946
5953
  module: "workspace",
@@ -5965,7 +5972,7 @@ var WORKSPACE_OPERATORS = {
5965
5972
  { name: "path", type: "string", description: "File path relative to workspace root" },
5966
5973
  { name: "content", type: "string", description: "File content" }
5967
5974
  ],
5968
- example: '["workspace/write-file", "orbitals/Product.orb", @entity.orbJson]'
5975
+ example: '["workspace/write-file", "orbitals/Product.orb", {"orbitals": []}]'
5969
5976
  },
5970
5977
  "workspace/exists": {
5971
5978
  module: "workspace",
@@ -5987,7 +5994,7 @@ var WORKSPACE_OPERATORS = {
5987
5994
  hasSideEffects: false,
5988
5995
  returnType: "array",
5989
5996
  params: [],
5990
- example: '["workspace/list-orbitals"] => ["ProductOrbital", "CartOrbital"]'
5997
+ example: '["workspace/list-orbitals"] // => ["ProductOrbital", "CartOrbital"]'
5991
5998
  },
5992
5999
  "workspace/read-schema": {
5993
6000
  module: "workspace",
@@ -6009,7 +6016,7 @@ var WORKSPACE_OPERATORS = {
6009
6016
  hasSideEffects: true,
6010
6017
  returnType: "void",
6011
6018
  params: [{ name: "schema", type: { kind: "entityRef" }, description: "Composed schema" }],
6012
- example: '["workspace/write-schema", @entity.composed]'
6019
+ example: '["workspace/write-schema", {"orbitals": [{"name": "ProductOrbital"}]}]'
6013
6020
  },
6014
6021
  "workspace/read-plan": {
6015
6022
  module: "workspace",
@@ -6031,7 +6038,7 @@ var WORKSPACE_OPERATORS = {
6031
6038
  hasSideEffects: true,
6032
6039
  returnType: "void",
6033
6040
  params: [{ name: "snapshot", type: { kind: "object", fields: { id: "string", status: "string" } }, description: "Plan snapshot" }],
6034
- example: '["workspace/write-plan", @entity.plan]'
6041
+ example: '["workspace/write-plan", ["create entity", "add list page"]]'
6035
6042
  },
6036
6043
  "workspace/archive-orbital": {
6037
6044
  module: "workspace",
@@ -6074,7 +6081,7 @@ var SESSION_OPERATORS = {
6074
6081
  { name: "orbitalName", type: "string", description: "Orbital name" },
6075
6082
  { name: "spec", type: { kind: "object", fields: { orbitalName: "string", organism: "string", method: "string" } }, description: "Orbital spec" }
6076
6083
  ],
6077
- example: '["session/write-spec", "ProductOrbital", @entity.spec]'
6084
+ example: '["session/write-spec", "ProductOrbital", {"goal": "manage products"}]'
6078
6085
  },
6079
6086
  "session/read-memory": {
6080
6087
  module: "session",
@@ -6099,7 +6106,7 @@ var SESSION_OPERATORS = {
6099
6106
  { name: "orbitalName", type: "string", description: "Orbital name" },
6100
6107
  { name: "memory", type: { kind: "object", fields: { entityName: "string", notes: { kind: "array", of: "string" } }, open: true }, description: "Orbital memory" }
6101
6108
  ],
6102
- example: '["session/write-memory", "ProductOrbital", @entity.memory]'
6109
+ example: '["session/write-memory", "ProductOrbital", {"notes": ["initial draft"]}]'
6103
6110
  },
6104
6111
  "session/read-history": {
6105
6112
  module: "session",
@@ -6124,7 +6131,7 @@ var SESSION_OPERATORS = {
6124
6131
  { name: "orbitalName", type: "string", description: "Orbital name" },
6125
6132
  { name: "entry", type: { kind: "object", fields: { role: "string", content: "string" } }, description: "History entry" }
6126
6133
  ],
6127
- example: '["session/append-history", "ProductOrbital", { role: "user", content: "Add a search bar" }]'
6134
+ example: '["session/append-history", "ProductOrbital", { "role": "user", "content": "Add a search bar" }]'
6128
6135
  },
6129
6136
  "session/read-errors": {
6130
6137
  module: "session",
@@ -6149,7 +6156,7 @@ var SESSION_OPERATORS = {
6149
6156
  { name: "orbitalName", type: "string", description: "Orbital name" },
6150
6157
  { name: "errors", type: { kind: "array", of: "ValidationError" }, description: "Validation errors" }
6151
6158
  ],
6152
- example: '["session/write-errors", "ProductOrbital", @entity.errors]'
6159
+ example: '["session/write-errors", "ProductOrbital", []]'
6153
6160
  },
6154
6161
  "session/read-analysis": {
6155
6162
  module: "session",
@@ -6230,7 +6237,7 @@ var TRACE_OPERATORS = {
6230
6237
  { name: "event", type: "string", description: "Event type name" },
6231
6238
  { name: "payload", type: { kind: "object", fields: {}, open: true }, description: "Event payload", optional: true }
6232
6239
  ],
6233
- example: '["trace/emit", "coordinator_state_changed", { phase: @entity.phase }]'
6240
+ example: '["trace/emit", "coordinator_state_changed", {"phase": "planning"}]'
6234
6241
  },
6235
6242
  "trace/log": {
6236
6243
  module: "trace",
@@ -6288,7 +6295,7 @@ var BEHAVIOR_OPERATORS = {
6288
6295
  { name: "orbitalName", type: "string", description: "Canonical orbital name to instantiate" },
6289
6296
  { name: "overrides", type: { kind: "object", fields: { linkedEntity: "string", method: "string" }, open: true }, description: "Override surface: linkedEntity, events, config, fields", optional: true }
6290
6297
  ],
6291
- example: '["behavior/instantiate", "std-ecommerce", "ProductOrbital", { linkedEntity: "Product" }]'
6298
+ example: '["behavior/instantiate", "std-ecommerce", "ProductOrbital", { "linkedEntity": "Product" }]'
6292
6299
  },
6293
6300
  "behavior/call": {
6294
6301
  module: "behavior",
@@ -6318,7 +6325,7 @@ var BEHAVIOR_OPERATORS = {
6318
6325
  { name: "palette", type: { kind: "object", fields: { topics: { kind: "array", of: "string" }, hints: { kind: "array", of: "string" } } }, description: "Topic-tree palette + primitive hints" },
6319
6326
  { name: "deltaPrompt", type: "string", description: "Per-orbital instruction prompt" }
6320
6327
  ],
6321
- example: '["lolo/emit-body", "PlayerOrbital", { topics: ["game/2d"] }, "player ship with movement"]'
6328
+ example: '["lolo/emit-body", "PlayerOrbital", { "topics": ["game/2d"] }, "player ship with movement"]'
6322
6329
  },
6323
6330
  "validate/validate": {
6324
6331
  module: "behavior",
@@ -6355,7 +6362,7 @@ var INTEGRATION_OPERATORS = {
6355
6362
  { name: "responseSchema", type: { kind: "object", fields: {}, open: true }, description: "JSON Schema the response must satisfy" },
6356
6363
  { name: "body", type: { kind: "object", fields: {}, open: true }, description: "Request body (for POST/PUT)", optional: true }
6357
6364
  ],
6358
- example: '["integration/http", "GET", "https://api.github.com/repos/foo/bar", { name: "string", stars: "number" }]'
6365
+ example: '["integration/http", "GET", "https://api.github.com/repos/foo/bar", { "name": "string", "stars": "number" }]'
6359
6366
  },
6360
6367
  "integration/github-get-repo": {
6361
6368
  module: "integration",