@inkeep/agents-core 0.41.2 → 0.43.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 +60 -2
- package/dist/auth/authz/client.d.ts +87 -0
- package/dist/auth/authz/client.js +196 -0
- package/dist/auth/authz/config.d.ts +103 -0
- package/dist/auth/authz/config.js +93 -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 +53 -0
- package/dist/auth/authz/permissions.js +83 -0
- package/dist/auth/authz/sync.d.ts +106 -0
- package/dist/auth/authz/sync.js +321 -0
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/auth/permissions.js +2 -181
- package/dist/client-exports.d.ts +9 -3
- package/dist/client-exports.js +4 -2
- package/dist/constants/context-breakdown.d.ts +61 -0
- package/dist/constants/context-breakdown.js +124 -0
- package/dist/constants/execution-limits-shared/defaults.d.ts +1 -1
- package/dist/constants/execution-limits-shared/defaults.js +1 -1
- package/dist/constants/execution-limits-shared/index.d.ts +1 -1
- 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.d.ts +0 -6
- package/dist/context/TemplateEngine.js +4 -19
- package/dist/context/index.d.ts +1 -5
- package/dist/context/index.js +1 -5
- package/dist/credential-stores/keychain-store.d.ts +20 -8
- package/dist/credential-stores/keychain-store.js +107 -43
- 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} +209 -7
- package/dist/data-access/{agents.d.ts → manage/agents.d.ts} +64 -63
- package/dist/data-access/{agents.js → manage/agents.js} +80 -27
- package/dist/data-access/{artifactComponents.d.ts → manage/artifactComponents.d.ts} +33 -33
- package/dist/data-access/{artifactComponents.js → manage/artifactComponents.js} +5 -5
- package/dist/data-access/{contextConfigs.d.ts → manage/contextConfigs.d.ts} +26 -26
- 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} +26 -26
- 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/manage/functionTools.d.ts +242 -0
- package/dist/data-access/{functionTools.js → manage/functionTools.js} +124 -30
- 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} +43 -43
- package/dist/data-access/{subAgentExternalAgentRelations.js → manage/subAgentExternalAgentRelations.js} +2 -2
- package/dist/data-access/{subAgentRelations.d.ts → manage/subAgentRelations.d.ts} +65 -65
- package/dist/data-access/{subAgentRelations.js → manage/subAgentRelations.js} +3 -3
- package/dist/data-access/{subAgentTeamAgentRelations.d.ts → manage/subAgentTeamAgentRelations.d.ts} +43 -43
- package/dist/data-access/{subAgentTeamAgentRelations.js → manage/subAgentTeamAgentRelations.js} +2 -2
- package/dist/data-access/{subAgents.d.ts → manage/subAgents.d.ts} +28 -28
- package/dist/data-access/{subAgents.js → manage/subAgents.js} +4 -4
- package/dist/data-access/{tools.d.ts → manage/tools.d.ts} +65 -52
- package/dist/data-access/{tools.js → manage/tools.js} +109 -64
- package/dist/data-access/manage/triggers.d.ts +106 -0
- package/dist/data-access/manage/triggers.js +81 -0
- package/dist/data-access/{apiKeys.d.ts → runtime/apiKeys.d.ts} +37 -37
- 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} +80 -31
- 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} +24 -24
- 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} +16 -4
- 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} +1257 -969
- package/dist/db/{schema.js → manage/manage-schema.js} +436 -334
- 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/db/utils.d.ts +6 -0
- package/dist/db/utils.js +42 -0
- 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 +83 -0
- package/dist/dolt/migrate-dolt.d.ts +1 -0
- package/dist/dolt/migrate-dolt.js +25 -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 +135 -0
- package/dist/dolt/schema-sync.js +255 -0
- package/dist/env.d.ts +6 -4
- package/dist/env.js +3 -2
- package/dist/index.d.ts +73 -46
- package/dist/index.js +76 -49
- package/dist/types/@napi-rs__keyring/index.d.ts +14 -0
- package/dist/types/entities.d.ts +81 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/utility.d.ts +46 -5
- package/dist/types/utility.js +2 -1
- package/dist/utils/JsonTransformer.d.ts +42 -0
- package/dist/utils/JsonTransformer.js +103 -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 +8 -4
- package/dist/utils/index.js +8 -4
- package/dist/utils/internal-service-auth.d.ts +79 -0
- package/dist/utils/internal-service-auth.js +140 -0
- package/dist/utils/jmespath-utils.d.ts +152 -0
- package/dist/utils/jmespath-utils.js +213 -0
- package/dist/utils/jwt-helpers.d.ts +56 -0
- package/dist/utils/jwt-helpers.js +90 -0
- package/dist/utils/mcp-client.d.ts +1 -1
- package/dist/utils/mcp-client.js +1 -1
- package/dist/utils/service-token-auth.d.ts +9 -27
- package/dist/utils/service-token-auth.js +48 -96
- package/dist/utils/signature-validation.d.ts +2 -0
- package/dist/utils/signature-validation.js +3 -0
- 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.d.ts +13 -1
- package/dist/utils/third-party-mcp-servers/composio-client.js +47 -29
- package/dist/utils/third-party-mcp-servers/index.d.ts +2 -2
- package/dist/utils/third-party-mcp-servers/index.js +2 -2
- package/dist/utils/trigger-auth.d.ts +85 -0
- package/dist/utils/trigger-auth.js +233 -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 +5 -4
- package/dist/validation/index.js +4 -3
- package/dist/validation/render-validation.js +19 -0
- package/dist/validation/schemas.d.ts +18223 -5148
- package/dist/validation/schemas.js +559 -12
- package/dist/validation/stream-event-schemas.d.ts +96 -1
- package/dist/validation/stream-event-schemas.js +67 -2
- 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/0003_tiny_captain_universe.sql +8 -0
- package/drizzle/manage/0004_curious_phil_sheldon.sql +2 -0
- package/drizzle/manage/0005_silent_shatterstar.sql +53 -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/0003_snapshot.json +3134 -0
- package/drizzle/manage/meta/0004_snapshot.json +3141 -0
- package/drizzle/manage/meta/0005_snapshot.json +3141 -0
- package/drizzle/manage/meta/_journal.json +48 -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 +56 -18
- package/spicedb/schema.zed +114 -0
- 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/functionTools.d.ts +0 -169
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { normalizeJMESPath, searchJMESPath } from "../utils/jmespath-utils.js";
|
|
1
2
|
import { getLogger } from "../utils/logger.js";
|
|
2
|
-
import jmespath from "jmespath";
|
|
3
3
|
|
|
4
4
|
//#region src/context/TemplateEngine.ts
|
|
5
5
|
const logger = getLogger("template-engine");
|
|
@@ -33,20 +33,6 @@ var TemplateEngine = class TemplateEngine {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* Normalize JMES path by wrapping property names with dashes in quotes
|
|
37
|
-
* Example: headers.x-tenant-id -> headers."x-tenant-id"
|
|
38
|
-
* Example: api-responses[0].response-code -> "api-responses"[0]."response-code"
|
|
39
|
-
*/
|
|
40
|
-
static normalizeJMESPath(path) {
|
|
41
|
-
return path.split(".").map((segment) => {
|
|
42
|
-
if (!segment.includes("-")) return segment;
|
|
43
|
-
if (segment.startsWith("\"") && segment.includes("\"")) return segment;
|
|
44
|
-
const bracketIndex = segment.indexOf("[");
|
|
45
|
-
if (bracketIndex !== -1) return `"${segment.substring(0, bracketIndex)}"${segment.substring(bracketIndex)}`;
|
|
46
|
-
return `"${segment}"`;
|
|
47
|
-
}).join(".");
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
36
|
* Process variable substitutions {{variable.path}} using JMESPath
|
|
51
37
|
*/
|
|
52
38
|
static processVariables(template, context, options) {
|
|
@@ -54,8 +40,8 @@ var TemplateEngine = class TemplateEngine {
|
|
|
54
40
|
const trimmedPath = path.trim();
|
|
55
41
|
try {
|
|
56
42
|
if (trimmedPath.startsWith("$")) return TemplateEngine.processBuiltinVariable(trimmedPath);
|
|
57
|
-
const normalizedPath =
|
|
58
|
-
const result =
|
|
43
|
+
const normalizedPath = normalizeJMESPath(trimmedPath);
|
|
44
|
+
const result = searchJMESPath(context, normalizedPath);
|
|
59
45
|
if (result === void 0 || result === null) {
|
|
60
46
|
if (options.strict) throw new Error(`Template variable '${trimmedPath}' not found in context`);
|
|
61
47
|
if (options.preserveUnresolved) return match;
|
|
@@ -63,7 +49,6 @@ var TemplateEngine = class TemplateEngine {
|
|
|
63
49
|
variable: trimmedPath,
|
|
64
50
|
normalizedPath,
|
|
65
51
|
availableKeys: Object.keys(context),
|
|
66
|
-
contextStructure: JSON.stringify(context, null, 2),
|
|
67
52
|
headersContent: context.headers ? JSON.stringify(context.headers, null, 2) : "undefined"
|
|
68
53
|
}, "Headers template variable debugging");
|
|
69
54
|
else logger.warn({
|
|
@@ -77,7 +62,7 @@ var TemplateEngine = class TemplateEngine {
|
|
|
77
62
|
return String(result);
|
|
78
63
|
} catch (error) {
|
|
79
64
|
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
80
|
-
const normalizedPath =
|
|
65
|
+
const normalizedPath = normalizeJMESPath(trimmedPath);
|
|
81
66
|
if (options.strict) throw new Error(`Failed to resolve template variable '${trimmedPath}' (normalized: '${normalizedPath}'): ${errorMessage}`);
|
|
82
67
|
logger.error({
|
|
83
68
|
variable: trimmedPath,
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { DotPaths } from "./validation-helpers.js";
|
|
2
2
|
import { ContextConfigBuilder, ContextConfigBuilderOptions, contextConfig, fetchDefinition, headers } from "./ContextConfig.js";
|
|
3
3
|
import { TemplateContext, TemplateEngine, TemplateRenderOptions } from "./TemplateEngine.js";
|
|
4
|
-
|
|
5
|
-
import { ContextResolutionOptions, ContextResolutionResult, ContextResolver, ResolvedContext } from "./ContextResolver.js";
|
|
6
|
-
import { determineContextTrigger, handleContextConfigChange, handleContextResolution } from "./context.js";
|
|
7
|
-
import { ContextCache } from "./contextCache.js";
|
|
8
|
-
export { ContextCache, ContextConfigBuilder, type ContextConfigBuilderOptions, ContextFetcher, type ContextResolutionOptions, type ContextResolutionResult, ContextResolver, type DotPaths, type FetchResult, MissingRequiredVariableError, type ResolvedContext, type TemplateContext, TemplateEngine, type TemplateRenderOptions, contextConfig, determineContextTrigger, fetchDefinition, handleContextConfigChange, handleContextResolution, headers };
|
|
4
|
+
export { ContextConfigBuilder, type ContextConfigBuilderOptions, type DotPaths, type TemplateContext, TemplateEngine, type TemplateRenderOptions, contextConfig, fetchDefinition, headers };
|
package/dist/context/index.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { ContextConfigBuilder, contextConfig, fetchDefinition, headers } from "./ContextConfig.js";
|
|
2
2
|
import { TemplateEngine } from "./TemplateEngine.js";
|
|
3
|
-
import { ContextCache } from "./contextCache.js";
|
|
4
|
-
import { ContextResolver } from "./ContextResolver.js";
|
|
5
|
-
import { ContextFetcher, MissingRequiredVariableError } from "./ContextFetcher.js";
|
|
6
|
-
import { determineContextTrigger, handleContextConfigChange, handleContextResolution } from "./context.js";
|
|
7
3
|
|
|
8
|
-
export {
|
|
4
|
+
export { ContextConfigBuilder, TemplateEngine, contextConfig, fetchDefinition, headers };
|
|
@@ -10,16 +10,16 @@ import { CredentialStore } from "../types/server.js";
|
|
|
10
10
|
* - Windows: Credential Vault
|
|
11
11
|
* - Linux: Secret Service API/libsecret
|
|
12
12
|
*
|
|
13
|
-
* Requires the '
|
|
14
|
-
* Falls back gracefully if
|
|
13
|
+
* Requires the '@napi-rs/keyring' npm package to be installed.
|
|
14
|
+
* Falls back gracefully if keyring is not available.
|
|
15
15
|
*
|
|
16
16
|
* ## macOS Permission Handling
|
|
17
17
|
*
|
|
18
|
-
* On macOS, when your Node.js app first calls
|
|
18
|
+
* On macOS, when your Node.js app first calls keyring operations:
|
|
19
19
|
* - `setPassword()` creates a new Keychain item (no prompt required)
|
|
20
20
|
* - `getPassword()` may prompt the user for permission on first access
|
|
21
21
|
* - Users can click "Allow", "Always Allow", or "Deny"
|
|
22
|
-
* - If denied,
|
|
22
|
+
* - If denied, keyring returns `null` which this implementation handles gracefully
|
|
23
23
|
* - The calling binary (usually `node`) will be shown in the permission prompt
|
|
24
24
|
* - For better UX in packaged apps, consider code signing and app bundling
|
|
25
25
|
*
|
|
@@ -33,14 +33,22 @@ declare class KeyChainStore implements CredentialStore {
|
|
|
33
33
|
readonly type: "keychain";
|
|
34
34
|
private readonly service;
|
|
35
35
|
private readonly logger;
|
|
36
|
-
private
|
|
37
|
-
private
|
|
36
|
+
private keyringAvailable;
|
|
37
|
+
private EntryClass;
|
|
38
38
|
private initializationPromise;
|
|
39
39
|
constructor(id: string, servicePrefix?: string);
|
|
40
40
|
/**
|
|
41
|
-
* Initialize
|
|
41
|
+
* Initialize keyring dynamically to handle optional availability
|
|
42
42
|
*/
|
|
43
|
-
private
|
|
43
|
+
private initializeKeyring;
|
|
44
|
+
/**
|
|
45
|
+
* Add a key to the index
|
|
46
|
+
*/
|
|
47
|
+
private addKeyToIndex;
|
|
48
|
+
/**
|
|
49
|
+
* Remove a key from the index
|
|
50
|
+
*/
|
|
51
|
+
private removeKeyFromIndex;
|
|
44
52
|
/**
|
|
45
53
|
* Get a credential from the keychain
|
|
46
54
|
*/
|
|
@@ -68,6 +76,10 @@ declare class KeyChainStore implements CredentialStore {
|
|
|
68
76
|
/**
|
|
69
77
|
* Find all credentials for this service
|
|
70
78
|
* Useful for debugging and listing stored credentials
|
|
79
|
+
*
|
|
80
|
+
* NOTE: @napi-rs/keyring does not have a findCredentials equivalent.
|
|
81
|
+
* This implementation uses a key index to track all stored keys.
|
|
82
|
+
* The index is maintained separately and updated during set/delete operations.
|
|
71
83
|
*/
|
|
72
84
|
findAllCredentials(): Promise<Array<{
|
|
73
85
|
account: string;
|
|
@@ -10,16 +10,16 @@ import { getLogger } from "../utils/logger.js";
|
|
|
10
10
|
* - Windows: Credential Vault
|
|
11
11
|
* - Linux: Secret Service API/libsecret
|
|
12
12
|
*
|
|
13
|
-
* Requires the '
|
|
14
|
-
* Falls back gracefully if
|
|
13
|
+
* Requires the '@napi-rs/keyring' npm package to be installed.
|
|
14
|
+
* Falls back gracefully if keyring is not available.
|
|
15
15
|
*
|
|
16
16
|
* ## macOS Permission Handling
|
|
17
17
|
*
|
|
18
|
-
* On macOS, when your Node.js app first calls
|
|
18
|
+
* On macOS, when your Node.js app first calls keyring operations:
|
|
19
19
|
* - `setPassword()` creates a new Keychain item (no prompt required)
|
|
20
20
|
* - `getPassword()` may prompt the user for permission on first access
|
|
21
21
|
* - Users can click "Allow", "Always Allow", or "Deny"
|
|
22
|
-
* - If denied,
|
|
22
|
+
* - If denied, keyring returns `null` which this implementation handles gracefully
|
|
23
23
|
* - The calling binary (usually `node`) will be shown in the permission prompt
|
|
24
24
|
* - For better UX in packaged apps, consider code signing and app bundling
|
|
25
25
|
*
|
|
@@ -33,34 +33,75 @@ var KeyChainStore = class {
|
|
|
33
33
|
type = CredentialStoreType.keychain;
|
|
34
34
|
service;
|
|
35
35
|
logger = getLogger("KeyChainStore");
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
keyringAvailable = false;
|
|
37
|
+
EntryClass = null;
|
|
38
38
|
initializationPromise;
|
|
39
39
|
constructor(id, servicePrefix = "inkeep-agent-framework") {
|
|
40
40
|
this.id = id;
|
|
41
41
|
this.service = `${servicePrefix}-${id}`;
|
|
42
|
-
this.initializationPromise = this.
|
|
42
|
+
this.initializationPromise = this.initializeKeyring();
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* Initialize
|
|
45
|
+
* Initialize keyring dynamically to handle optional availability
|
|
46
46
|
*/
|
|
47
|
-
async
|
|
48
|
-
if (this.
|
|
49
|
-
this.
|
|
47
|
+
async initializeKeyring() {
|
|
48
|
+
if (this.EntryClass) {
|
|
49
|
+
this.keyringAvailable = true;
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
try {
|
|
53
|
-
this.
|
|
53
|
+
this.EntryClass = (await import(
|
|
54
54
|
/* webpackIgnore: true */
|
|
55
|
-
"
|
|
56
|
-
)).
|
|
57
|
-
this.
|
|
55
|
+
"@napi-rs/keyring"
|
|
56
|
+
)).Entry;
|
|
57
|
+
this.keyringAvailable = true;
|
|
58
58
|
} catch (error) {
|
|
59
59
|
this.logger.warn({
|
|
60
60
|
storeId: this.id,
|
|
61
61
|
error: error instanceof Error ? error.message : "Unknown error"
|
|
62
|
-
}, "
|
|
63
|
-
this.
|
|
62
|
+
}, "Keyring not available - KeyChainStore will return null for all operations");
|
|
63
|
+
this.keyringAvailable = false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Add a key to the index
|
|
68
|
+
*/
|
|
69
|
+
addKeyToIndex(key) {
|
|
70
|
+
if (!this.EntryClass) return;
|
|
71
|
+
try {
|
|
72
|
+
const indexEntry = new this.EntryClass(this.service, "__key_index__");
|
|
73
|
+
const indexJson = indexEntry.getPassword();
|
|
74
|
+
const keys = indexJson ? JSON.parse(indexJson) : [];
|
|
75
|
+
if (!keys.includes(key)) {
|
|
76
|
+
keys.push(key);
|
|
77
|
+
indexEntry.setPassword(JSON.stringify(keys));
|
|
78
|
+
}
|
|
79
|
+
} catch (error) {
|
|
80
|
+
this.logger.warn({
|
|
81
|
+
storeId: this.id,
|
|
82
|
+
key,
|
|
83
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
84
|
+
}, "Failed to update key index");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Remove a key from the index
|
|
89
|
+
*/
|
|
90
|
+
removeKeyFromIndex(key) {
|
|
91
|
+
if (!this.EntryClass) return;
|
|
92
|
+
try {
|
|
93
|
+
const indexEntry = new this.EntryClass(this.service, "__key_index__");
|
|
94
|
+
const indexJson = indexEntry.getPassword();
|
|
95
|
+
if (!indexJson) return;
|
|
96
|
+
const keys = JSON.parse(indexJson);
|
|
97
|
+
const filteredKeys = keys.filter((k) => k !== key);
|
|
98
|
+
if (filteredKeys.length !== keys.length) indexEntry.setPassword(JSON.stringify(filteredKeys));
|
|
99
|
+
} catch (error) {
|
|
100
|
+
this.logger.warn({
|
|
101
|
+
storeId: this.id,
|
|
102
|
+
key,
|
|
103
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
104
|
+
}, "Failed to update key index");
|
|
64
105
|
}
|
|
65
106
|
}
|
|
66
107
|
/**
|
|
@@ -68,20 +109,23 @@ var KeyChainStore = class {
|
|
|
68
109
|
*/
|
|
69
110
|
async get(key) {
|
|
70
111
|
await this.initializationPromise;
|
|
71
|
-
if (!this.
|
|
112
|
+
if (!this.keyringAvailable || !this.EntryClass) {
|
|
72
113
|
this.logger.debug({
|
|
73
114
|
storeId: this.id,
|
|
74
115
|
key
|
|
75
|
-
}, "
|
|
116
|
+
}, "Keyring not available, returning null");
|
|
76
117
|
return null;
|
|
77
118
|
}
|
|
78
119
|
try {
|
|
79
|
-
const password =
|
|
80
|
-
if (password === null)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
120
|
+
const password = new this.EntryClass(this.service, key).getPassword();
|
|
121
|
+
if (password === null || password === void 0) {
|
|
122
|
+
this.logger.debug({
|
|
123
|
+
storeId: this.id,
|
|
124
|
+
service: this.service,
|
|
125
|
+
account: key
|
|
126
|
+
}, "No credential found in keychain");
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
85
129
|
return password;
|
|
86
130
|
} catch (error) {
|
|
87
131
|
this.logger.error({
|
|
@@ -98,15 +142,16 @@ var KeyChainStore = class {
|
|
|
98
142
|
*/
|
|
99
143
|
async set(key, value, _metadata) {
|
|
100
144
|
await this.initializationPromise;
|
|
101
|
-
if (!this.
|
|
145
|
+
if (!this.keyringAvailable || !this.EntryClass) {
|
|
102
146
|
this.logger.warn({
|
|
103
147
|
storeId: this.id,
|
|
104
148
|
key
|
|
105
|
-
}, "
|
|
106
|
-
throw new Error("
|
|
149
|
+
}, "Keyring not available, cannot set credential");
|
|
150
|
+
throw new Error("Keyring not available - cannot store credentials in system keychain");
|
|
107
151
|
}
|
|
108
152
|
try {
|
|
109
|
-
|
|
153
|
+
new this.EntryClass(this.service, key).setPassword(value);
|
|
154
|
+
this.addKeyToIndex(key);
|
|
110
155
|
this.logger.debug({
|
|
111
156
|
storeId: this.id,
|
|
112
157
|
service: this.service,
|
|
@@ -133,9 +178,9 @@ var KeyChainStore = class {
|
|
|
133
178
|
*/
|
|
134
179
|
async checkAvailability() {
|
|
135
180
|
await this.initializationPromise;
|
|
136
|
-
if (!this.
|
|
181
|
+
if (!this.keyringAvailable || !this.EntryClass) return {
|
|
137
182
|
available: false,
|
|
138
|
-
reason: "
|
|
183
|
+
reason: "Keyring not available - cannot store credentials in system keychain"
|
|
139
184
|
};
|
|
140
185
|
return { available: true };
|
|
141
186
|
}
|
|
@@ -144,26 +189,22 @@ var KeyChainStore = class {
|
|
|
144
189
|
*/
|
|
145
190
|
async delete(key) {
|
|
146
191
|
await this.initializationPromise;
|
|
147
|
-
if (!this.
|
|
192
|
+
if (!this.keyringAvailable || !this.EntryClass) {
|
|
148
193
|
this.logger.warn({
|
|
149
194
|
storeId: this.id,
|
|
150
195
|
key
|
|
151
|
-
}, "
|
|
196
|
+
}, "Keyring not available, cannot delete credential");
|
|
152
197
|
return false;
|
|
153
198
|
}
|
|
154
199
|
try {
|
|
155
|
-
|
|
156
|
-
|
|
200
|
+
new this.EntryClass(this.service, key).deletePassword();
|
|
201
|
+
this.removeKeyFromIndex(key);
|
|
202
|
+
this.logger.debug({
|
|
157
203
|
storeId: this.id,
|
|
158
204
|
service: this.service,
|
|
159
205
|
account: key
|
|
160
206
|
}, "Credential deleted from keychain");
|
|
161
|
-
|
|
162
|
-
storeId: this.id,
|
|
163
|
-
service: this.service,
|
|
164
|
-
account: key
|
|
165
|
-
}, "Credential not found in keychain for deletion");
|
|
166
|
-
return result;
|
|
207
|
+
return true;
|
|
167
208
|
} catch (error) {
|
|
168
209
|
this.logger.error({
|
|
169
210
|
storeId: this.id,
|
|
@@ -177,12 +218,27 @@ var KeyChainStore = class {
|
|
|
177
218
|
/**
|
|
178
219
|
* Find all credentials for this service
|
|
179
220
|
* Useful for debugging and listing stored credentials
|
|
221
|
+
*
|
|
222
|
+
* NOTE: @napi-rs/keyring does not have a findCredentials equivalent.
|
|
223
|
+
* This implementation uses a key index to track all stored keys.
|
|
224
|
+
* The index is maintained separately and updated during set/delete operations.
|
|
180
225
|
*/
|
|
181
226
|
async findAllCredentials() {
|
|
182
227
|
await this.initializationPromise;
|
|
183
|
-
if (!this.
|
|
228
|
+
if (!this.keyringAvailable || !this.EntryClass) return [];
|
|
184
229
|
try {
|
|
185
|
-
|
|
230
|
+
const indexJson = new this.EntryClass(this.service, "__key_index__").getPassword();
|
|
231
|
+
if (!indexJson) return [];
|
|
232
|
+
const keys = JSON.parse(indexJson);
|
|
233
|
+
const credentials = [];
|
|
234
|
+
for (const key of keys) try {
|
|
235
|
+
const password = new this.EntryClass(this.service, key).getPassword();
|
|
236
|
+
if (password) credentials.push({
|
|
237
|
+
account: key,
|
|
238
|
+
password
|
|
239
|
+
});
|
|
240
|
+
} catch {}
|
|
241
|
+
return credentials;
|
|
186
242
|
} catch (error) {
|
|
187
243
|
this.logger.error({
|
|
188
244
|
storeId: this.id,
|
|
@@ -200,6 +256,14 @@ var KeyChainStore = class {
|
|
|
200
256
|
const credentials = await this.findAllCredentials();
|
|
201
257
|
let deletedCount = 0;
|
|
202
258
|
for (const cred of credentials) if (await this.delete(cred.account)) deletedCount++;
|
|
259
|
+
if (this.EntryClass && deletedCount > 0) try {
|
|
260
|
+
new this.EntryClass(this.service, "__key_index__").deletePassword();
|
|
261
|
+
} catch (error) {
|
|
262
|
+
this.logger.warn({
|
|
263
|
+
storeId: this.id,
|
|
264
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
265
|
+
}, "Failed to delete key index");
|
|
266
|
+
}
|
|
203
267
|
if (deletedCount > 0) this.logger.info({
|
|
204
268
|
storeId: this.id,
|
|
205
269
|
service: this.service,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { MCPToolConfig } from "../types/entities.js";
|
|
2
1
|
import "../types/index.js";
|
|
3
2
|
import { CredentialStoreRegistry } from "../credential-stores/CredentialStoreRegistry.js";
|
|
4
3
|
import { PinoLogger } from "../utils/logger.js";
|
|
5
4
|
import { McpServerConfig } from "../utils/mcp-client.js";
|
|
5
|
+
import { MCPToolConfig } from "../types/entities.js";
|
|
6
6
|
|
|
7
7
|
//#region src/credential-stuffer/CredentialStuffer.d.ts
|
|
8
8
|
/**
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig } from "./contextConfigs.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { countExternalAgents, createExternalAgent, deleteExternalAgent, externalAgentExists, externalAgentUrlExists, getExternalAgent, getExternalAgentByUrl, listExternalAgents, listExternalAgentsPaginated, updateExternalAgent, upsertExternalAgent } from "./externalAgents.js";
|
|
11
|
-
import { deleteFunction, getFunction, listFunctions, listFunctionsPaginated, upsertFunction } from "./functions.js";
|
|
12
|
-
import { addFunctionToolToSubAgent, createFunctionTool, deleteFunctionTool, getFunctionToolById, getFunctionToolsForSubAgent, listFunctionTools, updateFunctionTool, updateSubAgentFunctionToolRelation, upsertFunctionTool, upsertSubAgentFunctionToolRelation } from "./functionTools.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
1
|
+
import { AgentsManageDatabaseClient, AgentsManageDatabaseConfig, createAgentManageDatabaseConnection, createAgentsManageDatabaseClient, createAgentsManageDatabasePool } from "../db/manage/manage-client.js";
|
|
2
|
+
import { AgentsRunDatabaseClient, AgentsRunDatabaseConfig, createAgentsRunDatabaseClient } from "../db/runtime/runtime-client.js";
|
|
3
|
+
import { AgentLogger, createFullAgentServerSide, deleteFullAgent, getFullAgent, getFullAgentWithRelationIds, updateFullAgentServerSide } from "./manage/agentFull.js";
|
|
4
|
+
import { createAgent, deleteAgent, fetchComponentRelationships, getAgentById, getAgentSubAgentInfos, getAgentWithDefaultSubAgent, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, listAgents, listAgentsPaginated, updateAgent, upsertAgent } from "./manage/agents.js";
|
|
5
|
+
import { agentHasArtifactComponents, associateArtifactComponentWithAgent, countArtifactComponents, countArtifactComponentsForAgent, createArtifactComponent, deleteAgentArtifactComponentRelationByAgent, deleteArtifactComponent, getAgentsUsingArtifactComponent, getArtifactComponentById, getArtifactComponentsForAgent, isArtifactComponentAssociatedWithAgent, listArtifactComponents, listArtifactComponentsPaginated, removeArtifactComponentFromAgent, updateArtifactComponent, upsertAgentArtifactComponentRelation, upsertArtifactComponent } from "./manage/artifactComponents.js";
|
|
6
|
+
import { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig } from "./manage/contextConfigs.js";
|
|
7
|
+
import { CredentialReferenceWithResources, countCredentialReferences, createCredentialReference, deleteCredentialReference, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getUserScopedCredentialReference, hasCredentialReference, listCredentialReferences, listCredentialReferencesPaginated, updateCredentialReference, upsertCredentialReference } from "./manage/credentialReferences.js";
|
|
8
|
+
import { associateDataComponentWithAgent, countDataComponents, createDataComponent, deleteAgentDataComponentRelationByAgent, deleteDataComponent, getAgentsUsingDataComponent, getDataComponent, getDataComponentsForAgent, isDataComponentAssociatedWithAgent, listDataComponents, listDataComponentsPaginated, removeDataComponentFromAgent, updateDataComponent, upsertAgentDataComponentRelation, upsertDataComponent } from "./manage/dataComponents.js";
|
|
9
|
+
import { createDataset, createDatasetItem, createDatasetItems, createDatasetRunConfig, createDatasetRunConfigAgentRelation, createEvaluationJobConfig, createEvaluationJobConfigEvaluatorRelation, createEvaluationRunConfig, createEvaluationRunConfigEvaluationSuiteConfigRelation, createEvaluationSuiteConfig, createEvaluationSuiteConfigEvaluatorRelation, createEvaluator, deleteDataset, deleteDatasetItem, deleteDatasetItemsByDataset, deleteDatasetRunConfig, deleteDatasetRunConfigAgentRelation, deleteEvaluationJobConfig, deleteEvaluationJobConfigEvaluatorRelation, deleteEvaluationJobConfigEvaluatorRelationsByEvaluator, deleteEvaluationRunConfig, deleteEvaluationRunConfigEvaluationSuiteConfigRelation, deleteEvaluationSuiteConfig, deleteEvaluationSuiteConfigEvaluatorRelation, deleteEvaluationSuiteConfigEvaluatorRelationsByEvaluator, deleteEvaluator, getDatasetById, getDatasetItemById, getDatasetRunConfigAgentRelations, getDatasetRunConfigById, getEvaluationJobConfigById, getEvaluationJobConfigEvaluatorRelations, getEvaluationRunConfigById, getEvaluationRunConfigEvaluationSuiteConfigRelations, getEvaluationSuiteConfigById, getEvaluationSuiteConfigEvaluatorRelations, getEvaluatorById, getEvaluatorsByIds, linkDatasetRunToEvaluationJobConfig, listDatasetItems, listDatasetRunConfigs, listDatasets, listEvaluationJobConfigs, listEvaluationRunConfigs, listEvaluationRunConfigsWithSuiteConfigs, listEvaluationSuiteConfigs, listEvaluators, updateDataset, updateDatasetItem, updateDatasetRunConfig, updateEvaluationRunConfig, updateEvaluationSuiteConfig, updateEvaluator } from "./manage/evalConfig.js";
|
|
10
|
+
import { countExternalAgents, createExternalAgent, deleteExternalAgent, externalAgentExists, externalAgentUrlExists, getExternalAgent, getExternalAgentByUrl, listExternalAgents, listExternalAgentsPaginated, updateExternalAgent, upsertExternalAgent } from "./manage/externalAgents.js";
|
|
11
|
+
import { deleteFunction, getFunction, listFunctions, listFunctionsPaginated, upsertFunction } from "./manage/functions.js";
|
|
12
|
+
import { addFunctionToolToSubAgent, associateFunctionToolWithSubAgent, createFunctionTool, deleteFunctionTool, getFunctionToolById, getFunctionToolsForSubAgent, getSubAgentsUsingFunctionTool, isFunctionToolAssociatedWithSubAgent, listFunctionTools, removeFunctionToolFromSubAgent, updateFunctionTool, updateSubAgentFunctionToolRelation, upsertFunctionTool, upsertSubAgentFunctionToolRelation } from "./manage/functionTools.js";
|
|
13
|
+
import { ProjectLogger, createFullProjectServerSide, deleteFullProject, getFullProject, getFullProjectWithRelationIds, updateFullProjectServerSide } from "./manage/projectFull.js";
|
|
14
|
+
import { CreateProjectWithBranchParams, CreateProjectWithBranchResult, DeleteProjectWithBranchParams, ListProjectsWithMetadataResult, ProjectConfigMetadata, ProjectWithMetadata, createProjectMetadataAndBranch, deleteProjectWithBranch, getProjectMainBranchName, getProjectWithBranchInfo, getProjectWithMetadata, listProjectsWithMetadataPaginated } from "./manage/projectLifecycle.js";
|
|
15
|
+
import { countProjects, createProject, deleteProject, getProject, getProjectResourceCounts, listProjects, listProjectsPaginated, projectExists, projectExistsInTable, projectHasResources, updateProject } from "./manage/projects.js";
|
|
16
|
+
import { createSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, getExternalAgentsForSubAgent, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentsForExternalAgent, listSubAgentExternalAgentRelations, updateSubAgentExternalAgentRelation, upsertSubAgentExternalAgentRelation } from "./manage/subAgentExternalAgentRelations.js";
|
|
17
|
+
import { createAgentToolRelation, createSubAgentRelation, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteSubAgentRelation, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsForTool, getRelatedAgentsForAgent, getSubAgentRelationsByTarget, getToolsForAgent, listAgentRelations, listAgentToolRelations, updateAgentRelation, updateAgentToolRelation, upsertSubAgentRelation, validateSubAgent } from "./manage/subAgentRelations.js";
|
|
18
|
+
import { SubAgentIsDefaultError, createSubAgent, deleteSubAgent, getSubAgentById, getSubAgentsByIds, listSubAgents, listSubAgentsPaginated, updateSubAgent, upsertSubAgent } from "./manage/subAgents.js";
|
|
19
|
+
import { createSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsForTeamAgent, getTeamAgentsForSubAgent, listSubAgentTeamAgentRelations, updateSubAgentTeamAgentRelation, upsertSubAgentTeamAgentRelation } from "./manage/subAgentTeamAgentRelations.js";
|
|
20
|
+
import { addToolToAgent, createTool, dbResultToMcpTool, dbResultToMcpToolSkeleton, deleteTool, getMcpToolById, getToolById, listTools, removeToolFromAgent, updateTool, upsertSubAgentToolRelation, upsertTool } from "./manage/tools.js";
|
|
21
|
+
import { createTrigger, deleteTrigger, getTriggerById, listTriggers, listTriggersPaginated, updateTrigger, upsertTrigger } from "./manage/triggers.js";
|
|
22
|
+
import { countApiKeys, createApiKey, deleteApiKey, generateAndCreateApiKey, getApiKeyById, getApiKeyByPublicId, hasApiKey, listApiKeys, listApiKeysPaginated, updateApiKey, updateApiKeyLastUsed, validateAndGetApiKey } from "./runtime/apiKeys.js";
|
|
23
|
+
import { CascadeDeleteResult, cascadeDeleteByAgent, cascadeDeleteByBranch, cascadeDeleteByContextConfig, cascadeDeleteByProject, cascadeDeleteBySubAgent } from "./runtime/cascade-delete.js";
|
|
24
|
+
import { cleanupTenantCache, clearContextConfigCache, clearConversationCache, getCacheEntry, getContextConfigCacheEntries, getConversationCacheEntries, invalidateHeadersCache, invalidateInvocationDefinitionsCache, setCacheEntry } from "./runtime/contextCache.js";
|
|
25
|
+
import { createConversation, createOrGetConversation, deleteConversation, getActiveAgentForConversation, getConversation, getConversationHistory, listConversations, setActiveAgentForConversation, setActiveAgentForThread, updateConversation, updateConversationActiveSubAgent } from "./runtime/conversations.js";
|
|
26
|
+
import { createDatasetRun, createDatasetRunConversationRelation, createDatasetRunConversationRelations, createEvaluationResult, createEvaluationResults, createEvaluationRun, deleteDatasetRun, deleteDatasetRunConversationRelation, deleteDatasetRunConversationRelationsByRun, deleteEvaluationResult, deleteEvaluationResultsByRun, deleteEvaluationRun, filterConversationsForJob, getDatasetRunById, getDatasetRunConversationRelationByConversation, getDatasetRunConversationRelations, getEvaluationResultById, getEvaluationRunById, getEvaluationRunByJobConfigId, listDatasetRuns, listDatasetRunsByConfig, listEvaluationResults, listEvaluationResultsByConversation, listEvaluationResultsByRun, listEvaluationRuns, listEvaluationRunsByJobConfigId, updateEvaluationResult, updateEvaluationRun } from "./runtime/evalRuns.js";
|
|
27
|
+
import { addLedgerArtifacts, countLedgerArtifactsByTask, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, getLedgerArtifacts, getLedgerArtifactsByContext, upsertLedgerArtifact } from "./runtime/ledgerArtifacts.js";
|
|
28
|
+
import { countMessagesByConversation, createMessage, deleteMessage, getMessageById, getMessagesByConversation, getMessagesByTask, getVisibleMessages, listMessages, updateMessage } from "./runtime/messages.js";
|
|
29
|
+
import { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizationsFromDb, upsertOrganization } from "./runtime/organizations.js";
|
|
30
|
+
import { ProjectMetadataPaginatedResult, countProjectsInRuntime, createProjectMetadata, deleteProjectMetadata, getProjectMetadata, listProjectsMetadata, listProjectsMetadataPaginated, projectsMetadataExists } from "./runtime/projects.js";
|
|
31
|
+
import { createTask, getTask, listTaskIdsByContextId, updateTask } from "./runtime/tasks.js";
|
|
32
|
+
import { createTriggerInvocation, getTriggerInvocationById, listTriggerInvocationsPaginated, updateTriggerInvocationStatus } from "./runtime/triggerInvocations.js";
|
|
33
|
+
import { getUserByEmail, getUserById } from "./runtime/users.js";
|
|
25
34
|
import { createValidatedDataAccess, validateProjectExists, withProjectValidation } from "./validation.js";
|
|
26
|
-
|
|
27
|
-
export { AgentLogger, CredentialReferenceWithResources, DatabaseClient, DatabaseConfig, ProjectLogger, SubAgentIsDefaultError, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, addUserToOrganization, agentHasArtifactComponents, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentToolRelation, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createExternalAgent, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createMessage, createOrGetConversation, createProject, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, externalAgentExists, externalAgentUrlExists, fetchComponentRelationships, generateAndCreateApiKey, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentsForSubAgent, getFullAgent, getFullAgentDefinition, getFullProject, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getMessageById, getMessagesByConversation, getMessagesByTask, getPendingInvitationsByEmail, getProject, getProjectResourceCounts, getRelatedAgentsForAgent, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getUserByEmail, getUserById, getUserOrganizations, getUserScopedCredentialReference, getVisibleMessages, hasApiKey, hasContextConfig, hasCredentialReference, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listFunctionsPaginated, listMessages, listProjects, listProjectsPaginated, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, validateAndGetApiKey, validateProjectExists, validateSubAgent, withProjectValidation };
|
|
35
|
+
export { AgentLogger, AgentsManageDatabaseClient, AgentsManageDatabaseConfig, AgentsRunDatabaseClient, AgentsRunDatabaseConfig, CascadeDeleteResult, CreateProjectWithBranchParams, CreateProjectWithBranchResult, CredentialReferenceWithResources, DeleteProjectWithBranchParams, ListProjectsWithMetadataResult, ProjectConfigMetadata, ProjectLogger, ProjectMetadataPaginatedResult, ProjectWithMetadata, SubAgentIsDefaultError, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, addUserToOrganization, agentHasArtifactComponents, associateArtifactComponentWithAgent, associateDataComponentWithAgent, associateFunctionToolWithSubAgent, cascadeDeleteByAgent, cascadeDeleteByBranch, cascadeDeleteByContextConfig, cascadeDeleteByProject, cascadeDeleteBySubAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, countProjectsInRuntime, createAgent, createAgentManageDatabaseConnection, createAgentToolRelation, createAgentsManageDatabaseClient, createAgentsManageDatabasePool, createAgentsRunDatabaseClient, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDataset, createDatasetItem, createDatasetItems, createDatasetRun, createDatasetRunConfig, createDatasetRunConfigAgentRelation, createDatasetRunConversationRelation, createDatasetRunConversationRelations, createEvaluationJobConfig, createEvaluationJobConfigEvaluatorRelation, createEvaluationResult, createEvaluationResults, createEvaluationRun, createEvaluationRunConfig, createEvaluationRunConfigEvaluationSuiteConfigRelation, createEvaluationSuiteConfig, createEvaluationSuiteConfigEvaluatorRelation, createEvaluator, createExternalAgent, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createMessage, createOrGetConversation, createProject, createProjectMetadata, createProjectMetadataAndBranch, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createTrigger, createTriggerInvocation, createValidatedDataAccess, dbResultToMcpTool, dbResultToMcpToolSkeleton, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteDataset, deleteDatasetItem, deleteDatasetItemsByDataset, deleteDatasetRun, deleteDatasetRunConfig, deleteDatasetRunConfigAgentRelation, deleteDatasetRunConversationRelation, deleteDatasetRunConversationRelationsByRun, deleteEvaluationJobConfig, deleteEvaluationJobConfigEvaluatorRelation, deleteEvaluationJobConfigEvaluatorRelationsByEvaluator, deleteEvaluationResult, deleteEvaluationResultsByRun, deleteEvaluationRun, deleteEvaluationRunConfig, deleteEvaluationRunConfigEvaluationSuiteConfigRelation, deleteEvaluationSuiteConfig, deleteEvaluationSuiteConfigEvaluatorRelation, deleteEvaluationSuiteConfigEvaluatorRelationsByEvaluator, deleteEvaluator, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteProjectMetadata, deleteProjectWithBranch, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, deleteTrigger, externalAgentExists, externalAgentUrlExists, fetchComponentRelationships, filterConversationsForJob, generateAndCreateApiKey, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getDataComponent, getDataComponentsForAgent, getDatasetById, getDatasetItemById, getDatasetRunById, getDatasetRunConfigAgentRelations, getDatasetRunConfigById, getDatasetRunConversationRelationByConversation, getDatasetRunConversationRelations, getEvaluationJobConfigById, getEvaluationJobConfigEvaluatorRelations, getEvaluationResultById, getEvaluationRunById, getEvaluationRunByJobConfigId, getEvaluationRunConfigById, getEvaluationRunConfigEvaluationSuiteConfigRelations, getEvaluationSuiteConfigById, getEvaluationSuiteConfigEvaluatorRelations, getEvaluatorById, getEvaluatorsByIds, getExternalAgent, getExternalAgentByUrl, getExternalAgentsForSubAgent, getFullAgent, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, getFullAgentWithRelationIds, getFullProject, getFullProjectWithRelationIds, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getMcpToolById, getMessageById, getMessagesByConversation, getMessagesByTask, getPendingInvitationsByEmail, getProject, getProjectMainBranchName, getProjectMetadata, getProjectResourceCounts, getProjectWithBranchInfo, getProjectWithMetadata, getRelatedAgentsForAgent, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getSubAgentsUsingFunctionTool, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getTriggerById, getTriggerInvocationById, getUserByEmail, getUserById, getUserOrganizationsFromDb, getUserScopedCredentialReference, getVisibleMessages, hasApiKey, hasContextConfig, hasCredentialReference, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isFunctionToolAssociatedWithSubAgent, linkDatasetRunToEvaluationJobConfig, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listDatasetItems, listDatasetRunConfigs, listDatasetRuns, listDatasetRunsByConfig, listDatasets, listEvaluationJobConfigs, listEvaluationResults, listEvaluationResultsByConversation, listEvaluationResultsByRun, listEvaluationRunConfigs, listEvaluationRunConfigsWithSuiteConfigs, listEvaluationRuns, listEvaluationRunsByJobConfigId, listEvaluationSuiteConfigs, listEvaluators, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listFunctionsPaginated, listMessages, listProjects, listProjectsMetadata, listProjectsMetadataPaginated, listProjectsPaginated, listProjectsWithMetadataPaginated, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, listTriggerInvocationsPaginated, listTriggers, listTriggersPaginated, projectExists, projectExistsInTable, projectHasResources, projectsMetadataExists, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeFunctionToolFromSubAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveSubAgent, updateCredentialReference, updateDataComponent, updateDataset, updateDatasetItem, updateDatasetRunConfig, updateEvaluationResult, updateEvaluationRun, updateEvaluationRunConfig, updateEvaluationSuiteConfig, updateEvaluator, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, updateTrigger, updateTriggerInvocationStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertOrganization, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, upsertTrigger, validateAndGetApiKey, validateProjectExists, validateSubAgent, withProjectValidation };
|