cc-permissions 0.1.2
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/LICENSE +14 -0
- package/README.md +230 -0
- package/dist/analyze.d.ts +10 -0
- package/dist/analyze.d.ts.map +1 -0
- package/dist/analyze.js +213 -0
- package/dist/analyze.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +348 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/output.d.ts +83 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +178 -0
- package/dist/output.js.map +1 -0
- package/dist/permissions.d.ts +32 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +98 -0
- package/dist/permissions.js.map +1 -0
- package/dist/templates/cache.d.ts +71 -0
- package/dist/templates/cache.d.ts.map +1 -0
- package/dist/templates/cache.js +137 -0
- package/dist/templates/cache.js.map +1 -0
- package/dist/templates/dotnet.d.ts +3 -0
- package/dist/templates/dotnet.d.ts.map +1 -0
- package/dist/templates/dotnet.js +76 -0
- package/dist/templates/dotnet.js.map +1 -0
- package/dist/templates/general.d.ts +3 -0
- package/dist/templates/general.d.ts.map +1 -0
- package/dist/templates/general.js +59 -0
- package/dist/templates/general.js.map +1 -0
- package/dist/templates/index.d.ts +32 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +54 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/loader.d.ts +19 -0
- package/dist/templates/loader.d.ts.map +1 -0
- package/dist/templates/loader.js +221 -0
- package/dist/templates/loader.js.map +1 -0
- package/dist/templates/python.d.ts +3 -0
- package/dist/templates/python.d.ts.map +1 -0
- package/dist/templates/python.js +110 -0
- package/dist/templates/python.js.map +1 -0
- package/dist/templates/remote.d.ts +45 -0
- package/dist/templates/remote.d.ts.map +1 -0
- package/dist/templates/remote.js +147 -0
- package/dist/templates/remote.js.map +1 -0
- package/dist/templates/web.d.ts +3 -0
- package/dist/templates/web.d.ts.map +1 -0
- package/dist/templates/web.js +101 -0
- package/dist/templates/web.js.map +1 -0
- package/dist/types.d.ts +44 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +53 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +118 -0
- package/dist/version.js.map +1 -0
- package/package.json +54 -0
- package/templates/android.jsonc +99 -0
- package/templates/aws.jsonc +113 -0
- package/templates/azure.jsonc +103 -0
- package/templates/database.jsonc +133 -0
- package/templates/docker.jsonc +115 -0
- package/templates/dotnet.jsonc +80 -0
- package/templates/flutter.jsonc +106 -0
- package/templates/gcp.jsonc +110 -0
- package/templates/git.jsonc +52 -0
- package/templates/github.jsonc +132 -0
- package/templates/go.jsonc +75 -0
- package/templates/ios.jsonc +98 -0
- package/templates/java.jsonc +93 -0
- package/templates/kubernetes.jsonc +114 -0
- package/templates/nodejs.jsonc +105 -0
- package/templates/php.jsonc +107 -0
- package/templates/python.jsonc +114 -0
- package/templates/ruby.jsonc +99 -0
- package/templates/rust.jsonc +97 -0
- package/templates/shell.jsonc +73 -0
- package/templates/template.schema.json +102 -0
- package/templates/terraform.jsonc +96 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/templates/loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAsB,gBAAgB,EAA8C,MAAM,aAAa,CAAC;AAiSpH;;;GAGG;AACH,wBAAgB,YAAY,IAAI,gBAAgB,CAK/C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { readFileSync, readdirSync } from "node:fs";
|
|
2
|
+
import { join, dirname, basename } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import stripJsonComments from "strip-json-comments";
|
|
5
|
+
// Get the bundled templates directory
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const TEMPLATES_DIR = join(__dirname, "..", "..", "templates");
|
|
8
|
+
// Module-level state
|
|
9
|
+
let _templates = null;
|
|
10
|
+
/**
|
|
11
|
+
* Validate a permission object.
|
|
12
|
+
*/
|
|
13
|
+
function validatePermission(perm, templateName, level, index) {
|
|
14
|
+
if (typeof perm !== "object" || perm === null) {
|
|
15
|
+
throw new Error(`Template "${templateName}": levels.${level}[${index}] must be an object`);
|
|
16
|
+
}
|
|
17
|
+
const p = perm;
|
|
18
|
+
if (typeof p.command !== "string" || p.command.trim() === "") {
|
|
19
|
+
throw new Error(`Template "${templateName}": levels.${level}[${index}].command must be a non-empty string`);
|
|
20
|
+
}
|
|
21
|
+
if (p.description !== undefined && typeof p.description !== "string") {
|
|
22
|
+
throw new Error(`Template "${templateName}": levels.${level}[${index}].description must be a string`);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
command: p.command,
|
|
26
|
+
description: p.description,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Validate a content pattern object.
|
|
31
|
+
*/
|
|
32
|
+
function validateContentPattern(pattern, templateName, index) {
|
|
33
|
+
if (typeof pattern !== "object" || pattern === null) {
|
|
34
|
+
throw new Error(`Template "${templateName}": detection.contentPatterns[${index}] must be an object`);
|
|
35
|
+
}
|
|
36
|
+
const p = pattern;
|
|
37
|
+
if (typeof p.file !== "string" || p.file.trim() === "") {
|
|
38
|
+
throw new Error(`Template "${templateName}": detection.contentPatterns[${index}].file must be a non-empty string`);
|
|
39
|
+
}
|
|
40
|
+
if (typeof p.contains !== "string" || p.contains.trim() === "") {
|
|
41
|
+
throw new Error(`Template "${templateName}": detection.contentPatterns[${index}].contains must be a non-empty string`);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
file: p.file,
|
|
45
|
+
contains: p.contains,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Validate detection rules object.
|
|
50
|
+
*/
|
|
51
|
+
function validateDetection(detection, templateName) {
|
|
52
|
+
if (detection === undefined) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
if (typeof detection !== "object" || detection === null) {
|
|
56
|
+
throw new Error(`Template "${templateName}": detection must be an object`);
|
|
57
|
+
}
|
|
58
|
+
const d = detection;
|
|
59
|
+
const result = {};
|
|
60
|
+
if (d.files !== undefined) {
|
|
61
|
+
if (!Array.isArray(d.files)) {
|
|
62
|
+
throw new Error(`Template "${templateName}": detection.files must be an array`);
|
|
63
|
+
}
|
|
64
|
+
for (let i = 0; i < d.files.length; i++) {
|
|
65
|
+
if (typeof d.files[i] !== "string") {
|
|
66
|
+
throw new Error(`Template "${templateName}": detection.files[${i}] must be a string`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
result.files = d.files;
|
|
70
|
+
}
|
|
71
|
+
if (d.directories !== undefined) {
|
|
72
|
+
if (!Array.isArray(d.directories)) {
|
|
73
|
+
throw new Error(`Template "${templateName}": detection.directories must be an array`);
|
|
74
|
+
}
|
|
75
|
+
for (let i = 0; i < d.directories.length; i++) {
|
|
76
|
+
if (typeof d.directories[i] !== "string") {
|
|
77
|
+
throw new Error(`Template "${templateName}": detection.directories[${i}] must be a string`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
result.directories = d.directories;
|
|
81
|
+
}
|
|
82
|
+
if (d.contentPatterns !== undefined) {
|
|
83
|
+
if (!Array.isArray(d.contentPatterns)) {
|
|
84
|
+
throw new Error(`Template "${templateName}": detection.contentPatterns must be an array`);
|
|
85
|
+
}
|
|
86
|
+
result.contentPatterns = d.contentPatterns.map((p, i) => validateContentPattern(p, templateName, i));
|
|
87
|
+
}
|
|
88
|
+
if (d.always !== undefined) {
|
|
89
|
+
if (typeof d.always !== "boolean") {
|
|
90
|
+
throw new Error(`Template "${templateName}": detection.always must be a boolean`);
|
|
91
|
+
}
|
|
92
|
+
result.always = d.always;
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Validate a template definition loaded from JSONC.
|
|
98
|
+
*/
|
|
99
|
+
function validateTemplate(data, filename) {
|
|
100
|
+
if (typeof data !== "object" || data === null) {
|
|
101
|
+
throw new Error(`Template "${filename}": must be an object`);
|
|
102
|
+
}
|
|
103
|
+
const obj = data;
|
|
104
|
+
// Validate name
|
|
105
|
+
if (typeof obj.name !== "string" || obj.name.trim() === "") {
|
|
106
|
+
throw new Error(`Template "${filename}": name must be a non-empty string`);
|
|
107
|
+
}
|
|
108
|
+
if (!/^[a-z][a-z0-9-]*$/.test(obj.name)) {
|
|
109
|
+
throw new Error(`Template "${filename}": name must be lowercase, start with a letter, and contain only letters, numbers, and hyphens`);
|
|
110
|
+
}
|
|
111
|
+
// Validate description
|
|
112
|
+
if (typeof obj.description !== "string" || obj.description.trim() === "") {
|
|
113
|
+
throw new Error(`Template "${filename}": description must be a non-empty string`);
|
|
114
|
+
}
|
|
115
|
+
// Validate levels
|
|
116
|
+
if (typeof obj.levels !== "object" || obj.levels === null) {
|
|
117
|
+
throw new Error(`Template "${filename}": levels must be an object`);
|
|
118
|
+
}
|
|
119
|
+
const levels = obj.levels;
|
|
120
|
+
const requiredLevels = ["restrictive", "standard", "permissive"];
|
|
121
|
+
for (const level of requiredLevels) {
|
|
122
|
+
if (!Array.isArray(levels[level])) {
|
|
123
|
+
throw new Error(`Template "${filename}": levels.${level} must be an array`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const name = obj.name;
|
|
127
|
+
const description = obj.description;
|
|
128
|
+
const detection = validateDetection(obj.detection, name);
|
|
129
|
+
// Validate category (optional)
|
|
130
|
+
if (obj.category !== undefined && typeof obj.category !== "string") {
|
|
131
|
+
throw new Error(`Template "${filename}": category must be a string`);
|
|
132
|
+
}
|
|
133
|
+
const template = {
|
|
134
|
+
name,
|
|
135
|
+
description,
|
|
136
|
+
levels: {
|
|
137
|
+
restrictive: levels.restrictive.map((p, i) => validatePermission(p, name, "restrictive", i)),
|
|
138
|
+
standard: levels.standard.map((p, i) => validatePermission(p, name, "standard", i)),
|
|
139
|
+
permissive: levels.permissive.map((p, i) => validatePermission(p, name, "permissive", i)),
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
if (obj.category) {
|
|
143
|
+
template.category = obj.category;
|
|
144
|
+
}
|
|
145
|
+
if (detection) {
|
|
146
|
+
template.detection = detection;
|
|
147
|
+
}
|
|
148
|
+
return template;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Load a single template from a JSONC file.
|
|
152
|
+
*/
|
|
153
|
+
function loadTemplateFile(filepath) {
|
|
154
|
+
const filename = basename(filepath);
|
|
155
|
+
try {
|
|
156
|
+
const content = readFileSync(filepath, "utf-8");
|
|
157
|
+
const stripped = stripJsonComments(content);
|
|
158
|
+
const data = JSON.parse(stripped);
|
|
159
|
+
return validateTemplate(data, filename);
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
if (error instanceof SyntaxError) {
|
|
163
|
+
throw new Error(`Template "${filename}": Invalid JSON - ${error.message}`);
|
|
164
|
+
}
|
|
165
|
+
throw error;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Load all templates from the bundled templates directory.
|
|
170
|
+
*/
|
|
171
|
+
function loadTemplates() {
|
|
172
|
+
const registry = {};
|
|
173
|
+
let files;
|
|
174
|
+
try {
|
|
175
|
+
files = readdirSync(TEMPLATES_DIR).filter((f) => f.endsWith(".jsonc"));
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
throw new Error(`Failed to read templates directory: ${TEMPLATES_DIR}`);
|
|
179
|
+
}
|
|
180
|
+
if (files.length === 0) {
|
|
181
|
+
throw new Error(`No template files found in ${TEMPLATES_DIR}`);
|
|
182
|
+
}
|
|
183
|
+
for (const file of files) {
|
|
184
|
+
const filepath = join(TEMPLATES_DIR, file);
|
|
185
|
+
const template = loadTemplateFile(filepath);
|
|
186
|
+
if (registry[template.name]) {
|
|
187
|
+
throw new Error(`Duplicate template name "${template.name}" found in ${file}`);
|
|
188
|
+
}
|
|
189
|
+
registry[template.name] = template;
|
|
190
|
+
}
|
|
191
|
+
return registry;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Get the loaded templates registry.
|
|
195
|
+
* Loads templates on first access (lazy initialization).
|
|
196
|
+
*/
|
|
197
|
+
export function getTemplates() {
|
|
198
|
+
if (!_templates) {
|
|
199
|
+
_templates = loadTemplates();
|
|
200
|
+
}
|
|
201
|
+
return _templates;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Check if templates have been loaded.
|
|
205
|
+
*/
|
|
206
|
+
export function isInitialized() {
|
|
207
|
+
return _templates !== null;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Reset the loader state (useful for testing).
|
|
211
|
+
*/
|
|
212
|
+
export function resetLoader() {
|
|
213
|
+
_templates = null;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Get the templates directory path.
|
|
217
|
+
*/
|
|
218
|
+
export function getTemplatesDir() {
|
|
219
|
+
return TEMPLATES_DIR;
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/templates/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,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":"python.d.ts","sourceRoot":"","sources":["../../src/templates/python.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,cAAc,EAAE,kBA4G5B,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export const pythonTemplate = {
|
|
2
|
+
name: "python",
|
|
3
|
+
description: "pip, python, venv, pytest, and common data tools",
|
|
4
|
+
levels: {
|
|
5
|
+
restrictive: [
|
|
6
|
+
// Python version/info
|
|
7
|
+
{ command: "python --version", description: "Check Python version" },
|
|
8
|
+
{ command: "python -V", description: "Check Python version (short)" },
|
|
9
|
+
{ command: "python3 --version", description: "Check Python 3 version" },
|
|
10
|
+
{ command: "python3 -V", description: "Check Python 3 version (short)" },
|
|
11
|
+
// pip read-only
|
|
12
|
+
{ command: "pip list", description: "List installed packages" },
|
|
13
|
+
{ command: "pip3 list", description: "List installed packages (pip3)" },
|
|
14
|
+
{ command: "pip show", description: "Show package info" },
|
|
15
|
+
{ command: "pip3 show", description: "Show package info (pip3)" },
|
|
16
|
+
{ command: "pip freeze", description: "Output installed packages" },
|
|
17
|
+
{ command: "pip3 freeze", description: "Output installed packages (pip3)" },
|
|
18
|
+
{ command: "pip check", description: "Verify package dependencies" },
|
|
19
|
+
{ command: "pip3 check", description: "Verify package dependencies (pip3)" },
|
|
20
|
+
{ command: "pip search", description: "Search for packages" },
|
|
21
|
+
{ command: "pip3 search", description: "Search for packages (pip3)" },
|
|
22
|
+
// uv read-only
|
|
23
|
+
{ command: "uv --version", description: "Check uv version" },
|
|
24
|
+
{ command: "uv pip list", description: "List installed packages (uv)" },
|
|
25
|
+
{ command: "uv pip show", description: "Show package info (uv)" },
|
|
26
|
+
{ command: "uv pip freeze", description: "Output installed packages (uv)" },
|
|
27
|
+
// Poetry read-only
|
|
28
|
+
{ command: "poetry --version", description: "Check Poetry version" },
|
|
29
|
+
{ command: "poetry show", description: "Show package info (Poetry)" },
|
|
30
|
+
{ command: "poetry env info", description: "Show environment info (Poetry)" },
|
|
31
|
+
// Conda read-only
|
|
32
|
+
{ command: "conda --version", description: "Check Conda version" },
|
|
33
|
+
{ command: "conda list", description: "List installed packages (Conda)" },
|
|
34
|
+
{ command: "conda info", description: "Show Conda info" },
|
|
35
|
+
{ command: "conda env list", description: "List Conda environments" },
|
|
36
|
+
// venv info
|
|
37
|
+
{ command: "python -m venv --help", description: "Venv help" },
|
|
38
|
+
],
|
|
39
|
+
standard: [
|
|
40
|
+
// Python execution
|
|
41
|
+
{ command: "python", description: "Run Python scripts" },
|
|
42
|
+
{ command: "python3", description: "Run Python 3 scripts" },
|
|
43
|
+
{ command: "python -c", description: "Execute Python code" },
|
|
44
|
+
{ command: "python3 -c", description: "Execute Python 3 code" },
|
|
45
|
+
{ command: "python -m", description: "Run Python module" },
|
|
46
|
+
{ command: "python3 -m", description: "Run Python 3 module" },
|
|
47
|
+
// Testing
|
|
48
|
+
{ command: "pytest", description: "Run pytest" },
|
|
49
|
+
{ command: "python -m pytest", description: "Run pytest via module" },
|
|
50
|
+
{ command: "python3 -m pytest", description: "Run pytest via module (py3)" },
|
|
51
|
+
{ command: "unittest", description: "Run unittest" },
|
|
52
|
+
{ command: "python -m unittest", description: "Run unittest via module" },
|
|
53
|
+
{ command: "python3 -m unittest", description: "Run unittest via module (py3)" },
|
|
54
|
+
// Linting/formatting
|
|
55
|
+
{ command: "ruff", description: "Run Ruff linter" },
|
|
56
|
+
{ command: "ruff check", description: "Run Ruff check" },
|
|
57
|
+
{ command: "ruff format", description: "Run Ruff formatter" },
|
|
58
|
+
{ command: "black", description: "Run Black formatter" },
|
|
59
|
+
{ command: "isort", description: "Run isort" },
|
|
60
|
+
{ command: "flake8", description: "Run flake8 linter" },
|
|
61
|
+
{ command: "pylint", description: "Run pylint" },
|
|
62
|
+
{ command: "mypy", description: "Run mypy type checker" },
|
|
63
|
+
// Build/packaging
|
|
64
|
+
{ command: "python -m build", description: "Build package" },
|
|
65
|
+
{ command: "python3 -m build", description: "Build package (py3)" },
|
|
66
|
+
// Virtual environment activation (sourcing handled by shell)
|
|
67
|
+
{ command: "python -m venv", description: "Create virtual environment" },
|
|
68
|
+
{ command: "python3 -m venv", description: "Create virtual environment (py3)" },
|
|
69
|
+
// uv execution
|
|
70
|
+
{ command: "uv run", description: "Run with uv" },
|
|
71
|
+
// Poetry scripts
|
|
72
|
+
{ command: "poetry run", description: "Run with Poetry" },
|
|
73
|
+
{ command: "poetry build", description: "Build with Poetry" },
|
|
74
|
+
// Conda activation
|
|
75
|
+
{ command: "conda activate", description: "Activate Conda environment" },
|
|
76
|
+
{ command: "conda deactivate", description: "Deactivate Conda environment" },
|
|
77
|
+
],
|
|
78
|
+
permissive: [
|
|
79
|
+
// pip install
|
|
80
|
+
{ command: "pip install", description: "Install packages" },
|
|
81
|
+
{ command: "pip3 install", description: "Install packages (pip3)" },
|
|
82
|
+
{ command: "pip uninstall", description: "Uninstall packages" },
|
|
83
|
+
{ command: "pip3 uninstall", description: "Uninstall packages (pip3)" },
|
|
84
|
+
{ command: "pip install -e", description: "Install in editable mode" },
|
|
85
|
+
{ command: "pip3 install -e", description: "Install in editable mode (pip3)" },
|
|
86
|
+
{ command: "pip install -r", description: "Install from requirements" },
|
|
87
|
+
{ command: "pip3 install -r", description: "Install from requirements (pip3)" },
|
|
88
|
+
// uv install
|
|
89
|
+
{ command: "uv pip install", description: "Install packages (uv)" },
|
|
90
|
+
{ command: "uv pip uninstall", description: "Uninstall packages (uv)" },
|
|
91
|
+
{ command: "uv pip sync", description: "Sync packages (uv)" },
|
|
92
|
+
{ command: "uv venv", description: "Create venv with uv" },
|
|
93
|
+
// Poetry install
|
|
94
|
+
{ command: "poetry install", description: "Install with Poetry" },
|
|
95
|
+
{ command: "poetry add", description: "Add package with Poetry" },
|
|
96
|
+
{ command: "poetry remove", description: "Remove package with Poetry" },
|
|
97
|
+
{ command: "poetry update", description: "Update with Poetry" },
|
|
98
|
+
{ command: "poetry lock", description: "Lock dependencies with Poetry" },
|
|
99
|
+
{ command: "poetry publish", description: "Publish with Poetry" },
|
|
100
|
+
// Conda install
|
|
101
|
+
{ command: "conda install", description: "Install packages (Conda)" },
|
|
102
|
+
{ command: "conda create", description: "Create Conda environment" },
|
|
103
|
+
{ command: "conda remove", description: "Remove packages (Conda)" },
|
|
104
|
+
{ command: "conda update", description: "Update packages (Conda)" },
|
|
105
|
+
{ command: "conda env create", description: "Create env from file (Conda)" },
|
|
106
|
+
{ command: "conda env remove", description: "Remove Conda environment" },
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=python.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"python.js","sourceRoot":"","sources":["../../src/templates/python.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAuB;IAChD,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,kDAAkD;IAC/D,MAAM,EAAE;QACN,WAAW,EAAE;YACX,sBAAsB;YACtB,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,sBAAsB,EAAE;YACpE,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,8BAA8B,EAAE;YACrE,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,wBAAwB,EAAE;YACvE,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,gCAAgC,EAAE;YACxE,gBAAgB;YAChB,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,yBAAyB,EAAE;YAC/D,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gCAAgC,EAAE;YACvE,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE;YACzD,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,0BAA0B,EAAE;YACjE,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,2BAA2B,EAAE;YACnE,EAAE,OAA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AW,EAAE,uBAAuB,EAAE;YACnE,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,yBAAyB,EAAE;YACvE,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAE;YAC7D,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,qBAAqB,EAAE;YAC1D,iBAAiB;YACjB,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,qBAAqB,EAAE;YACjE,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,yBAAyB,EAAE;YACjE,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,4BAA4B,EAAE;YACvE,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAE;YAC/D,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,+BAA+B,EAAE;YACxE,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,qBAAqB,EAAE;YACjE,gBAAgB;YAChB,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,0BAA0B,EAAE;YACrE,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,0BAA0B,EAAE;YACpE,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,yBAAyB,EAAE;YACnE,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,yBAAyB,EAAE;YACnE,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,8BAA8B,EAAE;YAC5E,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,0BAA0B,EAAE;SACzE;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface TemplateCategory {
|
|
2
|
+
name: string;
|
|
3
|
+
templates: string[];
|
|
4
|
+
}
|
|
5
|
+
export interface TemplateManifest {
|
|
6
|
+
version: string;
|
|
7
|
+
categories: TemplateCategory[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Extract a flat list of all template names from the categorized manifest.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getTemplateNames(manifest: TemplateManifest): string[];
|
|
13
|
+
export interface FetchResult {
|
|
14
|
+
success: boolean;
|
|
15
|
+
manifest?: TemplateManifest;
|
|
16
|
+
error?: string;
|
|
17
|
+
cached?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetch the template manifest from the remote CDN.
|
|
21
|
+
*/
|
|
22
|
+
export declare function fetchManifest(): Promise<TemplateManifest>;
|
|
23
|
+
/**
|
|
24
|
+
* Fetch a single template from the remote CDN.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fetchTemplate(name: string): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Fetch all templates from the remote CDN and cache them locally.
|
|
29
|
+
* Returns the fetch result with success/failure status.
|
|
30
|
+
*/
|
|
31
|
+
export declare function fetchAndCacheTemplates(): Promise<FetchResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Check if updates are available by comparing manifest versions.
|
|
34
|
+
*/
|
|
35
|
+
export declare function checkForUpdates(): Promise<{
|
|
36
|
+
hasUpdates: boolean;
|
|
37
|
+
currentVersion: string | null;
|
|
38
|
+
latestVersion: string | null;
|
|
39
|
+
error?: string;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Get the CDN base URL (for informational purposes).
|
|
43
|
+
*/
|
|
44
|
+
export declare function getCdnBaseUrl(): string;
|
|
45
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/templates/remote.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAErE;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA8BD;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAgC/D;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CASjE;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,WAAW,CAAC,CAwCnE;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAqBD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { cacheTemplate, saveCacheMeta, getCacheMeta, ensureCacheDir, } from "./cache.js";
|
|
2
|
+
// Raw GitHub URL for templates (updates immediately, no CDN cache delays)
|
|
3
|
+
const CDN_BASE_URL = "https://raw.githubusercontent.com/DanielCarmingham/cc-permissions-templates/main";
|
|
4
|
+
const MANIFEST_URL = `${CDN_BASE_URL}/index.json`;
|
|
5
|
+
const TEMPLATES_BASE_URL = `${CDN_BASE_URL}/templates`;
|
|
6
|
+
// Timeout for fetch requests (10 seconds)
|
|
7
|
+
const FETCH_TIMEOUT_MS = 10000;
|
|
8
|
+
// Supported manifest major version
|
|
9
|
+
const SUPPORTED_MAJOR_VERSION = 1;
|
|
10
|
+
/**
|
|
11
|
+
* Extract a flat list of all template names from the categorized manifest.
|
|
12
|
+
*/
|
|
13
|
+
export function getTemplateNames(manifest) {
|
|
14
|
+
return manifest.categories.flatMap((category) => category.templates);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Fetch with timeout support.
|
|
18
|
+
*/
|
|
19
|
+
async function fetchWithTimeout(url, timeoutMs = FETCH_TIMEOUT_MS) {
|
|
20
|
+
const controller = new AbortController();
|
|
21
|
+
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
22
|
+
try {
|
|
23
|
+
return await fetch(url, { signal: controller.signal });
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
clearTimeout(timeoutId);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parse the major version from a semver string.
|
|
31
|
+
*/
|
|
32
|
+
function parseMajorVersion(version) {
|
|
33
|
+
const match = version.match(/^(\d+)\./);
|
|
34
|
+
if (!match) {
|
|
35
|
+
throw new Error(`Invalid version format: ${version}`);
|
|
36
|
+
}
|
|
37
|
+
return parseInt(match[1], 10);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Fetch the template manifest from the remote CDN.
|
|
41
|
+
*/
|
|
42
|
+
export async function fetchManifest() {
|
|
43
|
+
const response = await fetchWithTimeout(MANIFEST_URL);
|
|
44
|
+
if (!response.ok) {
|
|
45
|
+
throw new Error(`Failed to fetch manifest: ${response.status} ${response.statusText}`);
|
|
46
|
+
}
|
|
47
|
+
const data = await response.json();
|
|
48
|
+
if (!data.version) {
|
|
49
|
+
throw new Error("Invalid manifest format: missing version");
|
|
50
|
+
}
|
|
51
|
+
const majorVersion = parseMajorVersion(data.version);
|
|
52
|
+
if (majorVersion !== SUPPORTED_MAJOR_VERSION) {
|
|
53
|
+
throw new Error(`Manifest version ${data.version} is not compatible with this version of cc-permissions. ` +
|
|
54
|
+
`Please upgrade cc-permissions: npm install -g cc-permissions@latest`);
|
|
55
|
+
}
|
|
56
|
+
if (!Array.isArray(data.categories)) {
|
|
57
|
+
throw new Error("Invalid manifest format: missing categories");
|
|
58
|
+
}
|
|
59
|
+
for (const category of data.categories) {
|
|
60
|
+
if (!category.name || !Array.isArray(category.templates)) {
|
|
61
|
+
throw new Error("Invalid manifest format: category missing name or templates");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return data;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Fetch a single template from the remote CDN.
|
|
68
|
+
*/
|
|
69
|
+
export async function fetchTemplate(name) {
|
|
70
|
+
const url = `${TEMPLATES_BASE_URL}/${name}.jsonc`;
|
|
71
|
+
const response = await fetchWithTimeout(url);
|
|
72
|
+
if (!response.ok) {
|
|
73
|
+
throw new Error(`Failed to fetch template "${name}": ${response.status} ${response.statusText}`);
|
|
74
|
+
}
|
|
75
|
+
return response.text();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Fetch all templates from the remote CDN and cache them locally.
|
|
79
|
+
* Returns the fetch result with success/failure status.
|
|
80
|
+
*/
|
|
81
|
+
export async function fetchAndCacheTemplates() {
|
|
82
|
+
try {
|
|
83
|
+
// Fetch manifest first
|
|
84
|
+
const manifest = await fetchManifest();
|
|
85
|
+
// Ensure cache directory exists
|
|
86
|
+
ensureCacheDir();
|
|
87
|
+
// Extract flat template list from categories
|
|
88
|
+
const templateNames = getTemplateNames(manifest);
|
|
89
|
+
// Fetch all templates in parallel
|
|
90
|
+
const templatePromises = templateNames.map(async (name) => {
|
|
91
|
+
const content = await fetchTemplate(name);
|
|
92
|
+
cacheTemplate(name, content);
|
|
93
|
+
return name;
|
|
94
|
+
});
|
|
95
|
+
await Promise.all(templatePromises);
|
|
96
|
+
// Save cache metadata
|
|
97
|
+
const meta = {
|
|
98
|
+
lastUpdated: new Date().toISOString(),
|
|
99
|
+
version: manifest.version,
|
|
100
|
+
templates: templateNames,
|
|
101
|
+
categories: manifest.categories,
|
|
102
|
+
};
|
|
103
|
+
saveCacheMeta(meta);
|
|
104
|
+
return {
|
|
105
|
+
success: true,
|
|
106
|
+
manifest,
|
|
107
|
+
cached: false,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
return {
|
|
112
|
+
success: false,
|
|
113
|
+
error: error instanceof Error ? error.message : String(error),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Check if updates are available by comparing manifest versions.
|
|
119
|
+
*/
|
|
120
|
+
export async function checkForUpdates() {
|
|
121
|
+
const currentMeta = getCacheMeta();
|
|
122
|
+
const currentVersion = currentMeta?.version ?? null;
|
|
123
|
+
try {
|
|
124
|
+
const manifest = await fetchManifest();
|
|
125
|
+
const latestVersion = manifest.version;
|
|
126
|
+
return {
|
|
127
|
+
hasUpdates: currentVersion !== latestVersion,
|
|
128
|
+
currentVersion,
|
|
129
|
+
latestVersion,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
return {
|
|
134
|
+
hasUpdates: false,
|
|
135
|
+
currentVersion,
|
|
136
|
+
latestVersion: null,
|
|
137
|
+
error: error instanceof Error ? error.message : String(error),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get the CDN base URL (for informational purposes).
|
|
143
|
+
*/
|
|
144
|
+
export function getCdnBaseUrl() {
|
|
145
|
+
return CDN_BASE_URL;
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=remote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/templates/remote.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,GAEf,MAAM,YAAY,CAAC;AAEpB,0EAA0E;AAC1E,MAAM,YAAY,GAChB,kFA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