@agentforge/tools 0.15.8 → 0.15.9
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 +46 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -27
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -834,8 +834,8 @@ function createSendSlackMessageTool(getSlackClient, logger22) {
|
|
|
834
834
|
icon_emoji: config.botIcon
|
|
835
835
|
});
|
|
836
836
|
logger22.info("send-slack-message result", {
|
|
837
|
-
channel: result.channel,
|
|
838
|
-
timestamp: result.ts,
|
|
837
|
+
...result.channel ? { channel: result.channel } : {},
|
|
838
|
+
...result.ts ? { timestamp: result.ts } : {},
|
|
839
839
|
messageLength: message.length,
|
|
840
840
|
success: true
|
|
841
841
|
});
|
|
@@ -880,8 +880,8 @@ function createNotifySlackTool(getSlackClient, logger22) {
|
|
|
880
880
|
icon_emoji: config.botIcon
|
|
881
881
|
});
|
|
882
882
|
logger22.info("notify-slack result", {
|
|
883
|
-
channel: result.channel,
|
|
884
|
-
timestamp: result.ts,
|
|
883
|
+
...result.channel ? { channel: result.channel } : {},
|
|
884
|
+
...result.ts ? { timestamp: result.ts } : {},
|
|
885
885
|
mentions: mentions.length
|
|
886
886
|
});
|
|
887
887
|
return {
|
|
@@ -1415,7 +1415,10 @@ function createArchiveConfluencePageTool(getAuth, getAuthHeader2, logger22) {
|
|
|
1415
1415
|
page_id: zod.z.string().describe("The ID of the page to archive"),
|
|
1416
1416
|
reason: zod.z.string().optional().describe("Optional reason for archiving (for audit trail)")
|
|
1417
1417
|
})).implement(async ({ page_id, reason }) => {
|
|
1418
|
-
logger22.info("archive-confluence-page called", {
|
|
1418
|
+
logger22.info("archive-confluence-page called", {
|
|
1419
|
+
page_id,
|
|
1420
|
+
...reason ? { reason } : {}
|
|
1421
|
+
});
|
|
1419
1422
|
try {
|
|
1420
1423
|
const { ATLASSIAN_SITE_URL } = getAuth();
|
|
1421
1424
|
const getResponse = await axios16__default.default.get(
|
|
@@ -2160,7 +2163,7 @@ var Neo4jConnectionPool = class {
|
|
|
2160
2163
|
const errorMessage = `Failed to connect to Neo4j: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
2161
2164
|
logger3.error("Neo4j connectivity verification failed", {
|
|
2162
2165
|
error: error instanceof Error ? error.message : "Unknown error",
|
|
2163
|
-
uri: this.config
|
|
2166
|
+
...this.config?.uri ? { uri: this.config.uri } : {}
|
|
2164
2167
|
});
|
|
2165
2168
|
throw new Error(errorMessage);
|
|
2166
2169
|
}
|
|
@@ -3185,7 +3188,7 @@ function createNeo4jQueryTool() {
|
|
|
3185
3188
|
logger5.debug("Executing Neo4j query", {
|
|
3186
3189
|
cypherPreview: input.cypher.substring(0, 100),
|
|
3187
3190
|
parameterCount: Object.keys(input.parameters || {}).length,
|
|
3188
|
-
database: input.database
|
|
3191
|
+
...input.database ? { database: input.database } : {}
|
|
3189
3192
|
});
|
|
3190
3193
|
try {
|
|
3191
3194
|
const session = neo4jPool.getSession(input.database);
|
|
@@ -3557,8 +3560,8 @@ function createNeo4jVectorSearchWithEmbeddingTool() {
|
|
|
3557
3560
|
logger6.debug("Performing vector search with embedding", {
|
|
3558
3561
|
queryTextLength: input.queryText.length,
|
|
3559
3562
|
indexName: input.indexName,
|
|
3560
|
-
limit: input.limit,
|
|
3561
|
-
model: input.model
|
|
3563
|
+
...input.limit !== void 0 ? { limit: input.limit } : {},
|
|
3564
|
+
...input.model ? { model: input.model } : {}
|
|
3562
3565
|
});
|
|
3563
3566
|
try {
|
|
3564
3567
|
const embeddingResult = await embeddingManager.generateEmbedding(input.queryText, input.model);
|
|
@@ -4385,9 +4388,9 @@ var ConnectionManager = class extends events.EventEmitter {
|
|
|
4385
4388
|
logger7.debug("Creating PostgreSQL connection pool", {
|
|
4386
4389
|
vendor: this.vendor,
|
|
4387
4390
|
poolConfig: {
|
|
4388
|
-
max: connectionConfig.max,
|
|
4389
|
-
idleTimeoutMillis: connectionConfig.idleTimeoutMillis,
|
|
4390
|
-
connectionTimeoutMillis: connectionConfig.connectionTimeoutMillis
|
|
4391
|
+
...connectionConfig.max !== void 0 ? { max: connectionConfig.max } : {},
|
|
4392
|
+
...connectionConfig.idleTimeoutMillis !== void 0 ? { idleTimeoutMillis: connectionConfig.idleTimeoutMillis } : {},
|
|
4393
|
+
...connectionConfig.connectionTimeoutMillis !== void 0 ? { connectionTimeoutMillis: connectionConfig.connectionTimeoutMillis } : {}
|
|
4391
4394
|
}
|
|
4392
4395
|
});
|
|
4393
4396
|
this.client = new Pool(connectionConfig);
|
|
@@ -4422,9 +4425,9 @@ var ConnectionManager = class extends events.EventEmitter {
|
|
|
4422
4425
|
logger7.debug("Creating MySQL connection pool", {
|
|
4423
4426
|
vendor: this.vendor,
|
|
4424
4427
|
poolConfig: {
|
|
4425
|
-
connectionLimit: connectionConfig.connectionLimit,
|
|
4426
|
-
acquireTimeout: connectionConfig.acquireTimeout,
|
|
4427
|
-
idleTimeout: connectionConfig.idleTimeout
|
|
4428
|
+
...connectionConfig.connectionLimit !== void 0 ? { connectionLimit: connectionConfig.connectionLimit } : {},
|
|
4429
|
+
...connectionConfig.acquireTimeout !== void 0 ? { acquireTimeout: connectionConfig.acquireTimeout } : {},
|
|
4430
|
+
...connectionConfig.idleTimeout !== void 0 ? { idleTimeout: connectionConfig.idleTimeout } : {}
|
|
4428
4431
|
}
|
|
4429
4432
|
});
|
|
4430
4433
|
}
|
|
@@ -4449,7 +4452,11 @@ var ConnectionManager = class extends events.EventEmitter {
|
|
|
4449
4452
|
validatePoolConfig(this.config.connection.pool);
|
|
4450
4453
|
logger7.debug("SQLite pool configuration provided but not applied (SQLite uses single connection)", {
|
|
4451
4454
|
vendor: this.vendor,
|
|
4452
|
-
poolConfig:
|
|
4455
|
+
poolConfig: {
|
|
4456
|
+
...this.config.connection.pool.max !== void 0 ? { max: this.config.connection.pool.max } : {},
|
|
4457
|
+
...this.config.connection.pool.idleTimeoutMillis !== void 0 ? { idleTimeoutMillis: this.config.connection.pool.idleTimeoutMillis } : {},
|
|
4458
|
+
...this.config.connection.pool.acquireTimeoutMillis !== void 0 ? { acquireTimeoutMillis: this.config.connection.pool.acquireTimeoutMillis } : {}
|
|
4459
|
+
}
|
|
4453
4460
|
});
|
|
4454
4461
|
}
|
|
4455
4462
|
logger7.debug("Creating SQLite connection", {
|
|
@@ -5870,8 +5877,8 @@ async function withTransaction(manager, operation, options) {
|
|
|
5870
5877
|
logger11.debug("Starting transaction", {
|
|
5871
5878
|
transactionId,
|
|
5872
5879
|
vendor,
|
|
5873
|
-
isolationLevel: resolvedOptions.isolationLevel,
|
|
5874
|
-
timeoutMs: resolvedOptions.timeoutMs
|
|
5880
|
+
...resolvedOptions.isolationLevel ? { isolationLevel: resolvedOptions.isolationLevel } : {},
|
|
5881
|
+
...resolvedOptions.timeoutMs !== void 0 ? { timeoutMs: resolvedOptions.timeoutMs } : {}
|
|
5875
5882
|
});
|
|
5876
5883
|
return manager.executeInConnection(async (executeQuery2) => {
|
|
5877
5884
|
const transaction = new ManagedTransaction({
|
|
@@ -7192,8 +7199,8 @@ async function executeSelect(manager, input, context) {
|
|
|
7192
7199
|
vendor: input.vendor,
|
|
7193
7200
|
table: input.table,
|
|
7194
7201
|
chunkSize: streamOptions.chunkSize ?? DEFAULT_CHUNK_SIZE,
|
|
7195
|
-
maxRows: streamOptions.maxRows,
|
|
7196
|
-
sampleSize: streamOptions.sampleSize
|
|
7202
|
+
...streamOptions.maxRows !== void 0 ? { maxRows: streamOptions.maxRows } : {},
|
|
7203
|
+
...streamOptions.sampleSize !== void 0 ? { sampleSize: streamOptions.sampleSize } : {}
|
|
7197
7204
|
});
|
|
7198
7205
|
}
|
|
7199
7206
|
const streamResult = await executeStreamingSelect(executor, streamInput, streamOptions);
|
|
@@ -8151,7 +8158,7 @@ async function executeUpdate(manager, input, context) {
|
|
|
8151
8158
|
vendor: input.vendor,
|
|
8152
8159
|
table: input.table,
|
|
8153
8160
|
hasWhere: !!input.where?.length,
|
|
8154
|
-
allowFullTableUpdate: input.allowFullTableUpdate,
|
|
8161
|
+
...input.allowFullTableUpdate !== void 0 ? { allowFullTableUpdate: input.allowFullTableUpdate } : {},
|
|
8155
8162
|
hasOptimisticLock: !!input.optimisticLock,
|
|
8156
8163
|
operationCount: input.operations?.length ?? 0,
|
|
8157
8164
|
batchModeEnabled: !!input.batch?.enabled
|
|
@@ -8657,8 +8664,8 @@ async function executeDelete(manager, input, context) {
|
|
|
8657
8664
|
vendor: input.vendor,
|
|
8658
8665
|
table: input.table,
|
|
8659
8666
|
hasWhere: !!input.where?.length,
|
|
8660
|
-
allowFullTableDelete: input.allowFullTableDelete,
|
|
8661
|
-
cascade: input.cascade,
|
|
8667
|
+
...input.allowFullTableDelete !== void 0 ? { allowFullTableDelete: input.allowFullTableDelete } : {},
|
|
8668
|
+
...input.cascade !== void 0 ? { cascade: input.cascade } : {},
|
|
8662
8669
|
softDelete: !!input.softDelete,
|
|
8663
8670
|
operationCount: input.operations?.length ?? 0,
|
|
8664
8671
|
batchModeEnabled: !!input.batch?.enabled
|
|
@@ -8678,7 +8685,7 @@ async function executeDelete(manager, input, context) {
|
|
|
8678
8685
|
rowCount: result.rowCount,
|
|
8679
8686
|
executionTime,
|
|
8680
8687
|
softDelete: result.softDeleted,
|
|
8681
|
-
cascade: input.cascade,
|
|
8688
|
+
...input.cascade !== void 0 ? { cascade: input.cascade } : {},
|
|
8682
8689
|
batchMode: !!result.batch,
|
|
8683
8690
|
partialSuccess: result.batch?.partialSuccess ?? false
|
|
8684
8691
|
});
|
|
@@ -8693,7 +8700,7 @@ async function executeDelete(manager, input, context) {
|
|
|
8693
8700
|
table: input.table,
|
|
8694
8701
|
error: error instanceof Error ? error.message : String(error),
|
|
8695
8702
|
executionTime,
|
|
8696
|
-
cascade: input.cascade,
|
|
8703
|
+
...input.cascade !== void 0 ? { cascade: input.cascade } : {},
|
|
8697
8704
|
softDelete: !!input.softDelete
|
|
8698
8705
|
});
|
|
8699
8706
|
const constraintMessage = getDeleteConstraintViolationMessage(error, input.cascade ?? false);
|
|
@@ -10064,14 +10071,26 @@ function createAskHumanTool() {
|
|
|
10064
10071
|
suggestions: validatedInput.suggestions,
|
|
10065
10072
|
status: "pending"
|
|
10066
10073
|
};
|
|
10067
|
-
logger21.debug("About to call interrupt()", {
|
|
10074
|
+
logger21.debug("About to call interrupt()", {
|
|
10075
|
+
humanRequest: {
|
|
10076
|
+
id: humanRequest.id,
|
|
10077
|
+
question: humanRequest.question,
|
|
10078
|
+
priority: humanRequest.priority,
|
|
10079
|
+
createdAt: humanRequest.createdAt,
|
|
10080
|
+
timeout: humanRequest.timeout,
|
|
10081
|
+
status: humanRequest.status,
|
|
10082
|
+
...humanRequest.context ? { hasContext: true } : {},
|
|
10083
|
+
...humanRequest.defaultResponse ? { defaultResponse: humanRequest.defaultResponse } : {},
|
|
10084
|
+
...humanRequest.suggestions ? { suggestions: humanRequest.suggestions } : {}
|
|
10085
|
+
}
|
|
10086
|
+
});
|
|
10068
10087
|
let response;
|
|
10069
10088
|
try {
|
|
10070
10089
|
response = interrupt(humanRequest);
|
|
10071
10090
|
logger21.debug("interrupt() returned successfully", { response, responseType: typeof response });
|
|
10072
10091
|
} catch (error) {
|
|
10073
10092
|
logger21.debug("interrupt() threw error (expected for GraphInterrupt)", {
|
|
10074
|
-
errorType: error
|
|
10093
|
+
...error && typeof error === "object" && "constructor" in error ? { errorType: error.constructor?.name } : {},
|
|
10075
10094
|
error: error instanceof Error ? error.message : String(error)
|
|
10076
10095
|
});
|
|
10077
10096
|
throw error;
|