agent-toolbelt 0.2.3 → 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/dist/index.d.mts +61 -1
- package/dist/index.d.ts +61 -1
- package/dist/index.js +8 -0
- package/dist/index.mjs +8 -0
- package/dist/langchain.js +29 -0
- package/dist/langchain.mjs +29 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -185,6 +185,53 @@ 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
|
+
}
|
|
188
235
|
interface PromptOptimizerResult {
|
|
189
236
|
mode: "improve" | "analyze" | "both";
|
|
190
237
|
model: string;
|
|
@@ -314,6 +361,19 @@ declare class AgentToolbelt {
|
|
|
314
361
|
format?: "hex" | "rgb" | "hsl" | "all";
|
|
315
362
|
includeShades?: boolean;
|
|
316
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>;
|
|
317
377
|
/** Analyze and improve an LLM prompt — scores clarity, specificity, structure, and completeness */
|
|
318
378
|
promptOptimizer(input: {
|
|
319
379
|
prompt: string;
|
|
@@ -343,4 +403,4 @@ declare class AgentToolbelt {
|
|
|
343
403
|
}): Promise<BrandKitResult>;
|
|
344
404
|
}
|
|
345
405
|
|
|
346
|
-
export { type AddressNormalizerResult, AgentToolbelt, type AgentToolbeltOptions, type BrandKitResult, type ColorPaletteResult, type CronBuilderResult, type CsvToJsonResult, type ImageMetadataStripperResult, type MarkdownConverterResult, type MeetingActionItem, type MeetingActionItemsResult, type PromptOptimizerResult, 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,53 @@ 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
|
+
}
|
|
188
235
|
interface PromptOptimizerResult {
|
|
189
236
|
mode: "improve" | "analyze" | "both";
|
|
190
237
|
model: string;
|
|
@@ -314,6 +361,19 @@ declare class AgentToolbelt {
|
|
|
314
361
|
format?: "hex" | "rgb" | "hsl" | "all";
|
|
315
362
|
includeShades?: boolean;
|
|
316
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>;
|
|
317
377
|
/** Analyze and improve an LLM prompt — scores clarity, specificity, structure, and completeness */
|
|
318
378
|
promptOptimizer(input: {
|
|
319
379
|
prompt: string;
|
|
@@ -343,4 +403,4 @@ declare class AgentToolbelt {
|
|
|
343
403
|
}): Promise<BrandKitResult>;
|
|
344
404
|
}
|
|
345
405
|
|
|
346
|
-
export { type AddressNormalizerResult, AgentToolbelt, type AgentToolbeltOptions, type BrandKitResult, type ColorPaletteResult, type CronBuilderResult, type CsvToJsonResult, type ImageMetadataStripperResult, type MarkdownConverterResult, type MeetingActionItem, type MeetingActionItemsResult, type PromptOptimizerResult, 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,14 @@ 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
|
+
}
|
|
93
101
|
/** Analyze and improve an LLM prompt — scores clarity, specificity, structure, and completeness */
|
|
94
102
|
promptOptimizer(input) {
|
|
95
103
|
return this.call("prompt-optimizer", input);
|
package/dist/index.mjs
CHANGED
|
@@ -64,6 +64,14 @@ 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
|
+
}
|
|
67
75
|
/** Analyze and improve an LLM prompt — scores clarity, specificity, structure, and completeness */
|
|
68
76
|
promptOptimizer(input) {
|
|
69
77
|
return this.call("prompt-optimizer", input);
|
package/dist/langchain.js
CHANGED
|
@@ -165,6 +165,35 @@ 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
|
+
}),
|
|
168
197
|
// ---- Prompt Optimizer ----
|
|
169
198
|
new import_tools.DynamicStructuredTool({
|
|
170
199
|
name: "optimize_prompt",
|
package/dist/langchain.mjs
CHANGED
|
@@ -141,6 +141,35 @@ 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
|
+
}),
|
|
144
173
|
// ---- Prompt Optimizer ----
|
|
145
174
|
new DynamicStructuredTool({
|
|
146
175
|
name: "optimize_prompt",
|
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",
|