@doingdev/opencode-claude-manager-plugin 0.1.17 → 0.1.18
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.
|
@@ -7,6 +7,22 @@ const defaultFacade = {
|
|
|
7
7
|
};
|
|
8
8
|
const TOOL_INPUT_PREVIEW_MAX = 2000;
|
|
9
9
|
const USER_MESSAGE_MAX = 4000;
|
|
10
|
+
/**
|
|
11
|
+
* Ensures the Claude Agent SDK Skill tool is pre-approved per
|
|
12
|
+
* https://docs.anthropic.com/en/docs/claude-code/sdk/skills
|
|
13
|
+
* Subagents inherit the parent session tool surface unless given a narrower `tools` list.
|
|
14
|
+
*/
|
|
15
|
+
function mergeSkillIntoAllowedTools(allowedTools, disallowedTools) {
|
|
16
|
+
if (disallowedTools?.includes('Skill')) {
|
|
17
|
+
return allowedTools;
|
|
18
|
+
}
|
|
19
|
+
if (allowedTools === undefined) {
|
|
20
|
+
return ['Skill'];
|
|
21
|
+
}
|
|
22
|
+
return allowedTools.includes('Skill')
|
|
23
|
+
? allowedTools
|
|
24
|
+
: [...allowedTools, 'Skill'];
|
|
25
|
+
}
|
|
10
26
|
export class ClaudeAgentSdkAdapter {
|
|
11
27
|
sdkFacade;
|
|
12
28
|
approvalManager;
|
|
@@ -141,7 +157,7 @@ export class ClaudeAgentSdkAdapter {
|
|
|
141
157
|
const options = {
|
|
142
158
|
cwd: input.cwd,
|
|
143
159
|
tools: { type: 'preset', preset: 'claude_code' },
|
|
144
|
-
allowedTools: input.allowedTools,
|
|
160
|
+
allowedTools: mergeSkillIntoAllowedTools(input.allowedTools, input.disallowedTools),
|
|
145
161
|
disallowedTools: input.disallowedTools,
|
|
146
162
|
continue: input.continueSession,
|
|
147
163
|
resume: input.resumeSessionId,
|
|
@@ -90,6 +90,12 @@ function getDefaultRules() {
|
|
|
90
90
|
description: 'Allow bash commands (after dangerous patterns filtered)',
|
|
91
91
|
},
|
|
92
92
|
// Agent / misc
|
|
93
|
+
{
|
|
94
|
+
id: 'allow-skill',
|
|
95
|
+
toolPattern: 'Skill',
|
|
96
|
+
action: 'allow',
|
|
97
|
+
description: 'Allow Agent Skills (filesystem SKILL.md)',
|
|
98
|
+
},
|
|
93
99
|
{
|
|
94
100
|
id: 'allow-agent',
|
|
95
101
|
toolPattern: 'Agent',
|
|
@@ -65,6 +65,7 @@ export interface RunClaudeSessionInput {
|
|
|
65
65
|
effort?: 'low' | 'medium' | 'high' | 'max';
|
|
66
66
|
mode?: SessionMode;
|
|
67
67
|
permissionMode?: 'default' | 'acceptEdits' | 'plan' | 'dontAsk';
|
|
68
|
+
/** Merged with `Skill` by the SDK adapter unless `Skill` appears in `disallowedTools`. */
|
|
68
69
|
allowedTools?: string[];
|
|
69
70
|
disallowedTools?: string[];
|
|
70
71
|
continueSession?: boolean;
|