@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.
package/dist/index.js CHANGED
@@ -268,7 +268,7 @@ var CORE_OPERATORS = {
268
268
  { name: "a", type: ANY, description: "Left operand" },
269
269
  { name: "b", type: ANY, description: "Right operand" }
270
270
  ],
271
- example: '["=", "@entity.status", "active"]'
271
+ example: '["=", "active", "active"]'
272
272
  },
273
273
  "==": {
274
274
  module: "core",
@@ -282,7 +282,7 @@ var CORE_OPERATORS = {
282
282
  { name: "a", type: ANY, description: "Left operand" },
283
283
  { name: "b", type: ANY, description: "Right operand" }
284
284
  ],
285
- example: '["==", "@entity.status", "active"]'
285
+ example: '["==", "active", "active"]'
286
286
  },
287
287
  "!=": {
288
288
  module: "core",
@@ -296,7 +296,7 @@ var CORE_OPERATORS = {
296
296
  { name: "a", type: ANY, description: "Left operand" },
297
297
  { name: "b", type: ANY, description: "Right operand" }
298
298
  ],
299
- example: '["!=", "@entity.id", null]'
299
+ example: '["!=", 1, null]'
300
300
  },
301
301
  "<": {
302
302
  module: "core",
@@ -310,7 +310,7 @@ var CORE_OPERATORS = {
310
310
  { name: "a", type: NUMBER, description: "Left operand" },
311
311
  { name: "b", type: NUMBER, description: "Right operand" }
312
312
  ],
313
- example: '["<", "@entity.health", 10]'
313
+ example: '["<", 5, 10]'
314
314
  },
315
315
  ">": {
316
316
  module: "core",
@@ -324,7 +324,7 @@ var CORE_OPERATORS = {
324
324
  { name: "a", type: NUMBER, description: "Left operand" },
325
325
  { name: "b", type: NUMBER, description: "Right operand" }
326
326
  ],
327
- example: '[">", "@entity.score", 0]'
327
+ example: '[">", 10, 0]'
328
328
  },
329
329
  "<=": {
330
330
  module: "core",
@@ -338,7 +338,7 @@ var CORE_OPERATORS = {
338
338
  { name: "a", type: NUMBER, description: "Left operand" },
339
339
  { name: "b", type: NUMBER, description: "Right operand" }
340
340
  ],
341
- example: '["<=", "@entity.count", 100]'
341
+ example: '["<=", 100, 100]'
342
342
  },
343
343
  ">=": {
344
344
  module: "core",
@@ -352,7 +352,7 @@ var CORE_OPERATORS = {
352
352
  { name: "a", type: NUMBER, description: "Left operand" },
353
353
  { name: "b", type: NUMBER, description: "Right operand" }
354
354
  ],
355
- example: '[">=", "@entity.age", 18]'
355
+ example: '[">=", 18, 18]'
356
356
  },
357
357
  // --- logic ------------------------------------------------------------------
358
358
  and: {
@@ -365,7 +365,7 @@ var CORE_OPERATORS = {
365
365
  returnType: "boolean",
366
366
  returnSemantics: "last-truthy-of-args",
367
367
  params: [{ name: "...conds", type: BOOLEAN, description: "Boolean expressions to AND" }],
368
- example: '["and", ["=", "@entity.active", true], [">", "@entity.score", 0]]'
368
+ example: '["and", ["=", "active", "active"], [">", 5, 0]]'
369
369
  },
370
370
  or: {
371
371
  module: "core",
@@ -377,7 +377,7 @@ var CORE_OPERATORS = {
377
377
  returnType: "boolean",
378
378
  returnSemantics: "first-truthy-of-args",
379
379
  params: [{ name: "...conds", type: BOOLEAN, description: "Boolean expressions to OR" }],
380
- example: '["or", ["=", "@entity.role", "admin"], ["=", "@entity.role", "owner"]]'
380
+ example: '["or", ["=", "admin", "user"], ["=", "admin", "owner"]]'
381
381
  },
382
382
  not: {
383
383
  module: "core",
@@ -388,7 +388,7 @@ var CORE_OPERATORS = {
388
388
  hasSideEffects: false,
389
389
  returnType: "boolean",
390
390
  params: [{ name: "cond", type: BOOLEAN, description: "Boolean to negate" }],
391
- example: '["not", "@entity.disabled"]'
391
+ example: '["not", false]'
392
392
  },
393
393
  if: {
394
394
  module: "core",
@@ -404,7 +404,7 @@ var CORE_OPERATORS = {
404
404
  { name: "then", type: ANY, description: "Value or effect if true" },
405
405
  { name: "else", type: ANY, description: "Value or effect if false" }
406
406
  ],
407
- example: '["if", [">", "@entity.health", 0], "alive", "dead"]'
407
+ example: '["if", [">", 5, 0], "alive", "dead"]'
408
408
  },
409
409
  // --- control ----------------------------------------------------------------
410
410
  let: {
@@ -512,7 +512,7 @@ var CORE_OPERATORS = {
512
512
  { name: "event", type: EVENT_KEY, description: "Event key" },
513
513
  { name: "payload", type: ENTITY_REF, description: "Optional payload", optional: true }
514
514
  ],
515
- example: '["emit", "PLAYER_DIED", { "playerId": "@entity.id" }]',
515
+ example: '["emit", "PLAYER_DIED", { "playerId": "p1" }]',
516
516
  effect: {
517
517
  kind: "emit",
518
518
  produces: {
@@ -547,7 +547,7 @@ var CORE_OPERATORS = {
547
547
  optional: true
548
548
  }
549
549
  ],
550
- example: '["persist", "create", "Task", { "title": "@payload.title" }, { "emit": { "success": "TASK_CREATED" } }]',
550
+ example: '["persist", "create", "Task", { "title": "Buy milk" }, { "emit": { "success": "TASK_CREATED" } }]',
551
551
  effect: {
552
552
  kind: "persist",
553
553
  // Action-discriminated union. The compiler narrows at the call site
@@ -601,7 +601,7 @@ var CORE_OPERATORS = {
601
601
  optional: true
602
602
  }
603
603
  ],
604
- example: '["navigate", "/tasks/:id", { "id": "@entity.id" }]',
604
+ example: '["navigate", "/tasks/:id", { "id": "t1" }]',
605
605
  effect: { kind: "navigate" }
606
606
  },
607
607
  "navigate-back": {
@@ -658,7 +658,7 @@ var CORE_OPERATORS = {
658
658
  optional: true
659
659
  }
660
660
  ],
661
- example: '["spawn", "Bullet", { "x": "@entity.x", "y": "@entity.y" }]',
661
+ example: '["spawn", "Bullet", { "x": 10, "y": 20 }]',
662
662
  effect: { kind: "spawn" }
663
663
  },
664
664
  despawn: {
@@ -703,18 +703,22 @@ var CORE_OPERATORS = {
703
703
  optional: true
704
704
  }
705
705
  ],
706
- example: '["fetch", "Task", { "id": "@payload.taskId", "emit": { "success": "TASK_LOADED" } }]',
706
+ example: '["fetch", "Task", { "id": "t1", "emit": { "success": "TASK_LOADED" } }]',
707
707
  effect: {
708
708
  kind: "fetch",
709
- // Call-site-discriminated union: options.id present -> single entity;
710
- // otherwise -> array of entity. The compiler narrows at the call site
711
- // when checking emit.success against the declared event payload.
712
709
  produces: {
713
- kind: "union",
714
- of: [
715
- { kind: "entity" },
716
- { kind: "array", of: { kind: "entity" } }
717
- ]
710
+ kind: "object",
711
+ fields: {
712
+ data: {
713
+ kind: "union",
714
+ of: [
715
+ { kind: "entity" },
716
+ { kind: "array", of: { kind: "entity" } }
717
+ ]
718
+ },
719
+ totalCount: "number"
720
+ },
721
+ open: false
718
722
  }
719
723
  }
720
724
  },
@@ -766,7 +770,7 @@ var CORE_OPERATORS = {
766
770
  optional: true
767
771
  }
768
772
  ],
769
- example: '["send-server", "CHAT_MESSAGE", { "text": "@input.text" }]',
773
+ example: '["send-server", "CHAT_MESSAGE", { "text": "hello" }]',
770
774
  effect: { kind: "send-server" }
771
775
  },
772
776
  ref: {
@@ -798,14 +802,21 @@ var CORE_OPERATORS = {
798
802
  example: '["ref", "Task"]',
799
803
  effect: {
800
804
  kind: "ref",
801
- // Same call-site shape as fetch. Kept for the V2 transition period;
805
+ // Same wrapper fetch emits. Kept for the V2 transition period;
802
806
  // scheduled for deprecation in a later phase (see Almadar_Entity_V2_Plan.md).
803
807
  produces: {
804
- kind: "union",
805
- of: [
806
- { kind: "entity" },
807
- { kind: "array", of: { kind: "entity" } }
808
- ]
808
+ kind: "object",
809
+ fields: {
810
+ data: {
811
+ kind: "union",
812
+ of: [
813
+ { kind: "entity" },
814
+ { kind: "array", of: { kind: "entity" } }
815
+ ]
816
+ },
817
+ totalCount: "number"
818
+ },
819
+ open: false
809
820
  }
810
821
  }
811
822
  },
@@ -833,7 +844,7 @@ var CORE_OPERATORS = {
833
844
  optional: true
834
845
  }
835
846
  ],
836
- example: '["call-service", "llm", "generate", { "userPrompt": "@entity.inputText" }, { "emit": { "success": "LlmCompleted", "failure": "LlmFailed" } }]',
847
+ example: '["call-service", "llm", "generate", { "userPrompt": "Hello" }, { "emit": { "success": "LlmCompleted", "failure": "LlmFailed" } }]',
837
848
  effect: {
838
849
  kind: "call-service",
839
850
  // TODO(entity-v2): narrow to the declared service return type once
@@ -1255,7 +1266,7 @@ var STR_OPERATORS = {
1255
1266
  hasSideEffects: false,
1256
1267
  returnType: "string",
1257
1268
  params: [{ name: "strings", type: "string", description: "Strings to concatenate" }],
1258
- example: '["str/concat", "/users/", "@entity.id"] // => "/users/123"'
1269
+ example: '["str/concat", "/users/", "123"] // => "/users/123"'
1259
1270
  },
1260
1271
  "str/upper": {
1261
1272
  module: "str",
@@ -1770,7 +1781,7 @@ var ARRAY_OPERATORS = {
1770
1781
  { name: "key", type: "string", description: "Field to sort by (for objects)", optional: true },
1771
1782
  { name: "dir", type: "string", description: '"asc" or "desc"', optional: true, defaultValue: "asc" }
1772
1783
  ],
1773
- example: '["array/sort", "@items", "price", "desc"]'
1784
+ example: '["array/sort", [{"price": 3}, {"price": 9}, {"price": 5}], "price", "desc"]'
1774
1785
  },
1775
1786
  "array/shuffle": {
1776
1787
  module: "array",
@@ -1862,7 +1873,7 @@ var ARRAY_OPERATORS = {
1862
1873
  { name: "arr", type: "array", description: "The array" },
1863
1874
  { name: "pred", type: "lambda", description: "Predicate function" }
1864
1875
  ],
1865
- example: '["array/find", "@items", ["fn", "x", ["=", "@x.status", "active"]]]'
1876
+ example: '["array/find", [{"status": "active"}, {"status": "archived"}], ["fn", "x", ["=", "@x.status", "active"]]]'
1866
1877
  },
1867
1878
  "array/findIndex": {
1868
1879
  module: "array",
@@ -1878,7 +1889,7 @@ var ARRAY_OPERATORS = {
1878
1889
  { name: "arr", type: "array", description: "The array" },
1879
1890
  { name: "pred", type: "lambda", description: "Predicate function" }
1880
1891
  ],
1881
- example: '["array/findIndex", "@items", ["fn", "x", ["=", "@x.status", "active"]]]'
1892
+ example: '["array/findIndex", [{"status": "active"}, {"status": "archived"}], ["fn", "x", ["=", "@x.status", "active"]]]'
1882
1893
  },
1883
1894
  "array/filter": {
1884
1895
  module: "array",
@@ -1895,7 +1906,7 @@ var ARRAY_OPERATORS = {
1895
1906
  { name: "arr", type: "array", description: "The array" },
1896
1907
  { name: "pred", type: "lambda", description: "Predicate function" }
1897
1908
  ],
1898
- example: '["array/filter", "@items", ["fn", "x", [">", "@x.price", 100]]]'
1909
+ example: '["array/filter", [{"price": 50}, {"price": 150}], ["fn", "x", [">", "@x.price", 100]]]'
1899
1910
  },
1900
1911
  "array/reject": {
1901
1912
  module: "array",
@@ -1912,7 +1923,7 @@ var ARRAY_OPERATORS = {
1912
1923
  { name: "arr", type: "array", description: "The array" },
1913
1924
  { name: "pred", type: "lambda", description: "Predicate function" }
1914
1925
  ],
1915
- example: '["array/reject", "@items", ["fn", "x", ["=", "@x.status", "deleted"]]]'
1926
+ example: '["array/reject", [{"status": "active"}, {"status": "deleted"}], ["fn", "x", ["=", "@x.status", "deleted"]]]'
1916
1927
  },
1917
1928
  "array/map": {
1918
1929
  module: "array",
@@ -1929,7 +1940,7 @@ var ARRAY_OPERATORS = {
1929
1940
  { name: "arr", type: "array", description: "The array" },
1930
1941
  { name: "fn", type: "lambda", description: "Transform function" }
1931
1942
  ],
1932
- example: '["array/map", "@items", ["fn", "x", ["*", "@x.price", 1.1]]]'
1943
+ example: '["array/map", [{"price": 100}, {"price": 200}], ["fn", "x", ["*", "@x.price", 1.1]]]'
1933
1944
  },
1934
1945
  "array/reduce": {
1935
1946
  module: "array",
@@ -1947,7 +1958,7 @@ var ARRAY_OPERATORS = {
1947
1958
  { name: "init", type: "any", description: "Initial accumulator value" },
1948
1959
  { name: "fn", type: "lambda", description: "Reducer function (acc, item) => newAcc" }
1949
1960
  ],
1950
- example: '["array/reduce", "@items", 0, ["fn", ["acc", "x"], ["+", "@acc", "@x.price"]]]'
1961
+ example: '["array/reduce", [{"price": 10}, {"price": 25}], 0, ["fn", ["acc", "x"], ["+", "@acc", "@x.price"]]]'
1951
1962
  },
1952
1963
  "array/every": {
1953
1964
  module: "array",
@@ -1963,7 +1974,7 @@ var ARRAY_OPERATORS = {
1963
1974
  { name: "arr", type: "array", description: "The array" },
1964
1975
  { name: "pred", type: "lambda", description: "Predicate function" }
1965
1976
  ],
1966
- example: '["array/every", "@items", ["fn", "x", [">", "@x.price", 0]]]'
1977
+ example: '["array/every", [{"price": 5}, {"price": 10}], ["fn", "x", [">", "@x.price", 0]]]'
1967
1978
  },
1968
1979
  "array/some": {
1969
1980
  module: "array",
@@ -1979,7 +1990,7 @@ var ARRAY_OPERATORS = {
1979
1990
  { name: "arr", type: "array", description: "The array" },
1980
1991
  { name: "pred", type: "lambda", description: "Predicate function" }
1981
1992
  ],
1982
- example: '["array/some", "@items", ["fn", "x", ["=", "@x.status", "active"]]]'
1993
+ example: '["array/some", [{"status": "archived"}, {"status": "active"}], ["fn", "x", ["=", "@x.status", "active"]]]'
1983
1994
  },
1984
1995
  "array/count": {
1985
1996
  module: "array",
@@ -1995,7 +2006,7 @@ var ARRAY_OPERATORS = {
1995
2006
  { name: "arr", type: "array", description: "The array" },
1996
2007
  { name: "pred", type: "lambda", description: "Predicate function", optional: true }
1997
2008
  ],
1998
- example: '["array/count", "@tasks", ["fn", "t", ["=", "@t.status", "done"]]]'
2009
+ example: '["array/count", [{"status": "done"}, {"status": "todo"}], ["fn", "t", ["=", "@t.status", "done"]]]'
1999
2010
  },
2000
2011
  "array/sum": {
2001
2012
  module: "array",
@@ -2009,7 +2020,7 @@ var ARRAY_OPERATORS = {
2009
2020
  { name: "arr", type: "array", description: "The array" },
2010
2021
  { name: "key", type: "string", description: "Field to sum", optional: true }
2011
2022
  ],
2012
- example: '["array/sum", "@cart.items", "price"]'
2023
+ example: '["array/sum", [{"price": 10}, {"price": 25}], "price"]'
2013
2024
  },
2014
2025
  "array/avg": {
2015
2026
  module: "array",
@@ -2023,7 +2034,7 @@ var ARRAY_OPERATORS = {
2023
2034
  { name: "arr", type: "array", description: "The array" },
2024
2035
  { name: "key", type: "string", description: "Field to average", optional: true }
2025
2036
  ],
2026
- example: '["array/avg", "@ratings", "score"]'
2037
+ example: '["array/avg", [{"score": 80}, {"score": 90}], "score"]'
2027
2038
  },
2028
2039
  "array/min": {
2029
2040
  module: "array",
@@ -2037,7 +2048,7 @@ var ARRAY_OPERATORS = {
2037
2048
  { name: "arr", type: "array", description: "The array" },
2038
2049
  { name: "key", type: "string", description: "Field to compare", optional: true }
2039
2050
  ],
2040
- example: '["array/min", "@products", "price"]'
2051
+ example: '["array/min", [{"price": 3}, {"price": 9}], "price"]'
2041
2052
  },
2042
2053
  "array/max": {
2043
2054
  module: "array",
@@ -2051,7 +2062,7 @@ var ARRAY_OPERATORS = {
2051
2062
  { name: "arr", type: "array", description: "The array" },
2052
2063
  { name: "key", type: "string", description: "Field to compare", optional: true }
2053
2064
  ],
2054
- example: '["array/max", "@products", "price"]'
2065
+ example: '["array/max", [{"price": 3}, {"price": 9}], "price"]'
2055
2066
  },
2056
2067
  "array/groupBy": {
2057
2068
  module: "array",
@@ -2065,7 +2076,7 @@ var ARRAY_OPERATORS = {
2065
2076
  { name: "arr", type: "array", description: "The array" },
2066
2077
  { name: "key", type: "string", description: "Field to group by" }
2067
2078
  ],
2068
- example: '["array/groupBy", "@orders", "status"]'
2079
+ example: '["array/groupBy", [{"status": "new"}, {"status": "done"}], "status"]'
2069
2080
  },
2070
2081
  "array/partition": {
2071
2082
  module: "array",
@@ -2081,7 +2092,7 @@ var ARRAY_OPERATORS = {
2081
2092
  { name: "arr", type: "array", description: "The array" },
2082
2093
  { name: "pred", type: "lambda", description: "Predicate function" }
2083
2094
  ],
2084
- example: '["array/partition", "@items", ["fn", "x", [">", "@x.price", 50]]]'
2095
+ example: '["array/partition", [{"price": 30}, {"price": 80}], ["fn", "x", [">", "@x.price", 50]]]'
2085
2096
  },
2086
2097
  "array/take": {
2087
2098
  module: "array",
@@ -2095,7 +2106,7 @@ var ARRAY_OPERATORS = {
2095
2106
  { name: "arr", type: "array", description: "The array" },
2096
2107
  { name: "n", type: "number", description: "Number of elements" }
2097
2108
  ],
2098
- example: '["array/take", "@items", 5]'
2109
+ example: '["array/take", [1, 2, 3, 4, 5, 6, 7], 5]'
2099
2110
  },
2100
2111
  "array/drop": {
2101
2112
  module: "array",
@@ -2109,7 +2120,7 @@ var ARRAY_OPERATORS = {
2109
2120
  { name: "arr", type: "array", description: "The array" },
2110
2121
  { name: "n", type: "number", description: "Number of elements to skip" }
2111
2122
  ],
2112
- example: '["array/drop", "@items", 5]'
2123
+ example: '["array/drop", [1, 2, 3, 4, 5, 6, 7], 5]'
2113
2124
  },
2114
2125
  "array/takeLast": {
2115
2126
  module: "array",
@@ -2123,7 +2134,7 @@ var ARRAY_OPERATORS = {
2123
2134
  { name: "arr", type: "array", description: "The array" },
2124
2135
  { name: "n", type: "number", description: "Number of elements" }
2125
2136
  ],
2126
- example: '["array/takeLast", "@items", 3]'
2137
+ example: '["array/takeLast", [1, 2, 3, 4, 5], 3]'
2127
2138
  },
2128
2139
  "array/dropLast": {
2129
2140
  module: "array",
@@ -2137,7 +2148,7 @@ var ARRAY_OPERATORS = {
2137
2148
  { name: "arr", type: "array", description: "The array" },
2138
2149
  { name: "n", type: "number", description: "Number of elements to skip" }
2139
2150
  ],
2140
- example: '["array/dropLast", "@items", 2]'
2151
+ example: '["array/dropLast", [1, 2, 3, 4, 5], 2]'
2141
2152
  },
2142
2153
  "array/cosine": {
2143
2154
  module: "array",
@@ -2151,7 +2162,7 @@ var ARRAY_OPERATORS = {
2151
2162
  { name: "a", type: { kind: "array", of: "number" }, description: "First vector" },
2152
2163
  { name: "b", type: { kind: "array", of: "number" }, description: "Second vector" }
2153
2164
  ],
2154
- example: '["array/cosine", "@entity.answerEmbedding", "@entity.referenceEmbedding"]'
2165
+ example: '["array/cosine", [1, 0], [0, 1]]'
2155
2166
  },
2156
2167
  "array/nearest": {
2157
2168
  module: "array",
@@ -2165,7 +2176,7 @@ var ARRAY_OPERATORS = {
2165
2176
  { name: "query", type: { kind: "array", of: "number" }, description: "Query vector" },
2166
2177
  { name: "candidates", type: { kind: "array", of: { kind: "array", of: "number" } }, description: "Candidate vectors to search" }
2167
2178
  ],
2168
- example: '["array/nearest", "@entity.queryEmbedding", "@entity.candidateEmbeddings"]'
2179
+ example: '["array/nearest", [1, 0], [[1, 0], [0, 1]]]'
2169
2180
  }
2170
2181
  };
2171
2182
 
@@ -2229,7 +2240,7 @@ var OBJECT_OPERATORS = {
2229
2240
  { name: "path", type: "string", description: 'Dot-separated path (e.g., "user.name")' },
2230
2241
  { name: "default", type: "any", description: "Default if path not found", optional: true }
2231
2242
  ],
2232
- example: '["object/get", "@user", "profile.name", "Anonymous"]'
2243
+ example: '["object/get", {"profile": {"name": "Ann"}}, "profile.name", "Anonymous"]'
2233
2244
  },
2234
2245
  "object/set": {
2235
2246
  module: "object",
@@ -2244,7 +2255,7 @@ var OBJECT_OPERATORS = {
2244
2255
  { name: "path", type: "string", description: "Dot-separated path" },
2245
2256
  { name: "value", type: "any", description: "Value to set" }
2246
2257
  ],
2247
- example: '["object/set", "@user", "profile.name", "John"]'
2258
+ example: '["object/set", {"profile": {"name": "Ann"}}, "profile.name", "John"]'
2248
2259
  },
2249
2260
  "object/has": {
2250
2261
  module: "object",
@@ -2258,7 +2269,7 @@ var OBJECT_OPERATORS = {
2258
2269
  { name: "obj", type: "object", description: "The object" },
2259
2270
  { name: "path", type: "string", description: "Dot-separated path" }
2260
2271
  ],
2261
- example: '["object/has", "@user", "profile.name"]'
2272
+ example: '["object/has", {"profile": {"name": "Ann"}}, "profile.name"]'
2262
2273
  },
2263
2274
  "object/merge": {
2264
2275
  module: "object",
@@ -2295,7 +2306,7 @@ var OBJECT_OPERATORS = {
2295
2306
  { name: "obj", type: "object", description: "The object" },
2296
2307
  { name: "keys", type: "array", description: "Keys to keep" }
2297
2308
  ],
2298
- example: '["object/pick", "@entity", ["name", "email"]]'
2309
+ example: '["object/pick", {"name": "Ann", "email": "ann@example.com", "age": 30}, ["name", "email"]]'
2299
2310
  },
2300
2311
  "object/omit": {
2301
2312
  module: "object",
@@ -2309,7 +2320,7 @@ var OBJECT_OPERATORS = {
2309
2320
  { name: "obj", type: "object", description: "The object" },
2310
2321
  { name: "keys", type: "array", description: "Keys to exclude" }
2311
2322
  ],
2312
- example: '["object/omit", "@entity", ["password", "secret"]]'
2323
+ example: '["object/omit", {"name": "Ann", "password": "x"}, ["password"]]'
2313
2324
  },
2314
2325
  "object/mapValues": {
2315
2326
  module: "object",
@@ -2325,7 +2336,7 @@ var OBJECT_OPERATORS = {
2325
2336
  { name: "obj", type: "object", description: "The object" },
2326
2337
  { name: "fn", type: "lambda", description: "Transform function" }
2327
2338
  ],
2328
- example: '["object/mapValues", "@stats", ["fn", "v", ["*", "@v", 100]]]'
2339
+ example: '["object/mapValues", {"a": 0.5, "b": 0.25}, ["fn", "v", ["*", "@v", 100]]]'
2329
2340
  },
2330
2341
  "object/mapKeys": {
2331
2342
  module: "object",
@@ -2341,7 +2352,7 @@ var OBJECT_OPERATORS = {
2341
2352
  { name: "obj", type: "object", description: "The object" },
2342
2353
  { name: "fn", type: "lambda", description: "Transform function" }
2343
2354
  ],
2344
- example: '["object/mapKeys", "@data", ["fn", "k", ["str/upper", "@k"]]]'
2355
+ example: '["object/mapKeys", {"a": 1, "b": 2}, ["fn", "k", ["str/upper", "@k"]]]'
2345
2356
  },
2346
2357
  "object/filter": {
2347
2358
  module: "object",
@@ -2357,7 +2368,7 @@ var OBJECT_OPERATORS = {
2357
2368
  { name: "obj", type: "object", description: "The object" },
2358
2369
  { name: "pred", type: "lambda", description: "Predicate (key, value) => boolean" }
2359
2370
  ],
2360
- example: '["object/filter", "@data", ["fn", ["k", "v"], ["!=", "@v", null]]]'
2371
+ example: '["object/filter", {"a": 1, "b": null}, ["fn", ["k", "v"], ["!=", "@v", null]]]'
2361
2372
  },
2362
2373
  "object/equals": {
2363
2374
  module: "object",
@@ -2382,7 +2393,7 @@ var OBJECT_OPERATORS = {
2382
2393
  hasSideEffects: false,
2383
2394
  returnType: "any",
2384
2395
  params: [{ name: "obj", type: "object", description: "The object" }],
2385
- example: '["object/clone", "@entity"]'
2396
+ example: '["object/clone", {"a": 1, "b": 2}]'
2386
2397
  },
2387
2398
  "object/deepClone": {
2388
2399
  module: "object",
@@ -2393,7 +2404,7 @@ var OBJECT_OPERATORS = {
2393
2404
  hasSideEffects: false,
2394
2405
  returnType: "any",
2395
2406
  params: [{ name: "obj", type: "object", description: "The object" }],
2396
- example: '["object/deepClone", "@entity"]'
2407
+ example: '["object/deepClone", {"a": {"b": 2}}]'
2397
2408
  },
2398
2409
  "path": {
2399
2410
  module: "object",
@@ -2407,7 +2418,7 @@ var OBJECT_OPERATORS = {
2407
2418
  params: [
2408
2419
  { name: "...segments", type: "string[]", description: "Path segments to join with dots" }
2409
2420
  ],
2410
- example: '["path", "formValues", "@payload.fieldId"] // => "formValues.customerName"'
2421
+ example: '["path", "formValues", "customerName"] // => "formValues.customerName"'
2411
2422
  }
2412
2423
  };
2413
2424
 
@@ -2461,7 +2472,7 @@ var TIME_OPERATORS = {
2461
2472
  { name: "date", type: "number", description: "Timestamp" },
2462
2473
  { name: "format", type: "string", description: "Format pattern" }
2463
2474
  ],
2464
- example: '["time/format", "@entity.createdAt", "MMM DD, YYYY"]'
2475
+ example: '["time/format", 1700000000000, "MMM DD, YYYY"]'
2465
2476
  },
2466
2477
  "time/year": {
2467
2478
  module: "time",
@@ -2472,7 +2483,7 @@ var TIME_OPERATORS = {
2472
2483
  hasSideEffects: false,
2473
2484
  returnType: "number",
2474
2485
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2475
- example: '["time/year", "@entity.createdAt"] // => 2024'
2486
+ example: '["time/year", 1700000000000] // => 2023'
2476
2487
  },
2477
2488
  "time/month": {
2478
2489
  module: "time",
@@ -2483,7 +2494,7 @@ var TIME_OPERATORS = {
2483
2494
  hasSideEffects: false,
2484
2495
  returnType: "number",
2485
2496
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2486
- example: '["time/month", "@entity.createdAt"] // => 1'
2497
+ example: '["time/month", 1700000000000] // => 11'
2487
2498
  },
2488
2499
  "time/day": {
2489
2500
  module: "time",
@@ -2494,7 +2505,7 @@ var TIME_OPERATORS = {
2494
2505
  hasSideEffects: false,
2495
2506
  returnType: "number",
2496
2507
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2497
- example: '["time/day", "@entity.createdAt"] // => 18'
2508
+ example: '["time/day", 1700000000000] // => 14'
2498
2509
  },
2499
2510
  "time/weekday": {
2500
2511
  module: "time",
@@ -2505,7 +2516,7 @@ var TIME_OPERATORS = {
2505
2516
  hasSideEffects: false,
2506
2517
  returnType: "number",
2507
2518
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2508
- example: '["time/weekday", "@entity.createdAt"] // => 4 (Thursday)'
2519
+ example: '["time/weekday", 1700000000000] // => 2 (Tuesday)'
2509
2520
  },
2510
2521
  "time/hour": {
2511
2522
  module: "time",
@@ -2516,7 +2527,7 @@ var TIME_OPERATORS = {
2516
2527
  hasSideEffects: false,
2517
2528
  returnType: "number",
2518
2529
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2519
- example: '["time/hour", "@entity.createdAt"] // => 14'
2530
+ example: '["time/hour", 1700000000000]'
2520
2531
  },
2521
2532
  "time/minute": {
2522
2533
  module: "time",
@@ -2527,7 +2538,7 @@ var TIME_OPERATORS = {
2527
2538
  hasSideEffects: false,
2528
2539
  returnType: "number",
2529
2540
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2530
- example: '["time/minute", "@entity.createdAt"] // => 30'
2541
+ example: '["time/minute", 1700000000000]'
2531
2542
  },
2532
2543
  "time/second": {
2533
2544
  module: "time",
@@ -2538,7 +2549,7 @@ var TIME_OPERATORS = {
2538
2549
  hasSideEffects: false,
2539
2550
  returnType: "number",
2540
2551
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2541
- example: '["time/second", "@entity.createdAt"] // => 45'
2552
+ example: '["time/second", 1700000000000]'
2542
2553
  },
2543
2554
  "time/add": {
2544
2555
  module: "time",
@@ -2583,7 +2594,7 @@ var TIME_OPERATORS = {
2583
2594
  { name: "b", type: "number", description: "Second timestamp" },
2584
2595
  { name: "unit", type: "string", description: "Result unit", optional: true, defaultValue: "ms" }
2585
2596
  ],
2586
- example: '["time/diff", "@entity.birthDate", ["time/now"], "year"]'
2597
+ example: '["time/diff", 1700000000000, ["time/now"], "year"]'
2587
2598
  },
2588
2599
  "time/startOf": {
2589
2600
  module: "time",
@@ -2625,7 +2636,7 @@ var TIME_OPERATORS = {
2625
2636
  { name: "a", type: "number", description: "First timestamp" },
2626
2637
  { name: "b", type: "number", description: "Second timestamp" }
2627
2638
  ],
2628
- example: '["time/isBefore", "@entity.startDate", "@entity.endDate"]'
2639
+ example: '["time/isBefore", 1700000000000, 1700086400000]'
2629
2640
  },
2630
2641
  "time/isAfter": {
2631
2642
  module: "time",
@@ -2639,7 +2650,7 @@ var TIME_OPERATORS = {
2639
2650
  { name: "a", type: "number", description: "First timestamp" },
2640
2651
  { name: "b", type: "number", description: "Second timestamp" }
2641
2652
  ],
2642
- example: '["time/isAfter", ["time/now"], "@entity.deadline"]'
2653
+ example: '["time/isAfter", ["time/now"], 1700000000000]'
2643
2654
  },
2644
2655
  "time/isBetween": {
2645
2656
  module: "time",
@@ -2654,7 +2665,7 @@ var TIME_OPERATORS = {
2654
2665
  { name: "start", type: "number", description: "Range start" },
2655
2666
  { name: "end", type: "number", description: "Range end" }
2656
2667
  ],
2657
- example: '["time/isBetween", ["time/now"], "@entity.startDate", "@entity.endDate"]'
2668
+ example: '["time/isBetween", ["time/now"], 1700000000000, 2000000000000]'
2658
2669
  },
2659
2670
  "time/isSame": {
2660
2671
  module: "time",
@@ -2669,7 +2680,7 @@ var TIME_OPERATORS = {
2669
2680
  { name: "b", type: "number", description: "Second timestamp" },
2670
2681
  { name: "unit", type: "string", description: "Comparison unit", optional: true }
2671
2682
  ],
2672
- example: '["time/isSame", "@a", "@b", "day"]'
2683
+ example: '["time/isSame", 1700000000000, 1700001000000, "day"]'
2673
2684
  },
2674
2685
  "time/isPast": {
2675
2686
  module: "time",
@@ -2680,7 +2691,7 @@ var TIME_OPERATORS = {
2680
2691
  hasSideEffects: false,
2681
2692
  returnType: "boolean",
2682
2693
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2683
- example: '["time/isPast", "@entity.expiresAt"]'
2694
+ example: '["time/isPast", 1700000000000]'
2684
2695
  },
2685
2696
  "time/isFuture": {
2686
2697
  module: "time",
@@ -2691,7 +2702,7 @@ var TIME_OPERATORS = {
2691
2702
  hasSideEffects: false,
2692
2703
  returnType: "boolean",
2693
2704
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2694
- example: '["time/isFuture", "@entity.scheduledAt"]'
2705
+ example: '["time/isFuture", 2000000000000]'
2695
2706
  },
2696
2707
  "time/isToday": {
2697
2708
  module: "time",
@@ -2702,7 +2713,7 @@ var TIME_OPERATORS = {
2702
2713
  hasSideEffects: false,
2703
2714
  returnType: "boolean",
2704
2715
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2705
- example: '["time/isToday", "@entity.createdAt"]'
2716
+ example: '["time/isToday", ["time/now"]]'
2706
2717
  },
2707
2718
  "time/relative": {
2708
2719
  module: "time",
@@ -2713,7 +2724,7 @@ var TIME_OPERATORS = {
2713
2724
  hasSideEffects: false,
2714
2725
  returnType: "string",
2715
2726
  params: [{ name: "date", type: "number", description: "Timestamp" }],
2716
- example: '["time/relative", "@entity.lastActivityAt"] // => "2 hours ago"'
2727
+ example: '["time/relative", 1700000000000] // => "2 years ago"'
2717
2728
  },
2718
2729
  "time/duration": {
2719
2730
  module: "time",
@@ -2739,7 +2750,7 @@ var VALIDATE_OPERATORS = {
2739
2750
  hasSideEffects: false,
2740
2751
  returnType: "boolean",
2741
2752
  params: [{ name: "value", type: "any", description: "Value to check" }],
2742
- example: '["validate/required", "@payload.name"]'
2753
+ example: '["validate/required", "Ann"]'
2743
2754
  },
2744
2755
  "validate/string": {
2745
2756
  module: "validate",
@@ -2750,7 +2761,7 @@ var VALIDATE_OPERATORS = {
2750
2761
  hasSideEffects: false,
2751
2762
  returnType: "boolean",
2752
2763
  params: [{ name: "value", type: "any", description: "Value to check" }],
2753
- example: '["validate/string", "@payload.name"]'
2764
+ example: '["validate/string", "Ann"]'
2754
2765
  },
2755
2766
  "validate/number": {
2756
2767
  module: "validate",
@@ -2761,7 +2772,7 @@ var VALIDATE_OPERATORS = {
2761
2772
  hasSideEffects: false,
2762
2773
  returnType: "boolean",
2763
2774
  params: [{ name: "value", type: "any", description: "Value to check" }],
2764
- example: '["validate/number", "@payload.age"]'
2775
+ example: '["validate/number", 42]'
2765
2776
  },
2766
2777
  "validate/boolean": {
2767
2778
  module: "validate",
@@ -2772,7 +2783,7 @@ var VALIDATE_OPERATORS = {
2772
2783
  hasSideEffects: false,
2773
2784
  returnType: "boolean",
2774
2785
  params: [{ name: "value", type: "any", description: "Value to check" }],
2775
- example: '["validate/boolean", "@payload.active"]'
2786
+ example: '["validate/boolean", true]'
2776
2787
  },
2777
2788
  "validate/array": {
2778
2789
  module: "validate",
@@ -2783,7 +2794,7 @@ var VALIDATE_OPERATORS = {
2783
2794
  hasSideEffects: false,
2784
2795
  returnType: "boolean",
2785
2796
  params: [{ name: "value", type: "any", description: "Value to check" }],
2786
- example: '["validate/array", "@payload.items"]'
2797
+ example: '["validate/array", [1, 2]]'
2787
2798
  },
2788
2799
  "validate/object": {
2789
2800
  module: "validate",
@@ -2794,7 +2805,7 @@ var VALIDATE_OPERATORS = {
2794
2805
  hasSideEffects: false,
2795
2806
  returnType: "boolean",
2796
2807
  params: [{ name: "value", type: "any", description: "Value to check" }],
2797
- example: '["validate/object", "@payload.data"]'
2808
+ example: '["validate/object", {"a": 1}]'
2798
2809
  },
2799
2810
  "validate/email": {
2800
2811
  module: "validate",
@@ -2805,7 +2816,7 @@ var VALIDATE_OPERATORS = {
2805
2816
  hasSideEffects: false,
2806
2817
  returnType: "boolean",
2807
2818
  params: [{ name: "value", type: "string", description: "Email to validate" }],
2808
- example: '["validate/email", "@payload.email"]'
2819
+ example: '["validate/email", "ann@example.com"]'
2809
2820
  },
2810
2821
  "validate/url": {
2811
2822
  module: "validate",
@@ -2816,7 +2827,7 @@ var VALIDATE_OPERATORS = {
2816
2827
  hasSideEffects: false,
2817
2828
  returnType: "boolean",
2818
2829
  params: [{ name: "value", type: "string", description: "URL to validate" }],
2819
- example: '["validate/url", "@payload.website"]'
2830
+ example: '["validate/url", "https://example.com"]'
2820
2831
  },
2821
2832
  "validate/uuid": {
2822
2833
  module: "validate",
@@ -2827,7 +2838,7 @@ var VALIDATE_OPERATORS = {
2827
2838
  hasSideEffects: false,
2828
2839
  returnType: "boolean",
2829
2840
  params: [{ name: "value", type: "string", description: "UUID to validate" }],
2830
- example: '["validate/uuid", "@payload.id"]'
2841
+ example: '["validate/uuid", "550e8400-e29b-41d4-a716-446655440000"]'
2831
2842
  },
2832
2843
  "validate/phone": {
2833
2844
  module: "validate",
@@ -2838,7 +2849,7 @@ var VALIDATE_OPERATORS = {
2838
2849
  hasSideEffects: false,
2839
2850
  returnType: "boolean",
2840
2851
  params: [{ name: "value", type: "string", description: "Phone number to validate" }],
2841
- example: '["validate/phone", "@payload.phone"]'
2852
+ example: '["validate/phone", "+15551234567"]'
2842
2853
  },
2843
2854
  "validate/creditCard": {
2844
2855
  module: "validate",
@@ -2849,7 +2860,7 @@ var VALIDATE_OPERATORS = {
2849
2860
  hasSideEffects: false,
2850
2861
  returnType: "boolean",
2851
2862
  params: [{ name: "value", type: "string", description: "Card number to validate" }],
2852
- example: '["validate/creditCard", "@payload.cardNumber"]'
2863
+ example: '["validate/creditCard", "4111111111111111"]'
2853
2864
  },
2854
2865
  "validate/date": {
2855
2866
  module: "validate",
@@ -2860,7 +2871,7 @@ var VALIDATE_OPERATORS = {
2860
2871
  hasSideEffects: false,
2861
2872
  returnType: "boolean",
2862
2873
  params: [{ name: "value", type: "any", description: "Value to check" }],
2863
- example: '["validate/date", "@payload.birthDate"]'
2874
+ example: '["validate/date", "2024-01-18"]'
2864
2875
  },
2865
2876
  "validate/minLength": {
2866
2877
  module: "validate",
@@ -2874,7 +2885,7 @@ var VALIDATE_OPERATORS = {
2874
2885
  { name: "value", type: "string | array", description: "Value to check" },
2875
2886
  { name: "min", type: "number", description: "Minimum length" }
2876
2887
  ],
2877
- example: '["validate/minLength", "@payload.password", 8]'
2888
+ example: '["validate/minLength", "password123", 8]'
2878
2889
  },
2879
2890
  "validate/maxLength": {
2880
2891
  module: "validate",
@@ -2888,7 +2899,7 @@ var VALIDATE_OPERATORS = {
2888
2899
  { name: "value", type: "string | array", description: "Value to check" },
2889
2900
  { name: "max", type: "number", description: "Maximum length" }
2890
2901
  ],
2891
- example: '["validate/maxLength", "@payload.name", 50]'
2902
+ example: '["validate/maxLength", "Ann", 50]'
2892
2903
  },
2893
2904
  "validate/length": {
2894
2905
  module: "validate",
@@ -2902,7 +2913,7 @@ var VALIDATE_OPERATORS = {
2902
2913
  { name: "value", type: "string | array", description: "Value to check" },
2903
2914
  { name: "exact", type: "number", description: "Required length" }
2904
2915
  ],
2905
- example: '["validate/length", "@payload.code", 6]'
2916
+ example: '["validate/length", "ABC123", 6]'
2906
2917
  },
2907
2918
  "validate/min": {
2908
2919
  module: "validate",
@@ -2916,7 +2927,7 @@ var VALIDATE_OPERATORS = {
2916
2927
  { name: "value", type: "number", description: "Number to check" },
2917
2928
  { name: "min", type: "number", description: "Minimum value" }
2918
2929
  ],
2919
- example: '["validate/min", "@payload.age", 18]'
2930
+ example: '["validate/min", 21, 18]'
2920
2931
  },
2921
2932
  "validate/max": {
2922
2933
  module: "validate",
@@ -2930,7 +2941,7 @@ var VALIDATE_OPERATORS = {
2930
2941
  { name: "value", type: "number", description: "Number to check" },
2931
2942
  { name: "max", type: "number", description: "Maximum value" }
2932
2943
  ],
2933
- example: '["validate/max", "@payload.quantity", 100]'
2944
+ example: '["validate/max", 50, 100]'
2934
2945
  },
2935
2946
  "validate/range": {
2936
2947
  module: "validate",
@@ -2945,7 +2956,7 @@ var VALIDATE_OPERATORS = {
2945
2956
  { name: "min", type: "number", description: "Minimum value" },
2946
2957
  { name: "max", type: "number", description: "Maximum value" }
2947
2958
  ],
2948
- example: '["validate/range", "@payload.rating", 1, 5]'
2959
+ example: '["validate/range", 4, 1, 5]'
2949
2960
  },
2950
2961
  "validate/pattern": {
2951
2962
  module: "validate",
@@ -2959,7 +2970,7 @@ var VALIDATE_OPERATORS = {
2959
2970
  { name: "value", type: "string", description: "String to check" },
2960
2971
  { name: "regex", type: "string", description: "Regex pattern" }
2961
2972
  ],
2962
- example: '["validate/pattern", "@payload.code", "^[A-Z]{3}[0-9]{3}$"]'
2973
+ example: '["validate/pattern", "ABC123", "^[A-Z]{3}[0-9]{3}$"]'
2963
2974
  },
2964
2975
  "validate/oneOf": {
2965
2976
  module: "validate",
@@ -2973,7 +2984,7 @@ var VALIDATE_OPERATORS = {
2973
2984
  { name: "value", type: "any", description: "Value to check" },
2974
2985
  { name: "options", type: "array", description: "Allowed values" }
2975
2986
  ],
2976
- example: '["validate/oneOf", "@payload.role", ["admin", "user", "guest"]]'
2987
+ example: '["validate/oneOf", "admin", ["admin", "user", "guest"]]'
2977
2988
  },
2978
2989
  "validate/noneOf": {
2979
2990
  module: "validate",
@@ -2987,7 +2998,7 @@ var VALIDATE_OPERATORS = {
2987
2998
  { name: "value", type: "any", description: "Value to check" },
2988
2999
  { name: "options", type: "array", description: "Disallowed values" }
2989
3000
  ],
2990
- example: '["validate/noneOf", "@payload.username", ["admin", "root", "system"]]'
3001
+ example: '["validate/noneOf", "alice", ["admin", "root", "system"]]'
2991
3002
  },
2992
3003
  "validate/equals": {
2993
3004
  module: "validate",
@@ -3001,7 +3012,7 @@ var VALIDATE_OPERATORS = {
3001
3012
  { name: "a", type: "any", description: "First value" },
3002
3013
  { name: "b", type: "any", description: "Second value" }
3003
3014
  ],
3004
- example: '["validate/equals", "@payload.password", "@payload.confirmPassword"]'
3015
+ example: '["validate/equals", "secret", "secret"]'
3005
3016
  },
3006
3017
  "validate/check": {
3007
3018
  module: "validate",
@@ -3015,11 +3026,7 @@ var VALIDATE_OPERATORS = {
3015
3026
  { name: "value", type: "any", description: "Value or object to validate" },
3016
3027
  { name: "rules", type: "object", description: "Validation rules by field" }
3017
3028
  ],
3018
- example: `["validate/check", "@payload.data", {
3019
- "name": [["required"], ["minLength", 2], ["maxLength", 50]],
3020
- "email": [["required"], ["email"]],
3021
- "age": [["number"], ["min", 18]]
3022
- }]`
3029
+ example: '["validate/check", {"name": "Ann", "email": "ann@example.com", "age": 20}, {"name": [["required"], ["minLength", 2], ["maxLength", 50]], "email": [["required"], ["email"]], "age": [["number"]]}]'
3023
3030
  }
3024
3031
  };
3025
3032
 
@@ -3395,7 +3402,7 @@ var NN_OPERATORS = {
3395
3402
  { name: "module", type: "nn/module", description: "The neural network module" },
3396
3403
  { name: "input", type: "tensor", description: "Input tensor" }
3397
3404
  ],
3398
- example: '["nn/forward", "@entity.architecture", "@entity.sensors"]'
3405
+ example: '["nn/forward", {"layers": [{"type": "dense", "units": 2}]}, [0.1, 0.2]]'
3399
3406
  },
3400
3407
  "nn/getWeights": {
3401
3408
  module: "nn",
@@ -3408,7 +3415,7 @@ var NN_OPERATORS = {
3408
3415
  params: [
3409
3416
  { name: "module", type: "nn/module", description: "The neural network module" }
3410
3417
  ],
3411
- example: '["nn/getWeights", "@entity.architecture"]'
3418
+ example: '["nn/getWeights", {"layers": [{"type": "dense", "units": 2}]}]'
3412
3419
  },
3413
3420
  "nn/setWeights": {
3414
3421
  module: "nn",
@@ -3422,7 +3429,7 @@ var NN_OPERATORS = {
3422
3429
  { name: "module", type: "nn/module", description: "The neural network module" },
3423
3430
  { name: "weights", type: "tensor", description: "New weights as flat tensor" }
3424
3431
  ],
3425
- example: '["nn/setWeights", "@entity.architecture", "@payload.newWeights"]'
3432
+ example: '["nn/setWeights", {"layers": [{"type": "dense", "units": 2}]}, [0.1, 0.2, 0.3]]'
3426
3433
  },
3427
3434
  "nn/paramCount": {
3428
3435
  module: "nn",
@@ -3435,7 +3442,7 @@ var NN_OPERATORS = {
3435
3442
  params: [
3436
3443
  { name: "module", type: "nn/module", description: "The neural network module" }
3437
3444
  ],
3438
- example: '["nn/paramCount", "@entity.architecture"] // => 3300'
3445
+ example: '["nn/paramCount", {"layers": [{"type": "dense", "units": 2}]}]'
3439
3446
  },
3440
3447
  "nn/clone": {
3441
3448
  module: "nn",
@@ -3448,7 +3455,7 @@ var NN_OPERATORS = {
3448
3455
  params: [
3449
3456
  { name: "module", type: "nn/module", description: "The neural network module to clone" }
3450
3457
  ],
3451
- example: '["nn/clone", "@entity.architecture"]'
3458
+ example: '["nn/clone", {"layers": [{"type": "dense", "units": 2}]}]'
3452
3459
  },
3453
3460
  // ============================================================================
3454
3461
  // ML lifecycle effect (bare alias invoked by std ML behaviors)
@@ -3465,7 +3472,7 @@ var NN_OPERATORS = {
3465
3472
  { name: "model", type: "nn/module", description: "The neural network module" },
3466
3473
  { name: "input", type: "tensor", description: "Input tensor" }
3467
3474
  ],
3468
- example: '["forward", "@entity.model", "@entity.input"]'
3475
+ example: '["forward", {"layers": [{"type": "dense", "units": 2}]}, [0.5]]'
3469
3476
  }
3470
3477
  };
3471
3478
 
@@ -3553,7 +3560,7 @@ var TENSOR_OPERATORS = {
3553
3560
  params: [
3554
3561
  { name: "tensor", type: "tensor", description: "The tensor" }
3555
3562
  ],
3556
- example: '["tensor/shape", "@entity.sensors"] // => [16]'
3563
+ example: '["tensor/shape", [[1, 2], [3, 4]]] // => [2, 2]'
3557
3564
  },
3558
3565
  "tensor/get": {
3559
3566
  module: "tensor",
@@ -3567,7 +3574,7 @@ var TENSOR_OPERATORS = {
3567
3574
  { name: "tensor", type: "tensor", description: "The tensor" },
3568
3575
  { name: "index", type: "number | number[]", description: "Index (single for 1D, array for multi-D)" }
3569
3576
  ],
3570
- example: '["tensor/get", "@entity.output", 3] // Get 4th element'
3577
+ example: '["tensor/get", [10, 20, 30, 40], 3] // Get 4th element'
3571
3578
  },
3572
3579
  "tensor/slice": {
3573
3580
  module: "tensor",
@@ -3582,7 +3589,7 @@ var TENSOR_OPERATORS = {
3582
3589
  { name: "start", type: "number", description: "Start index" },
3583
3590
  { name: "end", type: "number", description: "End index (exclusive)" }
3584
3591
  ],
3585
- example: '["tensor/slice", "@entity.output", 0, 3] // First 3 elements'
3592
+ example: '["tensor/slice", [10, 20, 30, 40], 0, 3] // First 3 elements'
3586
3593
  },
3587
3594
  "tensor/reshape": {
3588
3595
  module: "tensor",
@@ -3596,7 +3603,7 @@ var TENSOR_OPERATORS = {
3596
3603
  { name: "tensor", type: "tensor", description: "The tensor" },
3597
3604
  { name: "shape", type: "number[]", description: "New shape" }
3598
3605
  ],
3599
- example: '["tensor/reshape", "@entity.data", [4, 4]] // Reshape to 4x4'
3606
+ example: '["tensor/reshape", [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 4]] // Reshape to 4x4'
3600
3607
  },
3601
3608
  "tensor/flatten": {
3602
3609
  module: "tensor",
@@ -3609,7 +3616,7 @@ var TENSOR_OPERATORS = {
3609
3616
  params: [
3610
3617
  { name: "tensor", type: "tensor", description: "The tensor" }
3611
3618
  ],
3612
- example: '["tensor/flatten", "@entity.data"]'
3619
+ example: '["tensor/flatten", [[1, 2], [3, 4]]]'
3613
3620
  },
3614
3621
  // ============================================================================
3615
3622
  // Math Operations
@@ -3626,7 +3633,7 @@ var TENSOR_OPERATORS = {
3626
3633
  { name: "a", type: "tensor", description: "First tensor" },
3627
3634
  { name: "b", type: "tensor | number", description: "Second tensor or scalar" }
3628
3635
  ],
3629
- example: '["tensor/add", "@entity.a", "@entity.b"]'
3636
+ example: '["tensor/add", [1, 2], [3, 4]]'
3630
3637
  },
3631
3638
  "tensor/sub": {
3632
3639
  module: "tensor",
@@ -3640,7 +3647,7 @@ var TENSOR_OPERATORS = {
3640
3647
  { name: "a", type: "tensor", description: "First tensor" },
3641
3648
  { name: "b", type: "tensor | number", description: "Second tensor or scalar" }
3642
3649
  ],
3643
- example: '["tensor/sub", "@entity.a", "@entity.b"]'
3650
+ example: '["tensor/sub", [1, 2], [3, 4]]'
3644
3651
  },
3645
3652
  "tensor/mul": {
3646
3653
  module: "tensor",
@@ -3654,7 +3661,7 @@ var TENSOR_OPERATORS = {
3654
3661
  { name: "a", type: "tensor", description: "First tensor" },
3655
3662
  { name: "b", type: "tensor | number", description: "Second tensor or scalar" }
3656
3663
  ],
3657
- example: '["tensor/mul", "@entity.weights", 0.99] // Decay weights'
3664
+ example: '["tensor/mul", [0.5, 0.7], 0.99] // Decay weights'
3658
3665
  },
3659
3666
  "tensor/div": {
3660
3667
  module: "tensor",
@@ -3668,7 +3675,7 @@ var TENSOR_OPERATORS = {
3668
3675
  { name: "a", type: "tensor", description: "First tensor" },
3669
3676
  { name: "b", type: "tensor | number", description: "Second tensor or scalar" }
3670
3677
  ],
3671
- example: '["tensor/div", "@entity.gradient", "@entity.batchSize"]'
3678
+ example: '["tensor/div", [10, 20], 2]'
3672
3679
  },
3673
3680
  "tensor/matmul": {
3674
3681
  module: "tensor",
@@ -3682,7 +3689,7 @@ var TENSOR_OPERATORS = {
3682
3689
  { name: "a", type: "tensor", description: "First tensor (NxM)" },
3683
3690
  { name: "b", type: "tensor", description: "Second tensor (MxK)" }
3684
3691
  ],
3685
- example: '["tensor/matmul", "@entity.input", "@entity.weights"]'
3692
+ example: '["tensor/matmul", [[1, 2], [3, 4]], [[5, 6], [7, 8]]]'
3686
3693
  },
3687
3694
  "tensor/dot": {
3688
3695
  module: "tensor",
@@ -3696,7 +3703,7 @@ var TENSOR_OPERATORS = {
3696
3703
  { name: "a", type: "tensor", description: "First vector" },
3697
3704
  { name: "b", type: "tensor", description: "Second vector" }
3698
3705
  ],
3699
- example: '["tensor/dot", "@entity.a", "@entity.b"]'
3706
+ example: '["tensor/dot", [1, 2], [3, 4]]'
3700
3707
  },
3701
3708
  // ============================================================================
3702
3709
  // Reductions
@@ -3713,7 +3720,7 @@ var TENSOR_OPERATORS = {
3713
3720
  { name: "tensor", type: "tensor", description: "The tensor" },
3714
3721
  { name: "dim", type: "number", description: "Dimension to reduce", optional: true }
3715
3722
  ],
3716
- example: '["tensor/sum", "@entity.rewards"] // Total reward'
3723
+ example: '["tensor/sum", [1, 0, 1]] // Total reward'
3717
3724
  },
3718
3725
  "tensor/mean": {
3719
3726
  module: "tensor",
@@ -3727,7 +3734,7 @@ var TENSOR_OPERATORS = {
3727
3734
  { name: "tensor", type: "tensor", description: "The tensor" },
3728
3735
  { name: "dim", type: "number", description: "Dimension to reduce", optional: true }
3729
3736
  ],
3730
- example: '["tensor/mean", "@entity.losses"]'
3737
+ example: '["tensor/mean", [0.2, 0.4, 0.6]]'
3731
3738
  },
3732
3739
  "tensor/max": {
3733
3740
  module: "tensor",
@@ -3741,7 +3748,7 @@ var TENSOR_OPERATORS = {
3741
3748
  { name: "tensor", type: "tensor", description: "The tensor" },
3742
3749
  { name: "dim", type: "number", description: "Dimension to reduce", optional: true }
3743
3750
  ],
3744
- example: '["tensor/max", "@entity.qValues"]'
3751
+ example: '["tensor/max", [0.1, 0.9, 0.3]]'
3745
3752
  },
3746
3753
  "tensor/min": {
3747
3754
  module: "tensor",
@@ -3755,7 +3762,7 @@ var TENSOR_OPERATORS = {
3755
3762
  { name: "tensor", type: "tensor", description: "The tensor" },
3756
3763
  { name: "dim", type: "number", description: "Dimension to reduce", optional: true }
3757
3764
  ],
3758
- example: '["tensor/min", "@entity.distances"]'
3765
+ example: '["tensor/min", [3, 1, 2]]'
3759
3766
  },
3760
3767
  "tensor/argmax": {
3761
3768
  module: "tensor",
@@ -3769,7 +3776,7 @@ var TENSOR_OPERATORS = {
3769
3776
  { name: "tensor", type: "tensor", description: "The tensor" },
3770
3777
  { name: "dim", type: "number", description: "Dimension to reduce", optional: true }
3771
3778
  ],
3772
- example: '["tensor/argmax", "@entity.qValues"] // Best action index'
3779
+ example: '["tensor/argmax", [0.1, 0.9, 0.3]] // Best action index'
3773
3780
  },
3774
3781
  "tensor/norm": {
3775
3782
  module: "tensor",
@@ -3783,7 +3790,7 @@ var TENSOR_OPERATORS = {
3783
3790
  { name: "tensor", type: "tensor", description: "The tensor" },
3784
3791
  { name: "p", type: "number", description: "Norm order (default 2)", optional: true, defaultValue: 2 }
3785
3792
  ],
3786
- example: '["tensor/norm", "@entity.gradient"]'
3793
+ example: '["tensor/norm", [3, 4]]'
3787
3794
  },
3788
3795
  // ============================================================================
3789
3796
  // Range Validation (for contracts)
@@ -3800,7 +3807,7 @@ var TENSOR_OPERATORS = {
3800
3807
  { name: "tensor", type: "tensor", description: "The tensor" },
3801
3808
  { name: "range", type: "[number, number]", description: "Range as [min, max]" }
3802
3809
  ],
3803
- example: '["tensor/allInRange", "@payload.input", [-1.0, 1.0]]'
3810
+ example: '["tensor/allInRange", [0.5, -0.2], [-1.0, 1.0]]'
3804
3811
  },
3805
3812
  "tensor/outOfRangeIndices": {
3806
3813
  module: "tensor",
@@ -3814,7 +3821,7 @@ var TENSOR_OPERATORS = {
3814
3821
  { name: "tensor", type: "tensor", description: "The tensor" },
3815
3822
  { name: "range", type: "[number, number]", description: "Range as [min, max]" }
3816
3823
  ],
3817
- example: '["tensor/outOfRangeIndices", "@payload.input", [-1.0, 1.0]]'
3824
+ example: '["tensor/outOfRangeIndices", [0.5, 1.5], [-1.0, 1.0]]'
3818
3825
  },
3819
3826
  "tensor/clamp": {
3820
3827
  module: "tensor",
@@ -3829,7 +3836,7 @@ var TENSOR_OPERATORS = {
3829
3836
  { name: "min", type: "number", description: "Minimum value" },
3830
3837
  { name: "max", type: "number", description: "Maximum value" }
3831
3838
  ],
3832
- example: '["tensor/clamp", "@entity.output", -10.0, 10.0]'
3839
+ example: '["tensor/clamp", [5, -15, 3], -10.0, 10.0]'
3833
3840
  },
3834
3841
  "tensor/clampPerDim": {
3835
3842
  module: "tensor",
@@ -3843,7 +3850,7 @@ var TENSOR_OPERATORS = {
3843
3850
  { name: "tensor", type: "tensor", description: "The tensor" },
3844
3851
  { name: "ranges", type: "object", description: 'Per-dimension ranges { "0": {min, max}, ... }' }
3845
3852
  ],
3846
- example: '["tensor/clampPerDim", "@entity.rawOutput", "@entity.outputContract.ranges"]'
3853
+ example: '["tensor/clampPerDim", [5, -15], {"0": {"min": 0, "max": 10}, "1": {"min": -10, "max": 10}}]'
3847
3854
  },
3848
3855
  "tensor/outOfRangeDims": {
3849
3856
  module: "tensor",
@@ -3857,7 +3864,7 @@ var TENSOR_OPERATORS = {
3857
3864
  { name: "tensor", type: "tensor", description: "The tensor" },
3858
3865
  { name: "ranges", type: "object", description: 'Per-dimension ranges { "0": {min, max}, ... }' }
3859
3866
  ],
3860
- example: '["tensor/outOfRangeDims", "@entity.rawOutput", "@entity.outputContract.ranges"]'
3867
+ example: '["tensor/outOfRangeDims", [5, -15], {"0": {"min": 0, "max": 10}, "1": {"min": -10, "max": 10}}]'
3861
3868
  },
3862
3869
  // ============================================================================
3863
3870
  // Conversion
@@ -3873,7 +3880,7 @@ var TENSOR_OPERATORS = {
3873
3880
  params: [
3874
3881
  { name: "tensor", type: "tensor", description: "The tensor" }
3875
3882
  ],
3876
- example: '["tensor/toArray", "@entity.output"]'
3883
+ example: '["tensor/toArray", [[1, 2], [3, 4]]]'
3877
3884
  },
3878
3885
  "tensor/toList": {
3879
3886
  module: "tensor",
@@ -3886,7 +3893,7 @@ var TENSOR_OPERATORS = {
3886
3893
  params: [
3887
3894
  { name: "tensor", type: "tensor", description: "The tensor (must be 1D)" }
3888
3895
  ],
3889
- example: '["tensor/toList", "@entity.output"]'
3896
+ example: '["tensor/toList", [1, 2, 3]]'
3890
3897
  },
3891
3898
  // ============================================================================
3892
3899
  // Concatenation / stacking / shape manipulation
@@ -3903,7 +3910,7 @@ var TENSOR_OPERATORS = {
3903
3910
  { name: "a", type: "tensor", description: "First tensor" },
3904
3911
  { name: "b", type: "tensor", description: "Second tensor" }
3905
3912
  ],
3906
- example: '["tensor/cat", "@entity.a", "@entity.b"]'
3913
+ example: '["tensor/cat", [1, 2], [3, 4]]'
3907
3914
  },
3908
3915
  "tensor/stack": {
3909
3916
  module: "tensor",
@@ -3917,7 +3924,7 @@ var TENSOR_OPERATORS = {
3917
3924
  { name: "a", type: "tensor", description: "First tensor" },
3918
3925
  { name: "b", type: "tensor", description: "Second tensor" }
3919
3926
  ],
3920
- example: '["tensor/stack", "@entity.a", "@entity.b"]'
3927
+ example: '["tensor/stack", [1, 2], [3, 4]]'
3921
3928
  },
3922
3929
  "tensor/transpose": {
3923
3930
  module: "tensor",
@@ -3932,7 +3939,7 @@ var TENSOR_OPERATORS = {
3932
3939
  { name: "dim0", type: "number", description: "First dimension to swap (optional)" },
3933
3940
  { name: "dim1", type: "number", description: "Second dimension to swap (optional)" }
3934
3941
  ],
3935
- example: '["tensor/transpose", "@entity.matrix", 0, 1]'
3942
+ example: '["tensor/transpose", [[1, 2], [3, 4]], 0, 1]'
3936
3943
  },
3937
3944
  "tensor/unsqueeze": {
3938
3945
  module: "tensor",
@@ -3946,7 +3953,7 @@ var TENSOR_OPERATORS = {
3946
3953
  { name: "tensor", type: "tensor", description: "The tensor" },
3947
3954
  { name: "dim", type: "number", description: "Position to insert the new dimension" }
3948
3955
  ],
3949
- example: '["tensor/unsqueeze", "@entity.vector", 0]'
3956
+ example: '["tensor/unsqueeze", [1, 2, 3], 0]'
3950
3957
  },
3951
3958
  "tensor/squeeze": {
3952
3959
  module: "tensor",
@@ -3959,7 +3966,7 @@ var TENSOR_OPERATORS = {
3959
3966
  params: [
3960
3967
  { name: "tensor", type: "tensor", description: "The tensor" }
3961
3968
  ],
3962
- example: '["tensor/squeeze", "@entity.output"]'
3969
+ example: '["tensor/squeeze", [[1, 2, 3]]]'
3963
3970
  }
3964
3971
  };
3965
3972
 
@@ -3981,7 +3988,7 @@ var TRAIN_OPERATORS = {
3981
3988
  { name: "data", type: "array", description: "Training data (array of {input, target} or experiences)" },
3982
3989
  { name: "config", type: "train/config", description: "Training configuration with constraints" }
3983
3990
  ],
3984
- example: '["train/loop", "@entity.architecture", "@entity.buffer", "@entity.trainingConfig"]'
3991
+ example: '["train/loop", {"layers": [{"type": "dense", "units": 2}]}, [{"state": [0], "action": 1, "reward": 1}], {"epochs": 10}]'
3985
3992
  },
3986
3993
  "train/step": {
3987
3994
  module: "train",
@@ -3997,7 +4004,7 @@ var TRAIN_OPERATORS = {
3997
4004
  { name: "target", type: "tensor", description: "Target tensor" },
3998
4005
  { name: "config", type: "train/config", description: "Training configuration" }
3999
4006
  ],
4000
- example: '["train/step", "@entity.architecture", "@batch.input", "@batch.target", "@entity.config"]'
4007
+ example: '["train/step", {"layers": [{"type": "dense", "units": 2}]}, [0.1, 0.2], [1], {"lr": 0.01}]'
4001
4008
  },
4002
4009
  // ============================================================================
4003
4010
  // Validation
@@ -4014,7 +4021,7 @@ var TRAIN_OPERATORS = {
4014
4021
  { name: "module", type: "nn/module", description: "The neural network" },
4015
4022
  { name: "testCases", type: "array", description: "Array of {input, expected, tolerance?}" }
4016
4023
  ],
4017
- example: '["train/validate", "@entity.architecture", "@entity.validationSet"]'
4024
+ example: '["train/validate", {"layers": [{"type": "dense", "units": 2}]}, [{"input": [0], "expected": [1]}]]'
4018
4025
  },
4019
4026
  "train/checkRegression": {
4020
4027
  module: "train",
@@ -4029,7 +4036,7 @@ var TRAIN_OPERATORS = {
4029
4036
  { name: "oldModule", type: "nn/module", description: "Previous network" },
4030
4037
  { name: "invariants", type: "array", description: "Test cases that must not regress" }
4031
4038
  ],
4032
- example: '["train/checkRegression", "@payload.newWeights", "@entity.architecture", "@entity.requiredInvariants"]'
4039
+ example: '["train/checkRegression", [0.1, 0.2], {"layers": [{"type": "dense", "units": 2}]}, [{"input": [0], "expected": [1]}]]'
4033
4040
  },
4034
4041
  // ============================================================================
4035
4042
  // Constraint Checking
@@ -4046,7 +4053,7 @@ var TRAIN_OPERATORS = {
4046
4053
  { name: "module", type: "nn/module", description: "The neural network" },
4047
4054
  { name: "constraints", type: "train/constraints", description: "Constraint specification" }
4048
4055
  ],
4049
- example: '["train/checkConstraints", "@payload.newWeights", "@entity.constraints"]'
4056
+ example: '["train/checkConstraints", [0.1, 0.2], {"maxMagnitude": 10}]'
4050
4057
  },
4051
4058
  "train/checkWeightMagnitude": {
4052
4059
  module: "train",
@@ -4060,7 +4067,7 @@ var TRAIN_OPERATORS = {
4060
4067
  { name: "module", type: "nn/module", description: "The neural network" },
4061
4068
  { name: "maxMagnitude", type: "number", description: "Maximum allowed weight magnitude" }
4062
4069
  ],
4063
- example: '["train/checkWeightMagnitude", "@entity.architecture", 10.0]'
4070
+ example: '["train/checkWeightMagnitude", {"layers": [{"type": "dense", "units": 2}]}, 10.0]'
4064
4071
  },
4065
4072
  "train/checkForbiddenOutputs": {
4066
4073
  module: "train",
@@ -4075,7 +4082,7 @@ var TRAIN_OPERATORS = {
4075
4082
  { name: "testInputs", type: "array", description: "Inputs to test" },
4076
4083
  { name: "forbiddenRegions", type: "array", description: "Forbidden output regions" }
4077
4084
  ],
4078
- example: '["train/checkForbiddenOutputs", "@entity.architecture", "@entity.testInputs", "@entity.forbiddenOutputRegions"]'
4085
+ example: '["train/checkForbiddenOutputs", {"layers": [{"type": "dense", "units": 2}]}, [[0], [1]], {"0": {"min": 100, "max": 200}}]'
4079
4086
  },
4080
4087
  // ============================================================================
4081
4088
  // Gradient Operations
@@ -4092,7 +4099,7 @@ var TRAIN_OPERATORS = {
4092
4099
  { name: "module", type: "nn/module", description: "The neural network" },
4093
4100
  { name: "maxNorm", type: "number", description: "Maximum gradient norm" }
4094
4101
  ],
4095
- example: '["train/clipGradients", "@entity.architecture", 1.0]'
4102
+ example: '["train/clipGradients", {"layers": [{"type": "dense", "units": 2}]}, 1.0]'
4096
4103
  },
4097
4104
  "train/getGradientNorm": {
4098
4105
  module: "train",
@@ -4105,7 +4112,7 @@ var TRAIN_OPERATORS = {
4105
4112
  params: [
4106
4113
  { name: "module", type: "nn/module", description: "The neural network" }
4107
4114
  ],
4108
- example: '["train/getGradientNorm", "@entity.architecture"]'
4115
+ example: '["train/getGradientNorm", {"layers": [{"type": "dense", "units": 2}]}]'
4109
4116
  },
4110
4117
  // ============================================================================
4111
4118
  // Weight Operations
@@ -4122,7 +4129,7 @@ var TRAIN_OPERATORS = {
4122
4129
  { name: "module", type: "nn/module", description: "The neural network" },
4123
4130
  { name: "maxMagnitude", type: "number", description: "Maximum weight magnitude" }
4124
4131
  ],
4125
- example: '["train/clipWeights", "@entity.architecture", 10.0]'
4132
+ example: '["train/clipWeights", {"layers": [{"type": "dense", "units": 2}]}, 10.0]'
4126
4133
  },
4127
4134
  "train/getMaxWeightMagnitude": {
4128
4135
  module: "train",
@@ -4135,7 +4142,7 @@ var TRAIN_OPERATORS = {
4135
4142
  params: [
4136
4143
  { name: "module", type: "nn/module", description: "The neural network" }
4137
4144
  ],
4138
- example: '["train/getMaxWeightMagnitude", "@entity.architecture"]'
4145
+ example: '["train/getMaxWeightMagnitude", {"layers": [{"type": "dense", "units": 2}]}]'
4139
4146
  },
4140
4147
  // ============================================================================
4141
4148
  // Loss Functions
@@ -4152,7 +4159,7 @@ var TRAIN_OPERATORS = {
4152
4159
  { name: "predicted", type: "tensor", description: "Predicted values" },
4153
4160
  { name: "target", type: "tensor", description: "Target values" }
4154
4161
  ],
4155
- example: '["train/mse", "@entity.output", "@batch.target"]'
4162
+ example: '["train/mse", [0.5, 0.7], [1, 0]]'
4156
4163
  },
4157
4164
  "train/crossEntropy": {
4158
4165
  module: "train",
@@ -4166,7 +4173,7 @@ var TRAIN_OPERATORS = {
4166
4173
  { name: "logits", type: "tensor", description: "Raw model outputs (logits)" },
4167
4174
  { name: "labels", type: "tensor", description: "Target class labels" }
4168
4175
  ],
4169
- example: '["train/crossEntropy", "@entity.logits", "@batch.labels"]'
4176
+ example: '["train/crossEntropy", [2.0, 0.5], [1, 0]]'
4170
4177
  },
4171
4178
  "train/huber": {
4172
4179
  module: "train",
@@ -4181,7 +4188,7 @@ var TRAIN_OPERATORS = {
4181
4188
  { name: "target", type: "tensor", description: "Target values" },
4182
4189
  { name: "delta", type: "number", description: "Threshold for quadratic vs linear", optional: true, defaultValue: 1 }
4183
4190
  ],
4184
- example: '["train/huber", "@entity.qValues", "@batch.targets", 1.0]'
4191
+ example: '["train/huber", [0.5, 1.2], [1, 0], 1.0]'
4185
4192
  },
4186
4193
  // ============================================================================
4187
4194
  // Optimizers
@@ -4199,7 +4206,7 @@ var TRAIN_OPERATORS = {
4199
4206
  { name: "lr", type: "number", description: "Learning rate" },
4200
4207
  { name: "momentum", type: "number", description: "Momentum factor", optional: true, defaultValue: 0 }
4201
4208
  ],
4202
- example: '["train/sgd", "@entity.architecture", 0.01, 0.9]'
4209
+ example: '["train/sgd", {"layers": [{"type": "dense", "units": 2}]}, 0.01, 0.9]'
4203
4210
  },
4204
4211
  "train/adam": {
4205
4212
  module: "train",
@@ -4215,7 +4222,7 @@ var TRAIN_OPERATORS = {
4215
4222
  { name: "beta1", type: "number", description: "First moment decay", optional: true, defaultValue: 0.9 },
4216
4223
  { name: "beta2", type: "number", description: "Second moment decay", optional: true, defaultValue: 0.999 }
4217
4224
  ],
4218
- example: '["train/adam", "@entity.architecture", 0.001]'
4225
+ example: '["train/adam", {"layers": [{"type": "dense", "units": 2}]}, 0.001]'
4219
4226
  },
4220
4227
  // ============================================================================
4221
4228
  // Experience Replay (for RL)
@@ -4232,7 +4239,7 @@ var TRAIN_OPERATORS = {
4232
4239
  { name: "buffer", type: "array", description: "Experience buffer" },
4233
4240
  { name: "batchSize", type: "number", description: "Number of samples" }
4234
4241
  ],
4235
- example: '["train/sampleBatch", "@entity.experienceBuffer", 32]'
4242
+ example: '["train/sampleBatch", [{"state": [0], "reward": 1}, {"state": [1], "reward": 0}], 2]'
4236
4243
  },
4237
4244
  "train/computeReturns": {
4238
4245
  module: "train",
@@ -4246,7 +4253,7 @@ var TRAIN_OPERATORS = {
4246
4253
  { name: "rewards", type: "array", description: "Array of rewards" },
4247
4254
  { name: "gamma", type: "number", description: "Discount factor" }
4248
4255
  ],
4249
- example: '["train/computeReturns", "@episode.rewards", 0.99]'
4256
+ example: '["train/computeReturns", [1, 0, 1], 0.99]'
4250
4257
  },
4251
4258
  "train/computeAdvantages": {
4252
4259
  module: "train",
@@ -4261,7 +4268,7 @@ var TRAIN_OPERATORS = {
4261
4268
  { name: "values", type: "tensor", description: "Value estimates" },
4262
4269
  { name: "config", type: "object", description: "Config with gamma, lambda" }
4263
4270
  ],
4264
- example: '["train/computeAdvantages", "@episode.rewards", "@episode.values", { "gamma": 0.99, "lambda": 0.95 }]'
4271
+ example: '["train/computeAdvantages", [1, 0, 1], [0.5, 0.4, 0.3], { "gamma": 0.99, "lambda": 0.95 }]'
4265
4272
  },
4266
4273
  // ============================================================================
4267
4274
  // ML lifecycle effects (bare aliases invoked by std ML behaviors)
@@ -4279,7 +4286,7 @@ var TRAIN_OPERATORS = {
4279
4286
  { name: "data", type: "array", description: "Training data (optional)" },
4280
4287
  { name: "config", type: "object", description: "Training config (optional)" }
4281
4288
  ],
4282
- example: '["train", "@entity.model", "@entity.data", { "epochs": 100 }]'
4289
+ example: '["train", {"layers": [{"type": "dense", "units": 2}]}, [[0, 1], [1, 0]], { "epochs": 100 }]'
4283
4290
  },
4284
4291
  "evaluate": {
4285
4292
  module: "train",
@@ -4293,7 +4300,7 @@ var TRAIN_OPERATORS = {
4293
4300
  { name: "model", type: "nn/module", description: "The neural network module" },
4294
4301
  { name: "testCases", type: "array", description: "Test cases (optional)" }
4295
4302
  ],
4296
- example: '["evaluate", "@entity.model", "@entity.testCases"]'
4303
+ example: '["evaluate", {"layers": [{"type": "dense", "units": 2}]}, [{"input": [0], "expected": [1]}]]'
4297
4304
  },
4298
4305
  "checkpoint/save": {
4299
4306
  module: "train",
@@ -4307,7 +4314,7 @@ var TRAIN_OPERATORS = {
4307
4314
  { name: "model", type: "nn/module", description: "The neural network module" },
4308
4315
  { name: "key", type: "string", description: "Checkpoint identifier" }
4309
4316
  ],
4310
- example: '["checkpoint/save", "@entity.model", "@entity.checkpointKey"]'
4317
+ example: '["checkpoint/save", {"layers": [{"type": "dense", "units": 2}]}, "ckpt-1"]'
4311
4318
  },
4312
4319
  "checkpoint/load": {
4313
4320
  module: "train",
@@ -4320,7 +4327,7 @@ var TRAIN_OPERATORS = {
4320
4327
  params: [
4321
4328
  { name: "key", type: "string", description: "Checkpoint identifier" }
4322
4329
  ],
4323
- example: '["checkpoint/load", "@entity.checkpointKey"]'
4330
+ example: '["checkpoint/load", "ckpt-1"]'
4324
4331
  }
4325
4332
  };
4326
4333
 
@@ -4340,7 +4347,7 @@ var GRAPH_OPERATORS = {
4340
4347
  params: [
4341
4348
  { name: "config", type: "object", description: "Graph construction config (nodes, edges, node-features, edge-features, directed)" }
4342
4349
  ],
4343
- example: '["graph/from-entities", { "nodes": "User", "edges": "Follows" }]'
4350
+ example: '["graph/from-entities", [{ "age": 30, "score": 0.5 }, { "age": 25, "score": 0.7 }]]'
4344
4351
  },
4345
4352
  "graph/from-adjacency": {
4346
4353
  module: "graph",
@@ -4354,7 +4361,7 @@ var GRAPH_OPERATORS = {
4354
4361
  { name: "adjacency", type: "tensor", description: "Adjacency matrix" },
4355
4362
  { name: "features", type: "tensor", description: "Node feature matrix" }
4356
4363
  ],
4357
- example: '["graph/from-adjacency", "@entity.adj", "@entity.features"]'
4364
+ example: '["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]'
4358
4365
  },
4359
4366
  "graph/from-edge-list": {
4360
4367
  module: "graph",
@@ -4368,7 +4375,7 @@ var GRAPH_OPERATORS = {
4368
4375
  { name: "edges", type: "tensor", description: "Edge index tensor [2, num_edges]" },
4369
4376
  { name: "features", type: "tensor", description: "Node feature matrix" }
4370
4377
  ],
4371
- example: '["graph/from-edge-list", "@entity.edges", "@entity.features"]'
4378
+ example: '["graph/from-edge-list", [[0, 1]], [[1.0], [2.0]]]'
4372
4379
  },
4373
4380
  // ============================================================================
4374
4381
  // Transforms
@@ -4384,7 +4391,7 @@ var GRAPH_OPERATORS = {
4384
4391
  params: [
4385
4392
  { name: "graph", type: "graph", description: "Input graph" }
4386
4393
  ],
4387
- example: '["graph/add-self-loops", "@entity.graph"]'
4394
+ example: '["graph/add-self-loops", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4388
4395
  },
4389
4396
  "graph/to-undirected": {
4390
4397
  module: "graph",
@@ -4397,7 +4404,7 @@ var GRAPH_OPERATORS = {
4397
4404
  params: [
4398
4405
  { name: "graph", type: "graph", description: "Input graph" }
4399
4406
  ],
4400
- example: '["graph/to-undirected", "@entity.graph"]'
4407
+ example: '["graph/to-undirected", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4401
4408
  },
4402
4409
  "graph/subgraph": {
4403
4410
  module: "graph",
@@ -4411,7 +4418,7 @@ var GRAPH_OPERATORS = {
4411
4418
  { name: "graph", type: "graph", description: "Input graph" },
4412
4419
  { name: "mask", type: "tensor", description: "Boolean node mask" }
4413
4420
  ],
4414
- example: '["graph/subgraph", "@entity.graph", "@entity.mask"]'
4421
+ example: '["graph/subgraph", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]], [true, false]]'
4415
4422
  },
4416
4423
  "graph/k-hop": {
4417
4424
  module: "graph",
@@ -4426,7 +4433,7 @@ var GRAPH_OPERATORS = {
4426
4433
  { name: "node", type: "number", description: "Center node index" },
4427
4434
  { name: "k", type: "number", description: "Number of hops" }
4428
4435
  ],
4429
- example: '["graph/k-hop", "@entity.graph", 0, 2]'
4436
+ example: '["graph/k-hop", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]], 0, 2]'
4430
4437
  },
4431
4438
  // ============================================================================
4432
4439
  // Accessors
@@ -4442,7 +4449,7 @@ var GRAPH_OPERATORS = {
4442
4449
  params: [
4443
4450
  { name: "graph", type: "graph", description: "Input graph" }
4444
4451
  ],
4445
- example: '["graph/node-features", "@entity.graph"]'
4452
+ example: '["graph/node-features", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4446
4453
  },
4447
4454
  "graph/edge-index": {
4448
4455
  module: "graph",
@@ -4455,7 +4462,7 @@ var GRAPH_OPERATORS = {
4455
4462
  params: [
4456
4463
  { name: "graph", type: "graph", description: "Input graph" }
4457
4464
  ],
4458
- example: '["graph/edge-index", "@entity.graph"]'
4465
+ example: '["graph/edge-index", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4459
4466
  },
4460
4467
  "graph/edge-features": {
4461
4468
  module: "graph",
@@ -4468,7 +4475,7 @@ var GRAPH_OPERATORS = {
4468
4475
  params: [
4469
4476
  { name: "graph", type: "graph", description: "Input graph" }
4470
4477
  ],
4471
- example: '["graph/edge-features", "@entity.graph"]'
4478
+ example: '["graph/edge-features", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4472
4479
  },
4473
4480
  "graph/num-nodes": {
4474
4481
  module: "graph",
@@ -4481,7 +4488,7 @@ var GRAPH_OPERATORS = {
4481
4488
  params: [
4482
4489
  { name: "graph", type: "graph", description: "Input graph" }
4483
4490
  ],
4484
- example: '["graph/num-nodes", "@entity.graph"]'
4491
+ example: '["graph/num-nodes", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4485
4492
  },
4486
4493
  "graph/num-edges": {
4487
4494
  module: "graph",
@@ -4494,7 +4501,7 @@ var GRAPH_OPERATORS = {
4494
4501
  params: [
4495
4502
  { name: "graph", type: "graph", description: "Input graph" }
4496
4503
  ],
4497
- example: '["graph/num-edges", "@entity.graph"]'
4504
+ example: '["graph/num-edges", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4498
4505
  },
4499
4506
  "graph/degree": {
4500
4507
  module: "graph",
@@ -4507,7 +4514,7 @@ var GRAPH_OPERATORS = {
4507
4514
  params: [
4508
4515
  { name: "graph", type: "graph", description: "Input graph" }
4509
4516
  ],
4510
- example: '["graph/degree", "@entity.graph"]'
4517
+ example: '["graph/degree", ["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]'
4511
4518
  },
4512
4519
  // ============================================================================
4513
4520
  // Batching
@@ -4523,7 +4530,7 @@ var GRAPH_OPERATORS = {
4523
4530
  params: [
4524
4531
  { name: "graphs", type: "array", description: "List of graphs" }
4525
4532
  ],
4526
- example: '["graph/batch", "@entity.graphs"]'
4533
+ example: '["graph/batch", [["graph/from-adjacency", [[0, 1], [1, 0]], [[1.0], [2.0]]]]]'
4527
4534
  }
4528
4535
  };
4529
4536
 
@@ -4544,7 +4551,7 @@ var CONTRACT_OPERATORS = {
4544
4551
  { name: "tensor", type: "tensor", description: "Input tensor" },
4545
4552
  { name: "contract", type: "object", description: "Input contract spec" }
4546
4553
  ],
4547
- example: '["contract/validate-input", "@payload.input", "@entity.inputContract"]'
4554
+ example: '["contract/validate-input", [0.5, 0.7], {"ranges": {"0": {"min": 0, "max": 1}, "1": {"min": 0, "max": 1}}}]'
4548
4555
  },
4549
4556
  "contract/validate-output": {
4550
4557
  module: "contract",
@@ -4558,7 +4565,7 @@ var CONTRACT_OPERATORS = {
4558
4565
  { name: "tensor", type: "tensor", description: "Output tensor" },
4559
4566
  { name: "contract", type: "object", description: "Output contract spec" }
4560
4567
  ],
4561
- example: '["contract/validate-output", "@entity.output", "@entity.outputContract"]'
4568
+ example: '["contract/validate-output", [0.5, 0.7], {"ranges": {"0": {"min": 0, "max": 1}, "1": {"min": 0, "max": 1}}}]'
4562
4569
  },
4563
4570
  "contract/clamp-output": {
4564
4571
  module: "contract",
@@ -4572,7 +4579,7 @@ var CONTRACT_OPERATORS = {
4572
4579
  { name: "tensor", type: "tensor", description: "Output tensor" },
4573
4580
  { name: "contract", type: "object", description: "Output contract spec" }
4574
4581
  ],
4575
- example: '["contract/clamp-output", "@entity.output", "@entity.outputContract"]'
4582
+ example: '["contract/clamp-output", [0.5, 1.7], {"ranges": {"0": {"min": 0, "max": 1}, "1": {"min": 0, "max": 1}}}]'
4576
4583
  },
4577
4584
  "contract/violations": {
4578
4585
  module: "contract",
@@ -4586,7 +4593,7 @@ var CONTRACT_OPERATORS = {
4586
4593
  { name: "tensor", type: "tensor", description: "Tensor to check" },
4587
4594
  { name: "contract", type: "object", description: "Contract spec" }
4588
4595
  ],
4589
- example: '["contract/violations", "@entity.output", "@entity.outputContract"]'
4596
+ example: '["contract/violations", [0.5, 1.7], {"ranges": {"0": {"min": 0, "max": 1}, "1": {"min": 0, "max": 1}}}]'
4590
4597
  },
4591
4598
  // ============================================================================
4592
4599
  // Conversion
@@ -4603,7 +4610,7 @@ var CONTRACT_OPERATORS = {
4603
4610
  { name: "entity", type: "object", description: "Entity data" },
4604
4611
  { name: "contract", type: "object", description: "Input contract mapping fields to dims" }
4605
4612
  ],
4606
- example: '["contract/entity-to-tensor", "@entity", "@entity.inputContract"]'
4613
+ example: '["contract/entity-to-tensor", {"price": 10, "qty": 2}, {"fields": ["price", "qty"]}]'
4607
4614
  },
4608
4615
  "contract/tensor-to-payload": {
4609
4616
  module: "contract",
@@ -4617,7 +4624,7 @@ var CONTRACT_OPERATORS = {
4617
4624
  { name: "tensor", type: "tensor", description: "Output tensor" },
4618
4625
  { name: "contract", type: "object", description: "Output contract mapping dims to fields" }
4619
4626
  ],
4620
- example: '["contract/tensor-to-payload", "@entity.output", "@entity.outputContract"]'
4627
+ example: '["contract/tensor-to-payload", [0.5, 0.7], {"fields": ["price", "qty"]}]'
4621
4628
  }
4622
4629
  };
4623
4630
 
@@ -4638,7 +4645,7 @@ var DATA_OPERATORS = {
4638
4645
  { name: "entities", type: "array", description: "Entity collection" },
4639
4646
  { name: "contracts", type: "object", description: "Input/output contract pair" }
4640
4647
  ],
4641
- example: '["data/dataset", "@entity.trainingData", "@entity.contracts"]'
4648
+ example: '["data/dataset", [{"x": 1, "y": 2}], {"input": {"fields": ["x"]}, "output": {"fields": ["y"]}}]'
4642
4649
  },
4643
4650
  "data/dataloader": {
4644
4651
  module: "data",
@@ -4652,7 +4659,7 @@ var DATA_OPERATORS = {
4652
4659
  { name: "dataset", type: "object", description: "Dataset" },
4653
4660
  { name: "config", type: "object", description: "Config with batch_size, shuffle, etc." }
4654
4661
  ],
4655
- example: '["data/dataloader", "@entity.dataset", { "batch-size": 32, "shuffle": true }]'
4662
+ example: '["data/dataloader", ["data/dataset", [[1, 2], [3, 4], [5, 6]], {}], { "batch-size": 2, "shuffle": true }]'
4656
4663
  },
4657
4664
  "data/split": {
4658
4665
  module: "data",
@@ -4666,7 +4673,7 @@ var DATA_OPERATORS = {
4666
4673
  { name: "dataset", type: "object", description: "Dataset" },
4667
4674
  { name: "config", type: "object", description: "Split config, e.g. { trainRatio: 0.8 }" }
4668
4675
  ],
4669
- example: '["data/split", "@entity.dataset", { "trainRatio": 0.8 }]'
4676
+ example: '["data/split", ["data/dataset", [1, 2, 3, 4, 5], {}], { "trainRatio": 0.8 }]'
4670
4677
  },
4671
4678
  // ============================================================================
4672
4679
  // Preprocessing
@@ -4683,7 +4690,7 @@ var DATA_OPERATORS = {
4683
4690
  { name: "tensor", type: "tensor", description: "Feature tensor" },
4684
4691
  { name: "config", type: "object", description: "Normalization config (method, per_dim, etc.)" }
4685
4692
  ],
4686
- example: '["data/normalize", "@entity.features", { "method": "standard" }]'
4693
+ example: '["data/normalize", [[1, 2], [3, 4]], { "method": "standard" }]'
4687
4694
  },
4688
4695
  "data/augment": {
4689
4696
  module: "data",
@@ -4697,7 +4704,7 @@ var DATA_OPERATORS = {
4697
4704
  { name: "dataset", type: "object", description: "Dataset" },
4698
4705
  { name: "config", type: "object", description: "Augmentation config" }
4699
4706
  ],
4700
- example: '["data/augment", "@entity.dataset", { "flip": true, "rotate": 15 }]'
4707
+ example: '["data/augment", [[1.0, 2.0], [3.0, 4.0]], { "flip": true, "rotate": 15 }]'
4701
4708
  },
4702
4709
  // ============================================================================
4703
4710
  // Tokenization & Padding
@@ -4714,7 +4721,7 @@ var DATA_OPERATORS = {
4714
4721
  { name: "text", type: "string", description: "Text to tokenize" },
4715
4722
  { name: "config", type: "object", description: "Tokenizer config (method, vocab_size, max_length)" }
4716
4723
  ],
4717
- example: '["data/tokenize", "@entity.text", { "method": "bpe", "max-length": 512 }]'
4724
+ example: '["data/tokenize", "hello world", { "method": "bpe", "max-length": 512 }]'
4718
4725
  },
4719
4726
  "data/pad": {
4720
4727
  module: "data",
@@ -4728,7 +4735,7 @@ var DATA_OPERATORS = {
4728
4735
  { name: "sequences", type: "array", description: "List of token sequences" },
4729
4736
  { name: "config", type: "object", description: "Padding config (max_length, pad_value)" }
4730
4737
  ],
4731
- example: '["data/pad", "@entity.sequences", { "max-length": 512, "pad-value": 0 }]'
4738
+ example: '["data/pad", [[1, 2, 3], [4, 5]], { "max-length": 4, "pad-value": 0 }]'
4732
4739
  }
4733
4740
  };
4734
4741
 
@@ -4838,7 +4845,7 @@ var PROB_OPERATORS = {
4838
4845
  hasSideEffects: true,
4839
4846
  returnType: "void",
4840
4847
  params: [{ name: "predicate", type: "boolean", description: "Condition that must hold" }],
4841
- example: '["prob/condition", [">", "@entity.x", 0]]'
4848
+ example: '["prob/condition", [">", 5, 0]]'
4842
4849
  },
4843
4850
  "prob/sample": {
4844
4851
  module: "prob",
@@ -4868,7 +4875,7 @@ var PROB_OPERATORS = {
4868
4875
  { name: "query", type: "SExpr", description: "Query expression (lazy, value to collect)" },
4869
4876
  { name: "n", type: "number", description: "Number of samples to attempt" }
4870
4877
  ],
4871
- example: '["prob/posterior", model, evidence, query, 5000]'
4878
+ example: '["prob/posterior", ["prob/gaussian", 0, 1], [0.5], "mu", 5000]'
4872
4879
  },
4873
4880
  "prob/infer": {
4874
4881
  module: "prob",
@@ -4884,7 +4891,7 @@ var PROB_OPERATORS = {
4884
4891
  { name: "query", type: "SExpr", description: "Query expression (lazy)" },
4885
4892
  { name: "n", type: "number", description: "Number of samples to attempt" }
4886
4893
  ],
4887
- example: '["prob/infer", model, evidence, query, 5000]'
4894
+ example: '["prob/infer", ["prob/gaussian", 0, 1], [0.5], "mu", 5000]'
4888
4895
  },
4889
4896
  // ========================================
4890
4897
  // Statistics
@@ -4951,7 +4958,7 @@ var PROB_OPERATORS = {
4951
4958
  { name: "samples", type: "number[]", description: "Array of numeric samples" },
4952
4959
  { name: "alpha", type: "number", description: "Significance level (e.g., 0.05 for 95% interval)" }
4953
4960
  ],
4954
- example: '["prob/credible-interval", samples, 0.05] // => [lo, hi]'
4961
+ example: '["prob/credible-interval", [1, 2, 3, 4, 5], 0.05] // => [lo, hi]'
4955
4962
  }
4956
4963
  };
4957
4964
 
@@ -5139,7 +5146,7 @@ var BROWSER_OPERATORS = {
5139
5146
  kind: "custom",
5140
5147
  produces: "string"
5141
5148
  },
5142
- example: '["browser/clipboard-write", "@entity.inviteUrl", { "emit": { "success": "COPIED", "failure": "COPY_DENIED" } }]'
5149
+ example: '["browser/clipboard-write", "https://example.com/invite/abc", { "emit": { "success": "COPIED", "failure": "COPY_DENIED" } }]'
5143
5150
  },
5144
5151
  "browser/push-subscribe": {
5145
5152
  module: "browser",
@@ -5936,7 +5943,7 @@ var LLM_OPERATORS = {
5936
5943
  { name: "messages", type: { kind: "array", of: "LlmMessage" }, description: "Conversation messages" },
5937
5944
  { name: "tools", type: { kind: "array", of: "LlmToolDef" }, description: "Tool definitions available to the LLM" }
5938
5945
  ],
5939
- example: '["llm/call-tools", @entity.messages, @entity.tools]'
5946
+ example: '["llm/call-tools", [{"role": "user", "content": "What time is it?"}], [{"name": "getTime", "description": "Get current time", "parameters": {}}]]'
5940
5947
  },
5941
5948
  "llm/embed": {
5942
5949
  module: "llm",
@@ -5960,7 +5967,7 @@ var LLM_OPERATORS = {
5960
5967
  hasSideEffects: false,
5961
5968
  returnType: "number",
5962
5969
  params: [],
5963
- example: '["llm/token-count"] => 12450'
5970
+ example: '["llm/token-count"] // => 12450'
5964
5971
  },
5965
5972
  "llm/switch": {
5966
5973
  module: "llm",
@@ -6016,7 +6023,7 @@ var WORKSPACE_OPERATORS = {
6016
6023
  { name: "name", type: "string", description: "Orbital name" },
6017
6024
  { name: "def", type: { kind: "entityRef" }, description: "Orbital definition to write" }
6018
6025
  ],
6019
- example: '["workspace/write-orbital", "ProductOrbital", @entity.def]'
6026
+ example: '["workspace/write-orbital", "ProductOrbital", {"name": "ProductOrbital"}]'
6020
6027
  },
6021
6028
  "workspace/read-file": {
6022
6029
  module: "workspace",
@@ -6041,7 +6048,7 @@ var WORKSPACE_OPERATORS = {
6041
6048
  { name: "path", type: "string", description: "File path relative to workspace root" },
6042
6049
  { name: "content", type: "string", description: "File content" }
6043
6050
  ],
6044
- example: '["workspace/write-file", "orbitals/Product.orb", @entity.orbJson]'
6051
+ example: '["workspace/write-file", "orbitals/Product.orb", {"orbitals": []}]'
6045
6052
  },
6046
6053
  "workspace/exists": {
6047
6054
  module: "workspace",
@@ -6063,7 +6070,7 @@ var WORKSPACE_OPERATORS = {
6063
6070
  hasSideEffects: false,
6064
6071
  returnType: "array",
6065
6072
  params: [],
6066
- example: '["workspace/list-orbitals"] => ["ProductOrbital", "CartOrbital"]'
6073
+ example: '["workspace/list-orbitals"] // => ["ProductOrbital", "CartOrbital"]'
6067
6074
  },
6068
6075
  "workspace/read-schema": {
6069
6076
  module: "workspace",
@@ -6085,7 +6092,7 @@ var WORKSPACE_OPERATORS = {
6085
6092
  hasSideEffects: true,
6086
6093
  returnType: "void",
6087
6094
  params: [{ name: "schema", type: { kind: "entityRef" }, description: "Composed schema" }],
6088
- example: '["workspace/write-schema", @entity.composed]'
6095
+ example: '["workspace/write-schema", {"orbitals": [{"name": "ProductOrbital"}]}]'
6089
6096
  },
6090
6097
  "workspace/read-plan": {
6091
6098
  module: "workspace",
@@ -6107,7 +6114,7 @@ var WORKSPACE_OPERATORS = {
6107
6114
  hasSideEffects: true,
6108
6115
  returnType: "void",
6109
6116
  params: [{ name: "snapshot", type: { kind: "object", fields: { id: "string", status: "string" } }, description: "Plan snapshot" }],
6110
- example: '["workspace/write-plan", @entity.plan]'
6117
+ example: '["workspace/write-plan", ["create entity", "add list page"]]'
6111
6118
  },
6112
6119
  "workspace/archive-orbital": {
6113
6120
  module: "workspace",
@@ -6147,7 +6154,7 @@ var SESSION_OPERATORS = {
6147
6154
  { name: "orbitalName", type: "string", description: "Orbital name" },
6148
6155
  { name: "spec", type: { kind: "object", fields: { orbitalName: "string", organism: "string", method: "string" } }, description: "Orbital spec" }
6149
6156
  ],
6150
- example: '["session/write-spec", "ProductOrbital", @entity.spec]'
6157
+ example: '["session/write-spec", "ProductOrbital", {"goal": "manage products"}]'
6151
6158
  },
6152
6159
  "session/read-memory": {
6153
6160
  module: "session",
@@ -6172,7 +6179,7 @@ var SESSION_OPERATORS = {
6172
6179
  { name: "orbitalName", type: "string", description: "Orbital name" },
6173
6180
  { name: "memory", type: { kind: "object", fields: { entityName: "string", notes: { kind: "array", of: "string" } }, open: true }, description: "Orbital memory" }
6174
6181
  ],
6175
- example: '["session/write-memory", "ProductOrbital", @entity.memory]'
6182
+ example: '["session/write-memory", "ProductOrbital", {"notes": ["initial draft"]}]'
6176
6183
  },
6177
6184
  "session/read-history": {
6178
6185
  module: "session",
@@ -6197,7 +6204,7 @@ var SESSION_OPERATORS = {
6197
6204
  { name: "orbitalName", type: "string", description: "Orbital name" },
6198
6205
  { name: "entry", type: { kind: "object", fields: { role: "string", content: "string" } }, description: "History entry" }
6199
6206
  ],
6200
- example: '["session/append-history", "ProductOrbital", { role: "user", content: "Add a search bar" }]'
6207
+ example: '["session/append-history", "ProductOrbital", { "role": "user", "content": "Add a search bar" }]'
6201
6208
  },
6202
6209
  "session/read-errors": {
6203
6210
  module: "session",
@@ -6222,7 +6229,7 @@ var SESSION_OPERATORS = {
6222
6229
  { name: "orbitalName", type: "string", description: "Orbital name" },
6223
6230
  { name: "errors", type: { kind: "array", of: "ValidationError" }, description: "Validation errors" }
6224
6231
  ],
6225
- example: '["session/write-errors", "ProductOrbital", @entity.errors]'
6232
+ example: '["session/write-errors", "ProductOrbital", []]'
6226
6233
  },
6227
6234
  "session/read-analysis": {
6228
6235
  module: "session",
@@ -6297,7 +6304,7 @@ var TRACE_OPERATORS = {
6297
6304
  { name: "event", type: "string", description: "Event type name" },
6298
6305
  { name: "payload", type: { kind: "object", fields: {}, open: true }, description: "Event payload", optional: true }
6299
6306
  ],
6300
- example: '["trace/emit", "coordinator_state_changed", { phase: @entity.phase }]'
6307
+ example: '["trace/emit", "coordinator_state_changed", {"phase": "planning"}]'
6301
6308
  },
6302
6309
  "trace/log": {
6303
6310
  module: "trace",
@@ -6352,7 +6359,7 @@ var BEHAVIOR_OPERATORS = {
6352
6359
  { name: "orbitalName", type: "string", description: "Canonical orbital name to instantiate" },
6353
6360
  { name: "overrides", type: { kind: "object", fields: { linkedEntity: "string", method: "string" }, open: true }, description: "Override surface: linkedEntity, events, config, fields", optional: true }
6354
6361
  ],
6355
- example: '["behavior/instantiate", "std-ecommerce", "ProductOrbital", { linkedEntity: "Product" }]'
6362
+ example: '["behavior/instantiate", "std-ecommerce", "ProductOrbital", { "linkedEntity": "Product" }]'
6356
6363
  },
6357
6364
  "behavior/call": {
6358
6365
  module: "behavior",
@@ -6382,7 +6389,7 @@ var BEHAVIOR_OPERATORS = {
6382
6389
  { name: "palette", type: { kind: "object", fields: { topics: { kind: "array", of: "string" }, hints: { kind: "array", of: "string" } } }, description: "Topic-tree palette + primitive hints" },
6383
6390
  { name: "deltaPrompt", type: "string", description: "Per-orbital instruction prompt" }
6384
6391
  ],
6385
- example: '["lolo/emit-body", "PlayerOrbital", { topics: ["game/2d"] }, "player ship with movement"]'
6392
+ example: '["lolo/emit-body", "PlayerOrbital", { "topics": ["game/2d"] }, "player ship with movement"]'
6386
6393
  },
6387
6394
  "validate/validate": {
6388
6395
  module: "behavior",
@@ -6416,7 +6423,7 @@ var INTEGRATION_OPERATORS = {
6416
6423
  { name: "responseSchema", type: { kind: "object", fields: {}, open: true }, description: "JSON Schema the response must satisfy" },
6417
6424
  { name: "body", type: { kind: "object", fields: {}, open: true }, description: "Request body (for POST/PUT)", optional: true }
6418
6425
  ],
6419
- example: '["integration/http", "GET", "https://api.github.com/repos/foo/bar", { name: "string", stars: "number" }]'
6426
+ example: '["integration/http", "GET", "https://api.github.com/repos/foo/bar", { "name": "string", "stars": "number" }]'
6420
6427
  },
6421
6428
  "integration/github-get-repo": {
6422
6429
  module: "integration",