agent-toolbelt 0.2.2 → 0.2.4
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 +13 -1
- package/dist/index.d.mts +88 -1
- package/dist/index.d.ts +88 -1
- package/dist/index.js +12 -0
- package/dist/index.mjs +12 -0
- package/dist/langchain.js +44 -0
- package/dist/langchain.mjs +44 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Official SDK for [Agent Toolbelt](https://agent-toolbelt-production.up.railway.app) — a suite of focused API tools for AI agents and developers.
|
|
4
4
|
|
|
5
|
-
**Typed client + LangChain tool wrappers** for schema generation, text extraction, token counting, CSV conversion, Markdown conversion, URL metadata, regex building, cron expressions, address normalization, color palette generation,
|
|
5
|
+
**Typed client + LangChain tool wrappers** for schema generation, text extraction, token counting, CSV conversion, Markdown conversion, URL metadata, regex building, cron expressions, address normalization, color palette generation, brand kit creation, meeting action item extraction, and prompt optimization.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -121,6 +121,12 @@ await client.colorPalette({ description: "calm fintech blue", count: 5 });
|
|
|
121
121
|
|
|
122
122
|
// Generate a full brand kit — colors, typography, CSS/Tailwind tokens
|
|
123
123
|
await client.brandKit({ name: "Solaris Health", industry: "healthcare", vibe: ["modern", "trustworthy"], format: "full" });
|
|
124
|
+
|
|
125
|
+
// Extract action items, decisions, and summary from meeting notes
|
|
126
|
+
await client.meetingActionItems({ notes: transcript, format: "full", participants: ["Sarah", "John"] });
|
|
127
|
+
|
|
128
|
+
// Analyze and improve an LLM prompt
|
|
129
|
+
await client.promptOptimizer({ prompt: "Summarize this and tell me the main points.", model: "gpt-4o", mode: "both" });
|
|
124
130
|
```
|
|
125
131
|
|
|
126
132
|
---
|
|
@@ -163,6 +169,9 @@ const result = await agent.invoke({
|
|
|
163
169
|
| `normalize_address` | Normalize US addresses to USPS format |
|
|
164
170
|
| `generate_color_palette` | Generate color palettes with WCAG scores and CSS variables |
|
|
165
171
|
| `generate_brand_kit` | Generate full brand kit — colors, typography, CSS/Tailwind tokens |
|
|
172
|
+
| `strip_image_metadata` | Strip EXIF/GPS/IPTC/XMP metadata from images for privacy |
|
|
173
|
+
| `extract_meeting_action_items` | Extract action items, decisions, and summary from meeting notes |
|
|
174
|
+
| `optimize_prompt` | Analyze and improve LLM prompts with scores and rewrite |
|
|
166
175
|
|
|
167
176
|
---
|
|
168
177
|
|
|
@@ -181,6 +190,9 @@ const result = await agent.invoke({
|
|
|
181
190
|
| `address-normalizer` | $0.0005 / call |
|
|
182
191
|
| `color-palette` | $0.0005 / call |
|
|
183
192
|
| `brand-kit` | $0.001 / call |
|
|
193
|
+
| `image-metadata-stripper` | $0.001 / call |
|
|
194
|
+
| `meeting-action-items` | $0.05 / call |
|
|
195
|
+
| `prompt-optimizer` | $0.05 / call |
|
|
184
196
|
|
|
185
197
|
## License
|
|
186
198
|
|
package/dist/index.d.mts
CHANGED
|
@@ -185,6 +185,73 @@ interface BrandKitResult {
|
|
|
185
185
|
googleFontsUrl?: string;
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
+
interface DocumentComparatorResult {
|
|
189
|
+
mode: string;
|
|
190
|
+
summary: string;
|
|
191
|
+
overallAssessment: "minor" | "moderate" | "major";
|
|
192
|
+
analysis?: string;
|
|
193
|
+
additions?: Array<{
|
|
194
|
+
description: string;
|
|
195
|
+
content: string;
|
|
196
|
+
significance: "high" | "medium" | "low";
|
|
197
|
+
}>;
|
|
198
|
+
deletions?: Array<{
|
|
199
|
+
description: string;
|
|
200
|
+
content: string;
|
|
201
|
+
significance: "high" | "medium" | "low";
|
|
202
|
+
}>;
|
|
203
|
+
modifications?: Array<{
|
|
204
|
+
description: string;
|
|
205
|
+
before: string;
|
|
206
|
+
after: string;
|
|
207
|
+
significance: "high" | "medium" | "low";
|
|
208
|
+
}>;
|
|
209
|
+
stats: {
|
|
210
|
+
additions: number;
|
|
211
|
+
deletions: number;
|
|
212
|
+
modifications: number;
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
interface ContractClauseResult {
|
|
216
|
+
found: boolean;
|
|
217
|
+
summary?: string;
|
|
218
|
+
excerpt?: string | null;
|
|
219
|
+
details?: Record<string, unknown>;
|
|
220
|
+
}
|
|
221
|
+
interface ContractRiskFlag {
|
|
222
|
+
clause: string;
|
|
223
|
+
issue: string;
|
|
224
|
+
severity: "high" | "medium" | "low";
|
|
225
|
+
excerpt: string;
|
|
226
|
+
}
|
|
227
|
+
interface ContractClauseExtractorResult {
|
|
228
|
+
contractType: string;
|
|
229
|
+
clausesRequested: number;
|
|
230
|
+
clausesFound: number;
|
|
231
|
+
clauses: Record<string, ContractClauseResult>;
|
|
232
|
+
riskFlags?: ContractRiskFlag[];
|
|
233
|
+
riskSummary?: string;
|
|
234
|
+
}
|
|
235
|
+
interface PromptOptimizerResult {
|
|
236
|
+
mode: "improve" | "analyze" | "both";
|
|
237
|
+
model: string;
|
|
238
|
+
scores?: {
|
|
239
|
+
clarity: number;
|
|
240
|
+
specificity: number;
|
|
241
|
+
structure: number;
|
|
242
|
+
completeness: number;
|
|
243
|
+
overall: number;
|
|
244
|
+
};
|
|
245
|
+
issues?: string[];
|
|
246
|
+
suggestions?: string[];
|
|
247
|
+
improvedPrompt?: string;
|
|
248
|
+
changesSummary?: string[];
|
|
249
|
+
tokenStats: {
|
|
250
|
+
original: number;
|
|
251
|
+
improved?: number;
|
|
252
|
+
delta?: number;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
188
255
|
interface MeetingActionItem {
|
|
189
256
|
id: number;
|
|
190
257
|
owner: string;
|
|
@@ -294,6 +361,26 @@ declare class AgentToolbelt {
|
|
|
294
361
|
format?: "hex" | "rgb" | "hsl" | "all";
|
|
295
362
|
includeShades?: boolean;
|
|
296
363
|
}): Promise<ColorPaletteResult>;
|
|
364
|
+
/** Compare two document versions and produce a semantic diff */
|
|
365
|
+
documentComparator(input: {
|
|
366
|
+
original: string;
|
|
367
|
+
revised: string;
|
|
368
|
+
mode?: "summary" | "detailed" | "structured";
|
|
369
|
+
context?: string;
|
|
370
|
+
}): Promise<DocumentComparatorResult>;
|
|
371
|
+
/** Extract and analyze key clauses from a contract or legal document */
|
|
372
|
+
contractClauseExtractor(input: {
|
|
373
|
+
contract: string;
|
|
374
|
+
clauses?: Array<"parties" | "dates" | "payment_terms" | "termination" | "liability" | "ip_ownership" | "confidentiality" | "governing_law" | "penalties" | "renewal" | "warranties" | "dispute_resolution">;
|
|
375
|
+
flagRisks?: boolean;
|
|
376
|
+
}): Promise<ContractClauseExtractorResult>;
|
|
377
|
+
/** Analyze and improve an LLM prompt — scores clarity, specificity, structure, and completeness */
|
|
378
|
+
promptOptimizer(input: {
|
|
379
|
+
prompt: string;
|
|
380
|
+
model?: string;
|
|
381
|
+
task?: string;
|
|
382
|
+
mode?: "improve" | "analyze" | "both";
|
|
383
|
+
}): Promise<PromptOptimizerResult>;
|
|
297
384
|
/** Extract action items, decisions, and summary from meeting notes or transcripts */
|
|
298
385
|
meetingActionItems(input: {
|
|
299
386
|
notes: string;
|
|
@@ -316,4 +403,4 @@ declare class AgentToolbelt {
|
|
|
316
403
|
}): Promise<BrandKitResult>;
|
|
317
404
|
}
|
|
318
405
|
|
|
319
|
-
export { type AddressNormalizerResult, AgentToolbelt, type AgentToolbeltOptions, type BrandKitResult, type ColorPaletteResult, type CronBuilderResult, type CsvToJsonResult, type ImageMetadataStripperResult, type MarkdownConverterResult, type MeetingActionItem, type MeetingActionItemsResult, type RegexBuilderResult, type SchemaGeneratorResult, type TextExtractorResult, type TokenCountResult, type UrlMetadataResult };
|
|
406
|
+
export { type AddressNormalizerResult, AgentToolbelt, type AgentToolbeltOptions, type BrandKitResult, type ColorPaletteResult, type ContractClauseExtractorResult, type ContractClauseResult, type ContractRiskFlag, type CronBuilderResult, type CsvToJsonResult, type DocumentComparatorResult, type ImageMetadataStripperResult, type MarkdownConverterResult, type MeetingActionItem, type MeetingActionItemsResult, type PromptOptimizerResult, type RegexBuilderResult, type SchemaGeneratorResult, type TextExtractorResult, type TokenCountResult, type UrlMetadataResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -185,6 +185,73 @@ interface BrandKitResult {
|
|
|
185
185
|
googleFontsUrl?: string;
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
+
interface DocumentComparatorResult {
|
|
189
|
+
mode: string;
|
|
190
|
+
summary: string;
|
|
191
|
+
overallAssessment: "minor" | "moderate" | "major";
|
|
192
|
+
analysis?: string;
|
|
193
|
+
additions?: Array<{
|
|
194
|
+
description: string;
|
|
195
|
+
content: string;
|
|
196
|
+
significance: "high" | "medium" | "low";
|
|
197
|
+
}>;
|
|
198
|
+
deletions?: Array<{
|
|
199
|
+
description: string;
|
|
200
|
+
content: string;
|
|
201
|
+
significance: "high" | "medium" | "low";
|
|
202
|
+
}>;
|
|
203
|
+
modifications?: Array<{
|
|
204
|
+
description: string;
|
|
205
|
+
before: string;
|
|
206
|
+
after: string;
|
|
207
|
+
significance: "high" | "medium" | "low";
|
|
208
|
+
}>;
|
|
209
|
+
stats: {
|
|
210
|
+
additions: number;
|
|
211
|
+
deletions: number;
|
|
212
|
+
modifications: number;
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
interface ContractClauseResult {
|
|
216
|
+
found: boolean;
|
|
217
|
+
summary?: string;
|
|
218
|
+
excerpt?: string | null;
|
|
219
|
+
details?: Record<string, unknown>;
|
|
220
|
+
}
|
|
221
|
+
interface ContractRiskFlag {
|
|
222
|
+
clause: string;
|
|
223
|
+
issue: string;
|
|
224
|
+
severity: "high" | "medium" | "low";
|
|
225
|
+
excerpt: string;
|
|
226
|
+
}
|
|
227
|
+
interface ContractClauseExtractorResult {
|
|
228
|
+
contractType: string;
|
|
229
|
+
clausesRequested: number;
|
|
230
|
+
clausesFound: number;
|
|
231
|
+
clauses: Record<string, ContractClauseResult>;
|
|
232
|
+
riskFlags?: ContractRiskFlag[];
|
|
233
|
+
riskSummary?: string;
|
|
234
|
+
}
|
|
235
|
+
interface PromptOptimizerResult {
|
|
236
|
+
mode: "improve" | "analyze" | "both";
|
|
237
|
+
model: string;
|
|
238
|
+
scores?: {
|
|
239
|
+
clarity: number;
|
|
240
|
+
specificity: number;
|
|
241
|
+
structure: number;
|
|
242
|
+
completeness: number;
|
|
243
|
+
overall: number;
|
|
244
|
+
};
|
|
245
|
+
issues?: string[];
|
|
246
|
+
suggestions?: string[];
|
|
247
|
+
improvedPrompt?: string;
|
|
248
|
+
changesSummary?: string[];
|
|
249
|
+
tokenStats: {
|
|
250
|
+
original: number;
|
|
251
|
+
improved?: number;
|
|
252
|
+
delta?: number;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
188
255
|
interface MeetingActionItem {
|
|
189
256
|
id: number;
|
|
190
257
|
owner: string;
|
|
@@ -294,6 +361,26 @@ declare class AgentToolbelt {
|
|
|
294
361
|
format?: "hex" | "rgb" | "hsl" | "all";
|
|
295
362
|
includeShades?: boolean;
|
|
296
363
|
}): Promise<ColorPaletteResult>;
|
|
364
|
+
/** Compare two document versions and produce a semantic diff */
|
|
365
|
+
documentComparator(input: {
|
|
366
|
+
original: string;
|
|
367
|
+
revised: string;
|
|
368
|
+
mode?: "summary" | "detailed" | "structured";
|
|
369
|
+
context?: string;
|
|
370
|
+
}): Promise<DocumentComparatorResult>;
|
|
371
|
+
/** Extract and analyze key clauses from a contract or legal document */
|
|
372
|
+
contractClauseExtractor(input: {
|
|
373
|
+
contract: string;
|
|
374
|
+
clauses?: Array<"parties" | "dates" | "payment_terms" | "termination" | "liability" | "ip_ownership" | "confidentiality" | "governing_law" | "penalties" | "renewal" | "warranties" | "dispute_resolution">;
|
|
375
|
+
flagRisks?: boolean;
|
|
376
|
+
}): Promise<ContractClauseExtractorResult>;
|
|
377
|
+
/** Analyze and improve an LLM prompt — scores clarity, specificity, structure, and completeness */
|
|
378
|
+
promptOptimizer(input: {
|
|
379
|
+
prompt: string;
|
|
380
|
+
model?: string;
|
|
381
|
+
task?: string;
|
|
382
|
+
mode?: "improve" | "analyze" | "both";
|
|
383
|
+
}): Promise<PromptOptimizerResult>;
|
|
297
384
|
/** Extract action items, decisions, and summary from meeting notes or transcripts */
|
|
298
385
|
meetingActionItems(input: {
|
|
299
386
|
notes: string;
|
|
@@ -316,4 +403,4 @@ declare class AgentToolbelt {
|
|
|
316
403
|
}): Promise<BrandKitResult>;
|
|
317
404
|
}
|
|
318
405
|
|
|
319
|
-
export { type AddressNormalizerResult, AgentToolbelt, type AgentToolbeltOptions, type BrandKitResult, type ColorPaletteResult, type CronBuilderResult, type CsvToJsonResult, type ImageMetadataStripperResult, type MarkdownConverterResult, type MeetingActionItem, type MeetingActionItemsResult, type RegexBuilderResult, type SchemaGeneratorResult, type TextExtractorResult, type TokenCountResult, type UrlMetadataResult };
|
|
406
|
+
export { type AddressNormalizerResult, AgentToolbelt, type AgentToolbeltOptions, type BrandKitResult, type ColorPaletteResult, type ContractClauseExtractorResult, type ContractClauseResult, type ContractRiskFlag, type CronBuilderResult, type CsvToJsonResult, type DocumentComparatorResult, type ImageMetadataStripperResult, type MarkdownConverterResult, type MeetingActionItem, type MeetingActionItemsResult, type PromptOptimizerResult, type RegexBuilderResult, type SchemaGeneratorResult, type TextExtractorResult, type TokenCountResult, type UrlMetadataResult };
|
package/dist/index.js
CHANGED
|
@@ -90,6 +90,18 @@ var AgentToolbelt = class {
|
|
|
90
90
|
colorPalette(input) {
|
|
91
91
|
return this.call("color-palette", input);
|
|
92
92
|
}
|
|
93
|
+
/** Compare two document versions and produce a semantic diff */
|
|
94
|
+
documentComparator(input) {
|
|
95
|
+
return this.call("document-comparator", input);
|
|
96
|
+
}
|
|
97
|
+
/** Extract and analyze key clauses from a contract or legal document */
|
|
98
|
+
contractClauseExtractor(input) {
|
|
99
|
+
return this.call("contract-clause-extractor", input);
|
|
100
|
+
}
|
|
101
|
+
/** Analyze and improve an LLM prompt — scores clarity, specificity, structure, and completeness */
|
|
102
|
+
promptOptimizer(input) {
|
|
103
|
+
return this.call("prompt-optimizer", input);
|
|
104
|
+
}
|
|
93
105
|
/** Extract action items, decisions, and summary from meeting notes or transcripts */
|
|
94
106
|
meetingActionItems(input) {
|
|
95
107
|
return this.call("meeting-action-items", input);
|
package/dist/index.mjs
CHANGED
|
@@ -64,6 +64,18 @@ var AgentToolbelt = class {
|
|
|
64
64
|
colorPalette(input) {
|
|
65
65
|
return this.call("color-palette", input);
|
|
66
66
|
}
|
|
67
|
+
/** Compare two document versions and produce a semantic diff */
|
|
68
|
+
documentComparator(input) {
|
|
69
|
+
return this.call("document-comparator", input);
|
|
70
|
+
}
|
|
71
|
+
/** Extract and analyze key clauses from a contract or legal document */
|
|
72
|
+
contractClauseExtractor(input) {
|
|
73
|
+
return this.call("contract-clause-extractor", input);
|
|
74
|
+
}
|
|
75
|
+
/** Analyze and improve an LLM prompt — scores clarity, specificity, structure, and completeness */
|
|
76
|
+
promptOptimizer(input) {
|
|
77
|
+
return this.call("prompt-optimizer", input);
|
|
78
|
+
}
|
|
67
79
|
/** Extract action items, decisions, and summary from meeting notes or transcripts */
|
|
68
80
|
meetingActionItems(input) {
|
|
69
81
|
return this.call("meeting-action-items", input);
|
package/dist/langchain.js
CHANGED
|
@@ -165,6 +165,50 @@ function createLangChainTools(client) {
|
|
|
165
165
|
return JSON.stringify(result);
|
|
166
166
|
}
|
|
167
167
|
}),
|
|
168
|
+
// ---- Document Comparator ----
|
|
169
|
+
new import_tools.DynamicStructuredTool({
|
|
170
|
+
name: "compare_documents",
|
|
171
|
+
description: "Compare two versions of a document and produce a semantic diff. Use this to understand what changed between drafts, versions, or revisions of any text document \u2014 contracts, READMEs, policies, essays, terms of service, code documentation, etc. Returns additions, deletions, and modifications with significance ratings and an overall change assessment. The 'structured' mode gives a categorized breakdown; 'summary' gives a quick overview; 'detailed' gives full prose analysis.",
|
|
172
|
+
schema: import_zod.z.object({
|
|
173
|
+
original: import_zod.z.string().describe("The original version of the document"),
|
|
174
|
+
revised: import_zod.z.string().describe("The revised version of the document"),
|
|
175
|
+
mode: import_zod.z.enum(["summary", "detailed", "structured"]).default("structured").describe("Output format: 'structured' (categorized lists), 'detailed' (prose), 'summary' (brief overview)"),
|
|
176
|
+
context: import_zod.z.string().optional().describe("Document type for more relevant analysis (e.g. 'terms of service', 'employment contract')")
|
|
177
|
+
}),
|
|
178
|
+
func: async ({ original, revised, mode, context }) => {
|
|
179
|
+
const result = await client.documentComparator({ original, revised, mode, context });
|
|
180
|
+
return JSON.stringify(result);
|
|
181
|
+
}
|
|
182
|
+
}),
|
|
183
|
+
// ---- Contract Clause Extractor ----
|
|
184
|
+
new import_tools.DynamicStructuredTool({
|
|
185
|
+
name: "extract_contract_clauses",
|
|
186
|
+
description: "Extract and analyze key clauses from a contract or legal document. Use this to quickly understand the key terms in any legal agreement \u2014 who the parties are, payment terms, termination conditions, liability caps, IP ownership, confidentiality obligations, and more. Optionally flags risky or one-sided clauses with severity ratings and plain-language explanations. Ideal for contract review, due diligence, or surfacing terms that need negotiation.",
|
|
187
|
+
schema: import_zod.z.object({
|
|
188
|
+
contract: import_zod.z.string().describe("The contract or legal document text to analyze"),
|
|
189
|
+
clauses: import_zod.z.array(import_zod.z.enum(["parties", "dates", "payment_terms", "termination", "liability", "ip_ownership", "confidentiality", "governing_law", "penalties", "renewal", "warranties", "dispute_resolution"])).default(["parties", "dates", "payment_terms", "termination", "liability", "ip_ownership", "confidentiality", "governing_law", "penalties", "renewal", "warranties", "dispute_resolution"]).describe("Which clause types to extract"),
|
|
190
|
+
flagRisks: import_zod.z.boolean().default(true).describe("Flag clauses that may be unfavorable or risky")
|
|
191
|
+
}),
|
|
192
|
+
func: async ({ contract, clauses, flagRisks }) => {
|
|
193
|
+
const result = await client.contractClauseExtractor({ contract, clauses, flagRisks });
|
|
194
|
+
return JSON.stringify(result);
|
|
195
|
+
}
|
|
196
|
+
}),
|
|
197
|
+
// ---- Prompt Optimizer ----
|
|
198
|
+
new import_tools.DynamicStructuredTool({
|
|
199
|
+
name: "optimize_prompt",
|
|
200
|
+
description: "Analyze and improve an LLM prompt for clarity, specificity, structure, and completeness. Use this when a prompt isn't performing well, to prepare prompts before deploying them, or to learn what makes a good prompt for a specific model. Returns scores (1-10) for each quality dimension, a list of issues found, an improved rewrite, and a summary of what changed and why. Supports targeting specific models: gpt-4o, claude-3-5-sonnet, gpt-3.5-turbo, etc.",
|
|
201
|
+
schema: import_zod.z.object({
|
|
202
|
+
prompt: import_zod.z.string().describe("The LLM prompt to analyze and/or improve"),
|
|
203
|
+
model: import_zod.z.string().default("gpt-4o").describe("Target model to optimize for"),
|
|
204
|
+
task: import_zod.z.string().optional().describe("What this prompt is trying to accomplish (helps generate targeted suggestions)"),
|
|
205
|
+
mode: import_zod.z.enum(["improve", "analyze", "both"]).default("both").describe("'both' returns analysis + improved prompt; 'analyze' scores only; 'improve' rewrites only")
|
|
206
|
+
}),
|
|
207
|
+
func: async ({ prompt, model, task, mode }) => {
|
|
208
|
+
const result = await client.promptOptimizer({ prompt, model, task, mode });
|
|
209
|
+
return JSON.stringify(result);
|
|
210
|
+
}
|
|
211
|
+
}),
|
|
168
212
|
// ---- Meeting Action Items ----
|
|
169
213
|
new import_tools.DynamicStructuredTool({
|
|
170
214
|
name: "extract_meeting_action_items",
|
package/dist/langchain.mjs
CHANGED
|
@@ -141,6 +141,50 @@ function createLangChainTools(client) {
|
|
|
141
141
|
return JSON.stringify(result);
|
|
142
142
|
}
|
|
143
143
|
}),
|
|
144
|
+
// ---- Document Comparator ----
|
|
145
|
+
new DynamicStructuredTool({
|
|
146
|
+
name: "compare_documents",
|
|
147
|
+
description: "Compare two versions of a document and produce a semantic diff. Use this to understand what changed between drafts, versions, or revisions of any text document \u2014 contracts, READMEs, policies, essays, terms of service, code documentation, etc. Returns additions, deletions, and modifications with significance ratings and an overall change assessment. The 'structured' mode gives a categorized breakdown; 'summary' gives a quick overview; 'detailed' gives full prose analysis.",
|
|
148
|
+
schema: z.object({
|
|
149
|
+
original: z.string().describe("The original version of the document"),
|
|
150
|
+
revised: z.string().describe("The revised version of the document"),
|
|
151
|
+
mode: z.enum(["summary", "detailed", "structured"]).default("structured").describe("Output format: 'structured' (categorized lists), 'detailed' (prose), 'summary' (brief overview)"),
|
|
152
|
+
context: z.string().optional().describe("Document type for more relevant analysis (e.g. 'terms of service', 'employment contract')")
|
|
153
|
+
}),
|
|
154
|
+
func: async ({ original, revised, mode, context }) => {
|
|
155
|
+
const result = await client.documentComparator({ original, revised, mode, context });
|
|
156
|
+
return JSON.stringify(result);
|
|
157
|
+
}
|
|
158
|
+
}),
|
|
159
|
+
// ---- Contract Clause Extractor ----
|
|
160
|
+
new DynamicStructuredTool({
|
|
161
|
+
name: "extract_contract_clauses",
|
|
162
|
+
description: "Extract and analyze key clauses from a contract or legal document. Use this to quickly understand the key terms in any legal agreement \u2014 who the parties are, payment terms, termination conditions, liability caps, IP ownership, confidentiality obligations, and more. Optionally flags risky or one-sided clauses with severity ratings and plain-language explanations. Ideal for contract review, due diligence, or surfacing terms that need negotiation.",
|
|
163
|
+
schema: z.object({
|
|
164
|
+
contract: z.string().describe("The contract or legal document text to analyze"),
|
|
165
|
+
clauses: z.array(z.enum(["parties", "dates", "payment_terms", "termination", "liability", "ip_ownership", "confidentiality", "governing_law", "penalties", "renewal", "warranties", "dispute_resolution"])).default(["parties", "dates", "payment_terms", "termination", "liability", "ip_ownership", "confidentiality", "governing_law", "penalties", "renewal", "warranties", "dispute_resolution"]).describe("Which clause types to extract"),
|
|
166
|
+
flagRisks: z.boolean().default(true).describe("Flag clauses that may be unfavorable or risky")
|
|
167
|
+
}),
|
|
168
|
+
func: async ({ contract, clauses, flagRisks }) => {
|
|
169
|
+
const result = await client.contractClauseExtractor({ contract, clauses, flagRisks });
|
|
170
|
+
return JSON.stringify(result);
|
|
171
|
+
}
|
|
172
|
+
}),
|
|
173
|
+
// ---- Prompt Optimizer ----
|
|
174
|
+
new DynamicStructuredTool({
|
|
175
|
+
name: "optimize_prompt",
|
|
176
|
+
description: "Analyze and improve an LLM prompt for clarity, specificity, structure, and completeness. Use this when a prompt isn't performing well, to prepare prompts before deploying them, or to learn what makes a good prompt for a specific model. Returns scores (1-10) for each quality dimension, a list of issues found, an improved rewrite, and a summary of what changed and why. Supports targeting specific models: gpt-4o, claude-3-5-sonnet, gpt-3.5-turbo, etc.",
|
|
177
|
+
schema: z.object({
|
|
178
|
+
prompt: z.string().describe("The LLM prompt to analyze and/or improve"),
|
|
179
|
+
model: z.string().default("gpt-4o").describe("Target model to optimize for"),
|
|
180
|
+
task: z.string().optional().describe("What this prompt is trying to accomplish (helps generate targeted suggestions)"),
|
|
181
|
+
mode: z.enum(["improve", "analyze", "both"]).default("both").describe("'both' returns analysis + improved prompt; 'analyze' scores only; 'improve' rewrites only")
|
|
182
|
+
}),
|
|
183
|
+
func: async ({ prompt, model, task, mode }) => {
|
|
184
|
+
const result = await client.promptOptimizer({ prompt, model, task, mode });
|
|
185
|
+
return JSON.stringify(result);
|
|
186
|
+
}
|
|
187
|
+
}),
|
|
144
188
|
// ---- Meeting Action Items ----
|
|
145
189
|
new DynamicStructuredTool({
|
|
146
190
|
name: "extract_meeting_action_items",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-toolbelt",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Official SDK for Agent Toolbelt — typed API client and LangChain tool wrappers for schema generation, text extraction, token counting, CSV conversion, and more.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|