claudenv 1.1.0 → 1.2.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/README.md +163 -11
- package/bin/cli.js +167 -1
- package/package.json +1 -1
- package/scaffold/.claude/commands/improve.md +60 -0
- package/scaffold/global/.claude/commands/claudenv.md +3 -0
- package/scaffold/global/.claude/commands/improve.md +60 -0
- package/scaffold/global/.claude/skills/claudenv/SKILL.md +1 -0
- package/scaffold/global/.claude/skills/claudenv/scaffold/.claude/commands/improve.md +60 -0
- package/src/autonomy.js +117 -0
- package/src/hooks-gen.js +279 -0
- package/src/index.js +4 -0
- package/src/installer.js +2 -0
- package/src/loop.js +617 -0
- package/src/profiles.js +113 -0
package/src/profiles.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// =============================================
|
|
2
|
+
// Autonomy profiles — permission presets for Claude Code
|
|
3
|
+
// =============================================
|
|
4
|
+
|
|
5
|
+
export const CREDENTIAL_PATHS = [
|
|
6
|
+
'~/.ssh',
|
|
7
|
+
'~/.aws',
|
|
8
|
+
'~/.gnupg',
|
|
9
|
+
'~/.npmrc',
|
|
10
|
+
'~/.pypirc',
|
|
11
|
+
'~/.git-credentials',
|
|
12
|
+
'~/.docker/config.json',
|
|
13
|
+
'~/.kube',
|
|
14
|
+
'~/Library/Keychains',
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export const AUTONOMY_PROFILES = {
|
|
18
|
+
safe: {
|
|
19
|
+
name: 'safe',
|
|
20
|
+
description: 'Read-only + limited bash — safe for exploration',
|
|
21
|
+
allowedTools: [
|
|
22
|
+
'Read',
|
|
23
|
+
'Glob',
|
|
24
|
+
'Grep',
|
|
25
|
+
'Bash(ls *)',
|
|
26
|
+
'Bash(cat *)',
|
|
27
|
+
'Bash(git status)',
|
|
28
|
+
'Bash(git log *)',
|
|
29
|
+
'Bash(git diff *)',
|
|
30
|
+
],
|
|
31
|
+
disallowedTools: [
|
|
32
|
+
'Bash(rm *)',
|
|
33
|
+
'Bash(sudo *)',
|
|
34
|
+
'Edit',
|
|
35
|
+
'Write',
|
|
36
|
+
],
|
|
37
|
+
skipPermissions: false,
|
|
38
|
+
credentialPolicy: 'block',
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
moderate: {
|
|
42
|
+
name: 'moderate',
|
|
43
|
+
description: 'Full development with deny-list — safe for most development work',
|
|
44
|
+
allowedTools: [
|
|
45
|
+
'Read',
|
|
46
|
+
'Edit',
|
|
47
|
+
'Write',
|
|
48
|
+
'Glob',
|
|
49
|
+
'Grep',
|
|
50
|
+
'Bash(npm *)',
|
|
51
|
+
'Bash(npx *)',
|
|
52
|
+
'Bash(git *)',
|
|
53
|
+
'Bash(node *)',
|
|
54
|
+
'Bash(python3 *)',
|
|
55
|
+
'Bash(pip *)',
|
|
56
|
+
],
|
|
57
|
+
disallowedTools: [
|
|
58
|
+
'Bash(rm -rf *)',
|
|
59
|
+
'Bash(rm -fr *)',
|
|
60
|
+
'Bash(sudo *)',
|
|
61
|
+
'Bash(git push --force *)',
|
|
62
|
+
'Bash(git push -f *)',
|
|
63
|
+
'Bash(git reset --hard *)',
|
|
64
|
+
'Bash(chmod 777 *)',
|
|
65
|
+
'Bash(dd *)',
|
|
66
|
+
'Bash(mkfs *)',
|
|
67
|
+
],
|
|
68
|
+
skipPermissions: false,
|
|
69
|
+
credentialPolicy: 'block',
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
full: {
|
|
73
|
+
name: 'full',
|
|
74
|
+
description: 'Full autonomy — unrestricted access with audit logging',
|
|
75
|
+
allowedTools: [],
|
|
76
|
+
disallowedTools: [],
|
|
77
|
+
skipPermissions: true,
|
|
78
|
+
credentialPolicy: 'warn',
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
ci: {
|
|
82
|
+
name: 'ci',
|
|
83
|
+
description: 'Headless CI/CD mode — full autonomy with turn/budget limits',
|
|
84
|
+
allowedTools: [],
|
|
85
|
+
disallowedTools: [],
|
|
86
|
+
skipPermissions: true,
|
|
87
|
+
credentialPolicy: 'warn',
|
|
88
|
+
maxTurns: 50,
|
|
89
|
+
maxBudget: 5.0,
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Get a profile by name. Throws if not found.
|
|
95
|
+
* @param {string} name
|
|
96
|
+
* @returns {object}
|
|
97
|
+
*/
|
|
98
|
+
export function getProfile(name) {
|
|
99
|
+
const profile = AUTONOMY_PROFILES[name];
|
|
100
|
+
if (!profile) {
|
|
101
|
+
const valid = Object.keys(AUTONOMY_PROFILES).join(', ');
|
|
102
|
+
throw new Error(`Unknown autonomy profile: "${name}". Valid profiles: ${valid}`);
|
|
103
|
+
}
|
|
104
|
+
return profile;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* List all profiles with name and description.
|
|
109
|
+
* @returns {Array<{name: string, description: string}>}
|
|
110
|
+
*/
|
|
111
|
+
export function listProfiles() {
|
|
112
|
+
return Object.values(AUTONOMY_PROFILES).map(({ name, description }) => ({ name, description }));
|
|
113
|
+
}
|