@fprad0/skill-master-mcp 0.0.9 → 0.0.11
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 +15 -0
- package/README.md +43 -9
- package/VERSION.md +3 -3
- package/bin/lib/client-config.mjs +268 -0
- package/bin/lib/menu-core.mjs +678 -33
- package/bin/skill-master-bootstrap-global.mjs +15 -1
- package/bin/skill-master-doctor.mjs +181 -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 +43 -99
- package/dist/index.js +30 -5
- package/dist/index.js.map +1 -1
- package/docs/operations/GUIA_MULTI_COMPUTADOR.md +255 -0
- package/docs/operations/GUIA_NPM_PUBLICO.md +147 -0
- 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/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/SKILL.md +399 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/common-patterns.md +331 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/complete-examples.md +872 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/component-patterns.md +502 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/data-fetching.md +767 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/file-organization.md +502 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/loading-and-error-states.md +501 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/performance.md +406 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/routing-guide.md +364 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/styling-guide.md +428 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/typescript-standards.md +418 -0
- package/docs/skill-candidates/v0.0.11/git-version-control-ops/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/go-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/java-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/javascript-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/json-contract-design/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/multi-client-mcp-ops/SKILL.md +36 -0
- package/docs/skill-candidates/v0.0.11/nextjs/SKILL.md +745 -0
- package/docs/skill-candidates/v0.0.11/nextjs/agents/openai.yaml +3 -0
- package/docs/skill-candidates/v0.0.11/nextjs/references/app-router-files.md +94 -0
- package/docs/skill-candidates/v0.0.11/python-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/ruby-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/SKILL.md +209 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/references/architecture_patterns.md +103 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/references/development_workflows.md +103 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/references/tech_stack_guide.md +103 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/scripts/code_quality_analyzer.py +114 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/scripts/fullstack_scaffolder.py +114 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/scripts/project_scaffolder.py +114 -0
- package/docs/skill-candidates/v0.0.11/shadcn/SKILL.md +573 -0
- package/docs/skill-candidates/v0.0.11/shadcn/agents/openai.yaml +3 -0
- package/docs/skill-candidates/v0.0.11/sql-postgresql-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/terminal-shell-ops/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/typescript-expert/SKILL.md +429 -0
- package/docs/skill-candidates/v0.0.11/typescript-expert/references/tsconfig-strict.json +92 -0
- package/docs/skill-candidates/v0.0.11/typescript-expert/references/typescript-cheatsheet.md +383 -0
- package/docs/skill-candidates/v0.0.11/typescript-expert/references/utility-types.ts +335 -0
- package/docs/skill-candidates/v0.0.11/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/docs/skill-candidates/v0.0.11/ui-component-primitives/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/web-mobile-design-systems/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/windows-linux-platform-ops/SKILL.md +34 -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 +7 -2
- package/scripts/verify-menu-actions.mjs +115 -0
|
@@ -6,6 +6,21 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
|
|
7
7
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
8
8
|
const rootDir = dirname(here);
|
|
9
|
+
const args = process.argv.slice(2);
|
|
10
|
+
|
|
11
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
12
|
+
console.log(`Skill Master global bootstrap
|
|
13
|
+
|
|
14
|
+
Uso:
|
|
15
|
+
skill-master-bootstrap-global
|
|
16
|
+
|
|
17
|
+
Instala as skills globais embutidas e registra o MCP skill_master em Codex,
|
|
18
|
+
Claude Desktop, Gemini e Antigravity usando Node absoluto e o entrypoint
|
|
19
|
+
absoluto do pacote, sem depender do PATH do app desktop.
|
|
20
|
+
Reinicie os clientes depois da execucao.
|
|
21
|
+
`);
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
9
24
|
|
|
10
25
|
const steps = [
|
|
11
26
|
{
|
|
@@ -32,4 +47,3 @@ for (const step of steps) {
|
|
|
32
47
|
if ((process.exitCode ?? 0) === 0) {
|
|
33
48
|
console.log('[skill_master] Global bootstrap complete.');
|
|
34
49
|
}
|
|
35
|
-
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import {
|
|
8
|
+
assessCodexConfigContent,
|
|
9
|
+
assessMcpServerConfig,
|
|
10
|
+
defaultClientConfigPaths,
|
|
11
|
+
} from './lib/client-config.mjs';
|
|
12
|
+
|
|
13
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const rootDir = path.resolve(here, '..');
|
|
15
|
+
const args = process.argv.slice(2);
|
|
16
|
+
const has = (flag) => args.includes(flag);
|
|
17
|
+
|
|
18
|
+
if (has('--help') || has('-h')) {
|
|
19
|
+
console.log(`Skill Master Doctor
|
|
20
|
+
|
|
21
|
+
Uso:
|
|
22
|
+
skill-master-doctor
|
|
23
|
+
skill-master-doctor --strict
|
|
24
|
+
|
|
25
|
+
Valida pacote, binarios, skills globais e registro MCP em Codex, Claude,
|
|
26
|
+
Gemini e Antigravity. Nao publica versoes e nao altera configuracoes.
|
|
27
|
+
|
|
28
|
+
O registro recomendado usa Node absoluto + bin/skill-master.mjs absoluto para
|
|
29
|
+
evitar falhas de PATH em apps desktop no Windows, Linux e macOS.
|
|
30
|
+
`);
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const REQUIRED_GLOBAL_SKILLS = [
|
|
35
|
+
'catholic-moral-discernment',
|
|
36
|
+
'ai-ethics-human-dignity',
|
|
37
|
+
'professional-boundary-triage',
|
|
38
|
+
'broad-domain-router',
|
|
39
|
+
'language-quality-pt-en-fr',
|
|
40
|
+
'math-science-reasoning',
|
|
41
|
+
'philosophy-sociology-discernment',
|
|
42
|
+
'engineering-systems-master',
|
|
43
|
+
'source-authority-reviewer',
|
|
44
|
+
'release-ethics-gate',
|
|
45
|
+
'mcp-client-readiness',
|
|
46
|
+
'terminal-menu-operations',
|
|
47
|
+
'terminal-pixel-art-tui',
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
const REQUIRED_BINS = [
|
|
51
|
+
'skill-master-menu',
|
|
52
|
+
'skill-master-mcp',
|
|
53
|
+
'skill-master-update',
|
|
54
|
+
'skill-master-bootstrap-global',
|
|
55
|
+
'skill-master-install-global-skills',
|
|
56
|
+
'skill-master-register-clients',
|
|
57
|
+
'skill-master-doctor',
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
function readJson(filePath) {
|
|
61
|
+
if (!existsSync(filePath)) return { present: false, invalid: false, value: null };
|
|
62
|
+
try {
|
|
63
|
+
const raw = readFileSync(filePath, 'utf8').trim();
|
|
64
|
+
return { present: true, invalid: false, value: raw ? JSON.parse(raw) : {} };
|
|
65
|
+
} catch {
|
|
66
|
+
return { present: true, invalid: true, value: null };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function commandExists(command) {
|
|
71
|
+
const lookup = process.platform === 'win32' ? 'where' : 'command';
|
|
72
|
+
const lookupArgs = process.platform === 'win32' ? [command] : ['-v', command];
|
|
73
|
+
const result = spawnSync(lookup, lookupArgs, { shell: process.platform !== 'win32', stdio: 'ignore' });
|
|
74
|
+
return result.status === 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function jsonClientState(filePath) {
|
|
78
|
+
const parsed = readJson(filePath);
|
|
79
|
+
if (parsed.invalid) {
|
|
80
|
+
return {
|
|
81
|
+
filePath,
|
|
82
|
+
present: true,
|
|
83
|
+
configured: false,
|
|
84
|
+
mode: 'invalid-json',
|
|
85
|
+
command: null,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const server = parsed.value?.mcpServers?.skill_master;
|
|
90
|
+
const assessment = assessMcpServerConfig(server);
|
|
91
|
+
return {
|
|
92
|
+
filePath,
|
|
93
|
+
present: parsed.present,
|
|
94
|
+
configured: assessment.robust,
|
|
95
|
+
mode: assessment.mode,
|
|
96
|
+
command: assessment.command,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function codexState(filePath) {
|
|
101
|
+
if (!existsSync(filePath)) {
|
|
102
|
+
return { filePath, present: false, configured: false, mode: 'missing', command: null };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const content = readFileSync(filePath, 'utf8');
|
|
106
|
+
const assessment = assessCodexConfigContent(content);
|
|
107
|
+
return {
|
|
108
|
+
filePath,
|
|
109
|
+
present: true,
|
|
110
|
+
configured: assessment.robust,
|
|
111
|
+
mode: assessment.mode,
|
|
112
|
+
command: assessment.command,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function resultLine(ok, label, detail) {
|
|
117
|
+
const marker = ok ? 'OK' : 'NO';
|
|
118
|
+
return `[${marker}] ${label}${detail ? ` - ${detail}` : ''}`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const packageJsonState = readJson(path.join(rootDir, 'package.json'));
|
|
122
|
+
const packageJson = packageJsonState.value;
|
|
123
|
+
const globalSkillsRoot = path.join(process.env.CODEX_HOME ?? path.join(os.homedir(), '.codex'), 'skills');
|
|
124
|
+
const installedSkills = REQUIRED_GLOBAL_SKILLS.filter((skill) => existsSync(path.join(globalSkillsRoot, skill, 'SKILL.md')));
|
|
125
|
+
const missingSkills = REQUIRED_GLOBAL_SKILLS.filter((skill) => !installedSkills.includes(skill));
|
|
126
|
+
|
|
127
|
+
const clientPaths = defaultClientConfigPaths();
|
|
128
|
+
const clients = [
|
|
129
|
+
['Codex', codexState(clientPaths.codex)],
|
|
130
|
+
['Claude Desktop', jsonClientState(clientPaths.claude)],
|
|
131
|
+
['Gemini CLI', jsonClientState(clientPaths.gemini)],
|
|
132
|
+
['Antigravity', jsonClientState(clientPaths.antigravity)],
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
const binResults = REQUIRED_BINS.map((bin) => [bin, commandExists(bin)]);
|
|
136
|
+
const allBinsOk = binResults.every(([, ok]) => ok);
|
|
137
|
+
const allSkillsOk = missingSkills.length === 0;
|
|
138
|
+
const allClientsOk = clients.every(([, state]) => state.configured);
|
|
139
|
+
const packageOk = packageJson?.name === '@fprad0/skill-master-mcp';
|
|
140
|
+
|
|
141
|
+
console.log('Skill Master Doctor');
|
|
142
|
+
console.log(`- Root: ${rootDir}`);
|
|
143
|
+
console.log(`- Package: ${packageJson?.name ?? 'unknown'}@${packageJson?.version ?? 'unknown'}`);
|
|
144
|
+
console.log('');
|
|
145
|
+
|
|
146
|
+
console.log(resultLine(packageOk, 'Pacote local reconhecido', packageOk ? packageJson.version : 'package.json inesperado'));
|
|
147
|
+
console.log(resultLine(allBinsOk, 'Binarios globais no PATH', binResults.filter(([, ok]) => !ok).map(([bin]) => bin).join(', ') || 'todos encontrados'));
|
|
148
|
+
for (const [bin, ok] of binResults) {
|
|
149
|
+
console.log(` ${resultLine(ok, bin)}`);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
console.log('');
|
|
153
|
+
console.log(resultLine(allSkillsOk, `Skills globais ${installedSkills.length}/${REQUIRED_GLOBAL_SKILLS.length}`, missingSkills.join(', ') || 'todas instaladas'));
|
|
154
|
+
console.log(`- Skills root: ${globalSkillsRoot}`);
|
|
155
|
+
|
|
156
|
+
console.log('');
|
|
157
|
+
for (const [name, state] of clients) {
|
|
158
|
+
const detail = state.configured
|
|
159
|
+
? `${state.mode} em ${state.filePath}`
|
|
160
|
+
: state.present
|
|
161
|
+
? `presente, mas mode=${state.mode} command=${state.command ?? 'nao encontrado'} em ${state.filePath}`
|
|
162
|
+
: `ausente em ${state.filePath}`;
|
|
163
|
+
console.log(resultLine(state.configured, `${name} configurado`, detail));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const ready = packageOk && allBinsOk && allSkillsOk && allClientsOk;
|
|
167
|
+
console.log('');
|
|
168
|
+
console.log(resultLine(ready, 'Readiness global', ready ? 'pronto' : 'requer acao'));
|
|
169
|
+
|
|
170
|
+
if (!ready) {
|
|
171
|
+
console.log('');
|
|
172
|
+
console.log('Proximo comando recomendado:');
|
|
173
|
+
console.log(' skill-master-register-clients --apply-all --force');
|
|
174
|
+
console.log(' skill-master-menu --run bootstrap-global --yes');
|
|
175
|
+
console.log('');
|
|
176
|
+
console.log('Depois reinicie Codex, Claude, Gemini e Antigravity.');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (has('--strict') && !ready) {
|
|
180
|
+
process.exitCode = 1;
|
|
181
|
+
}
|
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
|
|
7
7
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
8
8
|
const rootDir = path.resolve(here, '..');
|
|
9
|
-
const defaultSource = path.join(rootDir, 'docs', 'skill-candidates'
|
|
9
|
+
const defaultSource = path.join(rootDir, 'docs', 'skill-candidates');
|
|
10
10
|
const defaultTarget = path.join(process.env.CODEX_HOME ?? path.join(os.homedir(), '.codex'), 'skills');
|
|
11
11
|
|
|
12
12
|
const args = process.argv.slice(2);
|
|
@@ -24,8 +24,11 @@ Uso:
|
|
|
24
24
|
skill-master-install-global-skills --overwrite
|
|
25
25
|
skill-master-install-global-skills --dry-run
|
|
26
26
|
skill-master-install-global-skills --target ~/.codex/skills
|
|
27
|
+
skill-master-install-global-skills --source ./docs/skill-candidates/v0.0.11
|
|
27
28
|
|
|
28
29
|
Instala as skills globais embutidas em CODEX_HOME/skills ou ~/.codex/skills.
|
|
30
|
+
Quando --source aponta para docs/skill-candidates, todas as pastas versionadas v*
|
|
31
|
+
sao lidas.
|
|
29
32
|
`);
|
|
30
33
|
process.exit(0);
|
|
31
34
|
}
|
|
@@ -40,10 +43,28 @@ if (!existsSync(source)) {
|
|
|
40
43
|
process.exit(1);
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
const listSkillSources = (sourcePath) => {
|
|
47
|
+
const entries = readdirSync(sourcePath, { withFileTypes: true });
|
|
48
|
+
const directSkills = entries
|
|
49
|
+
.filter((entry) => entry.isDirectory() && existsSync(path.join(sourcePath, entry.name, 'SKILL.md')))
|
|
50
|
+
.map((entry) => ({ name: entry.name, path: path.join(sourcePath, entry.name) }));
|
|
51
|
+
|
|
52
|
+
if (directSkills.length) {
|
|
53
|
+
return directSkills;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return entries
|
|
57
|
+
.filter((entry) => entry.isDirectory())
|
|
58
|
+
.flatMap((entry) => {
|
|
59
|
+
const versionPath = path.join(sourcePath, entry.name);
|
|
60
|
+
return readdirSync(versionPath, { withFileTypes: true })
|
|
61
|
+
.filter((skillEntry) => skillEntry.isDirectory() && existsSync(path.join(versionPath, skillEntry.name, 'SKILL.md')))
|
|
62
|
+
.map((skillEntry) => ({ name: skillEntry.name, path: path.join(versionPath, skillEntry.name) }));
|
|
63
|
+
})
|
|
64
|
+
.sort((left, right) => left.name.localeCompare(right.name));
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const skills = listSkillSources(source);
|
|
47
68
|
|
|
48
69
|
if (!dryRun) {
|
|
49
70
|
mkdirSync(target, { recursive: true });
|
|
@@ -53,16 +74,16 @@ const installed = [];
|
|
|
53
74
|
const skipped = [];
|
|
54
75
|
|
|
55
76
|
for (const skill of skills) {
|
|
56
|
-
const from = path
|
|
57
|
-
const to = path.join(target, skill);
|
|
77
|
+
const from = skill.path;
|
|
78
|
+
const to = path.join(target, skill.name);
|
|
58
79
|
if (existsSync(to) && !overwrite) {
|
|
59
|
-
skipped.push(skill);
|
|
80
|
+
skipped.push(skill.name);
|
|
60
81
|
continue;
|
|
61
82
|
}
|
|
62
83
|
if (!dryRun) {
|
|
63
84
|
cpSync(from, to, { recursive: true, force: overwrite });
|
|
64
85
|
}
|
|
65
|
-
installed.push(skill);
|
|
86
|
+
installed.push(skill.name);
|
|
66
87
|
}
|
|
67
88
|
|
|
68
89
|
console.log('[skill_master] Global skills installer');
|
|
@@ -74,4 +95,3 @@ if (dryRun) console.log('- Dry run: no files were written.');
|
|
|
74
95
|
if (installed.length) console.log(`- Installed skills: ${installed.join(', ')}`);
|
|
75
96
|
if (skipped.length) console.log(`- Skipped skills: ${skipped.join(', ')}`);
|
|
76
97
|
console.log('[skill_master] Restart or rescan Codex to load new global skills.');
|
|
77
|
-
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import prompts from 'prompts';
|
|
4
|
+
import readline from 'node:readline';
|
|
4
5
|
import { dirname } from 'node:path';
|
|
5
6
|
import { fileURLToPath } from 'node:url';
|
|
6
7
|
import {
|
|
7
|
-
buildMenuChoices,
|
|
8
8
|
buildMenuCommands,
|
|
9
9
|
formatActionHeader,
|
|
10
|
+
formatCyberMenuFrame,
|
|
10
11
|
formatHelp,
|
|
11
|
-
|
|
12
|
+
formatRunningActionFrame,
|
|
12
13
|
formatResultMessage,
|
|
13
14
|
formatStatusReport,
|
|
14
15
|
getMenuStatus,
|
|
@@ -20,6 +21,19 @@ import {
|
|
|
20
21
|
const currentFile = fileURLToPath(import.meta.url);
|
|
21
22
|
const rootDir = dirname(dirname(currentFile));
|
|
22
23
|
const commands = buildMenuCommands({ rootDir, currentFile });
|
|
24
|
+
readline.emitKeypressEvents(process.stdin);
|
|
25
|
+
const CONTROL = {
|
|
26
|
+
alternateScreenIn: '\x1b[?1049h',
|
|
27
|
+
alternateScreenOut: '\x1b[?1049l',
|
|
28
|
+
hideCursor: '\x1b[?25l',
|
|
29
|
+
showCursor: '\x1b[?25h',
|
|
30
|
+
cursorHome: '\x1b[H',
|
|
31
|
+
clearScreen: '\x1b[2J',
|
|
32
|
+
clearToEnd: '\x1b[0J',
|
|
33
|
+
reset: '\x1b[0m',
|
|
34
|
+
syncStart: '\x1b[?2026h',
|
|
35
|
+
syncEnd: '\x1b[?2026l',
|
|
36
|
+
};
|
|
23
37
|
|
|
24
38
|
function parseArgs(argv) {
|
|
25
39
|
const parsed = {
|
|
@@ -62,6 +76,10 @@ function printStatus() {
|
|
|
62
76
|
}
|
|
63
77
|
|
|
64
78
|
async function runSelectedAction(action, { yes = false, useColor = false } = {}) {
|
|
79
|
+
if (action.disabledReason) {
|
|
80
|
+
throw new Error(`Action ${action.key} is unavailable here: ${action.disabledReason}`);
|
|
81
|
+
}
|
|
82
|
+
|
|
65
83
|
if (action.confirmMessage && !yes) {
|
|
66
84
|
if (!isInteractiveTerminal()) {
|
|
67
85
|
throw new Error(`Action ${action.key} requires --yes outside an interactive terminal.`);
|
|
@@ -88,47 +106,177 @@ async function runSelectedAction(action, { yes = false, useColor = false } = {})
|
|
|
88
106
|
return { cancelled: false, code };
|
|
89
107
|
}
|
|
90
108
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const status = getMenuStatus(rootDir);
|
|
95
|
-
console.log(formatMenuBanner(status, { useColor: true }));
|
|
96
|
-
console.log('');
|
|
97
|
-
|
|
98
|
-
const selection = await prompts({
|
|
99
|
-
type: 'select',
|
|
100
|
-
name: 'action',
|
|
101
|
-
message: 'Escolha uma acao',
|
|
102
|
-
choices: buildMenuChoices(commands),
|
|
103
|
-
initial: 0,
|
|
104
|
-
});
|
|
109
|
+
const readKey = () => new Promise((resolve) => {
|
|
110
|
+
process.stdin.once('keypress', (_str, key) => resolve(key));
|
|
111
|
+
});
|
|
105
112
|
|
|
106
|
-
|
|
107
|
-
|
|
113
|
+
function createKeyReader() {
|
|
114
|
+
const queue = [];
|
|
115
|
+
const waiters = [];
|
|
116
|
+
const onKeypress = (_str, key) => {
|
|
117
|
+
const waiter = waiters.shift();
|
|
118
|
+
if (waiter) {
|
|
119
|
+
clearTimeout(waiter.timer);
|
|
120
|
+
waiter.resolve(key);
|
|
121
|
+
return;
|
|
108
122
|
}
|
|
123
|
+
queue.push(key);
|
|
124
|
+
};
|
|
109
125
|
|
|
110
|
-
|
|
111
|
-
if (!action) {
|
|
112
|
-
return 1;
|
|
113
|
-
}
|
|
126
|
+
process.stdin.on('keypress', onKeypress);
|
|
114
127
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
128
|
+
return {
|
|
129
|
+
read(timeoutMs) {
|
|
130
|
+
if (queue.length) return Promise.resolve(queue.shift());
|
|
131
|
+
return new Promise((resolve) => {
|
|
132
|
+
const waiter = {
|
|
133
|
+
resolve,
|
|
134
|
+
timer: setTimeout(() => {
|
|
135
|
+
const index = waiters.indexOf(waiter);
|
|
136
|
+
if (index >= 0) waiters.splice(index, 1);
|
|
137
|
+
resolve(null);
|
|
138
|
+
}, timeoutMs),
|
|
139
|
+
};
|
|
140
|
+
waiters.push(waiter);
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
close() {
|
|
144
|
+
for (const waiter of waiters.splice(0)) {
|
|
145
|
+
clearTimeout(waiter.timer);
|
|
146
|
+
waiter.resolve(null);
|
|
147
|
+
}
|
|
148
|
+
process.stdin.off('keypress', onKeypress);
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
119
152
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
153
|
+
function setRawInput(enabled) {
|
|
154
|
+
if (typeof process.stdin.setRawMode === 'function') {
|
|
155
|
+
process.stdin.setRawMode(enabled);
|
|
156
|
+
}
|
|
157
|
+
if (enabled) process.stdin.resume();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function restoreMenuInput() {
|
|
161
|
+
setRawInput(true);
|
|
162
|
+
process.stdin.resume();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function enterVisualScreen() {
|
|
166
|
+
process.stdout.write(`${CONTROL.alternateScreenIn}${CONTROL.hideCursor}${CONTROL.clearScreen}${CONTROL.cursorHome}`);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function leaveVisualScreen() {
|
|
170
|
+
process.stdout.write(`${CONTROL.reset}${CONTROL.showCursor}${CONTROL.alternateScreenOut}`);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function writeStableFrame(frame, { clear = false } = {}) {
|
|
174
|
+
const prefix = clear ? CONTROL.clearScreen : '';
|
|
175
|
+
process.stdout.write([
|
|
176
|
+
CONTROL.syncStart,
|
|
177
|
+
CONTROL.cursorHome,
|
|
178
|
+
prefix,
|
|
179
|
+
frame,
|
|
180
|
+
'\n',
|
|
181
|
+
CONTROL.clearToEnd,
|
|
182
|
+
CONTROL.syncEnd,
|
|
183
|
+
].join(''));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function renderCyberMenu(selectedIndex, tick, { clear = false } = {}) {
|
|
187
|
+
const status = getMenuStatus(rootDir);
|
|
188
|
+
const frame = formatCyberMenuFrame(status, commands, selectedIndex, tick, {
|
|
189
|
+
columns: process.stdout.columns ?? 120,
|
|
190
|
+
rows: process.stdout.rows ?? 32,
|
|
191
|
+
useColor: true,
|
|
192
|
+
});
|
|
193
|
+
writeStableFrame(frame, { clear });
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function renderRunningAction(action, tick) {
|
|
197
|
+
const status = getMenuStatus(rootDir);
|
|
198
|
+
const frame = formatRunningActionFrame(status, action, tick, {
|
|
199
|
+
columns: process.stdout.columns ?? 120,
|
|
200
|
+
rows: process.stdout.rows ?? 32,
|
|
201
|
+
useColor: true,
|
|
202
|
+
});
|
|
203
|
+
writeStableFrame(frame, { clear: true });
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
207
|
+
|
|
208
|
+
async function waitForAnyKey(message = 'Pressione qualquer tecla para voltar ao menu...') {
|
|
209
|
+
process.stdout.write(`\n${message}`);
|
|
210
|
+
setRawInput(true);
|
|
211
|
+
await readKey();
|
|
212
|
+
setRawInput(false);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
async function runVisualMenu() {
|
|
216
|
+
let selectedIndex = 0;
|
|
217
|
+
let tick = 0;
|
|
218
|
+
let lastCode = 0;
|
|
219
|
+
let keyReader = createKeyReader();
|
|
220
|
+
let previousColumns = process.stdout.columns ?? 120;
|
|
221
|
+
let previousRows = process.stdout.rows ?? 32;
|
|
222
|
+
let needsClear = true;
|
|
223
|
+
|
|
224
|
+
enterVisualScreen();
|
|
225
|
+
restoreMenuInput();
|
|
226
|
+
|
|
227
|
+
try {
|
|
228
|
+
while (true) {
|
|
229
|
+
const columns = process.stdout.columns ?? 120;
|
|
230
|
+
const rows = process.stdout.rows ?? 32;
|
|
231
|
+
const resized = columns !== previousColumns || rows !== previousRows;
|
|
232
|
+
previousColumns = columns;
|
|
233
|
+
previousRows = rows;
|
|
234
|
+
renderCyberMenu(selectedIndex, tick, { clear: needsClear || resized });
|
|
235
|
+
needsClear = false;
|
|
236
|
+
const key = await keyReader.read(240);
|
|
237
|
+
|
|
238
|
+
if (!key) {
|
|
239
|
+
tick += 1;
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
128
242
|
|
|
129
|
-
|
|
130
|
-
return
|
|
243
|
+
if (key.ctrl && key.name === 'c') return 130;
|
|
244
|
+
if (key.name === 'escape' || key.name === 'q') return lastCode;
|
|
245
|
+
if (key.name === 'up' || key.name === 'k') {
|
|
246
|
+
selectedIndex = selectedIndex === 0 ? commands.length - 1 : selectedIndex - 1;
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
if (key.name === 'down' || key.name === 'j') {
|
|
250
|
+
selectedIndex = selectedIndex === commands.length - 1 ? 0 : selectedIndex + 1;
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
if (key.name === 'return' || key.name === 'enter') {
|
|
254
|
+
const action = commands[selectedIndex];
|
|
255
|
+
keyReader.close();
|
|
256
|
+
renderRunningAction(action, tick);
|
|
257
|
+
await sleep(180);
|
|
258
|
+
setRawInput(false);
|
|
259
|
+
leaveVisualScreen();
|
|
260
|
+
try {
|
|
261
|
+
const result = await runSelectedAction(action, { useColor: true });
|
|
262
|
+
lastCode = result.code;
|
|
263
|
+
} catch (error) {
|
|
264
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
265
|
+
process.stderr.write(`[skill_master] ${message}\n`);
|
|
266
|
+
lastCode = 1;
|
|
267
|
+
}
|
|
268
|
+
await waitForAnyKey();
|
|
269
|
+
keyReader = createKeyReader();
|
|
270
|
+
restoreMenuInput();
|
|
271
|
+
enterVisualScreen();
|
|
272
|
+
needsClear = true;
|
|
273
|
+
}
|
|
131
274
|
}
|
|
275
|
+
} finally {
|
|
276
|
+
keyReader.close();
|
|
277
|
+
setRawInput(false);
|
|
278
|
+
process.stdin.pause();
|
|
279
|
+
leaveVisualScreen();
|
|
132
280
|
}
|
|
133
281
|
}
|
|
134
282
|
|