@almadar/std 3.14.1 → 5.0.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.
Files changed (43) hide show
  1. package/behaviors/exports/validation-report.json +2 -2
  2. package/dist/behaviors/exports/validation-report.json +2 -2
  3. package/dist/behaviors/exports-reader.js +71 -122
  4. package/dist/behaviors/exports-reader.js.map +1 -1
  5. package/dist/behaviors/functions/index.d.ts +10 -4
  6. package/dist/behaviors/functions/index.js +71 -122
  7. package/dist/behaviors/functions/index.js.map +1 -1
  8. package/dist/behaviors/index.js +71 -122
  9. package/dist/behaviors/index.js.map +1 -1
  10. package/dist/behaviors/query.js +71 -122
  11. package/dist/behaviors/query.js.map +1 -1
  12. package/dist/exports/validation-report.json +2 -2
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.js +176 -125
  15. package/dist/index.js.map +1 -1
  16. package/dist/modules/agent.d.ts +1 -1
  17. package/dist/modules/array.d.ts +1 -1
  18. package/dist/modules/async.d.ts +1 -1
  19. package/dist/modules/composition.d.ts +27 -0
  20. package/dist/modules/composition.js +98 -0
  21. package/dist/modules/composition.js.map +1 -0
  22. package/dist/modules/contract.d.ts +1 -1
  23. package/dist/modules/data.d.ts +1 -1
  24. package/dist/modules/format.d.ts +1 -1
  25. package/dist/modules/graph.d.ts +1 -1
  26. package/dist/modules/index.d.ts +2 -1
  27. package/dist/modules/index.js +96 -1
  28. package/dist/modules/index.js.map +1 -1
  29. package/dist/modules/math.d.ts +1 -1
  30. package/dist/modules/nn.d.ts +1 -1
  31. package/dist/modules/object.d.ts +1 -1
  32. package/dist/modules/os.d.ts +1 -1
  33. package/dist/modules/prob.d.ts +1 -1
  34. package/dist/modules/str.d.ts +1 -1
  35. package/dist/modules/tensor.d.ts +1 -1
  36. package/dist/modules/time.d.ts +1 -1
  37. package/dist/modules/train.d.ts +1 -1
  38. package/dist/modules/validate.d.ts +1 -1
  39. package/dist/registry.d.ts +1 -1
  40. package/dist/registry.js +98 -3
  41. package/dist/registry.js.map +1 -1
  42. package/dist/{types-BjP5nVQd.d.ts → types-BGtQuBge.d.ts} +5 -3
  43. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
1
  [
2
2
  {
3
- "name": "std-agent-pipeline",
3
+ "name": "std-cart",
4
4
  "errors": 0,
5
5
  "warnings": 0,
6
6
  "output": [
7
7
  "Loaded 22 services from packages/almadar-patterns/src/services-registry.json",
8
- "Validating schema: /home/osamah/kflow.ai.builder/packages/almadar-std/behaviors/exports/organisms/std-agent-pipeline.orb"
8
+ "Validating schema: /home/osamah/kflow.ai.builder/packages/almadar-std/behaviors/exports/molecules/std-cart.orb"
9
9
  ]
10
10
  }
11
11
  ]
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as StdModule, a as StdOperatorMeta } from './types-BjP5nVQd.js';
2
- export { b as STD_MODULES, c as STD_OPERATOR_CATEGORIES, d as StdOperatorCategory, g as getFunctionFromOperator, e as getModuleFromOperator, i as isStdCategory, f as isStdOperator, m as makeStdOperator } from './types-BjP5nVQd.js';
1
+ import { S as StdModule, a as StdOperatorMeta } from './types-BGtQuBge.js';
2
+ export { b as STD_MODULES, c as STD_OPERATOR_CATEGORIES, d as StdOperatorCategory, g as getFunctionFromOperator, e as getModuleFromOperator, i as isStdCategory, f as isStdOperator, m as makeStdOperator } from './types-BGtQuBge.js';
3
3
  export { STD_OPERATORS, STD_OPERATORS_BY_MODULE, getAllStdOperators, getLambdaOperators, getModuleOperators, getOperatorMetaExtended, getStdEffectOperators, getStdLibStats, getStdOperatorMeta, getStdOperatorsByModule, getStdPureOperators, isEffectOperatorExtended, isKnownOperatorExtended, isKnownStdOperator, isStdEffectOperator, isStdGuardOperator, validateOperatorArityExtended, validateStdOperatorArity } from './registry.js';
4
4
  export { MATH_OPERATORS } from './modules/math.js';
5
5
  export { STR_OPERATORS } from './modules/str.js';
package/dist/index.js CHANGED
@@ -25,7 +25,8 @@ var STD_MODULES = [
25
25
  "agent",
26
26
  "graph",
27
27
  "contract",
28
- "data"
28
+ "data",
29
+ "composition"
29
30
  ];
30
31
  var STD_OPERATOR_CATEGORIES = [
31
32
  "std-math",
@@ -42,6 +43,7 @@ var STD_OPERATOR_CATEGORIES = [
42
43
  "std-prob",
43
44
  "std-os",
44
45
  "std-agent",
46
+ "std-composition",
45
47
  "ml-arch",
46
48
  "ml-effect",
47
49
  "ml-tensor",
@@ -3841,6 +3843,98 @@ var AGENT_OPERATORS = {
3841
3843
  }
3842
3844
  };
3843
3845
 
3846
+ // modules/composition.ts
3847
+ var COMPOSITION_OPERATORS = {
3848
+ "behavior/compose": {
3849
+ module: "composition",
3850
+ category: "std-composition",
3851
+ minArity: 1,
3852
+ maxArity: 1,
3853
+ description: "Compose N orbitals into one application schema. Wires events, picks layout, generates pages.",
3854
+ hasSideEffects: false,
3855
+ compileTime: true,
3856
+ returnType: "object",
3857
+ params: [
3858
+ {
3859
+ name: "config",
3860
+ type: "object",
3861
+ description: "ComposeBehaviorsInput: { appName, orbitals[], layoutStrategy?, eventWiring?, entityMappings? }"
3862
+ }
3863
+ ],
3864
+ example: '(behavior/compose { appName: "ShoppingApp" orbitals: [...] })'
3865
+ },
3866
+ "behavior/wire": {
3867
+ module: "composition",
3868
+ category: "std-composition",
3869
+ minArity: 2,
3870
+ maxArity: 2,
3871
+ description: "Apply cross-orbital event wiring. Adds external emits/listens to inline traits.",
3872
+ hasSideEffects: false,
3873
+ compileTime: true,
3874
+ returnType: "array",
3875
+ params: [
3876
+ {
3877
+ name: "orbitals",
3878
+ type: "array",
3879
+ description: "Array of OrbitalDefinition to wire"
3880
+ },
3881
+ {
3882
+ name: "wiring",
3883
+ type: "array",
3884
+ description: "Array of EventWiringEntry { from, event, to, triggers }"
3885
+ }
3886
+ ],
3887
+ example: "(behavior/wire orbitals wiring)"
3888
+ },
3889
+ "behavior/detect-layout": {
3890
+ module: "composition",
3891
+ category: "std-composition",
3892
+ minArity: 1,
3893
+ maxArity: 2,
3894
+ description: "Auto-detect layout from orbital count and wiring topology. Returns single, tabs, sidebar, dashboard, or wizard-flow.",
3895
+ hasSideEffects: false,
3896
+ compileTime: true,
3897
+ returnType: "string",
3898
+ params: [
3899
+ {
3900
+ name: "orbitals",
3901
+ type: "array",
3902
+ description: "Array of OrbitalDefinition"
3903
+ },
3904
+ {
3905
+ name: "wiring",
3906
+ type: "array",
3907
+ description: "Optional EventWiringEntry array",
3908
+ optional: true
3909
+ }
3910
+ ],
3911
+ example: "(behavior/detect-layout orbitals)"
3912
+ },
3913
+ "behavior/pipe": {
3914
+ module: "composition",
3915
+ category: "std-composition",
3916
+ minArity: 2,
3917
+ maxArity: null,
3918
+ description: "Left-to-right composition. Each step receives the previous result as its first arg.",
3919
+ hasSideEffects: false,
3920
+ compileTime: true,
3921
+ returnType: "any",
3922
+ params: [
3923
+ {
3924
+ name: "seed",
3925
+ type: "any",
3926
+ description: "Initial value to pipe through steps"
3927
+ },
3928
+ {
3929
+ name: "...steps",
3930
+ type: "function[]",
3931
+ description: "Functions, each receiving the previous result as first argument"
3932
+ }
3933
+ ],
3934
+ example: '(behavior/pipe orbitals (behavior/wire wiring) (behavior/compose { appName: "X" }))'
3935
+ }
3936
+ };
3937
+
3844
3938
  // registry.ts
3845
3939
  var STD_OPERATORS = {
3846
3940
  ...MATH_OPERATORS,
@@ -3856,7 +3950,8 @@ var STD_OPERATORS = {
3856
3950
  ...TRAIN_OPERATORS,
3857
3951
  ...PROB_OPERATORS,
3858
3952
  ...OS_OPERATORS,
3859
- ...AGENT_OPERATORS
3953
+ ...AGENT_OPERATORS,
3954
+ ...COMPOSITION_OPERATORS
3860
3955
  };
3861
3956
  var STD_OPERATORS_BY_MODULE = {
3862
3957
  math: MATH_OPERATORS,
@@ -3872,7 +3967,8 @@ var STD_OPERATORS_BY_MODULE = {
3872
3967
  train: TRAIN_OPERATORS,
3873
3968
  prob: PROB_OPERATORS,
3874
3969
  os: OS_OPERATORS,
3875
- agent: AGENT_OPERATORS
3970
+ agent: AGENT_OPERATORS,
3971
+ composition: COMPOSITION_OPERATORS
3876
3972
  };
3877
3973
  function getStdOperatorMeta(operator) {
3878
3974
  return STD_OPERATORS[operator];
@@ -4689,19 +4785,14 @@ function buildTrait(c) {
4689
4785
  const actionEvents = /* @__PURE__ */ new Set();
4690
4786
  for (const a of c.headerActions) actionEvents.add(a.event);
4691
4787
  for (const a of c.itemActions) actionEvents.add(a.event);
4692
- for (const re of c.refreshEvents) actionEvents.add(re);
4693
4788
  const events = [
4694
4789
  { key: "INIT", name: "Initialize" },
4695
4790
  ...Array.from(actionEvents).map((e) => {
4696
4791
  const needsId = c.itemActions.some((a) => a.event === e);
4697
- const isRefresh = c.refreshEvents.includes(e);
4698
- if (isRefresh) {
4699
- return { key: e, name: e, payload: [{ name: "data", type: "object", required: true }] };
4700
- }
4701
4792
  return needsId ? { key: e, name: e, payload: [{ name: "id", type: "string", required: true }, { name: "row", type: "object" }] } : { key: e, name: e };
4702
4793
  })
4703
4794
  ];
4704
- const listensDecl = c.refreshEvents.length > 0 ? c.refreshEvents.map((evt) => ({ event: evt, triggers: evt })) : void 0;
4795
+ const listensDecl = c.refreshEvents.length > 0 ? c.refreshEvents.map((evt) => ({ event: evt, triggers: "INIT" })) : void 0;
4705
4796
  return {
4706
4797
  name: c.traitName,
4707
4798
  linkedEntity: entityName,
@@ -4738,14 +4829,7 @@ function buildTrait(c) {
4738
4829
  ]
4739
4830
  }]
4740
4831
  ]
4741
- },
4742
- // Refresh self-loops: when modal atoms fire SAVE etc., re-fetch data
4743
- ...c.refreshEvents.map((evt) => ({
4744
- from: "browsing",
4745
- to: "browsing",
4746
- event: evt,
4747
- effects: [["ref", entityName]]
4748
- }))
4832
+ }
4749
4833
  ]
4750
4834
  }
4751
4835
  };
@@ -4803,6 +4887,8 @@ function resolve2(params) {
4803
4887
  }
4804
4888
  ]
4805
4889
  };
4890
+ const saveEvent = params.saveEvent ?? "SAVE";
4891
+ const emitOnSave = params.emitOnSave ?? saveEvent;
4806
4892
  return {
4807
4893
  entityName,
4808
4894
  fields,
@@ -4816,9 +4902,9 @@ function resolve2(params) {
4816
4902
  openPayload: params.openPayload ?? [],
4817
4903
  closeEvent: params.closeEvent ?? "CLOSE",
4818
4904
  openEffects: params.openEffects ?? [],
4819
- saveEvent: params.saveEvent ?? null,
4905
+ saveEvent,
4820
4906
  saveEffects: params.saveEffects ?? [],
4821
- emitOnSave: params.emitOnSave ?? null,
4907
+ emitOnSave,
4822
4908
  standalone: params.standalone ?? true,
4823
4909
  pageName: params.pageName ?? `${entityName}ModalPage`,
4824
4910
  pagePath: params.pagePath ?? `/${p.toLowerCase()}/modal`,
@@ -4832,11 +4918,9 @@ function buildTrait2(c) {
4832
4918
  const events = [
4833
4919
  { key: "INIT", name: "Initialize" },
4834
4920
  { key: c.openEvent, name: "Open", ...c.openPayload.length > 0 ? { payload: c.openPayload } : {} },
4835
- { key: c.closeEvent, name: "Close" }
4921
+ { key: c.closeEvent, name: "Close" },
4922
+ { key: c.saveEvent, name: "Save", payload: [{ name: "data", type: "object", required: true }] }
4836
4923
  ];
4837
- if (c.saveEvent) {
4838
- events.push({ key: c.saveEvent, name: "Save", payload: [{ name: "data", type: "object", required: true }] });
4839
- }
4840
4924
  const transitions = [
4841
4925
  // INIT: closed → closed
4842
4926
  {
@@ -4889,41 +4973,44 @@ function buildTrait2(c) {
4889
4973
  }]] : []
4890
4974
  ] }
4891
4975
  ];
4892
- if (c.saveEvent) {
4893
- const mainRefresh = c.standalone ? [["ref", c.entityName], ["render-ui", "main", {
4894
- type: "stack",
4895
- direction: "vertical",
4896
- gap: "lg",
4897
- children: [
4898
- { type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [
4899
- { type: "stack", direction: "horizontal", gap: "md", children: [
4900
- { type: "icon", name: c.headerIcon, size: "lg" },
4901
- { type: "typography", content: c.modalTitle, variant: "h2" }
4902
- ] },
4903
- { type: "button", label: "Open", event: c.openEvent, variant: "primary", icon: c.headerIcon }
4976
+ const mainRefresh = c.standalone ? [["ref", c.entityName], ["render-ui", "main", {
4977
+ type: "stack",
4978
+ direction: "vertical",
4979
+ gap: "lg",
4980
+ children: [
4981
+ { type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [
4982
+ { type: "stack", direction: "horizontal", gap: "md", children: [
4983
+ { type: "icon", name: c.headerIcon, size: "lg" },
4984
+ { type: "typography", content: c.modalTitle, variant: "h2" }
4904
4985
  ] },
4905
- { type: "divider" },
4906
- { type: "empty-state", icon: c.headerIcon, title: "Nothing open", description: "Click Open to view details in a modal overlay." }
4907
- ]
4908
- }]] : [];
4909
- transitions.push({
4910
- from: "open",
4911
- to: "closed",
4912
- event: c.saveEvent,
4913
- effects: [
4914
- ...c.saveEffects,
4915
- ["render-ui", "modal", null],
4916
- // Emit after persist succeeds so browse traits can fetch fresh data
4917
- ...c.emitOnSave ? [["emit", c.emitOnSave]] : [],
4918
- ...mainRefresh
4919
- ]
4920
- });
4921
- }
4986
+ { type: "button", label: "Open", event: c.openEvent, variant: "primary", icon: c.headerIcon }
4987
+ ] },
4988
+ { type: "divider" },
4989
+ { type: "empty-state", icon: c.headerIcon, title: "Nothing open", description: "Click Open to view details in a modal overlay." }
4990
+ ]
4991
+ }]] : [];
4992
+ transitions.push({
4993
+ from: "open",
4994
+ to: "closed",
4995
+ event: c.saveEvent,
4996
+ effects: [
4997
+ ...c.saveEffects,
4998
+ ["render-ui", "modal", null],
4999
+ // Emit after persist succeeds so browse traits can fetch fresh data.
5000
+ // Skip the emit when emitOnSave equals saveEvent — that's a self-emit
5001
+ // that the runtime would short-circuit anyway, and avoids double
5002
+ // dispatch on every save.
5003
+ ...c.emitOnSave !== c.saveEvent ? [["emit", c.emitOnSave]] : [],
5004
+ ...mainRefresh
5005
+ ]
5006
+ });
4922
5007
  return {
4923
5008
  name: c.traitName,
4924
5009
  linkedEntity: c.entityName,
4925
5010
  category: "interaction",
4926
- ...c.emitOnSave ? { emits: [{ event: c.emitOnSave }] } : {},
5011
+ // Phase F.10: emits[] is always populated (default emitOnSave = saveEvent).
5012
+ // If a molecule supplies a distinct emitOnSave, declare both events.
5013
+ emits: c.emitOnSave === c.saveEvent ? [{ event: c.saveEvent }] : [{ event: c.saveEvent }, { event: c.emitOnSave }],
4927
5014
  stateMachine: {
4928
5015
  states: [{ name: "closed", isInitial: true }, { name: "open" }],
4929
5016
  events,
@@ -4952,6 +5039,8 @@ function resolve3(params) {
4952
5039
  const fields = ensureIdField(params.fields);
4953
5040
  const nonIdFields = fields.filter((f) => f.name !== "id");
4954
5041
  const p = plural(entityName);
5042
+ const confirmEvent = params.confirmEvent ?? "CONFIRM";
5043
+ const emitOnConfirm = params.emitOnConfirm ?? confirmEvent;
4955
5044
  return {
4956
5045
  entityName,
4957
5046
  fields,
@@ -4965,9 +5054,9 @@ function resolve3(params) {
4965
5054
  cancelLabel: params.cancelLabel ?? "Cancel",
4966
5055
  headerIcon: params.headerIcon ?? "shield-check",
4967
5056
  requestEvent: params.requestEvent ?? "REQUEST",
4968
- confirmEvent: params.confirmEvent ?? "CONFIRM",
5057
+ confirmEvent,
4969
5058
  confirmEffects: params.confirmEffects ?? [],
4970
- emitOnConfirm: params.emitOnConfirm ?? null,
5059
+ emitOnConfirm,
4971
5060
  standalone: params.standalone ?? true,
4972
5061
  pageName: params.pageName ?? `${entityName}ConfirmPage`,
4973
5062
  pagePath: params.pagePath ?? `/${p.toLowerCase()}/confirm`,
@@ -5047,7 +5136,9 @@ function buildTrait3(c) {
5047
5136
  name: c.traitName,
5048
5137
  linkedEntity: entityName,
5049
5138
  category: "interaction",
5050
- ...c.emitOnConfirm ? { emits: [{ event: c.emitOnConfirm }] } : {},
5139
+ // Phase F.10: emits[] always populated. When emitOnConfirm equals
5140
+ // confirmEvent, declare just the one. When they differ, declare both.
5141
+ emits: c.emitOnConfirm === c.confirmEvent ? [{ event: c.confirmEvent }] : [{ event: c.confirmEvent }, { event: c.emitOnConfirm }],
5051
5142
  stateMachine: {
5052
5143
  states: [
5053
5144
  { name: "idle", isInitial: true },
@@ -5084,7 +5175,9 @@ function buildTrait3(c) {
5084
5175
  effects: [
5085
5176
  ...c.confirmEffects,
5086
5177
  ...dismissAndRefresh,
5087
- ...c.emitOnConfirm ? [["emit", c.emitOnConfirm]] : []
5178
+ // Skip self-emit when emitOnConfirm == confirmEvent (the runtime
5179
+ // would short-circuit anyway).
5180
+ ...c.emitOnConfirm !== c.confirmEvent ? [["emit", c.emitOnConfirm]] : []
5088
5181
  ]
5089
5182
  },
5090
5183
  {
@@ -12943,6 +13036,7 @@ function stdList(params) {
12943
13036
  const UPPER = entityName.replace(/([a-z])([A-Z])/g, "$1_$2").toUpperCase();
12944
13037
  const CREATED = `${UPPER}_CREATED`;
12945
13038
  const UPDATED = `${UPPER}_UPDATED`;
13039
+ const DELETED = `${UPPER}_DELETED`;
12946
13040
  const browseTrait = extractTrait(stdBrowse({
12947
13041
  entityName,
12948
13042
  fields,
@@ -12963,7 +13057,7 @@ function stdList(params) {
12963
13057
  { label: "Edit", event: "EDIT" },
12964
13058
  { label: "Delete", event: "DELETE", variant: "danger" }
12965
13059
  ],
12966
- refreshEvents: [CREATED, UPDATED]
13060
+ refreshEvents: [CREATED, UPDATED, DELETED]
12967
13061
  }));
12968
13062
  const createTrait = extractTrait(stdModal({
12969
13063
  standalone: false,
@@ -13009,62 +13103,20 @@ function stdList(params) {
13009
13103
  closeEvent: "CLOSE",
13010
13104
  openEffects: [["fetch", entityName, { id: "@payload.id" }]]
13011
13105
  }));
13012
- const sm = browseTrait.stateMachine;
13013
- sm.states.push({ name: "deleting" });
13014
- const deleteEvent = sm.events.find((e) => e.key === "DELETE");
13015
- if (deleteEvent && !deleteEvent.payload) {
13016
- deleteEvent.payload = [{ name: "id", type: "string" }, { name: "row", type: "object" }];
13017
- }
13018
- const existingKeys = new Set(sm.events.map((e) => e.key));
13019
- if (!existingKeys.has("CONFIRM_DELETE")) sm.events.push({ key: "CONFIRM_DELETE", name: "Confirm Delete" });
13020
- if (!existingKeys.has("CANCEL")) sm.events.push({ key: "CANCEL", name: "Cancel" });
13021
- if (!existingKeys.has("CLOSE")) sm.events.push({ key: "CLOSE", name: "Close" });
13022
- const initTransition = sm.transitions[0];
13023
- const initRenderEffect = initTransition.effects.find(
13024
- (e) => Array.isArray(e) && e[0] === "render-ui" && e[1] === "main"
13025
- );
13026
- const browseMainView = initRenderEffect ? initRenderEffect[2] : null;
13027
- sm.transitions.push(
13028
- // DELETE: browsing → deleting (fetch entity by ID, show confirmation modal)
13029
- { from: "browsing", to: "deleting", event: "DELETE", effects: [
13030
- ["fetch", entityName, { id: "@payload.id" }],
13031
- ["render-ui", "modal", {
13032
- type: "stack",
13033
- direction: "vertical",
13034
- gap: "md",
13035
- children: [
13036
- { type: "stack", direction: "horizontal", gap: "sm", children: [
13037
- { type: "icon", name: "trash-2", size: "md" },
13038
- { type: "typography", content: `Delete ${entityName}`, variant: "h3" }
13039
- ] },
13040
- { type: "divider" },
13041
- { type: "typography", content: `@entity.${c.nonIdFields[0]?.name ?? "name"}`, variant: "h4" },
13042
- { type: "typography", content: c.deleteMessage, variant: "body" },
13043
- { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [
13044
- { type: "button", label: "Cancel", event: "CANCEL", variant: "ghost" },
13045
- { type: "button", label: "Delete", event: "CONFIRM_DELETE", variant: "danger", icon: "trash" }
13046
- ] }
13047
- ]
13048
- }]
13049
- ] },
13050
- // CONFIRM_DELETE: deleting → browsing (persist delete, dismiss modal, re-render main)
13051
- { from: "deleting", to: "browsing", event: "CONFIRM_DELETE", effects: [
13052
- ["persist", "delete", entityName, "@entity.id"],
13053
- ["render-ui", "modal", null],
13054
- ["render-ui", "main", browseMainView]
13055
- ] },
13056
- // CANCEL/CLOSE from deleting (dismiss modal, re-render main)
13057
- { from: "deleting", to: "browsing", event: "CANCEL", effects: [
13058
- ["render-ui", "modal", null],
13059
- ["fetch", entityName],
13060
- ["render-ui", "main", browseMainView]
13061
- ] },
13062
- { from: "deleting", to: "browsing", event: "CLOSE", effects: [
13063
- ["render-ui", "modal", null],
13064
- ["fetch", entityName],
13065
- ["render-ui", "main", browseMainView]
13066
- ] }
13067
- );
13106
+ const deleteTrait = extractTrait(stdConfirmation({
13107
+ standalone: false,
13108
+ entityName,
13109
+ fields,
13110
+ traitName: `${entityName}Delete`,
13111
+ confirmTitle: `Delete ${entityName}`,
13112
+ confirmMessage: c.deleteMessage,
13113
+ confirmLabel: "Delete",
13114
+ headerIcon: "trash-2",
13115
+ requestEvent: "DELETE",
13116
+ confirmEvent: "CONFIRM_DELETE",
13117
+ confirmEffects: [["persist", "delete", entityName, "@entity.pendingId"]],
13118
+ emitOnConfirm: DELETED
13119
+ }));
13068
13120
  const entity = makeEntity({ name: entityName, fields, persistence: c.persistence, collection: c.collection });
13069
13121
  const page = {
13070
13122
  name: c.pageName,
@@ -13074,13 +13126,14 @@ function stdList(params) {
13074
13126
  { ref: browseTrait.name },
13075
13127
  { ref: createTrait.name },
13076
13128
  { ref: editTrait.name },
13077
- { ref: viewTrait.name }
13129
+ { ref: viewTrait.name },
13130
+ { ref: deleteTrait.name }
13078
13131
  ]
13079
13132
  };
13080
13133
  return {
13081
13134
  name: `${entityName}Orbital`,
13082
13135
  entity,
13083
- traits: [browseTrait, createTrait, editTrait, viewTrait],
13136
+ traits: [browseTrait, createTrait, editTrait, viewTrait, deleteTrait],
13084
13137
  pages: [page]
13085
13138
  };
13086
13139
  }
@@ -13568,17 +13621,9 @@ function stdInventory(params) {
13568
13621
  headerIcon: "trash-2",
13569
13622
  requestEvent: "DROP",
13570
13623
  confirmEvent: "CONFIRM_DROP",
13571
- confirmEffects: [["persist", "delete", entityName, "@payload.id"]],
13624
+ confirmEffects: [["persist", "delete", entityName, "@entity.pendingId"]],
13572
13625
  emitOnConfirm: "CONFIRM_DROP"
13573
13626
  }));
13574
- const dropSm = dropTrait.stateMachine;
13575
- if (dropSm && "events" in dropSm) {
13576
- const events = dropSm.events;
13577
- const confirmDropEvt = events.find((e) => e.key === "CONFIRM_DROP");
13578
- if (confirmDropEvt && !confirmDropEvt.payload) {
13579
- confirmDropEvt.payload = [{ name: "id", type: "string", required: true }];
13580
- }
13581
- }
13582
13627
  const instances = [
13583
13628
  { id: "item-1", name: "Health Potion", description: "Restores 50 HP", status: "active", pendingId: "" },
13584
13629
  { id: "item-2", name: "Iron Sword", description: "A sturdy blade", status: "active", pendingId: "" },
@@ -32348,6 +32393,12 @@ var MODULE_DESCRIPTIONS = {
32348
32393
  displayName: "Agent Intelligence",
32349
32394
  description: "Agent memory management, LLM access, tool invocation, context management, and session control.",
32350
32395
  icon: "\u{1F916}"
32396
+ },
32397
+ composition: {
32398
+ name: "Composition",
32399
+ displayName: "Behavior Composition",
32400
+ description: "Compile-time operators for composing N orbitals into a single application schema.",
32401
+ icon: "\u{1F9E9}"
32351
32402
  }
32352
32403
  };
32353
32404
  var BEHAVIOR_GROUPINGS = {