antigravity-ai-kit 2.1.0 → 3.0.1
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/.agent/README.md +4 -4
- package/.agent/agents/README.md +16 -12
- package/.agent/agents/architect.md +1 -0
- package/.agent/agents/backend-specialist.md +11 -0
- package/.agent/agents/code-reviewer.md +1 -0
- package/.agent/agents/database-architect.md +11 -0
- package/.agent/agents/devops-engineer.md +11 -0
- package/.agent/agents/e2e-runner.md +1 -0
- package/.agent/agents/explorer-agent.md +11 -0
- package/.agent/agents/frontend-specialist.md +11 -0
- package/.agent/agents/mobile-developer.md +11 -0
- package/.agent/agents/performance-optimizer.md +11 -0
- package/.agent/agents/planner.md +1 -0
- package/.agent/agents/refactor-cleaner.md +1 -0
- package/.agent/agents/reliability-engineer.md +11 -0
- package/.agent/agents/security-reviewer.md +1 -0
- package/.agent/agents/sprint-orchestrator.md +10 -0
- package/.agent/agents/tdd-guide.md +1 -0
- package/.agent/commands/code-review.md +1 -0
- package/.agent/commands/debug.md +1 -0
- package/.agent/commands/deploy.md +1 -0
- package/.agent/commands/help.md +252 -31
- package/.agent/commands/plan.md +1 -0
- package/.agent/commands/status.md +1 -0
- package/.agent/commands/tdd.md +1 -0
- package/.agent/contexts/brainstorm.md +26 -0
- package/.agent/contexts/debug.md +28 -0
- package/.agent/contexts/implement.md +29 -0
- package/.agent/contexts/review.md +27 -0
- package/.agent/contexts/ship.md +28 -0
- package/.agent/engine/identity.json +13 -0
- package/.agent/engine/loading-rules.json +23 -1
- package/.agent/engine/marketplace-index.json +29 -0
- package/.agent/engine/reliability-config.json +14 -0
- package/.agent/engine/sdlc-map.json +44 -0
- package/.agent/engine/workflow-state.json +28 -2
- package/.agent/hooks/hooks.json +27 -25
- package/.agent/manifest.json +12 -4
- package/.agent/rules.md +2 -1
- package/.agent/skills/README.md +10 -5
- package/.agent/skills/i18n-localization/SKILL.md +191 -0
- package/.agent/skills/mcp-integration/SKILL.md +224 -0
- package/.agent/skills/parallel-agents/SKILL.md +1 -1
- package/.agent/skills/shell-conventions/SKILL.md +92 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +557 -0
- package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.agent/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/.agent/templates/adr-template.md +32 -0
- package/.agent/templates/bug-report.md +37 -0
- package/.agent/templates/feature-request.md +32 -0
- package/.agent/workflows/README.md +92 -78
- package/.agent/workflows/brainstorm.md +154 -100
- package/.agent/workflows/create.md +142 -75
- package/.agent/workflows/debug.md +157 -98
- package/.agent/workflows/deploy.md +195 -144
- package/.agent/workflows/enhance.md +157 -65
- package/.agent/workflows/orchestrate.md +171 -114
- package/.agent/workflows/plan.md +147 -72
- package/.agent/workflows/preview.md +140 -83
- package/.agent/workflows/quality-gate.md +196 -0
- package/.agent/workflows/retrospective.md +197 -0
- package/.agent/workflows/review.md +188 -0
- package/.agent/workflows/status.md +142 -91
- package/.agent/workflows/test.md +168 -95
- package/.agent/workflows/ui-ux-pro-max.md +181 -127
- package/README.md +215 -78
- package/bin/ag-kit.js +344 -10
- package/lib/agent-registry.js +214 -0
- package/lib/agent-reputation.js +351 -0
- package/lib/cli-commands.js +235 -0
- package/lib/conflict-detector.js +245 -0
- package/lib/engineering-manager.js +354 -0
- package/lib/error-budget.js +294 -0
- package/lib/hook-system.js +252 -0
- package/lib/identity.js +245 -0
- package/lib/loading-engine.js +208 -0
- package/lib/marketplace.js +298 -0
- package/lib/plugin-system.js +604 -0
- package/lib/security-scanner.js +309 -0
- package/lib/self-healing.js +434 -0
- package/lib/session-manager.js +261 -0
- package/lib/skill-sandbox.js +244 -0
- package/lib/task-governance.js +523 -0
- package/lib/task-model.js +317 -0
- package/lib/updater.js +201 -0
- package/lib/verify.js +240 -0
- package/lib/workflow-engine.js +353 -0
- package/lib/workflow-persistence.js +160 -0
- package/package.json +7 -3
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Antigravity AI Kit — Skill Sandboxing
|
|
3
|
+
*
|
|
4
|
+
* Enforces allowed-tools declarations from skill SKILL.md frontmatter.
|
|
5
|
+
* Validates that skills only reference tools within their permission set.
|
|
6
|
+
*
|
|
7
|
+
* @module lib/skill-sandbox
|
|
8
|
+
* @author Emre Dursun
|
|
9
|
+
* @since v3.0.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const path = require('path');
|
|
16
|
+
|
|
17
|
+
const AGENT_DIR = '.agent';
|
|
18
|
+
const SKILLS_DIR = 'skills';
|
|
19
|
+
|
|
20
|
+
/** Valid permission levels (ordered from least to most privileged) */
|
|
21
|
+
const PERMISSION_LEVELS = ['read-only', 'read-write', 'execute', 'network'];
|
|
22
|
+
|
|
23
|
+
/** Tool patterns that indicate permission level requirements */
|
|
24
|
+
const TOOL_PERMISSION_MAP = {
|
|
25
|
+
'network': [
|
|
26
|
+
/\bfetch\b/i, /\bhttp\b/i, /\bapi\b/i, /\bcurl\b/i, /\brequest\b/i,
|
|
27
|
+
/\bwebhook\b/i, /\bsocket\b/i, /\bdownload\b/i, /\bupload\b/i,
|
|
28
|
+
],
|
|
29
|
+
'execute': [
|
|
30
|
+
/\bexec\b/i, /\bspawn\b/i, /\bchild_process\b/i, /\bshell\b/i,
|
|
31
|
+
/\brun_command\b/i, /\bterminal\b/i, /\bscript\b/i,
|
|
32
|
+
],
|
|
33
|
+
'read-write': [
|
|
34
|
+
/\bwrite\b/i, /\bcreate\b/i, /\bdelete\b/i, /\bmodify\b/i,
|
|
35
|
+
/\bedit\b/i, /\bsave\b/i, /\bremove\b/i, /\bupdate\b/i,
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @typedef {object} SkillPermissions
|
|
41
|
+
* @property {string} skillName - Name of the skill
|
|
42
|
+
* @property {string[]} allowedTools - Declared allowed tools
|
|
43
|
+
* @property {string} permissionLevel - Highest permission level
|
|
44
|
+
* @property {boolean} hasFrontmatter - Whether frontmatter was found
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @typedef {object} SandboxViolation
|
|
49
|
+
* @property {string} skillName - Skill that violated
|
|
50
|
+
* @property {string} violation - Description of violation
|
|
51
|
+
* @property {'critical' | 'high' | 'medium' | 'low'} severity - Violation severity
|
|
52
|
+
* @property {string} file - File where violation was found
|
|
53
|
+
* @property {number} [line] - Line number (if applicable)
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Extracts permissions from a SKILL.md frontmatter.
|
|
58
|
+
*
|
|
59
|
+
* @param {string} content - Raw SKILL.md content
|
|
60
|
+
* @returns {{ allowedTools: string[], permissionLevel: string }}
|
|
61
|
+
*/
|
|
62
|
+
function extractPermissionsFromFrontmatter(content) {
|
|
63
|
+
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
64
|
+
|
|
65
|
+
if (!frontmatterMatch) {
|
|
66
|
+
return { allowedTools: [], permissionLevel: 'read-only' };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const frontmatter = frontmatterMatch[1];
|
|
70
|
+
/** @type {string[]} */
|
|
71
|
+
const allowedTools = [];
|
|
72
|
+
let permissionLevel = 'read-only';
|
|
73
|
+
|
|
74
|
+
// Parse allowed-tools from frontmatter
|
|
75
|
+
const toolsMatch = frontmatter.match(/allowed-tools:\s*\[(.*?)\]/);
|
|
76
|
+
if (toolsMatch) {
|
|
77
|
+
const toolsList = toolsMatch[1].split(',').map((t) => t.trim().replace(/['"]/g, '')).filter(Boolean);
|
|
78
|
+
allowedTools.push(...toolsList);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Parse permission-level from frontmatter
|
|
82
|
+
const permMatch = frontmatter.match(/permission-level:\s*(\S+)/);
|
|
83
|
+
if (permMatch && PERMISSION_LEVELS.includes(permMatch[1])) {
|
|
84
|
+
permissionLevel = permMatch[1];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return { allowedTools, permissionLevel };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Gets the permissions declared by a specific skill.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} skillName - Name of the skill
|
|
94
|
+
* @param {string} projectRoot - Root directory of the project
|
|
95
|
+
* @returns {SkillPermissions}
|
|
96
|
+
*/
|
|
97
|
+
function getSkillPermissions(skillName, projectRoot) {
|
|
98
|
+
const skillPath = path.join(projectRoot, AGENT_DIR, SKILLS_DIR, skillName, 'SKILL.md');
|
|
99
|
+
|
|
100
|
+
if (!fs.existsSync(skillPath)) {
|
|
101
|
+
return {
|
|
102
|
+
skillName,
|
|
103
|
+
allowedTools: [],
|
|
104
|
+
permissionLevel: 'read-only',
|
|
105
|
+
hasFrontmatter: false,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const content = fs.readFileSync(skillPath, 'utf-8');
|
|
110
|
+
const { allowedTools, permissionLevel } = extractPermissionsFromFrontmatter(content);
|
|
111
|
+
const hasFrontmatter = content.startsWith('---');
|
|
112
|
+
|
|
113
|
+
return { skillName, allowedTools, permissionLevel, hasFrontmatter };
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Scans a skill's content for tool usage that exceeds its declared permissions.
|
|
118
|
+
*
|
|
119
|
+
* @param {string} skillName - Name of the skill
|
|
120
|
+
* @param {string} projectRoot - Root directory of the project
|
|
121
|
+
* @returns {SandboxViolation[]}
|
|
122
|
+
*/
|
|
123
|
+
function validateSkillPermissions(skillName, projectRoot) {
|
|
124
|
+
const permissions = getSkillPermissions(skillName, projectRoot);
|
|
125
|
+
const skillDir = path.join(projectRoot, AGENT_DIR, SKILLS_DIR, skillName);
|
|
126
|
+
/** @type {SandboxViolation[]} */
|
|
127
|
+
const violations = [];
|
|
128
|
+
|
|
129
|
+
if (!fs.existsSync(skillDir)) {
|
|
130
|
+
violations.push({
|
|
131
|
+
skillName,
|
|
132
|
+
violation: `Skill directory not found: ${skillName}`,
|
|
133
|
+
severity: 'critical',
|
|
134
|
+
file: skillDir,
|
|
135
|
+
});
|
|
136
|
+
return violations;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Get the permission level index for comparison
|
|
140
|
+
const declaredLevelIndex = PERMISSION_LEVELS.indexOf(permissions.permissionLevel);
|
|
141
|
+
|
|
142
|
+
// Scan all files in the skill directory
|
|
143
|
+
const files = scanSkillFiles(skillDir);
|
|
144
|
+
|
|
145
|
+
for (const file of files) {
|
|
146
|
+
const content = fs.readFileSync(file, 'utf-8');
|
|
147
|
+
const lines = content.split('\n');
|
|
148
|
+
|
|
149
|
+
for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
|
150
|
+
const line = lines[lineIndex];
|
|
151
|
+
|
|
152
|
+
// Check each permission level higher than declared
|
|
153
|
+
for (const [level, patterns] of Object.entries(TOOL_PERMISSION_MAP)) {
|
|
154
|
+
const levelIndex = PERMISSION_LEVELS.indexOf(level);
|
|
155
|
+
|
|
156
|
+
if (levelIndex > declaredLevelIndex) {
|
|
157
|
+
for (const pattern of patterns) {
|
|
158
|
+
if (pattern.test(line)) {
|
|
159
|
+
violations.push({
|
|
160
|
+
skillName,
|
|
161
|
+
violation: `Uses ${level}-level tool pattern "${pattern.source}" but declared permission is "${permissions.permissionLevel}"`,
|
|
162
|
+
severity: levelIndex - declaredLevelIndex >= 2 ? 'critical' : 'high',
|
|
163
|
+
file: path.relative(projectRoot, file),
|
|
164
|
+
line: lineIndex + 1,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return violations;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Recursively scans a skill directory for readable files.
|
|
178
|
+
*
|
|
179
|
+
* @param {string} dirPath - Directory to scan
|
|
180
|
+
* @returns {string[]} Array of file paths
|
|
181
|
+
*/
|
|
182
|
+
function scanSkillFiles(dirPath) {
|
|
183
|
+
/** @type {string[]} */
|
|
184
|
+
const files = [];
|
|
185
|
+
|
|
186
|
+
if (!fs.existsSync(dirPath)) {
|
|
187
|
+
return files;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
191
|
+
|
|
192
|
+
for (const entry of entries) {
|
|
193
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
194
|
+
|
|
195
|
+
if (entry.isDirectory()) {
|
|
196
|
+
files.push(...scanSkillFiles(fullPath));
|
|
197
|
+
} else if (entry.isFile() && (entry.name.endsWith('.md') || entry.name.endsWith('.json') || entry.name.endsWith('.js'))) {
|
|
198
|
+
files.push(fullPath);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return files;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Enforces allowed-tools compliance across all skills.
|
|
207
|
+
*
|
|
208
|
+
* @param {string} projectRoot - Root directory of the project
|
|
209
|
+
* @returns {{ total: number, compliant: number, violations: SandboxViolation[] }}
|
|
210
|
+
*/
|
|
211
|
+
function enforceAllowedTools(projectRoot) {
|
|
212
|
+
const skillsDir = path.join(projectRoot, AGENT_DIR, SKILLS_DIR);
|
|
213
|
+
|
|
214
|
+
if (!fs.existsSync(skillsDir)) {
|
|
215
|
+
return { total: 0, compliant: 0, violations: [] };
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const skillDirs = fs.readdirSync(skillsDir, { withFileTypes: true })
|
|
219
|
+
.filter((d) => d.isDirectory())
|
|
220
|
+
.map((d) => d.name);
|
|
221
|
+
|
|
222
|
+
/** @type {SandboxViolation[]} */
|
|
223
|
+
const allViolations = [];
|
|
224
|
+
|
|
225
|
+
for (const skillName of skillDirs) {
|
|
226
|
+
const violations = validateSkillPermissions(skillName, projectRoot);
|
|
227
|
+
allViolations.push(...violations);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const violatedSkills = new Set(allViolations.map((v) => v.skillName));
|
|
231
|
+
|
|
232
|
+
return {
|
|
233
|
+
total: skillDirs.length,
|
|
234
|
+
compliant: skillDirs.length - violatedSkills.size,
|
|
235
|
+
violations: allViolations,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
module.exports = {
|
|
240
|
+
getSkillPermissions,
|
|
241
|
+
validateSkillPermissions,
|
|
242
|
+
enforceAllowedTools,
|
|
243
|
+
extractPermissionsFromFrontmatter,
|
|
244
|
+
};
|