@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
|
@@ -15,20 +15,20 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
15
15
|
total: number;
|
|
16
16
|
}>;
|
|
17
17
|
declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
|
|
18
|
-
tenantId: string;
|
|
19
|
-
projectId: string;
|
|
20
18
|
id: string;
|
|
21
|
-
title: string | null;
|
|
22
|
-
agentId: string | null;
|
|
23
19
|
createdAt: string;
|
|
24
20
|
updatedAt: string;
|
|
25
|
-
userId: string | null;
|
|
26
|
-
metadata: ConversationMetadata | null;
|
|
27
21
|
ref: {
|
|
28
22
|
type: "tag" | "commit" | "branch";
|
|
29
23
|
name: string;
|
|
30
24
|
hash: string;
|
|
31
25
|
} | null;
|
|
26
|
+
userId: string | null;
|
|
27
|
+
metadata: ConversationMetadata | null;
|
|
28
|
+
agentId: string | null;
|
|
29
|
+
projectId: string;
|
|
30
|
+
tenantId: string;
|
|
31
|
+
title: string | null;
|
|
32
32
|
activeSubAgentId: string;
|
|
33
33
|
lastContextResolution: string | null;
|
|
34
34
|
}>;
|
|
@@ -84,20 +84,20 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
84
84
|
scopes: ProjectScopeConfig;
|
|
85
85
|
conversationId: string;
|
|
86
86
|
}) => Promise<{
|
|
87
|
-
tenantId: string;
|
|
88
|
-
projectId: string;
|
|
89
87
|
id: string;
|
|
90
|
-
title: string | null;
|
|
91
|
-
agentId: string | null;
|
|
92
88
|
createdAt: string;
|
|
93
89
|
updatedAt: string;
|
|
94
|
-
userId: string | null;
|
|
95
|
-
metadata: ConversationMetadata | null;
|
|
96
90
|
ref: {
|
|
97
91
|
type: "tag" | "commit" | "branch";
|
|
98
92
|
name: string;
|
|
99
93
|
hash: string;
|
|
100
94
|
} | null;
|
|
95
|
+
userId: string | null;
|
|
96
|
+
metadata: ConversationMetadata | null;
|
|
97
|
+
agentId: string | null;
|
|
98
|
+
projectId: string;
|
|
99
|
+
tenantId: string;
|
|
100
|
+
title: string | null;
|
|
101
101
|
activeSubAgentId: string;
|
|
102
102
|
lastContextResolution: string | null;
|
|
103
103
|
} | undefined>;
|
|
@@ -120,20 +120,20 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
|
|
|
120
120
|
metadata?: ConversationMetadata | null | undefined;
|
|
121
121
|
contextConfigId?: string | undefined;
|
|
122
122
|
} | {
|
|
123
|
-
tenantId: string;
|
|
124
|
-
projectId: string;
|
|
125
123
|
id: string;
|
|
126
|
-
title: string | null;
|
|
127
|
-
agentId: string | null;
|
|
128
124
|
createdAt: string;
|
|
129
125
|
updatedAt: string;
|
|
130
|
-
userId: string | null;
|
|
131
|
-
metadata: ConversationMetadata | null;
|
|
132
126
|
ref: {
|
|
133
127
|
type: "tag" | "commit" | "branch";
|
|
134
128
|
name: string;
|
|
135
129
|
hash: string;
|
|
136
130
|
} | null;
|
|
131
|
+
userId: string | null;
|
|
132
|
+
metadata: ConversationMetadata | null;
|
|
133
|
+
agentId: string | null;
|
|
134
|
+
projectId: string;
|
|
135
|
+
tenantId: string;
|
|
136
|
+
title: string | null;
|
|
137
137
|
activeSubAgentId: string;
|
|
138
138
|
lastContextResolution: string | null;
|
|
139
139
|
}>;
|
|
@@ -152,20 +152,20 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
|
|
|
152
152
|
scopes: ProjectScopeConfig;
|
|
153
153
|
conversationId: string;
|
|
154
154
|
}) => Promise<{
|
|
155
|
-
tenantId: string;
|
|
156
|
-
projectId: string;
|
|
157
155
|
id: string;
|
|
158
|
-
title: string | null;
|
|
159
|
-
agentId: string | null;
|
|
160
156
|
createdAt: string;
|
|
161
157
|
updatedAt: string;
|
|
162
|
-
userId: string | null;
|
|
163
|
-
metadata: ConversationMetadata | null;
|
|
164
158
|
ref: {
|
|
165
159
|
type: "tag" | "commit" | "branch";
|
|
166
160
|
name: string;
|
|
167
161
|
hash: string;
|
|
168
162
|
} | null;
|
|
163
|
+
userId: string | null;
|
|
164
|
+
metadata: ConversationMetadata | null;
|
|
165
|
+
agentId: string | null;
|
|
166
|
+
projectId: string;
|
|
167
|
+
tenantId: string;
|
|
168
|
+
title: string | null;
|
|
169
169
|
activeSubAgentId: string;
|
|
170
170
|
lastContextResolution: string | null;
|
|
171
171
|
} | undefined>;
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { WorkAppGitHubInstallationStatus } from "../../types/utility.js";
|
|
2
|
+
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
|
|
3
|
+
import { McpTool, ToolSelect, WorkAppGitHubInstallationInsert, WorkAppGitHubInstallationSelect, WorkAppGitHubProjectRepositoryAccessSelect, WorkAppGitHubRepositoryInput, WorkAppGitHubRepositorySelect } from "../../types/entities.js";
|
|
4
|
+
|
|
5
|
+
//#region src/data-access/runtime/github-work-app-installations.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a new GitHub App installation record
|
|
9
|
+
*/
|
|
10
|
+
declare const createInstallation: (db: AgentsRunDatabaseClient) => (input: WorkAppGitHubInstallationInsert) => Promise<WorkAppGitHubInstallationSelect>;
|
|
11
|
+
/**
|
|
12
|
+
* Get installation by GitHub installation ID
|
|
13
|
+
*/
|
|
14
|
+
declare const getInstallationByGitHubId: (db: AgentsRunDatabaseClient) => (gitHubInstallationId: string) => Promise<WorkAppGitHubInstallationSelect | null>;
|
|
15
|
+
/**
|
|
16
|
+
* Get installation by internal ID with tenant validation
|
|
17
|
+
*/
|
|
18
|
+
declare const getInstallationById: (db: AgentsRunDatabaseClient) => (params: {
|
|
19
|
+
tenantId: string;
|
|
20
|
+
id: string;
|
|
21
|
+
}) => Promise<WorkAppGitHubInstallationSelect | null>;
|
|
22
|
+
/**
|
|
23
|
+
* Get all installations for a tenant
|
|
24
|
+
*/
|
|
25
|
+
declare const getInstallationsByTenantId: (db: AgentsRunDatabaseClient) => (params: {
|
|
26
|
+
tenantId: string;
|
|
27
|
+
includeDisconnected?: boolean;
|
|
28
|
+
}) => Promise<WorkAppGitHubInstallationSelect[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Update installation status
|
|
31
|
+
*/
|
|
32
|
+
declare const updateInstallationStatus: (db: AgentsRunDatabaseClient) => (params: {
|
|
33
|
+
tenantId: string;
|
|
34
|
+
id: string;
|
|
35
|
+
status: WorkAppGitHubInstallationStatus;
|
|
36
|
+
}) => Promise<WorkAppGitHubInstallationSelect | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Update installation status by GitHub installation ID (for webhook handlers)
|
|
39
|
+
*/
|
|
40
|
+
declare const updateInstallationStatusByGitHubId: (db: AgentsRunDatabaseClient) => (params: {
|
|
41
|
+
gitHubInstallationId: string;
|
|
42
|
+
status: WorkAppGitHubInstallationStatus;
|
|
43
|
+
}) => Promise<WorkAppGitHubInstallationSelect | null>;
|
|
44
|
+
/**
|
|
45
|
+
* Soft delete an installation (set status to 'disconnected')
|
|
46
|
+
* Also removes all project repository access for this installation's repositories
|
|
47
|
+
*/
|
|
48
|
+
declare const disconnectInstallation: (db: AgentsRunDatabaseClient) => (params: {
|
|
49
|
+
tenantId: string;
|
|
50
|
+
id: string;
|
|
51
|
+
}) => Promise<boolean>;
|
|
52
|
+
/**
|
|
53
|
+
* Delete an installation (hard delete)
|
|
54
|
+
* Returns the deleted installation if found, null otherwise
|
|
55
|
+
*/
|
|
56
|
+
declare const deleteInstallation: (db: AgentsRunDatabaseClient) => (params: {
|
|
57
|
+
tenantId: string;
|
|
58
|
+
id: string;
|
|
59
|
+
}) => Promise<WorkAppGitHubInstallationSelect | null>;
|
|
60
|
+
/**
|
|
61
|
+
* Sync repositories for an installation
|
|
62
|
+
* Adds new repos, removes missing repos, updates existing
|
|
63
|
+
*/
|
|
64
|
+
declare const syncRepositories: (db: AgentsRunDatabaseClient) => (params: {
|
|
65
|
+
installationId: string;
|
|
66
|
+
repositories: WorkAppGitHubRepositoryInput[];
|
|
67
|
+
}) => Promise<{
|
|
68
|
+
added: number;
|
|
69
|
+
removed: number;
|
|
70
|
+
updated: number;
|
|
71
|
+
}>;
|
|
72
|
+
/**
|
|
73
|
+
* Add repositories to an installation (for webhook 'added' events)
|
|
74
|
+
*/
|
|
75
|
+
declare const addRepositories: (db: AgentsRunDatabaseClient) => (params: {
|
|
76
|
+
installationId: string;
|
|
77
|
+
repositories: WorkAppGitHubRepositoryInput[];
|
|
78
|
+
}) => Promise<WorkAppGitHubRepositorySelect[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Remove repositories from an installation (for webhook 'removed' events)
|
|
81
|
+
* Also removes associated project repository access entries
|
|
82
|
+
*/
|
|
83
|
+
declare const removeRepositories: (db: AgentsRunDatabaseClient) => (params: {
|
|
84
|
+
installationId: string;
|
|
85
|
+
repositoryIds: string[];
|
|
86
|
+
}) => Promise<number>;
|
|
87
|
+
/**
|
|
88
|
+
* Get all repositories for an installation
|
|
89
|
+
*/
|
|
90
|
+
declare const getRepositoriesByInstallationId: (db: AgentsRunDatabaseClient) => (installationId: string) => Promise<WorkAppGitHubRepositorySelect[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Get repository by full name (e.g., "org/repo")
|
|
93
|
+
*/
|
|
94
|
+
declare const getRepositoryByFullName: (db: AgentsRunDatabaseClient) => (repositoryFullName: string) => Promise<WorkAppGitHubRepositorySelect | null>;
|
|
95
|
+
/**
|
|
96
|
+
* Get repository by internal ID
|
|
97
|
+
*/
|
|
98
|
+
declare const getRepositoryById: (db: AgentsRunDatabaseClient) => (id: string) => Promise<WorkAppGitHubRepositorySelect | null>;
|
|
99
|
+
/**
|
|
100
|
+
* Get all repositories for a tenant (across all installations)
|
|
101
|
+
*/
|
|
102
|
+
declare const getRepositoriesByTenantId: (db: AgentsRunDatabaseClient) => (tenantId: string) => Promise<(WorkAppGitHubRepositorySelect & {
|
|
103
|
+
installationAccountLogin: string;
|
|
104
|
+
installationId: string;
|
|
105
|
+
})[]>;
|
|
106
|
+
/**
|
|
107
|
+
* Set project repository access (full replacement)
|
|
108
|
+
* Used when mode='selected' to specify which repositories the project can access.
|
|
109
|
+
* Pass empty array to clear all access entries.
|
|
110
|
+
*
|
|
111
|
+
* Also cascades changes to MCP tools: any MCP tool in this project with mode='selected'
|
|
112
|
+
* will have its selected repositories filtered to only include repos that remain
|
|
113
|
+
* in the project's access list.
|
|
114
|
+
*/
|
|
115
|
+
declare const setProjectRepositoryAccess: (db: AgentsRunDatabaseClient) => (params: {
|
|
116
|
+
tenantId: string;
|
|
117
|
+
projectId: string;
|
|
118
|
+
repositoryIds: string[];
|
|
119
|
+
}) => Promise<void>;
|
|
120
|
+
/**
|
|
121
|
+
* Get project repository access entries
|
|
122
|
+
* These entries are used when mode='selected'. Check mode via getProjectAccessMode().
|
|
123
|
+
*/
|
|
124
|
+
declare const getProjectRepositoryAccess: (db: AgentsRunDatabaseClient) => (projectId: string) => Promise<WorkAppGitHubProjectRepositoryAccessSelect[]>;
|
|
125
|
+
/**
|
|
126
|
+
* Get project repository access with full repository details.
|
|
127
|
+
* If project access mode is 'all', returns all tenant repositories.
|
|
128
|
+
* If mode is 'selected' (or not set), returns only explicitly granted repositories.
|
|
129
|
+
*/
|
|
130
|
+
declare const getProjectRepositoryAccessWithDetails: (db: AgentsRunDatabaseClient) => (params: {
|
|
131
|
+
tenantId: string;
|
|
132
|
+
projectId: string;
|
|
133
|
+
}) => Promise<(WorkAppGitHubRepositorySelect & {
|
|
134
|
+
accessId: string;
|
|
135
|
+
installationAccountLogin: string;
|
|
136
|
+
installationId: string;
|
|
137
|
+
})[]>;
|
|
138
|
+
/**
|
|
139
|
+
* Check if a project has access to a specific repository
|
|
140
|
+
* Returns true if:
|
|
141
|
+
* - Project mode is 'all' and repository belongs to tenant installations
|
|
142
|
+
* - Project mode is 'selected' and repository is explicitly in the project's access list
|
|
143
|
+
*/
|
|
144
|
+
declare const checkProjectRepositoryAccess: (db: AgentsRunDatabaseClient) => (params: {
|
|
145
|
+
projectId: string;
|
|
146
|
+
repositoryFullName: string;
|
|
147
|
+
tenantId: string;
|
|
148
|
+
}) => Promise<{
|
|
149
|
+
hasAccess: boolean;
|
|
150
|
+
reason: string;
|
|
151
|
+
}>;
|
|
152
|
+
/**
|
|
153
|
+
* Remove all project repository access for a specific project
|
|
154
|
+
*/
|
|
155
|
+
declare const clearProjectRepositoryAccess: (db: AgentsRunDatabaseClient) => (projectId: string) => Promise<number>;
|
|
156
|
+
/**
|
|
157
|
+
* Validate that all repository IDs belong to installations owned by a tenant
|
|
158
|
+
* Returns list of invalid repository IDs
|
|
159
|
+
*/
|
|
160
|
+
declare const validateRepositoryOwnership: (db: AgentsRunDatabaseClient) => (params: {
|
|
161
|
+
tenantId: string;
|
|
162
|
+
repositoryIds: string[];
|
|
163
|
+
}) => Promise<string[]>;
|
|
164
|
+
/**
|
|
165
|
+
* Get repository count for an installation
|
|
166
|
+
*/
|
|
167
|
+
declare const getRepositoryCount: (db: AgentsRunDatabaseClient) => (installationId: string) => Promise<number>;
|
|
168
|
+
/**
|
|
169
|
+
* Get repository counts for all installations belonging to a tenant
|
|
170
|
+
*/
|
|
171
|
+
declare const getRepositoryCountsByTenantId: (db: AgentsRunDatabaseClient) => (params: {
|
|
172
|
+
tenantId: string;
|
|
173
|
+
includeDisconnected?: boolean;
|
|
174
|
+
}) => Promise<Map<string, number>>;
|
|
175
|
+
/**
|
|
176
|
+
* Set MCP tool repository access (full replacement)
|
|
177
|
+
* Used when mode='selected' to specify which repositories the tool can access.
|
|
178
|
+
* Pass empty array to clear all access entries.
|
|
179
|
+
*/
|
|
180
|
+
declare const setMcpToolRepositoryAccess: (db: AgentsRunDatabaseClient) => (params: {
|
|
181
|
+
toolId: string;
|
|
182
|
+
tenantId: string;
|
|
183
|
+
projectId: string;
|
|
184
|
+
repositoryIds: string[];
|
|
185
|
+
}) => Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Get MCP tool repository access entries
|
|
188
|
+
* These entries are used when mode='selected'. Check mode via getMcpToolAccessMode().
|
|
189
|
+
*/
|
|
190
|
+
declare const getMcpToolRepositoryAccess: (db: AgentsRunDatabaseClient) => (toolId: string) => Promise<{
|
|
191
|
+
id: string;
|
|
192
|
+
toolId: string;
|
|
193
|
+
tenantId: string;
|
|
194
|
+
projectId: string;
|
|
195
|
+
repositoryDbId: string;
|
|
196
|
+
createdAt: string;
|
|
197
|
+
updatedAt: string;
|
|
198
|
+
}[]>;
|
|
199
|
+
/**
|
|
200
|
+
* Get MCP tool repository access with full repository details.
|
|
201
|
+
* If the tool's access mode is 'all', returns all repositories the project has access to.
|
|
202
|
+
* If mode is 'selected' (or not set), returns only explicitly granted repositories.
|
|
203
|
+
*/
|
|
204
|
+
declare const getMcpToolRepositoryAccessWithDetails: (db: AgentsRunDatabaseClient) => (toolId: string) => Promise<(WorkAppGitHubRepositorySelect & {
|
|
205
|
+
accessId: string;
|
|
206
|
+
installationAccountLogin: string;
|
|
207
|
+
installationId: string;
|
|
208
|
+
})[]>;
|
|
209
|
+
/**
|
|
210
|
+
* Remove all MCP tool repository access for a specific tool
|
|
211
|
+
*/
|
|
212
|
+
declare const clearMcpToolRepositoryAccess: (db: AgentsRunDatabaseClient) => (toolId: string) => Promise<number>;
|
|
213
|
+
declare const isGithubWorkAppTool: (tool: ToolSelect | McpTool) => boolean | undefined;
|
|
214
|
+
type WorkAppGitHubAccessMode = 'all' | 'selected';
|
|
215
|
+
/**
|
|
216
|
+
* Set the access mode for a project's GitHub repository access.
|
|
217
|
+
* - 'all': Project has access to all repositories from tenant GitHub installations
|
|
218
|
+
* - 'selected': Project only has access to repositories listed in work_app_github_project_repository_access
|
|
219
|
+
*/
|
|
220
|
+
declare const setProjectAccessMode: (db: AgentsRunDatabaseClient) => (params: {
|
|
221
|
+
tenantId: string;
|
|
222
|
+
projectId: string;
|
|
223
|
+
mode: WorkAppGitHubAccessMode;
|
|
224
|
+
}) => Promise<void>;
|
|
225
|
+
/**
|
|
226
|
+
* Get the access mode for a project's GitHub repository access.
|
|
227
|
+
* Returns 'selected' if no mode is explicitly set (fail-safe default).
|
|
228
|
+
*/
|
|
229
|
+
declare const getProjectAccessMode: (db: AgentsRunDatabaseClient) => (params: {
|
|
230
|
+
tenantId: string;
|
|
231
|
+
projectId: string;
|
|
232
|
+
}) => Promise<WorkAppGitHubAccessMode>;
|
|
233
|
+
/**
|
|
234
|
+
* Delete the access mode entry for a project
|
|
235
|
+
*/
|
|
236
|
+
declare const deleteProjectAccessMode: (db: AgentsRunDatabaseClient) => (params: {
|
|
237
|
+
tenantId: string;
|
|
238
|
+
projectId: string;
|
|
239
|
+
}) => Promise<boolean>;
|
|
240
|
+
/**
|
|
241
|
+
* Set the access mode for an MCP tool's GitHub repository access.
|
|
242
|
+
* - 'all': Tool has access to all repositories the project has access to
|
|
243
|
+
* - 'selected': Tool only has access to repositories listed in work_app_github_mcp_tool_repository_access
|
|
244
|
+
*/
|
|
245
|
+
declare const setMcpToolAccessMode: (db: AgentsRunDatabaseClient) => (params: {
|
|
246
|
+
toolId: string;
|
|
247
|
+
tenantId: string;
|
|
248
|
+
projectId: string;
|
|
249
|
+
mode: WorkAppGitHubAccessMode;
|
|
250
|
+
}) => Promise<void>;
|
|
251
|
+
/**
|
|
252
|
+
* Get the access mode for an MCP tool's GitHub repository access.
|
|
253
|
+
* Returns 'selected' if no mode is explicitly set (fail-safe default).
|
|
254
|
+
*/
|
|
255
|
+
declare const getMcpToolAccessMode: (db: AgentsRunDatabaseClient) => (toolId: string) => Promise<WorkAppGitHubAccessMode>;
|
|
256
|
+
/**
|
|
257
|
+
* Delete the access mode entry for an MCP tool
|
|
258
|
+
*/
|
|
259
|
+
declare const deleteMcpToolAccessMode: (db: AgentsRunDatabaseClient) => (toolId: string) => Promise<boolean>;
|
|
260
|
+
//#endregion
|
|
261
|
+
export { WorkAppGitHubAccessMode, addRepositories, checkProjectRepositoryAccess, clearMcpToolRepositoryAccess, clearProjectRepositoryAccess, createInstallation, deleteInstallation, deleteMcpToolAccessMode, deleteProjectAccessMode, disconnectInstallation, getInstallationByGitHubId, getInstallationById, getInstallationsByTenantId, getMcpToolAccessMode, getMcpToolRepositoryAccess, getMcpToolRepositoryAccessWithDetails, getProjectAccessMode, getProjectRepositoryAccess, getProjectRepositoryAccessWithDetails, getRepositoriesByInstallationId, getRepositoriesByTenantId, getRepositoryByFullName, getRepositoryById, getRepositoryCount, getRepositoryCountsByTenantId, isGithubWorkAppTool, removeRepositories, setMcpToolAccessMode, setMcpToolRepositoryAccess, setProjectAccessMode, setProjectRepositoryAccess, syncRepositories, updateInstallationStatus, updateInstallationStatusByGitHubId, validateRepositoryOwnership };
|