@almadar/std 16.44.0 → 16.45.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/canonical-operators.json +55 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +115 -3
- package/dist/index.js.map +1 -1
- package/dist/modules/agent.d.ts +1 -1
- package/dist/modules/anim.d.ts +1 -1
- package/dist/modules/array.d.ts +1 -1
- package/dist/modules/async.d.ts +1 -1
- package/dist/modules/composition.d.ts +1 -1
- package/dist/modules/contract.d.ts +1 -1
- package/dist/modules/core.d.ts +1 -1
- package/dist/modules/data.d.ts +1 -1
- package/dist/modules/ease.d.ts +1 -1
- package/dist/modules/format.d.ts +1 -1
- package/dist/modules/geo.d.ts +1 -1
- package/dist/modules/graph.d.ts +1 -1
- package/dist/modules/grid.d.ts +1 -1
- package/dist/modules/index.d.ts +3 -1
- package/dist/modules/index.js +97 -1
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/math.d.ts +1 -1
- package/dist/modules/nn.d.ts +1 -1
- package/dist/modules/noise.d.ts +22 -0
- package/dist/modules/noise.js +56 -0
- package/dist/modules/noise.js.map +1 -0
- package/dist/modules/object.d.ts +1 -1
- package/dist/modules/os.d.ts +1 -1
- package/dist/modules/path.d.ts +22 -0
- package/dist/modules/path.js +46 -0
- package/dist/modules/path.js.map +1 -0
- package/dist/modules/prob.d.ts +1 -1
- package/dist/modules/str.d.ts +1 -1
- package/dist/modules/tensor.d.ts +1 -1
- package/dist/modules/time.d.ts +1 -1
- package/dist/modules/train.d.ts +1 -1
- package/dist/modules/validate.d.ts +1 -1
- package/dist/modules/vector.d.ts +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/registry.js +99 -3
- package/dist/registry.js.map +1 -1
- package/dist/{types-Bc_qzeWd.d.ts → types-cxNzLgmy.d.ts} +3 -3
- package/package.json +1 -1
package/dist/modules/math.d.ts
CHANGED
package/dist/modules/nn.d.ts
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { S as StdOperatorMeta } from '../types-cxNzLgmy.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Noise Module - Coherent Procedural Noise
|
|
5
|
+
*
|
|
6
|
+
* Deterministic coherent-noise generators (perlin-derived) for procedural
|
|
7
|
+
* generation. All operators are pure and produce byte-identical JS↔Rust
|
|
8
|
+
* output (shared verbatim permutation table). Output range [-1, 1].
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Noise module operators.
|
|
15
|
+
*/
|
|
16
|
+
declare const NOISE_OPERATORS: Record<string, StdOperatorMeta>;
|
|
17
|
+
/**
|
|
18
|
+
* Get all noise operator names.
|
|
19
|
+
*/
|
|
20
|
+
declare function getNoiseOperators(): string[];
|
|
21
|
+
|
|
22
|
+
export { NOISE_OPERATORS, getNoiseOperators };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// modules/noise.ts
|
|
2
|
+
var NOISE_OPERATORS = {
|
|
3
|
+
"noise/perlin": {
|
|
4
|
+
module: "noise",
|
|
5
|
+
category: "std-noise",
|
|
6
|
+
minArity: 2,
|
|
7
|
+
maxArity: 3,
|
|
8
|
+
description: "2D Perlin noise at (x,y) with optional seed; output [-1,1]",
|
|
9
|
+
hasSideEffects: false,
|
|
10
|
+
returnType: "number",
|
|
11
|
+
params: [
|
|
12
|
+
{ name: "x", type: "number", description: "X coordinate" },
|
|
13
|
+
{ name: "y", type: "number", description: "Y coordinate" },
|
|
14
|
+
{ name: "seed", type: "number", description: "Optional integer seed (default 0)", optional: true }
|
|
15
|
+
],
|
|
16
|
+
example: '["noise/perlin", 1.5, 2.5, 0] // => coherent value in [-1,1]'
|
|
17
|
+
},
|
|
18
|
+
"noise/simplex": {
|
|
19
|
+
module: "noise",
|
|
20
|
+
category: "std-noise",
|
|
21
|
+
minArity: 2,
|
|
22
|
+
maxArity: 3,
|
|
23
|
+
description: "Value-coherent noise (perlin-derived) at (x,y) with optional seed; output [-1,1]",
|
|
24
|
+
hasSideEffects: false,
|
|
25
|
+
returnType: "number",
|
|
26
|
+
params: [
|
|
27
|
+
{ name: "x", type: "number", description: "X coordinate" },
|
|
28
|
+
{ name: "y", type: "number", description: "Y coordinate" },
|
|
29
|
+
{ name: "seed", type: "number", description: "Optional integer seed (default 0)", optional: true }
|
|
30
|
+
],
|
|
31
|
+
example: '["noise/simplex", 1.5, 2.5, 0] // => coherent value in [-1,1]'
|
|
32
|
+
},
|
|
33
|
+
"noise/fbm": {
|
|
34
|
+
module: "noise",
|
|
35
|
+
category: "std-noise",
|
|
36
|
+
minArity: 3,
|
|
37
|
+
maxArity: 4,
|
|
38
|
+
description: "Fractal Brownian motion: summed perlin octaves (clamped 1..8); output [-1,1]",
|
|
39
|
+
hasSideEffects: false,
|
|
40
|
+
returnType: "number",
|
|
41
|
+
params: [
|
|
42
|
+
{ name: "x", type: "number", description: "X coordinate" },
|
|
43
|
+
{ name: "y", type: "number", description: "Y coordinate" },
|
|
44
|
+
{ name: "octaves", type: "number", description: "Octave count (floored, clamped to 1..8)" },
|
|
45
|
+
{ name: "seed", type: "number", description: "Optional integer seed (default 0)", optional: true }
|
|
46
|
+
],
|
|
47
|
+
example: '["noise/fbm", 1.5, 2.5, 4, 0] // => layered value in [-1,1]'
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function getNoiseOperators() {
|
|
51
|
+
return Object.keys(NOISE_OPERATORS);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { NOISE_OPERATORS, getNoiseOperators };
|
|
55
|
+
//# sourceMappingURL=noise.js.map
|
|
56
|
+
//# sourceMappingURL=noise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../modules/noise.ts"],"names":[],"mappings":";AAeO,IAAM,eAAA,GAAmD;AAAA,EAC9D,cAAA,EAAgB;AAAA,IACd,MAAA,EAAQ,OAAA;AAAA,IACR,QA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A,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,GAAA,EAAK,IAAA,EAAM,QAAA,EAAU,aAAa,cAAA,EAAe;AAAA,MACzD,EAAE,IAAA,EAAM,GAAA,EAAK,IAAA,EAAM,QAAA,EAAU,aAAa,cAAA,EAAe;AAAA,MACzD,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAM,QAAA,EAAU,aAAa,yCAAA,EAA0C;AAAA,MAC1F,EAAE,MAAM,MAAA,EAAQ,IAAA,EAAM,UAAU,WAAA,EAAa,mCAAA,EAAqC,UAAU,IAAA;AAAK,KACnG;AAAA,IACA,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,iBAAA,GAA8B;AAC5C,EAAA,OAAO,MAAA,CAAO,KAAK,eAAe,CAAA;AACpC","file":"noise.js","sourcesContent":["/**\n * Noise Module - Coherent Procedural Noise\n *\n * Deterministic coherent-noise generators (perlin-derived) for procedural\n * generation. All operators are pure and produce byte-identical JS↔Rust\n * output (shared verbatim permutation table). Output range [-1, 1].\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Noise module operators.\n */\nexport const NOISE_OPERATORS: Record<string, StdOperatorMeta> = {\n 'noise/perlin': {\n module: 'noise',\n category: 'std-noise',\n minArity: 2,\n maxArity: 3,\n description: '2D Perlin noise at (x,y) with optional seed; output [-1,1]',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'x', type: 'number', description: 'X coordinate' },\n { name: 'y', type: 'number', description: 'Y coordinate' },\n { name: 'seed', type: 'number', description: 'Optional integer seed (default 0)', optional: true },\n ],\n example: '[\"noise/perlin\", 1.5, 2.5, 0] // => coherent value in [-1,1]',\n },\n 'noise/simplex': {\n module: 'noise',\n category: 'std-noise',\n minArity: 2,\n maxArity: 3,\n description: 'Value-coherent noise (perlin-derived) at (x,y) with optional seed; output [-1,1]',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'x', type: 'number', description: 'X coordinate' },\n { name: 'y', type: 'number', description: 'Y coordinate' },\n { name: 'seed', type: 'number', description: 'Optional integer seed (default 0)', optional: true },\n ],\n example: '[\"noise/simplex\", 1.5, 2.5, 0] // => coherent value in [-1,1]',\n },\n 'noise/fbm': {\n module: 'noise',\n category: 'std-noise',\n minArity: 3,\n maxArity: 4,\n description: 'Fractal Brownian motion: summed perlin octaves (clamped 1..8); output [-1,1]',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'x', type: 'number', description: 'X coordinate' },\n { name: 'y', type: 'number', description: 'Y coordinate' },\n { name: 'octaves', type: 'number', description: 'Octave count (floored, clamped to 1..8)' },\n { name: 'seed', type: 'number', description: 'Optional integer seed (default 0)', optional: true },\n ],\n example: '[\"noise/fbm\", 1.5, 2.5, 4, 0] // => layered value in [-1,1]',\n },\n};\n\n/**\n * Get all noise operator names.\n */\nexport function getNoiseOperators(): string[] {\n return Object.keys(NOISE_OPERATORS);\n}\n"]}
|
package/dist/modules/object.d.ts
CHANGED
package/dist/modules/os.d.ts
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { S as StdOperatorMeta } from '../types-cxNzLgmy.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Path Module - Grid Pathfinding
|
|
5
|
+
*
|
|
6
|
+
* Deterministic grid pathfinding over integer cells `{x,y}`. All operators
|
|
7
|
+
* are pure and produce byte-identical JS↔Rust output via a fixed neighbor
|
|
8
|
+
* order and stable tie-break (lower f, then lower h, then earliest insertion).
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Path module operators.
|
|
15
|
+
*/
|
|
16
|
+
declare const PATH_OPERATORS: Record<string, StdOperatorMeta>;
|
|
17
|
+
/**
|
|
18
|
+
* Get all path operator names.
|
|
19
|
+
*/
|
|
20
|
+
declare function getPathOperators(): string[];
|
|
21
|
+
|
|
22
|
+
export { PATH_OPERATORS, getPathOperators };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// modules/path.ts
|
|
2
|
+
var PATH_OPERATORS = {
|
|
3
|
+
"path/astar": {
|
|
4
|
+
module: "path",
|
|
5
|
+
category: "std-path",
|
|
6
|
+
minArity: 5,
|
|
7
|
+
maxArity: 6,
|
|
8
|
+
description: "A* shortest path on a w\xD7h grid; returns cells start\u2192goal (incl. both) or [] if none",
|
|
9
|
+
hasSideEffects: false,
|
|
10
|
+
returnType: "array",
|
|
11
|
+
params: [
|
|
12
|
+
{ name: "start", type: "vector", description: "Start cell {x,y}" },
|
|
13
|
+
{ name: "goal", type: "vector", description: "Goal cell {x,y}" },
|
|
14
|
+
{ name: "blocked", type: { kind: "array", of: "vector" }, description: "Blocked cells [{x,y}, ...]" },
|
|
15
|
+
{ name: "w", type: "number", description: "Grid width (x in [0,w))" },
|
|
16
|
+
{ name: "h", type: "number", description: "Grid height (y in [0,h))" },
|
|
17
|
+
{ name: "diagonal", type: "boolean", description: "Allow 8-direction moves (default false)", optional: true }
|
|
18
|
+
],
|
|
19
|
+
example: '["path/astar", {"x":0,"y":0}, {"x":2,"y":0}, [], 3, 1] // => [{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0}]'
|
|
20
|
+
},
|
|
21
|
+
"path/reachable": {
|
|
22
|
+
module: "path",
|
|
23
|
+
category: "std-path",
|
|
24
|
+
minArity: 5,
|
|
25
|
+
maxArity: 6,
|
|
26
|
+
description: "BFS cells reachable within N moves from start (incl. start); sorted row-major",
|
|
27
|
+
hasSideEffects: false,
|
|
28
|
+
returnType: "array",
|
|
29
|
+
params: [
|
|
30
|
+
{ name: "start", type: "vector", description: "Start cell {x,y}" },
|
|
31
|
+
{ name: "steps", type: "number", description: "Maximum number of moves" },
|
|
32
|
+
{ name: "blocked", type: { kind: "array", of: "vector" }, description: "Blocked cells [{x,y}, ...]" },
|
|
33
|
+
{ name: "w", type: "number", description: "Grid width (x in [0,w))" },
|
|
34
|
+
{ name: "h", type: "number", description: "Grid height (y in [0,h))" },
|
|
35
|
+
{ name: "diagonal", type: "boolean", description: "Allow 8-direction moves (default false)", optional: true }
|
|
36
|
+
],
|
|
37
|
+
example: '["path/reachable", {"x":1,"y":1}, 1, [], 3, 3, false] // => 5 cross-shaped cells, row-major'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function getPathOperators() {
|
|
41
|
+
return Object.keys(PATH_OPERATORS);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { PATH_OPERATORS, getPathOperators };
|
|
45
|
+
//# sourceMappingURL=path.js.map
|
|
46
|
+
//# sourceMappingURL=path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../modules/path.ts"],"names":[],"mappings":";AAeO,IAAM,cAAA,GAAkD;AAAA,EAC7D,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,MAAA;AAAA,IACR,QAAA,EAAU,UAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,6FAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,QAAA,EAAU,aAAa,kBAAA,EAAmB;AAAA,MACjE,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,QAAA,EAAU,aAAa,iBAAA,EAAkB;AAAA,MAC/D,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAM,EAAE,IAAA,EAAM,OAAA,EAAS,EAAA,EAAI,QAAA,EAAS,EAAG,WAAA,EAAa,4BAAA,EAA6B;AAAA,MACpG,EAAE,IAAA,EAAM,GAAA,EAAK,IAAA,EAAM,QAAA,EAAU,aAAa,yBAAA,EAA0B;AAAA,MACpE,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terministic grid pathfinding over integer cells `{x,y}`. All operators\n * are pure and produce byte-identical JS↔Rust output via a fixed neighbor\n * order and stable tie-break (lower f, then lower h, then earliest insertion).\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Path module operators.\n */\nexport const PATH_OPERATORS: Record<string, StdOperatorMeta> = {\n 'path/astar': {\n module: 'path',\n category: 'std-path',\n minArity: 5,\n maxArity: 6,\n description: 'A* shortest path on a w×h grid; returns cells start→goal (incl. both) or [] if none',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'start', type: 'vector', description: 'Start cell {x,y}' },\n { name: 'goal', type: 'vector', description: 'Goal cell {x,y}' },\n { name: 'blocked', type: { kind: 'array', of: 'vector' }, description: 'Blocked cells [{x,y}, ...]' },\n { name: 'w', type: 'number', description: 'Grid width (x in [0,w))' },\n { name: 'h', type: 'number', description: 'Grid height (y in [0,h))' },\n { name: 'diagonal', type: 'boolean', description: 'Allow 8-direction moves (default false)', optional: true },\n ],\n example: '[\"path/astar\", {\"x\":0,\"y\":0}, {\"x\":2,\"y\":0}, [], 3, 1] // => [{\"x\":0,\"y\":0},{\"x\":1,\"y\":0},{\"x\":2,\"y\":0}]',\n },\n 'path/reachable': {\n module: 'path',\n category: 'std-path',\n minArity: 5,\n maxArity: 6,\n description: 'BFS cells reachable within N moves from start (incl. start); sorted row-major',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'start', type: 'vector', description: 'Start cell {x,y}' },\n { name: 'steps', type: 'number', description: 'Maximum number of moves' },\n { name: 'blocked', type: { kind: 'array', of: 'vector' }, description: 'Blocked cells [{x,y}, ...]' },\n { name: 'w', type: 'number', description: 'Grid width (x in [0,w))' },\n { name: 'h', type: 'number', description: 'Grid height (y in [0,h))' },\n { name: 'diagonal', type: 'boolean', description: 'Allow 8-direction moves (default false)', optional: true },\n ],\n example: '[\"path/reachable\", {\"x\":1,\"y\":1}, 1, [], 3, 3, false] // => 5 cross-shaped cells, row-major',\n },\n};\n\n/**\n * Get all path operator names.\n */\nexport function getPathOperators(): string[] {\n return Object.keys(PATH_OPERATORS);\n}\n"]}
|
package/dist/modules/prob.d.ts
CHANGED
package/dist/modules/str.d.ts
CHANGED
package/dist/modules/tensor.d.ts
CHANGED
package/dist/modules/time.d.ts
CHANGED
package/dist/modules/train.d.ts
CHANGED
package/dist/modules/vector.d.ts
CHANGED
package/dist/registry.d.ts
CHANGED
package/dist/registry.js
CHANGED
|
@@ -23,7 +23,9 @@ var STD_MODULES = [
|
|
|
23
23
|
"geo",
|
|
24
24
|
"grid",
|
|
25
25
|
"anim",
|
|
26
|
-
"ease"
|
|
26
|
+
"ease",
|
|
27
|
+
"noise",
|
|
28
|
+
"path"
|
|
27
29
|
];
|
|
28
30
|
function getModuleFromOperator(operator) {
|
|
29
31
|
const parts = operator.split("/");
|
|
@@ -5243,6 +5245,96 @@ var EASE_OPERATORS = {
|
|
|
5243
5245
|
}
|
|
5244
5246
|
};
|
|
5245
5247
|
|
|
5248
|
+
// modules/noise.ts
|
|
5249
|
+
var NOISE_OPERATORS = {
|
|
5250
|
+
"noise/perlin": {
|
|
5251
|
+
module: "noise",
|
|
5252
|
+
category: "std-noise",
|
|
5253
|
+
minArity: 2,
|
|
5254
|
+
maxArity: 3,
|
|
5255
|
+
description: "2D Perlin noise at (x,y) with optional seed; output [-1,1]",
|
|
5256
|
+
hasSideEffects: false,
|
|
5257
|
+
returnType: "number",
|
|
5258
|
+
params: [
|
|
5259
|
+
{ name: "x", type: "number", description: "X coordinate" },
|
|
5260
|
+
{ name: "y", type: "number", description: "Y coordinate" },
|
|
5261
|
+
{ name: "seed", type: "number", description: "Optional integer seed (default 0)", optional: true }
|
|
5262
|
+
],
|
|
5263
|
+
example: '["noise/perlin", 1.5, 2.5, 0] // => coherent value in [-1,1]'
|
|
5264
|
+
},
|
|
5265
|
+
"noise/simplex": {
|
|
5266
|
+
module: "noise",
|
|
5267
|
+
category: "std-noise",
|
|
5268
|
+
minArity: 2,
|
|
5269
|
+
maxArity: 3,
|
|
5270
|
+
description: "Value-coherent noise (perlin-derived) at (x,y) with optional seed; output [-1,1]",
|
|
5271
|
+
hasSideEffects: false,
|
|
5272
|
+
returnType: "number",
|
|
5273
|
+
params: [
|
|
5274
|
+
{ name: "x", type: "number", description: "X coordinate" },
|
|
5275
|
+
{ name: "y", type: "number", description: "Y coordinate" },
|
|
5276
|
+
{ name: "seed", type: "number", description: "Optional integer seed (default 0)", optional: true }
|
|
5277
|
+
],
|
|
5278
|
+
example: '["noise/simplex", 1.5, 2.5, 0] // => coherent value in [-1,1]'
|
|
5279
|
+
},
|
|
5280
|
+
"noise/fbm": {
|
|
5281
|
+
module: "noise",
|
|
5282
|
+
category: "std-noise",
|
|
5283
|
+
minArity: 3,
|
|
5284
|
+
maxArity: 4,
|
|
5285
|
+
description: "Fractal Brownian motion: summed perlin octaves (clamped 1..8); output [-1,1]",
|
|
5286
|
+
hasSideEffects: false,
|
|
5287
|
+
returnType: "number",
|
|
5288
|
+
params: [
|
|
5289
|
+
{ name: "x", type: "number", description: "X coordinate" },
|
|
5290
|
+
{ name: "y", type: "number", description: "Y coordinate" },
|
|
5291
|
+
{ name: "octaves", type: "number", description: "Octave count (floored, clamped to 1..8)" },
|
|
5292
|
+
{ name: "seed", type: "number", description: "Optional integer seed (default 0)", optional: true }
|
|
5293
|
+
],
|
|
5294
|
+
example: '["noise/fbm", 1.5, 2.5, 4, 0] // => layered value in [-1,1]'
|
|
5295
|
+
}
|
|
5296
|
+
};
|
|
5297
|
+
|
|
5298
|
+
// modules/path.ts
|
|
5299
|
+
var PATH_OPERATORS = {
|
|
5300
|
+
"path/astar": {
|
|
5301
|
+
module: "path",
|
|
5302
|
+
category: "std-path",
|
|
5303
|
+
minArity: 5,
|
|
5304
|
+
maxArity: 6,
|
|
5305
|
+
description: "A* shortest path on a w\xD7h grid; returns cells start\u2192goal (incl. both) or [] if none",
|
|
5306
|
+
hasSideEffects: false,
|
|
5307
|
+
returnType: "array",
|
|
5308
|
+
params: [
|
|
5309
|
+
{ name: "start", type: "vector", description: "Start cell {x,y}" },
|
|
5310
|
+
{ name: "goal", type: "vector", description: "Goal cell {x,y}" },
|
|
5311
|
+
{ name: "blocked", type: { kind: "array", of: "vector" }, description: "Blocked cells [{x,y}, ...]" },
|
|
5312
|
+
{ name: "w", type: "number", description: "Grid width (x in [0,w))" },
|
|
5313
|
+
{ name: "h", type: "number", description: "Grid height (y in [0,h))" },
|
|
5314
|
+
{ name: "diagonal", type: "boolean", description: "Allow 8-direction moves (default false)", optional: true }
|
|
5315
|
+
],
|
|
5316
|
+
example: '["path/astar", {"x":0,"y":0}, {"x":2,"y":0}, [], 3, 1] // => [{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0}]'
|
|
5317
|
+
},
|
|
5318
|
+
"path/reachable": {
|
|
5319
|
+
module: "path",
|
|
5320
|
+
category: "std-path",
|
|
5321
|
+
minArity: 5,
|
|
5322
|
+
maxArity: 6,
|
|
5323
|
+
description: "BFS cells reachable within N moves from start (incl. start); sorted row-major",
|
|
5324
|
+
hasSideEffects: false,
|
|
5325
|
+
returnType: "array",
|
|
5326
|
+
params: [
|
|
5327
|
+
{ name: "start", type: "vector", description: "Start cell {x,y}" },
|
|
5328
|
+
{ name: "steps", type: "number", description: "Maximum number of moves" },
|
|
5329
|
+
{ name: "blocked", type: { kind: "array", of: "vector" }, description: "Blocked cells [{x,y}, ...]" },
|
|
5330
|
+
{ name: "w", type: "number", description: "Grid width (x in [0,w))" },
|
|
5331
|
+
{ name: "h", type: "number", description: "Grid height (y in [0,h))" },
|
|
5332
|
+
{ name: "diagonal", type: "boolean", description: "Allow 8-direction moves (default false)", optional: true }
|
|
5333
|
+
],
|
|
5334
|
+
example: '["path/reachable", {"x":1,"y":1}, 1, [], 3, 3, false] // => 5 cross-shaped cells, row-major'
|
|
5335
|
+
}
|
|
5336
|
+
};
|
|
5337
|
+
|
|
5246
5338
|
// registry.ts
|
|
5247
5339
|
var STD_OPERATORS = {
|
|
5248
5340
|
...CORE_OPERATORS,
|
|
@@ -5265,7 +5357,9 @@ var STD_OPERATORS = {
|
|
|
5265
5357
|
...GEO_OPERATORS,
|
|
5266
5358
|
...GRID_OPERATORS,
|
|
5267
5359
|
...ANIM_OPERATORS,
|
|
5268
|
-
...EASE_OPERATORS
|
|
5360
|
+
...EASE_OPERATORS,
|
|
5361
|
+
...NOISE_OPERATORS,
|
|
5362
|
+
...PATH_OPERATORS
|
|
5269
5363
|
};
|
|
5270
5364
|
var OPERATOR_NAMES = Object.keys(STD_OPERATORS);
|
|
5271
5365
|
var STD_OPERATORS_BY_MODULE = {
|
|
@@ -5289,7 +5383,9 @@ var STD_OPERATORS_BY_MODULE = {
|
|
|
5289
5383
|
geo: GEO_OPERATORS,
|
|
5290
5384
|
grid: GRID_OPERATORS,
|
|
5291
5385
|
anim: ANIM_OPERATORS,
|
|
5292
|
-
ease: EASE_OPERATORS
|
|
5386
|
+
ease: EASE_OPERATORS,
|
|
5387
|
+
noise: NOISE_OPERATORS,
|
|
5388
|
+
path: PATH_OPERATORS
|
|
5293
5389
|
};
|
|
5294
5390
|
function getStdOperatorMeta(operator) {
|
|
5295
5391
|
return STD_OPERATORS[operator];
|