@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.js
CHANGED
|
@@ -807,8 +807,8 @@ function createSendSlackMessageTool(getSlackClient, logger22) {
|
|
|
807
807
|
icon_emoji: config.botIcon
|
|
808
808
|
});
|
|
809
809
|
logger22.info("send-slack-message result", {
|
|
810
|
-
channel: result.channel,
|
|
811
|
-
timestamp: result.ts,
|
|
810
|
+
...result.channel ? { channel: result.channel } : {},
|
|
811
|
+
...result.ts ? { timestamp: result.ts } : {},
|
|
812
812
|
messageLength: message.length,
|
|
813
813
|
success: true
|
|
814
814
|
});
|
|
@@ -853,8 +853,8 @@ function createNotifySlackTool(getSlackClient, logger22) {
|
|
|
853
853
|
icon_emoji: config.botIcon
|
|
854
854
|
});
|
|
855
855
|
logger22.info("notify-slack result", {
|
|
856
|
-
channel: result.channel,
|
|
857
|
-
timestamp: result.ts,
|
|
856
|
+
...result.channel ? { channel: result.channel } : {},
|
|
857
|
+
...result.ts ? { timestamp: result.ts } : {},
|
|
858
858
|
mentions: mentions.length
|
|
859
859
|
});
|
|
860
860
|
return {
|
|
@@ -1388,7 +1388,10 @@ function createArchiveConfluencePageTool(getAuth, getAuthHeader2, logger22) {
|
|
|
1388
1388
|
page_id: z.string().describe("The ID of the page to archive"),
|
|
1389
1389
|
reason: z.string().optional().describe("Optional reason for archiving (for audit trail)")
|
|
1390
1390
|
})).implement(async ({ page_id, reason }) => {
|
|
1391
|
-
logger22.info("archive-confluence-page called", {
|
|
1391
|
+
logger22.info("archive-confluence-page called", {
|
|
1392
|
+
page_id,
|
|
1393
|
+
...reason ? { reason } : {}
|
|
1394
|
+
});
|
|
1392
1395
|
try {
|
|
1393
1396
|
const { ATLASSIAN_SITE_URL } = getAuth();
|
|
1394
1397
|
const getResponse = await axios16.get(
|
|
@@ -2133,7 +2136,7 @@ var Neo4jConnectionPool = class {
|
|
|
2133
2136
|
const errorMessage = `Failed to connect to Neo4j: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
2134
2137
|
logger3.error("Neo4j connectivity verification failed", {
|
|
2135
2138
|
error: error instanceof Error ? error.message : "Unknown error",
|
|
2136
|
-
uri: this.config
|
|
2139
|
+
...this.config?.uri ? { uri: this.config.uri } : {}
|
|
2137
2140
|
});
|
|
2138
2141
|
throw new Error(errorMessage);
|
|
2139
2142
|
}
|
|
@@ -3158,7 +3161,7 @@ function createNeo4jQueryTool() {
|
|
|
3158
3161
|
logger5.debug("Executing Neo4j query", {
|
|
3159
3162
|
cypherPreview: input.cypher.substring(0, 100),
|
|
3160
3163
|
parameterCount: Object.keys(input.parameters || {}).length,
|
|
3161
|
-
database: input.database
|
|
3164
|
+
...input.database ? { database: input.database } : {}
|
|
3162
3165
|
});
|
|
3163
3166
|
try {
|
|
3164
3167
|
const session = neo4jPool.getSession(input.database);
|
|
@@ -3530,8 +3533,8 @@ function createNeo4jVectorSearchWithEmbeddingTool() {
|
|
|
3530
3533
|
logger6.debug("Performing vector search with embedding", {
|
|
3531
3534
|
queryTextLength: input.queryText.length,
|
|
3532
3535
|
indexName: input.indexName,
|
|
3533
|
-
limit: input.limit,
|
|
3534
|
-
model: input.model
|
|
3536
|
+
...input.limit !== void 0 ? { limit: input.limit } : {},
|
|
3537
|
+
...input.model ? { model: input.model } : {}
|
|
3535
3538
|
});
|
|
3536
3539
|
try {
|
|
3537
3540
|
const embeddingResult = await embeddingManager.generateEmbedding(input.queryText, input.model);
|
|
@@ -4358,9 +4361,9 @@ var ConnectionManager = class extends EventEmitter {
|
|
|
4358
4361
|
logger7.debug("Creating PostgreSQL connection pool", {
|
|
4359
4362
|
vendor: this.vendor,
|
|
4360
4363
|
poolConfig: {
|
|
4361
|
-
max: connectionConfig.max,
|
|
4362
|
-
idleTimeoutMillis: connectionConfig.idleTimeoutMillis,
|
|
4363
|
-
connectionTimeoutMillis: connectionConfig.connectionTimeoutMillis
|
|
4364
|
+
...connectionConfig.max !== void 0 ? { max: connectionConfig.max } : {},
|
|
4365
|
+
...connectionConfig.idleTimeoutMillis !== void 0 ? { idleTimeoutMillis: connectionConfig.idleTimeoutMillis } : {},
|
|
4366
|
+
...connectionConfig.connectionTimeoutMillis !== void 0 ? { connectionTimeoutMillis: connectionConfig.connectionTimeoutMillis } : {}
|
|
4364
4367
|
}
|
|
4365
4368
|
});
|
|
4366
4369
|
this.client = new Pool(connectionConfig);
|
|
@@ -4395,9 +4398,9 @@ var ConnectionManager = class extends EventEmitter {
|
|
|
4395
4398
|
logger7.debug("Creating MySQL connection pool", {
|
|
4396
4399
|
vendor: this.vendor,
|
|
4397
4400
|
poolConfig: {
|
|
4398
|
-
connectionLimit: connectionConfig.connectionLimit,
|
|
4399
|
-
acquireTimeout: connectionConfig.acquireTimeout,
|
|
4400
|
-
idleTimeout: connectionConfig.idleTimeout
|
|
4401
|
+
...connectionConfig.connectionLimit !== void 0 ? { connectionLimit: connectionConfig.connectionLimit } : {},
|
|
4402
|
+
...connectionConfig.acquireTimeout !== void 0 ? { acquireTimeout: connectionConfig.acquireTimeout } : {},
|
|
4403
|
+
...connectionConfig.idleTimeout !== void 0 ? { idleTimeout: connectionConfig.idleTimeout } : {}
|
|
4401
4404
|
}
|
|
4402
4405
|
});
|
|
4403
4406
|
}
|
|
@@ -4422,7 +4425,11 @@ var ConnectionManager = class extends EventEmitter {
|
|
|
4422
4425
|
validatePoolConfig(this.config.connection.pool);
|
|
4423
4426
|
logger7.debug("SQLite pool configuration provided but not applied (SQLite uses single connection)", {
|
|
4424
4427
|
vendor: this.vendor,
|
|
4425
|
-
poolConfig:
|
|
4428
|
+
poolConfig: {
|
|
4429
|
+
...this.config.connection.pool.max !== void 0 ? { max: this.config.connection.pool.max } : {},
|
|
4430
|
+
...this.config.connection.pool.idleTimeoutMillis !== void 0 ? { idleTimeoutMillis: this.config.connection.pool.idleTimeoutMillis } : {},
|
|
4431
|
+
...this.config.connection.pool.acquireTimeoutMillis !== void 0 ? { acquireTimeoutMillis: this.config.connection.pool.acquireTimeoutMillis } : {}
|
|
4432
|
+
}
|
|
4426
4433
|
});
|
|
4427
4434
|
}
|
|
4428
4435
|
logger7.debug("Creating SQLite connection", {
|
|
@@ -5843,8 +5850,8 @@ async function withTransaction(manager, operation, options) {
|
|
|
5843
5850
|
logger11.debug("Starting transaction", {
|
|
5844
5851
|
transactionId,
|
|
5845
5852
|
vendor,
|
|
5846
|
-
isolationLevel: resolvedOptions.isolationLevel,
|
|
5847
|
-
timeoutMs: resolvedOptions.timeoutMs
|
|
5853
|
+
...resolvedOptions.isolationLevel ? { isolationLevel: resolvedOptions.isolationLevel } : {},
|
|
5854
|
+
...resolvedOptions.timeoutMs !== void 0 ? { timeoutMs: resolvedOptions.timeoutMs } : {}
|
|
5848
5855
|
});
|
|
5849
5856
|
return manager.executeInConnection(async (executeQuery2) => {
|
|
5850
5857
|
const transaction = new ManagedTransaction({
|
|
@@ -7165,8 +7172,8 @@ async function executeSelect(manager, input, context) {
|
|
|
7165
7172
|
vendor: input.vendor,
|
|
7166
7173
|
table: input.table,
|
|
7167
7174
|
chunkSize: streamOptions.chunkSize ?? DEFAULT_CHUNK_SIZE,
|
|
7168
|
-
maxRows: streamOptions.maxRows,
|
|
7169
|
-
sampleSize: streamOptions.sampleSize
|
|
7175
|
+
...streamOptions.maxRows !== void 0 ? { maxRows: streamOptions.maxRows } : {},
|
|
7176
|
+
...streamOptions.sampleSize !== void 0 ? { sampleSize: streamOptions.sampleSize } : {}
|
|
7170
7177
|
});
|
|
7171
7178
|
}
|
|
7172
7179
|
const streamResult = await executeStreamingSelect(executor, streamInput, streamOptions);
|
|
@@ -8124,7 +8131,7 @@ async function executeUpdate(manager, input, context) {
|
|
|
8124
8131
|
vendor: input.vendor,
|
|
8125
8132
|
table: input.table,
|
|
8126
8133
|
hasWhere: !!input.where?.length,
|
|
8127
|
-
allowFullTableUpdate: input.allowFullTableUpdate,
|
|
8134
|
+
...input.allowFullTableUpdate !== void 0 ? { allowFullTableUpdate: input.allowFullTableUpdate } : {},
|
|
8128
8135
|
hasOptimisticLock: !!input.optimisticLock,
|
|
8129
8136
|
operationCount: input.operations?.length ?? 0,
|
|
8130
8137
|
batchModeEnabled: !!input.batch?.enabled
|
|
@@ -8630,8 +8637,8 @@ async function executeDelete(manager, input, context) {
|
|
|
8630
8637
|
vendor: input.vendor,
|
|
8631
8638
|
table: input.table,
|
|
8632
8639
|
hasWhere: !!input.where?.length,
|
|
8633
|
-
allowFullTableDelete: input.allowFullTableDelete,
|
|
8634
|
-
cascade: input.cascade,
|
|
8640
|
+
...input.allowFullTableDelete !== void 0 ? { allowFullTableDelete: input.allowFullTableDelete } : {},
|
|
8641
|
+
...input.cascade !== void 0 ? { cascade: input.cascade } : {},
|
|
8635
8642
|
softDelete: !!input.softDelete,
|
|
8636
8643
|
operationCount: input.operations?.length ?? 0,
|
|
8637
8644
|
batchModeEnabled: !!input.batch?.enabled
|
|
@@ -8651,7 +8658,7 @@ async function executeDelete(manager, input, context) {
|
|
|
8651
8658
|
rowCount: result.rowCount,
|
|
8652
8659
|
executionTime,
|
|
8653
8660
|
softDelete: result.softDeleted,
|
|
8654
|
-
cascade: input.cascade,
|
|
8661
|
+
...input.cascade !== void 0 ? { cascade: input.cascade } : {},
|
|
8655
8662
|
batchMode: !!result.batch,
|
|
8656
8663
|
partialSuccess: result.batch?.partialSuccess ?? false
|
|
8657
8664
|
});
|
|
@@ -8666,7 +8673,7 @@ async function executeDelete(manager, input, context) {
|
|
|
8666
8673
|
table: input.table,
|
|
8667
8674
|
error: error instanceof Error ? error.message : String(error),
|
|
8668
8675
|
executionTime,
|
|
8669
|
-
cascade: input.cascade,
|
|
8676
|
+
...input.cascade !== void 0 ? { cascade: input.cascade } : {},
|
|
8670
8677
|
softDelete: !!input.softDelete
|
|
8671
8678
|
});
|
|
8672
8679
|
const constraintMessage = getDeleteConstraintViolationMessage(error, input.cascade ?? false);
|
|
@@ -10037,14 +10044,26 @@ function createAskHumanTool() {
|
|
|
10037
10044
|
suggestions: validatedInput.suggestions,
|
|
10038
10045
|
status: "pending"
|
|
10039
10046
|
};
|
|
10040
|
-
logger21.debug("About to call interrupt()", {
|
|
10047
|
+
logger21.debug("About to call interrupt()", {
|
|
10048
|
+
humanRequest: {
|
|
10049
|
+
id: humanRequest.id,
|
|
10050
|
+
question: humanRequest.question,
|
|
10051
|
+
priority: humanRequest.priority,
|
|
10052
|
+
createdAt: humanRequest.createdAt,
|
|
10053
|
+
timeout: humanRequest.timeout,
|
|
10054
|
+
status: humanRequest.status,
|
|
10055
|
+
...humanRequest.context ? { hasContext: true } : {},
|
|
10056
|
+
...humanRequest.defaultResponse ? { defaultResponse: humanRequest.defaultResponse } : {},
|
|
10057
|
+
...humanRequest.suggestions ? { suggestions: humanRequest.suggestions } : {}
|
|
10058
|
+
}
|
|
10059
|
+
});
|
|
10041
10060
|
let response;
|
|
10042
10061
|
try {
|
|
10043
10062
|
response = interrupt(humanRequest);
|
|
10044
10063
|
logger21.debug("interrupt() returned successfully", { response, responseType: typeof response });
|
|
10045
10064
|
} catch (error) {
|
|
10046
10065
|
logger21.debug("interrupt() threw error (expected for GraphInterrupt)", {
|
|
10047
|
-
errorType: error
|
|
10066
|
+
...error && typeof error === "object" && "constructor" in error ? { errorType: error.constructor?.name } : {},
|
|
10048
10067
|
error: error instanceof Error ? error.message : String(error)
|
|
10049
10068
|
});
|
|
10050
10069
|
throw error;
|