@almadar/std 6.5.0 → 6.5.2
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.d.ts +2 -2
- package/dist/index.js +123 -2
- package/dist/index.js.map +1 -1
- package/dist/modules/agent.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/core.js +123 -2
- package/dist/modules/core.js.map +1 -1
- package/dist/modules/data.d.ts +1 -1
- package/dist/modules/format.d.ts +1 -1
- package/dist/modules/graph.d.ts +1 -1
- package/dist/modules/index.d.ts +1 -1
- package/dist/modules/index.js +123 -2
- 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/object.d.ts +1 -1
- package/dist/modules/os.d.ts +1 -1
- 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/registry.d.ts +1 -1
- package/dist/registry.js +123 -2
- package/dist/registry.js.map +1 -1
- package/dist/{types-DUr71Cgy.d.ts → types-D7dG8fBF.d.ts} +1 -1
- package/package.json +1 -1
package/dist/modules/math.d.ts
CHANGED
package/dist/modules/nn.d.ts
CHANGED
package/dist/modules/object.d.ts
CHANGED
package/dist/modules/os.d.ts
CHANGED
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/registry.d.ts
CHANGED
package/dist/registry.js
CHANGED
|
@@ -346,6 +346,10 @@ var CORE_OPERATORS = {
|
|
|
346
346
|
example: '["set", "@entity.health", 100]',
|
|
347
347
|
effect: {
|
|
348
348
|
kind: "set",
|
|
349
|
+
// success emit carries the written value; the evaluator coerces to the
|
|
350
|
+
// binding's declared type, so 'any' is the general shape. A future pass
|
|
351
|
+
// can narrow per-binding via resolveBinding.
|
|
352
|
+
produces: ANY,
|
|
349
353
|
config: { operation: SET_OPERATION }
|
|
350
354
|
}
|
|
351
355
|
},
|
|
@@ -385,7 +389,35 @@ var CORE_OPERATORS = {
|
|
|
385
389
|
{ name: "data", type: ENTITY_REF, description: "Payload (create/update) or entity id (delete)", optional: true }
|
|
386
390
|
],
|
|
387
391
|
example: '["persist", "create", "Task", { "title": "@payload.title" }]',
|
|
388
|
-
effect: {
|
|
392
|
+
effect: {
|
|
393
|
+
kind: "persist",
|
|
394
|
+
// Action-discriminated union. The compiler narrows at the call site
|
|
395
|
+
// based on the action arg literal to pick the right branch when
|
|
396
|
+
// checking the emit.success event's declared payload.
|
|
397
|
+
// create/update -> the resulting entity record
|
|
398
|
+
// delete/clear -> { id, deleted }
|
|
399
|
+
// batch -> summary of operations
|
|
400
|
+
produces: {
|
|
401
|
+
kind: "union",
|
|
402
|
+
of: [
|
|
403
|
+
{ kind: "entity" },
|
|
404
|
+
{
|
|
405
|
+
kind: "object",
|
|
406
|
+
fields: { id: STRING, deleted: BOOLEAN },
|
|
407
|
+
open: false
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
kind: "object",
|
|
411
|
+
fields: {
|
|
412
|
+
operations: { kind: "array", of: ANY },
|
|
413
|
+
completedCount: NUMBER,
|
|
414
|
+
totalCount: NUMBER
|
|
415
|
+
},
|
|
416
|
+
open: false
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
}
|
|
389
421
|
},
|
|
390
422
|
navigate: {
|
|
391
423
|
module: "core",
|
|
@@ -456,6 +488,89 @@ var CORE_OPERATORS = {
|
|
|
456
488
|
example: '["despawn", "@entity.id"]',
|
|
457
489
|
effect: { kind: "despawn" }
|
|
458
490
|
},
|
|
491
|
+
fetch: {
|
|
492
|
+
module: "core",
|
|
493
|
+
category: "effect",
|
|
494
|
+
minArity: 1,
|
|
495
|
+
maxArity: 2,
|
|
496
|
+
description: "Fetch an entity (by id) or a collection (by filter) from persistence",
|
|
497
|
+
hasSideEffects: true,
|
|
498
|
+
returnType: "void",
|
|
499
|
+
params: [
|
|
500
|
+
{ name: "entity", type: { kind: "entity" }, description: "Target entity name" },
|
|
501
|
+
{
|
|
502
|
+
name: "options",
|
|
503
|
+
type: {
|
|
504
|
+
kind: "object",
|
|
505
|
+
fields: {
|
|
506
|
+
id: STRING,
|
|
507
|
+
filter: ANY,
|
|
508
|
+
limit: NUMBER,
|
|
509
|
+
offset: NUMBER,
|
|
510
|
+
include: { kind: "array", of: STRING },
|
|
511
|
+
emit: { kind: "object", fields: {}, open: true }
|
|
512
|
+
},
|
|
513
|
+
open: true
|
|
514
|
+
},
|
|
515
|
+
description: "Fetch options: id | filter | limit | offset | include | emit",
|
|
516
|
+
optional: true
|
|
517
|
+
}
|
|
518
|
+
],
|
|
519
|
+
example: '["fetch", "Task", { "id": "@payload.taskId", "emit": { "success": "TASK_LOADED" } }]',
|
|
520
|
+
effect: {
|
|
521
|
+
kind: "fetch",
|
|
522
|
+
// Call-site-discriminated union: options.id present -> single entity;
|
|
523
|
+
// otherwise -> array of entity. The compiler narrows at the call site
|
|
524
|
+
// when checking emit.success against the declared event payload.
|
|
525
|
+
produces: {
|
|
526
|
+
kind: "union",
|
|
527
|
+
of: [
|
|
528
|
+
{ kind: "entity" },
|
|
529
|
+
{ kind: "array", of: { kind: "entity" } }
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
ref: {
|
|
535
|
+
module: "core",
|
|
536
|
+
category: "effect",
|
|
537
|
+
minArity: 1,
|
|
538
|
+
maxArity: 2,
|
|
539
|
+
description: "Reactive entity reference (deprecated, use fetch with listens in V2)",
|
|
540
|
+
hasSideEffects: true,
|
|
541
|
+
returnType: "void",
|
|
542
|
+
params: [
|
|
543
|
+
{ name: "entity", type: { kind: "entity" }, description: "Target entity name" },
|
|
544
|
+
{
|
|
545
|
+
name: "options",
|
|
546
|
+
type: {
|
|
547
|
+
kind: "object",
|
|
548
|
+
fields: {
|
|
549
|
+
id: STRING,
|
|
550
|
+
filter: ANY,
|
|
551
|
+
include: { kind: "array", of: STRING },
|
|
552
|
+
emit: { kind: "object", fields: {}, open: true }
|
|
553
|
+
},
|
|
554
|
+
open: true
|
|
555
|
+
},
|
|
556
|
+
description: "Ref options: id | filter | include | emit",
|
|
557
|
+
optional: true
|
|
558
|
+
}
|
|
559
|
+
],
|
|
560
|
+
example: '["ref", "Task"]',
|
|
561
|
+
effect: {
|
|
562
|
+
kind: "ref",
|
|
563
|
+
// Same call-site shape as fetch. Kept for the V2 transition period;
|
|
564
|
+
// scheduled for deprecation in a later phase (see Almadar_Entity_V2_Plan.md).
|
|
565
|
+
produces: {
|
|
566
|
+
kind: "union",
|
|
567
|
+
of: [
|
|
568
|
+
{ kind: "entity" },
|
|
569
|
+
{ kind: "array", of: { kind: "entity" } }
|
|
570
|
+
]
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
},
|
|
459
574
|
"call-service": {
|
|
460
575
|
module: "core",
|
|
461
576
|
category: "effect",
|
|
@@ -475,7 +590,13 @@ var CORE_OPERATORS = {
|
|
|
475
590
|
}
|
|
476
591
|
],
|
|
477
592
|
example: '["call-service", "llm", "generate", { "userPrompt": "@entity.inputText" }]',
|
|
478
|
-
effect: {
|
|
593
|
+
effect: {
|
|
594
|
+
kind: "call-service",
|
|
595
|
+
// TODO(entity-v2): narrow to the declared service return type once
|
|
596
|
+
// per-service return shapes live on the orbital services block.
|
|
597
|
+
// Today the emit.success payload is whatever the service adapter returns.
|
|
598
|
+
produces: ANY
|
|
599
|
+
}
|
|
479
600
|
},
|
|
480
601
|
"render-ui": {
|
|
481
602
|
module: "core",
|