semantic-primitives 0.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.
Files changed (238) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +449 -0
  3. package/dist/index.d.ts +8 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +25016 -0
  6. package/dist/llm/client.d.ts +82 -0
  7. package/dist/llm/client.d.ts.map +1 -0
  8. package/dist/llm/index.d.ts +11 -0
  9. package/dist/llm/index.d.ts.map +1 -0
  10. package/dist/llm/providers/anthropic.d.ts +13 -0
  11. package/dist/llm/providers/anthropic.d.ts.map +1 -0
  12. package/dist/llm/providers/google.d.ts +13 -0
  13. package/dist/llm/providers/google.d.ts.map +1 -0
  14. package/dist/llm/providers/index.d.ts +7 -0
  15. package/dist/llm/providers/index.d.ts.map +1 -0
  16. package/dist/llm/providers/openai.d.ts +13 -0
  17. package/dist/llm/providers/openai.d.ts.map +1 -0
  18. package/dist/llm/types.d.ts +91 -0
  19. package/dist/llm/types.d.ts.map +1 -0
  20. package/dist/primitives/bigint/bigint.d.ts +197 -0
  21. package/dist/primitives/bigint/bigint.d.ts.map +1 -0
  22. package/dist/primitives/bigint/index.d.ts +7 -0
  23. package/dist/primitives/bigint/index.d.ts.map +1 -0
  24. package/dist/primitives/bigint/prompts.d.ts +37 -0
  25. package/dist/primitives/bigint/prompts.d.ts.map +1 -0
  26. package/dist/primitives/boolean/boolean.d.ts +194 -0
  27. package/dist/primitives/boolean/boolean.d.ts.map +1 -0
  28. package/dist/primitives/boolean/evals/from.evals.d.ts +7 -0
  29. package/dist/primitives/boolean/evals/from.evals.d.ts.map +1 -0
  30. package/dist/primitives/boolean/evals/index.d.ts +5 -0
  31. package/dist/primitives/boolean/evals/index.d.ts.map +1 -0
  32. package/dist/primitives/boolean/index.d.ts +6 -0
  33. package/dist/primitives/boolean/index.d.ts.map +1 -0
  34. package/dist/primitives/boolean/prompts.d.ts +29 -0
  35. package/dist/primitives/boolean/prompts.d.ts.map +1 -0
  36. package/dist/primitives/index.d.ts +14 -0
  37. package/dist/primitives/index.d.ts.map +1 -0
  38. package/dist/primitives/null/index.d.ts +6 -0
  39. package/dist/primitives/null/index.d.ts.map +1 -0
  40. package/dist/primitives/null/null.d.ts +181 -0
  41. package/dist/primitives/null/null.d.ts.map +1 -0
  42. package/dist/primitives/null/prompts.d.ts +39 -0
  43. package/dist/primitives/null/prompts.d.ts.map +1 -0
  44. package/dist/primitives/number/index.d.ts +6 -0
  45. package/dist/primitives/number/index.d.ts.map +1 -0
  46. package/dist/primitives/number/number.d.ts +154 -0
  47. package/dist/primitives/number/number.d.ts.map +1 -0
  48. package/dist/primitives/number/number.prompts.d.ts +53 -0
  49. package/dist/primitives/number/number.prompts.d.ts.map +1 -0
  50. package/dist/primitives/string/evals/classify.evals.d.ts +7 -0
  51. package/dist/primitives/string/evals/classify.evals.d.ts.map +1 -0
  52. package/dist/primitives/string/evals/index.d.ts +6 -0
  53. package/dist/primitives/string/evals/index.d.ts.map +1 -0
  54. package/dist/primitives/string/evals/semanticallyEquals.evals.d.ts +7 -0
  55. package/dist/primitives/string/evals/semanticallyEquals.evals.d.ts.map +1 -0
  56. package/dist/primitives/string/index.d.ts +206 -0
  57. package/dist/primitives/string/index.d.ts.map +1 -0
  58. package/dist/primitives/string/string.prompts.d.ts +45 -0
  59. package/dist/primitives/string/string.prompts.d.ts.map +1 -0
  60. package/dist/primitives/symbol/index.d.ts +6 -0
  61. package/dist/primitives/symbol/index.d.ts.map +1 -0
  62. package/dist/primitives/symbol/symbol.d.ts +176 -0
  63. package/dist/primitives/symbol/symbol.d.ts.map +1 -0
  64. package/dist/primitives/symbol/symbol.prompts.d.ts +53 -0
  65. package/dist/primitives/symbol/symbol.prompts.d.ts.map +1 -0
  66. package/dist/primitives/undefined/index.d.ts +5 -0
  67. package/dist/primitives/undefined/index.d.ts.map +1 -0
  68. package/dist/primitives/undefined/prompts.d.ts +40 -0
  69. package/dist/primitives/undefined/prompts.d.ts.map +1 -0
  70. package/dist/primitives/undefined/undefined.d.ts +216 -0
  71. package/dist/primitives/undefined/undefined.d.ts.map +1 -0
  72. package/dist/primitives/void/index.d.ts +5 -0
  73. package/dist/primitives/void/index.d.ts.map +1 -0
  74. package/dist/primitives/void/prompts.d.ts +37 -0
  75. package/dist/primitives/void/prompts.d.ts.map +1 -0
  76. package/dist/primitives/void/void.d.ts +172 -0
  77. package/dist/primitives/void/void.d.ts.map +1 -0
  78. package/dist/shared/base-classes.d.ts +331 -0
  79. package/dist/shared/base-classes.d.ts.map +1 -0
  80. package/dist/shared/eval-types.d.ts +82 -0
  81. package/dist/shared/eval-types.d.ts.map +1 -0
  82. package/dist/shared/index.d.ts +25 -0
  83. package/dist/shared/index.d.ts.map +1 -0
  84. package/dist/shared/interfaces.d.ts +799 -0
  85. package/dist/shared/interfaces.d.ts.map +1 -0
  86. package/dist/shared/types.d.ts +335 -0
  87. package/dist/shared/types.d.ts.map +1 -0
  88. package/dist/types/array/array.d.ts +250 -0
  89. package/dist/types/array/array.d.ts.map +1 -0
  90. package/dist/types/array/index.d.ts +6 -0
  91. package/dist/types/array/index.d.ts.map +1 -0
  92. package/dist/types/array/prompts.d.ts +63 -0
  93. package/dist/types/array/prompts.d.ts.map +1 -0
  94. package/dist/types/blob-file/blob.d.ts +188 -0
  95. package/dist/types/blob-file/blob.d.ts.map +1 -0
  96. package/dist/types/blob-file/file.d.ts +144 -0
  97. package/dist/types/blob-file/file.d.ts.map +1 -0
  98. package/dist/types/blob-file/index.d.ts +8 -0
  99. package/dist/types/blob-file/index.d.ts.map +1 -0
  100. package/dist/types/blob-file/prompts.d.ts +101 -0
  101. package/dist/types/blob-file/prompts.d.ts.map +1 -0
  102. package/dist/types/bun/bun.d.ts +266 -0
  103. package/dist/types/bun/bun.d.ts.map +1 -0
  104. package/dist/types/bun/index.d.ts +7 -0
  105. package/dist/types/bun/index.d.ts.map +1 -0
  106. package/dist/types/bun/prompts.d.ts +93 -0
  107. package/dist/types/bun/prompts.d.ts.map +1 -0
  108. package/dist/types/callable/callable.d.ts +200 -0
  109. package/dist/types/callable/callable.d.ts.map +1 -0
  110. package/dist/types/callable/index.d.ts +6 -0
  111. package/dist/types/callable/index.d.ts.map +1 -0
  112. package/dist/types/callable/prompts.d.ts +45 -0
  113. package/dist/types/callable/prompts.d.ts.map +1 -0
  114. package/dist/types/constructable/constructable.d.ts +150 -0
  115. package/dist/types/constructable/constructable.d.ts.map +1 -0
  116. package/dist/types/constructable/index.d.ts +5 -0
  117. package/dist/types/constructable/index.d.ts.map +1 -0
  118. package/dist/types/constructable/prompts.d.ts +41 -0
  119. package/dist/types/constructable/prompts.d.ts.map +1 -0
  120. package/dist/types/date/date.d.ts +258 -0
  121. package/dist/types/date/date.d.ts.map +1 -0
  122. package/dist/types/date/index.d.ts +6 -0
  123. package/dist/types/date/index.d.ts.map +1 -0
  124. package/dist/types/date/prompts.d.ts +93 -0
  125. package/dist/types/date/prompts.d.ts.map +1 -0
  126. package/dist/types/error/error.d.ts +191 -0
  127. package/dist/types/error/error.d.ts.map +1 -0
  128. package/dist/types/error/index.d.ts +6 -0
  129. package/dist/types/error/index.d.ts.map +1 -0
  130. package/dist/types/error/prompts.d.ts +49 -0
  131. package/dist/types/error/prompts.d.ts.map +1 -0
  132. package/dist/types/event-emitter/event-emitter.d.ts +230 -0
  133. package/dist/types/event-emitter/event-emitter.d.ts.map +1 -0
  134. package/dist/types/event-emitter/index.d.ts +6 -0
  135. package/dist/types/event-emitter/index.d.ts.map +1 -0
  136. package/dist/types/event-emitter/prompts.d.ts +51 -0
  137. package/dist/types/event-emitter/prompts.d.ts.map +1 -0
  138. package/dist/types/fetch/headers.d.ts +126 -0
  139. package/dist/types/fetch/headers.d.ts.map +1 -0
  140. package/dist/types/fetch/index.d.ts +9 -0
  141. package/dist/types/fetch/index.d.ts.map +1 -0
  142. package/dist/types/fetch/prompts.d.ts +139 -0
  143. package/dist/types/fetch/prompts.d.ts.map +1 -0
  144. package/dist/types/fetch/request.d.ts +188 -0
  145. package/dist/types/fetch/request.d.ts.map +1 -0
  146. package/dist/types/fetch/response.d.ts +155 -0
  147. package/dist/types/fetch/response.d.ts.map +1 -0
  148. package/dist/types/form-data/form-data.d.ts +277 -0
  149. package/dist/types/form-data/form-data.d.ts.map +1 -0
  150. package/dist/types/form-data/index.d.ts +7 -0
  151. package/dist/types/form-data/index.d.ts.map +1 -0
  152. package/dist/types/form-data/prompts.d.ts +80 -0
  153. package/dist/types/form-data/prompts.d.ts.map +1 -0
  154. package/dist/types/index.d.ts +29 -0
  155. package/dist/types/index.d.ts.map +1 -0
  156. package/dist/types/map/index.d.ts +6 -0
  157. package/dist/types/map/index.d.ts.map +1 -0
  158. package/dist/types/map/map.d.ts +204 -0
  159. package/dist/types/map/map.d.ts.map +1 -0
  160. package/dist/types/map/prompts.d.ts +56 -0
  161. package/dist/types/map/prompts.d.ts.map +1 -0
  162. package/dist/types/never/index.d.ts +5 -0
  163. package/dist/types/never/index.d.ts.map +1 -0
  164. package/dist/types/never/never.d.ts +220 -0
  165. package/dist/types/never/never.d.ts.map +1 -0
  166. package/dist/types/never/prompts.d.ts +50 -0
  167. package/dist/types/never/prompts.d.ts.map +1 -0
  168. package/dist/types/object/index.d.ts +6 -0
  169. package/dist/types/object/index.d.ts.map +1 -0
  170. package/dist/types/object/object.d.ts +162 -0
  171. package/dist/types/object/object.d.ts.map +1 -0
  172. package/dist/types/object/prompts.d.ts +55 -0
  173. package/dist/types/object/prompts.d.ts.map +1 -0
  174. package/dist/types/object-literal/index.d.ts +6 -0
  175. package/dist/types/object-literal/index.d.ts.map +1 -0
  176. package/dist/types/object-literal/object-literal.d.ts +223 -0
  177. package/dist/types/object-literal/object-literal.d.ts.map +1 -0
  178. package/dist/types/object-literal/prompts.d.ts +49 -0
  179. package/dist/types/object-literal/prompts.d.ts.map +1 -0
  180. package/dist/types/promise/index.d.ts +6 -0
  181. package/dist/types/promise/index.d.ts.map +1 -0
  182. package/dist/types/promise/promise.d.ts +240 -0
  183. package/dist/types/promise/promise.d.ts.map +1 -0
  184. package/dist/types/promise/prompts.d.ts +45 -0
  185. package/dist/types/promise/prompts.d.ts.map +1 -0
  186. package/dist/types/record/index.d.ts +5 -0
  187. package/dist/types/record/index.d.ts.map +1 -0
  188. package/dist/types/record/prompts.d.ts +45 -0
  189. package/dist/types/record/prompts.d.ts.map +1 -0
  190. package/dist/types/record/record.d.ts +179 -0
  191. package/dist/types/record/record.d.ts.map +1 -0
  192. package/dist/types/regexp/index.d.ts +7 -0
  193. package/dist/types/regexp/index.d.ts.map +1 -0
  194. package/dist/types/regexp/prompts.d.ts +56 -0
  195. package/dist/types/regexp/prompts.d.ts.map +1 -0
  196. package/dist/types/regexp/regexp.d.ts +160 -0
  197. package/dist/types/regexp/regexp.d.ts.map +1 -0
  198. package/dist/types/set/index.d.ts +6 -0
  199. package/dist/types/set/index.d.ts.map +1 -0
  200. package/dist/types/set/prompts.d.ts +60 -0
  201. package/dist/types/set/prompts.d.ts.map +1 -0
  202. package/dist/types/set/set.d.ts +261 -0
  203. package/dist/types/set/set.d.ts.map +1 -0
  204. package/dist/types/streams/index.d.ts +8 -0
  205. package/dist/types/streams/index.d.ts.map +1 -0
  206. package/dist/types/streams/prompts.d.ts +53 -0
  207. package/dist/types/streams/prompts.d.ts.map +1 -0
  208. package/dist/types/streams/readable-stream.d.ts +148 -0
  209. package/dist/types/streams/readable-stream.d.ts.map +1 -0
  210. package/dist/types/streams/transform-stream.d.ts +67 -0
  211. package/dist/types/streams/transform-stream.d.ts.map +1 -0
  212. package/dist/types/streams/writable-stream.d.ts +111 -0
  213. package/dist/types/streams/writable-stream.d.ts.map +1 -0
  214. package/dist/types/text-codec/index.d.ts +12 -0
  215. package/dist/types/text-codec/index.d.ts.map +1 -0
  216. package/dist/types/text-codec/prompts.d.ts +79 -0
  217. package/dist/types/text-codec/prompts.d.ts.map +1 -0
  218. package/dist/types/text-codec/text-codec.d.ts +305 -0
  219. package/dist/types/text-codec/text-codec.d.ts.map +1 -0
  220. package/dist/types/tuple/index.d.ts +6 -0
  221. package/dist/types/tuple/index.d.ts.map +1 -0
  222. package/dist/types/tuple/prompts.d.ts +41 -0
  223. package/dist/types/tuple/prompts.d.ts.map +1 -0
  224. package/dist/types/tuple/tuple.d.ts +221 -0
  225. package/dist/types/tuple/tuple.d.ts.map +1 -0
  226. package/dist/types/unknown/index.d.ts +5 -0
  227. package/dist/types/unknown/index.d.ts.map +1 -0
  228. package/dist/types/unknown/prompts.d.ts +45 -0
  229. package/dist/types/unknown/prompts.d.ts.map +1 -0
  230. package/dist/types/unknown/unknown.d.ts +220 -0
  231. package/dist/types/unknown/unknown.d.ts.map +1 -0
  232. package/dist/types/url/index.d.ts +7 -0
  233. package/dist/types/url/index.d.ts.map +1 -0
  234. package/dist/types/url/prompts.d.ts +93 -0
  235. package/dist/types/url/prompts.d.ts.map +1 -0
  236. package/dist/types/url/url.d.ts +270 -0
  237. package/dist/types/url/url.d.ts.map +1 -0
  238. package/package.json +73 -0
@@ -0,0 +1,194 @@
1
+ /**
2
+ * SemanticBoolean
3
+ * A boolean type with LLM-powered semantic understanding
4
+ *
5
+ * Implements shared interfaces:
6
+ * - Semantic<boolean> - Base semantic wrapper
7
+ * - Comparable<SemanticBoolean> - Semantic equality comparison
8
+ * - Classifiable - Category classification (affirmative, negative, etc.)
9
+ */
10
+ import type { LLMClient } from '../../llm/client.ts';
11
+ import type { SemanticEqualsResult, ClassifyResult } from '../../shared/types.ts';
12
+ import type { Semantic, Comparable, Classifiable } from '../../shared/interfaces.ts';
13
+ export type { SemanticEqualsResult, ClassifyResult } from '../../shared/types.ts';
14
+ /** Options for parsing natural language to boolean */
15
+ export interface FromOptions {
16
+ locale?: string;
17
+ context?: string;
18
+ }
19
+ /** Categories of boolean expressions */
20
+ export type BooleanCategory = 'affirmative' | 'negative' | 'uncertain' | 'conditional';
21
+ /**
22
+ * Boolean category result for classification
23
+ */
24
+ export interface BooleanClassifyResult extends ClassifyResult {
25
+ category: BooleanCategory;
26
+ }
27
+ /**
28
+ * SemanticBoolean - Boolean with LLM-powered semantic understanding
29
+ *
30
+ * Unlike traditional booleans that only understand true/false,
31
+ * semantic booleans can interpret natural language, handle ambiguity,
32
+ * and bridge the gap between human communication and binary logic.
33
+ *
34
+ * Implements:
35
+ * - Semantic<boolean> - valueOf() returns the boolean value
36
+ * - Comparable<SemanticBoolean> - semanticallyEquals() for comparison
37
+ * - Classifiable<BooleanClassifyResult> - classify() for categorization
38
+ */
39
+ export declare class SemanticBoolean implements Semantic<boolean>, Comparable<SemanticBoolean>, Classifiable<BooleanClassifyResult> {
40
+ private readonly state;
41
+ private readonly client;
42
+ private constructor();
43
+ /**
44
+ * Create a SemanticBoolean from a raw boolean value
45
+ */
46
+ static fromBoolean(value: boolean, client?: LLMClient): SemanticBoolean;
47
+ /**
48
+ * Parse natural language into a boolean value.
49
+ * Understands affirmatives, negatives, and contextual expressions.
50
+ *
51
+ * @param input - Natural language text to interpret
52
+ * @param options - Optional locale and context settings
53
+ * @param client - Optional LLM client to use
54
+ * @returns Promise resolving to SemanticBoolean instance
55
+ *
56
+ * @example
57
+ * await SemanticBoolean.from("yes") // true
58
+ * await SemanticBoolean.from("absolutely") // true
59
+ * await SemanticBoolean.from("nope") // false
60
+ * await SemanticBoolean.from("hai", { locale: "ja" }) // true (Japanese yes)
61
+ */
62
+ static from(input: string, options?: FromOptions, client?: LLMClient): Promise<SemanticBoolean>;
63
+ /**
64
+ * Infer boolean value from an implication or statement.
65
+ * Analyzes statements that imply success/failure, presence/absence.
66
+ *
67
+ * @param statement - A declarative statement to analyze
68
+ * @param client - Optional LLM client to use
69
+ * @returns Promise resolving to SemanticBoolean with inferred value
70
+ *
71
+ * @example
72
+ * await SemanticBoolean.fromImplication("The test passed") // true
73
+ * await SemanticBoolean.fromImplication("We encountered errors") // false
74
+ * await SemanticBoolean.fromImplication("No issues found") // true
75
+ */
76
+ static fromImplication(statement: string, client?: LLMClient): Promise<SemanticBoolean>;
77
+ /**
78
+ * Check if two boolean expressions are semantically equivalent.
79
+ * Considers synonyms, cultural variations, and context.
80
+ *
81
+ * @param other - Another SemanticBoolean to compare
82
+ * @returns Promise resolving to equivalence result with confidence score
83
+ *
84
+ * @example
85
+ * const yes = await SemanticBoolean.from("yes");
86
+ * const absolutely = await SemanticBoolean.from("absolutely");
87
+ * await yes.semanticallyEquals(absolutely) // { equivalent: true, confidence: 0.95 }
88
+ */
89
+ semanticallyEquals(other: SemanticBoolean): Promise<SemanticEqualsResult>;
90
+ /**
91
+ * Compare the strength/emphasis of two boolean expressions.
92
+ * Returns negative if this is weaker, positive if stronger.
93
+ *
94
+ * @param other - Another SemanticBoolean to compare strength with
95
+ * @returns Promise resolving to number from -1 to 1 indicating relative strength
96
+ *
97
+ * @example
98
+ * const guess = await SemanticBoolean.from("I guess so");
99
+ * const absolutely = await SemanticBoolean.from("Absolutely!");
100
+ * await guess.compareStrength(absolutely) // -0.6 (weaker)
101
+ */
102
+ compareStrength(other: SemanticBoolean): Promise<number>;
103
+ /**
104
+ * Check if the expression is affirmative (yes, sure, absolutely, etc.).
105
+ *
106
+ * @returns true if the expression indicates agreement/yes
107
+ *
108
+ * @example
109
+ * const sb = await SemanticBoolean.from("sure thing");
110
+ * sb.isAffirmative() // true
111
+ */
112
+ isAffirmative(): boolean;
113
+ /**
114
+ * Check if the expression is negative (no, nope, never, etc.).
115
+ *
116
+ * @returns true if the expression indicates disagreement/no
117
+ *
118
+ * @example
119
+ * const sb = await SemanticBoolean.from("no way");
120
+ * sb.isNegative() // true
121
+ */
122
+ isNegative(): boolean;
123
+ /**
124
+ * Check if the expression indicates uncertainty (maybe, perhaps, etc.).
125
+ *
126
+ * @returns true if the expression is ambiguous or uncertain
127
+ *
128
+ * @example
129
+ * const sb = await SemanticBoolean.from("maybe");
130
+ * sb.isUncertain() // true
131
+ */
132
+ isUncertain(): boolean;
133
+ /**
134
+ * Check if the expression is conditional (yes, but...; if...; etc.).
135
+ *
136
+ * @returns true if the response depends on conditions
137
+ *
138
+ * @example
139
+ * const sb = await SemanticBoolean.from("yes, if the price is right");
140
+ * sb.isConditional() // true
141
+ */
142
+ isConditional(): boolean;
143
+ /**
144
+ * Extract conditions from a conditional boolean expression.
145
+ * Uses LLM for more complex condition extraction if needed.
146
+ *
147
+ * @returns Promise resolving to array of condition strings, empty if not conditional
148
+ *
149
+ * @example
150
+ * const sb = await SemanticBoolean.from("yes, if you can deliver by Friday");
151
+ * await sb.extractConditions() // ["deliver by Friday"]
152
+ */
153
+ extractConditions(): Promise<string[]>;
154
+ /**
155
+ * Get the raw boolean value.
156
+ *
157
+ * @returns The resolved true/false value
158
+ */
159
+ valueOf(): boolean;
160
+ /**
161
+ * Get the confidence level of the interpretation.
162
+ *
163
+ * @returns Number from 0 to 1 indicating interpretation confidence
164
+ */
165
+ confidence(): number;
166
+ /**
167
+ * Get the original expression that was parsed
168
+ */
169
+ getOriginalExpression(): string;
170
+ /**
171
+ * Get the category of the boolean expression
172
+ */
173
+ getCategory(): BooleanCategory;
174
+ /**
175
+ * Classify the boolean expression.
176
+ * Implements Classifiable interface.
177
+ *
178
+ * @returns Classification result with category and confidence
179
+ */
180
+ classify(): BooleanClassifyResult;
181
+ /**
182
+ * Convert to string representation
183
+ */
184
+ toString(): string;
185
+ /**
186
+ * Convert to JSON representation
187
+ */
188
+ toJSON(): {
189
+ value: boolean;
190
+ confidence: number;
191
+ category: BooleanCategory;
192
+ };
193
+ }
194
+ //# sourceMappingURL=boolean.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src/primitives/boolean/boolean.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,YAAY,EACb,MAAM,4BAA4B,CAAC;AAUpC,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAElF,sDAAsD;AACtD,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wCAAwC;AACxC,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC;AAWvF;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,eACX,YACE,QAAQ,CAAC,OAAO,CAAC,EACjB,UAAU,CAAC,eAAe,CAAC,EAC3B,YAAY,CAAC,qBAAqB,CAAC;IAErC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IAEnC,OAAO;IAKP;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe;IAavE;;;;;;;;;;;;;;OAcG;WACU,IAAI,CACf,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,SAAS,GACjB,OAAO,CAAC,eAAe,CAAC;IA6B3B;;;;;;;;;;;;OAYG;WACU,eAAe,CAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,SAAS,GACjB,OAAO,CAAC,eAAe,CAAC;IA2B3B;;;;;;;;;;;OAWG;IACG,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAe/E;;;;;;;;;;;OAWG;IACG,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAmB9D;;;;;;;;OAQG;IACH,aAAa,IAAI,OAAO;IAIxB;;;;;;;;OAQG;IACH,UAAU,IAAI,OAAO;IAIrB;;;;;;;;OAQG;IACH,WAAW,IAAI,OAAO;IAItB;;;;;;;;OAQG;IACH,aAAa,IAAI,OAAO;IAIxB;;;;;;;;;OASG;IACG,iBAAiB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAyB5C;;;;OAIG;IACH,OAAO,IAAI,OAAO;IAIlB;;;;OAIG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,qBAAqB,IAAI,MAAM;IAI/B;;OAEG;IACH,WAAW,IAAI,eAAe;IAI9B;;;;;OAKG;IACH,QAAQ,IAAI,qBAAqB;IAOjC;;OAEG;IACH,QAAQ,IAAI,MAAM;IAIlB;;OAEG;IACH,MAAM,IAAI;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,eAAe,CAAA;KAAE;CAO5E"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Evaluation dataset for SemanticBoolean.from()
3
+ * Tests the ability to parse natural language into boolean values
4
+ */
5
+ import type { EvalDataset } from '../../../shared/eval-types.ts';
6
+ export declare const dataset: EvalDataset;
7
+ //# sourceMappingURL=from.evals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"from.evals.d.ts","sourceRoot":"","sources":["../../../../src/primitives/boolean/evals/from.evals.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,eAAO,MAAM,OAAO,EAAE,WAiXrB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Evaluation datasets for SemanticBoolean
3
+ */
4
+ export { dataset as from } from './from.evals.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/primitives/boolean/evals/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SemanticBoolean Module
3
+ * Exports all SemanticBoolean types and utilities
4
+ */
5
+ export { SemanticBoolean, type FromOptions, type SemanticEqualsResult, type BooleanCategory, } from './boolean.ts';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/boolean/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Prompts for SemanticBoolean LLM operations
3
+ * These prompts are used to interpret and analyze boolean expressions
4
+ */
5
+ /**
6
+ * System prompt for boolean interpretation tasks
7
+ */
8
+ export declare const BOOLEAN_SYSTEM_PROMPT = "You are a semantic boolean interpreter. Your task is to analyze natural language expressions and determine their boolean meaning.\n\nYou must respond with valid JSON only, no additional text or explanation.\n\nGuidelines:\n- Interpret affirmative expressions (yes, sure, absolutely, correct, right, indeed) as true\n- Interpret negative expressions (no, nope, never, not at all, negative) as false\n- Consider context and locale when interpreting culturally-specific expressions\n- Provide confidence scores from 0.0 to 1.0 based on clarity of the expression\n- Identify uncertainty when expressions are ambiguous (maybe, perhaps, it depends)";
9
+ /**
10
+ * Prompt template for parsing natural language to boolean
11
+ */
12
+ export declare function createFromPrompt(input: string, locale?: string, context?: string): string;
13
+ /**
14
+ * Prompt template for inferring boolean from implication
15
+ */
16
+ export declare function createFromImplicationPrompt(statement: string): string;
17
+ /**
18
+ * Prompt template for semantic equality comparison
19
+ */
20
+ export declare function createSemanticallyEqualsPrompt(expression1: string, expression2: string): string;
21
+ /**
22
+ * Prompt template for strength comparison
23
+ */
24
+ export declare function createCompareStrengthPrompt(expression1: string, expression2: string): string;
25
+ /**
26
+ * Prompt template for extracting conditions
27
+ */
28
+ export declare function createExtractConditionsPrompt(expression: string): string;
29
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/primitives/boolean/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB,uoBASiD,CAAC;AAEpF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAwBzF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAerE;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,MAAM,CAaR;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,MAAM,CAqBR;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAYxE"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Semantic Primitives
3
+ * LLM-enhanced primitive types with semantic understanding
4
+ */
5
+ export { type SemanticEqualsResult } from '../shared/types.ts';
6
+ export { SemanticNumber, type ReasonableResult, type InferUnitResult, type SemanticEqualsOptions, type LLMClientInterface, } from './number/index.ts';
7
+ export { SemanticBoolean, type FromOptions, type BooleanCategory } from './boolean/index.ts';
8
+ export { SemanticString, type ClassifyResult, type ValidateResult, type DetectIntentResult, type DetectLanguageResult, type ContainsSensitiveResult, type Correction, } from './string/index.ts';
9
+ export { SemanticNull, type NullType, type NullClassifyResult, type SuggestDefaultResult, type SchemaInfo, type AppropriateContext, type InferReasonResult, type AppropriateResult, } from './null/index.ts';
10
+ export { SemanticSymbol, type SymbolClassifyResult, type SemanticEqualsResultWithReason, type ValidateResultWithWarnings, type Suggestion, } from './symbol/index.ts';
11
+ export { SemanticBigInt, type FormatStyle, type FormatOptions, type ScaleResult, type MatchPattern, type InferDomainResult, } from './bigint/index.ts';
12
+ export { SemanticUndefined, type UndefinedType, type UndefinedClassifyResult, type SuggestInitializationResult, type TypeHint, type AcceptableResult, type CompareToNullResult, } from './undefined/index.ts';
13
+ export { SemanticVoid, type VoidFunction, type AnalyzeSideEffectsResult, type ShouldReturnValueResult, type ValidateUsageResult, type CheckErrorHandlingResult, type SuggestSignatureResult, } from './void/index.ts';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EACL,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG7F,OAAO,EACL,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,GAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,YAAY,EACZ,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,UAAU,GAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,GACzB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,GAC5B,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SemanticNull Module
3
+ * Exports all SemanticNull types and utilities
4
+ */
5
+ export { SemanticNull, type SemanticEqualsResult, type InferReasonResult, type AppropriateResult, type NullType, type NullClassifyResult, type SuggestDefaultResult, type SchemaInfo, type AppropriateContext, } from './null.ts';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/null/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,YAAY,EACZ,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,kBAAkB,GACxB,MAAM,WAAW,CAAC"}
@@ -0,0 +1,181 @@
1
+ /**
2
+ * SemanticNull
3
+ * A null type with LLM-powered semantic understanding
4
+ *
5
+ * Implements shared interfaces:
6
+ * - Semantic<null> - Base semantic wrapper
7
+ * - Comparable<SemanticNull> - Semantic equality comparison
8
+ * - Explainable - Human-readable explanation
9
+ * - SemanticAbsence<null> - Absence-specific methods
10
+ */
11
+ import type { LLMClient } from '../../llm/client.ts';
12
+ import type { SemanticEqualsResult, InferReasonResult, AppropriateResult } from '../../shared/types.ts';
13
+ import type { Semantic, Comparable, Explainable, SemanticAbsence } from '../../shared/interfaces.ts';
14
+ export type { SemanticEqualsResult, InferReasonResult, AppropriateResult, } from '../../shared/types.ts';
15
+ /** Classification types for null values */
16
+ export type NullType = 'not-set' | 'not-applicable' | 'unknown';
17
+ /** Result of null classification */
18
+ export interface NullClassifyResult {
19
+ type: NullType;
20
+ canBeProvided: boolean;
21
+ }
22
+ /** Result of suggesting a default value */
23
+ export interface SuggestDefaultResult {
24
+ default: unknown;
25
+ explanation: string;
26
+ }
27
+ /** Schema information for suggestDefault */
28
+ export interface SchemaInfo {
29
+ type: string;
30
+ format?: string;
31
+ }
32
+ /** Context for isAppropriate */
33
+ export interface AppropriateContext {
34
+ required?: boolean;
35
+ schema?: unknown;
36
+ }
37
+ /**
38
+ * SemanticNull - Null with LLM-powered semantic understanding
39
+ *
40
+ * Unlike plain null that only represents absence,
41
+ * SemanticNull can explain why a value is null, classify the type of absence,
42
+ * and help reason about appropriate handling.
43
+ *
44
+ * Implements:
45
+ * - Semantic<null> - valueOf() returns null
46
+ * - Comparable<SemanticNull> - semanticallyEquals() for comparison
47
+ * - Explainable - explain() for human-readable description
48
+ * - SemanticAbsence<null> - getReason() and classify()
49
+ */
50
+ export declare class SemanticNull implements Semantic<null>, Comparable<SemanticNull>, Explainable, SemanticAbsence<null> {
51
+ private readonly reason;
52
+ private readonly client;
53
+ private constructor();
54
+ /**
55
+ * Create a SemanticNull with context about why the value is null.
56
+ *
57
+ * @param reason - Reason or context for the null value
58
+ * @param client - Optional LLM client for dependency injection
59
+ * @returns SemanticNull instance with context
60
+ *
61
+ * @example
62
+ * SemanticNull.because("user has not set a phone number")
63
+ * SemanticNull.because("field is not applicable for this user type")
64
+ */
65
+ static because(reason: string, client?: LLMClient): SemanticNull;
66
+ /**
67
+ * Create a SemanticNull without a reason.
68
+ *
69
+ * @param client - Optional LLM client for dependency injection
70
+ * @returns SemanticNull instance
71
+ */
72
+ static create(client?: LLMClient): SemanticNull;
73
+ /**
74
+ * Check if two null values are semantically equivalent.
75
+ * Null values with similar reasons/contexts are considered equivalent.
76
+ *
77
+ * @param other - Another SemanticNull to compare
78
+ * @returns Equivalence result with confidence score
79
+ *
80
+ * @example
81
+ * await SemanticNull.because("not set").semanticallyEquals(SemanticNull.because("empty"))
82
+ * // { equivalent: true, confidence: 0.85 }
83
+ */
84
+ semanticallyEquals(other: SemanticNull): Promise<SemanticEqualsResult>;
85
+ /**
86
+ * Infer the likely reason for a null value based on context.
87
+ *
88
+ * @param fieldName - Name of the field that is null
89
+ * @param context - Surrounding context (object, schema, etc.)
90
+ * @param client - Optional LLM client for dependency injection
91
+ * @returns Inferred reason for the null
92
+ *
93
+ * @example
94
+ * await SemanticNull.inferReason("deletedAt", { status: "active" })
95
+ * // { reason: "Record has not been deleted", type: "not-applicable" }
96
+ */
97
+ static inferReason(fieldName: string, context?: Record<string, unknown>, client?: LLMClient): Promise<InferReasonResult>;
98
+ /**
99
+ * Suggest an appropriate default value for a null field.
100
+ *
101
+ * @param fieldName - Name of the field
102
+ * @param schema - Optional schema or type information
103
+ * @param client - Optional LLM client for dependency injection
104
+ * @returns Suggested default with explanation
105
+ *
106
+ * @example
107
+ * await SemanticNull.suggestDefault("phoneNumber", { type: "string", format: "phone" })
108
+ * // { default: null, explanation: "Phone numbers should not have a default; require user input" }
109
+ *
110
+ * await SemanticNull.suggestDefault("retryCount", { type: "number" })
111
+ * // { default: 0, explanation: "Retry count should start at 0" }
112
+ */
113
+ static suggestDefault(fieldName: string, schema?: SchemaInfo, client?: LLMClient): Promise<SuggestDefaultResult>;
114
+ /**
115
+ * Check if null is appropriate for this field/context.
116
+ *
117
+ * @param fieldName - Name of the field
118
+ * @param context - Context information
119
+ * @param client - Optional LLM client for dependency injection
120
+ * @returns Validation result
121
+ *
122
+ * @example
123
+ * await SemanticNull.isAppropriate("email", { required: true })
124
+ * // { appropriate: false, reason: "Email is a required field" }
125
+ */
126
+ static isAppropriate(fieldName: string, context?: AppropriateContext, client?: LLMClient): Promise<AppropriateResult>;
127
+ /**
128
+ * Determine if this null represents "not set" vs "not applicable".
129
+ *
130
+ * @returns Classification of the null type
131
+ *
132
+ * @example
133
+ * // For a middleName field where user left it blank:
134
+ * // { type: "not-set", canBeProvided: true }
135
+ *
136
+ * // For a spouseName field for a single person:
137
+ * // { type: "not-applicable", canBeProvided: false }
138
+ */
139
+ classify(): Promise<NullClassifyResult>;
140
+ /**
141
+ * Generate a human-readable explanation of this null value.
142
+ *
143
+ * @param fieldName - Name of the field
144
+ * @returns Human-readable explanation
145
+ *
146
+ * @example
147
+ * await SemanticNull.because("user skipped").explain("middleName")
148
+ * // "Middle name was not provided by the user"
149
+ */
150
+ explain(fieldName: string): Promise<string>;
151
+ /**
152
+ * Get the reason for this null, if provided.
153
+ *
154
+ * @returns The reason string or undefined
155
+ */
156
+ getReason(): string | undefined;
157
+ /**
158
+ * Check if this is semantically null (always true for SemanticNull).
159
+ *
160
+ * @returns true
161
+ */
162
+ isNull(): true;
163
+ /**
164
+ * Get the underlying null value.
165
+ *
166
+ * @returns null
167
+ */
168
+ valueOf(): null;
169
+ /**
170
+ * Convert to string representation
171
+ */
172
+ toString(): string;
173
+ /**
174
+ * Convert to JSON representation
175
+ */
176
+ toJSON(): {
177
+ value: null;
178
+ reason?: string;
179
+ };
180
+ }
181
+ //# sourceMappingURL=null.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src/primitives/null/null.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAWpC,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAE/B,2CAA2C;AAC3C,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAEhE,oCAAoC;AACpC,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,4CAA4C;AAC5C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,gCAAgC;AAChC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,YACX,YACE,QAAQ,CAAC,IAAI,CAAC,EACd,UAAU,CAAC,YAAY,CAAC,EACxB,WAAW,EACX,eAAe,CAAC,IAAI,CAAC;IAEvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IAEnC,OAAO;IAKP;;;;;;;;;;OAUG;IACH,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,YAAY;IAIhE;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,YAAY;IAI/C;;;;;;;;;;OAUG;IACG,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAuB5E;;;;;;;;;;;OAWG;WACU,WAAW,CACtB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,MAAM,CAAC,EAAE,SAAS,GACjB,OAAO,CAAC,iBAAiB,CAAC;IAa7B;;;;;;;;;;;;;;OAcG;WACU,cAAc,CACzB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,UAAU,EACnB,MAAM,CAAC,EAAE,SAAS,GACjB,OAAO,CAAC,oBAAoB,CAAC;IAahC;;;;;;;;;;;OAWG;WACU,aAAa,CACxB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,kBAAkB,EAC5B,MAAM,CAAC,EAAE,SAAS,GACjB,OAAO,CAAC,iBAAiB,CAAC;IAa7B;;;;;;;;;;;OAWG;IACG,QAAQ,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAgB7C;;;;;;;;;OASG;IACG,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAajD;;;;OAIG;IACH,SAAS,IAAI,MAAM,GAAG,SAAS;IAI/B;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAId;;;;OAIG;IACH,OAAO,IAAI,IAAI;IAIf;;OAEG;IACH,QAAQ,IAAI,MAAM;IAOlB;;OAEG;IACH,MAAM,IAAI;QAAE,KAAK,EAAE,IAAI,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;CAM3C"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Prompts for SemanticNull LLM operations
3
+ * These prompts are used to reason about null values and their semantic meaning
4
+ */
5
+ /**
6
+ * System prompt for null interpretation tasks
7
+ */
8
+ export declare const NULL_SYSTEM_PROMPT = "You are a semantic null value interpreter. Your task is to analyze and reason about null values, their meaning, and appropriate handling.\n\nYou must respond with valid JSON only, no additional text or explanation.\n\nKey concepts:\n- \"not-set\": A value that could be provided but hasn't been (e.g., optional field left blank)\n- \"not-applicable\": A value that doesn't apply to the current context (e.g., spouse name for single person)\n- \"unknown\": The reason for null is unclear or indeterminate\n\nGuidelines:\n- Consider the field name semantics when inferring reasons\n- Analyze context to determine if null is intentional or missing\n- Provide confidence scores from 0.0 to 1.0 based on clarity\n- Suggest appropriate defaults only when safe (never for sensitive data)";
9
+ /**
10
+ * Prompt template for comparing two null reasons for semantic equivalence
11
+ */
12
+ export declare function createSemanticallyEqualsPrompt(reason1: string, reason2: string): string;
13
+ /**
14
+ * Prompt template for inferring the reason a field is null
15
+ */
16
+ export declare function createInferReasonPrompt(fieldName: string, context?: Record<string, unknown>): string;
17
+ /**
18
+ * Prompt template for suggesting a default value for a null field
19
+ */
20
+ export declare function createSuggestDefaultPrompt(fieldName: string, schema?: {
21
+ type: string;
22
+ format?: string;
23
+ }): string;
24
+ /**
25
+ * Prompt template for checking if null is appropriate for a field
26
+ */
27
+ export declare function createIsAppropriatePrompt(fieldName: string, context?: {
28
+ required?: boolean;
29
+ schema?: unknown;
30
+ }): string;
31
+ /**
32
+ * Prompt template for classifying the type of null
33
+ */
34
+ export declare function createClassifyPrompt(reason: string): string;
35
+ /**
36
+ * Prompt template for generating a human-readable explanation
37
+ */
38
+ export declare function createExplainPrompt(fieldName: string, reason?: string): string;
39
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/primitives/null/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,ixBAa0C,CAAC;AAE1E;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,MAAM,CAgBR;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,MAAM,CAuBR;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACzC,MAAM,CAyBR;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACjD,MAAM,CA4BR;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAiB3D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAsBR"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SemanticNumber module
3
+ * LLM-enhanced number type with semantic understanding
4
+ */
5
+ export * from './number.ts';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/number/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,aAAa,CAAC"}