javi-forge 1.6.0 → 1.7.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 +45 -1
- package/ci-local/README.md +56 -11
- package/ci-local/ci-local.ps1 +445 -0
- package/ci-local/ci-local.sh +52 -9
- package/ci-local/docker/python.Dockerfile +7 -0
- package/ci-local/hooks/commit-msg +120 -44
- package/ci-local/hooks/commit-msg.test.sh +286 -0
- package/ci-local/hooks/pre-commit +9 -1
- package/ci-local/hooks/pre-push +13 -2
- package/ci-local/install.ps1 +367 -0
- package/ci-local/install.sh +151 -5
- package/ci-local/uninstall.ps1 +85 -0
- package/ci-local/uninstall.sh +95 -0
- package/dist/cli/dispatch/ci.d.ts +12 -0
- package/dist/cli/dispatch/ci.js +38 -0
- package/dist/cli/dispatch/security.d.ts +11 -0
- package/dist/cli/dispatch/security.js +68 -0
- package/dist/cli/dispatch/simple-renderers.d.ts +16 -0
- package/dist/cli/dispatch/simple-renderers.js +65 -0
- package/dist/cli/dispatch/skill-publish.d.ts +15 -0
- package/dist/cli/dispatch/skill-publish.js +44 -0
- package/dist/cli/dispatch/skills-cmd.d.ts +13 -0
- package/dist/cli/dispatch/skills-cmd.js +93 -0
- package/dist/cli/dispatch/tdd.d.ts +11 -0
- package/dist/cli/dispatch/tdd.js +45 -0
- package/dist/cli/dispatch/types.d.ts +29 -0
- package/dist/cli/dispatch/types.js +2 -0
- package/dist/cli/dispatch/workflow.d.ts +11 -0
- package/dist/cli/dispatch/workflow.js +67 -0
- package/dist/cli/help.d.ts +127 -0
- package/dist/cli/help.js +138 -0
- package/dist/cli/runtime.d.ts +16 -0
- package/dist/cli/runtime.js +38 -0
- package/dist/cli/validators.d.ts +17 -0
- package/dist/cli/validators.js +35 -0
- package/dist/commands/analyze.d.ts +1 -1
- package/dist/commands/analyze.js +14 -16
- package/dist/commands/ci.d.ts +50 -3
- package/dist/commands/ci.js +537 -182
- package/dist/commands/doctor.d.ts +2 -2
- package/dist/commands/doctor.js +112 -62
- package/dist/commands/init/report.d.ts +13 -0
- package/dist/commands/init/report.js +13 -0
- package/dist/commands/init/steps/agent-skills.d.ts +13 -0
- package/dist/commands/init/steps/agent-skills.js +45 -0
- package/dist/commands/init/steps/ai-sync.d.ts +15 -0
- package/dist/commands/init/steps/ai-sync.js +62 -0
- package/dist/commands/init/steps/ci.d.ts +24 -0
- package/dist/commands/init/steps/ci.js +74 -0
- package/dist/commands/init/steps/claude-md.d.ts +14 -0
- package/dist/commands/init/steps/claude-md.js +54 -0
- package/dist/commands/init/steps/code-graph.d.ts +16 -0
- package/dist/commands/init/steps/code-graph.js +68 -0
- package/dist/commands/init/steps/context-dir.d.ts +13 -0
- package/dist/commands/init/steps/context-dir.js +47 -0
- package/dist/commands/init/steps/docker-deploy.d.ts +16 -0
- package/dist/commands/init/steps/docker-deploy.js +60 -0
- package/dist/commands/init/steps/ghagga.d.ts +15 -0
- package/dist/commands/init/steps/ghagga.js +58 -0
- package/dist/commands/init/steps/git.d.ts +25 -0
- package/dist/commands/init/steps/git.js +81 -0
- package/dist/commands/init/steps/gitignore.d.ts +13 -0
- package/dist/commands/init/steps/gitignore.js +39 -0
- package/dist/commands/init/steps/local-ai.d.ts +14 -0
- package/dist/commands/init/steps/local-ai.js +53 -0
- package/dist/commands/init/steps/manifest.d.ts +13 -0
- package/dist/commands/init/steps/manifest.js +58 -0
- package/dist/commands/init/steps/memory.d.ts +15 -0
- package/dist/commands/init/steps/memory.js +60 -0
- package/dist/commands/init/steps/mock.d.ts +13 -0
- package/dist/commands/init/steps/mock.js +64 -0
- package/dist/commands/init/steps/sdd.d.ts +12 -0
- package/dist/commands/init/steps/sdd.js +40 -0
- package/dist/commands/init/steps/security.d.ts +28 -0
- package/dist/commands/init/steps/security.js +103 -0
- package/dist/commands/init/types.d.ts +30 -0
- package/dist/commands/init/types.js +2 -0
- package/dist/commands/init.d.ts +5 -4
- package/dist/commands/init.js +42 -387
- package/dist/commands/llmstxt.d.ts +1 -1
- package/dist/commands/llmstxt.js +36 -34
- package/dist/commands/plugin.d.ts +10 -1
- package/dist/commands/plugin.js +92 -47
- package/dist/commands/security.d.ts +11 -5
- package/dist/commands/security.js +236 -77
- package/dist/commands/skills/analysis.d.ts +19 -0
- package/dist/commands/skills/analysis.js +211 -0
- package/dist/commands/skills/benchmark.d.ts +6 -0
- package/dist/commands/skills/benchmark.js +82 -0
- package/dist/commands/skills/constants.d.ts +10 -0
- package/dist/commands/skills/constants.js +27 -0
- package/dist/commands/skills/directives.d.ts +21 -0
- package/dist/commands/skills/directives.js +101 -0
- package/dist/commands/skills/parsing.d.ts +16 -0
- package/dist/commands/skills/parsing.js +108 -0
- package/dist/commands/skills/rules.d.ts +5 -0
- package/dist/commands/skills/rules.js +32 -0
- package/dist/commands/skills/scoring.d.ts +47 -0
- package/dist/commands/skills/scoring.js +306 -0
- package/dist/commands/skills.d.ts +8 -69
- package/dist/commands/skills.js +9 -490
- package/dist/commands/tdd-pipeline.d.ts +17 -0
- package/dist/commands/tdd-pipeline.js +144 -0
- package/dist/commands/tdd.d.ts +1 -1
- package/dist/commands/tdd.js +21 -18
- package/dist/commands/workflow.d.ts +23 -0
- package/dist/commands/workflow.js +116 -0
- package/dist/constants.d.ts +15 -1
- package/dist/constants.js +161 -122
- package/dist/index.js +43 -280
- package/dist/lib/agent-skills.d.ts +36 -1
- package/dist/lib/agent-skills.js +168 -19
- package/dist/lib/atlassian-mcp.d.ts +42 -0
- package/dist/lib/atlassian-mcp.js +98 -0
- package/dist/lib/auto-skill-install.d.ts +37 -0
- package/dist/lib/auto-skill-install.js +91 -0
- package/dist/lib/auto-wire.d.ts +20 -0
- package/dist/lib/auto-wire.js +240 -0
- package/dist/lib/ci-config.d.ts +65 -0
- package/dist/lib/ci-config.js +297 -0
- package/dist/lib/claudemd.d.ts +13 -1
- package/dist/lib/claudemd.js +174 -24
- package/dist/lib/codex-export.d.ts +1 -1
- package/dist/lib/codex-export.js +26 -32
- package/dist/lib/common.d.ts +1 -1
- package/dist/lib/common.js +52 -44
- package/dist/lib/context.d.ts +17 -2
- package/dist/lib/context.js +142 -13
- package/dist/lib/crash-recovery.d.ts +34 -0
- package/dist/lib/crash-recovery.js +123 -0
- package/dist/lib/docker.d.ts +23 -2
- package/dist/lib/docker.js +168 -131
- package/dist/lib/exec.d.ts +10 -0
- package/dist/lib/exec.js +11 -0
- package/dist/lib/frontmatter.d.ts +1 -1
- package/dist/lib/frontmatter.js +29 -15
- package/dist/lib/harness-audit.d.ts +35 -0
- package/dist/lib/harness-audit.js +277 -0
- package/dist/lib/parallel-batch.d.ts +42 -0
- package/dist/lib/parallel-batch.js +88 -0
- package/dist/lib/plugin.d.ts +9 -3
- package/dist/lib/plugin.js +127 -70
- package/dist/lib/secret-scanner.d.ts +30 -0
- package/dist/lib/secret-scanner.js +274 -0
- package/dist/lib/security-analysis.d.ts +74 -0
- package/dist/lib/security-analysis.js +489 -0
- package/dist/lib/skill-publish.d.ts +40 -0
- package/dist/lib/skill-publish.js +164 -0
- package/dist/lib/skill-scanner.d.ts +63 -0
- package/dist/lib/skill-scanner.js +383 -0
- package/dist/lib/stack-detector.d.ts +38 -0
- package/dist/lib/stack-detector.js +207 -0
- package/dist/lib/supply-chain.d.ts +23 -0
- package/dist/lib/supply-chain.js +126 -0
- package/dist/lib/team-presets.d.ts +53 -0
- package/dist/lib/team-presets.js +201 -0
- package/dist/lib/template.d.ts +16 -1
- package/dist/lib/template.js +46 -17
- package/dist/lib/workflow/discovery.d.ts +27 -0
- package/dist/lib/workflow/discovery.js +85 -0
- package/dist/lib/workflow/index.d.ts +5 -0
- package/dist/lib/workflow/index.js +5 -0
- package/dist/lib/workflow/parser.d.ts +16 -0
- package/dist/lib/workflow/parser.js +198 -0
- package/dist/lib/workflow/renderer.d.ts +9 -0
- package/dist/lib/workflow/renderer.js +152 -0
- package/dist/lib/workflow/validator.d.ts +10 -0
- package/dist/lib/workflow/validator.js +189 -0
- package/dist/tasks/index.d.ts +4 -0
- package/dist/tasks/index.js +4 -0
- package/dist/tasks/scaffold-tasks.d.ts +3 -0
- package/dist/tasks/scaffold-tasks.js +14 -0
- package/dist/tasks/task-id.d.ts +30 -0
- package/dist/tasks/task-id.js +59 -0
- package/dist/tasks/task-tracker.d.ts +15 -0
- package/dist/tasks/task-tracker.js +81 -0
- package/dist/types/index.d.ts +134 -6
- package/dist/types/index.js +11 -1
- package/dist/ui/AnalyzeUI.d.ts +1 -1
- package/dist/ui/AnalyzeUI.js +38 -39
- package/dist/ui/App.d.ts +5 -3
- package/dist/ui/App.js +86 -46
- package/dist/ui/AutoSkills.d.ts +9 -0
- package/dist/ui/AutoSkills.js +124 -0
- package/dist/ui/CI.d.ts +2 -2
- package/dist/ui/CI.js +24 -26
- package/dist/ui/CIContext.d.ts +1 -1
- package/dist/ui/CIContext.js +2 -2
- package/dist/ui/CISelector.d.ts +2 -2
- package/dist/ui/CISelector.js +23 -15
- package/dist/ui/Doctor.d.ts +1 -1
- package/dist/ui/Doctor.js +35 -29
- package/dist/ui/Header.d.ts +1 -1
- package/dist/ui/Header.js +14 -14
- package/dist/ui/HookProfileSelector.d.ts +9 -0
- package/dist/ui/HookProfileSelector.js +54 -0
- package/dist/ui/LlmsTxt.d.ts +1 -1
- package/dist/ui/LlmsTxt.js +31 -22
- package/dist/ui/MemorySelector.d.ts +2 -2
- package/dist/ui/MemorySelector.js +28 -16
- package/dist/ui/NameInput.d.ts +1 -1
- package/dist/ui/NameInput.js +21 -21
- package/dist/ui/OptionSelector.d.ts +6 -2
- package/dist/ui/OptionSelector.js +83 -32
- package/dist/ui/Plugin.d.ts +4 -3
- package/dist/ui/Plugin.js +78 -35
- package/dist/ui/Progress.d.ts +3 -3
- package/dist/ui/Progress.js +23 -22
- package/dist/ui/Skills.d.ts +2 -2
- package/dist/ui/Skills.js +61 -32
- package/dist/ui/StackSelector.d.ts +2 -2
- package/dist/ui/StackSelector.js +27 -17
- package/dist/ui/Summary.d.ts +3 -3
- package/dist/ui/Summary.js +60 -50
- package/dist/ui/Welcome.d.ts +1 -1
- package/dist/ui/Welcome.js +15 -16
- package/dist/ui/theme.d.ts +1 -1
- package/dist/ui/theme.js +6 -6
- package/lib/common.psm1 +167 -0
- package/lib/common.sh +30 -0
- package/package.json +46 -24
- package/templates/common/atlassian/mcp-atlassian-snippet.json +16 -0
- package/templates/common/repoforge/mcp-repoforge-snippet.json +11 -0
- package/templates/common/repoforge/repoforge.yaml +34 -0
- package/templates/github/deploy-docker-zero-downtime.yml +140 -0
- package/templates/github/repoforge-graph.yml +45 -0
- package/templates/gitlab/deploy-docker-zero-downtime.yml +57 -0
- package/templates/local-ai/.env.example +17 -0
- package/templates/local-ai/docker-compose.yml +95 -0
- package/templates/security-hooks/claude-settings-security.json +30 -0
- package/templates/security-hooks/commit-msg-signing +29 -0
- package/templates/security-hooks/pre-commit-permissions +74 -0
- package/templates/security-hooks/pre-commit-secrets +74 -0
- package/templates/security-hooks/pre-push-branch-protection +62 -0
- package/templates/security-hooks/pre-push-deps +83 -0
- package/templates/security-hooks/pre-push-signing +67 -0
- package/templates/woodpecker/deploy-docker-zero-downtime.yml +50 -0
- package/templates/workflows/ci-pipeline.dot +15 -0
- package/templates/workflows/feature-flow.dot +21 -0
- package/templates/workflows/release.dot +16 -0
- package/dist/__integration__/helpers.d.ts +0 -20
- package/dist/__integration__/helpers.d.ts.map +0 -1
- package/dist/__integration__/helpers.js +0 -31
- package/dist/__integration__/helpers.js.map +0 -1
- package/dist/commands/analyze.d.ts.map +0 -1
- package/dist/commands/analyze.js.map +0 -1
- package/dist/commands/ci.d.ts.map +0 -1
- package/dist/commands/ci.js.map +0 -1
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/llmstxt.d.ts.map +0 -1
- package/dist/commands/llmstxt.js.map +0 -1
- package/dist/commands/plugin.d.ts.map +0 -1
- package/dist/commands/plugin.js.map +0 -1
- package/dist/commands/security.d.ts.map +0 -1
- package/dist/commands/security.js.map +0 -1
- package/dist/commands/skills.d.ts.map +0 -1
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/tdd.d.ts.map +0 -1
- package/dist/commands/tdd.js.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/agent-skills.d.ts.map +0 -1
- package/dist/lib/agent-skills.js.map +0 -1
- package/dist/lib/claudemd.d.ts.map +0 -1
- package/dist/lib/claudemd.js.map +0 -1
- package/dist/lib/codex-export.d.ts.map +0 -1
- package/dist/lib/codex-export.js.map +0 -1
- package/dist/lib/common.d.ts.map +0 -1
- package/dist/lib/common.js.map +0 -1
- package/dist/lib/context.d.ts.map +0 -1
- package/dist/lib/context.js.map +0 -1
- package/dist/lib/docker.d.ts.map +0 -1
- package/dist/lib/docker.js.map +0 -1
- package/dist/lib/frontmatter.d.ts.map +0 -1
- package/dist/lib/frontmatter.js.map +0 -1
- package/dist/lib/plugin.d.ts.map +0 -1
- package/dist/lib/plugin.js.map +0 -1
- package/dist/lib/template.d.ts.map +0 -1
- package/dist/lib/template.js.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/ui/AnalyzeUI.d.ts.map +0 -1
- package/dist/ui/AnalyzeUI.js.map +0 -1
- package/dist/ui/App.d.ts.map +0 -1
- package/dist/ui/App.js.map +0 -1
- package/dist/ui/CI.d.ts.map +0 -1
- package/dist/ui/CI.js.map +0 -1
- package/dist/ui/CIContext.d.ts.map +0 -1
- package/dist/ui/CIContext.js.map +0 -1
- package/dist/ui/CISelector.d.ts.map +0 -1
- package/dist/ui/CISelector.js.map +0 -1
- package/dist/ui/Doctor.d.ts.map +0 -1
- package/dist/ui/Doctor.js.map +0 -1
- package/dist/ui/Header.d.ts.map +0 -1
- package/dist/ui/Header.js.map +0 -1
- package/dist/ui/LlmsTxt.d.ts.map +0 -1
- package/dist/ui/LlmsTxt.js.map +0 -1
- package/dist/ui/MemorySelector.d.ts.map +0 -1
- package/dist/ui/MemorySelector.js.map +0 -1
- package/dist/ui/NameInput.d.ts.map +0 -1
- package/dist/ui/NameInput.js.map +0 -1
- package/dist/ui/OptionSelector.d.ts.map +0 -1
- package/dist/ui/OptionSelector.js.map +0 -1
- package/dist/ui/Plugin.d.ts.map +0 -1
- package/dist/ui/Plugin.js.map +0 -1
- package/dist/ui/Progress.d.ts.map +0 -1
- package/dist/ui/Progress.js.map +0 -1
- package/dist/ui/Skills.d.ts.map +0 -1
- package/dist/ui/Skills.js.map +0 -1
- package/dist/ui/StackSelector.d.ts.map +0 -1
- package/dist/ui/StackSelector.js.map +0 -1
- package/dist/ui/Summary.d.ts.map +0 -1
- package/dist/ui/Summary.js.map +0 -1
- package/dist/ui/Welcome.d.ts.map +0 -1
- package/dist/ui/Welcome.js.map +0 -1
- package/dist/ui/theme.d.ts.map +0 -1
- package/dist/ui/theme.js.map +0 -1
package/dist/commands/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { exportPluginAsAgentSkills, generateGlobalSkillsJson, generateProjectSkillsJson, importAgentSkillsPackage, } from "../lib/agent-skills.js";
|
|
2
|
+
import { exportPluginAsCodexToml } from "../lib/codex-export.js";
|
|
3
|
+
import { installPlugin, listInstalledPlugins, removePlugin, searchRegistry, syncPlugins, validatePlugin, } from "../lib/plugin.js";
|
|
4
4
|
function report(onStep, id, label, status, detail) {
|
|
5
5
|
onStep({ id, label, status, detail });
|
|
6
6
|
}
|
|
@@ -8,140 +8,185 @@ function report(onStep, id, label, status, detail) {
|
|
|
8
8
|
* Add (install) a plugin from a GitHub source.
|
|
9
9
|
*/
|
|
10
10
|
export async function runPluginAdd(source, dryRun, onStep) {
|
|
11
|
-
const stepId =
|
|
12
|
-
report(onStep, stepId, `Install plugin: ${source}`,
|
|
11
|
+
const stepId = "plugin-add";
|
|
12
|
+
report(onStep, stepId, `Install plugin: ${source}`, "running");
|
|
13
13
|
const result = await installPlugin(source, { dryRun });
|
|
14
14
|
if (result.success) {
|
|
15
|
-
report(onStep, stepId, `Install plugin: ${source}`,
|
|
15
|
+
report(onStep, stepId, `Install plugin: ${source}`, "done", dryRun
|
|
16
|
+
? `dry-run: would install ${result.name}`
|
|
17
|
+
: `installed ${result.name}`);
|
|
16
18
|
}
|
|
17
19
|
else {
|
|
18
|
-
report(onStep, stepId, `Install plugin: ${source}`,
|
|
20
|
+
report(onStep, stepId, `Install plugin: ${source}`, "error", result.error);
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* Remove an installed plugin by name.
|
|
23
25
|
*/
|
|
24
26
|
export async function runPluginRemove(name, dryRun, onStep) {
|
|
25
|
-
const stepId =
|
|
26
|
-
report(onStep, stepId, `Remove plugin: ${name}`,
|
|
27
|
+
const stepId = "plugin-remove";
|
|
28
|
+
report(onStep, stepId, `Remove plugin: ${name}`, "running");
|
|
27
29
|
const result = await removePlugin(name, { dryRun });
|
|
28
30
|
if (result.success) {
|
|
29
|
-
report(onStep, stepId, `Remove plugin: ${name}`,
|
|
31
|
+
report(onStep, stepId, `Remove plugin: ${name}`, "done", dryRun ? `dry-run: would remove ${name}` : `removed ${name}`);
|
|
30
32
|
}
|
|
31
33
|
else {
|
|
32
|
-
report(onStep, stepId, `Remove plugin: ${name}`,
|
|
34
|
+
report(onStep, stepId, `Remove plugin: ${name}`, "error", result.error);
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* List all installed plugins.
|
|
37
39
|
*/
|
|
38
40
|
export async function runPluginList(onStep) {
|
|
39
|
-
const stepId =
|
|
40
|
-
report(onStep, stepId,
|
|
41
|
+
const stepId = "plugin-list";
|
|
42
|
+
report(onStep, stepId, "List installed plugins", "running");
|
|
41
43
|
const plugins = await listInstalledPlugins();
|
|
42
44
|
if (plugins.length === 0) {
|
|
43
|
-
report(onStep, stepId,
|
|
45
|
+
report(onStep, stepId, "List installed plugins", "done", "no plugins installed");
|
|
44
46
|
}
|
|
45
47
|
else {
|
|
46
|
-
const summary = plugins.map(p => `${p.name}@${p.version}`).join(
|
|
47
|
-
report(onStep, stepId,
|
|
48
|
+
const summary = plugins.map((p) => `${p.name}@${p.version}`).join(", ");
|
|
49
|
+
report(onStep, stepId, "List installed plugins", "done", `${plugins.length} plugins: ${summary}`);
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
/**
|
|
51
53
|
* Search the remote plugin registry.
|
|
52
54
|
*/
|
|
53
55
|
export async function runPluginSearch(query, onStep) {
|
|
54
|
-
const stepId =
|
|
55
|
-
report(onStep, stepId, `Search plugins${query ? `: ${query}` :
|
|
56
|
+
const stepId = "plugin-search";
|
|
57
|
+
report(onStep, stepId, `Search plugins${query ? `: ${query}` : ""}`, "running");
|
|
56
58
|
const results = await searchRegistry(query);
|
|
57
59
|
if (results.length === 0) {
|
|
58
|
-
report(onStep, stepId, `Search plugins${query ? `: ${query}` :
|
|
60
|
+
report(onStep, stepId, `Search plugins${query ? `: ${query}` : ""}`, "done", query
|
|
61
|
+
? `no plugins matching "${query}"`
|
|
62
|
+
: "registry empty or unreachable");
|
|
59
63
|
}
|
|
60
64
|
else {
|
|
61
|
-
const summary = results
|
|
62
|
-
|
|
65
|
+
const summary = results
|
|
66
|
+
.map((p) => `${p.id} — ${p.description}`)
|
|
67
|
+
.join("\n ");
|
|
68
|
+
report(onStep, stepId, `Search plugins${query ? `: ${query}` : ""}`, "done", `${results.length} results:\n ${summary}`);
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
71
|
/**
|
|
66
72
|
* Validate a local plugin directory.
|
|
67
73
|
*/
|
|
68
74
|
export async function runPluginValidate(pluginDir, onStep) {
|
|
69
|
-
const stepId =
|
|
70
|
-
report(onStep, stepId, `Validate plugin: ${pluginDir}`,
|
|
75
|
+
const stepId = "plugin-validate";
|
|
76
|
+
report(onStep, stepId, `Validate plugin: ${pluginDir}`, "running");
|
|
71
77
|
const result = await validatePlugin(pluginDir);
|
|
72
78
|
if (result.valid) {
|
|
73
|
-
report(onStep, stepId, `Validate plugin: ${pluginDir}`,
|
|
79
|
+
report(onStep, stepId, `Validate plugin: ${pluginDir}`, "done", `valid — ${result.manifest?.name}@${result.manifest?.version}`);
|
|
74
80
|
}
|
|
75
81
|
else {
|
|
76
|
-
const msgs = result.errors
|
|
77
|
-
|
|
82
|
+
const msgs = result.errors
|
|
83
|
+
.map((e) => ` ${e.path}: ${e.message}`)
|
|
84
|
+
.join("\n");
|
|
85
|
+
report(onStep, stepId, `Validate plugin: ${pluginDir}`, "error", `${result.errors.length} errors:\n${msgs}`);
|
|
78
86
|
}
|
|
79
87
|
}
|
|
80
88
|
/**
|
|
81
89
|
* Sync detected plugins into the project manifest.
|
|
82
90
|
*/
|
|
83
91
|
export async function runPluginSync(projectDir, dryRun, onStep) {
|
|
84
|
-
const stepId =
|
|
85
|
-
report(onStep, stepId,
|
|
92
|
+
const stepId = "plugin-sync";
|
|
93
|
+
report(onStep, stepId, "Sync plugins", "running");
|
|
86
94
|
try {
|
|
87
95
|
const result = await syncPlugins(projectDir, { dryRun });
|
|
88
96
|
const parts = [];
|
|
89
97
|
if (result.added.length > 0)
|
|
90
|
-
parts.push(`added: ${result.added.join(
|
|
98
|
+
parts.push(`added: ${result.added.join(", ")}`);
|
|
91
99
|
if (result.removed.length > 0)
|
|
92
|
-
parts.push(`removed: ${result.removed.join(
|
|
100
|
+
parts.push(`removed: ${result.removed.join(", ")}`);
|
|
93
101
|
if (result.unchanged.length > 0)
|
|
94
|
-
parts.push(`unchanged: ${result.unchanged.join(
|
|
102
|
+
parts.push(`unchanged: ${result.unchanged.join(", ")}`);
|
|
103
|
+
if (result.wired.length > 0)
|
|
104
|
+
parts.push(`wired: ${result.wired.length} capabilities`);
|
|
105
|
+
if (result.unwired.length > 0)
|
|
106
|
+
parts.push(`unwired: ${result.unwired.length} capabilities`);
|
|
95
107
|
if (parts.length === 0)
|
|
96
|
-
parts.push(
|
|
97
|
-
const prefix = dryRun ?
|
|
98
|
-
report(onStep, stepId,
|
|
108
|
+
parts.push("no plugins detected");
|
|
109
|
+
const prefix = dryRun ? "dry-run: " : "";
|
|
110
|
+
report(onStep, stepId, "Sync plugins", "done", `${prefix}${parts.join(" | ")}`);
|
|
99
111
|
}
|
|
100
112
|
catch (e) {
|
|
101
113
|
const msg = e instanceof Error ? e.message : String(e);
|
|
102
|
-
report(onStep, stepId,
|
|
114
|
+
report(onStep, stepId, "Sync plugins", "error", msg);
|
|
103
115
|
}
|
|
104
116
|
}
|
|
105
117
|
/**
|
|
106
118
|
* Export an installed plugin to Agent Skills spec format.
|
|
107
119
|
*/
|
|
108
120
|
export async function runPluginExport(name, onStep) {
|
|
109
|
-
const stepId =
|
|
110
|
-
report(onStep, stepId, `Export plugin: ${name}`,
|
|
121
|
+
const stepId = "plugin-export";
|
|
122
|
+
report(onStep, stepId, `Export plugin: ${name}`, "running");
|
|
111
123
|
const result = await exportPluginAsAgentSkills(name);
|
|
112
124
|
if (result.success) {
|
|
113
|
-
report(onStep, stepId, `Export plugin: ${name}`,
|
|
125
|
+
report(onStep, stepId, `Export plugin: ${name}`, "done", `exported to ${result.path}`);
|
|
114
126
|
}
|
|
115
127
|
else {
|
|
116
|
-
report(onStep, stepId, `Export plugin: ${name}`,
|
|
128
|
+
report(onStep, stepId, `Export plugin: ${name}`, "error", result.error);
|
|
117
129
|
}
|
|
118
130
|
}
|
|
119
131
|
/**
|
|
120
132
|
* Export an installed plugin to Codex-compatible TOML subagent files.
|
|
121
133
|
*/
|
|
122
134
|
export async function runPluginExportCodex(name, onStep) {
|
|
123
|
-
const stepId =
|
|
124
|
-
report(onStep, stepId, `Export plugin as Codex TOML: ${name}`,
|
|
135
|
+
const stepId = "plugin-export-codex";
|
|
136
|
+
report(onStep, stepId, `Export plugin as Codex TOML: ${name}`, "running");
|
|
125
137
|
const result = await exportPluginAsCodexToml(name);
|
|
126
138
|
if (result.success) {
|
|
127
|
-
report(onStep, stepId, `Export plugin as Codex TOML: ${name}`,
|
|
139
|
+
report(onStep, stepId, `Export plugin as Codex TOML: ${name}`, "done", `exported ${result.files?.length} TOML file(s)`);
|
|
128
140
|
}
|
|
129
141
|
else {
|
|
130
|
-
report(onStep, stepId, `Export plugin as Codex TOML: ${name}`,
|
|
142
|
+
report(onStep, stepId, `Export plugin as Codex TOML: ${name}`, "error", result.error);
|
|
131
143
|
}
|
|
132
144
|
}
|
|
133
145
|
/**
|
|
134
146
|
* Import an Agent Skills spec package and convert to javi-forge plugin format.
|
|
135
147
|
*/
|
|
136
148
|
export async function runPluginImport(sourceDir, dryRun, onStep) {
|
|
137
|
-
const stepId =
|
|
138
|
-
report(onStep, stepId, `Import agent-skills package: ${sourceDir}`,
|
|
149
|
+
const stepId = "plugin-import";
|
|
150
|
+
report(onStep, stepId, `Import agent-skills package: ${sourceDir}`, "running");
|
|
139
151
|
const result = await importAgentSkillsPackage(sourceDir, { dryRun });
|
|
140
152
|
if (result.success) {
|
|
141
|
-
report(onStep, stepId, `Import agent-skills package: ${sourceDir}`,
|
|
153
|
+
report(onStep, stepId, `Import agent-skills package: ${sourceDir}`, "done", dryRun
|
|
154
|
+
? `dry-run: would import ${result.name}`
|
|
155
|
+
: `imported ${result.name}`);
|
|
142
156
|
}
|
|
143
157
|
else {
|
|
144
|
-
report(onStep, stepId, `Import agent-skills package: ${sourceDir}`,
|
|
158
|
+
report(onStep, stepId, `Import agent-skills package: ${sourceDir}`, "error", result.error);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Generate a project-level skills.json from all installed plugins.
|
|
163
|
+
* Makes the project discoverable by `npx skills add` and 40+ AI agents.
|
|
164
|
+
*/
|
|
165
|
+
export async function runPluginExportSkillsJson(projectDir, dryRun, onStep) {
|
|
166
|
+
const stepId = "plugin-export-skills-json";
|
|
167
|
+
report(onStep, stepId, "Generate project skills.json", "running");
|
|
168
|
+
const result = await generateProjectSkillsJson(projectDir, { dryRun });
|
|
169
|
+
if (result.success) {
|
|
170
|
+
const prefix = dryRun ? "dry-run: would generate" : "generated";
|
|
171
|
+
report(onStep, stepId, "Generate project skills.json", "done", `${prefix} ${result.path} (${result.skillCount} skills from ${result.pluginCount} plugins)`);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
report(onStep, stepId, "Generate project skills.json", "error", result.error);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Generate a global skills.json from all globally installed plugins.
|
|
179
|
+
*/
|
|
180
|
+
export async function runPluginExportGlobalSkillsJson(dryRun, onStep) {
|
|
181
|
+
const stepId = "plugin-export-global-skills-json";
|
|
182
|
+
report(onStep, stepId, "Generate global skills.json", "running");
|
|
183
|
+
const result = await generateGlobalSkillsJson({ dryRun });
|
|
184
|
+
if (result.success) {
|
|
185
|
+
const prefix = dryRun ? "dry-run: would generate" : "generated";
|
|
186
|
+
report(onStep, stepId, "Generate global skills.json", "done", `${prefix} ${result.path} (${result.skillCount} skills from ${result.pluginCount} plugins)`);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
report(onStep, stepId, "Generate global skills.json", "error", result.error);
|
|
145
190
|
}
|
|
146
191
|
}
|
|
147
192
|
//# sourceMappingURL=plugin.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type SecurityMode =
|
|
3
|
-
export type SecurityStepStatus =
|
|
1
|
+
import type { SecurityBaseline, SecurityCheckOptions, SecurityCheckResult, SecurityFinding, SecuritySeverity, SecuritySummary, Stack } from "../types/index.js";
|
|
2
|
+
export type SecurityMode = "baseline" | "check" | "update" | "allowlist";
|
|
3
|
+
export type SecurityStepStatus = "pending" | "running" | "done" | "error" | "skipped";
|
|
4
4
|
export interface SecurityStep {
|
|
5
5
|
id: string;
|
|
6
6
|
label: string;
|
|
@@ -18,8 +18,14 @@ export declare function parsePipAudit(raw: string): SecurityFinding[];
|
|
|
18
18
|
export declare function parseCargoAudit(raw: string): SecurityFinding[];
|
|
19
19
|
export declare function parseGovulncheck(raw: string): SecurityFinding[];
|
|
20
20
|
export declare function parseAuditOutput(stack: Stack, raw: string): SecurityFinding[];
|
|
21
|
-
export declare function
|
|
21
|
+
export declare function severityAtOrAbove(severity: SecuritySeverity, threshold: SecuritySeverity): boolean;
|
|
22
|
+
export declare function filterBySeverity(findings: SecurityFinding[], minSeverity: SecuritySeverity): SecurityFinding[];
|
|
23
|
+
export declare function filterAllowlisted(findings: SecurityFinding[], allowlist: string[]): SecurityFinding[];
|
|
24
|
+
export declare function checkStaleness(baseline: SecurityBaseline, staleDays: number): string | undefined;
|
|
25
|
+
export declare function baselineAgeDays(baseline: SecurityBaseline): number;
|
|
26
|
+
export declare function computeSummary(current: SecurityFinding[], regressions: SecurityFinding[], resolved: SecurityFinding[], filteredRegressions: SecurityFinding[], baseline: SecurityBaseline): SecuritySummary;
|
|
27
|
+
export declare function detectRegressions(baseline: SecurityBaseline, current: SecurityFinding[], options?: SecurityCheckOptions): SecurityCheckResult;
|
|
22
28
|
export declare function readBaseline(projectDir: string): Promise<SecurityBaseline | null>;
|
|
23
29
|
export declare function writeBaseline(projectDir: string, baseline: SecurityBaseline): Promise<void>;
|
|
24
|
-
export declare function runSecurity(mode: SecurityMode, projectDir: string, onStep: SecurityStepCallback): Promise<SecurityCheckResult | null>;
|
|
30
|
+
export declare function runSecurity(mode: SecurityMode, projectDir: string, onStep: SecurityStepCallback, options?: SecurityCheckOptions): Promise<SecurityCheckResult | null>;
|
|
25
31
|
//# sourceMappingURL=security.d.ts.map
|