@inkeep/agents-core 0.42.0 → 0.44.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/auth/auth.d.ts +28 -26
- package/dist/auth/auth.js +21 -16
- package/dist/auth/authz/client.d.ts +8 -3
- package/dist/auth/authz/client.js +23 -17
- package/dist/auth/authz/config.d.ts +50 -29
- package/dist/auth/authz/config.js +42 -33
- package/dist/auth/authz/index.d.ts +3 -3
- package/dist/auth/authz/index.js +3 -3
- package/dist/auth/authz/permissions.d.ts +0 -4
- package/dist/auth/authz/permissions.js +9 -13
- package/dist/auth/authz/sync.d.ts +23 -2
- package/dist/auth/authz/sync.js +127 -53
- package/dist/auth/init.d.ts +1 -0
- package/dist/auth/init.js +115 -0
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +3 -6
- package/dist/client-exports.js +4 -7
- 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 +5 -0
- package/dist/constants/otel-attributes.js +8 -3
- package/dist/constants/signoz-queries.d.ts +1 -0
- package/dist/constants/signoz-queries.js +2 -1
- package/dist/context/TemplateEngine.d.ts +0 -6
- package/dist/context/TemplateEngine.js +4 -18
- package/dist/credential-stores/keychain-store.d.ts +20 -8
- package/dist/credential-stores/keychain-store.js +107 -43
- package/dist/data-access/index.d.ts +5 -4
- package/dist/data-access/index.js +5 -4
- package/dist/data-access/manage/agentFull.js +70 -25
- package/dist/data-access/manage/agents.d.ts +41 -41
- package/dist/data-access/manage/agents.js +29 -21
- package/dist/data-access/manage/artifactComponents.d.ts +12 -12
- package/dist/data-access/manage/artifactComponents.js +1 -1
- package/dist/data-access/manage/contextConfigs.d.ts +12 -12
- package/dist/data-access/manage/dataComponents.d.ts +6 -6
- package/dist/data-access/manage/dataComponents.js +1 -1
- package/dist/data-access/manage/functionTools.d.ts +44 -21
- package/dist/data-access/manage/functionTools.js +34 -22
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +26 -26
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +15 -15
- package/dist/data-access/manage/tools.d.ts +39 -28
- package/dist/data-access/manage/tools.js +73 -31
- package/dist/data-access/manage/triggers.d.ts +27 -1
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/cascade-delete.d.ts +48 -1
- package/dist/data-access/runtime/cascade-delete.js +52 -2
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/github-work-app-installations.d.ts +261 -0
- package/dist/data-access/runtime/github-work-app-installations.js +457 -0
- package/dist/data-access/runtime/messages.d.ts +18 -18
- package/dist/data-access/runtime/organizations.d.ts +2 -2
- package/dist/data-access/runtime/organizations.js +4 -4
- package/dist/data-access/runtime/tasks.d.ts +6 -6
- package/dist/db/manage/manage-schema.d.ts +533 -402
- package/dist/db/manage/manage-schema.js +38 -27
- package/dist/db/runtime/runtime-schema.d.ts +1021 -177
- package/dist/db/runtime/runtime-schema.js +173 -5
- package/dist/db/utils.d.ts +6 -0
- package/dist/db/utils.js +42 -0
- package/dist/dolt/branch.js +1 -1
- package/dist/dolt/branches-api.js +1 -1
- package/dist/dolt/index.d.ts +2 -2
- package/dist/dolt/index.js +4 -4
- package/dist/dolt/migrate-all-branches.js +6 -1
- package/dist/dolt/migrate-dolt.js +4 -1
- package/dist/dolt/ref-helpers.js +1 -1
- package/dist/dolt/ref-middleware.js +1 -1
- package/dist/dolt/ref-scope.js +1 -1
- package/dist/dolt/schema-sync.d.ts +2 -1
- package/dist/dolt/schema-sync.js +10 -1
- package/dist/env.d.ts +6 -4
- package/dist/env.js +11 -10
- package/dist/index.d.ts +15 -16
- package/dist/index.js +23 -24
- package/dist/types/@napi-rs__keyring/index.d.ts +14 -0
- package/dist/types/entities.d.ts +9 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/utility.d.ts +17 -3
- package/dist/types/utility.js +2 -1
- package/dist/utils/JsonTransformer.d.ts +1 -3
- package/dist/utils/JsonTransformer.js +14 -23
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +3 -3
- package/dist/utils/jmespath-utils.d.ts +152 -0
- package/dist/utils/jmespath-utils.js +213 -0
- package/dist/utils/mcp-client.d.ts +1 -1
- package/dist/utils/mcp-client.js +1 -1
- package/dist/utils/signature-validation.d.ts +2 -0
- package/dist/utils/signature-validation.js +3 -0
- package/dist/utils/third-party-mcp-servers/composio-client.d.ts +13 -1
- package/dist/utils/third-party-mcp-servers/composio-client.js +24 -6
- 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 +31 -8
- package/dist/utils/trigger-auth.js +121 -13
- package/dist/validation/agentFull.js +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +4 -23
- package/dist/validation/drizzle-schema-helpers.js +3 -30
- package/dist/validation/index.d.ts +3 -5
- package/dist/validation/index.js +5 -7
- package/dist/validation/render-validation.js +19 -0
- package/dist/validation/schemas.d.ts +3675 -1665
- package/dist/validation/schemas.js +409 -94
- package/dist/validation/stream-event-schemas.d.ts +96 -1
- package/dist/validation/stream-event-schemas.js +67 -2
- 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/0006_fixed_umar.sql +1 -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/0006_snapshot.json +3148 -0
- package/drizzle/manage/meta/_journal.json +28 -0
- package/drizzle/runtime/0010_previous_black_knight.sql +84 -0
- package/drizzle/runtime/meta/0010_snapshot.json +3066 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +12 -5
- package/spicedb/schema.zed +114 -0
- package/dist/validation/id-validation.d.ts +0 -24
- package/dist/validation/id-validation.js +0 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0",
|
|
4
4
|
"description": "Agents Core contains the database schema, types, and validation schemas for Inkeep Agent Framework, along with core components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -66,6 +66,10 @@
|
|
|
66
66
|
"types": "./dist/utils/schema-conversion.d.ts",
|
|
67
67
|
"import": "./dist/utils/schema-conversion.js"
|
|
68
68
|
},
|
|
69
|
+
"./utils/signature-validation": {
|
|
70
|
+
"types": "./dist/utils/signature-validation.d.ts",
|
|
71
|
+
"import": "./dist/utils/signature-validation.js"
|
|
72
|
+
},
|
|
69
73
|
"./auth": {
|
|
70
74
|
"types": "./dist/auth/auth.d.ts",
|
|
71
75
|
"import": "./dist/auth/auth.js"
|
|
@@ -97,6 +101,7 @@
|
|
|
97
101
|
"@ai-sdk/openai": "3.0.7",
|
|
98
102
|
"@ai-sdk/openai-compatible": "2.0.4",
|
|
99
103
|
"@authzed/authzed-node": "^1.6.1",
|
|
104
|
+
"@babel/parser": "^7.28.6",
|
|
100
105
|
"@better-auth/sso": "~1.4.10",
|
|
101
106
|
"@composio/core": "^0.2.4",
|
|
102
107
|
"@electric-sql/pglite": "^0.3.13",
|
|
@@ -125,7 +130,8 @@
|
|
|
125
130
|
"pino-pretty": "^13.1.1",
|
|
126
131
|
"postgres": "^3.4.8",
|
|
127
132
|
"traverse": "^0.6.10",
|
|
128
|
-
"ts-pattern": "^5.7.1"
|
|
133
|
+
"ts-pattern": "^5.7.1",
|
|
134
|
+
"@napi-rs/keyring": "^1.2.0"
|
|
129
135
|
},
|
|
130
136
|
"peerDependencies": {
|
|
131
137
|
"@hono/zod-openapi": "^1.1.5",
|
|
@@ -139,8 +145,7 @@
|
|
|
139
145
|
"@opentelemetry/sdk-metrics": "^2.0.1",
|
|
140
146
|
"@opentelemetry/sdk-node": "^0.203.0",
|
|
141
147
|
"@opentelemetry/sdk-trace-node": "^2.0.1",
|
|
142
|
-
"@opentelemetry/semantic-conventions": "^1.34.0"
|
|
143
|
-
"keytar": "^7.9.0"
|
|
148
|
+
"@opentelemetry/semantic-conventions": "^1.34.0"
|
|
144
149
|
},
|
|
145
150
|
"devDependencies": {
|
|
146
151
|
"@types/jmespath": "^0.15.2",
|
|
@@ -163,6 +168,7 @@
|
|
|
163
168
|
"files": [
|
|
164
169
|
"dist",
|
|
165
170
|
"drizzle",
|
|
171
|
+
"spicedb",
|
|
166
172
|
"README.md",
|
|
167
173
|
"LICENSE.md",
|
|
168
174
|
"SUPPLEMENTAL_TERMS.md"
|
|
@@ -204,6 +210,7 @@
|
|
|
204
210
|
"db:run:migrate": "drizzle-kit migrate --config=drizzle.run.config.ts",
|
|
205
211
|
"db:run:drop": "drizzle-kit drop --config=drizzle.run.config.ts",
|
|
206
212
|
"db:run:studio": "drizzle-kit studio --config=drizzle.run.config.ts",
|
|
207
|
-
"db:run:check": "drizzle-kit check --config=drizzle.run.config.ts"
|
|
213
|
+
"db:run:check": "drizzle-kit check --config=drizzle.run.config.ts",
|
|
214
|
+
"db:auth:init": "tsx src/auth/init.ts"
|
|
208
215
|
}
|
|
209
216
|
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SpiceDB Schema for Project-Level Access Control
|
|
3
|
+
*
|
|
4
|
+
* This schema defines the authorization model for the Inkeep Agent Framework.
|
|
5
|
+
* All projects are private by default and require explicit grants.
|
|
6
|
+
*
|
|
7
|
+
* Naming Conventions (per SpiceDB best practices):
|
|
8
|
+
* - Relations: nouns (roles) - e.g., owner, admin, member
|
|
9
|
+
* - Permissions: verbs (actions) - e.g., view, edit, delete, manage
|
|
10
|
+
*
|
|
11
|
+
* Future Extensibility:
|
|
12
|
+
* - Groups: Add `| group#member` to relation types
|
|
13
|
+
* - Service Accounts: Add `| service_account` to relation types
|
|
14
|
+
* - Custom Roles: Define a `role` definition and bind it via `relation custom_role: role`
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* user represents a human user in the system
|
|
19
|
+
*/
|
|
20
|
+
definition user {}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* organization represents a tenant/org boundary
|
|
24
|
+
* All authorization is scoped within an organization
|
|
25
|
+
*/
|
|
26
|
+
definition organization {
|
|
27
|
+
/**
|
|
28
|
+
* owner has full control over the organization
|
|
29
|
+
*/
|
|
30
|
+
relation owner: user
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* admin can manage org settings and all projects
|
|
34
|
+
*/
|
|
35
|
+
relation admin: user
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* member is a basic org member with no implicit project access
|
|
39
|
+
*/
|
|
40
|
+
relation member: user
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Can view organization details
|
|
44
|
+
* "Can user VIEW organization?"
|
|
45
|
+
*/
|
|
46
|
+
permission view = owner + admin + member
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Can manage organization settings and all projects
|
|
50
|
+
* "Can user MANAGE organization?"
|
|
51
|
+
*/
|
|
52
|
+
permission manage = owner + admin
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* project is a container for agents, workflows, and other resources
|
|
57
|
+
* All projects are private by default - require explicit grants
|
|
58
|
+
*
|
|
59
|
+
* Role Hierarchy:
|
|
60
|
+
* - project_admin: Full access (view + use + edit + manage members)
|
|
61
|
+
* - project_member: Operator access (view + use: invoke agents, create API keys)
|
|
62
|
+
* - project_viewer: Read-only access (view only)
|
|
63
|
+
*/
|
|
64
|
+
definition project {
|
|
65
|
+
/**
|
|
66
|
+
* The organization this project belongs to
|
|
67
|
+
*/
|
|
68
|
+
relation organization: organization
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* project_admin can manage project membership, settings, and configurations
|
|
72
|
+
* Includes all permissions: view, use, edit, delete
|
|
73
|
+
*/
|
|
74
|
+
relation project_admin: user
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* project_member can use the project (invoke agents, create API keys)
|
|
78
|
+
* but cannot edit configurations or manage members
|
|
79
|
+
* Includes: view, use
|
|
80
|
+
*/
|
|
81
|
+
relation project_member: user
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* project_viewer can only view the project and its resources (read-only)
|
|
85
|
+
* Cannot invoke agents, create API keys, or edit anything
|
|
86
|
+
* Includes: view only
|
|
87
|
+
*/
|
|
88
|
+
relation project_viewer: user
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Can view the project and its resources (read-only)
|
|
92
|
+
* "Can user VIEW project?"
|
|
93
|
+
* - Org managers can always view
|
|
94
|
+
* - All project roles can view
|
|
95
|
+
*/
|
|
96
|
+
permission view = organization->manage + project_admin + project_member + project_viewer
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Can use the project (invoke agents, create API keys, view traces)
|
|
100
|
+
* "Can user USE project?"
|
|
101
|
+
* - Org managers can always use
|
|
102
|
+
* - project_admin and project_member can use
|
|
103
|
+
* - project_viewer CANNOT use (read-only)
|
|
104
|
+
*/
|
|
105
|
+
permission use = organization->manage + project_admin + project_member
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Can edit project configurations and manage members
|
|
109
|
+
* "Can user EDIT project?"
|
|
110
|
+
* - Org managers can always edit
|
|
111
|
+
* - Only project_admin can edit
|
|
112
|
+
*/
|
|
113
|
+
permission edit = organization->manage + project_admin
|
|
114
|
+
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//#region src/validation/id-validation.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Valid URL-safe characters for resource IDs based on RFC 3986.
|
|
4
|
-
*
|
|
5
|
-
* Allowed characters:
|
|
6
|
-
* - Letters: a-z, A-Z
|
|
7
|
-
* - Numbers: 0-9
|
|
8
|
-
* - Hyphens: -
|
|
9
|
-
* - Underscores: _
|
|
10
|
-
*
|
|
11
|
-
* Note: While dots (.) and tildes (~) are technically URL-safe,
|
|
12
|
-
* we exclude them for consistency with existing patterns in the codebase.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Helper function to validate if a string is a valid resource ID
|
|
16
|
-
*/
|
|
17
|
-
declare function isValidResourceId(id: string): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Helper function to generate a URL-safe ID from a name or title.
|
|
20
|
-
* Converts to lowercase and replaces invalid characters with hyphens.
|
|
21
|
-
*/
|
|
22
|
-
declare function generateIdFromName(name: string): string;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { generateIdFromName, isValidResourceId };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { MAX_ID_LENGTH, resourceIdSchema } from "./drizzle-schema-helpers.js";
|
|
2
|
-
|
|
3
|
-
//#region src/validation/id-validation.ts
|
|
4
|
-
/**
|
|
5
|
-
* Valid URL-safe characters for resource IDs based on RFC 3986.
|
|
6
|
-
*
|
|
7
|
-
* Allowed characters:
|
|
8
|
-
* - Letters: a-z, A-Z
|
|
9
|
-
* - Numbers: 0-9
|
|
10
|
-
* - Hyphens: -
|
|
11
|
-
* - Underscores: _
|
|
12
|
-
*
|
|
13
|
-
* Note: While dots (.) and tildes (~) are technically URL-safe,
|
|
14
|
-
* we exclude them for consistency with existing patterns in the codebase.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Helper function to validate if a string is a valid resource ID
|
|
18
|
-
*/
|
|
19
|
-
function isValidResourceId(id) {
|
|
20
|
-
return resourceIdSchema.safeParse(id).success;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Helper function to generate a URL-safe ID from a name or title.
|
|
24
|
-
* Converts to lowercase and replaces invalid characters with hyphens.
|
|
25
|
-
*/
|
|
26
|
-
function generateIdFromName(name) {
|
|
27
|
-
const id = name.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, "-");
|
|
28
|
-
if (!id) throw new Error("Cannot generate valid ID from provided name");
|
|
29
|
-
const truncatedId = id.substring(0, MAX_ID_LENGTH);
|
|
30
|
-
const result = resourceIdSchema.safeParse(truncatedId);
|
|
31
|
-
if (!result.success) throw new Error(`Generated ID "${truncatedId}" is not valid: ${result.error.message}`);
|
|
32
|
-
return truncatedId;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Example valid IDs:
|
|
36
|
-
* - "qa-agent"
|
|
37
|
-
* - "customer_support_123"
|
|
38
|
-
* - "router"
|
|
39
|
-
* - "tool-executor-v2"
|
|
40
|
-
* - "PRODUCTION_CONFIG"
|
|
41
|
-
*
|
|
42
|
-
* Example invalid IDs:
|
|
43
|
-
* - "my.agent" (contains dot)
|
|
44
|
-
* - "agent@123" (contains @)
|
|
45
|
-
* - "agent/router" (contains slash)
|
|
46
|
-
* - "my agent" (contains space)
|
|
47
|
-
* - "agent#1" (contains hash)
|
|
48
|
-
* - "" (empty string)
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
//#endregion
|
|
52
|
-
export { generateIdFromName, isValidResourceId };
|