@fprad0/skill-master-mcp 0.0.9 → 0.0.10
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/CHANGELOG.md +11 -0
- package/README.md +16 -2
- package/VERSION.md +3 -3
- package/bin/lib/menu-core.mjs +651 -16
- package/bin/skill-master-bootstrap-global.mjs +14 -1
- package/bin/skill-master-doctor.mjs +168 -0
- package/bin/skill-master-install-global-skills.mjs +30 -10
- package/bin/skill-master-menu.mjs +184 -36
- package/bin/skill-master-register-clients.mjs +26 -3
- package/dist/index.js +30 -5
- package/dist/index.js.map +1 -1
- package/docs/skill-candidates/v0.0.10/cli-creator/LICENSE.txt +201 -0
- package/docs/skill-candidates/v0.0.10/cli-creator/SKILL.md +160 -0
- package/docs/skill-candidates/v0.0.10/cli-creator/agents/openai.yaml +4 -0
- package/docs/skill-candidates/v0.0.10/cli-creator/references/agent-cli-patterns.md +154 -0
- package/docs/skill-candidates/v0.0.10/developer-workstation-ops/SKILL.md +32 -0
- package/docs/skill-candidates/v0.0.10/figma/LICENSE.txt +2 -0
- package/docs/skill-candidates/v0.0.10/figma/SKILL.md +42 -0
- package/docs/skill-candidates/v0.0.10/figma/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma/references/figma-mcp-config.md +35 -0
- package/docs/skill-candidates/v0.0.10/figma/references/figma-tools-and-prompts.md +34 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/LICENSE.TXT +2 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/SKILL.md +349 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/references/mapping-checklist.md +7 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/scripts/normalize_node_id.py +25 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/LICENSE.TXT +2 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/SKILL.md +537 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/references/rule-template.md +15 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/scripts/check_agents_md.sh +9 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/LICENSE.TXT +2 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/SKILL.md +341 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/maintainers.yml +1 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/LICENSE.TXT +2 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/SKILL.md +314 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/maintainers.yml +3 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/code-connect-setup.md +260 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/component-creation.md +1014 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/discovery-phase.md +518 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/documentation-creation.md +834 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/error-recovery.md +540 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/naming-conventions.md +527 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/token-creation.md +962 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/bindVariablesToComponent.js +110 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/cleanupOrphans.js +127 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createComponentWithVariants.js +148 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createDocumentationPage.js +139 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createSemanticTokens.js +108 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createVariableCollection.js +49 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/inspectFileStructure.js +121 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/rehydrateState.js +92 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/validateCreation.js +83 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/LICENSE.txt +2 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/SKILL.md +258 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-use/LICENSE.TXT +2 -0
- package/docs/skill-candidates/v0.0.10/figma-use/SKILL.md +233 -0
- package/docs/skill-candidates/v0.0.10/figma-use/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-use/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-use/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-use/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-use/maintainers.yml +1 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/api-reference.md +301 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/common-patterns.md +512 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/component-patterns.md +488 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/effect-style-patterns.md +123 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/gotchas.md +599 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/maintainers.yml +12 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/plugin-api-patterns.md +513 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/plugin-api-standalone.d.ts +11293 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/plugin-api-standalone.index.md +441 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/text-style-patterns.md +203 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/validation-and-recovery.md +109 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/variable-patterns.md +354 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/maintainers.yml +9 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-components--creating.md +17 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-components--using.md +17 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-components.md +50 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-effect-styles.md +52 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-text-styles.md +90 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-variables--creating.md +13 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-variables--using.md +13 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-variables.md +64 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds.md +41 -0
- package/docs/skill-candidates/v0.0.10/frontend-design/LICENSE.txt +177 -0
- package/docs/skill-candidates/v0.0.10/frontend-design/SKILL.md +55 -0
- package/docs/skill-candidates/v0.0.10/frontend-ui-ux-systems/SKILL.md +32 -0
- package/docs/skill-candidates/v0.0.10/github/SKILL.md +74 -0
- package/docs/skill-candidates/v0.0.10/github/agents/openai.yaml +6 -0
- package/docs/skill-candidates/v0.0.10/github/assets/github-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/github/assets/github.png +0 -0
- package/docs/skill-candidates/v0.0.10/image-graphic-design-rendering/SKILL.md +28 -0
- package/docs/skill-candidates/v0.0.10/language-quality-pt-en-fr-it-ru/SKILL.md +28 -0
- package/docs/skill-candidates/v0.0.10/math-physics-reasoning/SKILL.md +28 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/LICENSE.txt +202 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/SKILL.md +236 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/reference/evaluation.md +602 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/reference/node_mcp_server.md +970 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/reference/python_mcp_server.md +719 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/connections.py +151 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/evaluation.py +373 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/requirements.txt +2 -0
- package/docs/skill-candidates/v0.0.10/mcp-client-readiness/SKILL.md +31 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/LICENSE.txt +201 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/SKILL.md +161 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/assets/openai-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/assets/openai.png +0 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/references/latest-model.md +37 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/references/prompting-guide.md +244 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/references/upgrade-guide.md +181 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/scripts/fetch-codex-manual.mjs +598 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/scripts/resolve-latest-model-info.js +147 -0
- package/docs/skill-candidates/v0.0.10/playwright/LICENSE.txt +201 -0
- package/docs/skill-candidates/v0.0.10/playwright/NOTICE.txt +14 -0
- package/docs/skill-candidates/v0.0.10/playwright/SKILL.md +147 -0
- package/docs/skill-candidates/v0.0.10/playwright/agents/openai.yaml +6 -0
- package/docs/skill-candidates/v0.0.10/playwright/assets/playwright-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/playwright/assets/playwright.png +0 -0
- package/docs/skill-candidates/v0.0.10/playwright/references/cli.md +116 -0
- package/docs/skill-candidates/v0.0.10/playwright/references/workflows.md +95 -0
- package/docs/skill-candidates/v0.0.10/playwright/scripts/playwright_cli.sh +25 -0
- package/docs/skill-candidates/v0.0.10/polyglot-backend-engineering/SKILL.md +32 -0
- package/docs/skill-candidates/v0.0.10/screenshot/LICENSE.txt +201 -0
- package/docs/skill-candidates/v0.0.10/screenshot/SKILL.md +267 -0
- package/docs/skill-candidates/v0.0.10/screenshot/agents/openai.yaml +6 -0
- package/docs/skill-candidates/v0.0.10/screenshot/assets/screenshot-small.svg +5 -0
- package/docs/skill-candidates/v0.0.10/screenshot/assets/screenshot.png +0 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/ensure_macos_permissions.sh +54 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/macos_display_info.swift +22 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/macos_permissions.swift +40 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/macos_window_info.swift +126 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/take_screenshot.ps1 +163 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/take_screenshot.py +585 -0
- package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/SKILL.md +62 -0
- package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/agents/openai.yaml +4 -0
- package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/references/activation-policy.md +77 -0
- package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/references/human-approval-policy.md +83 -0
- package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/references/persona-dev-senior-master.md +46 -0
- package/docs/skill-candidates/v0.0.10/terminal-menu-operations/SKILL.md +30 -0
- package/docs/skill-candidates/v0.0.10/terminal-pixel-art-tui/SKILL.md +43 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/LICENSE.txt +202 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/SKILL.md +96 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/examples/console_logging.py +35 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/examples/element_discovery.py +40 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/examples/static_html_automation.py +33 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/scripts/with_server.py +106 -0
- package/docs/skill-candidates/v0.0.10/winui-app/LICENSE.txt +202 -0
- package/docs/skill-candidates/v0.0.10/winui-app/SKILL.md +94 -0
- package/docs/skill-candidates/v0.0.10/winui-app/agents/openai.yaml +5 -0
- package/docs/skill-candidates/v0.0.10/winui-app/assets/winui.png +0 -0
- package/docs/skill-candidates/v0.0.10/winui-app/config.yaml +50 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/_sections.md +96 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/accessibility-input-and-localization.md +51 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/build-run-and-launch-verification.md +72 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/community-toolkit-controls-and-helpers.md +57 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/controls-layout-and-adaptive-ui.md +84 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-environment-audit-and-remediation.md +82 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-setup-and-project-selection.md +67 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-template-first-recovery.md +62 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-winui-app-structure.md +62 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/motion-animations-and-polish.md +45 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/performance-diagnostics-and-responsiveness.md +46 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/sample-source-map.md +37 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/shell-navigation-and-windowing.md +67 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/styling-theming-materials-and-icons.md +71 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/testing-debugging-and-review-checklists.md +77 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/windows-app-sdk-lifecycle-notifications-and-deployment.md +52 -0
- package/manifests/channels/beta.json +7 -7
- package/manifests/channels/stable.json +8 -8
- package/network/unapproved-skill-candidates.json +34 -1
- package/package.json +2 -1
package/bin/lib/menu-core.mjs
CHANGED
|
@@ -12,6 +12,11 @@ const ANSI = {
|
|
|
12
12
|
green: '\x1b[32m',
|
|
13
13
|
yellow: '\x1b[33m',
|
|
14
14
|
red: '\x1b[31m',
|
|
15
|
+
white: '\x1b[37m',
|
|
16
|
+
gray: '\x1b[90m',
|
|
17
|
+
teal: '\x1b[38;5;80m',
|
|
18
|
+
amber: '\x1b[38;5;179m',
|
|
19
|
+
blue: '\x1b[38;5;75m',
|
|
15
20
|
};
|
|
16
21
|
|
|
17
22
|
const REQUIRED_GLOBAL_SKILLS = [
|
|
@@ -25,12 +30,140 @@ const REQUIRED_GLOBAL_SKILLS = [
|
|
|
25
30
|
'engineering-systems-master',
|
|
26
31
|
'source-authority-reviewer',
|
|
27
32
|
'release-ethics-gate',
|
|
33
|
+
'mcp-client-readiness',
|
|
34
|
+
'terminal-menu-operations',
|
|
35
|
+
'terminal-pixel-art-tui',
|
|
28
36
|
];
|
|
29
37
|
|
|
38
|
+
const BUNDLED_SKILL_DOMAIN_GROUPS = [
|
|
39
|
+
{
|
|
40
|
+
key: 'moral',
|
|
41
|
+
label: 'moral-core',
|
|
42
|
+
skills: [
|
|
43
|
+
'ai-ethics-human-dignity',
|
|
44
|
+
'broad-domain-router',
|
|
45
|
+
'catholic-moral-discernment',
|
|
46
|
+
'engineering-systems-master',
|
|
47
|
+
'language-quality-pt-en-fr',
|
|
48
|
+
'math-science-reasoning',
|
|
49
|
+
'philosophy-sociology-discernment',
|
|
50
|
+
'professional-boundary-triage',
|
|
51
|
+
'release-ethics-gate',
|
|
52
|
+
'source-authority-reviewer',
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 'frontend',
|
|
57
|
+
label: 'frontend-ui',
|
|
58
|
+
skills: [
|
|
59
|
+
'figma',
|
|
60
|
+
'figma-code-connect-components',
|
|
61
|
+
'figma-create-design-system-rules',
|
|
62
|
+
'figma-generate-design',
|
|
63
|
+
'figma-generate-library',
|
|
64
|
+
'figma-implement-design',
|
|
65
|
+
'figma-use',
|
|
66
|
+
'frontend-design',
|
|
67
|
+
'frontend-ui-ux-systems',
|
|
68
|
+
'playwright',
|
|
69
|
+
'screenshot',
|
|
70
|
+
'webapp-testing',
|
|
71
|
+
'winui-app',
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: 'backend',
|
|
76
|
+
label: 'backend-data',
|
|
77
|
+
skills: [
|
|
78
|
+
'mcp-builder',
|
|
79
|
+
'polyglot-backend-engineering',
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: 'ops',
|
|
84
|
+
label: 'ops-clients',
|
|
85
|
+
skills: [
|
|
86
|
+
'cli-creator',
|
|
87
|
+
'developer-workstation-ops',
|
|
88
|
+
'github',
|
|
89
|
+
'mcp-client-readiness',
|
|
90
|
+
'openai-docs',
|
|
91
|
+
'skill-master-orchestrator',
|
|
92
|
+
'terminal-menu-operations',
|
|
93
|
+
'terminal-pixel-art-tui',
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
key: 'knowledge',
|
|
98
|
+
label: 'knowledge',
|
|
99
|
+
skills: [
|
|
100
|
+
'language-quality-pt-en-fr-it-ru',
|
|
101
|
+
'math-physics-reasoning',
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
const COMMAND_AREA_LABELS = {
|
|
107
|
+
status: 'diagnostico',
|
|
108
|
+
doctor: 'diagnostico',
|
|
109
|
+
check: 'desenvolvimento',
|
|
110
|
+
build: 'desenvolvimento',
|
|
111
|
+
publicNpm: 'distribuicao',
|
|
112
|
+
updateGlobal: 'distribuicao',
|
|
113
|
+
privateRegistry: 'registry',
|
|
114
|
+
activationStatus: 'ativacao',
|
|
115
|
+
activationBalanced: 'ativacao',
|
|
116
|
+
activationAlwaysOn: 'ativacao',
|
|
117
|
+
installGlobalSkills: 'skills-globais',
|
|
118
|
+
bootstrapGlobal: 'bootstrap-global',
|
|
119
|
+
registerClients: 'clientes-mcp',
|
|
120
|
+
promptRecommendation: 'roteamento',
|
|
121
|
+
successNotifications: 'aprendizado',
|
|
122
|
+
studySkills: 'aprendizado',
|
|
123
|
+
approvalPackage: 'aprovacao',
|
|
124
|
+
markLearnedStudy: 'aprovacao',
|
|
125
|
+
rejectLearnedSkill: 'aprovacao',
|
|
126
|
+
activateLearnedLocal: 'ativacao-skill',
|
|
127
|
+
activateLearnedGlobal: 'ativacao-skill',
|
|
128
|
+
notionSummary: 'documentacao',
|
|
129
|
+
};
|
|
130
|
+
|
|
30
131
|
function colorize(text, color, enabled) {
|
|
31
132
|
return enabled ? `${color}${text}${ANSI.reset}` : text;
|
|
32
133
|
}
|
|
33
134
|
|
|
135
|
+
function visibleLength(text) {
|
|
136
|
+
return String(text).replace(/\x1b\[[0-9;]*m/g, '').length;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function fitText(text, width) {
|
|
140
|
+
const value = String(text ?? '');
|
|
141
|
+
if (visibleLength(value) <= width) {
|
|
142
|
+
return `${value}${' '.repeat(width - visibleLength(value))}`;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return `${value.slice(0, Math.max(0, width - 1))}~`;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function splitText(text, width, maxLines = 3) {
|
|
149
|
+
const words = String(text ?? '').split(/\s+/).filter(Boolean);
|
|
150
|
+
const lines = [];
|
|
151
|
+
let current = '';
|
|
152
|
+
|
|
153
|
+
for (const word of words) {
|
|
154
|
+
const next = current ? `${current} ${word}` : word;
|
|
155
|
+
if (next.length <= width) {
|
|
156
|
+
current = next;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (current) lines.push(current);
|
|
160
|
+
current = word.length > width ? word.slice(0, width - 1) + '~' : word;
|
|
161
|
+
if (lines.length >= maxLines) break;
|
|
162
|
+
}
|
|
163
|
+
if (current && lines.length < maxLines) lines.push(current);
|
|
164
|
+
return lines.length ? lines : [''];
|
|
165
|
+
}
|
|
166
|
+
|
|
34
167
|
function globalSkillsRoot() {
|
|
35
168
|
return join(process.env.CODEX_HOME ?? join(os.homedir(), '.codex'), 'skills');
|
|
36
169
|
}
|
|
@@ -69,20 +202,38 @@ function readJsonState(filePath) {
|
|
|
69
202
|
}
|
|
70
203
|
}
|
|
71
204
|
|
|
205
|
+
function defaultClaudeConfigPath() {
|
|
206
|
+
if (process.platform === 'win32') {
|
|
207
|
+
return join(process.env.APPDATA ?? join(os.homedir(), 'AppData', 'Roaming'), 'Claude', 'claude_desktop_config.json');
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (process.platform === 'darwin') {
|
|
211
|
+
return join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return join(os.homedir(), '.config', 'Claude', 'claude_desktop_config.json');
|
|
215
|
+
}
|
|
216
|
+
|
|
72
217
|
function inspectGlobalReadiness() {
|
|
73
218
|
const root = globalSkillsRoot();
|
|
74
219
|
const installed = REQUIRED_GLOBAL_SKILLS.filter((name) => existsSync(join(root, name, 'SKILL.md')));
|
|
75
220
|
const missing = REQUIRED_GLOBAL_SKILLS.filter((name) => !installed.includes(name));
|
|
76
221
|
const codexConfigPath = join(process.env.CODEX_HOME ?? join(os.homedir(), '.codex'), 'config.toml');
|
|
77
|
-
const claudeConfigPath =
|
|
222
|
+
const claudeConfigPath = defaultClaudeConfigPath();
|
|
78
223
|
const geminiConfigPath = join(os.homedir(), '.gemini', 'settings.json');
|
|
224
|
+
const antigravityConfigPath = join(os.homedir(), '.gemini', 'config', 'mcp_config.json');
|
|
79
225
|
const codex = readClientConfigState(codexConfigPath);
|
|
80
226
|
const claude = readJsonState(claudeConfigPath);
|
|
81
227
|
const gemini = readJsonState(geminiConfigPath);
|
|
82
|
-
const
|
|
228
|
+
const antigravity = readJsonState(antigravityConfigPath);
|
|
229
|
+
const ready = missing.length === 0
|
|
230
|
+
&& codex.globalCommand
|
|
231
|
+
&& claude.globalCommand
|
|
232
|
+
&& gemini.globalCommand
|
|
233
|
+
&& antigravity.globalCommand;
|
|
83
234
|
const mode = ready
|
|
84
235
|
? 'ready'
|
|
85
|
-
: codex.kind === 'launcher' || claude.present || gemini.present
|
|
236
|
+
: codex.kind === 'launcher' || claude.present || gemini.present || antigravity.present
|
|
86
237
|
? 'partial'
|
|
87
238
|
: 'missing';
|
|
88
239
|
|
|
@@ -96,6 +247,7 @@ function inspectGlobalReadiness() {
|
|
|
96
247
|
codex,
|
|
97
248
|
claude,
|
|
98
249
|
gemini,
|
|
250
|
+
antigravity,
|
|
99
251
|
};
|
|
100
252
|
}
|
|
101
253
|
|
|
@@ -125,6 +277,7 @@ export function getMenuStatus(rootDir) {
|
|
|
125
277
|
?? join(process.env.SKILL_MASTER_HOME ?? join(process.env.HOME ?? process.env.USERPROFILE ?? '', '.skill-master'), 'data', 'success-learning');
|
|
126
278
|
const studyCandidates = readJson(rootDir, 'network/unapproved-skill-candidates.json');
|
|
127
279
|
const globalReadiness = inspectGlobalReadiness();
|
|
280
|
+
const bundledCatalog = inspectBundledSkillCatalog(rootDir);
|
|
128
281
|
|
|
129
282
|
return {
|
|
130
283
|
packageName: packageJson?.name ?? 'nao encontrado',
|
|
@@ -136,6 +289,7 @@ export function getMenuStatus(rootDir) {
|
|
|
136
289
|
pendingSuccessDrafts: countManifestFiles(successLearningDir),
|
|
137
290
|
studyCandidates: Array.isArray(studyCandidates?.candidates) ? studyCandidates.candidates.length : 0,
|
|
138
291
|
globalReadiness,
|
|
292
|
+
bundledCatalog,
|
|
139
293
|
};
|
|
140
294
|
}
|
|
141
295
|
|
|
@@ -157,21 +311,108 @@ function countManifestFiles(directory) {
|
|
|
157
311
|
return count;
|
|
158
312
|
}
|
|
159
313
|
|
|
314
|
+
function listBundledSkillNames(rootDir) {
|
|
315
|
+
const source = join(rootDir, 'docs', 'skill-candidates');
|
|
316
|
+
if (!existsSync(source)) {
|
|
317
|
+
return [];
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const entries = readdirSync(source, { withFileTypes: true });
|
|
321
|
+
const directSkills = entries
|
|
322
|
+
.filter((entry) => entry.isDirectory() && existsSync(join(source, entry.name, 'SKILL.md')))
|
|
323
|
+
.map((entry) => entry.name);
|
|
324
|
+
|
|
325
|
+
if (directSkills.length) {
|
|
326
|
+
return Array.from(new Set(directSkills)).sort();
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
return Array.from(new Set(
|
|
330
|
+
entries
|
|
331
|
+
.filter((entry) => entry.isDirectory())
|
|
332
|
+
.flatMap((entry) => {
|
|
333
|
+
const versionPath = join(source, entry.name);
|
|
334
|
+
return readdirSync(versionPath, { withFileTypes: true })
|
|
335
|
+
.filter((skillEntry) => skillEntry.isDirectory() && existsSync(join(versionPath, skillEntry.name, 'SKILL.md')))
|
|
336
|
+
.map((skillEntry) => skillEntry.name);
|
|
337
|
+
}),
|
|
338
|
+
)).sort();
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function inspectBundledSkillCatalog(rootDir) {
|
|
342
|
+
const names = listBundledSkillNames(rootDir);
|
|
343
|
+
const categories = BUNDLED_SKILL_DOMAIN_GROUPS.map((group) => ({
|
|
344
|
+
key: group.key,
|
|
345
|
+
label: group.label,
|
|
346
|
+
count: group.skills.filter((skill) => names.includes(skill)).length,
|
|
347
|
+
}));
|
|
348
|
+
|
|
349
|
+
return {
|
|
350
|
+
total: names.length,
|
|
351
|
+
names,
|
|
352
|
+
categories,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
function formatBundledCategoryLine(catalog) {
|
|
357
|
+
if (!catalog?.categories?.length) {
|
|
358
|
+
return 'bundled skills: 0';
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return catalog.categories
|
|
362
|
+
.filter((category) => category.count > 0)
|
|
363
|
+
.map((category) => `${category.label} ${category.count}`)
|
|
364
|
+
.join(' | ');
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function resolveCommandArea(action) {
|
|
368
|
+
if (!action) {
|
|
369
|
+
return 'geral';
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
return COMMAND_AREA_LABELS[action.key] ?? 'geral';
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function formatActionCommand(action) {
|
|
376
|
+
if (!action?.command) {
|
|
377
|
+
return '';
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
return [action.command, ...(action.args ?? [])].join(' ');
|
|
381
|
+
}
|
|
382
|
+
|
|
160
383
|
export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process.execPath }) {
|
|
384
|
+
const isDevCheckout = existsSync(join(rootDir, 'tsconfig.json')) && existsSync(join(rootDir, 'src'));
|
|
385
|
+
const repoOnlyReason = 'Disponivel apenas no clone de desenvolvimento; no pacote npm use Doctor ou Status.';
|
|
386
|
+
|
|
161
387
|
return [
|
|
162
388
|
{
|
|
163
389
|
key: 'status',
|
|
164
390
|
aliases: ['status'],
|
|
165
391
|
label: 'Status local',
|
|
166
392
|
description: 'Mostra versao local, manifesto e informacoes do pacote.',
|
|
393
|
+
details: ['Nao altera arquivos.', 'Use para confirmar se o menu esta lendo a instalacao correta.'],
|
|
394
|
+
success: 'Relatorio impresso com versao, canal, skills globais e clientes configurados.',
|
|
167
395
|
command: nodeExecPath,
|
|
168
396
|
args: [currentFile, '--status'],
|
|
169
397
|
},
|
|
398
|
+
{
|
|
399
|
+
key: 'doctor',
|
|
400
|
+
aliases: ['doctor', 'diagnostico', 'verificar-menu', 'validar-menu'],
|
|
401
|
+
label: 'Doctor do menu e clientes MCP',
|
|
402
|
+
description: 'Valida pacote, binarios, skills globais e registros em Codex, Claude, Gemini e Antigravity.',
|
|
403
|
+
details: ['Seguro para outros notebooks.', 'Nao publica versao e nao mexe em configuracoes sem uma acao separada.'],
|
|
404
|
+
success: 'Mostra um relatorio GO/NO-GO com proximos comandos recomendados.',
|
|
405
|
+
command: nodeExecPath,
|
|
406
|
+
args: [join(rootDir, 'bin', 'skill-master-doctor.mjs')],
|
|
407
|
+
},
|
|
170
408
|
{
|
|
171
409
|
key: 'check',
|
|
172
410
|
aliases: ['check', 'gate'],
|
|
173
411
|
label: 'Rodar gate completo',
|
|
174
412
|
description: 'Executa build, testes e validacao de manifestos.',
|
|
413
|
+
details: ['Exige clone do repositorio com src, testes e tsconfig.', 'Nao e uma acao indicada para instalacao global via npm.'],
|
|
414
|
+
success: 'Build, testes e manifestos passam no checkout de desenvolvimento.',
|
|
415
|
+
disabledReason: isDevCheckout ? null : repoOnlyReason,
|
|
175
416
|
command: 'npm',
|
|
176
417
|
args: ['run', 'check'],
|
|
177
418
|
},
|
|
@@ -180,6 +421,9 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
180
421
|
aliases: ['build'],
|
|
181
422
|
label: 'Rodar build',
|
|
182
423
|
description: 'Compila o projeto localmente.',
|
|
424
|
+
details: ['Exige clone do repositorio com tsconfig.', 'Pacotes npm publicados ja usam dist precompilado.'],
|
|
425
|
+
success: 'dist atualizado no checkout de desenvolvimento.',
|
|
426
|
+
disabledReason: isDevCheckout ? null : repoOnlyReason,
|
|
183
427
|
command: 'npm',
|
|
184
428
|
args: ['run', 'build'],
|
|
185
429
|
},
|
|
@@ -188,6 +432,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
188
432
|
aliases: ['public-npm', 'npm', 'registry'],
|
|
189
433
|
label: 'Validar pacote no npm publico',
|
|
190
434
|
description: 'Consulta a versao publicada em registry.npmjs.org.',
|
|
435
|
+
details: ['Usa somente leitura no registry publico.', 'Bom para confirmar se outro notebook consegue instalar por npm.'],
|
|
436
|
+
success: 'Retorna a versao publicada atualmente no npmjs.',
|
|
191
437
|
command: 'npm',
|
|
192
438
|
args: [
|
|
193
439
|
'view',
|
|
@@ -201,6 +447,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
201
447
|
aliases: ['update', 'update-global'],
|
|
202
448
|
label: 'Atualizar pacote global via npm',
|
|
203
449
|
description: 'Atualiza a instalacao global e exige reinicio do cliente MCP.',
|
|
450
|
+
details: ['Roda npm install -g fora do processo MCP stdio.', 'Use antes de abrir Codex, Claude, Gemini ou Antigravity.'],
|
|
451
|
+
success: 'Pacote global atualizado para a versao latest do npm publico.',
|
|
204
452
|
command: nodeExecPath,
|
|
205
453
|
args: [join(rootDir, 'bin', 'skill-master-update.mjs')],
|
|
206
454
|
confirmMessage: 'Atualizar o pacote global agora?',
|
|
@@ -210,6 +458,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
210
458
|
aliases: ['private-registry', 'private', 'github-packages'],
|
|
211
459
|
label: 'Configurar registry privado GitHub Packages',
|
|
212
460
|
description: 'Prepara o .npmrc e valida o acesso ao pacote privado.',
|
|
461
|
+
details: ['Uso avancado para ambientes privados.', 'Nao e necessario para o pacote publico do npmjs.'],
|
|
462
|
+
success: '.npmrc configurado e validacao npm view executada.',
|
|
213
463
|
command: nodeExecPath,
|
|
214
464
|
args: ['scripts/configure-private-registry.mjs', '--validate'],
|
|
215
465
|
confirmMessage: 'Rodar a configuracao de registry privado agora?',
|
|
@@ -219,6 +469,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
219
469
|
aliases: ['activation-status', 'modo', 'modo-ativacao'],
|
|
220
470
|
label: 'Modo de ativacao atual',
|
|
221
471
|
description: 'Mostra o modo manual, balanced ou always-on-assisted configurado localmente.',
|
|
472
|
+
details: ['Nao altera configuracao.', 'Ajuda a entender quando o Skill Master deve sugerir skills.'],
|
|
473
|
+
success: 'Modo atual e caminho da configuracao impressos no terminal.',
|
|
222
474
|
command: nodeExecPath,
|
|
223
475
|
args: [join(rootDir, 'bin', 'skill-master-activation.mjs'), '--status'],
|
|
224
476
|
},
|
|
@@ -227,6 +479,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
227
479
|
aliases: ['set-balanced', 'balanced'],
|
|
228
480
|
label: 'Usar modo balanced',
|
|
229
481
|
description: 'Define balanced como modo padrao de ativacao do Skill Master.',
|
|
482
|
+
details: ['Recomendado para uso diario.', 'Ativa o MCP quando ha ganho claro para o prompt.'],
|
|
483
|
+
success: 'Modo balanced salvo localmente.',
|
|
230
484
|
command: nodeExecPath,
|
|
231
485
|
args: [join(rootDir, 'bin', 'skill-master-activation.mjs'), '--set-mode', 'balanced'],
|
|
232
486
|
},
|
|
@@ -235,6 +489,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
235
489
|
aliases: ['set-always-on', 'always-on-assisted'],
|
|
236
490
|
label: 'Usar modo always-on-assisted',
|
|
237
491
|
description: 'Define avaliacao assistida quase sempre ativa, mantendo no-op quando nao houver ganho.',
|
|
492
|
+
details: ['Mais agressivo que balanced.', 'Indicado para usuarios que querem o Skill Master avaliando quase todos os prompts.'],
|
|
493
|
+
success: 'Modo always-on-assisted salvo localmente.',
|
|
238
494
|
command: nodeExecPath,
|
|
239
495
|
args: [join(rootDir, 'bin', 'skill-master-activation.mjs'), '--set-mode', 'always-on-assisted'],
|
|
240
496
|
confirmMessage: 'Alterar o modo local para always-on-assisted?',
|
|
@@ -244,6 +500,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
244
500
|
aliases: ['install-global-skills', 'skills-globais', 'global-skills'],
|
|
245
501
|
label: 'Instalar skills globais do Skill Master',
|
|
246
502
|
description: 'Copia as skills amplas e morais embutidas para CODEX_HOME/skills ou ~/.codex/skills.',
|
|
503
|
+
details: ['Necessario para Codex descobrir as skills globais.', 'Pode ser reexecutado com seguranca pelo bootstrap.'],
|
|
504
|
+
success: 'Skills globais copiadas para a pasta global do usuario.',
|
|
247
505
|
command: nodeExecPath,
|
|
248
506
|
args: [join(rootDir, 'bin', 'skill-master-install-global-skills.mjs')],
|
|
249
507
|
confirmMessage: 'Instalar as skills globais embutidas neste usuario?',
|
|
@@ -252,25 +510,31 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
252
510
|
key: 'bootstrapGlobal',
|
|
253
511
|
aliases: ['bootstrap-global', 'global-bootstrap', 'ativar-global-completo'],
|
|
254
512
|
label: 'Ativar MCP global neste computador',
|
|
255
|
-
description: 'Instala
|
|
513
|
+
description: 'Instala skills globais e registra Codex, Claude, Gemini e Antigravity no mesmo passo.',
|
|
514
|
+
details: ['Acao principal para notebooks novos.', 'Depois reinicie os clientes para eles recarregarem MCP e skills.'],
|
|
515
|
+
success: 'Skills instaladas e configuracoes MCP aplicadas nos clientes encontrados.',
|
|
256
516
|
command: nodeExecPath,
|
|
257
517
|
args: [join(rootDir, 'bin', 'skill-master-bootstrap-global.mjs')],
|
|
258
518
|
confirmMessage: 'Executar o bootstrap global do Skill Master neste computador?',
|
|
259
519
|
},
|
|
260
520
|
{
|
|
261
521
|
key: 'registerClients',
|
|
262
|
-
aliases: ['register-clients', 'registrar-clientes', 'codex-claude-gemini'],
|
|
263
|
-
label: 'Registrar
|
|
264
|
-
description: 'Gera/aplica configuracoes MCP para
|
|
522
|
+
aliases: ['register-clients', 'registrar-clientes', 'codex-claude-gemini', 'antigravity'],
|
|
523
|
+
label: 'Registrar clientes MCP',
|
|
524
|
+
description: 'Gera/aplica configuracoes MCP para Codex, Claude, Gemini e Antigravity reconhecerem skill_master.',
|
|
525
|
+
details: ['Usa o binario global skill-master-mcp.', 'Preserva outros servidores MCP ja existentes nos JSONs.'],
|
|
526
|
+
success: 'Arquivos de configuracao mesclados com o servidor skill_master.',
|
|
265
527
|
command: nodeExecPath,
|
|
266
528
|
args: [join(rootDir, 'bin', 'skill-master-register-clients.mjs'), '--apply-all'],
|
|
267
|
-
confirmMessage: 'Aplicar registro do skill_master em Codex, Claude e
|
|
529
|
+
confirmMessage: 'Aplicar registro do skill_master em Codex, Claude, Gemini e Antigravity?',
|
|
268
530
|
},
|
|
269
531
|
{
|
|
270
532
|
key: 'promptRecommendation',
|
|
271
533
|
aliases: ['recommend-prompt', 'recomendar-prompt', 'prompt-router'],
|
|
272
534
|
label: 'Ver recomendacao para um prompt',
|
|
273
535
|
description: 'Abre um fluxo interativo para avaliar um prompt pelo router local.',
|
|
536
|
+
details: ['Ajuda a decidir se skill-master, skill_master ou skill-master-mcp deve agir.', 'Nao publica nem altera skills.'],
|
|
537
|
+
success: 'Router imprime recomendacao, modo de ativacao e gates aplicaveis.',
|
|
274
538
|
command: nodeExecPath,
|
|
275
539
|
args: [join(rootDir, 'bin', 'skill-master-activation.mjs'), '--route-prompt-interactive'],
|
|
276
540
|
},
|
|
@@ -279,6 +543,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
279
543
|
aliases: ['notifications', 'notificacoes', 'success-notifications'],
|
|
280
544
|
label: 'Notificacoes de skills aprendidas',
|
|
281
545
|
description: 'Mostra drafts pendentes, aprovacoes e skills externas para estudar.',
|
|
546
|
+
details: ['Use para decidir o que aprovar, estudar ou rejeitar.', 'Nao ativa skill automaticamente.'],
|
|
547
|
+
success: 'Lista de pendencias e proximas acoes exibida.',
|
|
282
548
|
command: nodeExecPath,
|
|
283
549
|
args: [join(rootDir, 'bin', 'skill-master-success-skills.mjs'), '--notify'],
|
|
284
550
|
},
|
|
@@ -287,6 +553,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
287
553
|
aliases: ['study-skills', 'skills-estudo', 'estudar'],
|
|
288
554
|
label: 'Skills para estudar',
|
|
289
555
|
description: 'Lista skills externas e links de criadores ainda nao aprovados.',
|
|
556
|
+
details: ['Material de estudo, nao ativacao operacional.', 'Bom para revisao humana antes de virar skill local/global.'],
|
|
557
|
+
success: 'Links e motivos de estudo exibidos.',
|
|
290
558
|
command: nodeExecPath,
|
|
291
559
|
args: [join(rootDir, 'bin', 'skill-master-success-skills.mjs'), '--study'],
|
|
292
560
|
},
|
|
@@ -295,6 +563,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
295
563
|
aliases: ['approval-package', 'aprovar', 'pacote-aprovacao'],
|
|
296
564
|
label: 'Gerar pacote de aprovacao humana',
|
|
297
565
|
description: 'Cria um relatorio local para revisar e aprovar skills aprendidas.',
|
|
566
|
+
details: ['Exige decisao humana antes de ativacao.', 'Inclui riscos, evidencias e recomendacao.'],
|
|
567
|
+
success: 'Pacote local de aprovacao gerado.',
|
|
298
568
|
command: nodeExecPath,
|
|
299
569
|
args: [join(rootDir, 'bin', 'skill-master-success-skills.mjs'), '--approval-package'],
|
|
300
570
|
},
|
|
@@ -303,6 +573,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
303
573
|
aliases: ['mark-study', 'manter-estudo'],
|
|
304
574
|
label: 'Manter skill candidata para estudo',
|
|
305
575
|
description: 'Seleciona uma candidata e registra decisao de manter para estudo.',
|
|
576
|
+
details: ['Preserva historico sem ativar a skill.', 'Use quando a fonte ainda precisa revisao.'],
|
|
577
|
+
success: 'Decisao registrada no historico local.',
|
|
306
578
|
command: nodeExecPath,
|
|
307
579
|
args: [join(rootDir, 'bin', 'skill-master-success-skills.mjs'), '--mark-study-interactive'],
|
|
308
580
|
},
|
|
@@ -311,6 +583,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
311
583
|
aliases: ['reject-skill', 'rejeitar-skill'],
|
|
312
584
|
label: 'Rejeitar skill candidata',
|
|
313
585
|
description: 'Seleciona uma candidata, registra rejeicao e preserva historico.',
|
|
586
|
+
details: ['Nao apaga evidencias.', 'Use quando risco, fonte ou utilidade nao passam no gate.'],
|
|
587
|
+
success: 'Rejeicao registrada com motivo.',
|
|
314
588
|
command: nodeExecPath,
|
|
315
589
|
args: [join(rootDir, 'bin', 'skill-master-success-skills.mjs'), '--reject-interactive'],
|
|
316
590
|
confirmMessage: 'Abrir fluxo para rejeitar uma skill candidata?',
|
|
@@ -320,6 +594,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
320
594
|
aliases: ['activate-learned-local', 'ativar-local', 'skill-local'],
|
|
321
595
|
label: 'Ativar skill aprendida no workspace',
|
|
322
596
|
description: 'Instala uma skill aprendida em .codex/skills do projeto atual.',
|
|
597
|
+
details: ['Escopo limitado ao workspace.', 'Mais conservador que ativar globalmente.'],
|
|
598
|
+
success: 'Skill copiada para .codex/skills do projeto.',
|
|
323
599
|
command: nodeExecPath,
|
|
324
600
|
args: [join(rootDir, 'bin', 'skill-master-success-skills.mjs'), '--activate-interactive', '--target', 'local'],
|
|
325
601
|
confirmMessage: 'Selecionar e ativar uma skill aprendida no workspace atual?',
|
|
@@ -329,6 +605,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
329
605
|
aliases: ['activate-learned-global', 'ativar-global', 'skill-global'],
|
|
330
606
|
label: 'Ativar skill aprendida global',
|
|
331
607
|
description: 'Instala uma skill aprendida em CODEX_HOME/skills ou ~/.codex/skills.',
|
|
608
|
+
details: ['Afeta todos os projetos deste usuario.', 'Use apenas depois de aprovacao humana.'],
|
|
609
|
+
success: 'Skill instalada no diretorio global de skills.',
|
|
332
610
|
command: nodeExecPath,
|
|
333
611
|
args: [join(rootDir, 'bin', 'skill-master-success-skills.mjs'), '--activate-interactive', '--target', 'global'],
|
|
334
612
|
confirmMessage: 'Selecionar e ativar uma skill aprendida como skill global deste usuario?',
|
|
@@ -338,6 +616,8 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
338
616
|
aliases: ['notion-summary', 'resumo-notion'],
|
|
339
617
|
label: 'Abrir resumo para Notion',
|
|
340
618
|
description: 'Mostra um resumo copiavel do estado de ativacao para registrar no ledger Notion.',
|
|
619
|
+
details: ['Nao escreve no Notion sozinho.', 'Gera texto de continuidade para documentacao.'],
|
|
620
|
+
success: 'Resumo pronto para registro exibido.',
|
|
341
621
|
command: nodeExecPath,
|
|
342
622
|
args: [join(rootDir, 'bin', 'skill-master-activation.mjs'), '--notion-summary'],
|
|
343
623
|
},
|
|
@@ -347,8 +627,9 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
|
|
|
347
627
|
export function buildMenuChoices(commands) {
|
|
348
628
|
return commands.map((command) => ({
|
|
349
629
|
title: command.label,
|
|
350
|
-
description: command.description,
|
|
630
|
+
description: [command.description, command.success ? `Resultado: ${command.success}` : null].filter(Boolean).join(' '),
|
|
351
631
|
value: command.key,
|
|
632
|
+
disabled: command.disabledReason ?? false,
|
|
352
633
|
})).concat({
|
|
353
634
|
title: 'Sair',
|
|
354
635
|
description: 'Fecha o menu operacional.',
|
|
@@ -373,6 +654,7 @@ export function isInteractiveTerminal() {
|
|
|
373
654
|
|
|
374
655
|
export function formatStatusReport(status) {
|
|
375
656
|
const readiness = status.globalReadiness;
|
|
657
|
+
const bundledCatalog = status.bundledCatalog ?? { total: 0, categories: [] };
|
|
376
658
|
const lines = [
|
|
377
659
|
'Skill Master MCP - status local',
|
|
378
660
|
`Diretorio: ${status.rootDir}`,
|
|
@@ -384,9 +666,12 @@ export function formatStatusReport(status) {
|
|
|
384
666
|
`Skills externas para estudar: ${status.studyCandidates}`,
|
|
385
667
|
`Global readiness: ${readiness.ready ? 'pronto' : readiness.mode}`,
|
|
386
668
|
`Global skills instaladas: ${readiness.installed.length}/${readiness.required}`,
|
|
669
|
+
`Bundle de skills embutidas: ${bundledCatalog.total}`,
|
|
670
|
+
`Dominios do bundle: ${formatBundledCategoryLine(bundledCatalog)}`,
|
|
387
671
|
`Codex global: ${readiness.codex.globalCommand ? 'sim' : readiness.codex.kind}`,
|
|
388
672
|
`Claude global: ${readiness.claude.globalCommand ? 'sim' : readiness.claude.present ? 'nao-global' : 'ausente'}`,
|
|
389
673
|
`Gemini global: ${readiness.gemini.globalCommand ? 'sim' : readiness.gemini.present ? 'nao-global' : 'ausente'}`,
|
|
674
|
+
`Antigravity global: ${readiness.antigravity.globalCommand ? 'sim' : readiness.antigravity.present ? 'nao-global' : 'ausente'}`,
|
|
390
675
|
];
|
|
391
676
|
|
|
392
677
|
if (status.versionText) {
|
|
@@ -404,7 +689,7 @@ function formatGlobalAlert(status, { useColor = false } = {}) {
|
|
|
404
689
|
[
|
|
405
690
|
colorize('GLOBAL READY', ANSI.bold, useColor),
|
|
406
691
|
'O MCP esta reconhecido como comando global neste computador.',
|
|
407
|
-
'Codex, Claude e
|
|
692
|
+
'Codex, Claude, Gemini e Antigravity podem ser apontados para skill-master-mcp.',
|
|
408
693
|
'A instalacao global e as skills embutidas ja estao prontas para uso.',
|
|
409
694
|
],
|
|
410
695
|
{ color: ANSI.green, useColor },
|
|
@@ -417,7 +702,7 @@ function formatGlobalAlert(status, { useColor = false } = {}) {
|
|
|
417
702
|
colorize('ALERTA GLOBAL', ANSI.bold, useColor),
|
|
418
703
|
'Este computador ainda nao esta pronto para uso global do Skill Master.',
|
|
419
704
|
'Execute agora: skill-master-menu --run bootstrap-global --yes',
|
|
420
|
-
'Isso instala as skills globais e registra Codex, Claude e
|
|
705
|
+
'Isso instala as skills globais e registra Codex, Claude, Gemini e Antigravity.',
|
|
421
706
|
],
|
|
422
707
|
{ color: ANSI.red, useColor },
|
|
423
708
|
),
|
|
@@ -441,12 +726,14 @@ function renderPanelLines(lines, { color = ANSI.cyan, useColor = false } = {}) {
|
|
|
441
726
|
}
|
|
442
727
|
|
|
443
728
|
export function formatMenuBanner(status, { useColor = false } = {}) {
|
|
729
|
+
const bundledCatalog = status.bundledCatalog ?? { total: 0, categories: [] };
|
|
444
730
|
const lines = [
|
|
445
731
|
colorize('Skill Master MCP', ANSI.bold, useColor),
|
|
446
732
|
'Menu operacional para manutencao local',
|
|
447
733
|
`Versao local ${status.semver} | canal ${status.manifestVersion}`,
|
|
448
734
|
`Pendencias: ${status.pendingSuccessDrafts} drafts | estudo: ${status.studyCandidates} links`,
|
|
449
735
|
`Global: ${status.globalReadiness.ready ? 'pronto' : 'requer instalacao global'}`,
|
|
736
|
+
`Bundle: ${bundledCatalog.total} skills | ${formatBundledCategoryLine(bundledCatalog)}`,
|
|
450
737
|
colorize('Setas + Enter para navegar', ANSI.dim, useColor),
|
|
451
738
|
];
|
|
452
739
|
return [
|
|
@@ -455,12 +742,356 @@ export function formatMenuBanner(status, { useColor = false } = {}) {
|
|
|
455
742
|
].join('\n\n');
|
|
456
743
|
}
|
|
457
744
|
|
|
745
|
+
function dnaPanelLines(tick, width, height, status, { useColor = false, compact = false } = {}) {
|
|
746
|
+
const lines = [];
|
|
747
|
+
const center = Math.floor(width / 2);
|
|
748
|
+
const graphLeft = 2;
|
|
749
|
+
const graphRight = Math.max(graphLeft + 8, width - 3);
|
|
750
|
+
const graphWidth = Math.max(10, graphRight - graphLeft + 1);
|
|
751
|
+
const radius = Math.max(3, Math.floor((graphWidth - 4) / 3.35));
|
|
752
|
+
const phase = tick / 6;
|
|
753
|
+
const bodyHeight = Math.max(compact ? 6 : 8, height - (compact ? 5 : 6));
|
|
754
|
+
const scanRow = bodyHeight > 0 ? tick % bodyHeight : 0;
|
|
755
|
+
|
|
756
|
+
lines.push(fitText(colorize('GENOME MATRIX', ANSI.bold, useColor), width));
|
|
757
|
+
lines.push(fitText(colorize(compact ? 'lab helix / scan stable' : 'procedural intelligence helix', ANSI.dim, useColor), width));
|
|
758
|
+
if (!compact) {
|
|
759
|
+
lines.push(fitText(colorize('signal map / sync locked / low flicker', ANSI.gray, useColor), width));
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
const place = (cells, col, char, color) => {
|
|
763
|
+
if (col >= 0 && col < width) cells[col] = colorize(char, color, useColor);
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
for (let row = 0; row < bodyHeight; row += 1) {
|
|
767
|
+
const angle = row * 0.49 + phase;
|
|
768
|
+
const left = Math.round(center + Math.sin(angle) * radius);
|
|
769
|
+
const right = Math.round(center + Math.sin(angle + Math.PI) * radius);
|
|
770
|
+
const min = Math.min(left, right);
|
|
771
|
+
const max = Math.max(left, right);
|
|
772
|
+
const chars = Array.from({ length: width }, () => ' ');
|
|
773
|
+
const front = Math.cos(angle) >= 0;
|
|
774
|
+
const leftColor = front ? ANSI.teal : ANSI.blue;
|
|
775
|
+
const rightColor = front ? ANSI.amber : ANSI.gray;
|
|
776
|
+
const bondColor = front ? ANSI.gray : ANSI.blue;
|
|
777
|
+
const scanActive = row === scanRow;
|
|
778
|
+
|
|
779
|
+
place(chars, graphLeft, row === 0 ? '┌' : row === bodyHeight - 1 ? '└' : '│', ANSI.gray);
|
|
780
|
+
place(chars, graphRight, row === 0 ? '┐' : row === bodyHeight - 1 ? '┘' : '│', ANSI.gray);
|
|
781
|
+
|
|
782
|
+
if (row === 0 || row === bodyHeight - 1) {
|
|
783
|
+
for (let col = graphLeft + 1; col < graphRight; col += 1) {
|
|
784
|
+
place(chars, col, '─', ANSI.gray);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
for (let col = min + 2; col < max - 1; col += 1) {
|
|
789
|
+
const rungChar = row % 4 < 2 ? '═' : '─';
|
|
790
|
+
place(chars, col, scanActive ? '█' : rungChar, scanActive ? ANSI.white : bondColor);
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
place(chars, left - 1, '▓', leftColor);
|
|
794
|
+
place(chars, left, scanActive ? '█' : row % 2 === 0 ? '█' : '▓', scanActive ? ANSI.white : leftColor);
|
|
795
|
+
place(chars, left + 1, '▓', leftColor);
|
|
796
|
+
place(chars, right - 1, '▓', rightColor);
|
|
797
|
+
place(chars, right, scanActive ? '█' : row % 2 === 0 ? '█' : '▓', scanActive ? ANSI.white : rightColor);
|
|
798
|
+
place(chars, right + 1, '▓', rightColor);
|
|
799
|
+
|
|
800
|
+
if (row % 4 === 1 || row % 4 === 2) {
|
|
801
|
+
place(chars, center, scanActive ? '◆' : '◆', scanActive ? ANSI.white : ANSI.gray);
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
lines.push(chars.join(''));
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
lines.push(fitText('', width));
|
|
808
|
+
lines.push(fitText(colorize(compact ? 'helix stable' : 'helix stable lattice aligned', ANSI.gray, useColor), width));
|
|
809
|
+
lines.push(fitText(colorize(compact ? `global ${status.globalReadiness.installed.length}/${status.globalReadiness.required}` : `global ${status.globalReadiness.installed.length}/${status.globalReadiness.required} clients linked`, ANSI.amber, useColor), width));
|
|
810
|
+
|
|
811
|
+
return lines.slice(0, height).map((line) => fitText(line, width));
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
function renderMeterBar(value, total, width, { useColor = false, color = ANSI.teal } = {}) {
|
|
815
|
+
const safeTotal = Math.max(1, total);
|
|
816
|
+
const safeValue = Math.max(0, Math.min(value, safeTotal));
|
|
817
|
+
const fill = Math.round((safeValue / safeTotal) * width);
|
|
818
|
+
const filled = '█'.repeat(fill);
|
|
819
|
+
const empty = '░'.repeat(Math.max(0, width - fill));
|
|
820
|
+
return `${colorize(filled, color, useColor)}${colorize(empty, ANSI.gray, useColor)}`;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
function renderSparkline(series, { useColor = false, color = ANSI.teal } = {}) {
|
|
824
|
+
const blocks = ['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'];
|
|
825
|
+
return series.map((value) => colorize(blocks[Math.max(0, Math.min(blocks.length - 1, value))], color, useColor)).join('');
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
function buildTelemetrySeries(seed, length, tick) {
|
|
829
|
+
return Array.from({ length }, (_, index) => {
|
|
830
|
+
const raw = Math.sin((index + 1 + seed) * 0.72 + tick * 0.18) + Math.cos((index + seed) * 0.33 + tick * 0.11);
|
|
831
|
+
const normalized = Math.max(0, Math.min(1, (raw + 2) / 4));
|
|
832
|
+
return Math.round(normalized * 7);
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
function buildOverviewSignalLine(status, width, tick, { useColor = false, compact = false } = {}) {
|
|
837
|
+
const signalWidth = Math.max(6, Math.min(compact ? 8 : 12, Math.floor(width / (compact ? 10 : 8))));
|
|
838
|
+
const healthWidth = Math.max(6, Math.min(compact ? 8 : 12, Math.floor(width / (compact ? 10 : 8))));
|
|
839
|
+
const signal = renderSparkline(
|
|
840
|
+
buildTelemetrySeries(status.globalReadiness.installed.length + status.pendingSuccessDrafts, signalWidth, tick),
|
|
841
|
+
{ useColor, color: ANSI.teal },
|
|
842
|
+
);
|
|
843
|
+
const health = renderSparkline(
|
|
844
|
+
buildTelemetrySeries(status.studyCandidates + (status.globalReadiness.ready ? 7 : 3), healthWidth, tick + 3),
|
|
845
|
+
{ useColor, color: ANSI.amber },
|
|
846
|
+
);
|
|
847
|
+
return compact
|
|
848
|
+
? `signal ${signal} health ${health}`
|
|
849
|
+
: `signal ${signal} health ${health}`;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
function telemetryPanelLines(status, selected, width, height, { useColor = false, tick = 0, compact = false } = {}) {
|
|
853
|
+
const commandArea = resolveCommandArea(selected);
|
|
854
|
+
const bundledCatalog = status.bundledCatalog ?? { total: 0, categories: [] };
|
|
855
|
+
const categoryLead = bundledCatalog.categories
|
|
856
|
+
?.filter((category) => category.count > 0)
|
|
857
|
+
.sort((left, right) => right.count - left.count)[0];
|
|
858
|
+
const categoryName = categoryLead?.label ?? 'none';
|
|
859
|
+
const categoryCount = categoryLead?.count ?? 0;
|
|
860
|
+
const meterWidth = Math.max(8, Math.min(16, width - 14));
|
|
861
|
+
const sparkWidth = Math.max(8, Math.min(compact ? 8 : 12, width - 18));
|
|
862
|
+
const skillsSpark = renderSparkline(buildTelemetrySeries(status.globalReadiness.installed.length + categoryCount, sparkWidth, tick), { useColor, color: ANSI.amber });
|
|
863
|
+
const draftsSpark = renderSparkline(buildTelemetrySeries(status.pendingSuccessDrafts + 2, sparkWidth, tick + 2), { useColor, color: ANSI.teal });
|
|
864
|
+
const studySpark = renderSparkline(buildTelemetrySeries(status.studyCandidates + 4, sparkWidth, tick + 4), { useColor, color: ANSI.blue });
|
|
865
|
+
const lines = [
|
|
866
|
+
fitText(colorize('SYSTEM WINDOWS', ANSI.bold, useColor), width),
|
|
867
|
+
fitText(colorize(`selected area ${commandArea}`, ANSI.gray, useColor), width),
|
|
868
|
+
fitText(colorize(`dominant skill ${categoryName} ${categoryCount}`, ANSI.gray, useColor), width),
|
|
869
|
+
fitText(`bundle ${String(bundledCatalog.total).padStart(2, '0')} ${renderMeterBar(bundledCatalog.total, Math.max(36, bundledCatalog.total), meterWidth, { useColor, color: ANSI.white })}`, width),
|
|
870
|
+
fitText(`global ${status.globalReadiness.installed.length}/${status.globalReadiness.required} ${renderMeterBar(status.globalReadiness.installed.length, status.globalReadiness.required, meterWidth, { useColor, color: ANSI.amber })}`, width),
|
|
871
|
+
fitText(`skills ${skillsSpark}`, width),
|
|
872
|
+
fitText(`drafts ${String(status.pendingSuccessDrafts).padStart(2, '0')} ${renderMeterBar(status.pendingSuccessDrafts, Math.max(6, status.pendingSuccessDrafts || 1), meterWidth, { useColor, color: ANSI.teal })}`, width),
|
|
873
|
+
fitText(`queue ${draftsSpark}`, width),
|
|
874
|
+
fitText(`study ${String(status.studyCandidates).padStart(2, '0')} ${renderMeterBar(status.studyCandidates, Math.max(8, status.studyCandidates || 1), meterWidth, { useColor, color: ANSI.blue })}`, width),
|
|
875
|
+
fitText(`links ${studySpark}`, width),
|
|
876
|
+
fitText(colorize(compact ? 'codex / claude / gemini' : 'codex / claude / gemini / antigravity', ANSI.dim, useColor), width),
|
|
877
|
+
];
|
|
878
|
+
|
|
879
|
+
return lines.slice(0, height).map((line) => fitText(line, width));
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
function renderBox(lines, width, title, { useColor = false, color = ANSI.cyan, style = 'normal' } = {}) {
|
|
883
|
+
const innerWidth = Math.max(10, width - 4);
|
|
884
|
+
const titleText = title ? ` ${title.toUpperCase()} ` : '';
|
|
885
|
+
const topLeft = style === 'focus' ? '╭' : style === 'hud' ? '┏' : '┌';
|
|
886
|
+
const topRight = style === 'focus' ? '╮' : style === 'hud' ? '┓' : '┐';
|
|
887
|
+
const bottomLeft = style === 'focus' ? '╰' : style === 'hud' ? '┗' : '└';
|
|
888
|
+
const bottomRight = style === 'focus' ? '╯' : style === 'hud' ? '┛' : '┘';
|
|
889
|
+
const topFill = style === 'focus' ? '═' : '─';
|
|
890
|
+
const bottomTail = style === 'focus' ? '══' : '┄┄';
|
|
891
|
+
const top = `${topLeft}${titleText}${topFill.repeat(Math.max(0, width - 2 - titleText.length))}${topRight}`;
|
|
892
|
+
const bottom = `${bottomLeft}${topFill.repeat(Math.max(0, width - 4))}${bottomTail}${bottomRight}`;
|
|
893
|
+
const body = lines.map((line, index) => {
|
|
894
|
+
const left = index === 0
|
|
895
|
+
? (style === 'focus' ? '╞' : '├')
|
|
896
|
+
: index === lines.length - 1
|
|
897
|
+
? (style === 'focus' ? '╘' : '╰')
|
|
898
|
+
: '│';
|
|
899
|
+
const right = index === 0
|
|
900
|
+
? (style === 'focus' ? '╡' : '┤')
|
|
901
|
+
: index === lines.length - 1
|
|
902
|
+
? (style === 'focus' ? '╛' : '╯')
|
|
903
|
+
: '│';
|
|
904
|
+
return `${colorize(left, color, useColor)} ${fitText(line, innerWidth)} ${colorize(right, color, useColor)}`;
|
|
905
|
+
});
|
|
906
|
+
return [
|
|
907
|
+
colorize(top, color, useColor),
|
|
908
|
+
...body,
|
|
909
|
+
colorize(bottom, color, useColor),
|
|
910
|
+
];
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
function joinHorizontalBoxes(boxes, gutter = 2) {
|
|
914
|
+
const height = Math.max(...boxes.map((box) => box.lines.length));
|
|
915
|
+
const gap = ' '.repeat(gutter);
|
|
916
|
+
const rows = [];
|
|
917
|
+
|
|
918
|
+
for (let index = 0; index < height; index += 1) {
|
|
919
|
+
rows.push(boxes.map((box) => box.lines[index] ?? ' '.repeat(box.width)).join(gap));
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
return rows;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
export function formatCyberMenuFrame(status, commands, selectedIndex, tick = 0, {
|
|
926
|
+
columns = 120,
|
|
927
|
+
rows = 32,
|
|
928
|
+
useColor = false,
|
|
929
|
+
} = {}) {
|
|
930
|
+
const width = Math.max(72, Math.min(columns, 150));
|
|
931
|
+
const height = Math.max(22, Math.min(rows - 1, 42));
|
|
932
|
+
const compactMode = width < 104 || height < 27;
|
|
933
|
+
const rightWidth = compactMode ? (width >= 92 ? 28 : 26) : width >= 132 ? 44 : width >= 108 ? 38 : 30;
|
|
934
|
+
const gutter = 2;
|
|
935
|
+
const leftWidth = width - rightWidth - gutter;
|
|
936
|
+
const selected = commands[selectedIndex] ?? commands[0];
|
|
937
|
+
const actionArea = resolveCommandArea(selected);
|
|
938
|
+
const bundledCatalog = status.bundledCatalog ?? { total: 0, categories: [] };
|
|
939
|
+
const summaryOuterHeight = compactMode ? 7 : 8;
|
|
940
|
+
const bodyOuterHeight = Math.max(12, height - summaryOuterHeight - 1);
|
|
941
|
+
const detailOuterHeight = compactMode
|
|
942
|
+
? Math.min(8, Math.max(7, Math.floor(bodyOuterHeight * 0.46)))
|
|
943
|
+
: Math.min(10, Math.max(8, Math.floor(bodyOuterHeight * 0.42)));
|
|
944
|
+
const actionOuterHeight = compactMode
|
|
945
|
+
? Math.max(8, bodyOuterHeight - detailOuterHeight)
|
|
946
|
+
: Math.max(8, bodyOuterHeight - detailOuterHeight);
|
|
947
|
+
const rightBottomOuterHeight = compactMode
|
|
948
|
+
? Math.min(8, Math.max(7, Math.floor(bodyOuterHeight * 0.4)))
|
|
949
|
+
: Math.min(10, Math.max(8, Math.floor(bodyOuterHeight * 0.34)));
|
|
950
|
+
const rightTopOuterHeight = Math.max(8, bodyOuterHeight - rightBottomOuterHeight);
|
|
951
|
+
const summaryInnerWidth = width - 4;
|
|
952
|
+
const actionInnerWidth = leftWidth - 4;
|
|
953
|
+
const detailInnerWidth = leftWidth - 4;
|
|
954
|
+
const rightInnerWidth = rightWidth - 4;
|
|
955
|
+
const summaryInnerHeight = summaryOuterHeight - 2;
|
|
956
|
+
const actionInnerHeight = actionOuterHeight - 2;
|
|
957
|
+
const detailInnerHeight = detailOuterHeight - 2;
|
|
958
|
+
const rightTopInnerHeight = rightTopOuterHeight - 2;
|
|
959
|
+
const rightBottomInnerHeight = rightBottomOuterHeight - 2;
|
|
960
|
+
const visibleActionRows = Math.max(compactMode ? 2 : 3, actionInnerHeight - (compactMode ? 2 : 3));
|
|
961
|
+
const scrollStart = Math.min(
|
|
962
|
+
Math.max(0, selectedIndex - Math.floor(visibleActionRows / 2)),
|
|
963
|
+
Math.max(0, commands.length - visibleActionRows),
|
|
964
|
+
);
|
|
965
|
+
const visibleCommands = commands.slice(scrollStart, scrollStart + visibleActionRows);
|
|
966
|
+
|
|
967
|
+
const summaryLines = compactMode
|
|
968
|
+
? [
|
|
969
|
+
colorize('SKILL MASTER MENU', ANSI.bold, useColor),
|
|
970
|
+
`version ${status.semver} | channel ${status.manifestVersion} | readiness ${status.globalReadiness.ready ? 'ready' : status.globalReadiness.mode}`,
|
|
971
|
+
colorize(`GLOBAL SKILLS ${status.globalReadiness.installed.length}/${status.globalReadiness.required}`, ANSI.amber, useColor),
|
|
972
|
+
`bundle ${bundledCatalog.total} | drafts ${status.pendingSuccessDrafts} | study ${status.studyCandidates}`,
|
|
973
|
+
buildOverviewSignalLine(status, summaryInnerWidth, tick, { useColor, compact: true }),
|
|
974
|
+
colorize('compact cyberpunk hud / operator safe', ANSI.dim, useColor),
|
|
975
|
+
]
|
|
976
|
+
: [
|
|
977
|
+
colorize('SKILL MASTER MENU', ANSI.bold, useColor),
|
|
978
|
+
`version ${status.semver} | channel ${status.manifestVersion} | readiness ${status.globalReadiness.ready ? 'ready' : status.globalReadiness.mode}`,
|
|
979
|
+
colorize(`GLOBAL SKILLS ${status.globalReadiness.installed.length}/${status.globalReadiness.required}`, ANSI.amber, useColor),
|
|
980
|
+
`bundle ${bundledCatalog.total} | drafts ${status.pendingSuccessDrafts} | study ${status.studyCandidates}`,
|
|
981
|
+
buildOverviewSignalLine(status, summaryInnerWidth, tick, { useColor, compact: false }),
|
|
982
|
+
formatBundledCategoryLine(bundledCatalog),
|
|
983
|
+
colorize('workflow windows / cyberpunk terminal / operator safe', ANSI.dim, useColor),
|
|
984
|
+
];
|
|
985
|
+
|
|
986
|
+
const actionLines = [
|
|
987
|
+
colorize('ACTION GRID', ANSI.gray, useColor),
|
|
988
|
+
colorize('up/down move enter run q exit', ANSI.dim, useColor),
|
|
989
|
+
...visibleCommands.map((command, offset) => {
|
|
990
|
+
const index = scrollStart + offset;
|
|
991
|
+
const marker = index === selectedIndex ? '▸' : '·';
|
|
992
|
+
const disabled = command.disabledReason ? ' [off]' : '';
|
|
993
|
+
const label = `${marker} ${command.label}${disabled}`;
|
|
994
|
+
return index === selectedIndex
|
|
995
|
+
? colorize(fitText(label, actionInnerWidth), ANSI.teal, useColor)
|
|
996
|
+
: fitText(label, actionInnerWidth);
|
|
997
|
+
}),
|
|
998
|
+
];
|
|
999
|
+
|
|
1000
|
+
while (actionLines.length < actionInnerHeight) {
|
|
1001
|
+
actionLines.push(fitText('', actionInnerWidth));
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
const descriptionLines = [
|
|
1005
|
+
colorize('DETAIL FOCUS', ANSI.amber, useColor),
|
|
1006
|
+
colorize(selected?.label ?? 'Nenhuma acao', ANSI.bold, useColor),
|
|
1007
|
+
fitText(colorize(`area ${actionArea} | action ${Math.min(selectedIndex + 1, commands.length)}/${commands.length}`, ANSI.gray, useColor), detailInnerWidth),
|
|
1008
|
+
fitText(colorize('────────────────────────────────', ANSI.amber, useColor), detailInnerWidth),
|
|
1009
|
+
...splitText(selected?.description, detailInnerWidth, 1),
|
|
1010
|
+
...splitText(selected?.success ? `resultado: ${selected.success}` : '', detailInnerWidth, 1),
|
|
1011
|
+
...splitText(`exec: ${formatActionCommand(selected)}`, detailInnerWidth, 1),
|
|
1012
|
+
...(selected?.confirmMessage ? splitText(`confirmacao: ${selected.confirmMessage}`, detailInnerWidth, 2) : []),
|
|
1013
|
+
...(selected?.disabledReason ? splitText(`Indisponivel: ${selected.disabledReason}`, detailInnerWidth, 2) : []),
|
|
1014
|
+
];
|
|
1015
|
+
|
|
1016
|
+
while (descriptionLines.length < detailInnerHeight) {
|
|
1017
|
+
descriptionLines.push(fitText('', detailInnerWidth));
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
const rightTopLines = dnaPanelLines(tick, rightInnerWidth, rightTopInnerHeight, status, { useColor, compact: compactMode });
|
|
1021
|
+
const rightBottomLines = telemetryPanelLines(status, selected, rightInnerWidth, rightBottomInnerHeight, { useColor, tick, compact: compactMode });
|
|
1022
|
+
const summaryBox = renderBox(
|
|
1023
|
+
summaryLines.slice(0, summaryInnerHeight).map((line) => fitText(line, summaryInnerWidth)),
|
|
1024
|
+
width,
|
|
1025
|
+
'overview',
|
|
1026
|
+
{ useColor, color: ANSI.white, style: 'hud' },
|
|
1027
|
+
);
|
|
1028
|
+
const actionBox = renderBox(
|
|
1029
|
+
actionLines.slice(0, actionInnerHeight).map((line) => fitText(line, actionInnerWidth)),
|
|
1030
|
+
leftWidth,
|
|
1031
|
+
'actions',
|
|
1032
|
+
{ useColor, color: ANSI.gray, style: 'normal' },
|
|
1033
|
+
);
|
|
1034
|
+
const detailBox = renderBox(
|
|
1035
|
+
descriptionLines.slice(0, detailInnerHeight).map((line) => fitText(line, detailInnerWidth)),
|
|
1036
|
+
leftWidth,
|
|
1037
|
+
'details',
|
|
1038
|
+
{ useColor, color: ANSI.amber, style: 'focus' },
|
|
1039
|
+
);
|
|
1040
|
+
const dnaBox = renderBox(rightTopLines, rightWidth, 'dna-core', { useColor, color: ANSI.white, style: 'hud' });
|
|
1041
|
+
const telemetryBox = renderBox(rightBottomLines, rightWidth, 'telemetry', { useColor, color: ANSI.blue, style: 'normal' });
|
|
1042
|
+
const bodyRows = joinHorizontalBoxes([
|
|
1043
|
+
{ lines: [...actionBox, ...detailBox], width: leftWidth },
|
|
1044
|
+
{ lines: [...dnaBox, ...telemetryBox], width: rightWidth },
|
|
1045
|
+
], gutter);
|
|
1046
|
+
|
|
1047
|
+
return [...summaryBox, '', ...bodyRows].join('\n');
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
export function formatRunningActionFrame(status, action, tick = 0, {
|
|
1051
|
+
columns = 120,
|
|
1052
|
+
rows = 32,
|
|
1053
|
+
useColor = false,
|
|
1054
|
+
} = {}) {
|
|
1055
|
+
const width = Math.max(72, Math.min(columns, 150));
|
|
1056
|
+
const height = Math.max(18, Math.min(rows - 1, 30));
|
|
1057
|
+
const innerWidth = width - 4;
|
|
1058
|
+
const commandArea = resolveCommandArea(action);
|
|
1059
|
+
const pulse = renderSparkline(buildTelemetrySeries((status.globalReadiness.installed.length || 1) + tick, Math.max(8, Math.min(18, Math.floor(innerWidth / 5))), tick), { useColor, color: ANSI.teal });
|
|
1060
|
+
const lines = [
|
|
1061
|
+
colorize('EXECUTION TRANSFER', ANSI.bold, useColor),
|
|
1062
|
+
fitText(colorize(`area ${commandArea} | launching ${action?.label ?? 'acao'}`, ANSI.amber, useColor), innerWidth),
|
|
1063
|
+
fitText(colorize(`pulse ${pulse}`, ANSI.gray, useColor), innerWidth),
|
|
1064
|
+
fitText('', innerWidth),
|
|
1065
|
+
...splitText(action?.description ?? '', innerWidth, 2),
|
|
1066
|
+
...splitText(action?.success ? `resultado esperado: ${action.success}` : '', innerWidth, 2),
|
|
1067
|
+
...splitText(`exec: ${formatActionCommand(action)}`, innerWidth, 2),
|
|
1068
|
+
fitText('', innerWidth),
|
|
1069
|
+
fitText(colorize('alternando do HUD para o stream real do comando...', ANSI.dim, useColor), innerWidth),
|
|
1070
|
+
];
|
|
1071
|
+
|
|
1072
|
+
while (lines.length < Math.max(8, height - 2)) {
|
|
1073
|
+
lines.push(fitText('', innerWidth));
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
return renderBox(
|
|
1077
|
+
lines.slice(0, Math.max(8, height - 2)).map((line) => fitText(line, innerWidth)),
|
|
1078
|
+
width,
|
|
1079
|
+
'running',
|
|
1080
|
+
{ useColor, color: ANSI.teal, style: 'focus' },
|
|
1081
|
+
).join('\n');
|
|
1082
|
+
}
|
|
1083
|
+
|
|
458
1084
|
export function formatActionHeader(action, { useColor = false } = {}) {
|
|
1085
|
+
const lines = [
|
|
1086
|
+
colorize(action.label, ANSI.bold, useColor),
|
|
1087
|
+
action.description,
|
|
1088
|
+
...(action.details ?? []),
|
|
1089
|
+
action.success ? `Resultado esperado: ${action.success}` : null,
|
|
1090
|
+
action.disabledReason ? `Indisponivel: ${action.disabledReason}` : null,
|
|
1091
|
+
].filter(Boolean);
|
|
1092
|
+
|
|
459
1093
|
return renderPanelLines(
|
|
460
|
-
|
|
461
|
-
colorize(action.label, ANSI.bold, useColor),
|
|
462
|
-
action.description,
|
|
463
|
-
],
|
|
1094
|
+
lines,
|
|
464
1095
|
{ color: ANSI.green, useColor },
|
|
465
1096
|
);
|
|
466
1097
|
}
|
|
@@ -474,7 +1105,11 @@ export function formatResultMessage(code, { useColor = false } = {}) {
|
|
|
474
1105
|
}
|
|
475
1106
|
|
|
476
1107
|
export function formatHelp(commands) {
|
|
477
|
-
const actionList = commands.map((command) =>
|
|
1108
|
+
const actionList = commands.map((command) => {
|
|
1109
|
+
const aliases = command.aliases.length ? ` aliases: ${command.aliases.join(', ')}` : '';
|
|
1110
|
+
const disabled = command.disabledReason ? ` indisponivel: ${command.disabledReason}` : '';
|
|
1111
|
+
return ` - ${command.key}: ${command.label}\n ${command.description}${aliases}${disabled}`;
|
|
1112
|
+
}).join('\n');
|
|
478
1113
|
|
|
479
1114
|
return `Skill Master Menu
|
|
480
1115
|
|