@almadar/std 1.0.15 → 2.1.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.
@@ -1,4 +1,4 @@
1
- import { a as StdOperatorMeta } from '../types-I95R8_FN.js';
1
+ import { a as StdOperatorMeta } from '../types-CmNM_IbV.js';
2
2
 
3
3
  /**
4
4
  * Array Module - Collection Operations
@@ -1,4 +1,4 @@
1
- import { a as StdOperatorMeta } from '../types-I95R8_FN.js';
1
+ import { a as StdOperatorMeta } from '../types-CmNM_IbV.js';
2
2
 
3
3
  /**
4
4
  * Async Module - Asynchronous Operations
@@ -4,12 +4,29 @@ var ASYNC_OPERATORS = {
4
4
  module: "async",
5
5
  category: "std-async",
6
6
  minArity: 1,
7
- maxArity: 1,
8
- description: "Wait for specified milliseconds",
7
+ maxArity: 2,
8
+ description: "Wait for specified milliseconds, optionally execute an effect after",
9
9
  hasSideEffects: true,
10
- returnType: "void",
11
- params: [{ name: "ms", type: "number", description: "Milliseconds to wait" }],
12
- example: '["async/delay", 2000] // Wait 2 seconds'
10
+ returnType: "any",
11
+ params: [
12
+ { name: "ms", type: "number", description: "Milliseconds to wait" },
13
+ { name: "effect", type: "expression", description: "Optional effect to execute after delay" }
14
+ ],
15
+ example: '["async/delay", 2000, ["emit", "RETRY"]] // Wait 2s then emit'
16
+ },
17
+ "async/interval": {
18
+ module: "async",
19
+ category: "std-async",
20
+ minArity: 2,
21
+ maxArity: 2,
22
+ description: "Execute an effect periodically at a fixed interval",
23
+ hasSideEffects: true,
24
+ returnType: "string",
25
+ params: [
26
+ { name: "ms", type: "number", description: "Interval in milliseconds" },
27
+ { name: "effect", type: "expression", description: "Effect to execute each interval" }
28
+ ],
29
+ example: '["async/interval", 5000, ["emit", "POLL_TICK"]] // Emit every 5s'
13
30
  },
14
31
  "async/timeout": {
15
32
  module: "async",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../modules/async.ts"],"names":[],"mappings":";AAeO,IAAM,eAAA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AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,KAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,cAAc,IAAA,EAAM,cAAA,EAAgB,WAAA,EAAa,iBAAA,EAAmB,CAAA;AAAA,IACrF,OAAA,EAAS;AAAA,GACX;AAAA,EACA,WAAA,EAAa;AAAA,IACX,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,uDAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,cAAc,IAAA,EAAM,cAAA,EAAgB,WAAA,EAAa,oBAAA,EAAsB,CAAA;AAAA,IACxF,OAAA,EAAS;AAAA,GACX;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,iDAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,cAAc,IAAA,EAAM,cAAA,EAAgB,WAAA,EAAa,6BAAA,EAA+B,CAAA;AAAA,IACjG,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,iBAAA,GAA8B;AAC5C,EAAA,OAAO,MAAA,CAAO,KAAK,eAAe,CAAA;AACpC","file":"async.js","sourcesContent":["/**\n * Async Module - Asynchronous Operations\n *\n * Provides functions for handling async operations, delays, and timing.\n * These operators have side effects as they affect execution timing.\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Async module operators.\n * These operators control execution timing and have side effects.\n */\nexport const ASYNC_OPERATORS: Record<string, StdOperatorMeta> = {\n 'async/delay': {\n module: 'async',\n category: 'std-async',\n minArity: 1,\n maxArity: 1,\n description: 'Wait for specified milliseconds',\n hasSideEffects: true,\n returnType: 'void',\n params: [{ name: 'ms', type: 'number', description: 'Milliseconds to wait' }],\n example: '[\"async/delay\", 2000] // Wait 2 seconds',\n },\n 'async/timeout': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Add timeout to an effect',\n hasSideEffects: true,\n returnType: 'any',\n params: [\n { name: 'effect', type: 'expression', description: 'Effect to execute' },\n { name: 'ms', type: 'number', description: 'Timeout in milliseconds' },\n ],\n example: '[\"async/timeout\", [\"call\", \"api\", \"fetchData\"], 5000]',\n },\n 'async/debounce': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Debounce an event (wait for pause in events)',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'event', type: 'string', description: 'Event name to emit' },\n { name: 'ms', type: 'number', description: 'Debounce delay in milliseconds' },\n ],\n example: '[\"async/debounce\", \"SEARCH\", 300]',\n },\n 'async/throttle': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Throttle an event (emit at most once per interval)',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'event', type: 'string', description: 'Event name to emit' },\n { name: 'ms', type: 'number', description: 'Throttle interval in milliseconds' },\n ],\n example: '[\"async/throttle\", \"SCROLL\", 100]',\n },\n 'async/retry': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Retry an effect with configurable backoff',\n hasSideEffects: true,\n returnType: 'any',\n params: [\n { name: 'effect', type: 'expression', description: 'Effect to retry' },\n { name: 'opts', type: 'object', description: '{ attempts, backoff, baseDelay }' },\n ],\n example: `[\"async/retry\",\n [\"call\", \"api\", \"fetchData\", { \"id\": \"@entity.id\" }],\n { \"attempts\": 3, \"backoff\": \"exponential\", \"baseDelay\": 1000 }]`,\n },\n 'async/race': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in parallel, return first to complete',\n hasSideEffects: true,\n returnType: 'any',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to race' }],\n example: '[\"async/race\", [\"call\", \"api1\"], [\"call\", \"api2\"]]',\n },\n 'async/all': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in parallel, wait for all to complete',\n hasSideEffects: true,\n returnType: 'array',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to execute' }],\n example: '[\"async/all\", [\"call\", \"api1\"], [\"call\", \"api2\"]]',\n },\n 'async/sequence': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in sequence (one after another)',\n hasSideEffects: true,\n returnType: 'array',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to execute in order' }],\n example: '[\"async/sequence\", [\"call\", \"validate\"], [\"call\", \"save\"]]',\n },\n};\n\n/**\n * Get all async operator names.\n */\nexport function getAsyncOperators(): string[] {\n return Object.keys(ASYNC_OPERATORS);\n}\n"]}
1
+ {"version":3,"sources":["../../modules/async.ts"],"names":[],"mappings":";AAeO,IAAM,eAAA,GAAmD;AAAA,EAC9D,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,qEAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,KAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,QAAA,EAAU,aAAa,sBAAA,EAAuB;AAAA,MAClE,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,YAAA,EAAc,aAAa,wCAAA;AAAyC,KAC9F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AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,uDAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,KAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,cAAc,IAAA,EAAM,cAAA,EAAgB,WAAA,EAAa,iBAAA,EAAmB,CAAA;AAAA,IACrF,OAAA,EAAS;AAAA,GACX;AAAA,EACA,WAAA,EAAa;AAAA,IACX,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,uDAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,cAAc,IAAA,EAAM,cAAA,EAAgB,WAAA,EAAa,oBAAA,EAAsB,CAAA;AAAA,IACxF,OAAA,EAAS;AAAA,GACX;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,iDAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,cAAc,IAAA,EAAM,cAAA,EAAgB,WAAA,EAAa,6BAAA,EAA+B,CAAA;AAAA,IACjG,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,iBAAA,GAA8B;AAC5C,EAAA,OAAO,MAAA,CAAO,KAAK,eAAe,CAAA;AACpC","file":"async.js","sourcesContent":["/**\n * Async Module - Asynchronous Operations\n *\n * Provides functions for handling async operations, delays, and timing.\n * These operators have side effects as they affect execution timing.\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Async module operators.\n * These operators control execution timing and have side effects.\n */\nexport const ASYNC_OPERATORS: Record<string, StdOperatorMeta> = {\n 'async/delay': {\n module: 'async',\n category: 'std-async',\n minArity: 1,\n maxArity: 2,\n description: 'Wait for specified milliseconds, optionally execute an effect after',\n hasSideEffects: true,\n returnType: 'any',\n params: [\n { name: 'ms', type: 'number', description: 'Milliseconds to wait' },\n { name: 'effect', type: 'expression', description: 'Optional effect to execute after delay' },\n ],\n example: '[\"async/delay\", 2000, [\"emit\", \"RETRY\"]] // Wait 2s then emit',\n },\n 'async/interval': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Execute an effect periodically at a fixed interval',\n hasSideEffects: true,\n returnType: 'string',\n params: [\n { name: 'ms', type: 'number', description: 'Interval in milliseconds' },\n { name: 'effect', type: 'expression', description: 'Effect to execute each interval' },\n ],\n example: '[\"async/interval\", 5000, [\"emit\", \"POLL_TICK\"]] // Emit every 5s',\n },\n 'async/timeout': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Add timeout to an effect',\n hasSideEffects: true,\n returnType: 'any',\n params: [\n { name: 'effect', type: 'expression', description: 'Effect to execute' },\n { name: 'ms', type: 'number', description: 'Timeout in milliseconds' },\n ],\n example: '[\"async/timeout\", [\"call\", \"api\", \"fetchData\"], 5000]',\n },\n 'async/debounce': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Debounce an event (wait for pause in events)',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'event', type: 'string', description: 'Event name to emit' },\n { name: 'ms', type: 'number', description: 'Debounce delay in milliseconds' },\n ],\n example: '[\"async/debounce\", \"SEARCH\", 300]',\n },\n 'async/throttle': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Throttle an event (emit at most once per interval)',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'event', type: 'string', description: 'Event name to emit' },\n { name: 'ms', type: 'number', description: 'Throttle interval in milliseconds' },\n ],\n example: '[\"async/throttle\", \"SCROLL\", 100]',\n },\n 'async/retry': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Retry an effect with configurable backoff',\n hasSideEffects: true,\n returnType: 'any',\n params: [\n { name: 'effect', type: 'expression', description: 'Effect to retry' },\n { name: 'opts', type: 'object', description: '{ attempts, backoff, baseDelay }' },\n ],\n example: `[\"async/retry\",\n [\"call\", \"api\", \"fetchData\", { \"id\": \"@entity.id\" }],\n { \"attempts\": 3, \"backoff\": \"exponential\", \"baseDelay\": 1000 }]`,\n },\n 'async/race': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in parallel, return first to complete',\n hasSideEffects: true,\n returnType: 'any',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to race' }],\n example: '[\"async/race\", [\"call\", \"api1\"], [\"call\", \"api2\"]]',\n },\n 'async/all': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in parallel, wait for all to complete',\n hasSideEffects: true,\n returnType: 'array',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to execute' }],\n example: '[\"async/all\", [\"call\", \"api1\"], [\"call\", \"api2\"]]',\n },\n 'async/sequence': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in sequence (one after another)',\n hasSideEffects: true,\n returnType: 'array',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to execute in order' }],\n example: '[\"async/sequence\", [\"call\", \"validate\"], [\"call\", \"save\"]]',\n },\n};\n\n/**\n * Get all async operator names.\n */\nexport function getAsyncOperators(): string[] {\n return Object.keys(ASYNC_OPERATORS);\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { a as StdOperatorMeta } from '../types-I95R8_FN.js';
1
+ import { a as StdOperatorMeta } from '../types-CmNM_IbV.js';
2
2
 
3
3
  /**
4
4
  * Format Module - Display Formatting
@@ -9,4 +9,5 @@ export { ASYNC_OPERATORS, getAsyncOperators } from './async.js';
9
9
  export { NN_OPERATORS, getNnOperators } from './nn.js';
10
10
  export { TENSOR_OPERATORS, getTensorOperators } from './tensor.js';
11
11
  export { TRAIN_OPERATORS, getTrainOperators } from './train.js';
12
- import '../types-I95R8_FN.js';
12
+ export { PROB_OPERATORS, getProbOperators } from './prob.js';
13
+ import '../types-CmNM_IbV.js';
@@ -2119,12 +2119,29 @@ var ASYNC_OPERATORS = {
2119
2119
  module: "async",
2120
2120
  category: "std-async",
2121
2121
  minArity: 1,
2122
- maxArity: 1,
2123
- description: "Wait for specified milliseconds",
2122
+ maxArity: 2,
2123
+ description: "Wait for specified milliseconds, optionally execute an effect after",
2124
2124
  hasSideEffects: true,
2125
- returnType: "void",
2126
- params: [{ name: "ms", type: "number", description: "Milliseconds to wait" }],
2127
- example: '["async/delay", 2000] // Wait 2 seconds'
2125
+ returnType: "any",
2126
+ params: [
2127
+ { name: "ms", type: "number", description: "Milliseconds to wait" },
2128
+ { name: "effect", type: "expression", description: "Optional effect to execute after delay" }
2129
+ ],
2130
+ example: '["async/delay", 2000, ["emit", "RETRY"]] // Wait 2s then emit'
2131
+ },
2132
+ "async/interval": {
2133
+ module: "async",
2134
+ category: "std-async",
2135
+ minArity: 2,
2136
+ maxArity: 2,
2137
+ description: "Execute an effect periodically at a fixed interval",
2138
+ hasSideEffects: true,
2139
+ returnType: "string",
2140
+ params: [
2141
+ { name: "ms", type: "number", description: "Interval in milliseconds" },
2142
+ { name: "effect", type: "expression", description: "Effect to execute each interval" }
2143
+ ],
2144
+ example: '["async/interval", 5000, ["emit", "POLL_TICK"]] // Emit every 5s'
2128
2145
  },
2129
2146
  "async/timeout": {
2130
2147
  module: "async",
@@ -3137,6 +3154,232 @@ function getTrainOperators() {
3137
3154
  return Object.keys(TRAIN_OPERATORS);
3138
3155
  }
3139
3156
 
3140
- export { ARRAY_OPERATORS, ASYNC_OPERATORS, FORMAT_OPERATORS, MATH_OPERATORS, NN_OPERATORS, OBJECT_OPERATORS, STR_OPERATORS, TENSOR_OPERATORS, TIME_OPERATORS, TRAIN_OPERATORS, VALIDATE_OPERATORS, getArrayOperators, getAsyncOperators, getFormatOperators, getLambdaArrayOperators, getMathOperators, getNnOperators, getObjectOperators, getStrOperators, getTensorOperators, getTimeOperators, getTrainOperators, getValidateOperators };
3157
+ // modules/prob.ts
3158
+ var PROB_OPERATORS = {
3159
+ // ========================================
3160
+ // Distribution Sampling
3161
+ // ========================================
3162
+ "prob/seed": {
3163
+ module: "prob",
3164
+ category: "std-prob",
3165
+ minArity: 1,
3166
+ maxArity: 1,
3167
+ description: "Set seeded PRNG for deterministic probabilistic sampling",
3168
+ hasSideEffects: true,
3169
+ returnType: "void",
3170
+ params: [{ name: "n", type: "number", description: "Seed value (integer)" }],
3171
+ example: '["prob/seed", 42]'
3172
+ },
3173
+ "prob/flip": {
3174
+ module: "prob",
3175
+ category: "std-prob",
3176
+ minArity: 1,
3177
+ maxArity: 1,
3178
+ description: "Bernoulli trial: returns true with probability p",
3179
+ hasSideEffects: false,
3180
+ returnType: "boolean",
3181
+ params: [{ name: "p", type: "number", description: "Probability of true (0 to 1)" }],
3182
+ example: '["prob/flip", 0.5] // => true or false with equal probability'
3183
+ },
3184
+ "prob/gaussian": {
3185
+ module: "prob",
3186
+ category: "std-prob",
3187
+ minArity: 2,
3188
+ maxArity: 2,
3189
+ description: "Sample from a Gaussian (normal) distribution",
3190
+ hasSideEffects: false,
3191
+ returnType: "number",
3192
+ params: [
3193
+ { name: "mu", type: "number", description: "Mean" },
3194
+ { name: "sigma", type: "number", description: "Standard deviation" }
3195
+ ],
3196
+ example: '["prob/gaussian", 0, 1] // => standard normal sample'
3197
+ },
3198
+ "prob/uniform": {
3199
+ module: "prob",
3200
+ category: "std-prob",
3201
+ minArity: 2,
3202
+ maxArity: 2,
3203
+ description: "Sample from a uniform distribution [lo, hi)",
3204
+ hasSideEffects: false,
3205
+ returnType: "number",
3206
+ params: [
3207
+ { name: "lo", type: "number", description: "Lower bound (inclusive)" },
3208
+ { name: "hi", type: "number", description: "Upper bound (exclusive)" }
3209
+ ],
3210
+ example: '["prob/uniform", 0, 10] // => number in [0, 10)'
3211
+ },
3212
+ "prob/beta": {
3213
+ module: "prob",
3214
+ category: "std-prob",
3215
+ minArity: 2,
3216
+ maxArity: 2,
3217
+ description: "Sample from a Beta(alpha, beta) distribution",
3218
+ hasSideEffects: false,
3219
+ returnType: "number",
3220
+ params: [
3221
+ { name: "alpha", type: "number", description: "Alpha shape parameter (> 0)" },
3222
+ { name: "beta", type: "number", description: "Beta shape parameter (> 0)" }
3223
+ ],
3224
+ example: '["prob/beta", 2, 5] // => number in [0, 1], mean ~ 0.286'
3225
+ },
3226
+ "prob/categorical": {
3227
+ module: "prob",
3228
+ category: "std-prob",
3229
+ minArity: 2,
3230
+ maxArity: 2,
3231
+ description: "Weighted random selection from items",
3232
+ hasSideEffects: false,
3233
+ returnType: "any",
3234
+ params: [
3235
+ { name: "items", type: "array", description: "Array of items to choose from" },
3236
+ { name: "weights", type: "number[]", description: "Array of weights (same length as items)" }
3237
+ ],
3238
+ example: '["prob/categorical", ["a", "b", "c"], [1, 2, 1]] // => "b" most likely'
3239
+ },
3240
+ "prob/poisson": {
3241
+ module: "prob",
3242
+ category: "std-prob",
3243
+ minArity: 1,
3244
+ maxArity: 1,
3245
+ description: "Sample from a Poisson distribution",
3246
+ hasSideEffects: false,
3247
+ returnType: "number",
3248
+ params: [{ name: "lambda", type: "number", description: "Rate parameter (> 0)" }],
3249
+ example: '["prob/poisson", 4] // => non-negative integer, mean ~ 4'
3250
+ },
3251
+ // ========================================
3252
+ // Inference
3253
+ // ========================================
3254
+ "prob/condition": {
3255
+ module: "prob",
3256
+ category: "std-prob",
3257
+ minArity: 1,
3258
+ maxArity: 1,
3259
+ description: "Mark current sample as rejected if predicate is false",
3260
+ hasSideEffects: true,
3261
+ returnType: "void",
3262
+ params: [{ name: "predicate", type: "boolean", description: "Condition that must hold" }],
3263
+ example: '["prob/condition", [">", "@entity.x", 0]]'
3264
+ },
3265
+ "prob/sample": {
3266
+ module: "prob",
3267
+ category: "std-prob",
3268
+ minArity: 2,
3269
+ maxArity: 2,
3270
+ description: "Evaluate an expression n times and collect results",
3271
+ hasSideEffects: false,
3272
+ returnType: "array",
3273
+ params: [
3274
+ { name: "n", type: "number", description: "Number of samples" },
3275
+ { name: "expr", type: "SExpr", description: "Expression to evaluate (lazy)" }
3276
+ ],
3277
+ example: '["prob/sample", 1000, ["prob/flip", 0.5]] // => array of booleans'
3278
+ },
3279
+ "prob/posterior": {
3280
+ module: "prob",
3281
+ category: "std-prob",
3282
+ minArity: 4,
3283
+ maxArity: 4,
3284
+ description: "Rejection sampling: returns accepted query values",
3285
+ hasSideEffects: false,
3286
+ returnType: "array",
3287
+ params: [
3288
+ { name: "model", type: "SExpr", description: "Model expression (lazy, may call set/condition)" },
3289
+ { name: "evidence", type: "SExpr", description: "Evidence expression (lazy, boolean)" },
3290
+ { name: "query", type: "SExpr", description: "Query expression (lazy, value to collect)" },
3291
+ { name: "n", type: "number", description: "Number of samples to attempt" }
3292
+ ],
3293
+ example: '["prob/posterior", model, evidence, query, 5000]'
3294
+ },
3295
+ "prob/infer": {
3296
+ module: "prob",
3297
+ category: "std-prob",
3298
+ minArity: 4,
3299
+ maxArity: 4,
3300
+ description: "Like posterior but returns {mean, variance, samples, acceptRate}",
3301
+ hasSideEffects: false,
3302
+ returnType: "object",
3303
+ params: [
3304
+ { name: "model", type: "SExpr", description: "Model expression (lazy)" },
3305
+ { name: "evidence", type: "SExpr", description: "Evidence expression (lazy, boolean)" },
3306
+ { name: "query", type: "SExpr", description: "Query expression (lazy)" },
3307
+ { name: "n", type: "number", description: "Number of samples to attempt" }
3308
+ ],
3309
+ example: '["prob/infer", model, evidence, query, 5000]'
3310
+ },
3311
+ // ========================================
3312
+ // Statistics
3313
+ // ========================================
3314
+ "prob/expected-value": {
3315
+ module: "prob",
3316
+ category: "std-prob",
3317
+ minArity: 1,
3318
+ maxArity: 1,
3319
+ description: "Mean of numeric samples",
3320
+ hasSideEffects: false,
3321
+ returnType: "number",
3322
+ params: [{ name: "samples", type: "number[]", description: "Array of numeric samples" }],
3323
+ example: '["prob/expected-value", [2, 4, 6, 8]] // => 5'
3324
+ },
3325
+ "prob/variance": {
3326
+ module: "prob",
3327
+ category: "std-prob",
3328
+ minArity: 1,
3329
+ maxArity: 1,
3330
+ description: "Population variance of numeric samples",
3331
+ hasSideEffects: false,
3332
+ returnType: "number",
3333
+ params: [{ name: "samples", type: "number[]", description: "Array of numeric samples" }],
3334
+ example: '["prob/variance", [2, 4, 4, 4, 5, 5, 7, 9]] // => 4'
3335
+ },
3336
+ "prob/histogram": {
3337
+ module: "prob",
3338
+ category: "std-prob",
3339
+ minArity: 2,
3340
+ maxArity: 2,
3341
+ description: "Bin numeric samples into a histogram",
3342
+ hasSideEffects: false,
3343
+ returnType: "object",
3344
+ params: [
3345
+ { name: "samples", type: "number[]", description: "Array of numeric samples" },
3346
+ { name: "bins", type: "number", description: "Number of bins" }
3347
+ ],
3348
+ example: '["prob/histogram", [1, 2, 3, 4, 5], 2] // => {binEdges, counts}'
3349
+ },
3350
+ "prob/percentile": {
3351
+ module: "prob",
3352
+ category: "std-prob",
3353
+ minArity: 2,
3354
+ maxArity: 2,
3355
+ description: "Get the p-th percentile (0-100) from samples",
3356
+ hasSideEffects: false,
3357
+ returnType: "number",
3358
+ params: [
3359
+ { name: "samples", type: "number[]", description: "Array of numeric samples" },
3360
+ { name: "p", type: "number", description: "Percentile (0 to 100)" }
3361
+ ],
3362
+ example: '["prob/percentile", [1, 2, 3, 4, 5], 50] // => 3'
3363
+ },
3364
+ "prob/credible-interval": {
3365
+ module: "prob",
3366
+ category: "std-prob",
3367
+ minArity: 2,
3368
+ maxArity: 2,
3369
+ description: "Compute symmetric credible interval from samples",
3370
+ hasSideEffects: false,
3371
+ returnType: "array",
3372
+ params: [
3373
+ { name: "samples", type: "number[]", description: "Array of numeric samples" },
3374
+ { name: "alpha", type: "number", description: "Significance level (e.g., 0.05 for 95% interval)" }
3375
+ ],
3376
+ example: '["prob/credible-interval", samples, 0.05] // => [lo, hi]'
3377
+ }
3378
+ };
3379
+ function getProbOperators() {
3380
+ return PROB_OPERATORS;
3381
+ }
3382
+
3383
+ export { ARRAY_OPERATORS, ASYNC_OPERATORS, FORMAT_OPERATORS, MATH_OPERATORS, NN_OPERATORS, OBJECT_OPERATORS, PROB_OPERATORS, STR_OPERATORS, TENSOR_OPERATORS, TIME_OPERATORS, TRAIN_OPERATORS, VALIDATE_OPERATORS, getArrayOperators, getAsyncOperators, getFormatOperators, getLambdaArrayOperators, getMathOperators, getNnOperators, getObjectOperators, getProbOperators, getStrOperators, getTensorOperators, getTimeOperators, getTrainOperators, getValidateOperators };
3141
3384
  //# sourceMappingURL=index.js.map
3142
3385
  //# sourceMappingURL=index.js.map