aiblueprint-cli 1.4.46 → 1.4.48
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/{claude-code-config → ai-config}/.claude-plugin/plugin.json +2 -2
- package/ai-config/scripts/CLAUDE.md +31 -0
- package/{claude-code-config → ai-config}/scripts/package.json +1 -8
- package/ai-config/skills/codex-environment/SKILL.md +182 -0
- package/dist/cli.js +932 -768
- package/package.json +2 -2
- package/claude-code-config/hooks/hooks.json +0 -15
- package/claude-code-config/scripts/CLAUDE.md +0 -50
- package/claude-code-config/scripts/command-validator/CLAUDE.md +0 -112
- package/claude-code-config/scripts/command-validator/README.md +0 -147
- package/claude-code-config/scripts/command-validator/src/__tests__/validator.test.ts +0 -99
- package/claude-code-config/scripts/command-validator/src/cli.ts +0 -120
- package/claude-code-config/scripts/command-validator/src/lib/security-rules.ts +0 -174
- package/claude-code-config/scripts/command-validator/src/lib/types.ts +0 -34
- package/claude-code-config/scripts/command-validator/src/lib/validator.ts +0 -90
- package/claude-code-config/song/finish.mp3 +0 -0
- package/claude-code-config/song/need-human.mp3 +0 -0
- /package/{claude-code-config → ai-config}/agents/action.md +0 -0
- /package/{claude-code-config → ai-config}/agents/explore-codebase.md +0 -0
- /package/{claude-code-config → ai-config}/agents/explore-docs.md +0 -0
- /package/{claude-code-config → ai-config}/agents/websearch.md +0 -0
- /package/{claude-code-config → ai-config}/scripts/.claude/commands/fix-on-my-computer.md +0 -0
- /package/{claude-code-config → ai-config}/scripts/biome.json +0 -0
- /package/{claude-code-config → ai-config}/scripts/bun.lockb +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/CLAUDE.md +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/README.md +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/__tests__/context.test.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/__tests__/formatters.test.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/__tests__/statusline.test.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/data/.gitignore +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/data/.gitkeep +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/defaults.json +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/docs/ARCHITECTURE.md +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/fixtures/mock-transcript.jsonl +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/fixtures/test-input.json +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/index.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/config-types.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/config.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/context.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/formatters.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/git.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/menu-factories.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/presets.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/render-pure.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/types.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/utils.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/tests/spend-v2.test.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/statusline.config.json +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/test-with-fixtures.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/test.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/tsconfig.json +0 -0
- /package/{claude-code-config → ai-config}/scripts/tsconfig.json +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/scripts/setup-templates.sh +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/scripts/update-progress.sh +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-00-init.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-00b-branch.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-00b-economy.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-00b-interactive.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-01-analyze.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-02-plan.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-03-execute.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-04-validate.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/00-context.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/01-analyze.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/02-plan.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/03-execute.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/04-validate.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/README.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/step-complete.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/comprehensive-example.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/optimize-guide.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/project-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/prompting-techniques.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/rules-directory-guide.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/section-templates.md +0 -0
- /package/{claude-code-config → ai-config}/skills/commit/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/create-pr/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/fix-errors/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/fix-grammar/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/fix-pr-comments/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/merge/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/oneshot/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/anthropic-best-practices.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/anti-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/clarity-principles.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/context-management.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/few-shot-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/openai-best-practices.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/prompt-templates.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/reasoning-techniques.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/system-prompt-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/xml-structure.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/scripts/setup.sh +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/steps/step-00-init.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/steps/step-01-interactive-prd.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/steps/step-02-create-stories.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/steps/step-03-finish.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/LICENSE.txt +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/package.json +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/output-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/progressive-disclosure-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/prompting-integration.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/real-world-examples.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/script-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/workflows.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/xml-tag-guide.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/scripts/init-skill.ts +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/scripts/package-skill.ts +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/scripts/validate.ts +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/context-management.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/debugging-agents.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/error-handling-and-recovery.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/evaluation-and-testing.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/orchestration-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/subagents.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/writing-subagent-prompts.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ultrathink/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/scripts/setup-templates.sh +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/scripts/update-progress.sh +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-00-init.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-00b-branch.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-00b-economy.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-00b-interactive.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-01-analyze.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-02-plan.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-03-execute.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-04-validate.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/00-context.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/01-analyze.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/02-plan.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/03-execute.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/04-validate.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/README.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/step-complete.md +0 -0
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { homedir } from "node:os";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import type { SecurityRules } from "./types";
|
|
4
|
-
|
|
5
|
-
export const SECURITY_RULES: SecurityRules = {
|
|
6
|
-
CRITICAL_COMMANDS: [
|
|
7
|
-
"del",
|
|
8
|
-
"format",
|
|
9
|
-
"mkfs",
|
|
10
|
-
"shred",
|
|
11
|
-
"dd",
|
|
12
|
-
"fdisk",
|
|
13
|
-
"parted",
|
|
14
|
-
"gparted",
|
|
15
|
-
"cfdisk",
|
|
16
|
-
],
|
|
17
|
-
|
|
18
|
-
PRIVILEGE_COMMANDS: [
|
|
19
|
-
"sudo",
|
|
20
|
-
"su",
|
|
21
|
-
"passwd",
|
|
22
|
-
"chpasswd",
|
|
23
|
-
"usermod",
|
|
24
|
-
"chmod",
|
|
25
|
-
"chown",
|
|
26
|
-
"chgrp",
|
|
27
|
-
"setuid",
|
|
28
|
-
"setgid",
|
|
29
|
-
],
|
|
30
|
-
|
|
31
|
-
NETWORK_COMMANDS: [
|
|
32
|
-
"nc",
|
|
33
|
-
"netcat",
|
|
34
|
-
"nmap",
|
|
35
|
-
"telnet",
|
|
36
|
-
"ssh-keygen",
|
|
37
|
-
"iptables",
|
|
38
|
-
"ufw",
|
|
39
|
-
"firewall-cmd",
|
|
40
|
-
"ipfw",
|
|
41
|
-
],
|
|
42
|
-
|
|
43
|
-
SYSTEM_COMMANDS: [
|
|
44
|
-
"systemctl",
|
|
45
|
-
"service",
|
|
46
|
-
"kill",
|
|
47
|
-
"killall",
|
|
48
|
-
"pkill",
|
|
49
|
-
"mount",
|
|
50
|
-
"umount",
|
|
51
|
-
"swapon",
|
|
52
|
-
"swapoff",
|
|
53
|
-
],
|
|
54
|
-
|
|
55
|
-
DANGEROUS_PATTERNS: [
|
|
56
|
-
/rm\s+.*-rf\s*\/\s*$/i,
|
|
57
|
-
/rm\s+.*-rf\s*\/etc/i,
|
|
58
|
-
/rm\s+.*-rf\s*\/usr/i,
|
|
59
|
-
/rm\s+.*-rf\s*\/bin/i,
|
|
60
|
-
/rm\s+.*-rf\s*\/sys/i,
|
|
61
|
-
/rm\s+.*-rf\s*\/proc/i,
|
|
62
|
-
/rm\s+.*-rf\s*\/boot/i,
|
|
63
|
-
/rm\s+.*-rf\s*\/home\/[^/]*\s*$/i,
|
|
64
|
-
/rm\s+.*-rf\s*\.\.+\//i,
|
|
65
|
-
/rm\s+.*-rf\s*\*.*\*/i,
|
|
66
|
-
/rm\s+.*-rf\s*\$\w+/i,
|
|
67
|
-
/>\s*\/dev\/(sda|hda|nvme)/i,
|
|
68
|
-
/dd\s+.*of=\/dev\//i,
|
|
69
|
-
/shred\s+.*\/dev\//i,
|
|
70
|
-
/mkfs\.\w+\s+\/dev\//i,
|
|
71
|
-
/:\(\)\{\s*:\|:&\s*\};:/,
|
|
72
|
-
/while\s+true\s*;\s*do.*done/i,
|
|
73
|
-
/for\s*\(\(\s*;\s*;\s*\)\)/i,
|
|
74
|
-
/\|\s*(sh|bash|zsh|fish)$/i,
|
|
75
|
-
/(wget|curl)\s+.*\|\s*(sh|bash)/i,
|
|
76
|
-
/(wget|curl)\s+.*-O-.*\|\s*(sh|bash)/i,
|
|
77
|
-
/`.*rm.*`/i,
|
|
78
|
-
/\$\(.*rm.*\)/i,
|
|
79
|
-
/`.*dd.*`/i,
|
|
80
|
-
/\$\(.*dd.*\)/i,
|
|
81
|
-
/cat\s+\/etc\/(passwd|shadow|sudoers)/i,
|
|
82
|
-
/>\s*\/etc\/(passwd|shadow|sudoers)/i,
|
|
83
|
-
/echo\s+.*>>\s*\/etc\/(passwd|shadow|sudoers)/i,
|
|
84
|
-
/\|\s*nc\s+\S+\s+\d+/i,
|
|
85
|
-
/curl\s+.*-d.*\$\(/i,
|
|
86
|
-
/wget\s+.*--post-data.*\$\(/i,
|
|
87
|
-
/>\s*\/var\/log\//i,
|
|
88
|
-
/rm\s+\/var\/log\//i,
|
|
89
|
-
/echo\s+.*>\s*~?\/?\.bash_history/i,
|
|
90
|
-
/nc\s+.*-l.*-e/i,
|
|
91
|
-
/nc\s+.*-e.*-l/i,
|
|
92
|
-
/ncat\s+.*--exec/i,
|
|
93
|
-
/ssh-keygen.*authorized_keys/i,
|
|
94
|
-
/(wget|curl).*\.(sh|py|pl|exe|bin).*\|\s*(sh|bash|python)/i,
|
|
95
|
-
/(xmrig|ccminer|cgminer|bfgminer)/i,
|
|
96
|
-
/cat\s+\/dev\/(mem|kmem)/i,
|
|
97
|
-
/echo\s+.*>\s*\/dev\/(mem|kmem)/i,
|
|
98
|
-
/(insmod|rmmod|modprobe)\s+/i,
|
|
99
|
-
/crontab\s+-e/i,
|
|
100
|
-
/echo\s+.*>>\s*\/var\/spool\/cron/i,
|
|
101
|
-
/env\s*\|\s*grep.*PASSWORD/i,
|
|
102
|
-
/printenv.*PASSWORD/i,
|
|
103
|
-
/docker\s+(rm|rmi|kill|stop)\s+.*\$\(/i,
|
|
104
|
-
/docker\s+system\s+prune.*-a/i,
|
|
105
|
-
/docker\s+container\s+prune.*-f/i,
|
|
106
|
-
/docker\s+volume\s+rm.*\$\(/i,
|
|
107
|
-
/docker\s+network\s+rm.*\$\(/i,
|
|
108
|
-
/prisma\s+(migrate\s+reset|db\s+push\s+--force-reset)/i,
|
|
109
|
-
],
|
|
110
|
-
|
|
111
|
-
PROTECTED_PATHS: [
|
|
112
|
-
"/etc/",
|
|
113
|
-
"/usr/",
|
|
114
|
-
"/sbin/",
|
|
115
|
-
"/boot/",
|
|
116
|
-
"/sys/",
|
|
117
|
-
"/proc/",
|
|
118
|
-
"/dev/",
|
|
119
|
-
"/root/",
|
|
120
|
-
],
|
|
121
|
-
|
|
122
|
-
SAFE_EXECUTABLE_PATHS: [
|
|
123
|
-
"/Applications/",
|
|
124
|
-
"/usr/local/bin/",
|
|
125
|
-
"/usr/bin/",
|
|
126
|
-
"/bin/",
|
|
127
|
-
"/opt/",
|
|
128
|
-
],
|
|
129
|
-
|
|
130
|
-
SAFE_RM_PATHS: [
|
|
131
|
-
join(homedir(), "Developer/"),
|
|
132
|
-
"/tmp/",
|
|
133
|
-
"/var/tmp/",
|
|
134
|
-
`${process.cwd()}/`,
|
|
135
|
-
],
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
export const SAFE_COMMANDS = [
|
|
139
|
-
"ls",
|
|
140
|
-
"dir",
|
|
141
|
-
"pwd",
|
|
142
|
-
"whoami",
|
|
143
|
-
"date",
|
|
144
|
-
"echo",
|
|
145
|
-
"cat",
|
|
146
|
-
"head",
|
|
147
|
-
"tail",
|
|
148
|
-
"grep",
|
|
149
|
-
"find",
|
|
150
|
-
"wc",
|
|
151
|
-
"sort",
|
|
152
|
-
"uniq",
|
|
153
|
-
"cut",
|
|
154
|
-
"awk",
|
|
155
|
-
"sed",
|
|
156
|
-
"git",
|
|
157
|
-
"npm",
|
|
158
|
-
"pnpm",
|
|
159
|
-
"node",
|
|
160
|
-
"bun",
|
|
161
|
-
"python",
|
|
162
|
-
"pip",
|
|
163
|
-
"source",
|
|
164
|
-
"cd",
|
|
165
|
-
"cp",
|
|
166
|
-
"mv",
|
|
167
|
-
"mkdir",
|
|
168
|
-
"touch",
|
|
169
|
-
"ln",
|
|
170
|
-
"psql",
|
|
171
|
-
"mysql",
|
|
172
|
-
"sqlite3",
|
|
173
|
-
"mongo",
|
|
174
|
-
];
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export interface HookInput {
|
|
2
|
-
tool_name: string;
|
|
3
|
-
tool_input: {
|
|
4
|
-
command?: string;
|
|
5
|
-
};
|
|
6
|
-
session_id?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface ValidationResult {
|
|
10
|
-
isValid: boolean;
|
|
11
|
-
severity: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL";
|
|
12
|
-
violations: string[];
|
|
13
|
-
sanitizedCommand: string;
|
|
14
|
-
action: "allow" | "deny" | "ask";
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface SecurityRules {
|
|
18
|
-
CRITICAL_COMMANDS: string[];
|
|
19
|
-
PRIVILEGE_COMMANDS: string[];
|
|
20
|
-
NETWORK_COMMANDS: string[];
|
|
21
|
-
SYSTEM_COMMANDS: string[];
|
|
22
|
-
DANGEROUS_PATTERNS: RegExp[];
|
|
23
|
-
PROTECTED_PATHS: string[];
|
|
24
|
-
SAFE_EXECUTABLE_PATHS: string[];
|
|
25
|
-
SAFE_RM_PATHS: string[];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface HookOutput {
|
|
29
|
-
hookSpecificOutput: {
|
|
30
|
-
hookEventName: string;
|
|
31
|
-
permissionDecision: "allow" | "block" | "ask";
|
|
32
|
-
permissionDecisionReason: string;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { ValidationResult } from "./types";
|
|
2
|
-
|
|
3
|
-
const DANGEROUS_COMMANDS = [
|
|
4
|
-
"sudo",
|
|
5
|
-
"su",
|
|
6
|
-
"chmod",
|
|
7
|
-
"chown",
|
|
8
|
-
"dd",
|
|
9
|
-
"mkfs",
|
|
10
|
-
"fdisk",
|
|
11
|
-
"kill",
|
|
12
|
-
"killall",
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
export class CommandValidator {
|
|
16
|
-
validate(command: string, _toolName = "Unknown"): ValidationResult {
|
|
17
|
-
const result: ValidationResult = {
|
|
18
|
-
isValid: true,
|
|
19
|
-
severity: "LOW",
|
|
20
|
-
violations: [],
|
|
21
|
-
sanitizedCommand: command,
|
|
22
|
-
action: "allow",
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
if (!command || typeof command !== "string") {
|
|
26
|
-
result.isValid = false;
|
|
27
|
-
result.violations.push("Invalid command format");
|
|
28
|
-
result.action = "deny";
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// rm -rf → DENY (blocked completely)
|
|
33
|
-
if (this.containsRmRf(command)) {
|
|
34
|
-
result.isValid = false;
|
|
35
|
-
result.severity = "CRITICAL";
|
|
36
|
-
result.violations.push("rm -rf is forbidden - use trash instead");
|
|
37
|
-
result.action = "deny";
|
|
38
|
-
return result;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Other dangerous commands → ASK (ask for permission)
|
|
42
|
-
const dangerousCmd = this.containsDangerousCommand(command);
|
|
43
|
-
if (dangerousCmd) {
|
|
44
|
-
result.isValid = false;
|
|
45
|
-
result.severity = "HIGH";
|
|
46
|
-
result.violations.push(`Potentially dangerous command: ${dangerousCmd}`);
|
|
47
|
-
result.action = "ask";
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
containsRmRf(command: string): boolean {
|
|
55
|
-
// Check for rm -rf in any form (rm -rf, rm -fr, rm -r -f, etc.)
|
|
56
|
-
const rmRfPatterns = [
|
|
57
|
-
/\brm\s+(-[a-zA-Z]*r[a-zA-Z]*f[a-zA-Z]*|-[a-zA-Z]*f[a-zA-Z]*r[a-zA-Z]*)\s/i,
|
|
58
|
-
/\brm\s+-r\s+-f\s/i,
|
|
59
|
-
/\brm\s+-f\s+-r\s/i,
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
for (const pattern of rmRfPatterns) {
|
|
63
|
-
if (pattern.test(command)) {
|
|
64
|
-
return true;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
containsDangerousCommand(command: string): string | null {
|
|
72
|
-
const normalizedCmd = command.trim().toLowerCase();
|
|
73
|
-
const parts = normalizedCmd.split(/\s+/);
|
|
74
|
-
const mainCommand = parts[0].split("/").pop() || "";
|
|
75
|
-
|
|
76
|
-
if (DANGEROUS_COMMANDS.includes(mainCommand)) {
|
|
77
|
-
return mainCommand;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Check in chained commands
|
|
81
|
-
for (const dangerous of DANGEROUS_COMMANDS) {
|
|
82
|
-
const pattern = new RegExp(`\\b${dangerous}\\b`, "i");
|
|
83
|
-
if (pattern.test(command)) {
|
|
84
|
-
return dangerous;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/claude-memory/references/comprehensive-example.md
RENAMED
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/claude-memory/references/project-patterns.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/claude-memory/references/prompting-techniques.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/claude-memory/references/rules-directory-guide.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/claude-memory/references/section-templates.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/prompt-creator/references/clarity-principles.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/prompt-creator/references/context-management.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/prompt-creator/references/few-shot-patterns.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/prompt-creator/references/openai-best-practices.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/prompt-creator/references/prompt-templates.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/prompt-creator/references/reasoning-techniques.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/prompt-creator/references/system-prompt-patterns.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/ralph-loop/steps/step-01-interactive-prd.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/skill-creator/references/output-patterns.md
RENAMED
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/skill-creator/references/prompting-integration.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/skill-creator/references/real-world-examples.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/skill-creator/references/script-patterns.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/subagent-creator/references/context-management.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/subagent-creator/references/debugging-agents.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/workflow-apex-free/scripts/setup-templates.sh
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/workflow-apex-free/scripts/update-progress.sh
RENAMED
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-00b-branch.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-00b-economy.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-00b-interactive.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-01-analyze.md
RENAMED
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-03-execute.md
RENAMED
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-04-validate.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/04-validate.md
RENAMED
|
File without changes
|
|
File without changes
|
/package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/step-complete.md
RENAMED
|
File without changes
|