@taico/shared 0.2.0 → 0.2.6
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.
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const BASELINE_SYSTEM_TOOL_PROVIDED_IDS: readonly ["tasks", "context"];
|
|
2
|
+
export declare const BASELINE_AGENT_EXECUTION_SCOPES: readonly ["meta:read", "mcp:use", "tasks:read", "tasks:write", "context:read", "context:write"];
|
|
3
|
+
export declare const DEFAULT_AGENT_ALLOWED_TOOLS: readonly ["SlashCommand", "Bash", "Read", "Write", "Edit"];
|
|
4
|
+
export type AgentRuntimeScopeLike = {
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
export type AgentRuntimeToolPermissionLike = {
|
|
8
|
+
server: {
|
|
9
|
+
providedId: string;
|
|
10
|
+
};
|
|
11
|
+
grantedScopes: AgentRuntimeScopeLike[];
|
|
12
|
+
};
|
|
13
|
+
export declare function deriveExecutionScopesFromToolPermissions(permissions: AgentRuntimeToolPermissionLike[]): string[];
|
|
14
|
+
export declare function deriveAllowedToolsFromProvidedIds(providedIds: string[], alwaysAllowedTools?: readonly string[]): string[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const BASELINE_SYSTEM_TOOL_PROVIDED_IDS = ['tasks', 'context'];
|
|
2
|
+
export const BASELINE_AGENT_EXECUTION_SCOPES = [
|
|
3
|
+
'meta:read',
|
|
4
|
+
'mcp:use',
|
|
5
|
+
'tasks:read',
|
|
6
|
+
'tasks:write',
|
|
7
|
+
'context:read',
|
|
8
|
+
'context:write',
|
|
9
|
+
];
|
|
10
|
+
export const DEFAULT_AGENT_ALLOWED_TOOLS = [
|
|
11
|
+
'SlashCommand',
|
|
12
|
+
'Bash',
|
|
13
|
+
'Read',
|
|
14
|
+
'Write',
|
|
15
|
+
'Edit',
|
|
16
|
+
];
|
|
17
|
+
export function deriveExecutionScopesFromToolPermissions(permissions) {
|
|
18
|
+
const scopes = new Set(BASELINE_AGENT_EXECUTION_SCOPES);
|
|
19
|
+
for (const permission of permissions) {
|
|
20
|
+
for (const scope of permission.grantedScopes) {
|
|
21
|
+
scopes.add(scope.id);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return [...scopes].sort((a, b) => a.localeCompare(b));
|
|
25
|
+
}
|
|
26
|
+
export function deriveAllowedToolsFromProvidedIds(providedIds, alwaysAllowedTools = DEFAULT_AGENT_ALLOWED_TOOLS) {
|
|
27
|
+
const tools = new Set(alwaysAllowedTools);
|
|
28
|
+
for (const providedId of providedIds) {
|
|
29
|
+
tools.add(`mcp__${providedId}__*`);
|
|
30
|
+
}
|
|
31
|
+
return [...tools];
|
|
32
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export declare const INTERNAL_WORKER_AUTH_TARGET_NAME = "Taico Worker";
|
|
|
8
8
|
export declare const INTERNAL_WORKER_AUTH_TARGET_DESCRIPTION = "Internal OAuth target for Taico worker bootstrap.";
|
|
9
9
|
export declare const INTERNAL_WORKER_AUTH_SCOPES: Scope[];
|
|
10
10
|
export declare const DEFAULT_AGENT_TOKEN_SCOPES: readonly ["meta:read", "meta:write", "tasks:read", "tasks:write", "context:read", "context:write", "agents:read", "run:read", "run:write", "threads:read", "threads:write", "mcp-registry:read", "mcp:use", "secret:read"];
|
|
11
|
+
export * from './agent-runtime-permissions.js';
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,10 @@ export const INTERNAL_WORKER_AUTH_SCOPES = [
|
|
|
31
31
|
id: 'meta:read',
|
|
32
32
|
description: 'Read meta information (tags, etc.)',
|
|
33
33
|
},
|
|
34
|
+
{
|
|
35
|
+
id: 'mcp-registry:read',
|
|
36
|
+
description: 'Allows workers to read MCP server registry metadata.',
|
|
37
|
+
},
|
|
34
38
|
];
|
|
35
39
|
export const DEFAULT_AGENT_TOKEN_SCOPES = [
|
|
36
40
|
'meta:read',
|
|
@@ -48,3 +52,4 @@ export const DEFAULT_AGENT_TOKEN_SCOPES = [
|
|
|
48
52
|
'mcp:use',
|
|
49
53
|
'secret:read',
|
|
50
54
|
];
|
|
55
|
+
export * from './agent-runtime-permissions.js';
|