@almadar/std 13.6.0 → 13.8.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 (174) hide show
  1. package/behaviors/registry/agent/atoms/std-agent-activity-log.orb +69 -69
  2. package/behaviors/registry/agent/atoms/std-agent-chat-thread.orb +120 -120
  3. package/behaviors/registry/agent/atoms/std-agent-classifier.orb +114 -114
  4. package/behaviors/registry/agent/atoms/std-agent-completion.orb +124 -114
  5. package/behaviors/registry/agent/atoms/std-agent-context-window.orb +410 -395
  6. package/behaviors/registry/agent/atoms/std-agent-conversation.orb +93 -93
  7. package/behaviors/registry/agent/atoms/std-agent-memory.orb +67 -117
  8. package/behaviors/registry/agent/atoms/std-agent-provider.orb +149 -134
  9. package/behaviors/registry/agent/atoms/std-agent-search.orb +64 -64
  10. package/behaviors/registry/agent/atoms/std-agent-session.orb +106 -106
  11. package/behaviors/registry/agent/atoms/std-agent-step-progress.orb +194 -189
  12. package/behaviors/registry/agent/atoms/std-agent-token-gauge.orb +360 -355
  13. package/behaviors/registry/agent/atoms/std-agent-tool-call.orb +69 -69
  14. package/behaviors/registry/agent/molecules/std-agent-fix-loop.orb +204 -199
  15. package/behaviors/registry/agent/molecules/std-agent-learner.orb +174 -174
  16. package/behaviors/registry/agent/molecules/std-agent-planner.orb +125 -125
  17. package/behaviors/registry/agent/molecules/std-agent-rag.orb +127 -109
  18. package/behaviors/registry/agent/molecules/std-agent-tool-loop.orb +190 -185
  19. package/behaviors/registry/agent/organisms/std-agent-assistant.orb +1209 -1155
  20. package/behaviors/registry/agent/organisms/std-agent-builder.orb +3021 -3001
  21. package/behaviors/registry/agent/organisms/std-agent-pipeline.orb +2184 -2249
  22. package/behaviors/registry/agent/organisms/std-agent-reviewer.orb +1029 -1050
  23. package/behaviors/registry/agent/organisms/std-agent-tutor.orb +842 -804
  24. package/behaviors/registry/app/organisms/std-cms.orb +547 -547
  25. package/behaviors/registry/core/atoms/std-browse.orb +36 -36
  26. package/behaviors/registry/core/atoms/std-cache-aside.orb +111 -111
  27. package/behaviors/registry/core/atoms/std-calendar.orb +56 -51
  28. package/behaviors/registry/core/atoms/std-circuit-breaker.orb +202 -187
  29. package/behaviors/registry/core/atoms/std-confirmation.orb +24 -27
  30. package/behaviors/registry/core/atoms/std-display.orb +2 -2
  31. package/behaviors/registry/core/atoms/std-drawer.orb +58 -58
  32. package/behaviors/registry/core/atoms/std-filter.orb +6 -9
  33. package/behaviors/registry/core/atoms/std-gallery.orb +46 -46
  34. package/behaviors/registry/core/atoms/std-graphs.orb +24 -24
  35. package/behaviors/registry/core/atoms/std-modal.orb +19 -19
  36. package/behaviors/registry/core/atoms/std-pagination.orb +14 -14
  37. package/behaviors/registry/core/atoms/std-push.orb +48 -90
  38. package/behaviors/registry/core/atoms/std-rate-limiter.orb +205 -190
  39. package/behaviors/registry/core/atoms/std-related.orb +31 -31
  40. package/behaviors/registry/core/atoms/std-search.orb +3 -3
  41. package/behaviors/registry/core/atoms/std-selection.orb +102 -102
  42. package/behaviors/registry/core/atoms/std-stats.orb +64 -64
  43. package/behaviors/registry/core/atoms/std-tabs.orb +18 -18
  44. package/behaviors/registry/core/molecules/std-cart.orb +64 -64
  45. package/behaviors/registry/core/molecules/std-dashboard.orb +46 -46
  46. package/behaviors/registry/core/molecules/std-filtered-list.orb +21 -21
  47. package/behaviors/registry/core/molecules/std-form-advanced.orb +172 -127
  48. package/behaviors/registry/core/molecules/std-list.orb +63 -63
  49. package/behaviors/registry/core/molecules/std-wizard-form.orb +145 -130
  50. package/behaviors/registry/game/atoms/std-dialogue-box.orb +25 -25
  51. package/behaviors/registry/game/atoms/std-game-canvas2d.orb +42 -42
  52. package/behaviors/registry/game/atoms/std-overworld.orb +57 -57
  53. package/behaviors/registry/game/atoms/std-physics2d.orb +74 -74
  54. package/behaviors/registry/game/atoms/std-quest.orb +137 -137
  55. package/behaviors/registry/game/atoms/std-timer.orb +291 -291
  56. package/behaviors/registry/probes/molecules/std-source-scope-probe.orb +31 -31
  57. package/behaviors/registry/service/atoms/std-service-custom-bearer.orb +93 -78
  58. package/behaviors/registry/service/atoms/std-service-email.orb +91 -76
  59. package/behaviors/registry/service/atoms/std-service-github.orb +103 -83
  60. package/behaviors/registry/service/atoms/std-service-llm.orb +117 -112
  61. package/behaviors/registry/service/atoms/std-service-oauth.orb +131 -126
  62. package/behaviors/registry/service/atoms/std-service-redis.orb +123 -108
  63. package/behaviors/registry/service/atoms/std-service-storage.orb +125 -105
  64. package/behaviors/registry/service/atoms/std-service-stripe.orb +113 -103
  65. package/behaviors/registry/service/atoms/std-service-twilio.orb +102 -92
  66. package/behaviors/registry/service/atoms/std-service-youtube.orb +119 -114
  67. package/behaviors/registry/service/organisms/std-service-marketplace.orb +985 -873
  68. package/behaviors/registry/service/organisms/std-service-research-assistant.orb +1027 -972
  69. package/dist/behaviors/behaviors-registry.json +2913 -322
  70. package/dist/behaviors/registry/agent/atoms/std-agent-activity-log.orb +69 -69
  71. package/dist/behaviors/registry/agent/atoms/std-agent-chat-thread.orb +120 -120
  72. package/dist/behaviors/registry/agent/atoms/std-agent-classifier.orb +114 -114
  73. package/dist/behaviors/registry/agent/atoms/std-agent-completion.orb +124 -114
  74. package/dist/behaviors/registry/agent/atoms/std-agent-context-window.orb +410 -395
  75. package/dist/behaviors/registry/agent/atoms/std-agent-conversation.orb +93 -93
  76. package/dist/behaviors/registry/agent/atoms/std-agent-memory.orb +67 -117
  77. package/dist/behaviors/registry/agent/atoms/std-agent-provider.orb +149 -134
  78. package/dist/behaviors/registry/agent/atoms/std-agent-search.orb +64 -64
  79. package/dist/behaviors/registry/agent/atoms/std-agent-session.orb +106 -106
  80. package/dist/behaviors/registry/agent/atoms/std-agent-step-progress.orb +194 -189
  81. package/dist/behaviors/registry/agent/atoms/std-agent-token-gauge.orb +360 -355
  82. package/dist/behaviors/registry/agent/atoms/std-agent-tool-call.orb +69 -69
  83. package/dist/behaviors/registry/agent/molecules/std-agent-fix-loop.orb +204 -199
  84. package/dist/behaviors/registry/agent/molecules/std-agent-learner.orb +174 -174
  85. package/dist/behaviors/registry/agent/molecules/std-agent-planner.orb +125 -125
  86. package/dist/behaviors/registry/agent/molecules/std-agent-rag.orb +127 -109
  87. package/dist/behaviors/registry/agent/molecules/std-agent-tool-loop.orb +190 -185
  88. package/dist/behaviors/registry/agent/organisms/std-agent-assistant.orb +1209 -1155
  89. package/dist/behaviors/registry/agent/organisms/std-agent-builder.orb +3021 -3001
  90. package/dist/behaviors/registry/agent/organisms/std-agent-pipeline.orb +2184 -2249
  91. package/dist/behaviors/registry/agent/organisms/std-agent-reviewer.orb +1029 -1050
  92. package/dist/behaviors/registry/agent/organisms/std-agent-tutor.orb +842 -804
  93. package/dist/behaviors/registry/app/organisms/std-cms.orb +547 -547
  94. package/dist/behaviors/registry/core/atoms/std-browse.orb +36 -36
  95. package/dist/behaviors/registry/core/atoms/std-cache-aside.orb +111 -111
  96. package/dist/behaviors/registry/core/atoms/std-calendar.orb +56 -51
  97. package/dist/behaviors/registry/core/atoms/std-circuit-breaker.orb +202 -187
  98. package/dist/behaviors/registry/core/atoms/std-confirmation.orb +24 -27
  99. package/dist/behaviors/registry/core/atoms/std-display.orb +2 -2
  100. package/dist/behaviors/registry/core/atoms/std-drawer.orb +58 -58
  101. package/dist/behaviors/registry/core/atoms/std-filter.orb +6 -9
  102. package/dist/behaviors/registry/core/atoms/std-gallery.orb +46 -46
  103. package/dist/behaviors/registry/core/atoms/std-graphs.orb +24 -24
  104. package/dist/behaviors/registry/core/atoms/std-modal.orb +19 -19
  105. package/dist/behaviors/registry/core/atoms/std-pagination.orb +14 -14
  106. package/dist/behaviors/registry/core/atoms/std-push.orb +48 -90
  107. package/dist/behaviors/registry/core/atoms/std-rate-limiter.orb +205 -190
  108. package/dist/behaviors/registry/core/atoms/std-related.orb +31 -31
  109. package/dist/behaviors/registry/core/atoms/std-search.orb +3 -3
  110. package/dist/behaviors/registry/core/atoms/std-selection.orb +102 -102
  111. package/dist/behaviors/registry/core/atoms/std-stats.orb +64 -64
  112. package/dist/behaviors/registry/core/atoms/std-tabs.orb +18 -18
  113. package/dist/behaviors/registry/core/molecules/std-cart.orb +64 -64
  114. package/dist/behaviors/registry/core/molecules/std-dashboard.orb +46 -46
  115. package/dist/behaviors/registry/core/molecules/std-filtered-list.orb +21 -21
  116. package/dist/behaviors/registry/core/molecules/std-form-advanced.orb +172 -127
  117. package/dist/behaviors/registry/core/molecules/std-list.orb +63 -63
  118. package/dist/behaviors/registry/core/molecules/std-wizard-form.orb +145 -130
  119. package/dist/behaviors/registry/game/atoms/std-dialogue-box.orb +25 -25
  120. package/dist/behaviors/registry/game/atoms/std-game-canvas2d.orb +42 -42
  121. package/dist/behaviors/registry/game/atoms/std-overworld.orb +57 -57
  122. package/dist/behaviors/registry/game/atoms/std-physics2d.orb +74 -74
  123. package/dist/behaviors/registry/game/atoms/std-quest.orb +137 -137
  124. package/dist/behaviors/registry/game/atoms/std-timer.orb +291 -291
  125. package/dist/behaviors/registry/probes/molecules/std-source-scope-probe.orb +31 -31
  126. package/dist/behaviors/registry/service/atoms/std-service-custom-bearer.orb +93 -78
  127. package/dist/behaviors/registry/service/atoms/std-service-email.orb +91 -76
  128. package/dist/behaviors/registry/service/atoms/std-service-github.orb +103 -83
  129. package/dist/behaviors/registry/service/atoms/std-service-llm.orb +117 -112
  130. package/dist/behaviors/registry/service/atoms/std-service-oauth.orb +131 -126
  131. package/dist/behaviors/registry/service/atoms/std-service-redis.orb +123 -108
  132. package/dist/behaviors/registry/service/atoms/std-service-storage.orb +125 -105
  133. package/dist/behaviors/registry/service/atoms/std-service-stripe.orb +113 -103
  134. package/dist/behaviors/registry/service/atoms/std-service-twilio.orb +102 -92
  135. package/dist/behaviors/registry/service/atoms/std-service-youtube.orb +119 -114
  136. package/dist/behaviors/registry/service/organisms/std-service-marketplace.orb +985 -873
  137. package/dist/behaviors/registry/service/organisms/std-service-research-assistant.orb +1027 -972
  138. package/dist/behaviors-registry.json +2913 -322
  139. package/dist/index.d.ts +2 -2
  140. package/dist/index.js +26 -13
  141. package/dist/index.js.map +1 -1
  142. package/dist/modules/agent.d.ts +1 -1
  143. package/dist/modules/array.d.ts +1 -1
  144. package/dist/modules/array.js +16 -8
  145. package/dist/modules/array.js.map +1 -1
  146. package/dist/modules/async.d.ts +1 -1
  147. package/dist/modules/composition.d.ts +1 -1
  148. package/dist/modules/contract.d.ts +1 -1
  149. package/dist/modules/core.d.ts +1 -1
  150. package/dist/modules/core.js +6 -3
  151. package/dist/modules/core.js.map +1 -1
  152. package/dist/modules/data.d.ts +1 -1
  153. package/dist/modules/format.d.ts +1 -1
  154. package/dist/modules/graph.d.ts +1 -1
  155. package/dist/modules/index.d.ts +1 -1
  156. package/dist/modules/index.js +26 -13
  157. package/dist/modules/index.js.map +1 -1
  158. package/dist/modules/math.d.ts +1 -1
  159. package/dist/modules/nn.d.ts +1 -1
  160. package/dist/modules/object.d.ts +1 -1
  161. package/dist/modules/object.js +4 -2
  162. package/dist/modules/object.js.map +1 -1
  163. package/dist/modules/os.d.ts +1 -1
  164. package/dist/modules/prob.d.ts +1 -1
  165. package/dist/modules/str.d.ts +1 -1
  166. package/dist/modules/tensor.d.ts +1 -1
  167. package/dist/modules/time.d.ts +1 -1
  168. package/dist/modules/train.d.ts +1 -1
  169. package/dist/modules/validate.d.ts +1 -1
  170. package/dist/registry.d.ts +1 -1
  171. package/dist/registry.js +26 -13
  172. package/dist/registry.js.map +1 -1
  173. package/dist/{types-D7dG8fBF.d.ts → types-CdSN5hnD.d.ts} +43 -0
  174. package/package.json +1 -1
@@ -18,6 +18,40 @@ type BasicReturnType = 'number' | 'boolean' | 'string' | 'any' | 'void' | 'array
18
18
  /**
19
19
  * Base metadata for an operator.
20
20
  */
21
+ /**
22
+ * For operators whose actual return type depends on input expressions
23
+ * rather than being a fixed primitive (gap #24's family in
24
+ * `docs/Almadar_Std_Verification.md`). The static `returnType` is kept
25
+ * for back-compat with consumers that don't reason about input-dependent
26
+ * types; the validator (L2) reads `returnSemantics` first to derive the
27
+ * concrete type from the call site's argument expressions.
28
+ *
29
+ * - `'first-truthy-of-args'` — returns the first truthy argument's value
30
+ * (`or` semantics, NOT a boolean). Trips arithmetic-context misuse.
31
+ * - `'last-truthy-of-args'` — returns the last truthy argument's value
32
+ * when all are truthy, else first falsy (`and` short-circuit).
33
+ * - `'first-non-null-of-args'` — returns the first non-null arg's type
34
+ * (`coalesce` / `default` / `??`-style).
35
+ * - `'branch-union'` — return type is union of branch result types
36
+ * (`if cond X Y` → `X | Y`).
37
+ * - `'element-of-arg<N>'` — returns element type of arg at index N
38
+ * (`array/first arr` → element of `arr`, `array/get arr i` → element
39
+ * of `arr`). Suffix `?` (e.g. `'element-of-arg<0>?'`) marks
40
+ * nullable-when-missing (`array/find` → `T | undefined`).
41
+ * - `'lambda-result'` — return type is the lambda's body result, with
42
+ * the result possibly wrapped in an array (`array/map` →
43
+ * `Array<ReturnTypeOf<lambda>>`, `array/reduce` →
44
+ * `ReturnTypeOf<lambda>` / type of `init`).
45
+ * - `'object-key-lookup'` — return type depends on the input object
46
+ * shape and the literal key (`object/get`, `object/pick`).
47
+ * - `'identity-of-arg<N>'` — return type matches the input arg at index N
48
+ * (`tap`, `pipe-through`).
49
+ *
50
+ * Operators NOT listed here keep the fixed `returnType` semantics —
51
+ * arithmetic, math, comparisons, aggregations (`array/sum`/`avg`/`len`),
52
+ * type coercions, all effects.
53
+ */
54
+ type ReturnSemantics = 'first-truthy-of-args' | 'last-truthy-of-args' | 'first-non-null-of-args' | 'branch-union' | 'element-of-arg<0>' | 'element-of-arg<0>?' | 'element-of-arg<1>' | 'lambda-result' | 'object-key-lookup' | 'identity-of-arg<0>';
21
55
  interface OperatorMeta {
22
56
  /** Operator category */
23
57
  category: OperatorCategory;
@@ -31,6 +65,15 @@ interface OperatorMeta {
31
65
  hasSideEffects: boolean;
32
66
  /** Return type hint - basic types for core operators, extended types for std modules */
33
67
  returnType: string;
68
+ /**
69
+ * For operators whose actual return type is determined at the call site
70
+ * (input-dependent), tag with the appropriate semantics so the L2
71
+ * validator can derive the concrete type from argument expressions.
72
+ * Omitted when `returnType` is the fixed truth (most operators).
73
+ * See {@link ReturnSemantics} for the catalog and gap #24 in the std
74
+ * verification doc.
75
+ */
76
+ returnSemantics?: ReturnSemantics;
34
77
  }
35
78
  /**
36
79
  * Standard library module names.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/std",
3
- "version": "13.6.0",
3
+ "version": "13.8.0",
4
4
  "description": "Standard library operators for Almadar (math, string, array, etc.)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",