ccjk 15.28.2 → 15.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/chunks/agent-teams.mjs +145 -0
- package/dist/chunks/agent.mjs +1439 -0
- package/dist/chunks/agents.mjs +3783 -0
- package/dist/chunks/api-cli.mjs +135 -0
- package/dist/chunks/api-config-selector.mjs +159 -0
- package/dist/chunks/api-providers.mjs +144 -0
- package/dist/chunks/api.mjs +115 -0
- package/dist/chunks/auto-bootstrap.mjs +358 -0
- package/dist/chunks/auto-fixer.mjs +95 -0
- package/dist/chunks/auto-updater.mjs +507 -0
- package/dist/chunks/banner.mjs +173 -0
- package/dist/chunks/bash.mjs +187 -0
- package/dist/chunks/boost.mjs +474 -0
- package/dist/chunks/brain-config.mjs +75 -0
- package/dist/chunks/brain-status.mjs +89 -0
- package/dist/chunks/ccjk-agents.mjs +416 -0
- package/dist/chunks/ccjk-all.mjs +1046 -0
- package/dist/chunks/ccjk-config.mjs +445 -0
- package/dist/chunks/ccjk-hooks.mjs +1074 -0
- package/dist/chunks/ccjk-mcp.mjs +763 -0
- package/dist/chunks/ccjk-setup.mjs +765 -0
- package/dist/chunks/ccjk-skills.mjs +518 -0
- package/dist/chunks/ccr.mjs +109 -0
- package/dist/chunks/ccu.mjs +40 -0
- package/dist/chunks/check-updates.mjs +117 -0
- package/dist/chunks/claude-code-incremental-manager.mjs +761 -0
- package/dist/chunks/claude-config.mjs +606 -0
- package/dist/chunks/claude-config2.mjs +62 -0
- package/dist/chunks/claude-wrapper.mjs +85 -0
- package/dist/chunks/clavue-config.mjs +1454 -0
- package/dist/chunks/cleanup-migration.mjs +20 -0
- package/dist/chunks/cli-hook.mjs +4096 -0
- package/dist/chunks/cloud-sync.mjs +29 -0
- package/dist/chunks/code-type-resolver.mjs +880 -0
- package/dist/chunks/codex-config-switch.mjs +452 -0
- package/dist/chunks/codex-provider-manager.mjs +238 -0
- package/dist/chunks/codex-uninstaller.mjs +404 -0
- package/dist/chunks/codex.mjs +2141 -0
- package/dist/chunks/commands.mjs +108 -0
- package/dist/chunks/commands2.mjs +421 -0
- package/dist/chunks/commit.mjs +140 -0
- package/dist/chunks/completion.mjs +517 -0
- package/dist/chunks/config-consolidator.mjs +172 -0
- package/dist/chunks/config-switch.mjs +334 -0
- package/dist/chunks/config.mjs +558 -0
- package/dist/chunks/config2.mjs +484 -0
- package/dist/chunks/config3.mjs +486 -0
- package/dist/chunks/constants.mjs +323 -0
- package/dist/chunks/context-opt.mjs +444 -0
- package/dist/chunks/context.mjs +974 -0
- package/dist/chunks/dashboard.mjs +481 -0
- package/dist/chunks/doctor.mjs +1301 -0
- package/dist/chunks/eval.mjs +502 -0
- package/dist/chunks/evolution.mjs +322 -0
- package/dist/chunks/features.mjs +715 -0
- package/dist/chunks/fish.mjs +181 -0
- package/dist/chunks/fs-operations.mjs +180 -0
- package/dist/chunks/health-alerts.mjs +830 -0
- package/dist/chunks/help.mjs +341 -0
- package/dist/chunks/hook-installer.mjs +48 -0
- package/dist/chunks/impact.mjs +651 -0
- package/dist/chunks/index.mjs +23 -0
- package/dist/chunks/index10.mjs +19 -0
- package/dist/chunks/index11.mjs +1171 -0
- package/dist/chunks/index12.mjs +218 -0
- package/dist/chunks/index13.mjs +679 -0
- package/dist/chunks/index14.mjs +1009 -0
- package/dist/chunks/index15.mjs +194 -0
- package/dist/chunks/index2.mjs +7637 -0
- package/dist/chunks/index3.mjs +171 -0
- package/dist/chunks/index4.mjs +26 -0
- package/dist/chunks/index5.mjs +19 -0
- package/dist/chunks/index6.mjs +19092 -0
- package/dist/chunks/index7.mjs +616 -0
- package/dist/chunks/index8.mjs +1602 -0
- package/dist/chunks/index9.mjs +5384 -0
- package/dist/chunks/init.mjs +1911 -0
- package/dist/chunks/installer.mjs +757 -0
- package/dist/chunks/installer2.mjs +103 -0
- package/dist/chunks/interview.mjs +2927 -0
- package/dist/chunks/json-config.mjs +60 -0
- package/dist/chunks/linux.mjs +3863 -0
- package/dist/chunks/macos.mjs +69 -0
- package/dist/chunks/main.mjs +635 -0
- package/dist/chunks/manager.mjs +1048 -0
- package/dist/chunks/marketplace.mjs +265 -0
- package/dist/chunks/mcp-cli.mjs +205 -0
- package/dist/chunks/mcp-performance.mjs +187 -0
- package/dist/chunks/mcp.mjs +667 -0
- package/dist/chunks/memory-check.mjs +2973 -0
- package/dist/chunks/memory-paths.mjs +259 -0
- package/dist/chunks/memory-sync.mjs +209 -0
- package/dist/chunks/memory.mjs +354 -0
- package/dist/chunks/metrics-display.mjs +153 -0
- package/dist/chunks/monitor.mjs +1856 -0
- package/dist/chunks/notification.mjs +1864 -0
- package/dist/chunks/onboarding.mjs +386 -0
- package/dist/chunks/package.mjs +3 -0
- package/dist/chunks/paradigm.mjs +74 -0
- package/dist/chunks/permission-manager.mjs +250 -0
- package/dist/chunks/permissions.mjs +265 -0
- package/dist/chunks/persistence-manager.mjs +801 -0
- package/dist/chunks/persistence.mjs +707 -0
- package/dist/chunks/platform.mjs +395 -0
- package/dist/chunks/plugin.mjs +1936 -0
- package/dist/chunks/powershell.mjs +213 -0
- package/dist/chunks/prompts.mjs +244 -0
- package/dist/chunks/providers.mjs +263 -0
- package/dist/chunks/quick-actions.mjs +335 -0
- package/dist/chunks/quick-provider.mjs +755 -0
- package/dist/chunks/quick-setup.mjs +421 -0
- package/dist/chunks/remote.mjs +497 -0
- package/dist/chunks/research.mjs +1904 -0
- package/dist/chunks/rollback.mjs +38 -0
- package/dist/chunks/session-manager.mjs +1371 -0
- package/dist/chunks/session.mjs +878 -0
- package/dist/chunks/sessions.mjs +106 -0
- package/dist/chunks/silent-updater.mjs +396 -0
- package/dist/chunks/simple-config.mjs +122 -0
- package/dist/chunks/skill.mjs +117 -0
- package/dist/chunks/skill2.mjs +9052 -0
- package/dist/chunks/skills-sync.mjs +1343 -0
- package/dist/chunks/skills.mjs +577 -0
- package/dist/chunks/slash-commands.mjs +208 -0
- package/dist/chunks/smart-guide.mjs +247 -0
- package/dist/chunks/snapshot.mjs +58 -0
- package/dist/chunks/startup.mjs +487 -0
- package/dist/chunks/stats.mjs +191 -0
- package/dist/chunks/status.mjs +471 -0
- package/dist/chunks/team.mjs +63 -0
- package/dist/chunks/thinking.mjs +626 -0
- package/dist/chunks/trace.mjs +57 -0
- package/dist/chunks/uninstall.mjs +852 -0
- package/dist/chunks/update.mjs +174 -0
- package/dist/chunks/upgrade-manager.mjs +204 -0
- package/dist/chunks/upgrade.mjs +133 -0
- package/dist/chunks/version-checker.mjs +891 -0
- package/dist/chunks/vim.mjs +903 -0
- package/dist/chunks/windows.mjs +14 -0
- package/dist/chunks/workflows.mjs +633 -0
- package/dist/chunks/wsl.mjs +129 -0
- package/dist/chunks/zero-config.mjs +871 -0
- package/dist/chunks/zsh.mjs +182 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +11 -2
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +2684 -0
- package/dist/commands/edit.js +1 -2
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/grok.js +35 -0
- package/dist/commands/grok.js.map +1 -0
- package/dist/commands/init.js +183 -110
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.js +6 -8
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/profile.js +10 -28
- package/dist/commands/profile.js.map +1 -1
- package/dist/commands/quick.js +28 -25
- package/dist/commands/quick.js.map +1 -1
- package/dist/core/codex-config.js +11 -29
- package/dist/core/codex-config.js.map +1 -1
- package/dist/core/grok-config.js +110 -0
- package/dist/core/grok-config.js.map +1 -0
- package/dist/core/perms.js +96 -86
- package/dist/core/perms.js.map +1 -1
- package/dist/core/profiles.js +13 -57
- package/dist/core/profiles.js.map +1 -1
- package/dist/core/providers.js +58 -49
- package/dist/core/providers.js.map +1 -1
- package/dist/core/quick-parse.js +1 -7
- package/dist/core/quick-parse.js.map +1 -1
- package/dist/core/tools.js +24 -0
- package/dist/core/tools.js.map +1 -1
- package/dist/i18n/locales/en/agent-teams.json +18 -0
- package/dist/i18n/locales/en/agentBrowser.json +80 -0
- package/dist/i18n/locales/en/agents.json +135 -0
- package/dist/i18n/locales/en/api.json +63 -0
- package/dist/i18n/locales/en/ccjk-agents.json +33 -0
- package/dist/i18n/locales/en/ccjk-all.json +23 -0
- package/dist/i18n/locales/en/ccjk-skills.json +22 -0
- package/dist/i18n/locales/en/ccjk.json +276 -0
- package/dist/i18n/locales/en/ccr.json +65 -0
- package/dist/i18n/locales/en/claude-md.json +73 -0
- package/dist/i18n/locales/en/cli.json +148 -0
- package/dist/i18n/locales/en/cloud-setup.json +31 -0
- package/dist/i18n/locales/en/cloud-sync.json +147 -0
- package/dist/i18n/locales/en/cloud.json +40 -0
- package/dist/i18n/locales/en/cloudPlugins.json +118 -0
- package/dist/i18n/locales/en/codex.json +184 -0
- package/dist/i18n/locales/en/cometix.json +29 -0
- package/dist/i18n/locales/en/common.json +68 -0
- package/dist/i18n/locales/en/config.json +108 -0
- package/dist/i18n/locales/en/configuration.json +236 -0
- package/dist/i18n/locales/en/context.json +85 -0
- package/dist/i18n/locales/en/dashboard.json +78 -0
- package/dist/i18n/locales/en/errors.json +26 -0
- package/dist/i18n/locales/en/evolution.json +54 -0
- package/dist/i18n/locales/en/hooks.json +74 -0
- package/dist/i18n/locales/en/hooksSync.json +133 -0
- package/dist/i18n/locales/en/installation.json +83 -0
- package/dist/i18n/locales/en/interview.json +104 -0
- package/dist/i18n/locales/en/language.json +19 -0
- package/dist/i18n/locales/en/lsp.json +78 -0
- package/dist/i18n/locales/en/marketplace.json +116 -0
- package/dist/i18n/locales/en/mcp.json +180 -0
- package/dist/i18n/locales/en/memory.json +23 -0
- package/dist/i18n/locales/en/menu.json +299 -0
- package/dist/i18n/locales/en/multi-config.json +79 -0
- package/dist/i18n/locales/en/notification.json +307 -0
- package/dist/i18n/locales/en/permissions.json +95 -0
- package/dist/i18n/locales/en/persistence.json +127 -0
- package/dist/i18n/locales/en/plugins.json +146 -0
- package/dist/i18n/locales/en/quick-actions.json +78 -0
- package/dist/i18n/locales/en/registry.json +54 -0
- package/dist/i18n/locales/en/remote.json +93 -0
- package/dist/i18n/locales/en/sandbox.json +44 -0
- package/dist/i18n/locales/en/setup.json +44 -0
- package/dist/i18n/locales/en/shencha.json +14 -0
- package/dist/i18n/locales/en/skills.json +100 -0
- package/dist/i18n/locales/en/skillsSync.json +74 -0
- package/dist/i18n/locales/en/smartGuide.json +49 -0
- package/dist/i18n/locales/en/stats.json +20 -0
- package/dist/i18n/locales/en/subagent.json +69 -0
- package/dist/i18n/locales/en/superpowers.json +117 -0
- package/dist/i18n/locales/en/team.json +7 -0
- package/dist/i18n/locales/en/thinking.json +65 -0
- package/dist/i18n/locales/en/tools.json +42 -0
- package/dist/i18n/locales/en/uninstall.json +56 -0
- package/dist/i18n/locales/en/updater.json +29 -0
- package/dist/i18n/locales/en/vim.json +169 -0
- package/dist/i18n/locales/en/workflow.json +55 -0
- package/dist/i18n/locales/en/workspace.json +108 -0
- package/dist/i18n/locales/zh-CN/agent-teams.json +18 -0
- package/dist/i18n/locales/zh-CN/agentBrowser.json +80 -0
- package/dist/i18n/locales/zh-CN/agents.json +135 -0
- package/dist/i18n/locales/zh-CN/api.json +63 -0
- package/dist/i18n/locales/zh-CN/ccjk-agents.json +33 -0
- package/dist/i18n/locales/zh-CN/ccjk-all.json +23 -0
- package/dist/i18n/locales/zh-CN/ccjk-skills.json +22 -0
- package/dist/i18n/locales/zh-CN/ccjk.json +276 -0
- package/dist/i18n/locales/zh-CN/ccr.json +65 -0
- package/dist/i18n/locales/zh-CN/claude-md.json +73 -0
- package/dist/i18n/locales/zh-CN/cli.json +148 -0
- package/dist/i18n/locales/zh-CN/cloud-setup.json +31 -0
- package/dist/i18n/locales/zh-CN/cloud-sync.json +147 -0
- package/dist/i18n/locales/zh-CN/cloud.json +40 -0
- package/dist/i18n/locales/zh-CN/cloudPlugins.json +118 -0
- package/dist/i18n/locales/zh-CN/codex.json +184 -0
- package/dist/i18n/locales/zh-CN/cometix.json +29 -0
- package/dist/i18n/locales/zh-CN/common.json +68 -0
- package/dist/i18n/locales/zh-CN/config.json +108 -0
- package/dist/i18n/locales/zh-CN/configuration.json +234 -0
- package/dist/i18n/locales/zh-CN/context.json +85 -0
- package/dist/i18n/locales/zh-CN/dashboard.json +78 -0
- package/dist/i18n/locales/zh-CN/errors.json +26 -0
- package/dist/i18n/locales/zh-CN/evolution.json +54 -0
- package/dist/i18n/locales/zh-CN/hooks.json +74 -0
- package/dist/i18n/locales/zh-CN/hooksSync.json +133 -0
- package/dist/i18n/locales/zh-CN/installation.json +83 -0
- package/dist/i18n/locales/zh-CN/interview.json +104 -0
- package/dist/i18n/locales/zh-CN/language.json +19 -0
- package/dist/i18n/locales/zh-CN/lsp.json +78 -0
- package/dist/i18n/locales/zh-CN/marketplace.json +116 -0
- package/dist/i18n/locales/zh-CN/mcp.json +180 -0
- package/dist/i18n/locales/zh-CN/memory.json +23 -0
- package/dist/i18n/locales/zh-CN/menu.json +299 -0
- package/dist/i18n/locales/zh-CN/multi-config.json +79 -0
- package/dist/i18n/locales/zh-CN/notification.json +307 -0
- package/dist/i18n/locales/zh-CN/permissions.json +95 -0
- package/dist/i18n/locales/zh-CN/persistence.json +127 -0
- package/dist/i18n/locales/zh-CN/plugins.json +146 -0
- package/dist/i18n/locales/zh-CN/quick-actions.json +78 -0
- package/dist/i18n/locales/zh-CN/registry.json +54 -0
- package/dist/i18n/locales/zh-CN/remote.json +93 -0
- package/dist/i18n/locales/zh-CN/sandbox.json +44 -0
- package/dist/i18n/locales/zh-CN/setup.json +44 -0
- package/dist/i18n/locales/zh-CN/shencha.json +14 -0
- package/dist/i18n/locales/zh-CN/skills.json +100 -0
- package/dist/i18n/locales/zh-CN/skillsSync.json +74 -0
- package/dist/i18n/locales/zh-CN/smartGuide.json +49 -0
- package/dist/i18n/locales/zh-CN/stats.json +20 -0
- package/dist/i18n/locales/zh-CN/subagent.json +69 -0
- package/dist/i18n/locales/zh-CN/superpowers.json +117 -0
- package/dist/i18n/locales/zh-CN/team.json +7 -0
- package/dist/i18n/locales/zh-CN/thinking.json +65 -0
- package/dist/i18n/locales/zh-CN/tools.json +42 -0
- package/dist/i18n/locales/zh-CN/uninstall.json +56 -0
- package/dist/i18n/locales/zh-CN/updater.json +29 -0
- package/dist/i18n/locales/zh-CN/vim.json +169 -0
- package/dist/i18n/locales/zh-CN/workflow.json +55 -0
- package/dist/i18n/locales/zh-CN/workspace.json +108 -0
- package/dist/index.d.mts +5658 -0
- package/dist/index.d.ts +5658 -0
- package/dist/index.mjs +3732 -0
- package/dist/shared/ccjk.5bEolFrk.mjs +254 -0
- package/dist/shared/ccjk.8oaxX4iR.mjs +90 -0
- package/dist/shared/ccjk.B2U7DsPy.mjs +31 -0
- package/dist/shared/ccjk.B2f-cwUP.mjs +468 -0
- package/dist/shared/ccjk.BAGoDD49.mjs +36 -0
- package/dist/shared/ccjk.BBtCGd_g.mjs +899 -0
- package/dist/shared/ccjk.BFQ7yr5S.mjs +16 -0
- package/dist/shared/ccjk.BLsIiTqO.mjs +449 -0
- package/dist/shared/ccjk.BXv8aYs1.mjs +170 -0
- package/dist/shared/ccjk.BnsY5WxD.mjs +171 -0
- package/dist/shared/ccjk.BoApaI4j.mjs +28 -0
- package/dist/shared/ccjk.Bq8TqZG_.mjs +189 -0
- package/dist/shared/ccjk.BtrioX1Z.mjs +25 -0
- package/dist/shared/ccjk.Bx_rmYfN.mjs +69 -0
- package/dist/shared/ccjk.BzPbSEP2.mjs +115 -0
- package/dist/shared/ccjk.C0WLUnFV.mjs +293 -0
- package/dist/shared/ccjk.C1hANZTu.mjs +19 -0
- package/dist/shared/ccjk.C2jHOZVP.mjs +52 -0
- package/dist/shared/ccjk.CNhnT6uQ.mjs +636 -0
- package/dist/shared/ccjk.COweQ1RR.mjs +5 -0
- package/dist/shared/ccjk.CfKKcvWy.mjs +126 -0
- package/dist/shared/ccjk.Cjgrln_h.mjs +297 -0
- package/dist/shared/ccjk.CoCHVXl3.mjs +3951 -0
- package/dist/shared/ccjk.CwGZSTAK.mjs +319 -0
- package/dist/shared/ccjk.CxpGa6MC.mjs +2724 -0
- package/dist/shared/ccjk.D-magaEx.mjs +763 -0
- package/dist/shared/ccjk.D0g2ABGg.mjs +171 -0
- package/dist/shared/ccjk.D6ycHbak.mjs +270 -0
- package/dist/shared/ccjk.D75wivnp.mjs +142 -0
- package/dist/shared/ccjk.DDL-4C-k.mjs +100 -0
- package/dist/shared/ccjk.DFRPtmK_.mjs +75 -0
- package/dist/shared/ccjk.DMV3x5Sd.mjs +299 -0
- package/dist/shared/ccjk.DZ2LLOa-.mjs +2195 -0
- package/dist/shared/ccjk.DbigonEQ.mjs +698 -0
- package/dist/shared/ccjk.DcMvE7lf.mjs +618 -0
- package/dist/shared/ccjk.DeWpAShp.mjs +1828 -0
- package/dist/shared/ccjk.DhJ1kyDR.mjs +30 -0
- package/dist/shared/ccjk.DlTXS9rP.mjs +224 -0
- package/dist/shared/ccjk.DopKzo3z.mjs +305 -0
- package/dist/shared/ccjk.DsZsc4LR.mjs +1280 -0
- package/dist/shared/ccjk.DuzJZlgj.mjs +418 -0
- package/dist/shared/ccjk.Dxgd2vjc.mjs +444 -0
- package/dist/shared/ccjk.J8YiPsOw.mjs +259 -0
- package/dist/shared/ccjk.KfSWcGlE.mjs +38 -0
- package/dist/shared/ccjk.L7yC58_i.mjs +225 -0
- package/dist/shared/ccjk.MwtjAULc.mjs +1447 -0
- package/dist/shared/ccjk.OJKHVSOb.mjs +2005 -0
- package/dist/shared/ccjk.OTnevPNE.mjs +225 -0
- package/dist/shared/ccjk.RyizuzOI.mjs +21 -0
- package/dist/shared/ccjk.T_cX87dY.mjs +15 -0
- package/dist/shared/ccjk.bQ7Dh1g4.mjs +249 -0
- package/dist/shared/ccjk.gDEDGD_t.mjs +38 -0
- package/dist/shared/ccjk.hoqrwWdN.mjs +333 -0
- package/dist/shared/ccjk.i_vn-9C3.mjs +317 -0
- package/dist/shared/ccjk.lG3ccFjm.mjs +885 -0
- package/dist/shared/ccjk.wLJHO0Af.mjs +244 -0
- package/dist/shared/ccjk.y-a_1vK4.mjs +5127 -0
- package/dist/templates/agents/README.md +78 -0
- package/dist/templates/agents/fullstack-developer.json +70 -0
- package/dist/templates/agents/go-expert.json +69 -0
- package/dist/templates/agents/index.json +64 -0
- package/dist/templates/agents/python-expert.json +69 -0
- package/dist/templates/agents/react-specialist.json +69 -0
- package/dist/templates/agents/testing-automation-expert.json +70 -0
- package/dist/templates/agents/typescript-architect.json +69 -0
- package/dist/templates/claude-code/common/settings.json +109 -0
- package/dist/templates/common/error-prevention.md +267 -0
- package/dist/templates/common/karpathy-baseline.md +83 -0
- package/dist/templates/common/output-styles/zh-CN/carmack-mode.md +381 -0
- package/dist/templates/common/output-styles/zh-CN/codex-rigor-mode.md +114 -0
- package/dist/templates/common/output-styles/zh-CN/dhh-mode.md +265 -0
- package/dist/templates/common/output-styles/zh-CN/evan-you-mode.md +539 -0
- package/dist/templates/common/output-styles/zh-CN/jobs-mode.md +369 -0
- package/dist/templates/common/output-styles/zh-CN/linus-mode.md +135 -0
- package/dist/templates/common/output-styles/zh-CN/uncle-bob-mode.md +221 -0
- package/dist/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +628 -0
- package/dist/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +628 -0
- package/dist/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +187 -0
- package/dist/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +191 -0
- package/dist/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +249 -0
- package/dist/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +277 -0
- package/dist/templates/common/workflow/essential/en/agents/get-current-datetime.md +29 -0
- package/dist/templates/common/workflow/essential/en/agents/init-architect.md +115 -0
- package/dist/templates/common/workflow/essential/en/agents/ui-ux-designer.md +91 -0
- package/dist/templates/common/workflow/essential/en/feat.md +92 -0
- package/dist/templates/common/workflow/essential/en/goal.md +147 -0
- package/dist/templates/common/workflow/essential/en/init-project.md +53 -0
- package/dist/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +29 -0
- package/dist/templates/common/workflow/essential/zh-CN/agents/init-architect.md +115 -0
- package/dist/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +91 -0
- package/dist/templates/common/workflow/essential/zh-CN/feat.md +315 -0
- package/dist/templates/common/workflow/essential/zh-CN/goal.md +146 -0
- package/dist/templates/common/workflow/essential/zh-CN/init-project.md +53 -0
- package/dist/templates/common/workflow/git/en/git-cleanBranches.md +102 -0
- package/dist/templates/common/workflow/git/en/git-commit.md +205 -0
- package/dist/templates/common/workflow/git/en/git-rollback.md +90 -0
- package/dist/templates/common/workflow/git/en/git-worktree.md +276 -0
- package/dist/templates/common/workflow/git/zh-CN/git-cleanBranches.md +102 -0
- package/dist/templates/common/workflow/git/zh-CN/git-commit.md +205 -0
- package/dist/templates/common/workflow/git/zh-CN/git-rollback.md +90 -0
- package/dist/templates/common/workflow/git/zh-CN/git-worktree.md +276 -0
- package/dist/templates/common/workflow/interview/en/interview.md +67 -0
- package/dist/templates/common/workflow/interview/zh-CN/interview.md +67 -0
- package/dist/templates/common/workflow/linearMethod/en/linear-method.md +651 -0
- package/dist/templates/common/workflow/linearMethod/zh-CN/linear-method.md +752 -0
- package/dist/templates/common/workflow/refactoringMaster/en/refactoring-master.md +516 -0
- package/dist/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +812 -0
- package/dist/templates/common/workflow/sixStep/en/workflow.md +83 -0
- package/dist/templates/common/workflow/sixStep/zh-CN/workflow.md +359 -0
- package/dist/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +364 -0
- package/dist/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +366 -0
- package/dist/templates/hooks/README.md +212 -0
- package/dist/templates/hooks/git-workflow-hooks.md +551 -0
- package/dist/templates/hooks/post-test/coverage.json +21 -0
- package/dist/templates/hooks/post-test/summary.json +21 -0
- package/dist/templates/hooks/post-test-coverage.md +434 -0
- package/dist/templates/hooks/pre-commit/eslint.json +22 -0
- package/dist/templates/hooks/pre-commit/prettier.json +22 -0
- package/dist/templates/hooks/pre-commit-black.md +274 -0
- package/dist/templates/hooks/pre-commit-eslint.md +153 -0
- package/dist/templates/hooks/pre-commit-gofmt.md +284 -0
- package/dist/templates/hooks/pre-commit-prettier.md +212 -0
- package/dist/templates/hooks/pre-commit-type-check.md +377 -0
- package/dist/templates/skills/ccjk-init.md +154 -0
- package/dist/templates/skills/ccjk-mcp-setup.md +205 -0
- package/dist/templates/skills/ccjk-troubleshoot.md +228 -0
- package/dist/templates/skills/django-patterns.md +1016 -0
- package/dist/templates/skills/git-workflow.md +748 -0
- package/dist/templates/skills/go-idioms.md +963 -0
- package/dist/templates/skills/index.json +132 -0
- package/dist/templates/skills/nextjs-optimization.md +694 -0
- package/dist/templates/skills/python-pep8.md +852 -0
- package/dist/templates/skills/react-patterns.md +686 -0
- package/dist/templates/skills/rust-patterns.md +1057 -0
- package/dist/templates/skills/security-best-practices.md +1413 -0
- package/dist/templates/skills/testing-best-practices.md +1315 -0
- package/dist/templates/skills/ts-best-practices.md +354 -0
- package/package.json +12 -13
- package/dist/core/codex-auth.js +0 -63
- package/dist/core/codex-auth.js.map +0 -1
|
@@ -0,0 +1,1343 @@
|
|
|
1
|
+
import a from './index5.mjs';
|
|
2
|
+
import { i as inquirer } from './index6.mjs';
|
|
3
|
+
import { getTranslation } from './index2.mjs';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import { existsSync, readdirSync, readFileSync, mkdirSync } from 'node:fs';
|
|
6
|
+
import process__default from 'node:process';
|
|
7
|
+
import { a as createGateway } from '../shared/ccjk.D0g2ABGg.mjs';
|
|
8
|
+
import { CCJK_SKILLS_DIR, CCJK_CONFIG_DIR, CLOUD_ENDPOINTS } from './constants.mjs';
|
|
9
|
+
import { writeFileAtomic } from './fs-operations.mjs';
|
|
10
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
11
|
+
import { m as matter } from '../shared/ccjk.y-a_1vK4.mjs';
|
|
12
|
+
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
13
|
+
import { C as CloudErrorFactory, a as CloudError } from '../shared/ccjk.DMV3x5Sd.mjs';
|
|
14
|
+
import { s as showImpactReminder } from '../shared/ccjk.C1hANZTu.mjs';
|
|
15
|
+
import '../shared/ccjk.BAGoDD49.mjs';
|
|
16
|
+
import 'node:readline';
|
|
17
|
+
import 'stream';
|
|
18
|
+
import 'node:tty';
|
|
19
|
+
import 'node:async_hooks';
|
|
20
|
+
import '../shared/ccjk.Cjgrln_h.mjs';
|
|
21
|
+
import 'node:util';
|
|
22
|
+
import 'tty';
|
|
23
|
+
import 'fs';
|
|
24
|
+
import 'child_process';
|
|
25
|
+
import 'node:path';
|
|
26
|
+
import 'node:os';
|
|
27
|
+
import 'buffer';
|
|
28
|
+
import 'string_decoder';
|
|
29
|
+
import 'node:url';
|
|
30
|
+
import '../shared/ccjk.D6ycHbak.mjs';
|
|
31
|
+
import '../shared/ccjk.COweQ1RR.mjs';
|
|
32
|
+
|
|
33
|
+
function validateSkillListResponse(data) {
|
|
34
|
+
if (!data || typeof data !== "object")
|
|
35
|
+
return false;
|
|
36
|
+
const obj = data;
|
|
37
|
+
return Array.isArray(obj.skills) && typeof obj.total === "number" && typeof obj.page === "number" && typeof obj.pageSize === "number" && typeof obj.totalPages === "number";
|
|
38
|
+
}
|
|
39
|
+
function validateSkillGetResponse(data) {
|
|
40
|
+
if (!data || typeof data !== "object")
|
|
41
|
+
return false;
|
|
42
|
+
const obj = data;
|
|
43
|
+
return obj.skill !== void 0 && typeof obj.skill === "object" && obj.skill !== null;
|
|
44
|
+
}
|
|
45
|
+
function validateSkillUploadResponse(data) {
|
|
46
|
+
if (!data || typeof data !== "object")
|
|
47
|
+
return false;
|
|
48
|
+
const obj = data;
|
|
49
|
+
return obj.skill !== void 0 && typeof obj.skill === "object" && obj.skill !== null;
|
|
50
|
+
}
|
|
51
|
+
function validateSkillDownloadResponse(data) {
|
|
52
|
+
if (!data || typeof data !== "object")
|
|
53
|
+
return false;
|
|
54
|
+
const obj = data;
|
|
55
|
+
return obj.skill !== void 0 && typeof obj.skill === "object" && obj.skill !== null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
class SkillsApiClient {
|
|
59
|
+
gateway;
|
|
60
|
+
constructor(gateway) {
|
|
61
|
+
this.gateway = gateway;
|
|
62
|
+
}
|
|
63
|
+
// ==========================================================================
|
|
64
|
+
// List Skills
|
|
65
|
+
// ==========================================================================
|
|
66
|
+
/**
|
|
67
|
+
* List skills from cloud
|
|
68
|
+
*
|
|
69
|
+
* @param request - List request parameters
|
|
70
|
+
* @returns List response with skills array
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const response = await client.list({
|
|
75
|
+
* privacy: 'public',
|
|
76
|
+
* page: 1,
|
|
77
|
+
* pageSize: 20
|
|
78
|
+
* })
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
async list(request = {}) {
|
|
82
|
+
try {
|
|
83
|
+
const response = await this.gateway.request(
|
|
84
|
+
"skills.list",
|
|
85
|
+
{
|
|
86
|
+
method: "GET",
|
|
87
|
+
query: this.buildListQuery(request)
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
if (response.success && response.data) {
|
|
91
|
+
if (!validateSkillListResponse(response.data)) {
|
|
92
|
+
throw CloudErrorFactory.schemaMismatch(
|
|
93
|
+
"Invalid skill list response format",
|
|
94
|
+
{ context: { request } }
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return response;
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (error instanceof CloudError) {
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
throw CloudErrorFactory.unknown(error, {
|
|
104
|
+
context: { operation: "skills.list", request }
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// ==========================================================================
|
|
109
|
+
// Get Skill
|
|
110
|
+
// ==========================================================================
|
|
111
|
+
/**
|
|
112
|
+
* Get skill details by ID
|
|
113
|
+
*
|
|
114
|
+
* @param request - Get request with skill ID
|
|
115
|
+
* @returns Skill details
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* const response = await client.get({
|
|
120
|
+
* skillId: 'my-skill',
|
|
121
|
+
* version: '1.0.0'
|
|
122
|
+
* })
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
async get(request) {
|
|
126
|
+
try {
|
|
127
|
+
if (!request.skillId || request.skillId.trim() === "") {
|
|
128
|
+
throw CloudErrorFactory.validation("Skill ID is required");
|
|
129
|
+
}
|
|
130
|
+
const query = {};
|
|
131
|
+
if (request.version) {
|
|
132
|
+
query.version = request.version;
|
|
133
|
+
}
|
|
134
|
+
const response = await this.gateway.request(
|
|
135
|
+
"skills.download",
|
|
136
|
+
{
|
|
137
|
+
method: "GET",
|
|
138
|
+
query: {
|
|
139
|
+
skillId: request.skillId,
|
|
140
|
+
...query
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
if (response.success && response.data) {
|
|
145
|
+
if (!validateSkillGetResponse(response.data)) {
|
|
146
|
+
throw CloudErrorFactory.schemaMismatch(
|
|
147
|
+
"Invalid skill get response format",
|
|
148
|
+
{ context: { request } }
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return response;
|
|
153
|
+
} catch (error) {
|
|
154
|
+
if (error instanceof CloudError) {
|
|
155
|
+
throw error;
|
|
156
|
+
}
|
|
157
|
+
throw CloudErrorFactory.unknown(error, {
|
|
158
|
+
context: { operation: "skills.get", request }
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// ==========================================================================
|
|
163
|
+
// Upload Skill
|
|
164
|
+
// ==========================================================================
|
|
165
|
+
/**
|
|
166
|
+
* Upload skill to cloud
|
|
167
|
+
*
|
|
168
|
+
* @param request - Upload request with skill data
|
|
169
|
+
* @returns Upload response with skill details
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* const response = await client.upload({
|
|
174
|
+
* name: 'my-skill',
|
|
175
|
+
* version: '1.0.0',
|
|
176
|
+
* content: '# My Skill...',
|
|
177
|
+
* metadata: { author: 'me', description: 'A skill' },
|
|
178
|
+
* privacy: 'private',
|
|
179
|
+
* checksum: 'abc123'
|
|
180
|
+
* })
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
async upload(request) {
|
|
184
|
+
try {
|
|
185
|
+
this.validateUploadRequest(request);
|
|
186
|
+
const response = await this.gateway.request(
|
|
187
|
+
"skills.upload",
|
|
188
|
+
{
|
|
189
|
+
method: "POST",
|
|
190
|
+
body: request
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
if (response.success && response.data) {
|
|
194
|
+
if (!validateSkillUploadResponse(response.data)) {
|
|
195
|
+
throw CloudErrorFactory.schemaMismatch(
|
|
196
|
+
"Invalid skill upload response format",
|
|
197
|
+
{ context: { request } }
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return response;
|
|
202
|
+
} catch (error) {
|
|
203
|
+
if (error instanceof CloudError) {
|
|
204
|
+
throw error;
|
|
205
|
+
}
|
|
206
|
+
throw CloudErrorFactory.unknown(error, {
|
|
207
|
+
context: { operation: "skills.upload", request }
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// ==========================================================================
|
|
212
|
+
// Download Skill
|
|
213
|
+
// ==========================================================================
|
|
214
|
+
/**
|
|
215
|
+
* Download skill from cloud
|
|
216
|
+
*
|
|
217
|
+
* @param request - Download request with skill ID
|
|
218
|
+
* @returns Download response with skill content
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* ```typescript
|
|
222
|
+
* const response = await client.download({
|
|
223
|
+
* skillId: 'my-skill',
|
|
224
|
+
* version: '1.0.0'
|
|
225
|
+
* })
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
async download(request) {
|
|
229
|
+
try {
|
|
230
|
+
if (!request.skillId || request.skillId.trim() === "") {
|
|
231
|
+
throw CloudErrorFactory.validation("Skill ID is required");
|
|
232
|
+
}
|
|
233
|
+
const query = {
|
|
234
|
+
skillId: request.skillId
|
|
235
|
+
};
|
|
236
|
+
if (request.version) {
|
|
237
|
+
query.version = request.version;
|
|
238
|
+
}
|
|
239
|
+
const response = await this.gateway.request(
|
|
240
|
+
"skills.download",
|
|
241
|
+
{
|
|
242
|
+
method: "GET",
|
|
243
|
+
query
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
if (response.success && response.data) {
|
|
247
|
+
if (!validateSkillDownloadResponse(response.data)) {
|
|
248
|
+
throw CloudErrorFactory.schemaMismatch(
|
|
249
|
+
"Invalid skill download response format",
|
|
250
|
+
{ context: { request } }
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return response;
|
|
255
|
+
} catch (error) {
|
|
256
|
+
if (error instanceof CloudError) {
|
|
257
|
+
throw error;
|
|
258
|
+
}
|
|
259
|
+
throw CloudErrorFactory.unknown(error, {
|
|
260
|
+
context: { operation: "skills.download", request }
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// ==========================================================================
|
|
265
|
+
// Update Skill
|
|
266
|
+
// ==========================================================================
|
|
267
|
+
/**
|
|
268
|
+
* Update skill in cloud
|
|
269
|
+
*
|
|
270
|
+
* @param request - Update request with skill ID and changes
|
|
271
|
+
* @returns Update response with updated skill
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* ```typescript
|
|
275
|
+
* const response = await client.update({
|
|
276
|
+
* skillId: 'my-skill',
|
|
277
|
+
* version: '1.1.0',
|
|
278
|
+
* content: '# Updated content...'
|
|
279
|
+
* })
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
async update(request) {
|
|
283
|
+
try {
|
|
284
|
+
if (!request.skillId || request.skillId.trim() === "") {
|
|
285
|
+
throw CloudErrorFactory.validation("Skill ID is required");
|
|
286
|
+
}
|
|
287
|
+
const response = await this.gateway.request(
|
|
288
|
+
"skills.upload",
|
|
289
|
+
{
|
|
290
|
+
method: "PUT",
|
|
291
|
+
body: request
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
return response;
|
|
295
|
+
} catch (error) {
|
|
296
|
+
if (error instanceof CloudError) {
|
|
297
|
+
throw error;
|
|
298
|
+
}
|
|
299
|
+
throw CloudErrorFactory.unknown(error, {
|
|
300
|
+
context: { operation: "skills.update", request }
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
// ==========================================================================
|
|
305
|
+
// Delete Skill
|
|
306
|
+
// ==========================================================================
|
|
307
|
+
/**
|
|
308
|
+
* Delete skill from cloud
|
|
309
|
+
*
|
|
310
|
+
* @param request - Delete request with skill ID
|
|
311
|
+
* @returns Delete response
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```typescript
|
|
315
|
+
* const response = await client.delete({
|
|
316
|
+
* skillId: 'my-skill'
|
|
317
|
+
* })
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
async delete(request) {
|
|
321
|
+
try {
|
|
322
|
+
if (!request.skillId || request.skillId.trim() === "") {
|
|
323
|
+
throw CloudErrorFactory.validation("Skill ID is required");
|
|
324
|
+
}
|
|
325
|
+
const response = await this.gateway.request(
|
|
326
|
+
"skills.upload",
|
|
327
|
+
{
|
|
328
|
+
method: "DELETE",
|
|
329
|
+
query: {
|
|
330
|
+
skillId: request.skillId
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
return response;
|
|
335
|
+
} catch (error) {
|
|
336
|
+
if (error instanceof CloudError) {
|
|
337
|
+
throw error;
|
|
338
|
+
}
|
|
339
|
+
throw CloudErrorFactory.unknown(error, {
|
|
340
|
+
context: { operation: "skills.delete", request }
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
// ==========================================================================
|
|
345
|
+
// Helper Methods
|
|
346
|
+
// ==========================================================================
|
|
347
|
+
/**
|
|
348
|
+
* Build query parameters for list request
|
|
349
|
+
*/
|
|
350
|
+
buildListQuery(request) {
|
|
351
|
+
const query = {};
|
|
352
|
+
if (request.privacy)
|
|
353
|
+
query.privacy = request.privacy;
|
|
354
|
+
if (request.author)
|
|
355
|
+
query.author = request.author;
|
|
356
|
+
if (request.tags && request.tags.length > 0)
|
|
357
|
+
query.tags = request.tags.join(",");
|
|
358
|
+
if (request.query)
|
|
359
|
+
query.query = request.query;
|
|
360
|
+
if (request.page)
|
|
361
|
+
query.page = request.page;
|
|
362
|
+
if (request.pageSize)
|
|
363
|
+
query.pageSize = request.pageSize;
|
|
364
|
+
if (request.sortBy)
|
|
365
|
+
query.sortBy = request.sortBy;
|
|
366
|
+
if (request.sortDir)
|
|
367
|
+
query.sortDir = request.sortDir;
|
|
368
|
+
return query;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Validate upload request
|
|
372
|
+
*/
|
|
373
|
+
validateUploadRequest(request) {
|
|
374
|
+
const errors = [];
|
|
375
|
+
if (!request.name || request.name.trim() === "")
|
|
376
|
+
errors.push("Skill name is required");
|
|
377
|
+
if (!request.version || request.version.trim() === "")
|
|
378
|
+
errors.push("Skill version is required");
|
|
379
|
+
if (!request.content || request.content.trim() === "")
|
|
380
|
+
errors.push("Skill content is required");
|
|
381
|
+
if (!request.metadata)
|
|
382
|
+
errors.push("Skill metadata is required");
|
|
383
|
+
else if (!request.metadata.author || request.metadata.author.trim() === "")
|
|
384
|
+
errors.push("Skill author is required");
|
|
385
|
+
if (!request.privacy)
|
|
386
|
+
errors.push("Skill privacy level is required");
|
|
387
|
+
if (!request.checksum || request.checksum.trim() === "")
|
|
388
|
+
errors.push("Skill checksum is required");
|
|
389
|
+
if (errors.length > 0) {
|
|
390
|
+
throw CloudErrorFactory.validation(
|
|
391
|
+
`Invalid upload request: ${errors.join(", ")}`
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
function createSkillsClient(gateway) {
|
|
397
|
+
return new SkillsApiClient(gateway);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function parseSkillMd(content, filePath = "unknown") {
|
|
401
|
+
try {
|
|
402
|
+
const parsed = matter(content);
|
|
403
|
+
const metadata = extractMetadata(parsed.data, filePath);
|
|
404
|
+
return {
|
|
405
|
+
metadata,
|
|
406
|
+
content: parsed.content.trim(),
|
|
407
|
+
filePath
|
|
408
|
+
};
|
|
409
|
+
} catch (error) {
|
|
410
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
411
|
+
throw new Error(`Failed to parse SKILL.md at ${filePath}: ${errorMessage}`);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
async function parseSkillMdFile(filePath) {
|
|
415
|
+
try {
|
|
416
|
+
const content = await readFile(filePath, "utf-8");
|
|
417
|
+
const skill = parseSkillMd(content, filePath);
|
|
418
|
+
try {
|
|
419
|
+
const stats = await stat(filePath);
|
|
420
|
+
skill.modifiedAt = stats.mtime;
|
|
421
|
+
} catch {
|
|
422
|
+
}
|
|
423
|
+
return skill;
|
|
424
|
+
} catch (error) {
|
|
425
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
426
|
+
throw new Error(`Failed to read SKILL.md file at ${filePath}: ${errorMessage}`);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
function extractMetadata(data, filePath) {
|
|
430
|
+
if (!data.name || typeof data.name !== "string") {
|
|
431
|
+
throw new Error(`Missing or invalid 'name' field in ${filePath}`);
|
|
432
|
+
}
|
|
433
|
+
if (!data.description || typeof data.description !== "string") {
|
|
434
|
+
throw new Error(`Missing or invalid 'description' field in ${filePath}`);
|
|
435
|
+
}
|
|
436
|
+
if (!data.version || typeof data.version !== "string") {
|
|
437
|
+
throw new Error(`Missing or invalid 'version' field in ${filePath}`);
|
|
438
|
+
}
|
|
439
|
+
if (!data.category || typeof data.category !== "string") {
|
|
440
|
+
throw new Error(`Missing or invalid 'category' field in ${filePath}`);
|
|
441
|
+
}
|
|
442
|
+
if (!Array.isArray(data.triggers) || data.triggers.length === 0) {
|
|
443
|
+
throw new Error(`Missing or invalid 'triggers' field in ${filePath}`);
|
|
444
|
+
}
|
|
445
|
+
if (!Array.isArray(data.use_when) || data.use_when.length === 0) {
|
|
446
|
+
throw new Error(`Missing or invalid 'use_when' field in ${filePath}`);
|
|
447
|
+
}
|
|
448
|
+
const metadata = {
|
|
449
|
+
name: data.name,
|
|
450
|
+
description: data.description,
|
|
451
|
+
version: data.version,
|
|
452
|
+
category: data.category,
|
|
453
|
+
triggers: data.triggers,
|
|
454
|
+
use_when: data.use_when
|
|
455
|
+
};
|
|
456
|
+
if (data.author && typeof data.author === "string") {
|
|
457
|
+
metadata.author = data.author;
|
|
458
|
+
}
|
|
459
|
+
if (typeof data.auto_activate === "boolean") {
|
|
460
|
+
metadata.auto_activate = data.auto_activate;
|
|
461
|
+
}
|
|
462
|
+
if (typeof data.priority === "number") {
|
|
463
|
+
metadata.priority = data.priority;
|
|
464
|
+
}
|
|
465
|
+
if (Array.isArray(data.agents)) {
|
|
466
|
+
metadata.agents = data.agents;
|
|
467
|
+
}
|
|
468
|
+
if (data.difficulty && typeof data.difficulty === "string") {
|
|
469
|
+
metadata.difficulty = data.difficulty;
|
|
470
|
+
}
|
|
471
|
+
if (Array.isArray(data.related_skills)) {
|
|
472
|
+
metadata.related_skills = data.related_skills;
|
|
473
|
+
}
|
|
474
|
+
if (data.ccjk_version && typeof data.ccjk_version === "string") {
|
|
475
|
+
metadata.ccjk_version = data.ccjk_version;
|
|
476
|
+
}
|
|
477
|
+
if (Array.isArray(data.tags)) {
|
|
478
|
+
metadata.tags = data.tags;
|
|
479
|
+
}
|
|
480
|
+
if (Array.isArray(data.allowed_tools)) {
|
|
481
|
+
metadata.allowed_tools = data.allowed_tools;
|
|
482
|
+
}
|
|
483
|
+
if (data.context && typeof data.context === "string") {
|
|
484
|
+
metadata.context = data.context;
|
|
485
|
+
}
|
|
486
|
+
if (data.agent && typeof data.agent === "string") {
|
|
487
|
+
metadata.agent = data.agent;
|
|
488
|
+
}
|
|
489
|
+
if (typeof data.user_invocable === "boolean") {
|
|
490
|
+
metadata.user_invocable = data.user_invocable;
|
|
491
|
+
}
|
|
492
|
+
if (Array.isArray(data.hooks)) {
|
|
493
|
+
metadata.hooks = data.hooks;
|
|
494
|
+
}
|
|
495
|
+
if (Array.isArray(data.permissions)) {
|
|
496
|
+
metadata.permissions = data.permissions;
|
|
497
|
+
}
|
|
498
|
+
if (typeof data.timeout === "number") {
|
|
499
|
+
metadata.timeout = data.timeout;
|
|
500
|
+
}
|
|
501
|
+
if (Array.isArray(data.outputs)) {
|
|
502
|
+
metadata.outputs = data.outputs;
|
|
503
|
+
}
|
|
504
|
+
return metadata;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
process__default.env.CCJK_CLOUD_API_URL || `${CLOUD_ENDPOINTS.MAIN.BASE_URL}${CLOUD_ENDPOINTS.MAIN.API_VERSION}`;
|
|
508
|
+
const SYNC_STATE_FILE = join(CCJK_CONFIG_DIR, "skills-sync-state.json");
|
|
509
|
+
const DEFAULT_TIMEOUT = 3e4;
|
|
510
|
+
function loadSyncState() {
|
|
511
|
+
if (!existsSync(SYNC_STATE_FILE)) {
|
|
512
|
+
return {
|
|
513
|
+
version: "1.0.0",
|
|
514
|
+
lastGlobalSync: (/* @__PURE__ */ new Date()).toISOString(),
|
|
515
|
+
skills: {}
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
try {
|
|
519
|
+
const content = readFileSync(SYNC_STATE_FILE, "utf-8");
|
|
520
|
+
return JSON.parse(content);
|
|
521
|
+
} catch (error) {
|
|
522
|
+
console.warn("Failed to load sync state, using empty state:", error);
|
|
523
|
+
return {
|
|
524
|
+
version: "1.0.0",
|
|
525
|
+
lastGlobalSync: (/* @__PURE__ */ new Date()).toISOString(),
|
|
526
|
+
skills: {}
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
function saveSyncState(state) {
|
|
531
|
+
try {
|
|
532
|
+
if (!existsSync(CCJK_CONFIG_DIR)) {
|
|
533
|
+
mkdirSync(CCJK_CONFIG_DIR, { recursive: true });
|
|
534
|
+
}
|
|
535
|
+
writeFileAtomic(SYNC_STATE_FILE, JSON.stringify(state, null, 2), "utf-8");
|
|
536
|
+
} catch (error) {
|
|
537
|
+
console.error("Failed to save sync state:", error);
|
|
538
|
+
throw new Error(`Failed to save sync state: ${error}`);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
function updateSyncState(skillId, localVersion, remoteVersion, localChecksum, remoteChecksum) {
|
|
542
|
+
const state = loadSyncState();
|
|
543
|
+
let status = "synced";
|
|
544
|
+
if (localChecksum === remoteChecksum) {
|
|
545
|
+
status = "synced";
|
|
546
|
+
} else if (!remoteChecksum) {
|
|
547
|
+
status = "local_only";
|
|
548
|
+
} else if (!localChecksum) {
|
|
549
|
+
status = "remote_only";
|
|
550
|
+
} else if (localVersion > remoteVersion) {
|
|
551
|
+
status = "local_ahead";
|
|
552
|
+
} else if (remoteVersion > localVersion) {
|
|
553
|
+
status = "remote_ahead";
|
|
554
|
+
} else {
|
|
555
|
+
status = "conflict";
|
|
556
|
+
}
|
|
557
|
+
state.skills[skillId] = {
|
|
558
|
+
skillId,
|
|
559
|
+
lastSyncTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
560
|
+
localVersion,
|
|
561
|
+
remoteVersion,
|
|
562
|
+
localChecksum,
|
|
563
|
+
remoteChecksum,
|
|
564
|
+
status
|
|
565
|
+
};
|
|
566
|
+
state.lastGlobalSync = (/* @__PURE__ */ new Date()).toISOString();
|
|
567
|
+
saveSyncState(state);
|
|
568
|
+
}
|
|
569
|
+
function calculateChecksum(content) {
|
|
570
|
+
return createHash("sha256").update(content).digest("hex");
|
|
571
|
+
}
|
|
572
|
+
async function getLocalSkills() {
|
|
573
|
+
if (!existsSync(CCJK_SKILLS_DIR)) {
|
|
574
|
+
return [];
|
|
575
|
+
}
|
|
576
|
+
const skills = [];
|
|
577
|
+
const files = readdirSync(CCJK_SKILLS_DIR);
|
|
578
|
+
for (const file of files) {
|
|
579
|
+
if (file.endsWith(".md")) {
|
|
580
|
+
const filePath = join(CCJK_SKILLS_DIR, file);
|
|
581
|
+
try {
|
|
582
|
+
const skill = await parseSkillMdFile(filePath);
|
|
583
|
+
skills.push(skill);
|
|
584
|
+
} catch (error) {
|
|
585
|
+
console.warn(`Failed to parse skill file ${file}:`, error);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
return skills;
|
|
590
|
+
}
|
|
591
|
+
async function getLocalSkill(skillId) {
|
|
592
|
+
const filePath = join(CCJK_SKILLS_DIR, `${skillId}.md`);
|
|
593
|
+
if (!existsSync(filePath)) {
|
|
594
|
+
return null;
|
|
595
|
+
}
|
|
596
|
+
try {
|
|
597
|
+
return await parseSkillMdFile(filePath);
|
|
598
|
+
} catch (error) {
|
|
599
|
+
console.error(`Failed to parse skill ${skillId}:`, error);
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
function saveLocalSkill(skillId, content) {
|
|
604
|
+
if (!existsSync(CCJK_SKILLS_DIR)) {
|
|
605
|
+
mkdirSync(CCJK_SKILLS_DIR, { recursive: true });
|
|
606
|
+
}
|
|
607
|
+
const filePath = join(CCJK_SKILLS_DIR, `${skillId}.md`);
|
|
608
|
+
writeFileAtomic(filePath, content, "utf-8");
|
|
609
|
+
}
|
|
610
|
+
function getAuthToken() {
|
|
611
|
+
const tokenFile = join(CCJK_CONFIG_DIR, "cloud-token.json");
|
|
612
|
+
if (!existsSync(tokenFile)) {
|
|
613
|
+
return null;
|
|
614
|
+
}
|
|
615
|
+
try {
|
|
616
|
+
const content = readFileSync(tokenFile, "utf-8");
|
|
617
|
+
const data = JSON.parse(content);
|
|
618
|
+
return data.deviceToken || null;
|
|
619
|
+
} catch {
|
|
620
|
+
return null;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
let skillsClient = null;
|
|
624
|
+
function getSkillsClient() {
|
|
625
|
+
if (!skillsClient) {
|
|
626
|
+
const token = getAuthToken();
|
|
627
|
+
if (!token) {
|
|
628
|
+
throw new Error("Not authenticated. Please bind device first using: npx ccjk notification bind");
|
|
629
|
+
}
|
|
630
|
+
const gateway = createGateway({
|
|
631
|
+
authToken: token,
|
|
632
|
+
timeout: DEFAULT_TIMEOUT
|
|
633
|
+
});
|
|
634
|
+
skillsClient = createSkillsClient(gateway);
|
|
635
|
+
}
|
|
636
|
+
return skillsClient;
|
|
637
|
+
}
|
|
638
|
+
async function listCloudSkills(options = {}) {
|
|
639
|
+
try {
|
|
640
|
+
const client = getSkillsClient();
|
|
641
|
+
const response = await client.list({
|
|
642
|
+
privacy: options.privacy,
|
|
643
|
+
author: options.author,
|
|
644
|
+
tags: options.tags,
|
|
645
|
+
query: options.query,
|
|
646
|
+
page: options.page,
|
|
647
|
+
pageSize: options.pageSize,
|
|
648
|
+
sortBy: options.sortBy,
|
|
649
|
+
sortDir: options.sortDir
|
|
650
|
+
});
|
|
651
|
+
if (!response.success || !response.data) {
|
|
652
|
+
return {
|
|
653
|
+
success: false,
|
|
654
|
+
error: response.error || "Failed to list skills",
|
|
655
|
+
code: response.code,
|
|
656
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
const skills = response.data.skills.map((skill) => ({
|
|
660
|
+
id: skill.id,
|
|
661
|
+
name: skill.name,
|
|
662
|
+
version: skill.version,
|
|
663
|
+
content: skill.content,
|
|
664
|
+
metadata: skill.metadata,
|
|
665
|
+
privacy: skill.privacy,
|
|
666
|
+
checksum: skill.checksum,
|
|
667
|
+
createdAt: skill.createdAt,
|
|
668
|
+
updatedAt: skill.updatedAt
|
|
669
|
+
}));
|
|
670
|
+
return {
|
|
671
|
+
success: true,
|
|
672
|
+
data: {
|
|
673
|
+
skills,
|
|
674
|
+
total: response.data.total,
|
|
675
|
+
page: response.data.page,
|
|
676
|
+
pageSize: response.data.pageSize,
|
|
677
|
+
totalPages: response.data.totalPages
|
|
678
|
+
},
|
|
679
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
680
|
+
};
|
|
681
|
+
} catch (error) {
|
|
682
|
+
return {
|
|
683
|
+
success: false,
|
|
684
|
+
error: error instanceof Error ? error.message : String(error),
|
|
685
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
async function getCloudSkill(skillId, version) {
|
|
690
|
+
try {
|
|
691
|
+
const client = getSkillsClient();
|
|
692
|
+
const response = await client.get({
|
|
693
|
+
skillId,
|
|
694
|
+
version
|
|
695
|
+
});
|
|
696
|
+
if (!response.success || !response.data) {
|
|
697
|
+
return {
|
|
698
|
+
success: false,
|
|
699
|
+
error: response.error || "Failed to get skill",
|
|
700
|
+
code: response.code,
|
|
701
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
const skill = response.data.skill;
|
|
705
|
+
return {
|
|
706
|
+
success: true,
|
|
707
|
+
data: {
|
|
708
|
+
id: skill.id,
|
|
709
|
+
name: skill.name,
|
|
710
|
+
version: skill.version,
|
|
711
|
+
content: skill.content,
|
|
712
|
+
checksum: skill.checksum,
|
|
713
|
+
privacy: skill.privacy,
|
|
714
|
+
metadata: skill.metadata,
|
|
715
|
+
createdAt: skill.createdAt,
|
|
716
|
+
updatedAt: skill.updatedAt
|
|
717
|
+
},
|
|
718
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
719
|
+
};
|
|
720
|
+
} catch (error) {
|
|
721
|
+
return {
|
|
722
|
+
success: false,
|
|
723
|
+
error: error instanceof Error ? error.message : String(error),
|
|
724
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
async function uploadSkill(request) {
|
|
729
|
+
try {
|
|
730
|
+
const client = getSkillsClient();
|
|
731
|
+
const response = await client.upload({
|
|
732
|
+
name: request.name,
|
|
733
|
+
version: request.version,
|
|
734
|
+
content: request.content,
|
|
735
|
+
metadata: request.metadata,
|
|
736
|
+
privacy: request.privacy,
|
|
737
|
+
checksum: request.checksum
|
|
738
|
+
});
|
|
739
|
+
if (!response.success || !response.data) {
|
|
740
|
+
return {
|
|
741
|
+
success: false,
|
|
742
|
+
error: response.error || "Failed to upload skill",
|
|
743
|
+
code: response.code,
|
|
744
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
const skill = response.data.skill;
|
|
748
|
+
return {
|
|
749
|
+
success: true,
|
|
750
|
+
data: {
|
|
751
|
+
id: skill.id,
|
|
752
|
+
name: skill.name,
|
|
753
|
+
version: skill.version,
|
|
754
|
+
content: skill.content,
|
|
755
|
+
checksum: skill.checksum,
|
|
756
|
+
privacy: skill.privacy,
|
|
757
|
+
metadata: skill.metadata,
|
|
758
|
+
createdAt: skill.createdAt,
|
|
759
|
+
updatedAt: skill.updatedAt
|
|
760
|
+
},
|
|
761
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
762
|
+
};
|
|
763
|
+
} catch (error) {
|
|
764
|
+
return {
|
|
765
|
+
success: false,
|
|
766
|
+
error: error instanceof Error ? error.message : String(error),
|
|
767
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
async function updateCloudSkill(skillId, request) {
|
|
772
|
+
try {
|
|
773
|
+
const client = getSkillsClient();
|
|
774
|
+
const response = await client.update({
|
|
775
|
+
skillId,
|
|
776
|
+
version: request.version,
|
|
777
|
+
content: request.content,
|
|
778
|
+
metadata: request.metadata,
|
|
779
|
+
privacy: request.privacy,
|
|
780
|
+
checksum: request.checksum
|
|
781
|
+
});
|
|
782
|
+
if (!response.success || !response.data) {
|
|
783
|
+
return {
|
|
784
|
+
success: false,
|
|
785
|
+
error: response.error || "Failed to update skill",
|
|
786
|
+
code: response.code,
|
|
787
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
const skill = response.data.skill;
|
|
791
|
+
return {
|
|
792
|
+
success: true,
|
|
793
|
+
data: {
|
|
794
|
+
id: skill.id,
|
|
795
|
+
name: skill.name,
|
|
796
|
+
version: skill.version,
|
|
797
|
+
content: skill.content,
|
|
798
|
+
checksum: skill.checksum,
|
|
799
|
+
privacy: skill.privacy,
|
|
800
|
+
metadata: skill.metadata,
|
|
801
|
+
createdAt: skill.createdAt,
|
|
802
|
+
updatedAt: skill.updatedAt
|
|
803
|
+
},
|
|
804
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
805
|
+
};
|
|
806
|
+
} catch (error) {
|
|
807
|
+
return {
|
|
808
|
+
success: false,
|
|
809
|
+
error: error instanceof Error ? error.message : String(error),
|
|
810
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
async function syncSkill(skillId, options = {}) {
|
|
815
|
+
try {
|
|
816
|
+
const localSkill = await getLocalSkill(skillId);
|
|
817
|
+
const localContent = localSkill ? readFileSync(join(CCJK_SKILLS_DIR, `${skillId}.md`), "utf-8") : "";
|
|
818
|
+
const localChecksum = localContent ? calculateChecksum(localContent) : "";
|
|
819
|
+
const localVersion = localSkill?.metadata.version || "";
|
|
820
|
+
const cloudResponse = await getCloudSkill(skillId);
|
|
821
|
+
const cloudSkill = cloudResponse.success ? cloudResponse.data : null;
|
|
822
|
+
const remoteChecksum = cloudSkill?.checksum || "";
|
|
823
|
+
const remoteVersion = cloudSkill?.version || "";
|
|
824
|
+
const syncState = loadSyncState();
|
|
825
|
+
const previousState = syncState.skills[skillId];
|
|
826
|
+
let action = "skipped";
|
|
827
|
+
let newState;
|
|
828
|
+
if (localSkill && cloudSkill) {
|
|
829
|
+
if (localChecksum === remoteChecksum) {
|
|
830
|
+
action = "skipped";
|
|
831
|
+
} else if (options.force) {
|
|
832
|
+
if (!options.dryRun) {
|
|
833
|
+
const uploadRequest = {
|
|
834
|
+
name: localSkill.metadata.name,
|
|
835
|
+
version: localSkill.metadata.version,
|
|
836
|
+
content: localContent,
|
|
837
|
+
metadata: {
|
|
838
|
+
author: localSkill.metadata.author || "unknown",
|
|
839
|
+
description: localSkill.metadata.description,
|
|
840
|
+
tags: localSkill.metadata.tags || [],
|
|
841
|
+
category: localSkill.metadata.category
|
|
842
|
+
},
|
|
843
|
+
privacy: "private",
|
|
844
|
+
checksum: localChecksum
|
|
845
|
+
};
|
|
846
|
+
await updateCloudSkill(skillId, uploadRequest);
|
|
847
|
+
}
|
|
848
|
+
action = "uploaded";
|
|
849
|
+
} else {
|
|
850
|
+
const resolution = options.conflictResolution || "prompt";
|
|
851
|
+
if (resolution === "local") {
|
|
852
|
+
if (!options.dryRun) {
|
|
853
|
+
const uploadRequest = {
|
|
854
|
+
name: localSkill.metadata.name,
|
|
855
|
+
version: localSkill.metadata.version,
|
|
856
|
+
content: localContent,
|
|
857
|
+
metadata: {
|
|
858
|
+
author: localSkill.metadata.author || "unknown",
|
|
859
|
+
description: localSkill.metadata.description,
|
|
860
|
+
tags: localSkill.metadata.tags || [],
|
|
861
|
+
category: localSkill.metadata.category
|
|
862
|
+
},
|
|
863
|
+
privacy: "private",
|
|
864
|
+
checksum: localChecksum
|
|
865
|
+
};
|
|
866
|
+
await updateCloudSkill(skillId, uploadRequest);
|
|
867
|
+
}
|
|
868
|
+
action = "uploaded";
|
|
869
|
+
} else if (resolution === "remote") {
|
|
870
|
+
if (!options.dryRun) {
|
|
871
|
+
saveLocalSkill(skillId, cloudSkill.content);
|
|
872
|
+
}
|
|
873
|
+
action = "downloaded";
|
|
874
|
+
} else if (resolution === "newer") {
|
|
875
|
+
const localTime = localSkill.modifiedAt?.getTime() || 0;
|
|
876
|
+
const remoteTime = new Date(cloudSkill.updatedAt).getTime();
|
|
877
|
+
if (localTime > remoteTime) {
|
|
878
|
+
if (!options.dryRun) {
|
|
879
|
+
const uploadRequest = {
|
|
880
|
+
name: localSkill.metadata.name,
|
|
881
|
+
version: localSkill.metadata.version,
|
|
882
|
+
content: localContent,
|
|
883
|
+
metadata: {
|
|
884
|
+
author: localSkill.metadata.author || "unknown",
|
|
885
|
+
description: localSkill.metadata.description,
|
|
886
|
+
tags: localSkill.metadata.tags || [],
|
|
887
|
+
category: localSkill.metadata.category
|
|
888
|
+
},
|
|
889
|
+
privacy: "private",
|
|
890
|
+
checksum: localChecksum
|
|
891
|
+
};
|
|
892
|
+
await updateCloudSkill(skillId, uploadRequest);
|
|
893
|
+
}
|
|
894
|
+
action = "uploaded";
|
|
895
|
+
} else {
|
|
896
|
+
if (!options.dryRun) {
|
|
897
|
+
saveLocalSkill(skillId, cloudSkill.content);
|
|
898
|
+
}
|
|
899
|
+
action = "downloaded";
|
|
900
|
+
}
|
|
901
|
+
} else {
|
|
902
|
+
action = "conflict";
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
} else if (localSkill && !cloudSkill) {
|
|
906
|
+
if (!options.dryRun) {
|
|
907
|
+
const uploadRequest = {
|
|
908
|
+
name: localSkill.metadata.name,
|
|
909
|
+
version: localSkill.metadata.version,
|
|
910
|
+
content: localContent,
|
|
911
|
+
metadata: {
|
|
912
|
+
author: localSkill.metadata.author || "unknown",
|
|
913
|
+
description: localSkill.metadata.description,
|
|
914
|
+
tags: localSkill.metadata.tags || [],
|
|
915
|
+
category: localSkill.metadata.category
|
|
916
|
+
},
|
|
917
|
+
privacy: "private",
|
|
918
|
+
checksum: localChecksum
|
|
919
|
+
};
|
|
920
|
+
await uploadSkill(uploadRequest);
|
|
921
|
+
}
|
|
922
|
+
action = "uploaded";
|
|
923
|
+
} else if (!localSkill && cloudSkill) {
|
|
924
|
+
if (!options.dryRun) {
|
|
925
|
+
saveLocalSkill(skillId, cloudSkill.content);
|
|
926
|
+
}
|
|
927
|
+
action = "downloaded";
|
|
928
|
+
}
|
|
929
|
+
if (!options.dryRun && action !== "conflict") {
|
|
930
|
+
updateSyncState(skillId, localVersion, remoteVersion, localChecksum, remoteChecksum);
|
|
931
|
+
newState = loadSyncState().skills[skillId];
|
|
932
|
+
}
|
|
933
|
+
return {
|
|
934
|
+
skillId,
|
|
935
|
+
skillName: localSkill?.metadata.name || cloudSkill?.name || skillId,
|
|
936
|
+
success: true,
|
|
937
|
+
action,
|
|
938
|
+
previousState,
|
|
939
|
+
newState
|
|
940
|
+
};
|
|
941
|
+
} catch (error) {
|
|
942
|
+
return {
|
|
943
|
+
skillId,
|
|
944
|
+
skillName: skillId,
|
|
945
|
+
success: false,
|
|
946
|
+
action: "skipped",
|
|
947
|
+
error: error instanceof Error ? error.message : String(error)
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
async function syncAllSkills(options = {}) {
|
|
952
|
+
const startTime = Date.now();
|
|
953
|
+
try {
|
|
954
|
+
const localSkills = await getLocalSkills();
|
|
955
|
+
const localSkillIds = new Set(localSkills.map((s) => s.metadata.name));
|
|
956
|
+
const cloudResponse = await listCloudSkills({ privacy: options.privacy });
|
|
957
|
+
if (!cloudResponse.success) {
|
|
958
|
+
throw new Error(cloudResponse.error || "Failed to list cloud skills");
|
|
959
|
+
}
|
|
960
|
+
const cloudSkills = cloudResponse.data?.skills || [];
|
|
961
|
+
const cloudSkillIds = new Set(cloudSkills.map((s) => s.id));
|
|
962
|
+
const allSkillIds = /* @__PURE__ */ new Set([...localSkillIds, ...cloudSkillIds]);
|
|
963
|
+
let skillIdsToSync = Array.from(allSkillIds);
|
|
964
|
+
if (options.skillIds && options.skillIds.length > 0) {
|
|
965
|
+
skillIdsToSync = skillIdsToSync.filter((id) => options.skillIds.includes(id));
|
|
966
|
+
}
|
|
967
|
+
const results = [];
|
|
968
|
+
for (const skillId of skillIdsToSync) {
|
|
969
|
+
const result = await syncSkill(skillId, options);
|
|
970
|
+
results.push(result);
|
|
971
|
+
}
|
|
972
|
+
const succeeded = results.filter((r) => r.success).length;
|
|
973
|
+
const failed = results.filter((r) => !r.success).length;
|
|
974
|
+
const conflicts = results.filter((r) => r.action === "conflict").length;
|
|
975
|
+
const uploaded = results.filter((r) => r.action === "uploaded").length;
|
|
976
|
+
const downloaded = results.filter((r) => r.action === "downloaded").length;
|
|
977
|
+
const skipped = results.filter((r) => r.action === "skipped").length;
|
|
978
|
+
return {
|
|
979
|
+
success: failed === 0,
|
|
980
|
+
total: results.length,
|
|
981
|
+
succeeded,
|
|
982
|
+
failed,
|
|
983
|
+
conflicts,
|
|
984
|
+
uploaded,
|
|
985
|
+
downloaded,
|
|
986
|
+
skipped,
|
|
987
|
+
results,
|
|
988
|
+
durationMs: Date.now() - startTime
|
|
989
|
+
};
|
|
990
|
+
} catch (error) {
|
|
991
|
+
return {
|
|
992
|
+
success: false,
|
|
993
|
+
total: 0,
|
|
994
|
+
succeeded: 0,
|
|
995
|
+
failed: 0,
|
|
996
|
+
conflicts: 0,
|
|
997
|
+
uploaded: 0,
|
|
998
|
+
downloaded: 0,
|
|
999
|
+
skipped: 0,
|
|
1000
|
+
results: [],
|
|
1001
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1002
|
+
durationMs: Date.now() - startTime
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
async function pushSkills(skillIds, options = {}) {
|
|
1007
|
+
return syncAllSkills({
|
|
1008
|
+
...options,
|
|
1009
|
+
skillIds,
|
|
1010
|
+
conflictResolution: options.conflictResolution || "local"
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
async function pullSkills(skillIds, options = {}) {
|
|
1014
|
+
return syncAllSkills({
|
|
1015
|
+
...options,
|
|
1016
|
+
skillIds,
|
|
1017
|
+
conflictResolution: options.conflictResolution || "remote"
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
async function syncSkills(options = {}) {
|
|
1022
|
+
const t = getTranslation(options.lang);
|
|
1023
|
+
console.log("");
|
|
1024
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1025
|
+
console.log(a.bold.cyan(` ${t("skillsSync:title.sync")}`));
|
|
1026
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1027
|
+
console.log("");
|
|
1028
|
+
try {
|
|
1029
|
+
await showSyncStatus(options);
|
|
1030
|
+
const { confirm } = await inquirer.prompt({
|
|
1031
|
+
type: "confirm",
|
|
1032
|
+
name: "confirm",
|
|
1033
|
+
message: t("skillsSync:prompt.confirmSync"),
|
|
1034
|
+
default: true
|
|
1035
|
+
});
|
|
1036
|
+
if (!confirm) {
|
|
1037
|
+
console.log(a.yellow(`
|
|
1038
|
+
${t("skillsSync:message.cancelled")}`));
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
console.log(a.dim(`
|
|
1042
|
+
${t("skillsSync:message.syncing")}...
|
|
1043
|
+
`));
|
|
1044
|
+
const syncOptions = {
|
|
1045
|
+
conflictResolution: options.conflictResolution || "prompt",
|
|
1046
|
+
dryRun: options.dryRun,
|
|
1047
|
+
force: options.force,
|
|
1048
|
+
skillIds: options.skillIds,
|
|
1049
|
+
privacy: options.privacy
|
|
1050
|
+
};
|
|
1051
|
+
const result = await syncAllSkills(syncOptions);
|
|
1052
|
+
displaySyncResult(result, options.lang);
|
|
1053
|
+
} catch (error) {
|
|
1054
|
+
console.error(a.red(`
|
|
1055
|
+
${t("skillsSync:error.syncFailed")}: ${error}`));
|
|
1056
|
+
throw error;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
async function pushSkillsCommand(options = {}) {
|
|
1060
|
+
const t = getTranslation(options.lang);
|
|
1061
|
+
console.log("");
|
|
1062
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1063
|
+
console.log(a.bold.cyan(` ${t("skillsSync:title.push")}`));
|
|
1064
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1065
|
+
console.log("");
|
|
1066
|
+
try {
|
|
1067
|
+
const localSkills = await getLocalSkills();
|
|
1068
|
+
console.log(a.dim(` ${t("skillsSync:message.foundLocalSkills", { count: localSkills.length })}`));
|
|
1069
|
+
if (localSkills.length === 0) {
|
|
1070
|
+
console.log(a.yellow(`
|
|
1071
|
+
${t("skillsSync:message.noLocalSkills")}`));
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
const { confirm } = await inquirer.prompt({
|
|
1075
|
+
type: "confirm",
|
|
1076
|
+
name: "confirm",
|
|
1077
|
+
message: t("skillsSync:prompt.confirmPush"),
|
|
1078
|
+
default: true
|
|
1079
|
+
});
|
|
1080
|
+
if (!confirm) {
|
|
1081
|
+
console.log(a.yellow(`
|
|
1082
|
+
${t("skillsSync:message.cancelled")}`));
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
console.log(a.dim(`
|
|
1086
|
+
${t("skillsSync:message.pushing")}...
|
|
1087
|
+
`));
|
|
1088
|
+
const syncOptions = {
|
|
1089
|
+
conflictResolution: "local",
|
|
1090
|
+
dryRun: options.dryRun,
|
|
1091
|
+
force: options.force,
|
|
1092
|
+
skillIds: options.skillIds,
|
|
1093
|
+
privacy: options.privacy
|
|
1094
|
+
};
|
|
1095
|
+
const result = await pushSkills(options.skillIds, syncOptions);
|
|
1096
|
+
displaySyncResult(result, options.lang);
|
|
1097
|
+
} catch (error) {
|
|
1098
|
+
console.error(a.red(`
|
|
1099
|
+
${t("skillsSync:error.pushFailed")}: ${error}`));
|
|
1100
|
+
throw error;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
async function pullSkillsCommand(options = {}) {
|
|
1104
|
+
const t = getTranslation(options.lang);
|
|
1105
|
+
console.log("");
|
|
1106
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1107
|
+
console.log(a.bold.cyan(` ${t("skillsSync:title.pull")}`));
|
|
1108
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1109
|
+
console.log("");
|
|
1110
|
+
try {
|
|
1111
|
+
const cloudResponse = await listCloudSkills({ privacy: options.privacy });
|
|
1112
|
+
if (!cloudResponse.success) {
|
|
1113
|
+
throw new Error(cloudResponse.error || "Failed to list cloud skills");
|
|
1114
|
+
}
|
|
1115
|
+
const cloudSkills = cloudResponse.data?.skills || [];
|
|
1116
|
+
console.log(a.dim(` ${t("skillsSync:message.foundCloudSkills", { count: cloudSkills.length })}`));
|
|
1117
|
+
if (cloudSkills.length === 0) {
|
|
1118
|
+
console.log(a.yellow(`
|
|
1119
|
+
${t("skillsSync:message.noCloudSkills")}`));
|
|
1120
|
+
return;
|
|
1121
|
+
}
|
|
1122
|
+
const { confirm } = await inquirer.prompt({
|
|
1123
|
+
type: "confirm",
|
|
1124
|
+
name: "confirm",
|
|
1125
|
+
message: t("skillsSync:prompt.confirmPull"),
|
|
1126
|
+
default: true
|
|
1127
|
+
});
|
|
1128
|
+
if (!confirm) {
|
|
1129
|
+
console.log(a.yellow(`
|
|
1130
|
+
${t("skillsSync:message.cancelled")}`));
|
|
1131
|
+
return;
|
|
1132
|
+
}
|
|
1133
|
+
console.log(a.dim(`
|
|
1134
|
+
${t("skillsSync:message.pulling")}...
|
|
1135
|
+
`));
|
|
1136
|
+
const syncOptions = {
|
|
1137
|
+
conflictResolution: "remote",
|
|
1138
|
+
dryRun: options.dryRun,
|
|
1139
|
+
force: options.force,
|
|
1140
|
+
skillIds: options.skillIds,
|
|
1141
|
+
privacy: options.privacy
|
|
1142
|
+
};
|
|
1143
|
+
const result = await pullSkills(options.skillIds, syncOptions);
|
|
1144
|
+
displaySyncResult(result, options.lang);
|
|
1145
|
+
} catch (error) {
|
|
1146
|
+
console.error(a.red(`
|
|
1147
|
+
${t("skillsSync:error.pullFailed")}: ${error}`));
|
|
1148
|
+
throw error;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
async function listCloudSkillsCommand(options = {}) {
|
|
1152
|
+
const t = getTranslation(options.lang);
|
|
1153
|
+
console.log("");
|
|
1154
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1155
|
+
console.log(a.bold.cyan(` ${t("skillsSync:title.list")}`));
|
|
1156
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1157
|
+
console.log("");
|
|
1158
|
+
try {
|
|
1159
|
+
const response = await listCloudSkills({ privacy: options.privacy });
|
|
1160
|
+
if (!response.success) {
|
|
1161
|
+
throw new Error(response.error || "Failed to list cloud skills");
|
|
1162
|
+
}
|
|
1163
|
+
const skills = response.data?.skills || [];
|
|
1164
|
+
if (skills.length === 0) {
|
|
1165
|
+
console.log(a.yellow(` ${t("skillsSync:message.noCloudSkills")}`));
|
|
1166
|
+
return;
|
|
1167
|
+
}
|
|
1168
|
+
console.log(a.bold.green(` ${t("skillsSync:message.foundCloudSkills", { count: skills.length })}
|
|
1169
|
+
`));
|
|
1170
|
+
for (const skill of skills) {
|
|
1171
|
+
const privacyBadge = getPrivacyBadge(skill.privacy);
|
|
1172
|
+
console.log(`${a.bold(` ${skill.name}`) + a.dim(` v${skill.version}`)} ${privacyBadge}`);
|
|
1173
|
+
console.log(a.dim(` ${skill.metadata.description}`));
|
|
1174
|
+
if (skill.metadata.tags && skill.metadata.tags.length > 0) {
|
|
1175
|
+
const tags = skill.metadata.tags.map((tag) => a.bgGray.white(` ${tag} `)).join(" ");
|
|
1176
|
+
console.log(` ${tags}`);
|
|
1177
|
+
}
|
|
1178
|
+
console.log(a.dim(` ${t("skillsSync:label.author")}: ${skill.metadata.author}`));
|
|
1179
|
+
console.log(a.dim(` ${t("skillsSync:label.updated")}: ${new Date(skill.updatedAt).toLocaleString()}`));
|
|
1180
|
+
console.log("");
|
|
1181
|
+
}
|
|
1182
|
+
} catch (error) {
|
|
1183
|
+
console.error(a.red(`
|
|
1184
|
+
${t("skillsSync:error.listFailed")}: ${error}`));
|
|
1185
|
+
throw error;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
async function showSyncStatus(options = {}) {
|
|
1189
|
+
const t = getTranslation(options.lang);
|
|
1190
|
+
try {
|
|
1191
|
+
const syncState = loadSyncState();
|
|
1192
|
+
const localSkills = await getLocalSkills();
|
|
1193
|
+
const cloudResponse = await listCloudSkills({ privacy: options.privacy });
|
|
1194
|
+
const cloudSkills = cloudResponse.success ? cloudResponse.data?.skills || [] : [];
|
|
1195
|
+
console.log(a.bold(` ${t("skillsSync:label.status")}:`));
|
|
1196
|
+
console.log(a.dim(` ${t("skillsSync:label.localSkills")}: ${localSkills.length}`));
|
|
1197
|
+
console.log(a.dim(` ${t("skillsSync:label.cloudSkills")}: ${cloudSkills.length}`));
|
|
1198
|
+
console.log(a.dim(` ${t("skillsSync:label.lastSync")}: ${new Date(syncState.lastGlobalSync).toLocaleString()}`));
|
|
1199
|
+
const states = Object.values(syncState.skills);
|
|
1200
|
+
const synced = states.filter((s) => s.status === "synced").length;
|
|
1201
|
+
const localAhead = states.filter((s) => s.status === "local_ahead").length;
|
|
1202
|
+
const remoteAhead = states.filter((s) => s.status === "remote_ahead").length;
|
|
1203
|
+
const conflicts = states.filter((s) => s.status === "conflict").length;
|
|
1204
|
+
const localOnly = states.filter((s) => s.status === "local_only").length;
|
|
1205
|
+
const remoteOnly = states.filter((s) => s.status === "remote_only").length;
|
|
1206
|
+
console.log("");
|
|
1207
|
+
console.log(a.bold(` ${t("skillsSync:label.syncStates")}:`));
|
|
1208
|
+
if (synced > 0)
|
|
1209
|
+
console.log(a.green(` \u2713 ${t("skillsSync:status.synced")}: ${synced}`));
|
|
1210
|
+
if (localAhead > 0)
|
|
1211
|
+
console.log(a.yellow(` \u2191 ${t("skillsSync:status.localAhead")}: ${localAhead}`));
|
|
1212
|
+
if (remoteAhead > 0)
|
|
1213
|
+
console.log(a.yellow(` \u2193 ${t("skillsSync:status.remoteAhead")}: ${remoteAhead}`));
|
|
1214
|
+
if (conflicts > 0)
|
|
1215
|
+
console.log(a.red(` \u26A0 ${t("skillsSync:status.conflict")}: ${conflicts}`));
|
|
1216
|
+
if (localOnly > 0)
|
|
1217
|
+
console.log(a.green(` \u2295 ${t("skillsSync:status.localOnly")}: ${localOnly}`));
|
|
1218
|
+
if (remoteOnly > 0)
|
|
1219
|
+
console.log(a.green(` \u2296 ${t("skillsSync:status.remoteOnly")}: ${remoteOnly}`));
|
|
1220
|
+
console.log("");
|
|
1221
|
+
} catch (error) {
|
|
1222
|
+
console.warn(a.yellow(` ${t("skillsSync:warning.statusFailed")}: ${error}`));
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
async function skillsSyncMenu(options = {}) {
|
|
1226
|
+
const t = getTranslation(options.lang);
|
|
1227
|
+
while (true) {
|
|
1228
|
+
console.log("");
|
|
1229
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1230
|
+
console.log(a.bold.cyan(` ${t("skillsSync:menu.title")}`));
|
|
1231
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1232
|
+
console.log("");
|
|
1233
|
+
const { action } = await inquirer.prompt({
|
|
1234
|
+
type: "list",
|
|
1235
|
+
name: "action",
|
|
1236
|
+
message: t("skillsSync:menu.prompt"),
|
|
1237
|
+
choices: [
|
|
1238
|
+
{ name: `\u{1F504} ${t("skillsSync:menu.sync")}`, value: "sync" },
|
|
1239
|
+
{ name: `\u2191 ${t("skillsSync:menu.push")}`, value: "push" },
|
|
1240
|
+
{ name: `\u2193 ${t("skillsSync:menu.pull")}`, value: "pull" },
|
|
1241
|
+
{ name: `\u{1F4CB} ${t("skillsSync:menu.list")}`, value: "list" },
|
|
1242
|
+
{ name: `\u{1F4CA} ${t("skillsSync:menu.status")}`, value: "status" },
|
|
1243
|
+
new inquirer.Separator(),
|
|
1244
|
+
{ name: `\u{1F519} ${t("skillsSync:menu.back")}`, value: "back" }
|
|
1245
|
+
]
|
|
1246
|
+
});
|
|
1247
|
+
if (action === "back") {
|
|
1248
|
+
break;
|
|
1249
|
+
}
|
|
1250
|
+
try {
|
|
1251
|
+
switch (action) {
|
|
1252
|
+
case "sync":
|
|
1253
|
+
await syncSkills(options);
|
|
1254
|
+
break;
|
|
1255
|
+
case "push":
|
|
1256
|
+
await pushSkillsCommand(options);
|
|
1257
|
+
break;
|
|
1258
|
+
case "pull":
|
|
1259
|
+
await pullSkillsCommand(options);
|
|
1260
|
+
break;
|
|
1261
|
+
case "list":
|
|
1262
|
+
await listCloudSkillsCommand(options);
|
|
1263
|
+
break;
|
|
1264
|
+
case "status":
|
|
1265
|
+
await showSyncStatus(options);
|
|
1266
|
+
break;
|
|
1267
|
+
}
|
|
1268
|
+
} catch (error) {
|
|
1269
|
+
console.error(a.red(`
|
|
1270
|
+
${t("common.error")}: ${error}`));
|
|
1271
|
+
}
|
|
1272
|
+
await inquirer.prompt({
|
|
1273
|
+
type: "input",
|
|
1274
|
+
name: "continue",
|
|
1275
|
+
message: t("common.pressEnterToContinue")
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
function displaySyncResult(result, lang) {
|
|
1280
|
+
const t = getTranslation();
|
|
1281
|
+
console.log("");
|
|
1282
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1283
|
+
console.log(a.bold.cyan(` ${t("skillsSync:result.title")}`));
|
|
1284
|
+
console.log(a.bold.cyan("\u2501".repeat(60)));
|
|
1285
|
+
console.log("");
|
|
1286
|
+
if (result.success) {
|
|
1287
|
+
console.log(a.bold.green(` \u2713 ${t("skillsSync:result.success")}`));
|
|
1288
|
+
} else {
|
|
1289
|
+
console.log(a.bold.red(` \u2717 ${t("skillsSync:result.failed")}`));
|
|
1290
|
+
if (result.error) {
|
|
1291
|
+
console.log(a.red(` ${result.error}`));
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
console.log("");
|
|
1295
|
+
console.log(a.bold(` ${t("skillsSync:result.statistics")}:`));
|
|
1296
|
+
console.log(a.dim(` ${t("skillsSync:result.total")}: ${result.total}`));
|
|
1297
|
+
console.log(a.green(` ${t("skillsSync:result.succeeded")}: ${result.succeeded}`));
|
|
1298
|
+
if (result.failed > 0) {
|
|
1299
|
+
console.log(a.red(` ${t("skillsSync:result.failed")}: ${result.failed}`));
|
|
1300
|
+
}
|
|
1301
|
+
if (result.conflicts > 0) {
|
|
1302
|
+
console.log(a.yellow(` ${t("skillsSync:result.conflicts")}: ${result.conflicts}`));
|
|
1303
|
+
}
|
|
1304
|
+
console.log(a.green(` ${t("skillsSync:result.uploaded")}: ${result.uploaded}`));
|
|
1305
|
+
console.log(a.green(` ${t("skillsSync:result.downloaded")}: ${result.downloaded}`));
|
|
1306
|
+
console.log(a.dim(` ${t("skillsSync:result.skipped")}: ${result.skipped}`));
|
|
1307
|
+
console.log(a.dim(` ${t("skillsSync:result.duration")}: ${(result.durationMs / 1e3).toFixed(2)}s`));
|
|
1308
|
+
if (result.failed > 0 || result.conflicts > 0) {
|
|
1309
|
+
console.log("");
|
|
1310
|
+
console.log(a.bold(` ${t("skillsSync:result.details")}:`));
|
|
1311
|
+
for (const item of result.results) {
|
|
1312
|
+
if (!item.success || item.action === "conflict") {
|
|
1313
|
+
const icon = item.success ? "\u26A0" : "\u2717";
|
|
1314
|
+
const color = item.success ? a.yellow : a.red;
|
|
1315
|
+
console.log(color(` ${icon} ${item.skillName}`));
|
|
1316
|
+
if (item.error) {
|
|
1317
|
+
console.log(a.dim(` ${item.error}`));
|
|
1318
|
+
}
|
|
1319
|
+
if (item.action === "conflict") {
|
|
1320
|
+
console.log(a.dim(` ${t("skillsSync:result.conflictHint")}`));
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
if (result.success && result.uploaded > 0) {
|
|
1326
|
+
showImpactReminder("publish");
|
|
1327
|
+
}
|
|
1328
|
+
console.log("");
|
|
1329
|
+
}
|
|
1330
|
+
function getPrivacyBadge(privacy) {
|
|
1331
|
+
switch (privacy) {
|
|
1332
|
+
case "private":
|
|
1333
|
+
return a.bgRed.white(" PRIVATE ");
|
|
1334
|
+
case "team":
|
|
1335
|
+
return a.bgYellow.black(" TEAM ");
|
|
1336
|
+
case "public":
|
|
1337
|
+
return a.bgGreen.white(" PUBLIC ");
|
|
1338
|
+
default:
|
|
1339
|
+
return "";
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
export { listCloudSkillsCommand, pullSkillsCommand, pushSkillsCommand, showSyncStatus, skillsSyncMenu, syncSkills };
|