@far-world-labs/verblets 0.3.2 → 0.5.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/README.md CHANGED
@@ -24,19 +24,21 @@ Primitive verblets extract basic data types from natural language with high reli
24
24
 
25
25
  - [bool](./src/verblets/bool) - Interpret yes/no, true/false, and conditional statements
26
26
  - [date](./src/chains/date) - Parse dates from relative expressions, natural language, standard formats, and longer descriptions
27
- - [enum](./src/verblets/enum) - Convert free-form input to exactly one of several predefined options
27
+ - [classify](./src/verblets/enum) - Classify free-form input into exactly one of several predefined options
28
28
  - [number](./src/verblets/number) - Convert a block of text to a single number
29
29
  - [number-with-units](./src/verblets/number-with-units) - Parse measurements and convert between unit systems
30
30
 
31
31
  ### Math
32
32
 
33
- Math chains transform values using conceptual reasoning and subjective judgments beyond simple calculations.
33
+ Math chains transform values using conceptual reasoning and subjective judgment beyond simple calculations.
34
34
 
35
- - [scale](./src/chains/scale) - Convert qualitative descriptions to numeric values. Uses a specification generator to maintain consistency across invocations.
35
+ - [scale](./src/chains/scale) - Convert qualitative descriptions to numeric values using a specification generator for consistency across invocations
36
+ - [calibrate](./src/chains/calibrate) - Build and apply specification-based classifiers with adjustable sensitivity
37
+ - [probe-scan](./src/chains/probe-scan) - Scan items for relevance using embedding similarity with configurable detection thresholds
36
38
 
37
39
  ### Lists
38
40
 
39
- List operations transform, filter, and organize collections. They handle both individual items and batch processing for datasets larger than a context window. Many list operations support bulk operation with built-in retry. Many have alternative single invocation versions in the verblets directory. Many utilities have list support via specification-generators that maintain continuity, or prompt fragments that adapt single-invcation behavior to list processing.
41
+ List operations transform, filter, and organize collections. They handle both individual items and batch processing for datasets larger than a context window. Many support bulk operation with built-in retry. Some have single-invocation alternatives in the verblets directory. Several use specification-generators that maintain continuity across batches, or prompt fragments that adapt single-invocation behavior to list processing.
40
42
 
41
43
  - [central-tendency](./src/chains/central-tendency) - Find the most representative examples from a collection
42
44
  - [detect-patterns](./src/chains/detect-patterns) - Identify repeating structures, sequences, or relationships in data
@@ -57,16 +59,16 @@ List operations transform, filter, and organize collections. They handle both in
57
59
 
58
60
  ### Content
59
61
 
60
- Content utilities generate, transform, and analyze text while maintaining structure and meaning. They handle creative tasks, system analysis, and privacy-aware text processing.
62
+ Content utilities generate, transform, and analyze text while maintaining structure and meaning.
61
63
 
62
- - [anonymize](./src/chains/anonymize) - Replace names, dates, and identifying details with placeholders
63
- - [category-samples](./src/chains/category-samples) - Create examples ranging from typical to edge cases
64
+ - [category-samples](./src/chains/category-samples) - Generate examples ranging from prototypical to edge cases using cognitive science sampling
64
65
  - [collect-terms](./src/chains/collect-terms) - Find domain-specific or complex vocabulary
65
66
  - [commonalities](./src/verblets/commonalities) - Identify what items share conceptually, not just literally
66
- - [conversation](./src/chains/conversation) - Manage multi-turn dialogues with memory and context tracking
67
+ - [Conversation](./src/chains/conversation) - Generate multi-speaker transcripts with contextual turn-taking and distinct personas
67
68
  - [disambiguate](./src/chains/disambiguate) - Determine which meaning of ambiguous terms fits the context
68
69
  - [dismantle](./src/chains/dismantle) - Break down systems into parts, subparts, and their connections
69
- - [document-shrink](./src/chains/document-shrink) - Remove less relevant sections while keeping query-related content
70
+ - [document-shrink](./src/chains/document-shrink) - Compress documents using adaptive TF-IDF scoring while preserving query-relevant content
71
+ - [extract-blocks](./src/chains/extract-blocks) - Extract structured blocks from text with windowed parallel processing
70
72
  - [fill-missing](./src/verblets/fill-missing) - Predict likely content for redacted or corrupted sections
71
73
  - [filter-ambiguous](./src/chains/filter-ambiguous) - Flag items that need human clarification
72
74
  - [join](./src/chains/join) - Connect text fragments by adding transitions and maintaining flow
@@ -77,29 +79,42 @@ Content utilities generate, transform, and analyze text while maintaining struct
77
79
  - [questions](./src/chains/questions) - Generate follow-up questions that branch from initial inquiry
78
80
  - [relations](./src/chains/relations) - Extract relationship tuples from text
79
81
  - [schema-org](./src/verblets/schema-org) - Convert unstructured data to schema.org JSON-LD format
80
- - [socratic](./src/chains/socratic) - Ask questions that reveal hidden assumptions and logic gaps
82
+ - [SocraticMethod](./src/chains/socratic) - Progressive questioning dialogue with configurable challenge intensity
81
83
  - [split](./src/chains/split) - Find topic boundaries in continuous text
82
- - [summary-map](./src/chains/summary-map) - Build layered summaries for navigating large documents
84
+ - [SummaryMap](./src/chains/summary-map) - Token-budget hash table that compresses values to fit a target size
83
85
  - [tag-vocabulary](./src/chains/tag-vocabulary) - Generate and refine tag vocabularies through iterative analysis
84
86
  - [themes](./src/chains/themes) - Surface recurring ideas through multi-pass extraction and merging
85
87
  - [timeline](./src/chains/timeline) - Order events chronologically from scattered mentions
86
88
  - [to-object](./src/chains/to-object) - Extract key-value pairs from natural language descriptions
87
89
  - [truncate](./src/chains/truncate) - Remove trailing content after a semantic boundary
88
- - [veiled-variants](./src/chains/veiled-variants) - Reword queries to avoid triggering content filters
90
+ - [veiled-variants](./src/chains/veiled-variants) - Reframe queries through scientific, causal, and soft-cover strategies
91
+
92
+
93
+ ### Retrieval
94
+
95
+ Retrieval utilities transform queries and prepare text for search and RAG (retrieval-augmented generation) workflows. All query-rewriting verblets accept a `divergence` option controlling how far variants stray from the original.
96
+
97
+ - [embed-rewrite-query](./src/verblets/embed-rewrite-query) - Rewrite search queries for clarity and specificity
98
+ - [embed-multi-query](./src/verblets/embed-multi-query) - Generate diverse query variants for broader retrieval
99
+ - [embed-step-back](./src/verblets/embed-step-back) - Broaden queries to underlying concepts and principles
100
+ - [embed-subquestions](./src/verblets/embed-subquestions) - Split complex queries into atomic sub-questions
101
+ - [embed-rewrite-to-output-doc](./src/verblets/embed-rewrite-to-output-doc) - Rewrite a query as if it were the answer document
102
+ - [embed-score](./src/lib/embed-score) - Score and rank items against a query using embedding similarity
89
103
 
90
104
 
91
105
  ### Utility Operations
92
106
 
93
- Utility operations are uncategorized functionality like automatic tool selection, intent parsing, and context compression.
107
+ Utility operations handle automatic tool selection, intent parsing, prompt enhancement, and scheduling.
94
108
 
95
- - [ai-arch-expect](./src/chains/ai-arch-expect) - Validate AI architecture constraints and patterns
96
109
  - [auto](./src/verblets/auto) - Match task descriptions to available tools using function calling
97
- - [expect](./src/verblets/expect) - Check if conditions are met and explain why if not
98
- - [expect chain](./src/chains/expect) - Validate complex data relationships with detailed failure analysis
110
+ - [expect](./src/verblets/expect) - Jest-style AI assertions: `expect(actual).toEqual(expected)`
111
+ - [aiExpect](./src/chains/expect) - AI-powered test expectations with source introspection and debugging advice
99
112
  - [intent](./src/verblets/intent) - Extract action and parameters from natural language commands
100
- - [llm-logger](./src/chains/llm-logger) - Summarize log patterns and detect anomalies across time windows
101
- - [sentiment](./src/verblets/sentiment) - Classify as positive, negative, or neutral with nuance detection
113
+ - [phail-forge / makePrompt](./src/verblets/phail-forge) - Transform simple prompts into expert-level prompts with precise terminology
114
+ - [sentiment](./src/verblets/sentiment) - Classify text as positive, negative, or neutral
102
115
  - [set-interval](./src/chains/set-interval) - Schedule tasks using natural language time descriptions
116
+ - [llm-logger](./src/chains/llm-logger) - Summarize log patterns and detect anomalies across time windows
117
+ - [ai-arch-expect](./src/chains/ai-arch-expect) - Validate architecture constraints using AI analysis
103
118
 
104
119
  ### Codebase
105
120
 
@@ -107,16 +122,21 @@ Codebase utilities analyze, test, and improve code quality using AI reasoning.
107
122
 
108
123
  - [scan-js](./src/chains/scan-js) - Examine JavaScript for patterns, anti-patterns, and potential issues
109
124
  - [test](./src/chains/test) - Generate test cases covering happy paths, edge cases, and error conditions
110
- - [test-advice](./src/chains/test-advice) - Identify untested code paths and suggest test scenarios
111
125
 
112
- ## Library Helpers
113
126
 
114
- Helpers support higher-level operations. They make no LLM calls and are often synchronous.
127
+ ## Library Helpers
115
128
 
116
- - [chatgpt](./src/lib/chatgpt) - OpenAI ChatGPT wrapper
117
- - [prompt-cache](./src/lib/prompt-cache) - Cache prompts and responses
118
- - [retry](./src/lib/retry) - Retry asynchronous calls
119
- - [ring-buffer](./src/lib/ring-buffer) - Circular buffer implementation for running LLMs on streams of data
129
+ Low-level utilities that support chains and verblets. Most are synchronous and make no LLM calls.
130
+
131
+ - [llm](./src/lib/llm) - Core LLM wrapper with capability-based model selection and structured output
132
+ - [context](./src/lib/context) - Config resolution: `getOption`, `getOptions`, `withPolicy`, `scopeOperation`
133
+ - [prompt-cache](./src/lib/prompt-cache) - Cache LLM prompts and responses
134
+ - [retry](./src/lib/retry) - Config-aware async retry
135
+ - [parallel-batch](./src/lib/parallel-batch) - Parallel execution with concurrency limits
136
+ - [ring-buffer](./src/lib/ring-buffer) - Circular buffer for running LLMs on streams of data
137
+ - [embed-normalize-text](./src/lib/embed-normalize-text) - Normalize text (NFC, whitespace, line endings) for consistent embedding
138
+ - [embed-neighbor-chunks](./src/lib/embed-neighbor-chunks) - Expand retrieved chunks with neighboring context
139
+ - [progress](./src/lib/progress) - Progress event system: lifecycle tracking, batch progress, event emission
120
140
 
121
141
  ## Contributing
122
142
 
@@ -1,74 +1,225 @@
1
- import { ag as a } from "./shared-C6kPWghF.js";
2
- import { E as r, a3 as i, f as n, F as o, l as c, a as m, G as l, H as p, e as u, I as g, k as d, g as f, a as h, m as b, o as y, J as v, K as x, L as T, p as S, i as k, a4 as B, a5 as P, q as j, M as C, t as E, N as M, u as O, v as V, w as q, a6 as w, x as z, O as A, y as F, z as G, a7 as I, a8 as L, A as R, P as U, Q as W, n as D, h as H, R as J, a8 as K, S as N, ab as Q, ae as X, T as Y, r as Z, U as _, ac as $, ad as aa, j as sa, V as ea, af as ta, B as ra, a9 as ia, s as na, aa as oa, W as ca, C as ma, X as la, Y as pa, Z as ua, D as ga, _ as da, $ as fa, a0 as ha, a1 as ba, a2 as ya } from "./shared-C6kPWghF.js";
1
+ import { cC as a } from "./shared-C2_d1bKV.js";
2
+ import { cz as i, F as r, C as c, G as n, aQ as o, D as l, E as b, ao as p, Q as u, bg as m, bj as g, c1 as d, bx as S, c0 as I, $ as T, A as y, a8 as h, _ as R, b6 as v, o as C, au as f, aE as E, bv as F, f as M, aN as B, a5 as N, y as P, z as x, aM as A, bt as O, a1 as L, a2 as k, ch as w, bW as D, i as G, aO as z, bU as U, aP as V, ci as W, bl as _, cB as q, e as Q, aR as Y, cj as j, bY as K, B as J, H as X, a9 as H, c as Z, b7 as $, p as aa, aF as sa, aG as ea, R as ta, g as ia, bX as ra, a as ca, O as na, a3 as oa, a4 as la, ap as ba, aS as pa, aU as ua, aW as ma, aX as ga, bD as da, bS as Sa, bE as Ia, bQ as Ta, bF as ya, bR as ha, bK as Ra, bP as va, bO as Ca, bJ as fa, bN as Ea, bI as Fa, bT as Ma, bL as Ba, bM as Na, bG as Pa, a6 as xa, ab as Aa, ad as Oa, ae as La, aa as ka, ac as wa, a7 as Da, Y as Ga, Z as za, S as Ua, bw as Va, af as Wa, c8 as _a, aY as qa, ag as Qa, aZ as Ya, ah as ja, am as Ka, cy as Ja, aT as Xa, K as Ha, L as Za, M as $a, ai as as, aj as ss, cA as es, by as ts, ak as is, a_ as rs, ck as cs, al as ns, an as os, aq as ls, a as bs, bz as ps, bA as us, ar as ms, a$ as gs, b0 as ds, n as Ss, bZ as Is, h as Ts, k as ys, I as hs, J as Rs, cl as vs, b_ as Cs, b$ as fs, cg as Es, b8 as Fs, b9 as Ms, b1 as Bs, bA as Ns, cm as Ps, cs as xs, b2 as As, x as Os, cv as Ls, cw as ks, ct as ws, b3 as Ds, bV as Gs, r as zs, b5 as Us, b4 as Vs, bb as Ws, bd as _s, be as qs, ba as Qs, bc as Ys, cx as js, d as Ks, c3 as Js, l as Xs, t as Hs, v as Zs, w as $s, q as ae, u as se, m as ee, bf as te, cu as ie, bs as re, c4 as ce, as as ne, ax as oe, az as le, aA as be, av as pe, aw as ue, ay as me, at as ge, bB as de, s as Se, bH as Ie, bC as Te, cr as ye, aV as he, bh as Re, bu as ve, aB as Ce, cn as fe, bi as Ee, ca as Fe, c9 as Me, a0 as Be, aD as Ne, bk as Pe, aC as xe, aI as Ae, aK as Oe, aL as Le, aH as ke, aJ as we, U as De, V as Ge, T as ze, X as Ue, c2 as Ve, bm as We, bn as _e, cb as qe, cd as Qe, ce as Ye, cc as je, cf as Ke, bo as Je, bp as Xe, co as He, W as Ze, P as $e, cp as at, br as st, bq as et, c5 as tt, c6 as it, c7 as rt, N as ct, cq as nt } from "./shared-C2_d1bKV.js";
3
3
  a();
4
4
  export {
5
- r as anonymize,
6
- i as auto,
7
- n as bool,
8
- o as categorySamples,
9
- c as centralTendency,
10
- m as chatGPT,
11
- l as collectTerms,
12
- p as commonalities,
13
- u as constants,
14
- g as conversation,
15
- d as createScale,
16
- f as date,
17
- h as default,
18
- b as detectPatterns,
19
- y as detectThreshold,
20
- v as disambiguate,
21
- x as dismantle,
22
- T as documentShrink,
23
- S as entities,
24
- k as enums,
25
- B as expect,
26
- P as expectChain,
27
- j as extractBlocks,
28
- C as fillMissing,
29
- E as filter,
30
- M as filterAmbiguous,
31
- O as find,
32
- V as glossary,
33
- q as group,
34
- w as intent,
35
- z as intersections,
36
- A as join,
37
- F as list,
38
- G as listExpand,
39
- I as llmLogger,
40
- L as makePrompt,
41
- R as map,
42
- U as name,
43
- W as nameSimilarTo,
44
- D as number,
45
- H as numberWithUnits,
46
- J as people,
47
- K as phailForge,
48
- N as popReference,
49
- Q as promptCache,
50
- X as prompts,
51
- Y as questions,
52
- Z as reduce,
53
- _ as relations,
54
- $ as retry,
55
- aa as ringBuffer,
56
- sa as scale,
57
- ea as schemaOrg,
58
- ta as schemas,
59
- ra as score,
60
- ia as sentiment,
61
- na as services,
62
- oa as setInterval,
63
- ca as socratic,
64
- ma as sort,
65
- la as split,
66
- pa as summaryMap,
67
- ua as tagVocabulary,
68
- ga as tags,
69
- da as themes,
70
- fa as timeline,
71
- ha as toObject,
72
- ba as truncate,
73
- ya as veiledVariants
5
+ i as CAPABILITY_KEYS,
6
+ r as COMPLIANCE,
7
+ c as CONTEXT_KINDS,
8
+ n as COST_POSTURE,
9
+ o as Conversation,
10
+ l as DOMAIN,
11
+ b as ENVIRONMENT,
12
+ p as ListStyle,
13
+ u as QUALITY_INTENT,
14
+ m as SocraticMethod,
15
+ g as SummaryMap,
16
+ d as TimedAbortController,
17
+ S as aiExpect,
18
+ I as anySignal,
19
+ T as applyAllTargetingRules,
20
+ y as applyCalibrate,
21
+ h as applyEntities,
22
+ R as applyFirstTargetingRule,
23
+ v as applyRelations,
24
+ C as applyScale,
25
+ f as applyScore,
26
+ E as applyTags,
27
+ F as auto,
28
+ M as bool,
29
+ B as buildSeedGenerationPrompt,
30
+ N as calculateStatistics,
31
+ P as calibrate,
32
+ x as calibrateSpec,
33
+ A as categorySamples,
34
+ O as causalFramePrompt,
35
+ L as centralTendency,
36
+ k as centralTendencyLines,
37
+ w as chunk,
38
+ D as chunkSentences,
39
+ G as classify,
40
+ z as collectTerms,
41
+ U as combinations,
42
+ V as commonalities,
43
+ W as compact,
44
+ _ as computeTagStatistics,
45
+ q as config,
46
+ Q as constants,
47
+ Y as conversationTurnReduce,
48
+ j as cosineSimilarity,
49
+ K as createBatches,
50
+ J as createCalibratedClassifier,
51
+ X as createContextBuilder,
52
+ H as createEntityExtractor,
53
+ Z as createProgressEmitter,
54
+ $ as createRelationExtractor,
55
+ aa as createScale,
56
+ sa as createTagExtractor,
57
+ ea as createTagger,
58
+ ta as createTraceCollector,
59
+ ia as date,
60
+ ra as debug,
61
+ ca as default,
62
+ na as descriptorToSchema,
63
+ oa as detectPatterns,
64
+ la as detectThreshold,
65
+ ba as determineStyle,
66
+ pa as disambiguate,
67
+ ua as dismantle,
68
+ ma as dismantleFactory,
69
+ ga as documentShrink,
70
+ da as embed,
71
+ Sa as embedAssembleSpan,
72
+ Ia as embedBatch,
73
+ Ta as embedBuildIndex,
74
+ ya as embedChunked,
75
+ ha as embedMergeRanges,
76
+ Ra as embedMultiQuery,
77
+ va as embedNeighborChunks,
78
+ Ca as embedNormalizeText,
79
+ fa as embedRewriteQuery,
80
+ Ea as embedRewriteToOutputDoc,
81
+ Fa as embedScore,
82
+ Ma as embedStandaloneSpan,
83
+ Ba as embedStepBack,
84
+ Na as embedSubquestions,
85
+ Pa as embedWarmup,
86
+ xa as entities,
87
+ Aa as entitiesFilterInstructions,
88
+ Oa as entitiesFindInstructions,
89
+ La as entitiesGroupInstructions,
90
+ ka as entitiesMapInstructions,
91
+ wa as entitiesReduceInstructions,
92
+ Da as entitySpec,
93
+ Ga as evaluateTargetingClause,
94
+ za as evaluateTargetingRule,
95
+ Ua as eventToTrace,
96
+ Va as expect,
97
+ Wa as extractBlocks,
98
+ _a as extractJson,
99
+ qa as fillMissing,
100
+ Qa as filter,
101
+ Ya as filterAmbiguous,
102
+ ja as find,
103
+ Ka as generateList,
104
+ Ja as getCapabilities,
105
+ Xa as getMeanings,
106
+ Ha as getOption,
107
+ Za as getOptionDetail,
108
+ $a as getOptions,
109
+ as as glossary,
110
+ ss as group,
111
+ es as init,
112
+ ts as intent,
113
+ is as intersections,
114
+ rs as join,
115
+ cs as last,
116
+ ns as list,
117
+ os as listBatch,
118
+ ls as listExpand,
119
+ bs as llm,
120
+ ps as llmLogger,
121
+ us as makePrompt,
122
+ ms as map,
123
+ gs as name,
124
+ ds as nameSimilarTo,
125
+ Ss as nameStep,
126
+ Is as normalizeLlm,
127
+ Ts as number,
128
+ ys as numberWithUnits,
129
+ hs as observeApplication,
130
+ Rs as observeProviders,
131
+ vs as omit,
132
+ Cs as parallel,
133
+ fs as parallelMap,
134
+ Es as parseLLMList,
135
+ Fs as parseRDFLiteral,
136
+ Ms as parseRelations,
137
+ Bs as people,
138
+ Ns as phailForge,
139
+ Ps as pick,
140
+ xs as pipe,
141
+ As as popReference,
142
+ Os as probeScan,
143
+ Ls as promptCache,
144
+ ks as promptPiece,
145
+ ws as prompts,
146
+ Ds as questions,
147
+ Gs as rangeCombinations,
148
+ zs as reduce,
149
+ Us as relationSpec,
150
+ Vs as relations,
151
+ Ws as relationsFilterInstructions,
152
+ _s as relationsFindInstructions,
153
+ qs as relationsGroupInstructions,
154
+ Qs as relationsMapInstructions,
155
+ Ys as relationsReduceInstructions,
156
+ js as resolveModel,
157
+ Ks as retry,
158
+ Js as ringBuffer,
159
+ Xs as scale,
160
+ Hs as scaleFilterInstructions,
161
+ Zs as scaleFindInstructions,
162
+ $s as scaleGroupInstructions,
163
+ ae as scaleMapInstructions,
164
+ se as scaleReduceInstructions,
165
+ ee as scaleSpec,
166
+ te as schemaOrg,
167
+ ie as schemas,
168
+ re as scientificFramingPrompt,
169
+ ce as scopePhase,
170
+ ne as score,
171
+ oe as scoreFilterInstructions,
172
+ le as scoreFindInstructions,
173
+ be as scoreGroupInstructions,
174
+ pe as scoreItem,
175
+ ue as scoreMapInstructions,
176
+ me as scoreReduceInstructions,
177
+ ge as scoreSpec,
178
+ de as sentiment,
179
+ Se as services,
180
+ Ie as setEmbedEnabled,
181
+ Te as setInterval,
182
+ ye as shuffle,
183
+ he as simplifyTree,
184
+ Re as socratic,
185
+ ve as softCoverPrompt,
186
+ Ce as sort,
187
+ fe as sortBy,
188
+ Ee as split,
189
+ Fe as stripNumeric,
190
+ Me as stripResponse,
191
+ Be as suggestTargetingRules,
192
+ Ne as tagSpec,
193
+ Pe as tagVocabulary,
194
+ xe as tags,
195
+ Ae as tagsFilterInstructions,
196
+ Oe as tagsFindInstructions,
197
+ Le as tagsGroupInstructions,
198
+ ke as tagsMapInstructions,
199
+ we as tagsReduceInstructions,
200
+ De as targetingClause,
201
+ Ge as targetingRule,
202
+ ze as targetingRuleOps,
203
+ Ue as targetingRuleSchema,
204
+ Ve as templateReplace,
205
+ We as themes,
206
+ _e as timeline,
207
+ qe as toBool,
208
+ Qe as toDate,
209
+ Ye as toEnum,
210
+ je as toNumber,
211
+ Ke as toNumberWithUnits,
212
+ Je as toObject,
213
+ Xe as truncate,
214
+ He as unionBy,
215
+ Ze as validateTargetingRules,
216
+ $e as valueArbitrate,
217
+ at as vectorSearch,
218
+ st as veiledVariantStrategies,
219
+ et as veiledVariants,
220
+ tt as version,
221
+ it as windowFor,
222
+ rt as withInactivityTimeout,
223
+ ct as withPolicy,
224
+ nt as zipWith
74
225
  };