@inkeep/agents-run-api 0.0.0-dev-20250912012833 → 0.0.0-dev-20250912142126
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 +5 -5
- package/dist/index.cjs +68 -44
- package/dist/index.js +68 -44
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Inkeep
|
|
1
|
+
# Inkeep Agents Run API
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The Agents Run API is responsible for runtime agent operations, including Agent-to-Agent (A2A) communication, chat completions, and MCP (Model Context Protocol) tool integrations.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -82,8 +82,8 @@ The API uses environment-based configuration with defaults for local development
|
|
|
82
82
|
|
|
83
83
|
## Integration
|
|
84
84
|
|
|
85
|
-
### With
|
|
86
|
-
The
|
|
85
|
+
### With Agents Manage API
|
|
86
|
+
The Agents Run API reads agent configurations and relationships created by the Agents Manage API but doesn't modify them during runtime.
|
|
87
87
|
|
|
88
88
|
### With MCP Tools
|
|
89
89
|
Supports multiple MCP transport types:
|
|
@@ -114,4 +114,4 @@ The API implements comprehensive error handling:
|
|
|
114
114
|
- **API Key Authentication**: Configurable authentication methods
|
|
115
115
|
- **Input Validation**: Request sanitization and type checking
|
|
116
116
|
- **CORS**: Configurable cross-origin policies
|
|
117
|
-
- **Rate Limiting**: Configurable request throttling
|
|
117
|
+
- **Rate Limiting**: Configurable request throttling
|
package/dist/index.cjs
CHANGED
|
@@ -576,9 +576,9 @@ function setupOpenAPIRoutes(app6) {
|
|
|
576
576
|
const document = app6.getOpenAPIDocument({
|
|
577
577
|
openapi: "3.0.0",
|
|
578
578
|
info: {
|
|
579
|
-
title: "Inkeep
|
|
579
|
+
title: "Inkeep Agents Run API",
|
|
580
580
|
version: "1.0.0",
|
|
581
|
-
description: "
|
|
581
|
+
description: "Chat completions, MCP, and A2A run endpoints in the Inkeep Agent Framework."
|
|
582
582
|
},
|
|
583
583
|
servers: [
|
|
584
584
|
{
|
|
@@ -598,7 +598,7 @@ function setupOpenAPIRoutes(app6) {
|
|
|
598
598
|
"/docs",
|
|
599
599
|
swaggerUi.swaggerUI({
|
|
600
600
|
url: "/openapi.json",
|
|
601
|
-
title: "Inkeep
|
|
601
|
+
title: "Inkeep Agents Run API Documentation"
|
|
602
602
|
})
|
|
603
603
|
);
|
|
604
604
|
}
|
|
@@ -1217,11 +1217,7 @@ init_dbClient();
|
|
|
1217
1217
|
// src/agents/Agent.ts
|
|
1218
1218
|
init_conversations();
|
|
1219
1219
|
init_dbClient();
|
|
1220
|
-
|
|
1221
|
-
// package.json
|
|
1222
|
-
var package_default = {
|
|
1223
|
-
version: "0.1.3"};
|
|
1224
|
-
var tracer = agentsCore.getTracer("agents-run-api", package_default.version);
|
|
1220
|
+
var tracer = agentsCore.getTracer("agents-run-api");
|
|
1225
1221
|
function agentInitializingOp(sessionId, graphId) {
|
|
1226
1222
|
return {
|
|
1227
1223
|
type: "agent_initializing",
|
|
@@ -1350,7 +1346,9 @@ var _ModelFactory = class _ModelFactory {
|
|
|
1350
1346
|
*/
|
|
1351
1347
|
static createModel(config2) {
|
|
1352
1348
|
if (!config2?.model?.trim()) {
|
|
1353
|
-
throw new Error(
|
|
1349
|
+
throw new Error(
|
|
1350
|
+
"Model configuration is required. Please configure models at the project level."
|
|
1351
|
+
);
|
|
1354
1352
|
}
|
|
1355
1353
|
const modelSettings = config2;
|
|
1356
1354
|
const modelString = modelSettings.model.trim();
|
|
@@ -1371,7 +1369,9 @@ var _ModelFactory = class _ModelFactory {
|
|
|
1371
1369
|
case "openai":
|
|
1372
1370
|
return _ModelFactory.createOpenAIModel(modelName, modelSettings.providerOptions);
|
|
1373
1371
|
default:
|
|
1374
|
-
throw new Error(
|
|
1372
|
+
throw new Error(
|
|
1373
|
+
`Unsupported provider: ${provider}. Supported providers are: ${_ModelFactory.SUPPORTED_PROVIDERS.join(", ")}`
|
|
1374
|
+
);
|
|
1375
1375
|
}
|
|
1376
1376
|
} catch (error) {
|
|
1377
1377
|
logger5.error(
|
|
@@ -1382,7 +1382,9 @@ var _ModelFactory = class _ModelFactory {
|
|
|
1382
1382
|
},
|
|
1383
1383
|
"Failed to create model"
|
|
1384
1384
|
);
|
|
1385
|
-
throw new Error(
|
|
1385
|
+
throw new Error(
|
|
1386
|
+
`Failed to create model ${modelString}: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
1387
|
+
);
|
|
1386
1388
|
}
|
|
1387
1389
|
}
|
|
1388
1390
|
/**
|
|
@@ -1635,12 +1637,15 @@ var GraphSession = class {
|
|
|
1635
1637
|
if (eventType === "artifact_saved" && data.pendingGeneration) {
|
|
1636
1638
|
const artifactId = data.artifactId;
|
|
1637
1639
|
if (this.pendingArtifacts.size >= this.MAX_PENDING_ARTIFACTS) {
|
|
1638
|
-
logger6.warn(
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1640
|
+
logger6.warn(
|
|
1641
|
+
{
|
|
1642
|
+
sessionId: this.sessionId,
|
|
1643
|
+
artifactId,
|
|
1644
|
+
pendingCount: this.pendingArtifacts.size,
|
|
1645
|
+
maxAllowed: this.MAX_PENDING_ARTIFACTS
|
|
1646
|
+
},
|
|
1647
|
+
"Too many pending artifacts, skipping processing"
|
|
1648
|
+
);
|
|
1644
1649
|
return;
|
|
1645
1650
|
}
|
|
1646
1651
|
this.pendingArtifacts.add(artifactId);
|
|
@@ -1653,21 +1658,27 @@ var GraphSession = class {
|
|
|
1653
1658
|
this.artifactProcessingErrors.set(artifactId, errorCount);
|
|
1654
1659
|
if (errorCount >= this.MAX_ARTIFACT_RETRIES) {
|
|
1655
1660
|
this.pendingArtifacts.delete(artifactId);
|
|
1656
|
-
logger6.error(
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1661
|
+
logger6.error(
|
|
1662
|
+
{
|
|
1663
|
+
sessionId: this.sessionId,
|
|
1664
|
+
artifactId,
|
|
1665
|
+
errorCount,
|
|
1666
|
+
maxRetries: this.MAX_ARTIFACT_RETRIES,
|
|
1667
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
1668
|
+
stack: error instanceof Error ? error.stack : void 0
|
|
1669
|
+
},
|
|
1670
|
+
"Artifact processing failed after max retries, giving up"
|
|
1671
|
+
);
|
|
1664
1672
|
} else {
|
|
1665
|
-
logger6.warn(
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1673
|
+
logger6.warn(
|
|
1674
|
+
{
|
|
1675
|
+
sessionId: this.sessionId,
|
|
1676
|
+
artifactId,
|
|
1677
|
+
errorCount,
|
|
1678
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
1679
|
+
},
|
|
1680
|
+
"Artifact processing failed, may retry"
|
|
1681
|
+
);
|
|
1671
1682
|
}
|
|
1672
1683
|
});
|
|
1673
1684
|
});
|
|
@@ -2071,7 +2082,9 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
|
|
|
2071
2082
|
let modelToUse = summarizerModel;
|
|
2072
2083
|
if (!summarizerModel?.model?.trim()) {
|
|
2073
2084
|
if (!this.statusUpdateState?.baseModel?.model?.trim()) {
|
|
2074
|
-
throw new Error(
|
|
2085
|
+
throw new Error(
|
|
2086
|
+
"Either summarizer or base model is required for progress summary generation. Please configure models at the project level."
|
|
2087
|
+
);
|
|
2075
2088
|
}
|
|
2076
2089
|
modelToUse = this.statusUpdateState.baseModel;
|
|
2077
2090
|
}
|
|
@@ -2199,7 +2212,9 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
|
|
|
2199
2212
|
let modelToUse = summarizerModel;
|
|
2200
2213
|
if (!summarizerModel?.model?.trim()) {
|
|
2201
2214
|
if (!this.statusUpdateState?.baseModel?.model?.trim()) {
|
|
2202
|
-
throw new Error(
|
|
2215
|
+
throw new Error(
|
|
2216
|
+
"Either summarizer or base model is required for status update generation. Please configure models at the project level."
|
|
2217
|
+
);
|
|
2203
2218
|
}
|
|
2204
2219
|
modelToUse = this.statusUpdateState.baseModel;
|
|
2205
2220
|
}
|
|
@@ -2489,7 +2504,9 @@ Make it specific and relevant.`;
|
|
|
2489
2504
|
let modelToUse = this.statusUpdateState?.summarizerModel;
|
|
2490
2505
|
if (!modelToUse?.model?.trim()) {
|
|
2491
2506
|
if (!this.statusUpdateState?.baseModel?.model?.trim()) {
|
|
2492
|
-
throw new Error(
|
|
2507
|
+
throw new Error(
|
|
2508
|
+
"Either summarizer or base model is required for artifact name generation. Please configure models at the project level."
|
|
2509
|
+
);
|
|
2493
2510
|
}
|
|
2494
2511
|
modelToUse = this.statusUpdateState.baseModel;
|
|
2495
2512
|
}
|
|
@@ -2748,7 +2765,9 @@ var _ArtifactParser = class _ArtifactParser {
|
|
|
2748
2765
|
* More robust detection that handles streaming fragments
|
|
2749
2766
|
*/
|
|
2750
2767
|
hasIncompleteArtifact(text) {
|
|
2751
|
-
return /^.*<(?:artifact(?::ref)?|a(?:r(?:t(?:i(?:f(?:a(?:c(?:t(?::(?:r(?:e(?:f)?)?)?)?)?)?)?)?)?)?)?)?$/.test(
|
|
2768
|
+
return /^.*<(?:artifact(?::ref)?|a(?:r(?:t(?:i(?:f(?:a(?:c(?:t(?::(?:r(?:e(?:f)?)?)?)?)?)?)?)?)?)?)?)?$/.test(
|
|
2769
|
+
text
|
|
2770
|
+
) || /^.*<artifact:ref(?:[^>]*)$/.test(text) || // Incomplete artifact:ref at end
|
|
2752
2771
|
this.findSafeTextBoundary(text) < text.length;
|
|
2753
2772
|
}
|
|
2754
2773
|
/**
|
|
@@ -7076,7 +7095,9 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
|
|
|
7076
7095
|
if (this.jsonBuffer.length + content.length > _VercelDataStreamHelper.MAX_BUFFER_SIZE) {
|
|
7077
7096
|
const newBuffer = this.truncateJsonBufferSafely(this.jsonBuffer);
|
|
7078
7097
|
if (newBuffer.length === this.jsonBuffer.length) {
|
|
7079
|
-
console.warn(
|
|
7098
|
+
console.warn(
|
|
7099
|
+
"VercelDataStreamHelper: Could not find safe JSON truncation point, clearing buffer"
|
|
7100
|
+
);
|
|
7080
7101
|
this.jsonBuffer = "";
|
|
7081
7102
|
this.sentItems.clear();
|
|
7082
7103
|
} else {
|
|
@@ -7484,11 +7505,17 @@ var ExecutionHandler = class {
|
|
|
7484
7505
|
);
|
|
7485
7506
|
} catch (error) {
|
|
7486
7507
|
if (error?.message?.includes("UNIQUE constraint failed") || error?.message?.includes("PRIMARY KEY constraint failed") || error?.code === "SQLITE_CONSTRAINT_PRIMARYKEY") {
|
|
7487
|
-
logger19.info(
|
|
7508
|
+
logger19.info(
|
|
7509
|
+
{ taskId, error: error.message },
|
|
7510
|
+
"Task already exists, fetching existing task"
|
|
7511
|
+
);
|
|
7488
7512
|
const existingTask = await agentsCore.getTask(dbClient_default)({ id: taskId });
|
|
7489
7513
|
if (existingTask) {
|
|
7490
7514
|
task = existingTask;
|
|
7491
|
-
logger19.info(
|
|
7515
|
+
logger19.info(
|
|
7516
|
+
{ taskId, existingTask },
|
|
7517
|
+
"Successfully reused existing task from race condition"
|
|
7518
|
+
);
|
|
7492
7519
|
} else {
|
|
7493
7520
|
logger19.error({ taskId, error }, "Task constraint failed but task not found");
|
|
7494
7521
|
throw error;
|
|
@@ -8889,15 +8916,12 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8889
8916
|
app6.use(
|
|
8890
8917
|
"*",
|
|
8891
8918
|
cors.cors({
|
|
8892
|
-
origin:
|
|
8893
|
-
|
|
8894
|
-
return origin.startsWith("http://localhost:") || origin.startsWith("https://localhost:") ? origin : null;
|
|
8895
|
-
},
|
|
8919
|
+
origin: "*",
|
|
8920
|
+
// public API
|
|
8896
8921
|
allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
8897
8922
|
allowHeaders: ["*"],
|
|
8898
8923
|
exposeHeaders: ["Content-Length"],
|
|
8899
|
-
maxAge: 86400
|
|
8900
|
-
credentials: true
|
|
8924
|
+
maxAge: 86400
|
|
8901
8925
|
})
|
|
8902
8926
|
);
|
|
8903
8927
|
app6.use("/tenants/*", apiKeyAuth());
|
package/dist/index.js
CHANGED
|
@@ -268,9 +268,9 @@ function setupOpenAPIRoutes(app6) {
|
|
|
268
268
|
const document = app6.getOpenAPIDocument({
|
|
269
269
|
openapi: "3.0.0",
|
|
270
270
|
info: {
|
|
271
|
-
title: "Inkeep
|
|
271
|
+
title: "Inkeep Agents Run API",
|
|
272
272
|
version: "1.0.0",
|
|
273
|
-
description: "
|
|
273
|
+
description: "Chat completions, MCP, and A2A run endpoints in the Inkeep Agent Framework."
|
|
274
274
|
},
|
|
275
275
|
servers: [
|
|
276
276
|
{
|
|
@@ -290,7 +290,7 @@ function setupOpenAPIRoutes(app6) {
|
|
|
290
290
|
"/docs",
|
|
291
291
|
swaggerUI({
|
|
292
292
|
url: "/openapi.json",
|
|
293
|
-
title: "Inkeep
|
|
293
|
+
title: "Inkeep Agents Run API Documentation"
|
|
294
294
|
})
|
|
295
295
|
);
|
|
296
296
|
}
|
|
@@ -899,11 +899,7 @@ async function handleTasksResubscribe(c, agent, request) {
|
|
|
899
899
|
});
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
|
|
903
|
-
// package.json
|
|
904
|
-
var package_default = {
|
|
905
|
-
version: "0.1.3"};
|
|
906
|
-
var tracer = getTracer("agents-run-api", package_default.version);
|
|
902
|
+
var tracer = getTracer("agents-run-api");
|
|
907
903
|
function agentInitializingOp(sessionId, graphId) {
|
|
908
904
|
return {
|
|
909
905
|
type: "agent_initializing",
|
|
@@ -1032,7 +1028,9 @@ var _ModelFactory = class _ModelFactory {
|
|
|
1032
1028
|
*/
|
|
1033
1029
|
static createModel(config) {
|
|
1034
1030
|
if (!config?.model?.trim()) {
|
|
1035
|
-
throw new Error(
|
|
1031
|
+
throw new Error(
|
|
1032
|
+
"Model configuration is required. Please configure models at the project level."
|
|
1033
|
+
);
|
|
1036
1034
|
}
|
|
1037
1035
|
const modelSettings = config;
|
|
1038
1036
|
const modelString = modelSettings.model.trim();
|
|
@@ -1053,7 +1051,9 @@ var _ModelFactory = class _ModelFactory {
|
|
|
1053
1051
|
case "openai":
|
|
1054
1052
|
return _ModelFactory.createOpenAIModel(modelName, modelSettings.providerOptions);
|
|
1055
1053
|
default:
|
|
1056
|
-
throw new Error(
|
|
1054
|
+
throw new Error(
|
|
1055
|
+
`Unsupported provider: ${provider}. Supported providers are: ${_ModelFactory.SUPPORTED_PROVIDERS.join(", ")}`
|
|
1056
|
+
);
|
|
1057
1057
|
}
|
|
1058
1058
|
} catch (error) {
|
|
1059
1059
|
logger5.error(
|
|
@@ -1064,7 +1064,9 @@ var _ModelFactory = class _ModelFactory {
|
|
|
1064
1064
|
},
|
|
1065
1065
|
"Failed to create model"
|
|
1066
1066
|
);
|
|
1067
|
-
throw new Error(
|
|
1067
|
+
throw new Error(
|
|
1068
|
+
`Failed to create model ${modelString}: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
1069
|
+
);
|
|
1068
1070
|
}
|
|
1069
1071
|
}
|
|
1070
1072
|
/**
|
|
@@ -1313,12 +1315,15 @@ var GraphSession = class {
|
|
|
1313
1315
|
if (eventType === "artifact_saved" && data.pendingGeneration) {
|
|
1314
1316
|
const artifactId = data.artifactId;
|
|
1315
1317
|
if (this.pendingArtifacts.size >= this.MAX_PENDING_ARTIFACTS) {
|
|
1316
|
-
logger6.warn(
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1318
|
+
logger6.warn(
|
|
1319
|
+
{
|
|
1320
|
+
sessionId: this.sessionId,
|
|
1321
|
+
artifactId,
|
|
1322
|
+
pendingCount: this.pendingArtifacts.size,
|
|
1323
|
+
maxAllowed: this.MAX_PENDING_ARTIFACTS
|
|
1324
|
+
},
|
|
1325
|
+
"Too many pending artifacts, skipping processing"
|
|
1326
|
+
);
|
|
1322
1327
|
return;
|
|
1323
1328
|
}
|
|
1324
1329
|
this.pendingArtifacts.add(artifactId);
|
|
@@ -1331,21 +1336,27 @@ var GraphSession = class {
|
|
|
1331
1336
|
this.artifactProcessingErrors.set(artifactId, errorCount);
|
|
1332
1337
|
if (errorCount >= this.MAX_ARTIFACT_RETRIES) {
|
|
1333
1338
|
this.pendingArtifacts.delete(artifactId);
|
|
1334
|
-
logger6.error(
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1339
|
+
logger6.error(
|
|
1340
|
+
{
|
|
1341
|
+
sessionId: this.sessionId,
|
|
1342
|
+
artifactId,
|
|
1343
|
+
errorCount,
|
|
1344
|
+
maxRetries: this.MAX_ARTIFACT_RETRIES,
|
|
1345
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
1346
|
+
stack: error instanceof Error ? error.stack : void 0
|
|
1347
|
+
},
|
|
1348
|
+
"Artifact processing failed after max retries, giving up"
|
|
1349
|
+
);
|
|
1342
1350
|
} else {
|
|
1343
|
-
logger6.warn(
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1351
|
+
logger6.warn(
|
|
1352
|
+
{
|
|
1353
|
+
sessionId: this.sessionId,
|
|
1354
|
+
artifactId,
|
|
1355
|
+
errorCount,
|
|
1356
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
1357
|
+
},
|
|
1358
|
+
"Artifact processing failed, may retry"
|
|
1359
|
+
);
|
|
1349
1360
|
}
|
|
1350
1361
|
});
|
|
1351
1362
|
});
|
|
@@ -1749,7 +1760,9 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
|
|
|
1749
1760
|
let modelToUse = summarizerModel;
|
|
1750
1761
|
if (!summarizerModel?.model?.trim()) {
|
|
1751
1762
|
if (!this.statusUpdateState?.baseModel?.model?.trim()) {
|
|
1752
|
-
throw new Error(
|
|
1763
|
+
throw new Error(
|
|
1764
|
+
"Either summarizer or base model is required for progress summary generation. Please configure models at the project level."
|
|
1765
|
+
);
|
|
1753
1766
|
}
|
|
1754
1767
|
modelToUse = this.statusUpdateState.baseModel;
|
|
1755
1768
|
}
|
|
@@ -1877,7 +1890,9 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
|
|
|
1877
1890
|
let modelToUse = summarizerModel;
|
|
1878
1891
|
if (!summarizerModel?.model?.trim()) {
|
|
1879
1892
|
if (!this.statusUpdateState?.baseModel?.model?.trim()) {
|
|
1880
|
-
throw new Error(
|
|
1893
|
+
throw new Error(
|
|
1894
|
+
"Either summarizer or base model is required for status update generation. Please configure models at the project level."
|
|
1895
|
+
);
|
|
1881
1896
|
}
|
|
1882
1897
|
modelToUse = this.statusUpdateState.baseModel;
|
|
1883
1898
|
}
|
|
@@ -2167,7 +2182,9 @@ Make it specific and relevant.`;
|
|
|
2167
2182
|
let modelToUse = this.statusUpdateState?.summarizerModel;
|
|
2168
2183
|
if (!modelToUse?.model?.trim()) {
|
|
2169
2184
|
if (!this.statusUpdateState?.baseModel?.model?.trim()) {
|
|
2170
|
-
throw new Error(
|
|
2185
|
+
throw new Error(
|
|
2186
|
+
"Either summarizer or base model is required for artifact name generation. Please configure models at the project level."
|
|
2187
|
+
);
|
|
2171
2188
|
}
|
|
2172
2189
|
modelToUse = this.statusUpdateState.baseModel;
|
|
2173
2190
|
}
|
|
@@ -2423,7 +2440,9 @@ var _ArtifactParser = class _ArtifactParser {
|
|
|
2423
2440
|
* More robust detection that handles streaming fragments
|
|
2424
2441
|
*/
|
|
2425
2442
|
hasIncompleteArtifact(text) {
|
|
2426
|
-
return /^.*<(?:artifact(?::ref)?|a(?:r(?:t(?:i(?:f(?:a(?:c(?:t(?::(?:r(?:e(?:f)?)?)?)?)?)?)?)?)?)?)?)?$/.test(
|
|
2443
|
+
return /^.*<(?:artifact(?::ref)?|a(?:r(?:t(?:i(?:f(?:a(?:c(?:t(?::(?:r(?:e(?:f)?)?)?)?)?)?)?)?)?)?)?)?$/.test(
|
|
2444
|
+
text
|
|
2445
|
+
) || /^.*<artifact:ref(?:[^>]*)$/.test(text) || // Incomplete artifact:ref at end
|
|
2427
2446
|
this.findSafeTextBoundary(text) < text.length;
|
|
2428
2447
|
}
|
|
2429
2448
|
/**
|
|
@@ -6740,7 +6759,9 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
|
|
|
6740
6759
|
if (this.jsonBuffer.length + content.length > _VercelDataStreamHelper.MAX_BUFFER_SIZE) {
|
|
6741
6760
|
const newBuffer = this.truncateJsonBufferSafely(this.jsonBuffer);
|
|
6742
6761
|
if (newBuffer.length === this.jsonBuffer.length) {
|
|
6743
|
-
console.warn(
|
|
6762
|
+
console.warn(
|
|
6763
|
+
"VercelDataStreamHelper: Could not find safe JSON truncation point, clearing buffer"
|
|
6764
|
+
);
|
|
6744
6765
|
this.jsonBuffer = "";
|
|
6745
6766
|
this.sentItems.clear();
|
|
6746
6767
|
} else {
|
|
@@ -7145,11 +7166,17 @@ var ExecutionHandler = class {
|
|
|
7145
7166
|
);
|
|
7146
7167
|
} catch (error) {
|
|
7147
7168
|
if (error?.message?.includes("UNIQUE constraint failed") || error?.message?.includes("PRIMARY KEY constraint failed") || error?.code === "SQLITE_CONSTRAINT_PRIMARYKEY") {
|
|
7148
|
-
logger19.info(
|
|
7169
|
+
logger19.info(
|
|
7170
|
+
{ taskId, error: error.message },
|
|
7171
|
+
"Task already exists, fetching existing task"
|
|
7172
|
+
);
|
|
7149
7173
|
const existingTask = await getTask(dbClient_default)({ id: taskId });
|
|
7150
7174
|
if (existingTask) {
|
|
7151
7175
|
task = existingTask;
|
|
7152
|
-
logger19.info(
|
|
7176
|
+
logger19.info(
|
|
7177
|
+
{ taskId, existingTask },
|
|
7178
|
+
"Successfully reused existing task from race condition"
|
|
7179
|
+
);
|
|
7153
7180
|
} else {
|
|
7154
7181
|
logger19.error({ taskId, error }, "Task constraint failed but task not found");
|
|
7155
7182
|
throw error;
|
|
@@ -8544,15 +8571,12 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8544
8571
|
app6.use(
|
|
8545
8572
|
"*",
|
|
8546
8573
|
cors({
|
|
8547
|
-
origin:
|
|
8548
|
-
|
|
8549
|
-
return origin.startsWith("http://localhost:") || origin.startsWith("https://localhost:") ? origin : null;
|
|
8550
|
-
},
|
|
8574
|
+
origin: "*",
|
|
8575
|
+
// public API
|
|
8551
8576
|
allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
8552
8577
|
allowHeaders: ["*"],
|
|
8553
8578
|
exposeHeaders: ["Content-Length"],
|
|
8554
|
-
maxAge: 86400
|
|
8555
|
-
credentials: true
|
|
8579
|
+
maxAge: 86400
|
|
8556
8580
|
})
|
|
8557
8581
|
);
|
|
8558
8582
|
app6.use("/tenants/*", apiKeyAuth());
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-run-api",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.0-dev-20250912142126",
|
|
4
|
+
"description": "Agents Run API for Inkeep Agent Framework - handles chat, agent execution, and streaming",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"traverse": "^0.6.11",
|
|
45
45
|
"ts-pattern": "^5.7.1",
|
|
46
46
|
"zod": "^4.1.5",
|
|
47
|
-
"@inkeep/agents-core": "^0.0.0-dev-
|
|
47
|
+
"@inkeep/agents-core": "^0.0.0-dev-20250912142126"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@hono/vite-dev-server": "^0.20.1",
|