@compilr-dev/cli 0.4.0 → 0.5.1
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 +254 -68
- package/dist/.tsbuildinfo.app +1 -0
- package/dist/.tsbuildinfo.data +1 -0
- package/dist/.tsbuildinfo.domain +1 -0
- package/dist/.tsbuildinfo.foundation +1 -0
- package/dist/agent.d.ts +134 -4
- package/dist/agent.js +345 -166
- package/dist/anchors/index.d.ts +9 -0
- package/dist/anchors/index.js +9 -0
- package/dist/anchors/project-anchors.d.ts +79 -0
- package/dist/anchors/project-anchors.js +202 -0
- package/dist/auth/api-client.d.ts +124 -0
- package/dist/auth/api-client.js +261 -0
- package/dist/auth/index.d.ts +172 -0
- package/dist/auth/index.js +545 -0
- package/dist/auth/storage.d.ts +52 -0
- package/dist/auth/storage.js +118 -0
- package/dist/changelog/index.d.ts +16 -0
- package/dist/changelog/index.js +24 -0
- package/dist/changelog/releases.d.ts +17 -0
- package/dist/changelog/releases.js +63 -0
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands-v2/handlers/auth.d.ts +10 -0
- package/dist/commands-v2/handlers/auth.js +118 -0
- package/dist/commands-v2/handlers/background.d.ts +14 -0
- package/dist/commands-v2/handlers/background.js +276 -0
- package/dist/commands-v2/handlers/context.d.ts +13 -0
- package/dist/commands-v2/handlers/context.js +533 -0
- package/dist/commands-v2/handlers/core.d.ts +14 -0
- package/dist/commands-v2/handlers/core.js +290 -0
- package/dist/commands-v2/handlers/debug.d.ts +11 -0
- package/dist/commands-v2/handlers/debug.js +177 -0
- package/dist/commands-v2/handlers/delegations.d.ts +8 -0
- package/dist/commands-v2/handlers/delegations.js +29 -0
- package/dist/commands-v2/handlers/files.d.ts +8 -0
- package/dist/commands-v2/handlers/files.js +162 -0
- package/dist/commands-v2/handlers/filter.d.ts +9 -0
- package/dist/commands-v2/handlers/filter.js +130 -0
- package/dist/commands-v2/handlers/games.d.ts +7 -0
- package/dist/commands-v2/handlers/games.js +57 -0
- package/dist/commands-v2/handlers/index.d.ts +25 -0
- package/dist/commands-v2/handlers/index.js +63 -0
- package/dist/commands-v2/handlers/mcp.d.ts +8 -0
- package/dist/commands-v2/handlers/mcp.js +39 -0
- package/dist/commands-v2/handlers/notifications.d.ts +9 -0
- package/dist/commands-v2/handlers/notifications.js +34 -0
- package/dist/commands-v2/handlers/project.d.ts +22 -0
- package/dist/commands-v2/handlers/project.js +1035 -0
- package/dist/commands-v2/handlers/reset.d.ts +11 -0
- package/dist/commands-v2/handlers/reset.js +118 -0
- package/dist/commands-v2/handlers/session.d.ts +161 -0
- package/dist/commands-v2/handlers/session.js +805 -0
- package/dist/commands-v2/handlers/settings.d.ts +17 -0
- package/dist/commands-v2/handlers/settings.js +417 -0
- package/dist/commands-v2/handlers/tasks.d.ts +5 -0
- package/dist/commands-v2/handlers/tasks.js +36 -0
- package/dist/commands-v2/handlers/team.d.ts +9 -0
- package/dist/commands-v2/handlers/team.js +549 -0
- package/dist/commands-v2/handlers/terminals.d.ts +9 -0
- package/dist/commands-v2/handlers/terminals.js +34 -0
- package/dist/commands-v2/index.d.ts +14 -0
- package/dist/commands-v2/index.js +18 -0
- package/dist/commands-v2/registry.d.ts +52 -0
- package/dist/commands-v2/registry.js +114 -0
- package/dist/commands-v2/types.d.ts +153 -0
- package/dist/commands-v2/types.js +7 -0
- package/dist/commands.js +123 -7
- package/dist/compilr-diff-companion.vsix +0 -0
- package/dist/db/index.js +98 -4
- package/dist/db/repositories/document-repository.d.ts +2 -0
- package/dist/db/repositories/document-repository.js +5 -1
- package/dist/db/repositories/index.d.ts +2 -0
- package/dist/db/repositories/index.js +1 -0
- package/dist/db/repositories/plan-repository.d.ts +101 -0
- package/dist/db/repositories/plan-repository.js +275 -0
- package/dist/db/repositories/project-repository.d.ts +6 -0
- package/dist/db/repositories/project-repository.js +41 -0
- package/dist/db/repositories/work-item-repository.d.ts +15 -0
- package/dist/db/repositories/work-item-repository.js +69 -4
- package/dist/db/schema.d.ts +40 -3
- package/dist/db/schema.js +66 -3
- package/dist/episodes/index.d.ts +20 -0
- package/dist/episodes/index.js +27 -0
- package/dist/episodes/recorder.d.ts +51 -0
- package/dist/episodes/recorder.js +195 -0
- package/dist/episodes/significant-work.d.ts +21 -0
- package/dist/episodes/significant-work.js +56 -0
- package/dist/episodes/store.d.ts +38 -0
- package/dist/episodes/store.js +199 -0
- package/dist/episodes/types.d.ts +35 -0
- package/dist/episodes/types.js +6 -0
- package/dist/episodes/work-at-risk.d.ts +12 -0
- package/dist/episodes/work-at-risk.js +38 -0
- package/dist/episodes/work-summary-anchor.d.ts +23 -0
- package/dist/episodes/work-summary-anchor.js +73 -0
- package/dist/games/coins.d.ts +66 -0
- package/dist/games/coins.js +165 -0
- package/dist/games/game-base.d.ts +84 -0
- package/dist/games/game-base.js +204 -0
- package/dist/games/index.d.ts +16 -0
- package/dist/games/index.js +49 -0
- package/dist/games/scores.d.ts +69 -0
- package/dist/games/scores.js +191 -0
- package/dist/games/tetris/board.d.ts +59 -0
- package/dist/games/tetris/board.js +170 -0
- package/dist/games/tetris/index.d.ts +109 -0
- package/dist/games/tetris/index.js +610 -0
- package/dist/games/tetris/pieces.d.ts +44 -0
- package/dist/games/tetris/pieces.js +271 -0
- package/dist/games/tetris/renderer.d.ts +26 -0
- package/dist/games/tetris/renderer.js +77 -0
- package/dist/guide/guide-content.d.ts +23 -0
- package/dist/guide/guide-content.js +196 -0
- package/dist/guide/index.d.ts +8 -0
- package/dist/guide/index.js +7 -0
- package/dist/guide/shared-content.d.ts +37 -0
- package/dist/guide/shared-content.js +1272 -0
- package/dist/guide/tutorial-helpers.d.ts +57 -0
- package/dist/guide/tutorial-helpers.js +147 -0
- package/dist/handlers/ask-user-handlers.d.ts +32 -0
- package/dist/handlers/ask-user-handlers.js +104 -0
- package/dist/handlers/delegation-handlers.d.ts +34 -0
- package/dist/handlers/delegation-handlers.js +291 -0
- package/dist/handlers/permission-handler.d.ts +30 -0
- package/dist/handlers/permission-handler.js +205 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.js +615 -179
- package/dist/input-handlers/index.d.ts +7 -0
- package/dist/input-handlers/index.js +7 -0
- package/dist/input-handlers/memory-handler.d.ts +26 -0
- package/dist/input-handlers/memory-handler.js +69 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.js +12 -0
- package/dist/models/model-registry.d.ts +38 -0
- package/dist/models/model-registry.js +69 -0
- package/dist/models/model-tiers.d.ts +28 -0
- package/dist/models/model-tiers.js +71 -0
- package/dist/models/model-validation.d.ts +25 -0
- package/dist/models/model-validation.js +291 -0
- package/dist/models/ollama-models.d.ts +73 -0
- package/dist/models/ollama-models.js +178 -0
- package/dist/models/provider-types.d.ts +6 -0
- package/dist/models/provider-types.js +1 -0
- package/dist/models/providers.d.ts +35 -0
- package/dist/models/providers.js +58 -0
- package/dist/models/types.d.ts +4 -0
- package/dist/models/types.js +4 -0
- package/dist/multi-agent/activity.d.ts +21 -0
- package/dist/multi-agent/activity.js +34 -0
- package/dist/multi-agent/agent-selection.d.ts +55 -0
- package/dist/multi-agent/agent-selection.js +90 -0
- package/dist/multi-agent/artifacts.d.ts +197 -0
- package/dist/multi-agent/artifacts.js +379 -0
- package/dist/multi-agent/checkpointer.d.ts +138 -0
- package/dist/multi-agent/checkpointer.js +471 -0
- package/dist/multi-agent/collision-utils.d.ts +16 -0
- package/dist/multi-agent/collision-utils.js +28 -0
- package/dist/multi-agent/context-resolver.d.ts +97 -0
- package/dist/multi-agent/context-resolver.js +316 -0
- package/dist/multi-agent/custom-agents.d.ts +83 -0
- package/dist/multi-agent/custom-agents.js +227 -0
- package/dist/multi-agent/delegation-tracker.d.ts +157 -0
- package/dist/multi-agent/delegation-tracker.js +243 -0
- package/dist/multi-agent/file-lock-hook.d.ts +29 -0
- package/dist/multi-agent/file-lock-hook.js +97 -0
- package/dist/multi-agent/file-locks.d.ts +58 -0
- package/dist/multi-agent/file-locks.js +194 -0
- package/dist/multi-agent/index.d.ts +24 -0
- package/dist/multi-agent/index.js +30 -0
- package/dist/multi-agent/mention-parser.d.ts +64 -0
- package/dist/multi-agent/mention-parser.js +146 -0
- package/dist/multi-agent/notification-manager.d.ts +84 -0
- package/dist/multi-agent/notification-manager.js +224 -0
- package/dist/multi-agent/pending-requests.d.ts +122 -0
- package/dist/multi-agent/pending-requests.js +155 -0
- package/dist/multi-agent/session-registry.d.ts +139 -0
- package/dist/multi-agent/session-registry.js +514 -0
- package/dist/multi-agent/shared-context.d.ts +293 -0
- package/dist/multi-agent/shared-context.js +671 -0
- package/dist/multi-agent/skill-requirements.d.ts +66 -0
- package/dist/multi-agent/skill-requirements.js +178 -0
- package/dist/multi-agent/task-assignment.d.ts +69 -0
- package/dist/multi-agent/task-assignment.js +123 -0
- package/dist/multi-agent/task-suggestion.d.ts +31 -0
- package/dist/multi-agent/task-suggestion.js +72 -0
- package/dist/multi-agent/team-agent.d.ts +201 -0
- package/dist/multi-agent/team-agent.js +488 -0
- package/dist/multi-agent/team.d.ts +286 -0
- package/dist/multi-agent/team.js +610 -0
- package/dist/multi-agent/tool-config.d.ts +110 -0
- package/dist/multi-agent/tool-config.js +661 -0
- package/dist/multi-agent/types.d.ts +211 -0
- package/dist/multi-agent/types.js +617 -0
- package/dist/prompts/plan-mode-prompt.d.ts +11 -0
- package/dist/prompts/plan-mode-prompt.js +95 -0
- package/dist/repl-helpers.d.ts +63 -0
- package/dist/repl-helpers.js +319 -0
- package/dist/repl-v2.d.ts +554 -0
- package/dist/repl-v2.js +3286 -0
- package/dist/session/index.d.ts +6 -0
- package/dist/session/index.js +6 -0
- package/dist/session/project-session-manager.d.ts +158 -0
- package/dist/session/project-session-manager.js +650 -0
- package/dist/settings/index.d.ts +156 -13
- package/dist/settings/index.js +377 -24
- package/dist/settings/mcp-config.d.ts +76 -0
- package/dist/settings/mcp-config.js +143 -0
- package/dist/settings/paths.d.ts +114 -0
- package/dist/settings/paths.js +270 -0
- package/dist/shared-handlers.d.ts +62 -0
- package/dist/shared-handlers.js +48 -0
- package/dist/system-prompt/builder.d.ts +5 -0
- package/dist/system-prompt/builder.js +4 -0
- package/dist/system-prompt/index.d.ts +18 -0
- package/dist/system-prompt/index.js +18 -0
- package/dist/system-prompt/modules.d.ts +5 -0
- package/dist/system-prompt/modules.js +4 -0
- package/dist/tabbed-menu.js +2 -1
- package/dist/templates/compilr-md-import.d.ts +16 -0
- package/dist/templates/compilr-md-import.js +241 -0
- package/dist/templates/compilr-md.js +10 -58
- package/dist/templates/config-json.d.ts +1 -25
- package/dist/templates/index.d.ts +2 -0
- package/dist/templates/index.js +35 -75
- package/dist/themes/colors.js +3 -1
- package/dist/themes/registry.d.ts +5 -36
- package/dist/themes/registry.js +11 -95
- package/dist/themes/types.d.ts +3 -38
- package/dist/themes/types.js +2 -2
- package/dist/tool-names.d.ts +108 -0
- package/dist/tool-names.js +227 -0
- package/dist/tools/anchor-tools.d.ts +31 -0
- package/dist/tools/anchor-tools.js +255 -0
- package/dist/tools/artifact-tools.d.ts +42 -0
- package/dist/tools/artifact-tools.js +328 -0
- package/dist/tools/ask-user-simple.d.ts +1 -1
- package/dist/tools/ask-user-simple.js +2 -1
- package/dist/tools/ask-user.d.ts +1 -1
- package/dist/tools/ask-user.js +2 -1
- package/dist/tools/backlog-wrappers.d.ts +56 -0
- package/dist/tools/backlog-wrappers.js +353 -0
- package/dist/tools/backlog.d.ts +2 -2
- package/dist/tools/backlog.js +2 -2
- package/dist/tools/db-tools.d.ts +12 -0
- package/dist/tools/db-tools.js +14 -0
- package/dist/tools/delegate-background.d.ts +27 -0
- package/dist/tools/delegate-background.js +115 -0
- package/dist/tools/delegate.d.ts +22 -0
- package/dist/tools/delegate.js +97 -0
- package/dist/tools/delegation-status.d.ts +16 -0
- package/dist/tools/delegation-status.js +128 -0
- package/dist/tools/document-db.d.ts +43 -0
- package/dist/tools/document-db.js +220 -0
- package/dist/tools/guide-tool.d.ts +12 -0
- package/dist/tools/guide-tool.js +59 -0
- package/dist/tools/handoff.d.ts +25 -0
- package/dist/tools/handoff.js +99 -0
- package/dist/tools/meta-tools.d.ts +26 -0
- package/dist/tools/meta-tools.js +47 -0
- package/dist/tools/plan-tools.d.ts +54 -0
- package/dist/tools/plan-tools.js +338 -0
- package/dist/tools/platform-adapter.d.ts +29 -0
- package/dist/tools/platform-adapter.js +394 -0
- package/dist/tools/project-db.d.ts +34 -0
- package/dist/tools/project-db.js +39 -0
- package/dist/tools/recall-work-tool.d.ts +18 -0
- package/dist/tools/recall-work-tool.js +82 -0
- package/dist/tools/workitem-db.d.ts +135 -0
- package/dist/tools/workitem-db.js +730 -0
- package/dist/tools.d.ts +67 -2
- package/dist/tools.js +238 -38
- package/dist/ui/ask-user-overlay.d.ts +2 -2
- package/dist/ui/ask-user-overlay.js +443 -535
- package/dist/ui/ask-user-simple-overlay.d.ts +2 -2
- package/dist/ui/ask-user-simple-overlay.js +182 -209
- package/dist/ui/autocomplete-controller.d.ts +42 -0
- package/dist/ui/autocomplete-controller.js +384 -0
- package/dist/ui/base/index.d.ts +26 -0
- package/dist/ui/base/index.js +33 -0
- package/dist/ui/base/inline-overlay-utils.d.ts +217 -0
- package/dist/ui/base/inline-overlay-utils.js +320 -0
- package/dist/ui/base/inline-overlay.d.ts +159 -0
- package/dist/ui/base/inline-overlay.js +257 -0
- package/dist/ui/base/key-utils.d.ts +15 -0
- package/dist/ui/base/key-utils.js +30 -0
- package/dist/ui/base/overlay-base-v2.d.ts +203 -0
- package/dist/ui/base/overlay-base-v2.js +260 -0
- package/dist/ui/base/overlay-base.d.ts +156 -0
- package/dist/ui/base/overlay-base.js +238 -0
- package/dist/ui/base/overlay-lifecycle.d.ts +65 -0
- package/dist/ui/base/overlay-lifecycle.js +159 -0
- package/dist/ui/base/overlay-types.d.ts +185 -0
- package/dist/ui/base/overlay-types.js +7 -0
- package/dist/ui/base/render-utils.d.ts +27 -0
- package/dist/ui/base/render-utils.js +36 -0
- package/dist/ui/base/screen-stack.d.ts +148 -0
- package/dist/ui/base/screen-stack.js +184 -0
- package/dist/ui/base/tabbed-list-overlay-v2.d.ts +118 -0
- package/dist/ui/base/tabbed-list-overlay-v2.js +335 -0
- package/dist/ui/base/tabbed-list-overlay.d.ts +153 -0
- package/dist/ui/base/tabbed-list-overlay.js +369 -0
- package/dist/ui/constants/labels.d.ts +14 -0
- package/dist/ui/constants/labels.js +51 -0
- package/dist/ui/conversation-store.d.ts +55 -0
- package/dist/ui/conversation-store.js +107 -0
- package/dist/ui/conversation.d.ts +75 -4
- package/dist/ui/conversation.js +376 -165
- package/dist/ui/diff.d.ts +7 -1
- package/dist/ui/diff.js +85 -48
- package/dist/ui/ephemeral.d.ts +1 -1
- package/dist/ui/ephemeral.js +4 -10
- package/dist/ui/features/index.d.ts +34 -0
- package/dist/ui/features/index.js +34 -0
- package/dist/ui/features/input-feature.d.ts +85 -0
- package/dist/ui/features/input-feature.js +238 -0
- package/dist/ui/features/list-feature.d.ts +155 -0
- package/dist/ui/features/list-feature.js +244 -0
- package/dist/ui/features/pagination-feature.d.ts +154 -0
- package/dist/ui/features/pagination-feature.js +238 -0
- package/dist/ui/features/search-feature.d.ts +148 -0
- package/dist/ui/features/search-feature.js +185 -0
- package/dist/ui/features/tab-feature.d.ts +194 -0
- package/dist/ui/features/tab-feature.js +307 -0
- package/dist/ui/file-autocomplete.d.ts +24 -0
- package/dist/ui/file-autocomplete.js +56 -0
- package/dist/ui/footer-renderer.d.ts +69 -0
- package/dist/ui/footer-renderer.js +431 -0
- package/dist/ui/footer.d.ts +181 -7
- package/dist/ui/footer.js +523 -74
- package/dist/ui/guardrail-overlay.d.ts +29 -0
- package/dist/ui/guardrail-overlay.js +145 -0
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -3
- package/dist/ui/input-controller.d.ts +51 -0
- package/dist/ui/input-controller.js +176 -0
- package/dist/ui/input-prompt.d.ts +135 -33
- package/dist/ui/input-prompt.js +728 -337
- package/dist/ui/iteration-limit-overlay.d.ts +2 -2
- package/dist/ui/iteration-limit-overlay.js +92 -128
- package/dist/ui/keyboard-handler.d.ts +57 -0
- package/dist/ui/keyboard-handler.js +557 -0
- package/dist/ui/keys-overlay.d.ts +1 -0
- package/dist/ui/keys-overlay.js +203 -141
- package/dist/ui/line-utils.d.ts +88 -0
- package/dist/ui/line-utils.js +150 -0
- package/dist/ui/live-region-facade.d.ts +42 -0
- package/dist/ui/live-region-facade.js +205 -0
- package/dist/ui/live-region.d.ts +157 -0
- package/dist/ui/live-region.js +379 -0
- package/dist/ui/mascot/expressions.d.ts +32 -0
- package/dist/ui/mascot/expressions.js +213 -0
- package/dist/ui/mascot/index.d.ts +8 -0
- package/dist/ui/mascot/index.js +8 -0
- package/dist/ui/mascot/renderer.d.ts +19 -0
- package/dist/ui/mascot/renderer.js +132 -0
- package/dist/ui/overlay/data/tutorial-content.d.ts +9 -0
- package/dist/ui/overlay/data/tutorial-content.js +9 -0
- package/dist/ui/overlay/data/tutorial-registry.d.ts +12 -0
- package/dist/ui/overlay/data/tutorial-registry.js +116 -0
- package/dist/ui/overlay/data/tutorial-types.d.ts +35 -0
- package/dist/ui/overlay/data/tutorial-types.js +6 -0
- package/dist/ui/overlay/data/tutorials/basics/first-conversation.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/basics/first-conversation.js +220 -0
- package/dist/ui/overlay/data/tutorials/basics/first-project.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/basics/first-project.js +284 -0
- package/dist/ui/overlay/data/tutorials/basics/navigation.d.ts +8 -0
- package/dist/ui/overlay/data/tutorials/basics/navigation.js +22 -0
- package/dist/ui/overlay/data/tutorials/basics/welcome.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/basics/welcome.js +174 -0
- package/dist/ui/overlay/data/tutorials/config/context-management.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/config/context-management.js +158 -0
- package/dist/ui/overlay/data/tutorials/config/mcp-servers.d.ts +8 -0
- package/dist/ui/overlay/data/tutorials/config/mcp-servers.js +155 -0
- package/dist/ui/overlay/data/tutorials/config/model-selection.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/config/model-selection.js +162 -0
- package/dist/ui/overlay/data/tutorials/config/permissions-safety.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/config/permissions-safety.js +163 -0
- package/dist/ui/overlay/data/tutorials/config/settings-config.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/config/settings-config.js +166 -0
- package/dist/ui/overlay/data/tutorials/planning/arch.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/planning/arch.js +168 -0
- package/dist/ui/overlay/data/tutorials/planning/backlog.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/planning/backlog.js +103 -0
- package/dist/ui/overlay/data/tutorials/planning/build.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/planning/build.js +173 -0
- package/dist/ui/overlay/data/tutorials/planning/design.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/planning/design.js +205 -0
- package/dist/ui/overlay/data/tutorials/planning/docs.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/planning/docs.js +143 -0
- package/dist/ui/overlay/data/tutorials/planning/prd.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/planning/prd.js +173 -0
- package/dist/ui/overlay/data/tutorials/planning/scaffold.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/planning/scaffold.js +164 -0
- package/dist/ui/overlay/data/tutorials/planning/sketch.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/planning/sketch.js +58 -0
- package/dist/ui/overlay/data/tutorials/projects/anchors.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/projects/anchors.js +248 -0
- package/dist/ui/overlay/data/tutorials/projects/import-project.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/projects/import-project.js +172 -0
- package/dist/ui/overlay/data/tutorials/projects/managing-projects.d.ts +8 -0
- package/dist/ui/overlay/data/tutorials/projects/managing-projects.js +212 -0
- package/dist/ui/overlay/data/tutorials/projects/new-project.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/projects/new-project.js +251 -0
- package/dist/ui/overlay/data/tutorials/projects/session-management.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/projects/session-management.js +169 -0
- package/dist/ui/overlay/data/tutorials/teams/background-execution.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/teams/background-execution.js +171 -0
- package/dist/ui/overlay/data/tutorials/teams/multi-terminal.d.ts +8 -0
- package/dist/ui/overlay/data/tutorials/teams/multi-terminal.js +147 -0
- package/dist/ui/overlay/data/tutorials/teams/task-assignment.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/teams/task-assignment.js +204 -0
- package/dist/ui/overlay/data/tutorials/teams/team-overview.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/teams/team-overview.js +165 -0
- package/dist/ui/overlay/data/tutorials/teams/working-with-agents.d.ts +7 -0
- package/dist/ui/overlay/data/tutorials/teams/working-with-agents.js +172 -0
- package/dist/ui/overlay/impl/agents-overlay-v2.d.ts +45 -0
- package/dist/ui/overlay/impl/agents-overlay-v2.js +814 -0
- package/dist/ui/overlay/impl/anchors-overlay-v2.d.ts +47 -0
- package/dist/ui/overlay/impl/anchors-overlay-v2.js +749 -0
- package/dist/ui/overlay/impl/arch-type-overlay-v2.d.ts +37 -0
- package/dist/ui/overlay/impl/arch-type-overlay-v2.js +240 -0
- package/dist/ui/overlay/impl/artifact-detail-overlay-v2.d.ts +43 -0
- package/dist/ui/overlay/impl/artifact-detail-overlay-v2.js +232 -0
- package/dist/ui/overlay/impl/artifact-overlay-v2.d.ts +40 -0
- package/dist/ui/overlay/impl/artifact-overlay-v2.js +115 -0
- package/dist/ui/overlay/impl/ask-user-overlay-v2.d.ts +72 -0
- package/dist/ui/overlay/impl/ask-user-overlay-v2.js +581 -0
- package/dist/ui/overlay/impl/ask-user-simple-overlay-v2.d.ts +46 -0
- package/dist/ui/overlay/impl/ask-user-simple-overlay-v2.js +204 -0
- package/dist/ui/overlay/impl/background-overlay-v2.d.ts +40 -0
- package/dist/ui/overlay/impl/background-overlay-v2.js +147 -0
- package/dist/ui/overlay/impl/backlog-overlay-v2.d.ts +52 -0
- package/dist/ui/overlay/impl/backlog-overlay-v2.js +681 -0
- package/dist/ui/overlay/impl/changelog-overlay-v2.d.ts +44 -0
- package/dist/ui/overlay/impl/changelog-overlay-v2.js +165 -0
- package/dist/ui/overlay/impl/commands-overlay-v2.d.ts +33 -0
- package/dist/ui/overlay/impl/commands-overlay-v2.js +439 -0
- package/dist/ui/overlay/impl/config-overlay-v2.d.ts +111 -0
- package/dist/ui/overlay/impl/config-overlay-v2.js +718 -0
- package/dist/ui/overlay/impl/custom-agent-form-overlay-v2.d.ts +83 -0
- package/dist/ui/overlay/impl/custom-agent-form-overlay-v2.js +711 -0
- package/dist/ui/overlay/impl/dashboard-overlay-v2.d.ts +57 -0
- package/dist/ui/overlay/impl/dashboard-overlay-v2.js +382 -0
- package/dist/ui/overlay/impl/delegations-overlay-v2.d.ts +28 -0
- package/dist/ui/overlay/impl/delegations-overlay-v2.js +279 -0
- package/dist/ui/overlay/impl/docs-overlay-v2.d.ts +45 -0
- package/dist/ui/overlay/impl/docs-overlay-v2.js +117 -0
- package/dist/ui/overlay/impl/document-detail-overlay-v2.d.ts +84 -0
- package/dist/ui/overlay/impl/document-detail-overlay-v2.js +1112 -0
- package/dist/ui/overlay/impl/filter-overlay-v2.d.ts +41 -0
- package/dist/ui/overlay/impl/filter-overlay-v2.js +110 -0
- package/dist/ui/overlay/impl/games-overlay-v2.d.ts +31 -0
- package/dist/ui/overlay/impl/games-overlay-v2.js +135 -0
- package/dist/ui/overlay/impl/guardrail-overlay-v2.d.ts +43 -0
- package/dist/ui/overlay/impl/guardrail-overlay-v2.js +114 -0
- package/dist/ui/overlay/impl/help-overlay-v2.d.ts +57 -0
- package/dist/ui/overlay/impl/help-overlay-v2.js +287 -0
- package/dist/ui/overlay/impl/init-setup-overlay-v2.d.ts +25 -0
- package/dist/ui/overlay/impl/init-setup-overlay-v2.js +97 -0
- package/dist/ui/overlay/impl/iteration-limit-overlay-v2.d.ts +35 -0
- package/dist/ui/overlay/impl/iteration-limit-overlay-v2.js +105 -0
- package/dist/ui/overlay/impl/keys-overlay-v2.d.ts +41 -0
- package/dist/ui/overlay/impl/keys-overlay-v2.js +248 -0
- package/dist/ui/overlay/impl/login-overlay-v2.d.ts +49 -0
- package/dist/ui/overlay/impl/login-overlay-v2.js +277 -0
- package/dist/ui/overlay/impl/mascot-overlay-v2.d.ts +41 -0
- package/dist/ui/overlay/impl/mascot-overlay-v2.js +138 -0
- package/dist/ui/overlay/impl/mcp-overlay-v2.d.ts +63 -0
- package/dist/ui/overlay/impl/mcp-overlay-v2.js +907 -0
- package/dist/ui/overlay/impl/model-overlay-v2.d.ts +93 -0
- package/dist/ui/overlay/impl/model-overlay-v2.js +1143 -0
- package/dist/ui/overlay/impl/model-warning-overlay-v2.d.ts +46 -0
- package/dist/ui/overlay/impl/model-warning-overlay-v2.js +132 -0
- package/dist/ui/overlay/impl/new-overlay-v2.d.ts +108 -0
- package/dist/ui/overlay/impl/new-overlay-v2.js +1243 -0
- package/dist/ui/overlay/impl/notifications-overlay-v2.d.ts +20 -0
- package/dist/ui/overlay/impl/notifications-overlay-v2.js +116 -0
- package/dist/ui/overlay/impl/onboarding-wizard-overlay-v2.d.ts +76 -0
- package/dist/ui/overlay/impl/onboarding-wizard-overlay-v2.js +728 -0
- package/dist/ui/overlay/impl/pending-overlay-v2.d.ts +51 -0
- package/dist/ui/overlay/impl/pending-overlay-v2.js +445 -0
- package/dist/ui/overlay/impl/permission-overlay-v2.d.ts +36 -0
- package/dist/ui/overlay/impl/permission-overlay-v2.js +380 -0
- package/dist/ui/overlay/impl/permissions-overlay-v2.d.ts +85 -0
- package/dist/ui/overlay/impl/permissions-overlay-v2.js +820 -0
- package/dist/ui/overlay/impl/plan-approval-overlay-v2.d.ts +35 -0
- package/dist/ui/overlay/impl/plan-approval-overlay-v2.js +181 -0
- package/dist/ui/overlay/impl/project-edit-overlay-v2.d.ts +36 -0
- package/dist/ui/overlay/impl/project-edit-overlay-v2.js +195 -0
- package/dist/ui/overlay/impl/projects-overlay-v2.d.ts +37 -0
- package/dist/ui/overlay/impl/projects-overlay-v2.js +733 -0
- package/dist/ui/overlay/impl/reset-overlay-v2.d.ts +39 -0
- package/dist/ui/overlay/impl/reset-overlay-v2.js +107 -0
- package/dist/ui/overlay/impl/resume-overlay-v2.d.ts +60 -0
- package/dist/ui/overlay/impl/resume-overlay-v2.js +414 -0
- package/dist/ui/overlay/impl/session-mode-overlay-v2.d.ts +43 -0
- package/dist/ui/overlay/impl/session-mode-overlay-v2.js +124 -0
- package/dist/ui/overlay/impl/tasks-overlay-v2.d.ts +28 -0
- package/dist/ui/overlay/impl/tasks-overlay-v2.js +283 -0
- package/dist/ui/overlay/impl/team-overlay-v2.d.ts +86 -0
- package/dist/ui/overlay/impl/team-overlay-v2.js +692 -0
- package/dist/ui/overlay/impl/terminals-overlay-v2.d.ts +26 -0
- package/dist/ui/overlay/impl/terminals-overlay-v2.js +217 -0
- package/dist/ui/overlay/impl/theme-overlay-v2.d.ts +42 -0
- package/dist/ui/overlay/impl/theme-overlay-v2.js +135 -0
- package/dist/ui/overlay/impl/tools-overlay-v2.d.ts +47 -0
- package/dist/ui/overlay/impl/tools-overlay-v2.js +214 -0
- package/dist/ui/overlay/impl/tutorial-overlay-v2.d.ts +45 -0
- package/dist/ui/overlay/impl/tutorial-overlay-v2.js +212 -0
- package/dist/ui/overlay/impl/workflow-overlay-v2.d.ts +80 -0
- package/dist/ui/overlay/impl/workflow-overlay-v2.js +641 -0
- package/dist/ui/overlay/index.d.ts +52 -0
- package/dist/ui/overlay/index.js +54 -0
- package/dist/ui/overlay/key-utils.d.ts +6 -0
- package/dist/ui/overlay/key-utils.js +6 -0
- package/dist/ui/overlay/types.d.ts +140 -0
- package/dist/ui/overlay/types.js +22 -0
- package/dist/ui/overlay-manager.d.ts +43 -0
- package/dist/ui/overlay-manager.js +238 -0
- package/dist/ui/overlays.d.ts +0 -4
- package/dist/ui/overlays.js +4 -460
- package/dist/ui/permission-overlay.d.ts +1 -1
- package/dist/ui/permission-overlay.js +189 -300
- package/dist/ui/providers/types.d.ts +178 -0
- package/dist/ui/providers/types.js +9 -0
- package/dist/ui/render-modes.d.ts +36 -0
- package/dist/ui/render-modes.js +44 -0
- package/dist/ui/startup-menu.d.ts +36 -0
- package/dist/ui/startup-menu.js +236 -0
- package/dist/ui/status-bar-controller.d.ts +33 -0
- package/dist/ui/status-bar-controller.js +99 -0
- package/dist/ui/subagent-renderer.d.ts +117 -0
- package/dist/ui/subagent-renderer.js +318 -0
- package/dist/ui/terminal-autocomplete-utils.d.ts +23 -0
- package/dist/ui/terminal-autocomplete-utils.js +83 -0
- package/dist/ui/terminal-codes.d.ts +94 -0
- package/dist/ui/terminal-codes.js +124 -0
- package/dist/ui/terminal-line-builders.d.ts +17 -0
- package/dist/ui/terminal-line-builders.js +42 -0
- package/dist/ui/terminal-render-item.d.ts +16 -0
- package/dist/ui/terminal-render-item.js +267 -0
- package/dist/ui/terminal-renderer.d.ts +220 -0
- package/dist/ui/terminal-renderer.js +750 -0
- package/dist/ui/terminal-types.d.ts +179 -0
- package/dist/ui/terminal-types.js +34 -0
- package/dist/ui/terminal-ui.d.ts +331 -0
- package/dist/ui/terminal-ui.js +819 -0
- package/dist/ui/terminal.d.ts +20 -0
- package/dist/ui/terminal.js +72 -0
- package/dist/ui/todo-zone.d.ts +19 -1
- package/dist/ui/todo-zone.js +124 -38
- package/dist/ui/tool-formatters.d.ts +16 -0
- package/dist/ui/tool-formatters.js +1027 -0
- package/dist/ui/turn-metrics.d.ts +56 -0
- package/dist/ui/turn-metrics.js +75 -0
- package/dist/ui/types.d.ts +28 -0
- package/dist/ui/types.js +1 -0
- package/dist/ui/vscode-diff-ipc.d.ts +102 -0
- package/dist/ui/vscode-diff-ipc.js +385 -0
- package/dist/utils/credentials.d.ts +24 -5
- package/dist/utils/credentials.js +123 -9
- package/dist/utils/debug-log.d.ts +28 -0
- package/dist/utils/debug-log.js +57 -0
- package/dist/utils/format-tokens.d.ts +13 -0
- package/dist/utils/format-tokens.js +18 -0
- package/dist/utils/git-config.d.ts +26 -0
- package/dist/utils/git-config.js +54 -0
- package/dist/utils/message-utils.d.ts +61 -0
- package/dist/utils/message-utils.js +72 -0
- package/dist/utils/model-tiers.d.ts +8 -1
- package/dist/utils/model-tiers.js +39 -17
- package/dist/utils/open-browser.d.ts +5 -0
- package/dist/utils/open-browser.js +32 -0
- package/dist/utils/path-safety.d.ts +56 -0
- package/dist/utils/path-safety.js +240 -0
- package/dist/utils/project-detection.d.ts +58 -0
- package/dist/utils/project-detection.js +424 -0
- package/dist/utils/project-memory.js +2 -1
- package/dist/utils/project-status.d.ts +2 -2
- package/dist/utils/startup-perf.d.ts +18 -0
- package/dist/utils/startup-perf.js +60 -0
- package/dist/utils/token-tracker.d.ts +62 -0
- package/dist/utils/token-tracker.js +150 -0
- package/dist/utils/token-types.d.ts +23 -0
- package/dist/utils/token-types.js +18 -0
- package/dist/utils/types/config-types.d.ts +32 -0
- package/dist/utils/types/config-types.js +8 -0
- package/dist/utils/update-checker.d.ts +28 -0
- package/dist/utils/update-checker.js +106 -0
- package/dist/utils/version.d.ts +7 -0
- package/dist/utils/version.js +10 -0
- package/dist/utils/vscode-detect.d.ts +39 -0
- package/dist/utils/vscode-detect.js +137 -0
- package/dist/workflow/guided-mode-injector.d.ts +42 -0
- package/dist/workflow/guided-mode-injector.js +191 -0
- package/dist/workflow/index.d.ts +8 -0
- package/dist/workflow/index.js +8 -0
- package/dist/workflow/step-criteria.d.ts +62 -0
- package/dist/workflow/step-criteria.js +150 -0
- package/dist/workflow/step-tracker.d.ts +92 -0
- package/dist/workflow/step-tracker.js +141 -0
- package/package.json +32 -12
- package/dist/index.old.d.ts +0 -7
- package/dist/index.old.js +0 -1014
- package/dist/repl.d.ts +0 -121
- package/dist/repl.js +0 -1878
- package/dist/templates/claude-md.d.ts +0 -7
- package/dist/templates/claude-md.js +0 -189
- package/dist/test-autocomplete.d.ts +0 -7
- package/dist/test-autocomplete.js +0 -85
- package/dist/test-tabbed-menu.d.ts +0 -7
- package/dist/test-tabbed-menu.js +0 -25
- package/dist/tool-selector.d.ts +0 -71
- package/dist/tool-selector.js +0 -184
- package/dist/ui/agents-overlay.d.ts +0 -12
- package/dist/ui/agents-overlay.js +0 -501
- package/dist/ui/arch-type-overlay.d.ts +0 -20
- package/dist/ui/arch-type-overlay.js +0 -229
- package/dist/ui/backlog-overlay.d.ts +0 -17
- package/dist/ui/backlog-overlay.js +0 -786
- package/dist/ui/commands-overlay.d.ts +0 -11
- package/dist/ui/commands-overlay.js +0 -410
- package/dist/ui/config-overlay.d.ts +0 -34
- package/dist/ui/config-overlay.js +0 -977
- package/dist/ui/init-overlay.d.ts +0 -24
- package/dist/ui/init-overlay.js +0 -525
- package/dist/ui/input-prompt-v2.d.ts +0 -179
- package/dist/ui/input-prompt-v2.js +0 -991
- package/dist/ui/model-warning-overlay.d.ts +0 -30
- package/dist/ui/model-warning-overlay.js +0 -171
- package/dist/ui/tools-overlay.d.ts +0 -26
- package/dist/ui/tools-overlay.js +0 -278
- package/dist/ui/tutorial-overlay.d.ts +0 -10
- package/dist/ui/tutorial-overlay.js +0 -936
package/dist/settings/index.d.ts
CHANGED
|
@@ -4,26 +4,54 @@
|
|
|
4
4
|
* Centralized settings management for the CLI.
|
|
5
5
|
* Persistence in ~/.compilr-dev/settings.json
|
|
6
6
|
*/
|
|
7
|
-
export type PermissionMode = '
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
export type
|
|
7
|
+
export type PermissionMode = 'normal' | 'plan' | 'auto-accept';
|
|
8
|
+
export type PermissionLevel = 'always' | 'session' | 'once' | 'deny';
|
|
9
|
+
export type NotificationMode = 'auto' | 'bell' | 'disabled';
|
|
10
|
+
export type ProviderType = 'auto' | 'claude' | 'openai' | 'gemini' | 'ollama' | 'together' | 'groq' | 'fireworks' | 'perplexity' | 'openrouter' | 'custom';
|
|
11
|
+
export type StartupMode = 'menu' | 'repl';
|
|
12
|
+
export type ProjectStartupMode = 'last' | 'off';
|
|
13
|
+
export type MascotSetting = 'none' | 'random' | 'neutral' | 'thinking' | 'looking_left' | 'looking_right' | 'sleeping' | 'alert' | 'error' | 'success' | 'success_minimal' | 'searching' | 'skeptical';
|
|
14
|
+
export type ProjectSessionMode = 'auto' | 'ask' | 'fresh';
|
|
15
|
+
export type CompactMode = 'active' | 'all' | 'auto';
|
|
16
|
+
/**
|
|
17
|
+
* Permission rule for a tool or pattern.
|
|
18
|
+
* Supports wildcards: git_* matches git_commit, git_branch, etc.
|
|
19
|
+
*/
|
|
20
|
+
export interface PermissionRule {
|
|
21
|
+
toolName: string;
|
|
22
|
+
level: PermissionLevel;
|
|
23
|
+
description?: string;
|
|
24
|
+
isDefault?: boolean;
|
|
25
|
+
}
|
|
12
26
|
export interface Settings {
|
|
13
27
|
theme?: string;
|
|
28
|
+
firstRunComplete: boolean;
|
|
29
|
+
telemetryEnabled: boolean;
|
|
14
30
|
defaultProvider: ProviderType;
|
|
15
31
|
defaultModel: string | null;
|
|
32
|
+
ollamaBaseUrl?: string;
|
|
16
33
|
autoCompact: boolean;
|
|
17
34
|
showTips: boolean;
|
|
18
35
|
reviseCode: boolean;
|
|
19
36
|
verbose: boolean;
|
|
20
37
|
progressBar: boolean;
|
|
21
|
-
|
|
22
|
-
|
|
38
|
+
checkUpdates: boolean;
|
|
39
|
+
lastUpdateCheck: number | null;
|
|
23
40
|
permissionMode: PermissionMode;
|
|
24
41
|
notifications: NotificationMode;
|
|
25
|
-
|
|
26
|
-
|
|
42
|
+
permissionRules: PermissionRule[];
|
|
43
|
+
startupMode: StartupMode;
|
|
44
|
+
projectStartup: ProjectStartupMode;
|
|
45
|
+
lastProjectId: number | null;
|
|
46
|
+
mascot: MascotSetting;
|
|
47
|
+
projectSessionMode: ProjectSessionMode;
|
|
48
|
+
sessionRetentionDays: number;
|
|
49
|
+
compactMode: CompactMode;
|
|
50
|
+
delegation: boolean;
|
|
51
|
+
vsDiffExtension: boolean;
|
|
52
|
+
lastSeenVersion?: string;
|
|
53
|
+
modelTiers?: Partial<Record<ProviderType, Partial<Record<'fast' | 'balanced' | 'powerful', string>>>>;
|
|
54
|
+
roleTierDefaults?: Record<string, 'fast' | 'balanced' | 'powerful'>;
|
|
27
55
|
}
|
|
28
56
|
/**
|
|
29
57
|
* Get all settings (cached)
|
|
@@ -56,12 +84,48 @@ export declare const isShowTipsEnabled: () => boolean;
|
|
|
56
84
|
export declare const isReviseCodeEnabled: () => boolean;
|
|
57
85
|
export declare const isVerboseEnabled: () => boolean;
|
|
58
86
|
export declare const isProgressBarEnabled: () => boolean;
|
|
59
|
-
export declare const
|
|
60
|
-
export declare const
|
|
87
|
+
export declare const isTelemetryEnabled: () => boolean;
|
|
88
|
+
export declare const isCheckUpdatesEnabled: () => boolean;
|
|
89
|
+
export declare const getLastUpdateCheck: () => number | null;
|
|
90
|
+
/**
|
|
91
|
+
* Record that we checked for updates
|
|
92
|
+
*/
|
|
93
|
+
export declare function recordUpdateCheck(): void;
|
|
61
94
|
export declare const getPermissionMode: () => PermissionMode;
|
|
62
95
|
export declare const getNotificationMode: () => NotificationMode;
|
|
63
|
-
|
|
64
|
-
|
|
96
|
+
type AgentMode = 'normal' | 'auto-accept' | 'plan';
|
|
97
|
+
/**
|
|
98
|
+
* Map UI AgentMode to PermissionMode setting.
|
|
99
|
+
* Now 1:1 mapping (except accept-edits which has no UI equivalent).
|
|
100
|
+
*/
|
|
101
|
+
export declare function agentModeToPermissionMode(mode: AgentMode): PermissionMode;
|
|
102
|
+
/**
|
|
103
|
+
* Map PermissionMode setting to UI AgentMode.
|
|
104
|
+
* Now 1:1 mapping for all modes.
|
|
105
|
+
*/
|
|
106
|
+
export declare function permissionModeToAgentMode(mode: PermissionMode): AgentMode;
|
|
107
|
+
/**
|
|
108
|
+
* Sync permission mode when UI mode changes via Shift+Tab.
|
|
109
|
+
* Also returns the new permission mode for display/logging.
|
|
110
|
+
*/
|
|
111
|
+
export declare function syncPermissionModeFromUI(uiMode: AgentMode): PermissionMode;
|
|
112
|
+
export declare const getStartupMode: () => StartupMode;
|
|
113
|
+
export declare const getProjectStartupMode: () => ProjectStartupMode;
|
|
114
|
+
export declare const getLastProjectId: () => number | null;
|
|
115
|
+
export declare const getMascotSetting: () => MascotSetting;
|
|
116
|
+
export declare const getProjectSessionMode: () => ProjectSessionMode;
|
|
117
|
+
export declare const getSessionRetentionDays: () => number;
|
|
118
|
+
export declare const getCompactMode: () => CompactMode;
|
|
119
|
+
export declare const isDelegationEnabled: () => boolean;
|
|
120
|
+
export declare const isFirstRunComplete: () => boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Mark onboarding as complete (called after wizard finishes)
|
|
123
|
+
*/
|
|
124
|
+
export declare function completeFirstRun(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Remember the last opened project (for 'last' mode)
|
|
127
|
+
*/
|
|
128
|
+
export declare function setLastProjectId(projectId: number): void;
|
|
65
129
|
/**
|
|
66
130
|
* Map internal permission mode to display value
|
|
67
131
|
*/
|
|
@@ -78,3 +142,82 @@ export declare function notificationModeToDisplay(mode: NotificationMode): strin
|
|
|
78
142
|
* Map display value to internal notification mode
|
|
79
143
|
*/
|
|
80
144
|
export declare function displayToNotificationMode(display: string): NotificationMode;
|
|
145
|
+
/**
|
|
146
|
+
* Map internal project startup mode to display value
|
|
147
|
+
*/
|
|
148
|
+
export declare function projectStartupModeToDisplay(mode: ProjectStartupMode): string;
|
|
149
|
+
/**
|
|
150
|
+
* Map display value to internal project startup mode
|
|
151
|
+
*/
|
|
152
|
+
export declare function displayToProjectStartupMode(display: string): ProjectStartupMode;
|
|
153
|
+
/**
|
|
154
|
+
* Map internal project session mode to display value
|
|
155
|
+
*/
|
|
156
|
+
export declare function projectSessionModeToDisplay(mode: ProjectSessionMode): string;
|
|
157
|
+
/**
|
|
158
|
+
* Map display value to internal project session mode
|
|
159
|
+
*/
|
|
160
|
+
export declare function displayToProjectSessionMode(display: string): ProjectSessionMode;
|
|
161
|
+
/**
|
|
162
|
+
* Map session retention days to display value
|
|
163
|
+
*/
|
|
164
|
+
export declare function sessionRetentionToDisplay(days: number): string;
|
|
165
|
+
/**
|
|
166
|
+
* Map display value to session retention days
|
|
167
|
+
*/
|
|
168
|
+
export declare function displayToSessionRetention(display: string): number;
|
|
169
|
+
/**
|
|
170
|
+
* Map internal compact mode to display value
|
|
171
|
+
*/
|
|
172
|
+
export declare function compactModeToDisplay(mode: CompactMode): string;
|
|
173
|
+
/**
|
|
174
|
+
* Map display value to internal compact mode
|
|
175
|
+
*/
|
|
176
|
+
export declare function displayToCompactMode(display: string): CompactMode;
|
|
177
|
+
/**
|
|
178
|
+
* Get all permission rules (including defaults)
|
|
179
|
+
*/
|
|
180
|
+
export declare function getPermissionRules(): PermissionRule[];
|
|
181
|
+
/**
|
|
182
|
+
* Add a new permission rule
|
|
183
|
+
*/
|
|
184
|
+
export declare function addPermissionRule(rule: Omit<PermissionRule, 'isDefault'>): void;
|
|
185
|
+
/**
|
|
186
|
+
* Update a permission rule by tool name
|
|
187
|
+
*/
|
|
188
|
+
export declare function updatePermissionRule(toolName: string, updates: Partial<Omit<PermissionRule, 'toolName' | 'isDefault'>>): boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Delete a permission rule (only non-default rules can be deleted)
|
|
191
|
+
*/
|
|
192
|
+
export declare function deletePermissionRule(toolName: string): boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Reset permission rules to defaults
|
|
195
|
+
*/
|
|
196
|
+
export declare function resetPermissionRules(): void;
|
|
197
|
+
/**
|
|
198
|
+
* Get the user's preferred model tier for a role.
|
|
199
|
+
* Returns undefined if no preference is set (use role's built-in default).
|
|
200
|
+
*/
|
|
201
|
+
export declare function getRoleTierDefault(roleId: string): 'fast' | 'balanced' | 'powerful' | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* Set the user's preferred model tier for a role.
|
|
204
|
+
*/
|
|
205
|
+
export declare function setRoleTierDefault(roleId: string, tier: 'fast' | 'balanced' | 'powerful'): void;
|
|
206
|
+
/**
|
|
207
|
+
* Clear the user's preferred model tier for a role (revert to built-in default).
|
|
208
|
+
*/
|
|
209
|
+
export declare function clearRoleTierDefault(roleId: string): void;
|
|
210
|
+
/**
|
|
211
|
+
* Find the permission rule that matches a tool name.
|
|
212
|
+
* Supports wildcards: git_* matches git_commit, git_branch, etc.
|
|
213
|
+
*/
|
|
214
|
+
export declare function findMatchingRule(toolName: string): PermissionRule | null;
|
|
215
|
+
/**
|
|
216
|
+
* Map permission level to display string
|
|
217
|
+
*/
|
|
218
|
+
export declare function permissionLevelToDisplay(level: PermissionLevel): string;
|
|
219
|
+
/**
|
|
220
|
+
* Map display string to permission level
|
|
221
|
+
*/
|
|
222
|
+
export declare function displayToPermissionLevel(display: string): PermissionLevel;
|
|
223
|
+
export {};
|
package/dist/settings/index.js
CHANGED
|
@@ -17,22 +17,55 @@ const CONFIG_FILE = path.join(CONFIG_DIR, 'settings.json');
|
|
|
17
17
|
// =============================================================================
|
|
18
18
|
const DEFAULT_SETTINGS = {
|
|
19
19
|
theme: 'compilr-dark',
|
|
20
|
+
// First run / onboarding
|
|
21
|
+
firstRunComplete: false, // New users start with onboarding wizard
|
|
22
|
+
// Telemetry default (opt-out model - default ON)
|
|
23
|
+
telemetryEnabled: true,
|
|
20
24
|
// Provider/Model defaults
|
|
21
25
|
defaultProvider: 'auto',
|
|
22
26
|
defaultModel: null,
|
|
23
27
|
// Boolean defaults
|
|
24
28
|
autoCompact: true,
|
|
25
|
-
showTips: true,
|
|
26
|
-
reviseCode: true,
|
|
29
|
+
showTips: true, // TODO: Not yet implemented
|
|
30
|
+
reviseCode: true, // TODO: Not yet implemented
|
|
27
31
|
verbose: false,
|
|
28
32
|
progressBar: true,
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
// Update defaults
|
|
34
|
+
checkUpdates: true, // Check for updates on startup
|
|
35
|
+
lastUpdateCheck: null, // Never checked
|
|
31
36
|
// Cycle defaults
|
|
32
|
-
permissionMode: '
|
|
37
|
+
permissionMode: 'normal',
|
|
33
38
|
notifications: 'auto',
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
// Default permission rules
|
|
40
|
+
permissionRules: [
|
|
41
|
+
{ toolName: 'bash', level: 'once', description: 'Execute shell commands', isDefault: true },
|
|
42
|
+
{ toolName: 'write_file', level: 'once', description: 'Write/create files', isDefault: true },
|
|
43
|
+
{ toolName: 'edit', level: 'once', description: 'Edit file contents', isDefault: true },
|
|
44
|
+
{ toolName: 'git_commit', level: 'once', description: 'Create git commits', isDefault: true },
|
|
45
|
+
{ toolName: 'git_branch', level: 'once', description: 'Create/delete branches', isDefault: true },
|
|
46
|
+
{ toolName: 'run_tests', level: 'once', description: 'Run test suite', isDefault: true },
|
|
47
|
+
{ toolName: 'run_lint', level: 'once', description: 'Run linter (may auto-fix)', isDefault: true },
|
|
48
|
+
{ toolName: 'read_file', level: 'always', description: 'Read files', isDefault: true },
|
|
49
|
+
{ toolName: 'glob', level: 'always', description: 'Find files by pattern', isDefault: true },
|
|
50
|
+
{ toolName: 'grep', level: 'always', description: 'Search file contents', isDefault: true },
|
|
51
|
+
],
|
|
52
|
+
// Startup default
|
|
53
|
+
startupMode: 'menu',
|
|
54
|
+
// Project startup defaults
|
|
55
|
+
projectStartup: 'last', // Default: load last opened project
|
|
56
|
+
lastProjectId: null,
|
|
57
|
+
// Mascot default
|
|
58
|
+
mascot: 'neutral', // Default: show neutral mascot with logo
|
|
59
|
+
// Project-session binding default
|
|
60
|
+
projectSessionMode: 'auto', // Default: auto-resume last session when loading project
|
|
61
|
+
// Session history retention default (30 days)
|
|
62
|
+
sessionRetentionDays: 30,
|
|
63
|
+
// Compact mode default (auto: compact agents above 70% utilization)
|
|
64
|
+
compactMode: 'auto',
|
|
65
|
+
// Tool result delegation default (enabled by default)
|
|
66
|
+
delegation: true,
|
|
67
|
+
// VS Code diff extension default (opt-in)
|
|
68
|
+
vsDiffExtension: false,
|
|
36
69
|
};
|
|
37
70
|
// =============================================================================
|
|
38
71
|
// In-memory cache
|
|
@@ -80,6 +113,23 @@ export function getSettings() {
|
|
|
80
113
|
}
|
|
81
114
|
const stored = loadFromDisk();
|
|
82
115
|
settingsCache = { ...DEFAULT_SETTINGS, ...stored };
|
|
116
|
+
// Migration: convert deprecated 'cwd' to 'off'
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
|
+
if (settingsCache.projectStartup === 'cwd') {
|
|
119
|
+
settingsCache.projectStartup = 'off';
|
|
120
|
+
saveToDisk(settingsCache);
|
|
121
|
+
}
|
|
122
|
+
// Migration: convert old permission mode values
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
124
|
+
const oldPermMode = settingsCache.permissionMode;
|
|
125
|
+
if (oldPermMode === 'default' || oldPermMode === 'accept-edits') {
|
|
126
|
+
settingsCache.permissionMode = 'normal';
|
|
127
|
+
saveToDisk(settingsCache);
|
|
128
|
+
}
|
|
129
|
+
else if (oldPermMode === 'dont-ask') {
|
|
130
|
+
settingsCache.permissionMode = 'auto-accept';
|
|
131
|
+
saveToDisk(settingsCache);
|
|
132
|
+
}
|
|
83
133
|
return settingsCache;
|
|
84
134
|
}
|
|
85
135
|
/**
|
|
@@ -127,17 +177,83 @@ export const getDefaultProvider = () => getSetting('defaultProvider');
|
|
|
127
177
|
export const getDefaultModel = () => getSetting('defaultModel');
|
|
128
178
|
// Boolean getters
|
|
129
179
|
export const isAutoCompactEnabled = () => getSetting('autoCompact');
|
|
130
|
-
export const isShowTipsEnabled = () => getSetting('showTips');
|
|
131
|
-
export const isReviseCodeEnabled = () => getSetting('reviseCode');
|
|
180
|
+
export const isShowTipsEnabled = () => getSetting('showTips'); // TODO: Not yet implemented
|
|
181
|
+
export const isReviseCodeEnabled = () => getSetting('reviseCode'); // TODO: Not yet implemented
|
|
132
182
|
export const isVerboseEnabled = () => getSetting('verbose');
|
|
133
183
|
export const isProgressBarEnabled = () => getSetting('progressBar');
|
|
134
|
-
export const
|
|
135
|
-
|
|
184
|
+
export const isTelemetryEnabled = () => getSetting('telemetryEnabled');
|
|
185
|
+
// Update getters
|
|
186
|
+
export const isCheckUpdatesEnabled = () => getSetting('checkUpdates');
|
|
187
|
+
export const getLastUpdateCheck = () => getSetting('lastUpdateCheck');
|
|
188
|
+
/**
|
|
189
|
+
* Record that we checked for updates
|
|
190
|
+
*/
|
|
191
|
+
export function recordUpdateCheck() {
|
|
192
|
+
setSetting('lastUpdateCheck', Date.now());
|
|
193
|
+
}
|
|
136
194
|
// Cycle getters
|
|
137
195
|
export const getPermissionMode = () => getSetting('permissionMode');
|
|
138
196
|
export const getNotificationMode = () => getSetting('notifications');
|
|
139
|
-
|
|
140
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Map UI AgentMode to PermissionMode setting.
|
|
199
|
+
* Now 1:1 mapping (except accept-edits which has no UI equivalent).
|
|
200
|
+
*/
|
|
201
|
+
export function agentModeToPermissionMode(mode) {
|
|
202
|
+
switch (mode) {
|
|
203
|
+
case 'normal':
|
|
204
|
+
return 'normal';
|
|
205
|
+
case 'auto-accept':
|
|
206
|
+
return 'auto-accept';
|
|
207
|
+
case 'plan':
|
|
208
|
+
return 'plan';
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Map PermissionMode setting to UI AgentMode.
|
|
213
|
+
* Now 1:1 mapping for all modes.
|
|
214
|
+
*/
|
|
215
|
+
export function permissionModeToAgentMode(mode) {
|
|
216
|
+
// Direct 1:1 mapping - all modes match
|
|
217
|
+
return mode;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Sync permission mode when UI mode changes via Shift+Tab.
|
|
221
|
+
* Also returns the new permission mode for display/logging.
|
|
222
|
+
*/
|
|
223
|
+
export function syncPermissionModeFromUI(uiMode) {
|
|
224
|
+
const permMode = agentModeToPermissionMode(uiMode);
|
|
225
|
+
setSetting('permissionMode', permMode);
|
|
226
|
+
return permMode;
|
|
227
|
+
}
|
|
228
|
+
// Startup getter
|
|
229
|
+
export const getStartupMode = () => getSetting('startupMode');
|
|
230
|
+
// Project startup getters
|
|
231
|
+
export const getProjectStartupMode = () => getSetting('projectStartup');
|
|
232
|
+
export const getLastProjectId = () => getSetting('lastProjectId');
|
|
233
|
+
// Mascot getter
|
|
234
|
+
export const getMascotSetting = () => getSetting('mascot');
|
|
235
|
+
// Project-session binding getter
|
|
236
|
+
export const getProjectSessionMode = () => getSetting('projectSessionMode');
|
|
237
|
+
// Session retention getter
|
|
238
|
+
export const getSessionRetentionDays = () => getSetting('sessionRetentionDays');
|
|
239
|
+
// Compact mode getter
|
|
240
|
+
export const getCompactMode = () => getSetting('compactMode');
|
|
241
|
+
// Tool result delegation
|
|
242
|
+
export const isDelegationEnabled = () => getSetting('delegation');
|
|
243
|
+
// First run / onboarding
|
|
244
|
+
export const isFirstRunComplete = () => getSetting('firstRunComplete');
|
|
245
|
+
/**
|
|
246
|
+
* Mark onboarding as complete (called after wizard finishes)
|
|
247
|
+
*/
|
|
248
|
+
export function completeFirstRun() {
|
|
249
|
+
setSetting('firstRunComplete', true);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Remember the last opened project (for 'last' mode)
|
|
253
|
+
*/
|
|
254
|
+
export function setLastProjectId(projectId) {
|
|
255
|
+
setSetting('lastProjectId', projectId);
|
|
256
|
+
}
|
|
141
257
|
// =============================================================================
|
|
142
258
|
// Display Value Mappers (for config overlay)
|
|
143
259
|
// =============================================================================
|
|
@@ -146,12 +262,12 @@ export const getEditorMode = () => getSetting('editorMode');
|
|
|
146
262
|
*/
|
|
147
263
|
export function permissionModeToDisplay(mode) {
|
|
148
264
|
switch (mode) {
|
|
149
|
-
case '
|
|
150
|
-
return '
|
|
265
|
+
case 'normal':
|
|
266
|
+
return 'Normal';
|
|
151
267
|
case 'plan':
|
|
152
268
|
return 'Plan';
|
|
153
|
-
case '
|
|
154
|
-
return '
|
|
269
|
+
case 'auto-accept':
|
|
270
|
+
return 'Auto-accept';
|
|
155
271
|
}
|
|
156
272
|
}
|
|
157
273
|
/**
|
|
@@ -161,10 +277,10 @@ export function displayToPermissionMode(display) {
|
|
|
161
277
|
switch (display) {
|
|
162
278
|
case 'Plan':
|
|
163
279
|
return 'plan';
|
|
164
|
-
case '
|
|
165
|
-
return '
|
|
280
|
+
case 'Auto-accept':
|
|
281
|
+
return 'auto-accept';
|
|
166
282
|
default:
|
|
167
|
-
return '
|
|
283
|
+
return 'normal';
|
|
168
284
|
}
|
|
169
285
|
}
|
|
170
286
|
/**
|
|
@@ -174,8 +290,8 @@ export function notificationModeToDisplay(mode) {
|
|
|
174
290
|
switch (mode) {
|
|
175
291
|
case 'auto':
|
|
176
292
|
return 'Auto';
|
|
177
|
-
case '
|
|
178
|
-
return '
|
|
293
|
+
case 'bell':
|
|
294
|
+
return 'Terminal Bell';
|
|
179
295
|
case 'disabled':
|
|
180
296
|
return 'Disabled';
|
|
181
297
|
}
|
|
@@ -185,11 +301,248 @@ export function notificationModeToDisplay(mode) {
|
|
|
185
301
|
*/
|
|
186
302
|
export function displayToNotificationMode(display) {
|
|
187
303
|
switch (display) {
|
|
188
|
-
case '
|
|
189
|
-
return '
|
|
304
|
+
case 'Terminal Bell':
|
|
305
|
+
return 'bell';
|
|
190
306
|
case 'Disabled':
|
|
191
307
|
return 'disabled';
|
|
192
308
|
default:
|
|
193
309
|
return 'auto';
|
|
194
310
|
}
|
|
195
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Map internal project startup mode to display value
|
|
314
|
+
*/
|
|
315
|
+
export function projectStartupModeToDisplay(mode) {
|
|
316
|
+
switch (mode) {
|
|
317
|
+
case 'last':
|
|
318
|
+
return 'Last opened';
|
|
319
|
+
case 'off':
|
|
320
|
+
return 'Off';
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Map display value to internal project startup mode
|
|
325
|
+
*/
|
|
326
|
+
export function displayToProjectStartupMode(display) {
|
|
327
|
+
switch (display) {
|
|
328
|
+
case 'Off':
|
|
329
|
+
return 'off';
|
|
330
|
+
default:
|
|
331
|
+
return 'last';
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Map internal project session mode to display value
|
|
336
|
+
*/
|
|
337
|
+
export function projectSessionModeToDisplay(mode) {
|
|
338
|
+
switch (mode) {
|
|
339
|
+
case 'auto':
|
|
340
|
+
return 'Auto';
|
|
341
|
+
case 'ask':
|
|
342
|
+
return 'Ask';
|
|
343
|
+
case 'fresh':
|
|
344
|
+
return 'Fresh';
|
|
345
|
+
default:
|
|
346
|
+
return 'Auto';
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Map display value to internal project session mode
|
|
351
|
+
*/
|
|
352
|
+
export function displayToProjectSessionMode(display) {
|
|
353
|
+
switch (display) {
|
|
354
|
+
case 'Ask':
|
|
355
|
+
return 'ask';
|
|
356
|
+
case 'Fresh':
|
|
357
|
+
return 'fresh';
|
|
358
|
+
default:
|
|
359
|
+
return 'auto';
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Map session retention days to display value
|
|
364
|
+
*/
|
|
365
|
+
export function sessionRetentionToDisplay(days) {
|
|
366
|
+
if (days <= 0)
|
|
367
|
+
return 'Forever';
|
|
368
|
+
return `${String(days)} days`;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Map display value to session retention days
|
|
372
|
+
*/
|
|
373
|
+
export function displayToSessionRetention(display) {
|
|
374
|
+
if (display === 'Forever')
|
|
375
|
+
return 0;
|
|
376
|
+
const match = /^(\d+)\s*days?$/.exec(display);
|
|
377
|
+
if (match)
|
|
378
|
+
return parseInt(match[1], 10);
|
|
379
|
+
return 30; // Default fallback
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Map internal compact mode to display value
|
|
383
|
+
*/
|
|
384
|
+
export function compactModeToDisplay(mode) {
|
|
385
|
+
switch (mode) {
|
|
386
|
+
case 'active':
|
|
387
|
+
return 'Active agent';
|
|
388
|
+
case 'all':
|
|
389
|
+
return 'All agents';
|
|
390
|
+
case 'auto':
|
|
391
|
+
return 'Auto (>70%)';
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Map display value to internal compact mode
|
|
396
|
+
*/
|
|
397
|
+
export function displayToCompactMode(display) {
|
|
398
|
+
switch (display) {
|
|
399
|
+
case 'Active agent':
|
|
400
|
+
return 'active';
|
|
401
|
+
case 'All agents':
|
|
402
|
+
return 'all';
|
|
403
|
+
default:
|
|
404
|
+
return 'auto';
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
// =============================================================================
|
|
408
|
+
// Permission Rules Management
|
|
409
|
+
// =============================================================================
|
|
410
|
+
/**
|
|
411
|
+
* Get all permission rules (including defaults)
|
|
412
|
+
*/
|
|
413
|
+
export function getPermissionRules() {
|
|
414
|
+
return getSetting('permissionRules');
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Add a new permission rule
|
|
418
|
+
*/
|
|
419
|
+
export function addPermissionRule(rule) {
|
|
420
|
+
const rules = getPermissionRules();
|
|
421
|
+
// Check if rule with same toolName exists
|
|
422
|
+
const existingIndex = rules.findIndex(r => r.toolName === rule.toolName);
|
|
423
|
+
if (existingIndex >= 0) {
|
|
424
|
+
// Update existing rule
|
|
425
|
+
rules[existingIndex] = { ...rule, isDefault: false };
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
// Add new rule
|
|
429
|
+
rules.push({ ...rule, isDefault: false });
|
|
430
|
+
}
|
|
431
|
+
setSetting('permissionRules', rules);
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Update a permission rule by tool name
|
|
435
|
+
*/
|
|
436
|
+
export function updatePermissionRule(toolName, updates) {
|
|
437
|
+
const rules = getPermissionRules();
|
|
438
|
+
const index = rules.findIndex(r => r.toolName === toolName);
|
|
439
|
+
if (index < 0)
|
|
440
|
+
return false;
|
|
441
|
+
rules[index] = { ...rules[index], ...updates };
|
|
442
|
+
setSetting('permissionRules', rules);
|
|
443
|
+
return true;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Delete a permission rule (only non-default rules can be deleted)
|
|
447
|
+
*/
|
|
448
|
+
export function deletePermissionRule(toolName) {
|
|
449
|
+
const rules = getPermissionRules();
|
|
450
|
+
const index = rules.findIndex(r => r.toolName === toolName);
|
|
451
|
+
if (index < 0)
|
|
452
|
+
return false;
|
|
453
|
+
// Don't allow deleting default rules
|
|
454
|
+
if (rules[index].isDefault)
|
|
455
|
+
return false;
|
|
456
|
+
rules.splice(index, 1);
|
|
457
|
+
setSetting('permissionRules', rules);
|
|
458
|
+
return true;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Reset permission rules to defaults
|
|
462
|
+
*/
|
|
463
|
+
export function resetPermissionRules() {
|
|
464
|
+
setSetting('permissionRules', DEFAULT_SETTINGS.permissionRules);
|
|
465
|
+
}
|
|
466
|
+
// =============================================================================
|
|
467
|
+
// Role Tier Defaults
|
|
468
|
+
// =============================================================================
|
|
469
|
+
/**
|
|
470
|
+
* Get the user's preferred model tier for a role.
|
|
471
|
+
* Returns undefined if no preference is set (use role's built-in default).
|
|
472
|
+
*/
|
|
473
|
+
export function getRoleTierDefault(roleId) {
|
|
474
|
+
const defaults = getSetting('roleTierDefaults');
|
|
475
|
+
return defaults?.[roleId];
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Set the user's preferred model tier for a role.
|
|
479
|
+
*/
|
|
480
|
+
export function setRoleTierDefault(roleId, tier) {
|
|
481
|
+
const defaults = getSetting('roleTierDefaults') ?? {};
|
|
482
|
+
defaults[roleId] = tier;
|
|
483
|
+
setSetting('roleTierDefaults', defaults);
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Clear the user's preferred model tier for a role (revert to built-in default).
|
|
487
|
+
*/
|
|
488
|
+
export function clearRoleTierDefault(roleId) {
|
|
489
|
+
const defaults = getSetting('roleTierDefaults');
|
|
490
|
+
if (defaults && roleId in defaults) {
|
|
491
|
+
const { [roleId]: _removed, ...remaining } = defaults;
|
|
492
|
+
setSetting('roleTierDefaults', Object.keys(remaining).length > 0 ? remaining : undefined);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Find the permission rule that matches a tool name.
|
|
497
|
+
* Supports wildcards: git_* matches git_commit, git_branch, etc.
|
|
498
|
+
*/
|
|
499
|
+
export function findMatchingRule(toolName) {
|
|
500
|
+
const rules = getPermissionRules();
|
|
501
|
+
// First try exact match
|
|
502
|
+
const exactMatch = rules.find(r => r.toolName === toolName);
|
|
503
|
+
if (exactMatch)
|
|
504
|
+
return exactMatch;
|
|
505
|
+
// Then try wildcard patterns
|
|
506
|
+
for (const rule of rules) {
|
|
507
|
+
if (rule.toolName.includes('*')) {
|
|
508
|
+
const pattern = rule.toolName
|
|
509
|
+
.replace(/[.+?^${}()|[\]\\]/g, '\\$&') // Escape special regex chars
|
|
510
|
+
.replace(/\*/g, '.*'); // Convert * to .*
|
|
511
|
+
const regex = new RegExp(`^${pattern}$`);
|
|
512
|
+
if (regex.test(toolName)) {
|
|
513
|
+
return rule;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
return null;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Map permission level to display string
|
|
521
|
+
*/
|
|
522
|
+
export function permissionLevelToDisplay(level) {
|
|
523
|
+
switch (level) {
|
|
524
|
+
case 'always':
|
|
525
|
+
return 'Always';
|
|
526
|
+
case 'session':
|
|
527
|
+
return 'Session';
|
|
528
|
+
case 'once':
|
|
529
|
+
return 'Once';
|
|
530
|
+
case 'deny':
|
|
531
|
+
return 'Deny';
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Map display string to permission level
|
|
536
|
+
*/
|
|
537
|
+
export function displayToPermissionLevel(display) {
|
|
538
|
+
switch (display.toLowerCase()) {
|
|
539
|
+
case 'always':
|
|
540
|
+
return 'always';
|
|
541
|
+
case 'session':
|
|
542
|
+
return 'session';
|
|
543
|
+
case 'deny':
|
|
544
|
+
return 'deny';
|
|
545
|
+
default:
|
|
546
|
+
return 'once';
|
|
547
|
+
}
|
|
548
|
+
}
|