@agentforge/tools 0.15.4 → 0.15.6
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.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +67 -65
- package/dist/index.d.ts +67 -65
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -3069,6 +3069,8 @@ interface Neo4jToolsConfig {
|
|
|
3069
3069
|
* Manages Neo4j driver connections with pooling and health checks.
|
|
3070
3070
|
*/
|
|
3071
3071
|
|
|
3072
|
+
type Neo4jQueryResult = any;
|
|
3073
|
+
type Neo4jQueryParameters = Record<string, unknown>;
|
|
3072
3074
|
/**
|
|
3073
3075
|
* Neo4j connection pool singleton
|
|
3074
3076
|
*/
|
|
@@ -3090,15 +3092,15 @@ declare class Neo4jConnectionPool {
|
|
|
3090
3092
|
/**
|
|
3091
3093
|
* Execute a query with automatic session management
|
|
3092
3094
|
*/
|
|
3093
|
-
executeQuery<T =
|
|
3095
|
+
executeQuery<T = Neo4jQueryResult>(cypher: string, parameters?: Neo4jQueryParameters, database?: string): Promise<T[]>;
|
|
3094
3096
|
/**
|
|
3095
3097
|
* Execute a read query
|
|
3096
3098
|
*/
|
|
3097
|
-
executeReadQuery<T =
|
|
3099
|
+
executeReadQuery<T = Neo4jQueryResult>(cypher: string, parameters?: Neo4jQueryParameters, database?: string): Promise<T[]>;
|
|
3098
3100
|
/**
|
|
3099
3101
|
* Execute a write query
|
|
3100
3102
|
*/
|
|
3101
|
-
executeWriteQuery<T =
|
|
3103
|
+
executeWriteQuery<T = Neo4jQueryResult>(cypher: string, parameters?: Neo4jQueryParameters, database?: string): Promise<T[]>;
|
|
3102
3104
|
/**
|
|
3103
3105
|
* Check if driver is initialized
|
|
3104
3106
|
*/
|
|
@@ -3373,7 +3375,7 @@ declare function createNeo4jQueryTool(): _agentforge_core.Tool<{
|
|
|
3373
3375
|
query?: undefined;
|
|
3374
3376
|
} | {
|
|
3375
3377
|
success: boolean;
|
|
3376
|
-
data:
|
|
3378
|
+
data: Record<string, unknown>[];
|
|
3377
3379
|
recordCount: number;
|
|
3378
3380
|
summary: {
|
|
3379
3381
|
query: string;
|
|
@@ -3464,7 +3466,7 @@ declare function createNeo4jFindNodesTool(): _agentforge_core.Tool<{
|
|
|
3464
3466
|
query?: undefined;
|
|
3465
3467
|
} | {
|
|
3466
3468
|
success: boolean;
|
|
3467
|
-
nodes:
|
|
3469
|
+
nodes: unknown[];
|
|
3468
3470
|
count: number;
|
|
3469
3471
|
query: {
|
|
3470
3472
|
label: string;
|
|
@@ -3508,10 +3510,10 @@ declare function createNeo4jTraverseTool(): _agentforge_core.Tool<{
|
|
|
3508
3510
|
} | {
|
|
3509
3511
|
success: boolean;
|
|
3510
3512
|
paths: {
|
|
3511
|
-
start:
|
|
3512
|
-
end:
|
|
3513
|
-
relationships:
|
|
3514
|
-
depth:
|
|
3513
|
+
start: unknown;
|
|
3514
|
+
end: unknown;
|
|
3515
|
+
relationships: unknown;
|
|
3516
|
+
depth: unknown;
|
|
3515
3517
|
}[];
|
|
3516
3518
|
count: number;
|
|
3517
3519
|
query: {
|
|
@@ -3556,8 +3558,8 @@ declare function createNeo4jVectorSearchTool(): _agentforge_core.Tool<{
|
|
|
3556
3558
|
} | {
|
|
3557
3559
|
success: boolean;
|
|
3558
3560
|
results: {
|
|
3559
|
-
node:
|
|
3560
|
-
score:
|
|
3561
|
+
node: unknown;
|
|
3562
|
+
score: unknown;
|
|
3561
3563
|
}[];
|
|
3562
3564
|
count: number;
|
|
3563
3565
|
query: {
|
|
@@ -3603,8 +3605,8 @@ declare function createNeo4jVectorSearchWithEmbeddingTool(): _agentforge_core.To
|
|
|
3603
3605
|
} | {
|
|
3604
3606
|
success: boolean;
|
|
3605
3607
|
results: {
|
|
3606
|
-
node:
|
|
3607
|
-
score:
|
|
3608
|
+
node: unknown;
|
|
3609
|
+
score: unknown;
|
|
3608
3610
|
}[];
|
|
3609
3611
|
count: number;
|
|
3610
3612
|
query: {
|
|
@@ -3663,8 +3665,8 @@ declare function createNeo4jCreateNodeWithEmbeddingTool(): _agentforge_core.Tool
|
|
|
3663
3665
|
message?: undefined;
|
|
3664
3666
|
} | {
|
|
3665
3667
|
success: boolean;
|
|
3666
|
-
node:
|
|
3667
|
-
nodeId:
|
|
3668
|
+
node: unknown;
|
|
3669
|
+
nodeId: unknown;
|
|
3668
3670
|
embedding: {
|
|
3669
3671
|
model: string;
|
|
3670
3672
|
dimensions: number;
|
|
@@ -3694,7 +3696,7 @@ declare const neo4jQuery: _agentforge_core.Tool<{
|
|
|
3694
3696
|
query?: undefined;
|
|
3695
3697
|
} | {
|
|
3696
3698
|
success: boolean;
|
|
3697
|
-
data:
|
|
3699
|
+
data: Record<string, unknown>[];
|
|
3698
3700
|
recordCount: number;
|
|
3699
3701
|
summary: {
|
|
3700
3702
|
query: string;
|
|
@@ -3773,7 +3775,7 @@ declare const neo4jFindNodes: _agentforge_core.Tool<{
|
|
|
3773
3775
|
query?: undefined;
|
|
3774
3776
|
} | {
|
|
3775
3777
|
success: boolean;
|
|
3776
|
-
nodes:
|
|
3778
|
+
nodes: unknown[];
|
|
3777
3779
|
count: number;
|
|
3778
3780
|
query: {
|
|
3779
3781
|
label: string;
|
|
@@ -3811,10 +3813,10 @@ declare const neo4jTraverse: _agentforge_core.Tool<{
|
|
|
3811
3813
|
} | {
|
|
3812
3814
|
success: boolean;
|
|
3813
3815
|
paths: {
|
|
3814
|
-
start:
|
|
3815
|
-
end:
|
|
3816
|
-
relationships:
|
|
3817
|
-
depth:
|
|
3816
|
+
start: unknown;
|
|
3817
|
+
end: unknown;
|
|
3818
|
+
relationships: unknown;
|
|
3819
|
+
depth: unknown;
|
|
3818
3820
|
}[];
|
|
3819
3821
|
count: number;
|
|
3820
3822
|
query: {
|
|
@@ -3853,8 +3855,8 @@ declare const neo4jVectorSearch: _agentforge_core.Tool<{
|
|
|
3853
3855
|
} | {
|
|
3854
3856
|
success: boolean;
|
|
3855
3857
|
results: {
|
|
3856
|
-
node:
|
|
3857
|
-
score:
|
|
3858
|
+
node: unknown;
|
|
3859
|
+
score: unknown;
|
|
3858
3860
|
}[];
|
|
3859
3861
|
count: number;
|
|
3860
3862
|
query: {
|
|
@@ -3893,8 +3895,8 @@ declare const neo4jVectorSearchWithEmbedding: _agentforge_core.Tool<{
|
|
|
3893
3895
|
} | {
|
|
3894
3896
|
success: boolean;
|
|
3895
3897
|
results: {
|
|
3896
|
-
node:
|
|
3897
|
-
score:
|
|
3898
|
+
node: unknown;
|
|
3899
|
+
score: unknown;
|
|
3898
3900
|
}[];
|
|
3899
3901
|
count: number;
|
|
3900
3902
|
query: {
|
|
@@ -3946,8 +3948,8 @@ declare const neo4jCreateNodeWithEmbedding: _agentforge_core.Tool<{
|
|
|
3946
3948
|
message?: undefined;
|
|
3947
3949
|
} | {
|
|
3948
3950
|
success: boolean;
|
|
3949
|
-
node:
|
|
3950
|
-
nodeId:
|
|
3951
|
+
node: unknown;
|
|
3952
|
+
nodeId: unknown;
|
|
3951
3953
|
embedding: {
|
|
3952
3954
|
model: string;
|
|
3953
3955
|
dimensions: number;
|
|
@@ -3976,7 +3978,7 @@ declare const neo4jTools: (_agentforge_core.Tool<{
|
|
|
3976
3978
|
query?: undefined;
|
|
3977
3979
|
} | {
|
|
3978
3980
|
success: boolean;
|
|
3979
|
-
data:
|
|
3981
|
+
data: Record<string, unknown>[];
|
|
3980
3982
|
recordCount: number;
|
|
3981
3983
|
summary: {
|
|
3982
3984
|
query: string;
|
|
@@ -4047,7 +4049,7 @@ declare const neo4jTools: (_agentforge_core.Tool<{
|
|
|
4047
4049
|
query?: undefined;
|
|
4048
4050
|
} | {
|
|
4049
4051
|
success: boolean;
|
|
4050
|
-
nodes:
|
|
4052
|
+
nodes: unknown[];
|
|
4051
4053
|
count: number;
|
|
4052
4054
|
query: {
|
|
4053
4055
|
label: string;
|
|
@@ -4081,10 +4083,10 @@ declare const neo4jTools: (_agentforge_core.Tool<{
|
|
|
4081
4083
|
} | {
|
|
4082
4084
|
success: boolean;
|
|
4083
4085
|
paths: {
|
|
4084
|
-
start:
|
|
4085
|
-
end:
|
|
4086
|
-
relationships:
|
|
4087
|
-
depth:
|
|
4086
|
+
start: unknown;
|
|
4087
|
+
end: unknown;
|
|
4088
|
+
relationships: unknown;
|
|
4089
|
+
depth: unknown;
|
|
4088
4090
|
}[];
|
|
4089
4091
|
count: number;
|
|
4090
4092
|
query: {
|
|
@@ -4119,8 +4121,8 @@ declare const neo4jTools: (_agentforge_core.Tool<{
|
|
|
4119
4121
|
} | {
|
|
4120
4122
|
success: boolean;
|
|
4121
4123
|
results: {
|
|
4122
|
-
node:
|
|
4123
|
-
score:
|
|
4124
|
+
node: unknown;
|
|
4125
|
+
score: unknown;
|
|
4124
4126
|
}[];
|
|
4125
4127
|
count: number;
|
|
4126
4128
|
query: {
|
|
@@ -4155,8 +4157,8 @@ declare const neo4jTools: (_agentforge_core.Tool<{
|
|
|
4155
4157
|
} | {
|
|
4156
4158
|
success: boolean;
|
|
4157
4159
|
results: {
|
|
4158
|
-
node:
|
|
4159
|
-
score:
|
|
4160
|
+
node: unknown;
|
|
4161
|
+
score: unknown;
|
|
4160
4162
|
}[];
|
|
4161
4163
|
count: number;
|
|
4162
4164
|
query: {
|
|
@@ -4204,8 +4206,8 @@ declare const neo4jTools: (_agentforge_core.Tool<{
|
|
|
4204
4206
|
message?: undefined;
|
|
4205
4207
|
} | {
|
|
4206
4208
|
success: boolean;
|
|
4207
|
-
node:
|
|
4208
|
-
nodeId:
|
|
4209
|
+
node: unknown;
|
|
4210
|
+
nodeId: unknown;
|
|
4209
4211
|
embedding: {
|
|
4210
4212
|
model: string;
|
|
4211
4213
|
dimensions: number;
|
|
@@ -4234,7 +4236,7 @@ declare const neo4jCoreTools: (_agentforge_core.Tool<{
|
|
|
4234
4236
|
query?: undefined;
|
|
4235
4237
|
} | {
|
|
4236
4238
|
success: boolean;
|
|
4237
|
-
data:
|
|
4239
|
+
data: Record<string, unknown>[];
|
|
4238
4240
|
recordCount: number;
|
|
4239
4241
|
summary: {
|
|
4240
4242
|
query: string;
|
|
@@ -4305,7 +4307,7 @@ declare const neo4jCoreTools: (_agentforge_core.Tool<{
|
|
|
4305
4307
|
query?: undefined;
|
|
4306
4308
|
} | {
|
|
4307
4309
|
success: boolean;
|
|
4308
|
-
nodes:
|
|
4310
|
+
nodes: unknown[];
|
|
4309
4311
|
count: number;
|
|
4310
4312
|
query: {
|
|
4311
4313
|
label: string;
|
|
@@ -4339,10 +4341,10 @@ declare const neo4jCoreTools: (_agentforge_core.Tool<{
|
|
|
4339
4341
|
} | {
|
|
4340
4342
|
success: boolean;
|
|
4341
4343
|
paths: {
|
|
4342
|
-
start:
|
|
4343
|
-
end:
|
|
4344
|
-
relationships:
|
|
4345
|
-
depth:
|
|
4344
|
+
start: unknown;
|
|
4345
|
+
end: unknown;
|
|
4346
|
+
relationships: unknown;
|
|
4347
|
+
depth: unknown;
|
|
4346
4348
|
}[];
|
|
4347
4349
|
count: number;
|
|
4348
4350
|
query: {
|
|
@@ -4377,8 +4379,8 @@ declare const neo4jCoreTools: (_agentforge_core.Tool<{
|
|
|
4377
4379
|
} | {
|
|
4378
4380
|
success: boolean;
|
|
4379
4381
|
results: {
|
|
4380
|
-
node:
|
|
4381
|
-
score:
|
|
4382
|
+
node: unknown;
|
|
4383
|
+
score: unknown;
|
|
4382
4384
|
}[];
|
|
4383
4385
|
count: number;
|
|
4384
4386
|
query: {
|
|
@@ -4414,7 +4416,7 @@ declare function createNeo4jTools(config?: Neo4jToolsConfig, includeEmbeddingToo
|
|
|
4414
4416
|
query?: undefined;
|
|
4415
4417
|
} | {
|
|
4416
4418
|
success: boolean;
|
|
4417
|
-
data:
|
|
4419
|
+
data: Record<string, unknown>[];
|
|
4418
4420
|
recordCount: number;
|
|
4419
4421
|
summary: {
|
|
4420
4422
|
query: string;
|
|
@@ -4485,7 +4487,7 @@ declare function createNeo4jTools(config?: Neo4jToolsConfig, includeEmbeddingToo
|
|
|
4485
4487
|
query?: undefined;
|
|
4486
4488
|
} | {
|
|
4487
4489
|
success: boolean;
|
|
4488
|
-
nodes:
|
|
4490
|
+
nodes: unknown[];
|
|
4489
4491
|
count: number;
|
|
4490
4492
|
query: {
|
|
4491
4493
|
label: string;
|
|
@@ -4519,10 +4521,10 @@ declare function createNeo4jTools(config?: Neo4jToolsConfig, includeEmbeddingToo
|
|
|
4519
4521
|
} | {
|
|
4520
4522
|
success: boolean;
|
|
4521
4523
|
paths: {
|
|
4522
|
-
start:
|
|
4523
|
-
end:
|
|
4524
|
-
relationships:
|
|
4525
|
-
depth:
|
|
4524
|
+
start: unknown;
|
|
4525
|
+
end: unknown;
|
|
4526
|
+
relationships: unknown;
|
|
4527
|
+
depth: unknown;
|
|
4526
4528
|
}[];
|
|
4527
4529
|
count: number;
|
|
4528
4530
|
query: {
|
|
@@ -4557,8 +4559,8 @@ declare function createNeo4jTools(config?: Neo4jToolsConfig, includeEmbeddingToo
|
|
|
4557
4559
|
} | {
|
|
4558
4560
|
success: boolean;
|
|
4559
4561
|
results: {
|
|
4560
|
-
node:
|
|
4561
|
-
score:
|
|
4562
|
+
node: unknown;
|
|
4563
|
+
score: unknown;
|
|
4562
4564
|
}[];
|
|
4563
4565
|
count: number;
|
|
4564
4566
|
query: {
|
|
@@ -4593,8 +4595,8 @@ declare function createNeo4jTools(config?: Neo4jToolsConfig, includeEmbeddingToo
|
|
|
4593
4595
|
} | {
|
|
4594
4596
|
success: boolean;
|
|
4595
4597
|
results: {
|
|
4596
|
-
node:
|
|
4597
|
-
score:
|
|
4598
|
+
node: unknown;
|
|
4599
|
+
score: unknown;
|
|
4598
4600
|
}[];
|
|
4599
4601
|
count: number;
|
|
4600
4602
|
query: {
|
|
@@ -4642,8 +4644,8 @@ declare function createNeo4jTools(config?: Neo4jToolsConfig, includeEmbeddingToo
|
|
|
4642
4644
|
message?: undefined;
|
|
4643
4645
|
} | {
|
|
4644
4646
|
success: boolean;
|
|
4645
|
-
node:
|
|
4646
|
-
nodeId:
|
|
4647
|
+
node: unknown;
|
|
4648
|
+
nodeId: unknown;
|
|
4647
4649
|
embedding: {
|
|
4648
4650
|
model: string;
|
|
4649
4651
|
dimensions: number;
|
|
@@ -7867,11 +7869,11 @@ declare const StringTrimSchema: z.ZodObject<{
|
|
|
7867
7869
|
characters: z.ZodOptional<z.ZodString>;
|
|
7868
7870
|
}, "strip", z.ZodTypeAny, {
|
|
7869
7871
|
text: string;
|
|
7870
|
-
mode: "both" | "
|
|
7872
|
+
mode: "both" | "start" | "end";
|
|
7871
7873
|
characters?: string | undefined;
|
|
7872
7874
|
}, {
|
|
7873
7875
|
text: string;
|
|
7874
|
-
mode?: "both" | "
|
|
7876
|
+
mode?: "both" | "start" | "end" | undefined;
|
|
7875
7877
|
characters?: string | undefined;
|
|
7876
7878
|
}>;
|
|
7877
7879
|
/**
|
|
@@ -7986,7 +7988,7 @@ declare function createStringCaseConverterTool(): _agentforge_core.Tool<{
|
|
|
7986
7988
|
*/
|
|
7987
7989
|
declare function createStringTrimTool(): _agentforge_core.Tool<{
|
|
7988
7990
|
text: string;
|
|
7989
|
-
mode?: "both" | "
|
|
7991
|
+
mode?: "both" | "start" | "end" | undefined;
|
|
7990
7992
|
characters?: string | undefined;
|
|
7991
7993
|
}, {
|
|
7992
7994
|
original: string;
|
|
@@ -8083,7 +8085,7 @@ declare const stringCaseConverter: _agentforge_core.Tool<{
|
|
|
8083
8085
|
}>;
|
|
8084
8086
|
declare const stringTrim: _agentforge_core.Tool<{
|
|
8085
8087
|
text: string;
|
|
8086
|
-
mode?: "both" | "
|
|
8088
|
+
mode?: "both" | "start" | "end" | undefined;
|
|
8087
8089
|
characters?: string | undefined;
|
|
8088
8090
|
}, {
|
|
8089
8091
|
original: string;
|
|
@@ -8143,7 +8145,7 @@ declare const stringUtilityTools: (_agentforge_core.Tool<{
|
|
|
8143
8145
|
targetCase: "title" | "lowercase" | "uppercase" | "camel" | "snake" | "kebab" | "pascal";
|
|
8144
8146
|
}> | _agentforge_core.Tool<{
|
|
8145
8147
|
text: string;
|
|
8146
|
-
mode?: "both" | "
|
|
8148
|
+
mode?: "both" | "start" | "end" | undefined;
|
|
8147
8149
|
characters?: string | undefined;
|
|
8148
8150
|
}, {
|
|
8149
8151
|
original: string;
|
|
@@ -8201,7 +8203,7 @@ declare function createStringUtilityTools(config?: StringUtilitiesConfig): (_age
|
|
|
8201
8203
|
targetCase: "title" | "lowercase" | "uppercase" | "camel" | "snake" | "kebab" | "pascal";
|
|
8202
8204
|
}> | _agentforge_core.Tool<{
|
|
8203
8205
|
text: string;
|
|
8204
|
-
mode?: "both" | "
|
|
8206
|
+
mode?: "both" | "start" | "end" | undefined;
|
|
8205
8207
|
characters?: string | undefined;
|
|
8206
8208
|
}, {
|
|
8207
8209
|
original: string;
|
package/dist/index.js
CHANGED
|
@@ -3053,6 +3053,21 @@ async function generateEmbedding(text, model) {
|
|
|
3053
3053
|
async function generateBatchEmbeddings(texts, model) {
|
|
3054
3054
|
return embeddingManager.generateBatchEmbeddings(texts, model);
|
|
3055
3055
|
}
|
|
3056
|
+
function normalizeRecord(record) {
|
|
3057
|
+
const originalKeyByString = /* @__PURE__ */ new Map();
|
|
3058
|
+
const normalizedKeys = [];
|
|
3059
|
+
for (const key of record.keys) {
|
|
3060
|
+
const keyString = String(key);
|
|
3061
|
+
if (!originalKeyByString.has(keyString)) {
|
|
3062
|
+
originalKeyByString.set(keyString, key);
|
|
3063
|
+
normalizedKeys.push(keyString);
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
return {
|
|
3067
|
+
keys: normalizedKeys,
|
|
3068
|
+
get: (key) => record.get(originalKeyByString.get(key) ?? key)
|
|
3069
|
+
};
|
|
3070
|
+
}
|
|
3056
3071
|
function formatInteger(value) {
|
|
3057
3072
|
if (value.inSafeRange()) {
|
|
3058
3073
|
return value.toNumber();
|
|
@@ -3116,7 +3131,8 @@ function formatPath(path12) {
|
|
|
3116
3131
|
};
|
|
3117
3132
|
}
|
|
3118
3133
|
function formatResults(records) {
|
|
3119
|
-
return records.map((
|
|
3134
|
+
return records.map((rawRecord) => {
|
|
3135
|
+
const record = normalizeRecord(rawRecord);
|
|
3120
3136
|
const formatted = {};
|
|
3121
3137
|
for (const key of record.keys) {
|
|
3122
3138
|
formatted[key] = formatValue(record.get(key));
|