@triplef/agent 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/dist/schemas/index.d.ts +4 -0
- package/dist/tools/index.d.ts +0 -6
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# @triplef/agent
|
|
4
|
+
|
|
5
|
+
The tripleF (3F) agent domain — structured-output schemas, prompt builders, and model tools shared across the apps.
|
|
6
|
+
|
|
7
|
+
`This library is **ESM-only** and does not support CommonJS.`
|
|
8
|
+
`Your project must use ES modules.`
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<br>
|
|
13
|
+
|
|
14
|
+
<!-- DEPBADGE:START -->
|
|
15
|
+
<!-- DEPBADGE:END -->
|
|
16
|
+
|
|
17
|
+
## Subpath exports
|
|
18
|
+
|
|
19
|
+
- `@triplef/agent/schemas` — Zod schemas and `z.infer` types for intent classification, response templates, and memory extraction/consolidation/profile, plus URL-trust and Zod-shape helpers (`formatZodShape`, `deriveSchemaKeys`) and the `LexiconSelectInput`/`LexiconSelectResult` retrieval-selection contract.
|
|
20
|
+
- `@triplef/agent/prompts` — harness and memory prompt builders, the snippet system, and `buildStructuredPrompt` (renders a schema's JSON shape into a prompt template).
|
|
21
|
+
- `@triplef/agent/tools` — search/tool factories (Serper, Bright Data, YouTube, web-fetch, image-variants, memory) with a decoupled `ToolDependencies` contract.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { intentSchema } from '@triplef/agent/schemas';
|
|
27
|
+
import { buildStructuredPrompt } from '@triplef/agent/prompts';
|
|
28
|
+
import { createSerperWebSearch } from '@triplef/agent/tools';
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`ai` and `zod` are peer dependencies; `ai` is optional (only the `/tools` subpath needs it).
|
|
32
|
+
|
|
33
|
+
<br>
|
|
34
|
+
|
|
35
|
+
<div align="center">
|
|
36
|
+
|
|
37
|
+
[E-MAIL](mailto:eugen.hildt@gmail.com) — [WIKI](https://github.com/ehildt/tripleF/wiki) — [ISSUES](https://github.com/ehildt/tripleF/issues) — [DONATE](https://github.com/sponsors/ehildt)
|
|
38
|
+
|
|
39
|
+
</div>
|
|
40
|
+
<br>
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -154,6 +154,7 @@ interface LexiconSelectInput {
|
|
|
154
154
|
query: string;
|
|
155
155
|
documents: LexiconSourceDocument[];
|
|
156
156
|
budgetChars?: number;
|
|
157
|
+
partitionScope?: string;
|
|
157
158
|
}
|
|
158
159
|
interface LexiconSelectResult {
|
|
159
160
|
chunks: LexiconSelectedChunk[];
|
|
@@ -161,6 +162,9 @@ interface LexiconSelectResult {
|
|
|
161
162
|
selectedChunks: number;
|
|
162
163
|
droppedByThreshold: number;
|
|
163
164
|
inputChunksDropped: number;
|
|
165
|
+
pastChunks?: LexiconSelectedChunk[];
|
|
166
|
+
reusedDocs?: number;
|
|
167
|
+
storedDocs?: number;
|
|
164
168
|
}
|
|
165
169
|
|
|
166
170
|
declare const ConsolidationVerdictSchema: z.ZodObject<{
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -84,12 +84,6 @@ interface MarketDailyBar {
|
|
|
84
84
|
interface ToolDependencies {
|
|
85
85
|
getLiveConfig: () => ToolConfigSnapshot;
|
|
86
86
|
logger: ToolLogger;
|
|
87
|
-
compactContent: (content: string, opts?: {
|
|
88
|
-
model?: string;
|
|
89
|
-
notify?: (event: string, data?: unknown) => void;
|
|
90
|
-
}) => Promise<{
|
|
91
|
-
text: string;
|
|
92
|
-
}>;
|
|
93
87
|
model?: string;
|
|
94
88
|
notify?: (event: string, data?: unknown) => void;
|
|
95
89
|
getOrFetchHistory?: (ticker: string, from: string, to: string) => Promise<MarketDailyBar[]>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@triplef/agent",
|
|
3
3
|
"description": "tripleF (3F) agent domain — structured-output schemas, prompt builders, and model tools shared across the apps.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"packageManager": "pnpm@11.24.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"format": "prettier --write .",
|
|
46
46
|
"lint": "eslint ./src",
|
|
47
47
|
"lint-staged": "npx lint-staged --allow-empty",
|
|
48
|
-
"ncu:update": "npx npm-check-updates -u --format group",
|
|
48
|
+
"ncu:update": "npx npm-check-updates -u --format group --dep prod,dev,optional,packageManager,peer",
|
|
49
49
|
"ncu:interactive": "npx npm-check-updates -u --interactive --format group",
|
|
50
50
|
"ncu:validate": "npx npm-check-updates -e 2 --packageFile=./package.json",
|
|
51
51
|
"test": "vitest run",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"turndown": "^7.2.4"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"ai": "^7.0.
|
|
63
|
+
"ai": "^7.0.83",
|
|
64
64
|
"zod": "^4.4.3"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|