bi-superpowers 1.0.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/.claude-plugin/marketplace.json +31 -0
- package/.claude-plugin/plugin.json +34 -0
- package/.claude-plugin/skill-manifest.json +79 -0
- package/.mcp.json +13 -0
- package/.plugin/plugin.json +14 -0
- package/LICENSE +21 -0
- package/README.md +849 -0
- package/bin/build-plugin.js +97 -0
- package/bin/cli.js +891 -0
- package/bin/commands/autoupdate.js +128 -0
- package/bin/commands/build-desktop.js +368 -0
- package/bin/commands/create-from-template.js +165 -0
- package/bin/commands/diff.js +435 -0
- package/bin/commands/install.js +542 -0
- package/bin/commands/lint.js +441 -0
- package/bin/commands/mcp-setup.js +255 -0
- package/bin/commands/session-update.js +204 -0
- package/bin/commands/smoke-test.js +20 -0
- package/bin/commands/uninstall.js +611 -0
- package/bin/commands/update-check.js +427 -0
- package/bin/commands/validate-cases.js +264 -0
- package/bin/commands/validate-projects.js +426 -0
- package/bin/commands/watch.js +251 -0
- package/bin/lib/agents.js +62 -0
- package/bin/lib/base-template-smoke.js +299 -0
- package/bin/lib/claude-hooks.js +160 -0
- package/bin/lib/generators/claude-plugin.js +529 -0
- package/bin/lib/generators/index.js +116 -0
- package/bin/lib/generators/shared.js +257 -0
- package/bin/lib/mcp-config.js +835 -0
- package/bin/lib/microsoft-mcp.js +206 -0
- package/bin/lib/powerbi-mcp-session.js +140 -0
- package/bin/lib/skills.js +164 -0
- package/bin/lib/template-scaffold.js +366 -0
- package/bin/mcp/powerbi-modeling-launcher.js +42 -0
- package/bin/postinstall.js +50 -0
- package/bin/utils/mcp-detect.js +346 -0
- package/bin/utils/tui.js +314 -0
- package/commands/bi-connect.md +520 -0
- package/commands/bi-dax.md +464 -0
- package/commands/bi-kickoff.md +550 -0
- package/commands/bi-modeling.md +485 -0
- package/commands/bi-performance.md +521 -0
- package/commands/bi-powerquery.md +229 -0
- package/commands/bi-refactor.md +249 -0
- package/commands/bi-scorecard.md +268 -0
- package/commands/bi-start.md +272 -0
- package/config.example.json +23 -0
- package/config.json +23 -0
- package/desktop-extension/manifest.json +30 -0
- package/desktop-extension/package.json +10 -0
- package/desktop-extension/server.js +137 -0
- package/package.json +94 -0
- package/skills/bi-connect/SKILL.md +522 -0
- package/skills/bi-connect/scripts/update-check.js +427 -0
- package/skills/bi-dax/SKILL.md +466 -0
- package/skills/bi-dax/scripts/update-check.js +427 -0
- package/skills/bi-kickoff/SKILL.md +552 -0
- package/skills/bi-kickoff/references/flow.html +78 -0
- package/skills/bi-kickoff/references/flow.md +62 -0
- package/skills/bi-kickoff/scripts/update-check.js +427 -0
- package/skills/bi-modeling/SKILL.md +487 -0
- package/skills/bi-modeling/scripts/update-check.js +427 -0
- package/skills/bi-performance/SKILL.md +523 -0
- package/skills/bi-performance/scripts/install-tabular-editor.ps1 +159 -0
- package/skills/bi-performance/scripts/run-bpa.ps1 +265 -0
- package/skills/bi-performance/scripts/update-check.js +427 -0
- package/skills/bi-powerquery/SKILL.md +231 -0
- package/skills/bi-powerquery/references/base-template-data-contract.md +323 -0
- package/skills/bi-powerquery/references/power-query-standards.md +74 -0
- package/skills/bi-powerquery/scripts/new-powerquery-staging.ps1 +371 -0
- package/skills/bi-powerquery/scripts/test-powerquery-contract.ps1 +225 -0
- package/skills/bi-powerquery/scripts/update-check.js +427 -0
- package/skills/bi-refactor/SKILL.md +251 -0
- package/skills/bi-refactor/references/flow.md +27 -0
- package/skills/bi-refactor/scripts/update-check.js +427 -0
- package/skills/bi-scorecard/SKILL.md +270 -0
- package/skills/bi-scorecard/examples/base-template-scorecard-overlay.json +82 -0
- package/skills/bi-scorecard/scripts/new-scorecard-blueprint-from-base-template.ps1 +124 -0
- package/skills/bi-scorecard/scripts/powerbi-goal-status-rules-api.ps1 +39 -0
- package/skills/bi-scorecard/scripts/powerbi-goal-values-api.ps1 +48 -0
- package/skills/bi-scorecard/scripts/powerbi-goals-api.ps1 +68 -0
- package/skills/bi-scorecard/scripts/powerbi-rest-common.ps1 +197 -0
- package/skills/bi-scorecard/scripts/powerbi-scorecards-api.ps1 +53 -0
- package/skills/bi-scorecard/scripts/update-check.js +427 -0
- package/skills/bi-start/SKILL.md +274 -0
- package/skills/bi-start/scripts/update-check.js +427 -0
- package/src/content/base.md +197 -0
- package/src/content/mcp-requirements.json +57 -0
- package/src/content/routing.md +201 -0
- package/src/content/skills/bi-connect.md +493 -0
- package/src/content/skills/bi-dax.md +437 -0
- package/src/content/skills/bi-kickoff/SKILL.md +523 -0
- package/src/content/skills/bi-kickoff/references/flow.html +78 -0
- package/src/content/skills/bi-kickoff/references/flow.md +62 -0
- package/src/content/skills/bi-modeling.md +458 -0
- package/src/content/skills/bi-performance/SKILL.md +494 -0
- package/src/content/skills/bi-performance/scripts/install-tabular-editor.ps1 +159 -0
- package/src/content/skills/bi-performance/scripts/run-bpa.ps1 +265 -0
- package/src/content/skills/bi-powerquery/SKILL.md +202 -0
- package/src/content/skills/bi-powerquery/references/base-template-data-contract.md +323 -0
- package/src/content/skills/bi-powerquery/references/power-query-standards.md +74 -0
- package/src/content/skills/bi-powerquery/scripts/new-powerquery-staging.ps1 +371 -0
- package/src/content/skills/bi-powerquery/scripts/test-powerquery-contract.ps1 +225 -0
- package/src/content/skills/bi-refactor/SKILL.md +222 -0
- package/src/content/skills/bi-refactor/references/flow.md +27 -0
- package/src/content/skills/bi-scorecard/SKILL.md +241 -0
- package/src/content/skills/bi-scorecard/examples/base-template-scorecard-blueprint.expected.json +105 -0
- package/src/content/skills/bi-scorecard/examples/base-template-scorecard-overlay.json +82 -0
- package/src/content/skills/bi-scorecard/scripts/new-scorecard-blueprint-from-base-template.ps1 +124 -0
- package/src/content/skills/bi-scorecard/scripts/powerbi-goal-status-rules-api.ps1 +39 -0
- package/src/content/skills/bi-scorecard/scripts/powerbi-goal-values-api.ps1 +48 -0
- package/src/content/skills/bi-scorecard/scripts/powerbi-goals-api.ps1 +68 -0
- package/src/content/skills/bi-scorecard/scripts/powerbi-rest-common.ps1 +197 -0
- package/src/content/skills/bi-scorecard/scripts/powerbi-scorecards-api.ps1 +53 -0
- package/src/content/skills/bi-start.md +266 -0
- package/templates/base-template/AGENTS.md +33 -0
- package/templates/base-template/base-template.Report/.platform +11 -0
- package/templates/base-template/base-template.Report/StaticResources/RegisteredResources/BISuperpowers.json +3888 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BaseThemes/CY18SU07.json +177 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BaseThemes/Fluent2-CY26SU03.json +4104 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleCityPark.json +26 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleDefault.json +26 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleNeutral.json +26 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleOrchid.json +26 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleTidal.json +26 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Bloom.json +139 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/CityPark.json +40 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Classroom.json +40 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/ColorblindSafe.json +48 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/CopilotDefault.json +1861 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Divergent.json +127 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Electric.json +48 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Frontier.json +136 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/HighContrast.json +40 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Highrise.json +41 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Innovate.json +227 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/NewExecutive.json +41 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Solar.json +33 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Storm.json +25 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Sunset.json +48 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Temperature.json +33 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Tidal.json +100 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Twilight.json +40 -0
- package/templates/base-template/base-template.Report/definition/bookmarks/1d40d43c7ade66e8603c.bookmark.json +2297 -0
- package/templates/base-template/base-template.Report/definition/bookmarks/af068ff51c0ca3089ea7.bookmark.json +2300 -0
- package/templates/base-template/base-template.Report/definition/bookmarks/bookmarks.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/page.json +130 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/0352fd80d074693a65db/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/0352fd80d074693a65db/visual.json +669 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/1c5a14bf493697344b68/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/1c5a14bf493697344b68/visual.json +723 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/3486cf7624c5b109b4e5/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/3486cf7624c5b109b4e5/visual.json +333 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/4d8b989008edc0db28d1/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/4d8b989008edc0db28d1/visual.json +109 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/55e10ac7d76a1954f94f/mobile.json +31 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/55e10ac7d76a1954f94f/visual.json +378 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/57f52ecf4490f70e4da1/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/57f52ecf4490f70e4da1/visual.json +175 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/5f4d76bbc870118e9840/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/5f4d76bbc870118e9840/visual.json +468 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/73629e1abebb7a444b59/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/73629e1abebb7a444b59/visual.json +359 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/749cb1388c7e0a88161c/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/749cb1388c7e0a88161c/visual.json +690 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/90677f13cea5d1275990/visual.json +17 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/92cf92e3da10493adb78/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/92cf92e3da10493adb78/visual.json +468 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/9fe17b1971f68443fc15/mobile.json +10 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/9fe17b1971f68443fc15/visual.json +328 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a30bd0950630ed94e8a3/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a30bd0950630ed94e8a3/visual.json +578 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a56e91d9400a835e4814/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a56e91d9400a835e4814/visual.json +432 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/aded24cd205c0b528642/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/aded24cd205c0b528642/visual.json +801 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/af34b26f14a8a724c9a9/mobile.json +37 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/af34b26f14a8a724c9a9/visual.json +1318 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/b529688fe5a226643322/visual.json +209 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/c4c6f332d05e72e2eb06/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/c4c6f332d05e72e2eb06/visual.json +174 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/fa81f184e2cb0e8b087c/mobile.json +29 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/fa81f184e2cb0e8b087c/visual.json +241 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/page.json +130 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/07e9c4302e29029c5462/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/07e9c4302e29029c5462/visual.json +690 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/109ceede4bc015b0c006/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/109ceede4bc015b0c006/visual.json +468 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/118257e006d472277e10/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/118257e006d472277e10/visual.json +359 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/2caf02e0137c4a1280cc/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/2caf02e0137c4a1280cc/visual.json +669 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/311e76fe3c9edad68204/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/311e76fe3c9edad68204/visual.json +109 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/31c21f8cbeb3b208940a/visual.json +209 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/3ab72c25062437149b03/visual.json +17 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5959867442abcb0ce2b3/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5959867442abcb0ce2b3/visual.json +788 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5b96e0f88d192b044a13/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5b96e0f88d192b044a13/visual.json +592 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/64e749a63d0786000e22/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/64e749a63d0786000e22/visual.json +468 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/7ae1ca604edac6586ad0/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/7ae1ca604edac6586ad0/visual.json +1310 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/840300733885141a6603/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/840300733885141a6603/visual.json +175 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/a38448cdb203279273d2/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/a38448cdb203279273d2/visual.json +516 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d1e86f213a3841d12e20/visual.json +328 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d4a484c1bcc8ee3075e2/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d4a484c1bcc8ee3075e2/visual.json +432 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d87cb5cf06acca19bbb5/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d87cb5cf06acca19bbb5/visual.json +241 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/e243da2677209ed69408/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/e243da2677209ed69408/visual.json +174 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/f3aaf24f5b22b67573b0/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/f3aaf24f5b22b67573b0/visual.json +333 -0
- package/templates/base-template/base-template.Report/definition/pages/pages.json +8 -0
- package/templates/base-template/base-template.Report/definition/report.json +89 -0
- package/templates/base-template/base-template.Report/definition/version.json +4 -0
- package/templates/base-template/base-template.Report/definition.pbir +9 -0
- package/templates/base-template/base-template.SemanticModel/.platform +11 -0
- package/templates/base-template/base-template.SemanticModel/definition/cultures/es-AR.tmdl +11185 -0
- package/templates/base-template/base-template.SemanticModel/definition/database.tmdl +3 -0
- package/templates/base-template/base-template.SemanticModel/definition/expressions.tmdl +234 -0
- package/templates/base-template/base-template.SemanticModel/definition/functions.tmdl +637 -0
- package/templates/base-template/base-template.SemanticModel/definition/model.tmdl +82 -0
- package/templates/base-template/base-template.SemanticModel/definition/relationships.tmdl +271 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Calendario.tmdl +200 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Campa/303/261as.tmdl +75 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Canales.tmdl +84 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Clientes.tmdl +143 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Devoluciones.tmdl +95 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Ejecuci/303/263n proyectos.tmdl" +130 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Entregas.tmdl +122 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Equipos m/303/251tricas.tmdl" +40 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Equipos.tmdl +73 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Horas.tmdl +122 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Interacciones clientes.tmdl +146 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Leads.tmdl +119 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Monedas.tmdl +44 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Movimientos financieros.tmdl +145 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/M/303/251tricas.tmdl +1294 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/N/303/263mina.tmdl +110 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Oportunidades.tmdl +135 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Presupuesto.tmdl +125 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Productos.tmdl +98 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Proyectos.tmdl +77 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Servicios.tmdl +75 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Tareas proyecto.tmdl +102 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Tipo de cambio.tmdl +67 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Ventas.tmdl +180 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux An/303/241lisis dimensiones.tmdl" +38 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Comparaciones.tmdl +227 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Compatibilidad m/303/251trica-dimensi/303/263n.tmdl" +68 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Modelo configuraci/303/263n.tmdl" +44 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Modo fechas.tmdl +36 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux M/303/251trica-Equipo.tmdl" +102 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Overrides m/303/251trica-dimensi/303/263n.tmdl" +54 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Per/303/255odos.tmdl" +182 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Rango fechas modo.tmdl +36 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Rango fechas.tmdl +27 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Vista de calendario.tmdl +30 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_GC C/303/241lculo.tmdl" +70 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_GC Eje X.tmdl +63 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_GC M/303/251trica.tmdl" +374 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_GC Tipo c/303/241lculo.tmdl" +223 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_PC Dimensi/303/263n.tmdl" +98 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_PC Eje X.tmdl +68 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables//303/223rdenes servicio.tmdl" +151 -0
- package/templates/base-template/base-template.SemanticModel/definition.pbism +5 -0
- package/templates/base-template/base-template.SemanticModel/diagramLayout.json +568 -0
- package/templates/base-template/base-template.pbip +14 -0
- package/templates/base-template/template.manifest.json +41 -0
- package/theme/BISuperpowers.json +3888 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-update command (opt-in gstack-style self-update)
|
|
3
|
+
* =====================================================
|
|
4
|
+
*
|
|
5
|
+
* `super autoupdate on|off|status` toggles a Claude Code `SessionStart`
|
|
6
|
+
* hook that silently keeps the plugin current — so the user never installs
|
|
7
|
+
* by hand. OFF by default; the user explicitly opts in.
|
|
8
|
+
*
|
|
9
|
+
* - on Register the SessionStart hook in ~/.claude/settings.json
|
|
10
|
+
* - off Remove it
|
|
11
|
+
* - status Report whether it's enabled
|
|
12
|
+
*
|
|
13
|
+
* The hook runs bin/commands/session-update.js, which throttles to once per
|
|
14
|
+
* hour and, when due, upgrades via npm (`npm install -g <pkg>@latest`) then
|
|
15
|
+
* refreshes the agent skills/MCPs (`super install --all --yes`) in a
|
|
16
|
+
* detached background process. Because it's npm-based, it works even when
|
|
17
|
+
* the GitHub repo is private.
|
|
18
|
+
*
|
|
19
|
+
* Scope note: SessionStart hooks are a Claude Code feature. Other agents
|
|
20
|
+
* (Codex, Copilot, Gemini, Kilo) don't have an equivalent simple hook, so
|
|
21
|
+
* for them the existing notify-on-invocation flow + `super upgrade` remains
|
|
22
|
+
* the path. This also only helps npm-installed setups, not Claude Code
|
|
23
|
+
* marketplace installs (those update via `/plugin update`).
|
|
24
|
+
*
|
|
25
|
+
* @module commands/autoupdate
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
const path = require('path');
|
|
29
|
+
const {
|
|
30
|
+
registerSessionStartHook,
|
|
31
|
+
unregisterSessionStartHook,
|
|
32
|
+
isSessionStartHookRegistered,
|
|
33
|
+
claudeSettingsPath,
|
|
34
|
+
} = require('../lib/claude-hooks');
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Build the shell command the SessionStart hook runs.
|
|
38
|
+
* @param {string} packageDir - Absolute path to the installed package
|
|
39
|
+
*/
|
|
40
|
+
function hookCommand(packageDir) {
|
|
41
|
+
const script = path.join(packageDir, 'bin', 'commands', 'session-update.js');
|
|
42
|
+
return `node "${script}"`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Enable auto-update: register the SessionStart hook. Shared with
|
|
47
|
+
* `super install --auto-update`.
|
|
48
|
+
* @returns {{ file: string, action: string }}
|
|
49
|
+
*/
|
|
50
|
+
function enableAutoupdate(packageDir, opts = {}) {
|
|
51
|
+
return registerSessionStartHook(hookCommand(packageDir), opts);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Disable auto-update: remove the SessionStart hook.
|
|
56
|
+
* @returns {{ file: string, removed: boolean }}
|
|
57
|
+
*/
|
|
58
|
+
function disableAutoupdate(opts = {}) {
|
|
59
|
+
return unregisterSessionStartHook(opts);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* `super autoupdate <on|off|status>`
|
|
64
|
+
* @param {string[]} args
|
|
65
|
+
* @param {object} config - { packageDir, version }
|
|
66
|
+
*/
|
|
67
|
+
function autoupdateCommand(args, config) {
|
|
68
|
+
const chalk = require('chalk');
|
|
69
|
+
const sub = (args[0] || 'status').toLowerCase();
|
|
70
|
+
const packageDir = config.packageDir || path.dirname(path.dirname(__dirname));
|
|
71
|
+
|
|
72
|
+
if (sub === 'on' || sub === 'enable') {
|
|
73
|
+
try {
|
|
74
|
+
const { file } = enableAutoupdate(packageDir);
|
|
75
|
+
console.log(chalk.green(' ✓ Auto-update enabled (Claude Code SessionStart hook).'));
|
|
76
|
+
console.log(chalk.gray(` ${file.replace(require('os').homedir(), '~')}`));
|
|
77
|
+
console.log(
|
|
78
|
+
chalk.gray(
|
|
79
|
+
' Each new Claude Code session checks at most once/hour and, if a new\n' +
|
|
80
|
+
' version exists, upgrades via npm + refreshes your agents in the\n' +
|
|
81
|
+
' background. npm-based, so it works with a private GitHub repo.'
|
|
82
|
+
)
|
|
83
|
+
);
|
|
84
|
+
console.log(chalk.gray(' Other agents still use notify-on-invocation + `super upgrade`.'));
|
|
85
|
+
} catch (err) {
|
|
86
|
+
console.error(chalk.red(` ✗ Could not enable auto-update: ${err.message}`));
|
|
87
|
+
process.exitCode = 1;
|
|
88
|
+
}
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (sub === 'off' || sub === 'disable') {
|
|
93
|
+
try {
|
|
94
|
+
const { removed } = disableAutoupdate();
|
|
95
|
+
console.log(
|
|
96
|
+
removed
|
|
97
|
+
? chalk.green(' ✓ Auto-update disabled (SessionStart hook removed).')
|
|
98
|
+
: chalk.gray(' – Auto-update was not enabled. Nothing to remove.')
|
|
99
|
+
);
|
|
100
|
+
} catch (err) {
|
|
101
|
+
console.error(chalk.red(` ✗ Could not disable auto-update: ${err.message}`));
|
|
102
|
+
process.exitCode = 1;
|
|
103
|
+
}
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (sub === 'status') {
|
|
108
|
+
const enabled = isSessionStartHookRegistered();
|
|
109
|
+
console.log(
|
|
110
|
+
enabled
|
|
111
|
+
? chalk.green(' Auto-update: ON (Claude Code SessionStart hook registered).')
|
|
112
|
+
: chalk.gray(' Auto-update: OFF. Enable with `super autoupdate on`.')
|
|
113
|
+
);
|
|
114
|
+
console.log(
|
|
115
|
+
chalk.gray(` Settings file: ${claudeSettingsPath().replace(require('os').homedir(), '~')}`)
|
|
116
|
+
);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
console.log(chalk.yellow(` Unknown subcommand: ${sub}`));
|
|
121
|
+
console.log(chalk.gray(' Usage: super autoupdate <on|off|status>'));
|
|
122
|
+
process.exitCode = 1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
module.exports = autoupdateCommand;
|
|
126
|
+
module.exports.enableAutoupdate = enableAutoupdate;
|
|
127
|
+
module.exports.disableAutoupdate = disableAutoupdate;
|
|
128
|
+
module.exports.hookCommand = hookCommand;
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build Desktop Extension Command
|
|
3
|
+
* ================================
|
|
4
|
+
*
|
|
5
|
+
* Builds a .mcpb extension for Claude Desktop by:
|
|
6
|
+
* 1. Copying desktop-extension/ template to a temp directory
|
|
7
|
+
* 2. Copying every skill source (flat + folder-based) into temp/skills/
|
|
8
|
+
* 3. Installing dependencies
|
|
9
|
+
* 4. Running `npx @anthropic-ai/mcpb pack` to create the .mcpb file
|
|
10
|
+
* 5. Moving the result to the current directory
|
|
11
|
+
*
|
|
12
|
+
* Usage: super build-desktop [--output <path>]
|
|
13
|
+
*
|
|
14
|
+
* @module commands/build-desktop
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const fs = require('fs');
|
|
18
|
+
const path = require('path');
|
|
19
|
+
const os = require('os');
|
|
20
|
+
const { spawnSync } = require('child_process');
|
|
21
|
+
const { loadSkills } = require('../lib/skills');
|
|
22
|
+
|
|
23
|
+
/** Directory where the npm package is installed */
|
|
24
|
+
const PACKAGE_DIR = path.dirname(path.dirname(__dirname));
|
|
25
|
+
|
|
26
|
+
/** Desktop extension template source */
|
|
27
|
+
const DESKTOP_TEMPLATE_DIR = path.join(PACKAGE_DIR, 'desktop-extension');
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Bundle skills into the Desktop extension's skills/ directory.
|
|
31
|
+
*
|
|
32
|
+
* Handles both flat `src/content/skills/<name>.md` and folder-based
|
|
33
|
+
* `src/content/skills/<name>/SKILL.md` layouts by writing each skill as
|
|
34
|
+
* `<name>/SKILL.md`. Folder-based skills also get their runtime
|
|
35
|
+
* `references/` and `scripts/` subtrees copied into the MCPB, so prompts
|
|
36
|
+
* never point Claude Desktop at files missing from the installed extension.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} skillsOutDir - Destination directory (created if missing)
|
|
39
|
+
* @param {string} packageDir - npm package root containing src/content/skills/
|
|
40
|
+
* @returns {string[]} Names of skills bundled into skillsOutDir
|
|
41
|
+
*/
|
|
42
|
+
function bundleSkills(skillsOutDir, packageDir) {
|
|
43
|
+
fs.mkdirSync(skillsOutDir, { recursive: true });
|
|
44
|
+
const skills = loadSkills({ packageDir });
|
|
45
|
+
for (const skill of skills) {
|
|
46
|
+
const skillOutDir = path.join(skillsOutDir, skill.name);
|
|
47
|
+
fs.mkdirSync(skillOutDir, { recursive: true });
|
|
48
|
+
fs.writeFileSync(path.join(skillOutDir, 'SKILL.md'), skill.content);
|
|
49
|
+
|
|
50
|
+
if (skill.bundleDir) {
|
|
51
|
+
copyRuntimeTree(
|
|
52
|
+
path.join(skill.bundleDir, 'references'),
|
|
53
|
+
path.join(skillOutDir, 'references')
|
|
54
|
+
);
|
|
55
|
+
copyRuntimeTree(path.join(skill.bundleDir, 'scripts'), path.join(skillOutDir, 'scripts'));
|
|
56
|
+
copyRuntimeTree(path.join(skill.bundleDir, 'examples'), path.join(skillOutDir, 'examples'));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return skills.map((s) => s.name);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Copy runtime skill assets, excluding test/build/editor artifacts.
|
|
64
|
+
*
|
|
65
|
+
* @param {string} source - Source file or directory
|
|
66
|
+
* @param {string} target - Destination file or directory
|
|
67
|
+
*/
|
|
68
|
+
function copyRuntimeTree(source, target) {
|
|
69
|
+
if (!fs.existsSync(source)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const stat = fs.statSync(source);
|
|
74
|
+
if (stat.isDirectory()) {
|
|
75
|
+
fs.mkdirSync(target, { recursive: true });
|
|
76
|
+
for (const entry of fs.readdirSync(source, { withFileTypes: true })) {
|
|
77
|
+
copyRuntimeTree(path.join(source, entry.name), path.join(target, entry.name));
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (!stat.isFile() || shouldSkipRuntimeFile(source)) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
87
|
+
fs.copyFileSync(source, target);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @param {string} filePath - Runtime asset path
|
|
92
|
+
* @returns {boolean} True if this file should not ship in the MCPB
|
|
93
|
+
*/
|
|
94
|
+
function shouldSkipRuntimeFile(filePath) {
|
|
95
|
+
const base = path.basename(filePath);
|
|
96
|
+
return (
|
|
97
|
+
base.endsWith('.test.js') ||
|
|
98
|
+
base.endsWith('.spec.js') ||
|
|
99
|
+
base.endsWith('.expected.json') ||
|
|
100
|
+
base.endsWith('.bak') ||
|
|
101
|
+
base.endsWith('.tmp')
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Run an external command without shell string execution.
|
|
107
|
+
*
|
|
108
|
+
* @param {string} command - Executable name/path
|
|
109
|
+
* @param {string[]} args - Command arguments
|
|
110
|
+
* @param {{cwd?: string}} options - spawnSync options
|
|
111
|
+
*/
|
|
112
|
+
function createRunExternalOptions(options = {}) {
|
|
113
|
+
return {
|
|
114
|
+
encoding: 'utf8',
|
|
115
|
+
stdio: 'pipe',
|
|
116
|
+
// npm can emit funding/audit/deprecation notices to stdout even with
|
|
117
|
+
// --silent; the 1 MiB spawnSync default would set ENOBUFS and hard-fail
|
|
118
|
+
// the install step (which, unlike pack, has no adm-zip fallback).
|
|
119
|
+
maxBuffer: 1024 * 1024 * 64,
|
|
120
|
+
...options,
|
|
121
|
+
shell: false,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function runExternal(command, args, options = {}) {
|
|
126
|
+
const result = spawnSync(command, args, createRunExternalOptions(options));
|
|
127
|
+
|
|
128
|
+
if (result.error) {
|
|
129
|
+
throw result.error;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (result.status !== 0) {
|
|
133
|
+
const stdout = typeof result.stdout === 'string' ? result.stdout.trim() : '';
|
|
134
|
+
const stderr = typeof result.stderr === 'string' ? result.stderr.trim() : '';
|
|
135
|
+
const details = [
|
|
136
|
+
`${command} ${args.join(' ')} failed with exit code ${result.status}`,
|
|
137
|
+
stdout ? `stdout:\n${stdout}` : null,
|
|
138
|
+
stderr ? `stderr:\n${stderr}` : null,
|
|
139
|
+
].filter(Boolean);
|
|
140
|
+
throw new Error(details.join('\n'));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Resolve npm/npx in a way that avoids Windows .cmd execution with shell=false.
|
|
146
|
+
*
|
|
147
|
+
* @param {'npm'|'npx'} command - Package manager command
|
|
148
|
+
* @param {{platform?: string, execPath?: string, env?: NodeJS.ProcessEnv}} runtime - Runtime hints
|
|
149
|
+
* @returns {{command: string, argsPrefix: string[]}} Command and args prefix
|
|
150
|
+
*/
|
|
151
|
+
function resolvePackageManagerCommand(command, runtime = {}) {
|
|
152
|
+
const platform = runtime.platform || process.platform;
|
|
153
|
+
const execPath = runtime.execPath || process.execPath;
|
|
154
|
+
const env = runtime.env || process.env;
|
|
155
|
+
|
|
156
|
+
if (platform !== 'win32') {
|
|
157
|
+
return { command, argsPrefix: [] };
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const cliPath = findPackageManagerCli(command, execPath, env);
|
|
161
|
+
if (cliPath) {
|
|
162
|
+
return { command: execPath, argsPrefix: [cliPath] };
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
throw new Error(`Unable to resolve ${command} JS CLI for shell-free Windows execution`);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function findPackageManagerCli(command, execPath, env) {
|
|
169
|
+
const cliFile = `${command}-cli.js`;
|
|
170
|
+
const candidates = [];
|
|
171
|
+
|
|
172
|
+
if (env.npm_execpath) {
|
|
173
|
+
candidates.push(path.join(path.dirname(env.npm_execpath), cliFile));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
candidates.push(path.join(path.dirname(execPath), 'node_modules', 'npm', 'bin', cliFile));
|
|
177
|
+
|
|
178
|
+
try {
|
|
179
|
+
candidates.push(require.resolve(`npm/bin/${cliFile}`));
|
|
180
|
+
} catch (_) {
|
|
181
|
+
// npm is not always resolvable as a module from packaged installs.
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return candidates.find((candidate) => fs.existsSync(candidate));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Parse build-desktop CLI arguments.
|
|
189
|
+
*
|
|
190
|
+
* @param {string[]} args - CLI arguments after `build-desktop`
|
|
191
|
+
* @returns {{outputDir: string}} Build options
|
|
192
|
+
*/
|
|
193
|
+
function parseArgs(args) {
|
|
194
|
+
const options = {
|
|
195
|
+
outputDir: process.cwd(),
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
for (let index = 0; index < args.length; index++) {
|
|
199
|
+
const arg = args[index];
|
|
200
|
+
|
|
201
|
+
if (arg === '--output' || arg === '-o') {
|
|
202
|
+
const value = args[++index];
|
|
203
|
+
if (!value || value.startsWith('-')) {
|
|
204
|
+
throw new Error(`${arg} requires a path`);
|
|
205
|
+
}
|
|
206
|
+
options.outputDir = path.resolve(value);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return options;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Build the .mcpb extension for Claude Desktop.
|
|
215
|
+
*
|
|
216
|
+
* @param {string[]} args - CLI arguments
|
|
217
|
+
* @param {Object} config - Command config from CLI
|
|
218
|
+
*/
|
|
219
|
+
function buildDesktop(args, _config) {
|
|
220
|
+
let options;
|
|
221
|
+
try {
|
|
222
|
+
options = parseArgs(args || []);
|
|
223
|
+
} catch (err) {
|
|
224
|
+
console.error(`Error: ${err.message}`);
|
|
225
|
+
process.exit(1);
|
|
226
|
+
}
|
|
227
|
+
const outputDir = options.outputDir;
|
|
228
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
229
|
+
|
|
230
|
+
console.log(`
|
|
231
|
+
BI Agent Superpowers — Build Desktop Extension
|
|
232
|
+
================================================
|
|
233
|
+
`);
|
|
234
|
+
|
|
235
|
+
// Verify template exists
|
|
236
|
+
if (!fs.existsSync(DESKTOP_TEMPLATE_DIR)) {
|
|
237
|
+
console.error('Error: desktop-extension/ template not found in package.');
|
|
238
|
+
console.error('Try reinstalling: npm install -g bi-superpowers');
|
|
239
|
+
process.exit(1);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Verify skills exist
|
|
243
|
+
const skillsSourceDir = path.join(PACKAGE_DIR, 'src', 'content', 'skills');
|
|
244
|
+
if (!fs.existsSync(skillsSourceDir)) {
|
|
245
|
+
console.error(
|
|
246
|
+
'Error: skill sources not found. Try reinstalling: npm install -g bi-superpowers'
|
|
247
|
+
);
|
|
248
|
+
process.exit(1);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Create temp build directory
|
|
252
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'bi-superpowers-mcpb-'));
|
|
253
|
+
|
|
254
|
+
try {
|
|
255
|
+
console.log(' Preparing build directory...');
|
|
256
|
+
|
|
257
|
+
// Copy template files (manifest.json, server.js, package.json)
|
|
258
|
+
for (const file of ['manifest.json', 'server.js', 'package.json']) {
|
|
259
|
+
const src = path.join(DESKTOP_TEMPLATE_DIR, file);
|
|
260
|
+
if (fs.existsSync(src)) {
|
|
261
|
+
fs.copyFileSync(src, path.join(tmpDir, file));
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Bundle every skill (flat + folder-based) into temp/skills/
|
|
266
|
+
const bundledNames = bundleSkills(path.join(tmpDir, 'skills'), PACKAGE_DIR);
|
|
267
|
+
const skillFiles = bundledNames.map((n) => `${n}/SKILL.md`);
|
|
268
|
+
console.log(` Bundled ${bundledNames.length} skills`);
|
|
269
|
+
|
|
270
|
+
// Patch template placeholder versions with the real package version
|
|
271
|
+
const pkgVersion = require(path.join(PACKAGE_DIR, 'package.json')).version;
|
|
272
|
+
for (const file of ['manifest.json', 'package.json']) {
|
|
273
|
+
const filePath = path.join(tmpDir, file);
|
|
274
|
+
if (fs.existsSync(filePath)) {
|
|
275
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
276
|
+
fs.writeFileSync(
|
|
277
|
+
filePath,
|
|
278
|
+
content.replace(/"version":\s*"[^"]*"/, `"version": "${pkgVersion}"`),
|
|
279
|
+
'utf8'
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
const serverPath = path.join(tmpDir, 'server.js');
|
|
284
|
+
if (fs.existsSync(serverPath)) {
|
|
285
|
+
const content = fs.readFileSync(serverPath, 'utf8');
|
|
286
|
+
fs.writeFileSync(
|
|
287
|
+
serverPath,
|
|
288
|
+
content.replace(/version:\s*'[^']*'/, `version: '${pkgVersion}'`),
|
|
289
|
+
'utf8'
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Install dependencies in temp dir
|
|
294
|
+
console.log(' Installing dependencies...');
|
|
295
|
+
const npmCommand = resolvePackageManagerCommand('npm');
|
|
296
|
+
runExternal(
|
|
297
|
+
npmCommand.command,
|
|
298
|
+
[...npmCommand.argsPrefix, 'install', '--omit=dev', '--silent'],
|
|
299
|
+
{
|
|
300
|
+
cwd: tmpDir,
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
|
|
304
|
+
// Pack into .mcpb using the official CLI
|
|
305
|
+
console.log(' Packing .mcpb extension...');
|
|
306
|
+
try {
|
|
307
|
+
const npxCommand = resolvePackageManagerCommand('npx');
|
|
308
|
+
runExternal(
|
|
309
|
+
npxCommand.command,
|
|
310
|
+
[...npxCommand.argsPrefix, '--yes', '@anthropic-ai/mcpb', 'pack', tmpDir],
|
|
311
|
+
{
|
|
312
|
+
cwd: outputDir,
|
|
313
|
+
}
|
|
314
|
+
);
|
|
315
|
+
} catch (packErr) {
|
|
316
|
+
// If mcpb CLI is not available, create zip with adm-zip (cross-platform)
|
|
317
|
+
console.log(' Note: @anthropic-ai/mcpb not available, creating zip archive...');
|
|
318
|
+
const AdmZip = require('adm-zip');
|
|
319
|
+
const zip = new AdmZip();
|
|
320
|
+
zip.addLocalFolder(tmpDir);
|
|
321
|
+
const mcpbFile = path.join(outputDir, 'bi-superpowers.mcpb');
|
|
322
|
+
zip.writeZip(mcpbFile);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Check for output file (mcpb CLI may name it with version suffix)
|
|
326
|
+
const possibleOutputs = [
|
|
327
|
+
path.join(outputDir, 'bi-superpowers.mcpb'),
|
|
328
|
+
path.join(outputDir, `bi-superpowers-${pkgVersion}.mcpb`),
|
|
329
|
+
];
|
|
330
|
+
const outputFile = possibleOutputs.find((f) => fs.existsSync(f));
|
|
331
|
+
|
|
332
|
+
if (outputFile) {
|
|
333
|
+
const size = (fs.statSync(outputFile).size / 1024).toFixed(1);
|
|
334
|
+
console.log(`
|
|
335
|
+
Done! Extension built successfully.
|
|
336
|
+
|
|
337
|
+
Output: ${outputFile} (${size} KB)
|
|
338
|
+
|
|
339
|
+
To install in Claude Desktop:
|
|
340
|
+
1. Double-click the .mcpb file, or
|
|
341
|
+
2. Go to Settings > Extensions > Install Extension
|
|
342
|
+
|
|
343
|
+
The extension adds ${skillFiles.length} BI skills as MCP prompts.
|
|
344
|
+
Use the "setup-mcp" prompt for Power BI Modeling MCP configuration.
|
|
345
|
+
`);
|
|
346
|
+
} else {
|
|
347
|
+
console.log('\n Build complete. Check current directory for .mcpb file.');
|
|
348
|
+
}
|
|
349
|
+
} catch (err) {
|
|
350
|
+
console.error(`\nBuild failed: ${err.message}`);
|
|
351
|
+
process.exit(1);
|
|
352
|
+
} finally {
|
|
353
|
+
// Clean up temp directory
|
|
354
|
+
try {
|
|
355
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
356
|
+
} catch (_) {
|
|
357
|
+
// Ignore cleanup errors
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
module.exports = buildDesktop;
|
|
363
|
+
module.exports.bundleSkills = bundleSkills;
|
|
364
|
+
module.exports.copyRuntimeTree = copyRuntimeTree;
|
|
365
|
+
module.exports.shouldSkipRuntimeFile = shouldSkipRuntimeFile;
|
|
366
|
+
module.exports.parseArgs = parseArgs;
|
|
367
|
+
module.exports.resolvePackageManagerCommand = resolvePackageManagerCommand;
|
|
368
|
+
module.exports.createRunExternalOptions = createRunExternalOptions;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create From Template Command
|
|
3
|
+
* ============================
|
|
4
|
+
*
|
|
5
|
+
* Scaffolds a new Power BI project from a packaged template under
|
|
6
|
+
* `templates/<name>/` into `<targetDir>/pbip-files/<projectName>.*`,
|
|
7
|
+
* renaming the PBIP descriptor + the two artifact folders and rewriting
|
|
8
|
+
* the internal cross-references (.pbip, definition.pbir, both .platform
|
|
9
|
+
* files with regenerated logicalIds).
|
|
10
|
+
*
|
|
11
|
+
* Used by the `bi-kickoff` skill PHASE 0 Option C ("Comenzar desde un
|
|
12
|
+
* template del plugin") so the agent does not have to copy files by
|
|
13
|
+
* hand. Available standalone for power users who want to scaffold from
|
|
14
|
+
* the CLI without going through the skill.
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* super create-from-template --template base-template --name <projectName>
|
|
18
|
+
* super create-from-template --template base-template --name <projectName> --target /path/to/project
|
|
19
|
+
* super create-from-template --list
|
|
20
|
+
* super create-from-template --template base-template --name <projectName> --dry-run
|
|
21
|
+
* super create-from-template --template base-template --name <projectName> --force
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const path = require('path');
|
|
25
|
+
const { listTemplates, scaffoldFromTemplate } = require('../lib/template-scaffold');
|
|
26
|
+
|
|
27
|
+
function parseArgs(args) {
|
|
28
|
+
const options = {
|
|
29
|
+
templateName: null,
|
|
30
|
+
targetDir: process.cwd(),
|
|
31
|
+
projectName: null,
|
|
32
|
+
force: false,
|
|
33
|
+
dryRun: false,
|
|
34
|
+
list: false,
|
|
35
|
+
json: false,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
for (let index = 0; index < args.length; index++) {
|
|
39
|
+
const arg = args[index];
|
|
40
|
+
if (arg === '--template' || arg === '-t') {
|
|
41
|
+
options.templateName = readValue(args, ++index, arg);
|
|
42
|
+
} else if (arg === '--target') {
|
|
43
|
+
options.targetDir = readValue(args, ++index, arg);
|
|
44
|
+
} else if (arg === '--name' || arg === '-n') {
|
|
45
|
+
options.projectName = readValue(args, ++index, arg);
|
|
46
|
+
} else if (arg === '--force' || arg === '-f') {
|
|
47
|
+
options.force = true;
|
|
48
|
+
} else if (arg === '--dry-run') {
|
|
49
|
+
options.dryRun = true;
|
|
50
|
+
} else if (arg === '--list' || arg === '-l') {
|
|
51
|
+
options.list = true;
|
|
52
|
+
} else if (arg === '--json') {
|
|
53
|
+
options.json = true;
|
|
54
|
+
} else {
|
|
55
|
+
throw new Error(`Unknown argument: ${arg}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
options.targetDir = path.resolve(options.targetDir);
|
|
59
|
+
return options;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function readValue(args, index, flag) {
|
|
63
|
+
const value = args[index];
|
|
64
|
+
if (!value || value.startsWith('-')) {
|
|
65
|
+
throw new Error(`${flag} requires a value`);
|
|
66
|
+
}
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function printList(packageDir, json) {
|
|
71
|
+
const templates = listTemplates(packageDir);
|
|
72
|
+
if (json) {
|
|
73
|
+
console.log(JSON.stringify({ templates: templates.map((t) => ({ name: t.name })) }, null, 2));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
console.log('BI Agent Superpowers — Available Templates');
|
|
77
|
+
console.log('==========================================\n');
|
|
78
|
+
if (templates.length === 0) {
|
|
79
|
+
console.log('No templates found in templates/.');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
for (const template of templates) {
|
|
83
|
+
console.log(`- ${template.name} (${template.pbipFile})`);
|
|
84
|
+
}
|
|
85
|
+
console.log(
|
|
86
|
+
'\nUse: super create-from-template --template <name> --name <projectName> [--target <dir>]'
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function printResult(result, json) {
|
|
91
|
+
if (json) {
|
|
92
|
+
console.log(JSON.stringify(result, null, 2));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (result.dryRun) {
|
|
97
|
+
console.log('BI Agent Superpowers — create-from-template (dry-run)');
|
|
98
|
+
console.log('====================================================\n');
|
|
99
|
+
console.log(`Template: ${result.template}`);
|
|
100
|
+
console.log(`Project name: ${result.projectName}`);
|
|
101
|
+
console.log(`Output dir: ${result.pbipDir}\n`);
|
|
102
|
+
console.log(`Would write ${result.planned.length} entries:`);
|
|
103
|
+
for (const entry of result.planned) {
|
|
104
|
+
console.log(` ${entry.kind === 'directory' ? 'DIR ' : 'FILE'} ${entry.to}`);
|
|
105
|
+
}
|
|
106
|
+
console.log('\nRun without --dry-run to apply changes.');
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
console.log('BI Agent Superpowers — create-from-template');
|
|
111
|
+
console.log('===========================================\n');
|
|
112
|
+
console.log(`Template: ${result.template}`);
|
|
113
|
+
console.log(`Project name: ${result.projectName}`);
|
|
114
|
+
console.log(`Output dir: ${result.pbipDir}`);
|
|
115
|
+
console.log(`Wrote ${result.written.length} entries.`);
|
|
116
|
+
console.log(`Updated ${result.updatedJson.length} cross-reference files.\n`);
|
|
117
|
+
console.log('Next step:');
|
|
118
|
+
console.log(
|
|
119
|
+
` 1. Open ${path.join(result.pbipDir, result.projectName + '.pbip')} in Power BI Desktop`
|
|
120
|
+
);
|
|
121
|
+
console.log(' 2. Verify the model loads and the report opens');
|
|
122
|
+
console.log(' 3. Continue the bi-kickoff skill, or run a commit when ready');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
async function createFromTemplateCommand(args, config = {}) {
|
|
126
|
+
let options;
|
|
127
|
+
try {
|
|
128
|
+
options = parseArgs(args || []);
|
|
129
|
+
const packageDir = config.packageDir || path.resolve(__dirname, '..', '..');
|
|
130
|
+
|
|
131
|
+
if (options.list) {
|
|
132
|
+
printList(packageDir, options.json);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (!options.templateName) {
|
|
137
|
+
throw new Error('--template is required. Run with --list to see available templates.');
|
|
138
|
+
}
|
|
139
|
+
if (!options.projectName) {
|
|
140
|
+
throw new Error('--name is required (the new project name).');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const result = scaffoldFromTemplate({
|
|
144
|
+
packageDir,
|
|
145
|
+
templateName: options.templateName,
|
|
146
|
+
targetDir: options.targetDir,
|
|
147
|
+
projectName: options.projectName,
|
|
148
|
+
force: options.force,
|
|
149
|
+
dryRun: options.dryRun,
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
printResult(result, options.json);
|
|
153
|
+
} catch (err) {
|
|
154
|
+
if (options && options.json) {
|
|
155
|
+
console.log(JSON.stringify({ error: err.message }, null, 2));
|
|
156
|
+
} else {
|
|
157
|
+
console.error(`Error: ${err.message}`);
|
|
158
|
+
}
|
|
159
|
+
process.exitCode = 1;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
module.exports = Object.assign(createFromTemplateCommand, {
|
|
164
|
+
parseArgs,
|
|
165
|
+
});
|