@inkeep/agents-core 0.41.2 → 0.42.0
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/api-client/base-client.d.ts +87 -8
- package/dist/api-client/base-client.js +174 -1
- package/dist/api-client/eval-api-client.d.ts +47 -0
- package/dist/api-client/eval-api-client.js +65 -0
- package/dist/api-client/index.d.ts +4 -0
- package/dist/api-client/index.js +5 -0
- package/dist/api-client/manage-api-client.d.ts +34 -0
- package/dist/api-client/manage-api-client.js +104 -0
- package/dist/auth/auth.d.ts +86 -20
- package/dist/auth/auth.js +55 -1
- package/dist/auth/authz/client.d.ts +81 -0
- package/dist/auth/authz/client.js +189 -0
- package/dist/auth/authz/config.d.ts +76 -0
- package/dist/auth/authz/config.js +76 -0
- package/dist/auth/authz/index.d.ts +5 -0
- package/dist/auth/authz/index.js +6 -0
- package/dist/auth/authz/permissions.d.ts +57 -0
- package/dist/auth/authz/permissions.js +83 -0
- package/dist/auth/authz/sync.d.ts +85 -0
- package/dist/auth/authz/sync.js +237 -0
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/auth/permissions.js +2 -181
- package/dist/client-exports.d.ts +8 -3
- package/dist/client-exports.js +3 -2
- package/dist/constants/context-breakdown.d.ts +61 -0
- package/dist/constants/context-breakdown.js +124 -0
- package/dist/constants/otel-attributes.d.ts +4 -0
- package/dist/constants/otel-attributes.js +4 -0
- package/dist/context/ContextConfig.d.ts +2 -2
- package/dist/context/ContextConfig.js +3 -3
- package/dist/context/TemplateEngine.js +0 -1
- package/dist/context/index.d.ts +1 -5
- package/dist/context/index.js +1 -5
- package/dist/credential-stuffer/CredentialStuffer.d.ts +1 -1
- package/dist/data-access/index.d.ts +34 -26
- package/dist/data-access/index.js +34 -26
- package/dist/data-access/manage/agentFull.d.ts +36 -0
- package/dist/data-access/{agentFull.js → manage/agentFull.js} +205 -7
- package/dist/data-access/{agents.d.ts → manage/agents.d.ts} +23 -22
- package/dist/data-access/{agents.js → manage/agents.js} +52 -7
- package/dist/data-access/{artifactComponents.d.ts → manage/artifactComponents.d.ts} +21 -21
- package/dist/data-access/{artifactComponents.js → manage/artifactComponents.js} +5 -5
- package/dist/data-access/{contextConfigs.d.ts → manage/contextConfigs.d.ts} +14 -14
- package/dist/data-access/{contextConfigs.js → manage/contextConfigs.js} +3 -3
- package/dist/data-access/{credentialReferences.d.ts → manage/credentialReferences.d.ts} +17 -17
- package/dist/data-access/{credentialReferences.js → manage/credentialReferences.js} +2 -2
- package/dist/data-access/{dataComponents.d.ts → manage/dataComponents.d.ts} +20 -20
- package/dist/data-access/{dataComponents.js → manage/dataComponents.js} +7 -7
- package/dist/data-access/manage/evalConfig.d.ts +221 -0
- package/dist/data-access/manage/evalConfig.js +275 -0
- package/dist/data-access/{externalAgents.d.ts → manage/externalAgents.d.ts} +16 -16
- package/dist/data-access/{externalAgents.js → manage/externalAgents.js} +2 -2
- package/dist/data-access/{functionTools.d.ts → manage/functionTools.d.ts} +65 -15
- package/dist/data-access/{functionTools.js → manage/functionTools.js} +90 -8
- package/dist/data-access/{functions.d.ts → manage/functions.d.ts} +9 -9
- package/dist/data-access/{functions.js → manage/functions.js} +3 -3
- package/dist/data-access/manage/projectFull.d.ts +38 -0
- package/dist/data-access/{projectFull.js → manage/projectFull.js} +64 -65
- package/dist/data-access/manage/projectLifecycle.d.ts +119 -0
- package/dist/data-access/manage/projectLifecycle.js +234 -0
- package/dist/data-access/manage/projects.d.ts +75 -0
- package/dist/data-access/{projects.js → manage/projects.js} +15 -16
- package/dist/data-access/{subAgentExternalAgentRelations.d.ts → manage/subAgentExternalAgentRelations.d.ts} +19 -19
- package/dist/data-access/{subAgentExternalAgentRelations.js → manage/subAgentExternalAgentRelations.js} +2 -2
- package/dist/data-access/{subAgentRelations.d.ts → manage/subAgentRelations.d.ts} +29 -29
- package/dist/data-access/{subAgentRelations.js → manage/subAgentRelations.js} +3 -3
- package/dist/data-access/{subAgentTeamAgentRelations.d.ts → manage/subAgentTeamAgentRelations.d.ts} +19 -19
- package/dist/data-access/{subAgentTeamAgentRelations.js → manage/subAgentTeamAgentRelations.js} +2 -2
- package/dist/data-access/{subAgents.d.ts → manage/subAgents.d.ts} +13 -13
- package/dist/data-access/{subAgents.js → manage/subAgents.js} +4 -4
- package/dist/data-access/{tools.d.ts → manage/tools.d.ts} +26 -19
- package/dist/data-access/{tools.js → manage/tools.js} +57 -35
- package/dist/data-access/manage/triggers.d.ts +80 -0
- package/dist/data-access/manage/triggers.js +81 -0
- package/dist/data-access/{apiKeys.d.ts → runtime/apiKeys.d.ts} +17 -17
- package/dist/data-access/{apiKeys.js → runtime/apiKeys.js} +3 -3
- package/dist/data-access/runtime/cascade-delete.d.ts +77 -0
- package/dist/data-access/runtime/cascade-delete.js +111 -0
- package/dist/data-access/{contextCache.d.ts → runtime/contextCache.d.ts} +13 -13
- package/dist/data-access/{contextCache.js → runtime/contextCache.js} +5 -5
- package/dist/data-access/{conversations.d.ts → runtime/conversations.d.ts} +68 -19
- package/dist/data-access/{conversations.js → runtime/conversations.js} +13 -7
- package/dist/data-access/runtime/evalRuns.d.ts +120 -0
- package/dist/data-access/runtime/evalRuns.js +168 -0
- package/dist/data-access/{ledgerArtifacts.d.ts → runtime/ledgerArtifacts.d.ts} +13 -13
- package/dist/data-access/{ledgerArtifacts.js → runtime/ledgerArtifacts.js} +3 -3
- package/dist/data-access/{messages.d.ts → runtime/messages.d.ts} +15 -15
- package/dist/data-access/{messages.js → runtime/messages.js} +2 -2
- package/dist/data-access/{organizations.d.ts → runtime/organizations.d.ts} +16 -7
- package/dist/data-access/{organizations.js → runtime/organizations.js} +15 -3
- package/dist/data-access/runtime/projects.d.ts +62 -0
- package/dist/data-access/runtime/projects.js +90 -0
- package/dist/data-access/runtime/tasks.d.ts +55 -0
- package/dist/data-access/{tasks.js → runtime/tasks.js} +2 -2
- package/dist/data-access/runtime/triggerInvocations.d.ts +62 -0
- package/dist/data-access/runtime/triggerInvocations.js +54 -0
- package/dist/data-access/runtime/users.d.ts +19 -0
- package/dist/data-access/{users.js → runtime/users.js} +2 -2
- package/dist/data-access/validation.d.ts +4 -4
- package/dist/data-access/validation.js +1 -1
- package/dist/db/clean.d.ts +8 -4
- package/dist/db/clean.js +14 -105
- package/dist/db/delete.d.ts +1 -1
- package/dist/db/delete.js +7 -10
- package/dist/db/manage/dolt-cleanup.d.ts +51 -0
- package/dist/db/manage/dolt-cleanup.js +132 -0
- package/dist/db/manage/manage-client.d.ts +26 -0
- package/dist/db/manage/manage-client.js +68 -0
- package/dist/db/{schema.d.ts → manage/manage-schema.d.ts} +1459 -1285
- package/dist/db/{schema.js → manage/manage-schema.js} +433 -341
- package/dist/db/manage/test-manage-client.d.ts +27 -0
- package/dist/db/manage/test-manage-client.js +68 -0
- package/dist/db/runtime/runtime-client.d.ts +20 -0
- package/dist/db/runtime/runtime-client.js +30 -0
- package/dist/db/runtime/runtime-schema.d.ts +2834 -0
- package/dist/db/runtime/runtime-schema.js +483 -0
- package/dist/db/runtime/test-runtime-client.d.ts +27 -0
- package/dist/db/{test-client.js → runtime/test-runtime-client.js} +11 -25
- package/dist/dolt/branch.d.ts +62 -0
- package/dist/dolt/branch.js +82 -0
- package/dist/dolt/branches-api.d.ts +108 -0
- package/dist/dolt/branches-api.js +162 -0
- package/dist/dolt/commit.d.ts +94 -0
- package/dist/dolt/commit.js +103 -0
- package/dist/dolt/diff.d.ts +27 -0
- package/dist/dolt/diff.js +21 -0
- package/dist/dolt/index.d.ts +10 -0
- package/dist/dolt/index.js +11 -0
- package/dist/dolt/merge.d.ts +63 -0
- package/dist/dolt/merge.js +81 -0
- package/dist/dolt/migrate-all-branches.d.ts +4 -0
- package/dist/dolt/migrate-all-branches.js +78 -0
- package/dist/dolt/migrate-dolt.d.ts +1 -0
- package/dist/dolt/migrate-dolt.js +22 -0
- package/dist/dolt/ref-helpers.d.ts +19 -0
- package/dist/dolt/ref-helpers.js +65 -0
- package/dist/dolt/ref-middleware.d.ts +82 -0
- package/dist/dolt/ref-middleware.js +217 -0
- package/dist/dolt/ref-scope.d.ts +101 -0
- package/dist/dolt/ref-scope.js +231 -0
- package/dist/dolt/schema-sync.d.ts +134 -0
- package/dist/dolt/schema-sync.js +246 -0
- package/dist/env.d.ts +6 -4
- package/dist/env.js +3 -2
- package/dist/index.d.ts +71 -44
- package/dist/index.js +74 -47
- package/dist/types/entities.d.ts +81 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/utility.d.ts +45 -4
- package/dist/utils/JsonTransformer.d.ts +44 -0
- package/dist/utils/JsonTransformer.js +112 -0
- package/dist/utils/apiKeys.d.ts +5 -1
- package/dist/utils/apiKeys.js +11 -1
- package/dist/utils/colors.d.ts +34 -0
- package/dist/utils/colors.js +49 -0
- package/dist/utils/credential-store-utils.d.ts +1 -1
- package/dist/utils/format-messages.d.ts +1 -1
- package/dist/utils/index.d.ts +7 -3
- package/dist/utils/index.js +7 -3
- package/dist/utils/internal-service-auth.d.ts +79 -0
- package/dist/utils/internal-service-auth.js +140 -0
- package/dist/utils/jwt-helpers.d.ts +56 -0
- package/dist/utils/jwt-helpers.js +90 -0
- package/dist/utils/service-token-auth.d.ts +9 -27
- package/dist/utils/service-token-auth.js +48 -96
- package/dist/utils/template-interpolation.d.ts +22 -0
- package/dist/utils/template-interpolation.js +62 -0
- package/dist/utils/third-party-mcp-servers/composio-client.js +23 -23
- package/dist/utils/trigger-auth.d.ts +62 -0
- package/dist/utils/trigger-auth.js +125 -0
- package/dist/validation/agentFull.js +2 -4
- package/dist/validation/dolt-schemas.d.ts +49 -0
- package/dist/validation/dolt-schemas.js +44 -0
- package/dist/validation/drizzle-schema-helpers.d.ts +4 -26
- package/dist/validation/drizzle-schema-helpers.js +5 -151
- package/dist/validation/index.d.ts +4 -3
- package/dist/validation/index.js +3 -2
- package/dist/validation/schemas.d.ts +17647 -4789
- package/dist/validation/schemas.js +328 -11
- package/drizzle/manage/0000_tearful_rhodey.sql +414 -0
- package/drizzle/manage/0001_broken_wendell_vaughn.sql +19 -0
- package/drizzle/manage/0002_bent_sunfire.sql +1 -0
- package/drizzle/manage/meta/0000_snapshot.json +2987 -0
- package/drizzle/manage/meta/0001_snapshot.json +3115 -0
- package/drizzle/manage/meta/0002_snapshot.json +3115 -0
- package/drizzle/manage/meta/_journal.json +27 -0
- package/drizzle/runtime/0008_silly_preak.sql +127 -0
- package/drizzle/runtime/0009_freezing_leo.sql +17 -0
- package/drizzle/runtime/meta/0008_snapshot.json +2263 -0
- package/drizzle/runtime/meta/0009_snapshot.json +2397 -0
- package/drizzle/{meta → runtime/meta}/_journal.json +14 -0
- package/package.json +48 -15
- package/dist/context/ContextFetcher.d.ts +0 -73
- package/dist/context/ContextFetcher.js +0 -291
- package/dist/context/ContextResolver.d.ts +0 -60
- package/dist/context/ContextResolver.js +0 -278
- package/dist/context/context.d.ts +0 -27
- package/dist/context/context.js +0 -128
- package/dist/context/contextCache.d.ts +0 -58
- package/dist/context/contextCache.js +0 -177
- package/dist/data-access/agentFull.d.ts +0 -33
- package/dist/data-access/projectFull.d.ts +0 -32
- package/dist/data-access/projects.d.ts +0 -71
- package/dist/data-access/tasks.d.ts +0 -45
- package/dist/data-access/users.d.ts +0 -19
- package/dist/db/client.d.ts +0 -20
- package/dist/db/client.js +0 -28
- package/dist/db/test-client.d.ts +0 -31
- package/dist/middleware/contextValidation.d.ts +0 -46
- package/dist/middleware/contextValidation.js +0 -280
- package/dist/middleware/index.d.ts +0 -2
- package/dist/middleware/index.js +0 -3
- package/dist/utils/execution.d.ts +0 -22
- package/dist/utils/execution.js +0 -25
- /package/drizzle/{0000_exotic_mysterio.sql → runtime/0000_exotic_mysterio.sql} +0 -0
- /package/drizzle/{0001_calm_sheva_callister.sql → runtime/0001_calm_sheva_callister.sql} +0 -0
- /package/drizzle/{0002_puzzling_goblin_queen.sql → runtime/0002_puzzling_goblin_queen.sql} +0 -0
- /package/drizzle/{0003_sweet_human_robot.sql → runtime/0003_sweet_human_robot.sql} +0 -0
- /package/drizzle/{0004_cuddly_shooting_star.sql → runtime/0004_cuddly_shooting_star.sql} +0 -0
- /package/drizzle/{0005_reflective_starfox.sql → runtime/0005_reflective_starfox.sql} +0 -0
- /package/drizzle/{0006_stale_thaddeus_ross.sql → runtime/0006_stale_thaddeus_ross.sql} +0 -0
- /package/drizzle/{0007_slim_karma.sql → runtime/0007_slim_karma.sql} +0 -0
- /package/drizzle/{meta → runtime/meta}/0000_snapshot.json +0 -0
- /package/drizzle/{meta → runtime/meta}/0001_snapshot.json +0 -0
- /package/drizzle/{meta → runtime/meta}/0003_snapshot.json +0 -0
- /package/drizzle/{meta → runtime/meta}/0005_snapshot.json +0 -0
- /package/drizzle/{meta → runtime/meta}/0006_snapshot.json +0 -0
- /package/drizzle/{meta → runtime/meta}/0007_snapshot.json +0 -0
|
@@ -7,7 +7,7 @@ import { Composio } from "@composio/core";
|
|
|
7
7
|
* Composio MCP Server Client
|
|
8
8
|
* Handles all Composio-specific operations for MCP server integration
|
|
9
9
|
*/
|
|
10
|
-
const logger = getLogger("composio-client");
|
|
10
|
+
const logger$1 = getLogger("composio-client");
|
|
11
11
|
const TOOLKIT_TO_CATEGORY = {
|
|
12
12
|
github: "development",
|
|
13
13
|
gitlab: "development",
|
|
@@ -88,14 +88,14 @@ function extractComposioServerId(mcpUrl) {
|
|
|
88
88
|
async function deleteComposioConnectedAccount(accountId) {
|
|
89
89
|
const composioInstance = getComposioInstance();
|
|
90
90
|
if (!composioInstance) {
|
|
91
|
-
logger.info({}, "Composio not configured, skipping account deletion");
|
|
91
|
+
logger$1.info({}, "Composio not configured, skipping account deletion");
|
|
92
92
|
return false;
|
|
93
93
|
}
|
|
94
94
|
try {
|
|
95
95
|
await composioInstance.connectedAccounts.delete(accountId);
|
|
96
96
|
return true;
|
|
97
97
|
} catch (error) {
|
|
98
|
-
logger.warn({ error }, "Error deleting Composio connected account");
|
|
98
|
+
logger$1.warn({ error }, "Error deleting Composio connected account");
|
|
99
99
|
return false;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -106,7 +106,7 @@ async function deleteComposioConnectedAccount(accountId) {
|
|
|
106
106
|
async function fetchComposioConnectedAccounts(derivedUserId) {
|
|
107
107
|
const composioInstance = getComposioInstance();
|
|
108
108
|
if (!composioInstance) {
|
|
109
|
-
logger.info({}, "Composio not configured, skipping connected accounts fetch");
|
|
109
|
+
logger$1.info({}, "Composio not configured, skipping connected accounts fetch");
|
|
110
110
|
return null;
|
|
111
111
|
}
|
|
112
112
|
try {
|
|
@@ -115,7 +115,7 @@ async function fetchComposioConnectedAccounts(derivedUserId) {
|
|
|
115
115
|
statuses: ["ACTIVE", "INITIATED"]
|
|
116
116
|
});
|
|
117
117
|
} catch (error) {
|
|
118
|
-
logger.error({ error }, "Error fetching Composio connected accounts");
|
|
118
|
+
logger$1.error({ error }, "Error fetching Composio connected accounts");
|
|
119
119
|
return null;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -127,18 +127,18 @@ async function fetchComposioConnectedAccounts(derivedUserId) {
|
|
|
127
127
|
*/
|
|
128
128
|
async function isComposioMCPServerAuthenticated(tenantId, projectId, mcpServerUrl, credentialScope = "project", userId) {
|
|
129
129
|
if (!process.env.COMPOSIO_API_KEY) {
|
|
130
|
-
logger.info({}, "Composio API key not configured, skipping auth check");
|
|
130
|
+
logger$1.info({}, "Composio API key not configured, skipping auth check");
|
|
131
131
|
return false;
|
|
132
132
|
}
|
|
133
133
|
const serverId = extractComposioServerId(mcpServerUrl);
|
|
134
134
|
if (!serverId) {
|
|
135
|
-
logger.info({ mcpServerUrl }, "Could not extract Composio server ID from URL");
|
|
135
|
+
logger$1.info({ mcpServerUrl }, "Could not extract Composio server ID from URL");
|
|
136
136
|
return false;
|
|
137
137
|
}
|
|
138
138
|
const composioUserId = getComposioUserId(tenantId, projectId, credentialScope, userId);
|
|
139
139
|
const composioInstance = getComposioInstance();
|
|
140
140
|
if (!composioInstance) {
|
|
141
|
-
logger.info({}, "Composio not configured, skipping auth check");
|
|
141
|
+
logger$1.info({}, "Composio not configured, skipping auth check");
|
|
142
142
|
return false;
|
|
143
143
|
}
|
|
144
144
|
try {
|
|
@@ -149,7 +149,7 @@ async function isComposioMCPServerAuthenticated(tenantId, projectId, mcpServerUr
|
|
|
149
149
|
if (!connectedAccounts) return false;
|
|
150
150
|
return !!connectedAccounts.items.find((account) => account.authConfig.id === firstAuthConfigId && account.status === "ACTIVE");
|
|
151
151
|
} catch (error) {
|
|
152
|
-
logger.error({
|
|
152
|
+
logger$1.error({
|
|
153
153
|
error,
|
|
154
154
|
mcpServerUrl
|
|
155
155
|
}, "Error checking Composio authentication status");
|
|
@@ -184,7 +184,7 @@ function transformComposioServerData(composioMcpServer, isAuthenticated, url, th
|
|
|
184
184
|
async function ensureComposioAccount(composioMcpServer, derivedUserId, initiatedAccounts) {
|
|
185
185
|
const firstAuthConfigId = composioMcpServer.authConfigIds[0];
|
|
186
186
|
if (!firstAuthConfigId) {
|
|
187
|
-
logger.error({ serverId: composioMcpServer.id }, "No auth config ID found for MCP server");
|
|
187
|
+
logger$1.error({ serverId: composioMcpServer.id }, "No auth config ID found for MCP server");
|
|
188
188
|
return null;
|
|
189
189
|
}
|
|
190
190
|
const existingInitiatedAccount = initiatedAccounts.find((account) => account.authConfig.id === firstAuthConfigId);
|
|
@@ -192,12 +192,12 @@ async function ensureComposioAccount(composioMcpServer, derivedUserId, initiated
|
|
|
192
192
|
try {
|
|
193
193
|
const composioInstance = getComposioInstance();
|
|
194
194
|
if (!composioInstance) {
|
|
195
|
-
logger.error({ serverId: composioMcpServer.id }, "Composio not configured");
|
|
195
|
+
logger$1.error({ serverId: composioMcpServer.id }, "Composio not configured");
|
|
196
196
|
return null;
|
|
197
197
|
}
|
|
198
198
|
return (await composioInstance.connectedAccounts.link(derivedUserId, firstAuthConfigId)).redirectUrl ?? null;
|
|
199
199
|
} catch (error) {
|
|
200
|
-
logger.error({
|
|
200
|
+
logger$1.error({
|
|
201
201
|
serverId: composioMcpServer.id,
|
|
202
202
|
error
|
|
203
203
|
}, "Error creating connected account for MCP server");
|
|
@@ -212,24 +212,24 @@ async function ensureComposioAccount(composioMcpServer, derivedUserId, initiated
|
|
|
212
212
|
*/
|
|
213
213
|
async function getComposioOAuthRedirectUrl(tenantId, projectId, mcpServerUrl, credentialScope, userId) {
|
|
214
214
|
if (!process.env.COMPOSIO_API_KEY) {
|
|
215
|
-
logger.info({}, "Composio API key not configured");
|
|
215
|
+
logger$1.info({}, "Composio API key not configured");
|
|
216
216
|
return null;
|
|
217
217
|
}
|
|
218
218
|
const serverId = extractComposioServerId(mcpServerUrl);
|
|
219
219
|
if (!serverId) {
|
|
220
|
-
logger.info({ mcpServerUrl }, "Could not extract Composio server ID from URL");
|
|
220
|
+
logger$1.info({ mcpServerUrl }, "Could not extract Composio server ID from URL");
|
|
221
221
|
return null;
|
|
222
222
|
}
|
|
223
223
|
const composioInstance = getComposioInstance();
|
|
224
224
|
if (!composioInstance) {
|
|
225
|
-
logger.info({}, "Composio not configured");
|
|
225
|
+
logger$1.info({}, "Composio not configured");
|
|
226
226
|
return null;
|
|
227
227
|
}
|
|
228
228
|
const composioUserId = getComposioUserId(tenantId, projectId, credentialScope, userId);
|
|
229
229
|
try {
|
|
230
230
|
return await ensureComposioAccount(await composioInstance.mcp.get(serverId), composioUserId, (await fetchComposioConnectedAccounts(composioUserId))?.items.filter((account) => account.status === "INITIATED") ?? []);
|
|
231
231
|
} catch (error) {
|
|
232
|
-
logger.error({
|
|
232
|
+
logger$1.error({
|
|
233
233
|
error,
|
|
234
234
|
mcpServerUrl
|
|
235
235
|
}, "Failed to get Composio OAuth redirect URL");
|
|
@@ -256,12 +256,12 @@ async function transformComposioServer(composioMcpServer, authenticatedAuthConfi
|
|
|
256
256
|
*/
|
|
257
257
|
async function fetchComposioServers() {
|
|
258
258
|
if (!process.env.COMPOSIO_API_KEY) {
|
|
259
|
-
logger.info({}, "COMPOSIO_API_KEY not configured, skipping Composio servers");
|
|
259
|
+
logger$1.info({}, "COMPOSIO_API_KEY not configured, skipping Composio servers");
|
|
260
260
|
return [];
|
|
261
261
|
}
|
|
262
262
|
const composioInstance = getComposioInstance();
|
|
263
263
|
if (!composioInstance) {
|
|
264
|
-
logger.info({}, "Composio not configured, returning empty list");
|
|
264
|
+
logger$1.info({}, "Composio not configured, returning empty list");
|
|
265
265
|
return [];
|
|
266
266
|
}
|
|
267
267
|
try {
|
|
@@ -272,7 +272,7 @@ async function fetchComposioServers() {
|
|
|
272
272
|
authConfigs: []
|
|
273
273
|
}))?.items.map((server) => transformComposioServerData(server, false, server.MCPUrl, void 0)) ?? [];
|
|
274
274
|
} catch (error) {
|
|
275
|
-
logger.error({ error }, "Failed to fetch Composio servers");
|
|
275
|
+
logger$1.error({ error }, "Failed to fetch Composio servers");
|
|
276
276
|
return [];
|
|
277
277
|
}
|
|
278
278
|
}
|
|
@@ -283,19 +283,19 @@ async function fetchComposioServers() {
|
|
|
283
283
|
*/
|
|
284
284
|
async function fetchSingleComposioServer(tenantId, projectId, mcpServerUrl, credentialScope = "project", userId) {
|
|
285
285
|
if (!process.env.COMPOSIO_API_KEY) {
|
|
286
|
-
logger.debug({}, "COMPOSIO_API_KEY not configured");
|
|
286
|
+
logger$1.debug({}, "COMPOSIO_API_KEY not configured");
|
|
287
287
|
return null;
|
|
288
288
|
}
|
|
289
289
|
const composioUserId = getComposioUserId(tenantId, projectId, credentialScope, userId);
|
|
290
290
|
const composioInstance = getComposioInstance();
|
|
291
291
|
if (!composioInstance) {
|
|
292
|
-
logger.info({}, "Composio not configured, returning null");
|
|
292
|
+
logger$1.info({}, "Composio not configured, returning null");
|
|
293
293
|
return null;
|
|
294
294
|
}
|
|
295
295
|
try {
|
|
296
296
|
const serverId = extractComposioServerId(mcpServerUrl);
|
|
297
297
|
if (!serverId) {
|
|
298
|
-
logger.error({ mcpServerUrl }, "Could not extract Composio server ID from URL");
|
|
298
|
+
logger$1.error({ mcpServerUrl }, "Could not extract Composio server ID from URL");
|
|
299
299
|
return null;
|
|
300
300
|
}
|
|
301
301
|
const composioMcpServer = await composioInstance.mcp.get(serverId);
|
|
@@ -307,7 +307,7 @@ async function fetchSingleComposioServer(tenantId, projectId, mcpServerUrl, cred
|
|
|
307
307
|
const initiatedAccounts = userConnectedAccounts?.items.filter((account) => account.status === "INITIATED");
|
|
308
308
|
return await transformComposioServer(composioMcpServer, new Set(activeAccounts?.map((account) => account.authConfig.id) ?? []), initiatedAccounts ?? [], composioUserId);
|
|
309
309
|
} catch (error) {
|
|
310
|
-
logger.error({
|
|
310
|
+
logger$1.error({
|
|
311
311
|
error,
|
|
312
312
|
mcpServerUrl
|
|
313
313
|
}, "Failed to fetch single Composio server");
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { TriggerAuthHeaderInputSchema, TriggerAuthHeaderStoredSchema, TriggerAuthenticationStoredSchema } from "../validation/schemas.js";
|
|
2
|
+
import { Context } from "hono";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
//#region src/utils/trigger-auth.d.ts
|
|
6
|
+
type TriggerAuthHeaderInput = z.infer<typeof TriggerAuthHeaderInputSchema>;
|
|
7
|
+
type TriggerAuthHeaderStored = z.infer<typeof TriggerAuthHeaderStoredSchema>;
|
|
8
|
+
type TriggerAuthenticationStored = z.infer<typeof TriggerAuthenticationStoredSchema>;
|
|
9
|
+
interface TriggerAuthResult {
|
|
10
|
+
success: boolean;
|
|
11
|
+
status?: number;
|
|
12
|
+
message?: string;
|
|
13
|
+
}
|
|
14
|
+
interface HashedHeaderValue {
|
|
15
|
+
valueHash: string;
|
|
16
|
+
valuePrefix: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Hash a header value using scrypt for secure storage.
|
|
20
|
+
* Returns the hash and a prefix for display purposes.
|
|
21
|
+
*
|
|
22
|
+
* @param value - The plaintext header value to hash
|
|
23
|
+
* @returns Object containing valueHash (for storage) and valuePrefix (for display)
|
|
24
|
+
*/
|
|
25
|
+
declare function hashTriggerHeaderValue(value: string): Promise<HashedHeaderValue>;
|
|
26
|
+
/**
|
|
27
|
+
* Validate a header value against its stored hash using timing-safe comparison.
|
|
28
|
+
*
|
|
29
|
+
* @param value - The plaintext header value from the incoming request
|
|
30
|
+
* @param storedHash - The hash stored in the database
|
|
31
|
+
* @returns True if the value matches the hash
|
|
32
|
+
*/
|
|
33
|
+
declare function validateTriggerHeaderValue(value: string, storedHash: string): Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Transform authentication input (plaintext values) to stored format (hashed values).
|
|
36
|
+
* Used when creating or updating triggers.
|
|
37
|
+
*
|
|
38
|
+
* @param headers - Array of header inputs with plaintext values
|
|
39
|
+
* @returns Array of headers with hashed values for storage
|
|
40
|
+
*/
|
|
41
|
+
declare function hashAuthenticationHeaders(headers: TriggerAuthHeaderInput[]): Promise<TriggerAuthHeaderStored[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Verifies incoming webhook requests using the configured authentication headers.
|
|
44
|
+
* Each configured header must be present and match its expected value (via hash comparison).
|
|
45
|
+
*
|
|
46
|
+
* @param c - Hono context containing the request headers
|
|
47
|
+
* @param authentication - Trigger authentication configuration with hashed header values
|
|
48
|
+
* @returns TriggerAuthResult indicating success/failure with appropriate HTTP status
|
|
49
|
+
*/
|
|
50
|
+
declare function verifyTriggerAuth(c: Context, authentication?: TriggerAuthenticationStored | null): Promise<TriggerAuthResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Verifies webhook request integrity using HMAC-SHA256 signing secret.
|
|
53
|
+
* Reads signature from X-Signature-256 header and uses timing-safe comparison.
|
|
54
|
+
*
|
|
55
|
+
* @param c - Hono context containing the request headers and body
|
|
56
|
+
* @param signingSecret - HMAC-SHA256 signing secret
|
|
57
|
+
* @param body - Raw request body as string
|
|
58
|
+
* @returns TriggerAuthResult indicating success/failure
|
|
59
|
+
*/
|
|
60
|
+
declare function verifySigningSecret(c: Context, signingSecret: string | null | undefined, body: string): TriggerAuthResult;
|
|
61
|
+
//#endregion
|
|
62
|
+
export { HashedHeaderValue, TriggerAuthResult, hashAuthenticationHeaders, hashTriggerHeaderValue, validateTriggerHeaderValue, verifySigningSecret, verifyTriggerAuth };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { createHmac, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/trigger-auth.ts
|
|
5
|
+
const scryptAsync = promisify(scrypt);
|
|
6
|
+
const SALT_LENGTH = 32;
|
|
7
|
+
const KEY_LENGTH = 64;
|
|
8
|
+
const VALUE_PREFIX_LENGTH = 8;
|
|
9
|
+
/**
|
|
10
|
+
* Hash a header value using scrypt for secure storage.
|
|
11
|
+
* Returns the hash and a prefix for display purposes.
|
|
12
|
+
*
|
|
13
|
+
* @param value - The plaintext header value to hash
|
|
14
|
+
* @returns Object containing valueHash (for storage) and valuePrefix (for display)
|
|
15
|
+
*/
|
|
16
|
+
async function hashTriggerHeaderValue(value) {
|
|
17
|
+
const salt = randomBytes(SALT_LENGTH);
|
|
18
|
+
const hashedBuffer = await scryptAsync(value, salt, KEY_LENGTH);
|
|
19
|
+
return {
|
|
20
|
+
valueHash: Buffer.concat([salt, hashedBuffer]).toString("base64"),
|
|
21
|
+
valuePrefix: value.substring(0, VALUE_PREFIX_LENGTH)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Validate a header value against its stored hash using timing-safe comparison.
|
|
26
|
+
*
|
|
27
|
+
* @param value - The plaintext header value from the incoming request
|
|
28
|
+
* @param storedHash - The hash stored in the database
|
|
29
|
+
* @returns True if the value matches the hash
|
|
30
|
+
*/
|
|
31
|
+
async function validateTriggerHeaderValue(value, storedHash) {
|
|
32
|
+
try {
|
|
33
|
+
const combined = Buffer.from(storedHash, "base64");
|
|
34
|
+
const salt = combined.subarray(0, SALT_LENGTH);
|
|
35
|
+
return timingSafeEqual(combined.subarray(SALT_LENGTH), await scryptAsync(value, salt, KEY_LENGTH));
|
|
36
|
+
} catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Transform authentication input (plaintext values) to stored format (hashed values).
|
|
42
|
+
* Used when creating or updating triggers.
|
|
43
|
+
*
|
|
44
|
+
* @param headers - Array of header inputs with plaintext values
|
|
45
|
+
* @returns Array of headers with hashed values for storage
|
|
46
|
+
*/
|
|
47
|
+
async function hashAuthenticationHeaders(headers) {
|
|
48
|
+
return Promise.all(headers.map(async (header) => {
|
|
49
|
+
const { valueHash, valuePrefix } = await hashTriggerHeaderValue(header.value);
|
|
50
|
+
return {
|
|
51
|
+
name: header.name,
|
|
52
|
+
valueHash,
|
|
53
|
+
valuePrefix
|
|
54
|
+
};
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Verifies incoming webhook requests using the configured authentication headers.
|
|
59
|
+
* Each configured header must be present and match its expected value (via hash comparison).
|
|
60
|
+
*
|
|
61
|
+
* @param c - Hono context containing the request headers
|
|
62
|
+
* @param authentication - Trigger authentication configuration with hashed header values
|
|
63
|
+
* @returns TriggerAuthResult indicating success/failure with appropriate HTTP status
|
|
64
|
+
*/
|
|
65
|
+
async function verifyTriggerAuth(c, authentication) {
|
|
66
|
+
if (!authentication || !authentication.headers || authentication.headers.length === 0) return { success: true };
|
|
67
|
+
for (const header of authentication.headers) {
|
|
68
|
+
const headerName = header.name.toLowerCase();
|
|
69
|
+
const actualValue = c.req.header(headerName);
|
|
70
|
+
if (!actualValue) return {
|
|
71
|
+
success: false,
|
|
72
|
+
status: 401,
|
|
73
|
+
message: `Missing authentication header: ${header.name}`
|
|
74
|
+
};
|
|
75
|
+
if (!await validateTriggerHeaderValue(actualValue, header.valueHash)) return {
|
|
76
|
+
success: false,
|
|
77
|
+
status: 403,
|
|
78
|
+
message: `Invalid value for header: ${header.name}`
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return { success: true };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Verifies webhook request integrity using HMAC-SHA256 signing secret.
|
|
85
|
+
* Reads signature from X-Signature-256 header and uses timing-safe comparison.
|
|
86
|
+
*
|
|
87
|
+
* @param c - Hono context containing the request headers and body
|
|
88
|
+
* @param signingSecret - HMAC-SHA256 signing secret
|
|
89
|
+
* @param body - Raw request body as string
|
|
90
|
+
* @returns TriggerAuthResult indicating success/failure
|
|
91
|
+
*/
|
|
92
|
+
function verifySigningSecret(c, signingSecret, body) {
|
|
93
|
+
if (!signingSecret) return { success: true };
|
|
94
|
+
const signature = c.req.header("x-signature-256");
|
|
95
|
+
if (!signature) return {
|
|
96
|
+
success: false,
|
|
97
|
+
status: 401,
|
|
98
|
+
message: "Missing X-Signature-256 header"
|
|
99
|
+
};
|
|
100
|
+
const expectedSignature = `sha256=${createHmac("sha256", signingSecret).update(body).digest("hex")}`;
|
|
101
|
+
try {
|
|
102
|
+
const signatureBuffer = Buffer.from(signature);
|
|
103
|
+
const expectedBuffer = Buffer.from(expectedSignature);
|
|
104
|
+
if (signatureBuffer.length !== expectedBuffer.length) return {
|
|
105
|
+
success: false,
|
|
106
|
+
status: 403,
|
|
107
|
+
message: "Invalid signature"
|
|
108
|
+
};
|
|
109
|
+
if (!timingSafeEqual(signatureBuffer, expectedBuffer)) return {
|
|
110
|
+
success: false,
|
|
111
|
+
status: 403,
|
|
112
|
+
message: "Invalid signature"
|
|
113
|
+
};
|
|
114
|
+
return { success: true };
|
|
115
|
+
} catch {
|
|
116
|
+
return {
|
|
117
|
+
success: false,
|
|
118
|
+
status: 403,
|
|
119
|
+
message: "Invalid signature format"
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
//#endregion
|
|
125
|
+
export { hashAuthenticationHeaders, hashTriggerHeaderValue, validateTriggerHeaderValue, verifySigningSecret, verifyTriggerAuth };
|
|
@@ -53,10 +53,8 @@ function validateAgentRelationships(agentData) {
|
|
|
53
53
|
if (subAgent.canTransferTo && Array.isArray(subAgent.canTransferTo)) {
|
|
54
54
|
for (const targetId of subAgent.canTransferTo) if (!availableAgentIds.has(targetId)) errors.push(`Agent '${subAgentId}' has transfer target '${targetId}' that doesn't exist in agent`);
|
|
55
55
|
}
|
|
56
|
-
if (subAgent.canDelegateTo && Array.isArray(subAgent.canDelegateTo))
|
|
57
|
-
|
|
58
|
-
if (typeof targetItem === "string") {
|
|
59
|
-
console.log("targetItem is string", targetItem);
|
|
56
|
+
if (subAgent.canDelegateTo && Array.isArray(subAgent.canDelegateTo)) {
|
|
57
|
+
for (const targetItem of subAgent.canDelegateTo) if (typeof targetItem === "string") {
|
|
60
58
|
if (!availableAgentIds.has(targetItem) && !availableExternalAgentIds.has(targetItem)) errors.push(`Agent '${subAgentId}' has delegation target '${targetItem}' that doesn't exist in agent`);
|
|
61
59
|
}
|
|
62
60
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
|
|
3
|
+
//#region src/validation/dolt-schemas.d.ts
|
|
4
|
+
declare const BranchNameSchema: z.ZodString;
|
|
5
|
+
declare const CreateBranchRequestSchema: z.ZodObject<{
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
from: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
declare const BranchInfoSchema: z.ZodObject<{
|
|
10
|
+
baseName: z.ZodString;
|
|
11
|
+
fullName: z.ZodString;
|
|
12
|
+
hash: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
declare const BranchResponseSchema: z.ZodObject<{
|
|
15
|
+
data: z.ZodObject<{
|
|
16
|
+
baseName: z.ZodString;
|
|
17
|
+
fullName: z.ZodString;
|
|
18
|
+
hash: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
declare const BranchListResponseSchema: z.ZodObject<{
|
|
22
|
+
data: z.ZodArray<z.ZodObject<{
|
|
23
|
+
baseName: z.ZodString;
|
|
24
|
+
fullName: z.ZodString;
|
|
25
|
+
hash: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
declare const BranchNameParamsSchema: z.ZodObject<{
|
|
29
|
+
tenantId: z.ZodString;
|
|
30
|
+
projectId: z.ZodString;
|
|
31
|
+
branchName: z.ZodString;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
declare const ResolvedRefSchema: z.ZodObject<{
|
|
34
|
+
type: z.ZodEnum<{
|
|
35
|
+
tag: "tag";
|
|
36
|
+
commit: "commit";
|
|
37
|
+
branch: "branch";
|
|
38
|
+
}>;
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
hash: z.ZodString;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
type ResolvedRef = z.infer<typeof ResolvedRefSchema>;
|
|
43
|
+
type CreateBranchRequest = z.infer<typeof CreateBranchRequestSchema>;
|
|
44
|
+
type BranchInfo = z.infer<typeof BranchInfoSchema>;
|
|
45
|
+
type BranchResponse = z.infer<typeof BranchResponseSchema>;
|
|
46
|
+
type BranchListResponse = z.infer<typeof BranchListResponseSchema>;
|
|
47
|
+
type BranchNameParams = z.infer<typeof BranchNameParamsSchema>;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { BranchInfo, BranchInfoSchema, BranchListResponse, BranchListResponseSchema, BranchNameParams, BranchNameParamsSchema, BranchNameSchema, BranchResponse, BranchResponseSchema, CreateBranchRequest, CreateBranchRequestSchema, ResolvedRef, ResolvedRefSchema };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
|
|
3
|
+
//#region src/validation/dolt-schemas.ts
|
|
4
|
+
const BranchNameSchema = z.string().min(1, "Branch name cannot be empty").max(255, "Branch name too long").regex(/^[a-zA-Z0-9\-_./]+$/, { message: "Branch name can only contain letters, numbers, hyphens, underscores, dots, and slashes" }).openapi({
|
|
5
|
+
example: "feature-x",
|
|
6
|
+
description: "Name of the branch"
|
|
7
|
+
});
|
|
8
|
+
const CreateBranchRequestSchema = z.object({
|
|
9
|
+
name: BranchNameSchema,
|
|
10
|
+
from: z.string().optional().describe("Branch or commit to create from. Defaults to tenant main branch.")
|
|
11
|
+
}).openapi("CreateBranchRequest");
|
|
12
|
+
const BranchInfoSchema = z.object({
|
|
13
|
+
baseName: z.string().describe("User-provided branch name"),
|
|
14
|
+
fullName: z.string().describe("Full namespaced branch name"),
|
|
15
|
+
hash: z.string().describe("Current commit hash of the branch")
|
|
16
|
+
}).openapi("BranchInfo");
|
|
17
|
+
const BranchResponseSchema = z.object({ data: BranchInfoSchema }).openapi("BranchResponse");
|
|
18
|
+
const BranchListResponseSchema = z.object({ data: z.array(BranchInfoSchema) }).openapi("BranchListResponse");
|
|
19
|
+
const BranchNameParamsSchema = z.object({
|
|
20
|
+
tenantId: z.string().openapi({ param: {
|
|
21
|
+
name: "tenantId",
|
|
22
|
+
in: "path"
|
|
23
|
+
} }),
|
|
24
|
+
projectId: z.string().openapi({ param: {
|
|
25
|
+
name: "projectId",
|
|
26
|
+
in: "path"
|
|
27
|
+
} }),
|
|
28
|
+
branchName: z.string().openapi({ param: {
|
|
29
|
+
name: "branchName",
|
|
30
|
+
in: "path"
|
|
31
|
+
} })
|
|
32
|
+
}).openapi("BranchNameParams");
|
|
33
|
+
const ResolvedRefSchema = z.object({
|
|
34
|
+
type: z.enum([
|
|
35
|
+
"commit",
|
|
36
|
+
"tag",
|
|
37
|
+
"branch"
|
|
38
|
+
]).describe("The type of ref"),
|
|
39
|
+
name: z.string().describe("The name of the ref (branch name, tag name, or commit hash)"),
|
|
40
|
+
hash: z.string().describe("The commit hash this ref resolves to")
|
|
41
|
+
}).openapi("ResolvedRef");
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { BranchInfoSchema, BranchListResponseSchema, BranchNameParamsSchema, BranchNameSchema, BranchResponseSchema, CreateBranchRequestSchema, ResolvedRefSchema };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as drizzle_zod231 from "drizzle-zod";
|
|
3
3
|
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
4
4
|
|
|
5
5
|
//#region src/validation/drizzle-schema-helpers.d.ts
|
|
@@ -22,8 +22,8 @@ declare const resourceIdSchema: z.ZodString;
|
|
|
22
22
|
declare function createResourceIdSchema(description: string, options?: {
|
|
23
23
|
example?: string;
|
|
24
24
|
}): z.ZodString;
|
|
25
|
-
declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>):
|
|
26
|
-
declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>):
|
|
25
|
+
declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod231.BuildSchema<"select", T["_"]["columns"], drizzle_zod231.BuildRefine<T["_"]["columns"], undefined>, undefined>;
|
|
26
|
+
declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod231.BuildSchema<"insert", T["_"]["columns"], drizzle_zod231.BuildRefine<Pick<T["_"]["columns"], keyof T["$inferInsert"]>, undefined>, undefined>;
|
|
27
27
|
declare const createSelectSchema: typeof createSelectSchemaWithModifiers;
|
|
28
28
|
declare const createInsertSchema: typeof createInsertSchemaWithModifiers;
|
|
29
29
|
/**
|
|
@@ -38,27 +38,5 @@ declare const createInsertSchema: typeof createInsertSchemaWithModifiers;
|
|
|
38
38
|
* The schema shape itself is not modified, but the field schemas are registered.
|
|
39
39
|
*/
|
|
40
40
|
declare function registerFieldSchemas<T extends z.ZodObject<any>>(schema: T): T;
|
|
41
|
-
/**
|
|
42
|
-
* Wrapper for .partial() that registers the resulting schema and its fields in the global registry.
|
|
43
|
-
* This function ensures that field schemas are properly registered and configured with OpenAPI metadata.
|
|
44
|
-
*/
|
|
45
|
-
declare function partialWithRegistry<T extends z.ZodObject<any>>(schema: T, metadata?: {
|
|
46
|
-
description?: string;
|
|
47
|
-
[key: string]: unknown;
|
|
48
|
-
}): T;
|
|
49
|
-
/**
|
|
50
|
-
* Wrapper for .omit() that registers the resulting schema and its fields in the global registry
|
|
51
|
-
*/
|
|
52
|
-
declare function omitWithRegistry<T extends z.ZodObject<any>>(schema: T, keys: z.ZodObject<any>['shape'], metadata?: {
|
|
53
|
-
description?: string;
|
|
54
|
-
[key: string]: unknown;
|
|
55
|
-
}): T;
|
|
56
|
-
/**
|
|
57
|
-
* Wrapper for .extend() that registers the resulting schema and its fields in the global registry
|
|
58
|
-
*/
|
|
59
|
-
declare function extendWithRegistry<T extends z.ZodObject<any>>(schema: T, shape: z.ZodRawShape, metadata?: {
|
|
60
|
-
description?: string;
|
|
61
|
-
[key: string]: unknown;
|
|
62
|
-
}): T;
|
|
63
41
|
//#endregion
|
|
64
|
-
export { MAX_ID_LENGTH, MIN_ID_LENGTH, URL_SAFE_ID_PATTERN, createInsertSchema, createResourceIdSchema, createSelectSchema,
|
|
42
|
+
export { MAX_ID_LENGTH, MIN_ID_LENGTH, URL_SAFE_ID_PATTERN, createInsertSchema, createResourceIdSchema, createSelectSchema, registerFieldSchemas, resourceIdSchema };
|