@inkeep/agents-api 0.0.0-dev-20260327195114 → 0.0.0-dev-20260327225559
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/.well-known/workflow/v1/manifest.json +64 -64
- package/dist/createApp.d.ts +2 -2
- package/dist/data/db/manageDbClient.d.ts +2 -2
- package/dist/data-reconciliation/handlers/agent.d.ts +2 -2
- package/dist/data-reconciliation/handlers/context-configs.d.ts +2 -2
- package/dist/data-reconciliation/handlers/scheduled-triggers.d.ts +2 -2
- package/dist/data-reconciliation/handlers/sub-agents.d.ts +2 -2
- package/dist/data-reconciliation/handlers/tools.d.ts +2 -2
- package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
- package/dist/domains/evals/routes/index.d.ts +2 -2
- package/dist/domains/evals/workflow/routes.d.ts +2 -2
- package/dist/domains/manage/routes/authLookup.d.ts +2 -2
- package/dist/domains/manage/routes/availableAgents.d.ts +2 -2
- package/dist/domains/manage/routes/conversations.d.ts +2 -2
- package/dist/domains/manage/routes/index.d.ts +2 -2
- package/dist/domains/manage/routes/invitations.d.ts +2 -2
- package/dist/domains/manage/routes/passwordResetLinks.d.ts +2 -2
- package/dist/domains/manage/routes/signoz.d.ts +2 -2
- package/dist/domains/manage/routes/users.d.ts +2 -2
- package/dist/domains/mcp/routes/mcp.d.ts +2 -2
- package/dist/domains/run/routes/auth.d.ts +2 -2
- package/dist/domains/run/workflow/steps/scheduledTriggerSteps.d.ts +6 -6
- package/dist/factory.d.ts +81 -81
- package/dist/index.d.ts +80 -80
- package/dist/index.js +3 -3
- package/dist/middleware/manageAuth.d.ts +3 -3
- package/dist/middleware/projectConfig.d.ts +3 -3
- package/dist/middleware/requirePermission.d.ts +2 -2
- package/dist/middleware/runAuth.d.ts +4 -4
- package/dist/middleware/sessionAuth.d.ts +3 -3
- package/dist/middleware/tenantAccess.d.ts +2 -2
- package/dist/middleware/tracing.d.ts +3 -3
- package/dist/startup/playground-app.d.ts +2 -2
- package/dist/startup/playground-app.js +94 -41
- package/package.json +5 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseExecutionContext } from "@inkeep/agents-core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono8 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/middleware/runAuth.d.ts
|
|
5
|
-
declare const runApiKeyAuth: () =>
|
|
5
|
+
declare const runApiKeyAuth: () => hono8.MiddlewareHandler<{
|
|
6
6
|
Variables: {
|
|
7
7
|
executionContext: BaseExecutionContext;
|
|
8
8
|
};
|
|
@@ -11,7 +11,7 @@ declare const runApiKeyAuth: () => hono14.MiddlewareHandler<{
|
|
|
11
11
|
* Creates a middleware that applies API key authentication except for specified route patterns
|
|
12
12
|
* @param skipRouteCheck - Function that returns true if the route should skip authentication
|
|
13
13
|
*/
|
|
14
|
-
declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) =>
|
|
14
|
+
declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) => hono8.MiddlewareHandler<{
|
|
15
15
|
Variables: {
|
|
16
16
|
executionContext: BaseExecutionContext;
|
|
17
17
|
};
|
|
@@ -20,7 +20,7 @@ declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) =
|
|
|
20
20
|
* Helper middleware for endpoints that optionally support API key authentication
|
|
21
21
|
* If no auth header is present, it continues without setting the executionContext
|
|
22
22
|
*/
|
|
23
|
-
declare const runOptionalAuth: () =>
|
|
23
|
+
declare const runOptionalAuth: () => hono8.MiddlewareHandler<{
|
|
24
24
|
Variables: {
|
|
25
25
|
executionContext?: BaseExecutionContext;
|
|
26
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppVariables } from "../types/app.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono4 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/middleware/sessionAuth.d.ts
|
|
5
5
|
|
|
@@ -8,12 +8,12 @@ import * as hono2 from "hono";
|
|
|
8
8
|
* Requires that a user has already been authenticated via Better Auth session.
|
|
9
9
|
* Used primarily for manage routes that require an active user session.
|
|
10
10
|
*/
|
|
11
|
-
declare const sessionAuth: () =>
|
|
11
|
+
declare const sessionAuth: () => hono4.MiddlewareHandler<any, string, {}, Response>;
|
|
12
12
|
/**
|
|
13
13
|
* Global session middleware - sets user and session in context for all routes
|
|
14
14
|
* Used for all routes that require an active user session.
|
|
15
15
|
*/
|
|
16
|
-
declare const sessionContext: () =>
|
|
16
|
+
declare const sessionContext: () => hono4.MiddlewareHandler<{
|
|
17
17
|
Variables: AppVariables;
|
|
18
18
|
}, string, {}, Response>;
|
|
19
19
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as hono7 from "hono";
|
|
2
2
|
|
|
3
3
|
//#region src/middleware/tenantAccess.d.ts
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ import * as hono4 from "hono";
|
|
|
12
12
|
* - API key user: Access only to the tenant associated with the API key
|
|
13
13
|
* - Session user: Access based on organization membership
|
|
14
14
|
*/
|
|
15
|
-
declare const requireTenantAccess: () =>
|
|
15
|
+
declare const requireTenantAccess: () => hono7.MiddlewareHandler<{
|
|
16
16
|
Variables: {
|
|
17
17
|
userId: string;
|
|
18
18
|
tenantId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as hono11 from "hono";
|
|
2
2
|
|
|
3
3
|
//#region src/middleware/tracing.d.ts
|
|
4
|
-
declare const otelBaggageMiddleware: () =>
|
|
5
|
-
declare const executionBaggageMiddleware: () =>
|
|
4
|
+
declare const otelBaggageMiddleware: () => hono11.MiddlewareHandler<any, string, {}, Response>;
|
|
5
|
+
declare const executionBaggageMiddleware: () => hono11.MiddlewareHandler<any, string, {}, Response>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { executionBaggageMiddleware, otelBaggageMiddleware };
|
|
@@ -5,61 +5,114 @@ import { derivePlaygroundKid, getAppById, updateApp } from "@inkeep/agents-core"
|
|
|
5
5
|
|
|
6
6
|
//#region src/startup/playground-app.ts
|
|
7
7
|
const logger = getLogger$1("playground-app");
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
return;
|
|
8
|
+
function derivePlaygroundDomains() {
|
|
9
|
+
const manageUiUrl = env.INKEEP_AGENTS_MANAGE_UI_URL;
|
|
10
|
+
if (manageUiUrl) try {
|
|
11
|
+
const url = new URL(manageUiUrl);
|
|
12
|
+
if (url.hostname === "localhost" || url.hostname === "127.0.0.1") return ["localhost", "127.0.0.1"];
|
|
13
|
+
return [url.hostname];
|
|
14
|
+
} catch {
|
|
15
|
+
logger.warn({ manageUiUrl }, "Invalid INKEEP_AGENTS_MANAGE_UI_URL, falling back to environment defaults");
|
|
16
|
+
}
|
|
17
|
+
if (env.ENVIRONMENT === "production") {
|
|
18
|
+
logger.error({}, "INKEEP_AGENTS_MANAGE_UI_URL not set in production — cannot derive playground allowed domains");
|
|
19
|
+
return [];
|
|
13
20
|
}
|
|
21
|
+
return ["localhost", "127.0.0.1"];
|
|
22
|
+
}
|
|
23
|
+
async function ensurePlaygroundAppConfig() {
|
|
14
24
|
const appId = env.INKEEP_PLAYGROUND_APP_ID || "app_playground";
|
|
15
|
-
logger.info({ appId }, "
|
|
25
|
+
logger.info({ appId }, "Checking playground app configuration");
|
|
16
26
|
const app = await getAppById(runDbClient_default)(appId);
|
|
17
27
|
if (!app) {
|
|
18
|
-
logger.info({ appId }, "Playground app not found, skipping
|
|
28
|
+
logger.info({ appId }, "Playground app not found, skipping configuration");
|
|
19
29
|
return;
|
|
20
30
|
}
|
|
21
31
|
if (app.config.type !== "web_client") {
|
|
22
|
-
logger.warn({
|
|
32
|
+
logger.warn({
|
|
33
|
+
appId,
|
|
34
|
+
type: app.config.type
|
|
35
|
+
}, "Playground app is not a web_client app");
|
|
23
36
|
return;
|
|
24
37
|
}
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
38
|
+
const webClient = { ...app.config.webClient };
|
|
39
|
+
const auth = { ...webClient.auth ?? {} };
|
|
40
|
+
let configChanged = false;
|
|
41
|
+
const derivedDomains = derivePlaygroundDomains();
|
|
42
|
+
const currentDomains = webClient.allowedDomains ?? [];
|
|
43
|
+
const hasWildcard = currentDomains.includes("*");
|
|
44
|
+
const specificDomains = currentDomains.filter((d) => d !== "*");
|
|
45
|
+
const newDomains = derivedDomains.filter((d) => !specificDomains.includes(d));
|
|
46
|
+
if (hasWildcard && derivedDomains.length > 0) {
|
|
47
|
+
const mergedDomains = [...specificDomains, ...newDomains];
|
|
31
48
|
logger.info({
|
|
49
|
+
appId,
|
|
50
|
+
previousDomains: currentDomains,
|
|
51
|
+
removedWildcard: true,
|
|
52
|
+
mergedDomains
|
|
53
|
+
}, "Replacing wildcard with explicit domains on playground app");
|
|
54
|
+
webClient.allowedDomains = mergedDomains;
|
|
55
|
+
configChanged = true;
|
|
56
|
+
} else if (newDomains.length > 0) {
|
|
57
|
+
const mergedDomains = [...currentDomains, ...newDomains];
|
|
58
|
+
logger.info({
|
|
59
|
+
appId,
|
|
60
|
+
currentDomains,
|
|
61
|
+
addedDomains: newDomains,
|
|
62
|
+
mergedDomains
|
|
63
|
+
}, "Adding new domains to playground app allowed domains");
|
|
64
|
+
webClient.allowedDomains = mergedDomains;
|
|
65
|
+
configChanged = true;
|
|
66
|
+
} else if (derivedDomains.length === 0) logger.warn({
|
|
67
|
+
appId,
|
|
68
|
+
currentDomains
|
|
69
|
+
}, "No playground domains could be derived — allowedDomains not updated");
|
|
70
|
+
else logger.info({
|
|
71
|
+
appId,
|
|
72
|
+
domains: currentDomains
|
|
73
|
+
}, "Playground app domains are up to date");
|
|
74
|
+
const publicKeyB64 = env.INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY;
|
|
75
|
+
if (publicKeyB64) {
|
|
76
|
+
const publicKeyPem = Buffer.from(publicKeyB64, "base64").toString("utf-8");
|
|
77
|
+
const kid = await derivePlaygroundKid(publicKeyPem);
|
|
78
|
+
const existingKeys = auth.publicKeys ?? [];
|
|
79
|
+
if (!existingKeys.some((k) => k.kid === kid)) {
|
|
80
|
+
const newKey = {
|
|
81
|
+
kid,
|
|
82
|
+
publicKey: publicKeyPem,
|
|
83
|
+
algorithm: "RS256",
|
|
84
|
+
addedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
85
|
+
};
|
|
86
|
+
const updatedKeys = [...existingKeys, newKey];
|
|
87
|
+
webClient.auth = {
|
|
88
|
+
...auth,
|
|
89
|
+
publicKeys: updatedKeys
|
|
90
|
+
};
|
|
91
|
+
configChanged = true;
|
|
92
|
+
logger.info({
|
|
93
|
+
appId,
|
|
94
|
+
kid
|
|
95
|
+
}, "Registering playground public key");
|
|
96
|
+
} else logger.info({
|
|
32
97
|
appId,
|
|
33
98
|
kid
|
|
34
99
|
}, "Playground key already registered");
|
|
35
|
-
return;
|
|
36
100
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
await updateApp(runDbClient_default)({
|
|
55
|
-
id: appId,
|
|
56
|
-
data: { config: updatedConfig }
|
|
57
|
-
});
|
|
58
|
-
logger.info({
|
|
59
|
-
appId,
|
|
60
|
-
kid
|
|
61
|
-
}, "Registered playground public key");
|
|
101
|
+
if (configChanged) {
|
|
102
|
+
const updatedConfig = {
|
|
103
|
+
type: "web_client",
|
|
104
|
+
webClient
|
|
105
|
+
};
|
|
106
|
+
await updateApp(runDbClient_default)({
|
|
107
|
+
id: appId,
|
|
108
|
+
data: { config: updatedConfig }
|
|
109
|
+
});
|
|
110
|
+
logger.info({
|
|
111
|
+
appId,
|
|
112
|
+
allowedDomains: updatedConfig.webClient.allowedDomains
|
|
113
|
+
}, "Playground app configuration updated");
|
|
114
|
+
}
|
|
62
115
|
}
|
|
63
116
|
|
|
64
117
|
//#endregion
|
|
65
|
-
export {
|
|
118
|
+
export { ensurePlaygroundAppConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-api",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260327225559",
|
|
4
4
|
"description": "Unified Inkeep Agents API - combines management, runtime, and evaluation capabilities",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"pg": "^8.16.3",
|
|
74
74
|
"undici": "^7.22.0",
|
|
75
75
|
"workflow": "4.2.0-beta.67",
|
|
76
|
-
"@inkeep/agents-core": "^0.0.0-dev-
|
|
77
|
-
"@inkeep/agents-email": "^0.0.0-dev-
|
|
78
|
-
"@inkeep/agents-mcp": "^0.0.0-dev-
|
|
79
|
-
"@inkeep/agents-work-apps": "^0.0.0-dev-
|
|
76
|
+
"@inkeep/agents-core": "^0.0.0-dev-20260327225559",
|
|
77
|
+
"@inkeep/agents-email": "^0.0.0-dev-20260327225559",
|
|
78
|
+
"@inkeep/agents-mcp": "^0.0.0-dev-20260327225559",
|
|
79
|
+
"@inkeep/agents-work-apps": "^0.0.0-dev-20260327225559"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"@hono/zod-openapi": "^1.1.5",
|