@kaitranntt/ccs 8.4.0-dev.10 → 8.4.0-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/profile-registry.d.ts.map +1 -1
- package/dist/auth/profile-registry.js +13 -12
- package/dist/auth/profile-registry.js.map +1 -1
- package/dist/cliproxy/accounts/account-safety.d.ts.map +1 -1
- package/dist/cliproxy/accounts/account-safety.js +56 -56
- package/dist/cliproxy/accounts/account-safety.js.map +1 -1
- package/dist/cliproxy/auth/antigravity-responsibility.d.ts.map +1 -1
- package/dist/cliproxy/auth/antigravity-responsibility.js +15 -15
- package/dist/cliproxy/auth/antigravity-responsibility.js.map +1 -1
- package/dist/cliproxy/auth/auth-token-manager.d.ts.map +1 -1
- package/dist/cliproxy/auth/auth-token-manager.js +2 -1
- package/dist/cliproxy/auth/auth-token-manager.js.map +1 -1
- package/dist/cliproxy/auth/auth-types.d.ts.map +1 -1
- package/dist/cliproxy/auth/auth-types.js +3 -2
- package/dist/cliproxy/auth/auth-types.js.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +6 -5
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/cliproxy/auth/provider-refreshers/index.d.ts.map +1 -1
- package/dist/cliproxy/auth/provider-refreshers/index.js +2 -1
- package/dist/cliproxy/auth/provider-refreshers/index.js.map +1 -1
- package/dist/cliproxy/config/model-config.d.ts.map +1 -1
- package/dist/cliproxy/config/model-config.js +32 -32
- package/dist/cliproxy/config/model-config.js.map +1 -1
- package/dist/cliproxy/executor/arg-parser.d.ts.map +1 -1
- package/dist/cliproxy/executor/arg-parser.js +26 -26
- package/dist/cliproxy/executor/arg-parser.js.map +1 -1
- package/dist/cliproxy/executor/auth-coordinator.d.ts.map +1 -1
- package/dist/cliproxy/executor/auth-coordinator.js +15 -14
- package/dist/cliproxy/executor/auth-coordinator.js.map +1 -1
- package/dist/cliproxy/executor/index.d.ts.map +1 -1
- package/dist/cliproxy/executor/index.js +17 -13
- package/dist/cliproxy/executor/index.js.map +1 -1
- package/dist/cliproxy/executor/lifecycle-manager.d.ts.map +1 -1
- package/dist/cliproxy/executor/lifecycle-manager.js +18 -16
- package/dist/cliproxy/executor/lifecycle-manager.js.map +1 -1
- package/dist/cliproxy/executor/model-warnings.d.ts.map +1 -1
- package/dist/cliproxy/executor/model-warnings.js +24 -13
- package/dist/cliproxy/executor/model-warnings.js.map +1 -1
- package/dist/cliproxy/executor/retry-handler.d.ts.map +1 -1
- package/dist/cliproxy/executor/retry-handler.js +13 -11
- package/dist/cliproxy/executor/retry-handler.js.map +1 -1
- package/dist/cliproxy/executor/session-bridge.d.ts.map +1 -1
- package/dist/cliproxy/executor/session-bridge.js +18 -10
- package/dist/cliproxy/executor/session-bridge.js.map +1 -1
- package/dist/cliproxy/management/remote-token-uploader.d.ts.map +1 -1
- package/dist/cliproxy/management/remote-token-uploader.js +11 -11
- package/dist/cliproxy/management/remote-token-uploader.js.map +1 -1
- package/dist/cliproxy/proxy/https-tunnel-proxy.d.ts +5 -1
- package/dist/cliproxy/proxy/https-tunnel-proxy.d.ts.map +1 -1
- package/dist/cliproxy/proxy/https-tunnel-proxy.js +22 -10
- package/dist/cliproxy/proxy/https-tunnel-proxy.js.map +1 -1
- package/dist/cliproxy/proxy/tool-sanitization-proxy.d.ts +0 -12
- package/dist/cliproxy/proxy/tool-sanitization-proxy.d.ts.map +1 -1
- package/dist/cliproxy/proxy/tool-sanitization-proxy.js +42 -72
- package/dist/cliproxy/proxy/tool-sanitization-proxy.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.d.ts +21 -0
- package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.js +154 -0
- package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.d.ts +35 -0
- package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.js +98 -0
- package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.d.ts +22 -0
- package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.js +111 -0
- package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.d.ts +17 -0
- package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.js +85 -0
- package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/constants.d.ts +25 -0
- package/dist/cliproxy/quota/quota-fetcher/constants.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/constants.js +31 -0
- package/dist/cliproxy/quota/quota-fetcher/constants.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/http-client.d.ts +29 -0
- package/dist/cliproxy/quota/quota-fetcher/http-client.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/http-client.js +199 -0
- package/dist/cliproxy/quota/quota-fetcher/http-client.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/project-lookup.d.ts +16 -0
- package/dist/cliproxy/quota/quota-fetcher/project-lookup.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/project-lookup.js +89 -0
- package/dist/cliproxy/quota/quota-fetcher/project-lookup.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/status-classifier.d.ts +29 -0
- package/dist/cliproxy/quota/quota-fetcher/status-classifier.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/status-classifier.js +168 -0
- package/dist/cliproxy/quota/quota-fetcher/status-classifier.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/types.d.ts +165 -0
- package/dist/cliproxy/quota/quota-fetcher/types.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/types.js +9 -0
- package/dist/cliproxy/quota/quota-fetcher/types.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-claude.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-claude.js +14 -3
- package/dist/cliproxy/quota/quota-fetcher-claude.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-codex.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-codex.js +36 -9
- package/dist/cliproxy/quota/quota-fetcher-codex.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.d.ts +26 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.js +132 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.d.ts +23 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.js +54 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.d.ts +26 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.js +29 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.d.ts +61 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.js +259 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.d.ts +20 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.js +38 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.d.ts +82 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.js +263 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.d.ts +46 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.js +188 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.d.ts +35 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.js +65 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.d.ts +37 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.js +117 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.d.ts +31 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.js +77 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.d.ts +114 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.js +10 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli.d.ts +13 -58
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli.js +20 -819
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-ghcp.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-ghcp.js +19 -4
- package/dist/cliproxy/quota/quota-fetcher-ghcp.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher.d.ts +12 -108
- package/dist/cliproxy/quota/quota-fetcher.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher.js +23 -766
- package/dist/cliproxy/quota/quota-fetcher.js.map +1 -1
- package/dist/cliproxy/routing/routing-strategy.d.ts.map +1 -1
- package/dist/cliproxy/routing/routing-strategy.js +11 -3
- package/dist/cliproxy/routing/routing-strategy.js.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.d.ts +26 -0
- package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.js +82 -0
- package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.d.ts +41 -0
- package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.js +202 -0
- package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/format-helpers.d.ts +32 -0
- package/dist/commands/cliproxy/quota-subcommand/format-helpers.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/format-helpers.js +90 -0
- package/dist/commands/cliproxy/quota-subcommand/format-helpers.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/handlers.d.ts +25 -0
- package/dist/commands/cliproxy/quota-subcommand/handlers.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/handlers.js +245 -0
- package/dist/commands/cliproxy/quota-subcommand/handlers.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/profile-args.d.ts +10 -0
- package/dist/commands/cliproxy/quota-subcommand/profile-args.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/profile-args.js +37 -0
- package/dist/commands/cliproxy/quota-subcommand/profile-args.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/provider-runtime.d.ts +12 -0
- package/dist/commands/cliproxy/quota-subcommand/provider-runtime.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/provider-runtime.js +64 -0
- package/dist/commands/cliproxy/quota-subcommand/provider-runtime.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.d.ts +27 -0
- package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.js +74 -0
- package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.d.ts +10 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.js +46 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/claude.d.ts +14 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/claude.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/claude.js +68 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/claude.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/codex.d.ts +14 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/codex.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/codex.js +82 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/codex.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.d.ts +14 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.js +61 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.d.ts +13 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.js +63 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/test-exports.d.ts +19 -0
- package/dist/commands/cliproxy/quota-subcommand/test-exports.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/test-exports.js +22 -0
- package/dist/commands/cliproxy/quota-subcommand/test-exports.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/types.d.ts +42 -0
- package/dist/commands/cliproxy/quota-subcommand/types.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/types.js +9 -0
- package/dist/commands/cliproxy/quota-subcommand/types.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand.d.ts +14 -36
- package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand.js +21 -872
- package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
- package/dist/commands/persist-command/arg-parsing.d.ts +14 -0
- package/dist/commands/persist-command/arg-parsing.d.ts.map +1 -0
- package/dist/commands/persist-command/arg-parsing.js +84 -0
- package/dist/commands/persist-command/arg-parsing.js.map +1 -0
- package/dist/commands/persist-command/backup-rotation.d.ts +23 -0
- package/dist/commands/persist-command/backup-rotation.d.ts.map +1 -0
- package/dist/commands/persist-command/backup-rotation.js +260 -0
- package/dist/commands/persist-command/backup-rotation.js.map +1 -0
- package/dist/commands/persist-command/handler.d.ts +10 -0
- package/dist/commands/persist-command/handler.d.ts.map +1 -0
- package/dist/commands/persist-command/handler.js +267 -0
- package/dist/commands/persist-command/handler.js.map +1 -0
- package/dist/commands/persist-command/help.d.ts +9 -0
- package/dist/commands/persist-command/help.d.ts.map +1 -0
- package/dist/commands/persist-command/help.js +86 -0
- package/dist/commands/persist-command/help.js.map +1 -0
- package/dist/commands/persist-command/receipt.d.ts +13 -0
- package/dist/commands/persist-command/receipt.d.ts.map +1 -0
- package/dist/commands/persist-command/receipt.js +102 -0
- package/dist/commands/persist-command/receipt.js.map +1 -0
- package/dist/commands/persist-command/secret-detection.d.ts +11 -0
- package/dist/commands/persist-command/secret-detection.d.ts.map +1 -0
- package/dist/commands/persist-command/secret-detection.js +54 -0
- package/dist/commands/persist-command/secret-detection.js.map +1 -0
- package/dist/commands/persist-command/secure-file.d.ts +21 -0
- package/dist/commands/persist-command/secure-file.d.ts.map +1 -0
- package/dist/commands/persist-command/secure-file.js +231 -0
- package/dist/commands/persist-command/secure-file.js.map +1 -0
- package/dist/commands/persist-command/types.d.ts +42 -0
- package/dist/commands/persist-command/types.d.ts.map +1 -0
- package/dist/commands/persist-command/types.js +34 -0
- package/dist/commands/persist-command/types.js.map +1 -0
- package/dist/commands/persist-command.d.ts +7 -2
- package/dist/commands/persist-command.d.ts.map +1 -1
- package/dist/commands/persist-command.js +17 -933
- package/dist/commands/persist-command.js.map +1 -1
- package/dist/copilot/copilot-executor.js +25 -25
- package/dist/copilot/copilot-executor.js.map +1 -1
- package/dist/cursor/cursor-daemon-entry.d.ts.map +1 -1
- package/dist/cursor/cursor-daemon-entry.js +34 -9
- package/dist/cursor/cursor-daemon-entry.js.map +1 -1
- package/dist/cursor/cursor-daemon.d.ts.map +1 -1
- package/dist/cursor/cursor-daemon.js +1 -0
- package/dist/cursor/cursor-daemon.js.map +1 -1
- package/dist/cursor/cursor-profile-executor.d.ts.map +1 -1
- package/dist/cursor/cursor-profile-executor.js +18 -17
- package/dist/cursor/cursor-profile-executor.js.map +1 -1
- package/dist/delegation/delegation-handler.d.ts.map +1 -1
- package/dist/delegation/delegation-handler.js +29 -23
- package/dist/delegation/delegation-handler.js.map +1 -1
- package/dist/delegation/headless-executor.d.ts +1 -0
- package/dist/delegation/headless-executor.d.ts.map +1 -1
- package/dist/delegation/headless-executor.js +35 -14
- package/dist/delegation/headless-executor.js.map +1 -1
- package/dist/delegation/session-manager.d.ts.map +1 -1
- package/dist/delegation/session-manager.js +12 -4
- package/dist/delegation/session-manager.js.map +1 -1
- package/dist/dispatcher/cli-argument-parser.d.ts +1 -1
- package/dist/dispatcher/cli-argument-parser.d.ts.map +1 -1
- package/dist/dispatcher/cli-argument-parser.js +24 -23
- package/dist/dispatcher/cli-argument-parser.js.map +1 -1
- package/dist/dispatcher/flows/cliproxy-flow.d.ts.map +1 -1
- package/dist/dispatcher/flows/cliproxy-flow.js +12 -11
- package/dist/dispatcher/flows/cliproxy-flow.js.map +1 -1
- package/dist/dispatcher/flows/settings-flow.d.ts.map +1 -1
- package/dist/dispatcher/flows/settings-flow.js +27 -27
- package/dist/dispatcher/flows/settings-flow.js.map +1 -1
- package/dist/dispatcher/profile-resolver.d.ts.map +1 -1
- package/dist/dispatcher/profile-resolver.js +16 -16
- package/dist/dispatcher/profile-resolver.js.map +1 -1
- package/dist/docker/supervisord-lifecycle.d.ts.map +1 -1
- package/dist/docker/supervisord-lifecycle.js +5 -1
- package/dist/docker/supervisord-lifecycle.js.map +1 -1
- package/dist/errors/error-types.d.ts +26 -22
- package/dist/errors/error-types.d.ts.map +1 -1
- package/dist/errors/error-types.js +15 -12
- package/dist/errors/error-types.js.map +1 -1
- package/dist/errors/exit-codes.d.ts +20 -13
- package/dist/errors/exit-codes.d.ts.map +1 -1
- package/dist/errors/exit-codes.js +32 -28
- package/dist/errors/exit-codes.js.map +1 -1
- package/dist/glmt/delta-accumulator.d.ts +1 -0
- package/dist/glmt/delta-accumulator.d.ts.map +1 -1
- package/dist/glmt/delta-accumulator.js +12 -4
- package/dist/glmt/delta-accumulator.js.map +1 -1
- package/dist/glmt/glmt-proxy.d.ts.map +1 -1
- package/dist/glmt/glmt-proxy.js +39 -10
- package/dist/glmt/glmt-proxy.js.map +1 -1
- package/dist/glmt/glmt-transformer.d.ts.map +1 -1
- package/dist/glmt/glmt-transformer.js +1 -4
- package/dist/glmt/glmt-transformer.js.map +1 -1
- package/dist/glmt/pipeline/request-transformer.d.ts.map +1 -1
- package/dist/glmt/pipeline/request-transformer.js +5 -1
- package/dist/glmt/pipeline/request-transformer.js.map +1 -1
- package/dist/glmt/pipeline/response-builder.d.ts.map +1 -1
- package/dist/glmt/pipeline/response-builder.js +7 -3
- package/dist/glmt/pipeline/response-builder.js.map +1 -1
- package/dist/glmt/pipeline/stream-parser.d.ts.map +1 -1
- package/dist/glmt/pipeline/stream-parser.js +11 -5
- package/dist/glmt/pipeline/stream-parser.js.map +1 -1
- package/dist/glmt/pipeline/tool-call-handler.d.ts.map +1 -1
- package/dist/glmt/pipeline/tool-call-handler.js +7 -1
- package/dist/glmt/pipeline/tool-call-handler.js.map +1 -1
- package/dist/glmt/sse-parser.d.ts +1 -0
- package/dist/glmt/sse-parser.d.ts.map +1 -1
- package/dist/glmt/sse-parser.js +7 -3
- package/dist/glmt/sse-parser.js.map +1 -1
- package/dist/management/shared-manager/fs-helpers.d.ts +69 -0
- package/dist/management/shared-manager/fs-helpers.d.ts.map +1 -0
- package/dist/management/shared-manager/fs-helpers.js +241 -0
- package/dist/management/shared-manager/fs-helpers.js.map +1 -0
- package/dist/management/shared-manager/migrations.d.ts +21 -0
- package/dist/management/shared-manager/migrations.d.ts.map +1 -0
- package/dist/management/shared-manager/migrations.js +187 -0
- package/dist/management/shared-manager/migrations.js.map +1 -0
- package/dist/management/shared-manager/orchestrator.d.ts +87 -0
- package/dist/management/shared-manager/orchestrator.d.ts.map +1 -0
- package/dist/management/shared-manager/orchestrator.js +161 -0
- package/dist/management/shared-manager/orchestrator.js.map +1 -0
- package/dist/management/shared-manager/plugin-layout-internals.d.ts +42 -0
- package/dist/management/shared-manager/plugin-layout-internals.d.ts.map +1 -0
- package/dist/management/shared-manager/plugin-layout-internals.js +192 -0
- package/dist/management/shared-manager/plugin-layout-internals.js.map +1 -0
- package/dist/management/shared-manager/plugin-metadata-normalizer.d.ts +53 -0
- package/dist/management/shared-manager/plugin-metadata-normalizer.d.ts.map +1 -0
- package/dist/management/shared-manager/plugin-metadata-normalizer.js +253 -0
- package/dist/management/shared-manager/plugin-metadata-normalizer.js.map +1 -0
- package/dist/management/shared-manager/project-context-sync.d.ts +36 -0
- package/dist/management/shared-manager/project-context-sync.d.ts.map +1 -0
- package/dist/management/shared-manager/project-context-sync.js +204 -0
- package/dist/management/shared-manager/project-context-sync.js.map +1 -0
- package/dist/management/shared-manager/project-memory-sync.d.ts +21 -0
- package/dist/management/shared-manager/project-memory-sync.d.ts.map +1 -0
- package/dist/management/shared-manager/project-memory-sync.js +113 -0
- package/dist/management/shared-manager/project-memory-sync.js.map +1 -0
- package/dist/management/shared-manager/shared-dir-linker.d.ts +41 -0
- package/dist/management/shared-manager/shared-dir-linker.d.ts.map +1 -0
- package/dist/management/shared-manager/shared-dir-linker.js +227 -0
- package/dist/management/shared-manager/shared-dir-linker.js.map +1 -0
- package/dist/management/shared-manager/symlink-helpers.d.ts +61 -0
- package/dist/management/shared-manager/symlink-helpers.d.ts.map +1 -0
- package/dist/management/shared-manager/symlink-helpers.js +243 -0
- package/dist/management/shared-manager/symlink-helpers.js.map +1 -0
- package/dist/management/shared-manager/types.d.ts +45 -0
- package/dist/management/shared-manager/types.d.ts.map +1 -0
- package/dist/management/shared-manager/types.js +57 -0
- package/dist/management/shared-manager/types.js.map +1 -0
- package/dist/management/shared-manager.d.ts +13 -160
- package/dist/management/shared-manager.d.ts.map +1 -1
- package/dist/management/shared-manager.js +18 -1294
- package/dist/management/shared-manager.js.map +1 -1
- package/dist/proxy/proxy-daemon-entry.js +1 -1
- package/dist/proxy/proxy-daemon-entry.js.map +1 -1
- package/dist/proxy/transformers/sse-stream-transformer.d.ts.map +1 -1
- package/dist/proxy/transformers/sse-stream-transformer.js +12 -17
- package/dist/proxy/transformers/sse-stream-transformer.js.map +1 -1
- package/dist/services/logging/index.d.ts +1 -1
- package/dist/services/logging/index.d.ts.map +1 -1
- package/dist/services/logging/index.js +6 -1
- package/dist/services/logging/index.js.map +1 -1
- package/dist/services/logging/log-context.d.ts +27 -2
- package/dist/services/logging/log-context.d.ts.map +1 -1
- package/dist/services/logging/log-context.js +43 -4
- package/dist/services/logging/log-context.js.map +1 -1
- package/dist/services/logging/log-redaction.d.ts +9 -0
- package/dist/services/logging/log-redaction.d.ts.map +1 -1
- package/dist/services/logging/log-redaction.js +31 -3
- package/dist/services/logging/log-redaction.js.map +1 -1
- package/dist/services/logging/logger.js +2 -2
- package/dist/services/logging/logger.js.map +1 -1
- package/dist/targets/codex-adapter.d.ts.map +1 -1
- package/dist/targets/codex-adapter.js +11 -10
- package/dist/targets/codex-adapter.js.map +1 -1
- package/dist/targets/droid-adapter.d.ts.map +1 -1
- package/dist/targets/droid-adapter.js +12 -12
- package/dist/targets/droid-adapter.js.map +1 -1
- package/dist/utils/image-analysis/mcp-installer.d.ts.map +1 -1
- package/dist/utils/image-analysis/mcp-installer.js +16 -13
- package/dist/utils/image-analysis/mcp-installer.js.map +1 -1
- package/dist/utils/websearch/mcp-installer.d.ts.map +1 -1
- package/dist/utils/websearch/mcp-installer.js +14 -12
- package/dist/utils/websearch/mcp-installer.js.map +1 -1
- package/dist/web-server/middleware/request-logging-middleware.d.ts.map +1 -1
- package/dist/web-server/middleware/request-logging-middleware.js +14 -9
- package/dist/web-server/middleware/request-logging-middleware.js.map +1 -1
- package/dist/web-server/routes/bar-routes.d.ts.map +1 -1
- package/dist/web-server/routes/bar-routes.js +11 -2
- package/dist/web-server/routes/bar-routes.js.map +1 -1
- package/dist/web-server/routes/claude-extension-routes.d.ts.map +1 -1
- package/dist/web-server/routes/claude-extension-routes.js +3 -2
- package/dist/web-server/routes/claude-extension-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.js +6 -4
- package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-stats-routes/config-routes.d.ts +16 -0
- package/dist/web-server/routes/cliproxy-stats-routes/config-routes.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/config-routes.js +219 -0
- package/dist/web-server/routes/cliproxy-stats-routes/config-routes.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.d.ts +12 -0
- package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.js +153 -0
- package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.d.ts +19 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.js +38 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.d.ts +13 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.js +195 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/restart-route.d.ts +17 -0
- package/dist/web-server/routes/cliproxy-stats-routes/restart-route.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/restart-route.js +34 -0
- package/dist/web-server/routes/cliproxy-stats-routes/restart-route.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/router.d.ts +10 -0
- package/dist/web-server/routes/cliproxy-stats-routes/router.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/router.js +245 -0
- package/dist/web-server/routes/cliproxy-stats-routes/router.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/shared.d.ts +35 -0
- package/dist/web-server/routes/cliproxy-stats-routes/shared.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/shared.js +59 -0
- package/dist/web-server/routes/cliproxy-stats-routes/shared.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.d.ts +44 -0
- package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.js +66 -0
- package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes.d.ts +16 -57
- package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-stats-routes.js +25 -926
- package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-sync-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-sync-routes.js +9 -2
- package/dist/web-server/routes/cliproxy-sync-routes.js.map +1 -1
- package/dist/web-server/routes/copilot-settings-routes.d.ts.map +1 -1
- package/dist/web-server/routes/copilot-settings-routes.js +2 -1
- package/dist/web-server/routes/copilot-settings-routes.js.map +1 -1
- package/dist/web-server/routes/image-analysis-routes.d.ts.map +1 -1
- package/dist/web-server/routes/image-analysis-routes.js +2 -1
- package/dist/web-server/routes/image-analysis-routes.js.map +1 -1
- package/dist/web-server/routes/persist-routes.d.ts.map +1 -1
- package/dist/web-server/routes/persist-routes.js +8 -1
- package/dist/web-server/routes/persist-routes.js.map +1 -1
- package/dist/web-server/routes/proxy-routes.d.ts.map +1 -1
- package/dist/web-server/routes/proxy-routes.js +33 -5
- package/dist/web-server/routes/proxy-routes.js.map +1 -1
- package/dist/web-server/routes/route-helpers.d.ts.map +1 -1
- package/dist/web-server/routes/route-helpers.js +10 -6
- package/dist/web-server/routes/route-helpers.js.map +1 -1
- package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
- package/dist/web-server/routes/settings-routes.js +7 -6
- package/dist/web-server/routes/settings-routes.js.map +1 -1
- package/dist/web-server/usage/aggregator.d.ts.map +1 -1
- package/dist/web-server/usage/aggregator.js +8 -8
- package/dist/web-server/usage/aggregator.js.map +1 -1
- package/dist/web-server/usage/handlers.d.ts.map +1 -1
- package/dist/web-server/usage/handlers.js +1 -1
- package/dist/web-server/usage/handlers.js.map +1 -1
- package/package.json +1 -1
- package/scripts/ci-parity-gate.sh +31 -0
- package/scripts/generate-throw-error-baseline.js +103 -0
- package/scripts/hardening-inventory.js +62 -4
- package/scripts/maintainability-metrics.js +356 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SharedManager orchestrator.
|
|
3
|
+
*
|
|
4
|
+
* Thin coordinator over the focused submodules under shared-manager/. The
|
|
5
|
+
* class is responsible ONLY for:
|
|
6
|
+
* 1. Resolving filesystem roots (homeDir, ccsDir, sharedDir, claudeDir,
|
|
7
|
+
* instancesDir) and the plugin-layout lock.
|
|
8
|
+
* 2. Forwarding every public method to the appropriate extracted helper,
|
|
9
|
+
* passing those roots explicitly.
|
|
10
|
+
*
|
|
11
|
+
* All behavior, signatures, and structured logging live in the submodules
|
|
12
|
+
* and are preserved exactly. This file deliberately contains no logic of
|
|
13
|
+
* its own.
|
|
14
|
+
*/
|
|
15
|
+
import type { AccountContextPolicy } from '../../auth/account-context';
|
|
16
|
+
/**
|
|
17
|
+
* SharedManager Class
|
|
18
|
+
*
|
|
19
|
+
* Manages symlinked shared directories for CCS. See submodule docs for the
|
|
20
|
+
* detailed behavior of each operation.
|
|
21
|
+
*/
|
|
22
|
+
declare class SharedManager {
|
|
23
|
+
private readonly homeDir;
|
|
24
|
+
private readonly sharedDir;
|
|
25
|
+
private readonly claudeDir;
|
|
26
|
+
private readonly instancesDir;
|
|
27
|
+
private readonly pluginLayoutLock;
|
|
28
|
+
constructor();
|
|
29
|
+
private get roots();
|
|
30
|
+
private get symlinkDeps();
|
|
31
|
+
/**
|
|
32
|
+
* Ensure shared directories exist as symlinks to ~/.claude/. Creates
|
|
33
|
+
* ~/.claude/ structure if missing.
|
|
34
|
+
*/
|
|
35
|
+
ensureSharedDirectories(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Link shared directories into an instance.
|
|
38
|
+
*/
|
|
39
|
+
linkSharedDirectories(instancePath: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Detach shared-directory symlinks from an instance.
|
|
42
|
+
*/
|
|
43
|
+
detachSharedDirectories(instancePath: string): void;
|
|
44
|
+
/**
|
|
45
|
+
* Sync project workspace context based on account policy.
|
|
46
|
+
*/
|
|
47
|
+
syncProjectContext(instancePath: string, policy: AccountContextPolicy): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Sync advanced continuity artifacts for shared deeper mode.
|
|
50
|
+
*/
|
|
51
|
+
syncAdvancedContinuityArtifacts(instancePath: string, policy: AccountContextPolicy): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Ensure all project memory directories for an instance are shared.
|
|
54
|
+
*/
|
|
55
|
+
syncProjectMemories(instancePath: string): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Normalize plugin metadata and reconcile marketplace metadata for the
|
|
58
|
+
* active config dir.
|
|
59
|
+
*/
|
|
60
|
+
normalizeSharedPluginMetadataPaths(configDir?: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Same as normalizeSharedPluginMetadataPaths but guarded by the
|
|
63
|
+
* plugin-layout named lock so concurrent instances cannot interleave.
|
|
64
|
+
*/
|
|
65
|
+
normalizeSharedPluginMetadataPathsLocked(configDir?: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Normalize installed_plugins.json paths to canonical ~/.claude/ paths.
|
|
68
|
+
*/
|
|
69
|
+
normalizePluginRegistryPaths(configDir?: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Reconcile marketplace registry content into the active config dir and
|
|
72
|
+
* keep the global ~/.claude copy up to date.
|
|
73
|
+
*/
|
|
74
|
+
normalizeMarketplaceRegistryPaths(configDir?: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* Migrate from v3.1.1 (copied data in ~/.ccs/shared/) to v3.2.0 (symlinks
|
|
77
|
+
* to ~/.claude/). Runs once on upgrade.
|
|
78
|
+
*/
|
|
79
|
+
migrateFromV311(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Migrate existing instances from isolated to shared settings.json
|
|
82
|
+
* (v4.4+). Runs once on upgrade.
|
|
83
|
+
*/
|
|
84
|
+
migrateToSharedSettings(): void;
|
|
85
|
+
}
|
|
86
|
+
export default SharedManager;
|
|
87
|
+
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/management/shared-manager/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAwBvE;;;;;GAKG;AACH,cAAM,aAAa;IACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,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
|
+
* class is responsible ONLY for:
|
|
7
|
+
* 1. Resolving filesystem roots (homeDir, ccsDir, sharedDir, claudeDir,
|
|
8
|
+
* instancesDir) and the plugin-layout lock.
|
|
9
|
+
* 2. Forwarding every public method to the appropriate extracted helper,
|
|
10
|
+
* passing those roots explicitly.
|
|
11
|
+
*
|
|
12
|
+
* All behavior, signatures, and structured logging live in the submodules
|
|
13
|
+
* and are preserved exactly. This file deliberately contains no logic of
|
|
14
|
+
* its own.
|
|
15
|
+
*/
|
|
16
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
20
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
21
|
+
}
|
|
22
|
+
Object.defineProperty(o, k2, desc);
|
|
23
|
+
}) : (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
o[k2] = m[k];
|
|
26
|
+
}));
|
|
27
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
28
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
29
|
+
}) : function(o, v) {
|
|
30
|
+
o["default"] = v;
|
|
31
|
+
});
|
|
32
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
|
+
};
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
const os = __importStar(require("os"));
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
const ui_1 = require("../../utils/ui");
|
|
46
|
+
const config_loader_facade_1 = require("../../config/config-loader-facade");
|
|
47
|
+
const profile_context_sync_lock_1 = __importDefault(require("../profile-context-sync-lock"));
|
|
48
|
+
const plugin_metadata_normalizer_1 = require("./plugin-metadata-normalizer");
|
|
49
|
+
const shared_dir_linker_1 = require("./shared-dir-linker");
|
|
50
|
+
const project_context_sync_1 = require("./project-context-sync");
|
|
51
|
+
const project_memory_sync_1 = require("./project-memory-sync");
|
|
52
|
+
const migrations_1 = require("./migrations");
|
|
53
|
+
/**
|
|
54
|
+
* SharedManager Class
|
|
55
|
+
*
|
|
56
|
+
* Manages symlinked shared directories for CCS. See submodule docs for the
|
|
57
|
+
* detailed behavior of each operation.
|
|
58
|
+
*/
|
|
59
|
+
class SharedManager {
|
|
60
|
+
constructor() {
|
|
61
|
+
this.homeDir = os.homedir();
|
|
62
|
+
const ccsDir = (0, config_loader_facade_1.getCcsDir)();
|
|
63
|
+
this.sharedDir = path.join(ccsDir, 'shared');
|
|
64
|
+
this.claudeDir = path.join(this.homeDir, '.claude');
|
|
65
|
+
this.instancesDir = path.join(ccsDir, 'instances');
|
|
66
|
+
this.pluginLayoutLock = new profile_context_sync_lock_1.default(this.instancesDir);
|
|
67
|
+
}
|
|
68
|
+
get roots() {
|
|
69
|
+
return {
|
|
70
|
+
claudeDir: this.claudeDir,
|
|
71
|
+
sharedDir: this.sharedDir,
|
|
72
|
+
instancesDir: this.instancesDir,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
get symlinkDeps() {
|
|
76
|
+
return { warn: ui_1.warn };
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Ensure shared directories exist as symlinks to ~/.claude/. Creates
|
|
80
|
+
* ~/.claude/ structure if missing.
|
|
81
|
+
*/
|
|
82
|
+
ensureSharedDirectories() {
|
|
83
|
+
(0, shared_dir_linker_1.ensureSharedDirectories)(this.roots);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Link shared directories into an instance.
|
|
87
|
+
*/
|
|
88
|
+
linkSharedDirectories(instancePath) {
|
|
89
|
+
(0, shared_dir_linker_1.linkSharedDirectories)(this.roots, instancePath);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Detach shared-directory symlinks from an instance.
|
|
93
|
+
*/
|
|
94
|
+
detachSharedDirectories(instancePath) {
|
|
95
|
+
(0, shared_dir_linker_1.detachSharedDirectories)(this.roots, instancePath);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Sync project workspace context based on account policy.
|
|
99
|
+
*/
|
|
100
|
+
async syncProjectContext(instancePath, policy) {
|
|
101
|
+
await (0, project_context_sync_1.syncProjectContext)(this.roots, instancePath, policy, this.symlinkDeps);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Sync advanced continuity artifacts for shared deeper mode.
|
|
105
|
+
*/
|
|
106
|
+
async syncAdvancedContinuityArtifacts(instancePath, policy) {
|
|
107
|
+
await (0, project_context_sync_1.syncAdvancedContinuityArtifacts)(this.roots, instancePath, policy, this.symlinkDeps);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Ensure all project memory directories for an instance are shared.
|
|
111
|
+
*/
|
|
112
|
+
async syncProjectMemories(instancePath) {
|
|
113
|
+
await (0, project_memory_sync_1.syncProjectMemories)(this.roots, instancePath, this.symlinkDeps);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Normalize plugin metadata and reconcile marketplace metadata for the
|
|
117
|
+
* active config dir.
|
|
118
|
+
*/
|
|
119
|
+
normalizeSharedPluginMetadataPaths(configDir) {
|
|
120
|
+
this.normalizePluginRegistryPaths(configDir);
|
|
121
|
+
this.normalizeMarketplaceRegistryPaths(configDir);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Same as normalizeSharedPluginMetadataPaths but guarded by the
|
|
125
|
+
* plugin-layout named lock so concurrent instances cannot interleave.
|
|
126
|
+
*/
|
|
127
|
+
normalizeSharedPluginMetadataPathsLocked(configDir) {
|
|
128
|
+
this.pluginLayoutLock.withNamedLockSync('__plugin-layout__', () => {
|
|
129
|
+
this.normalizeSharedPluginMetadataPaths(configDir);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Normalize installed_plugins.json paths to canonical ~/.claude/ paths.
|
|
134
|
+
*/
|
|
135
|
+
normalizePluginRegistryPaths(configDir) {
|
|
136
|
+
(0, plugin_metadata_normalizer_1.normalizePluginRegistryPaths)(this.roots, configDir);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Reconcile marketplace registry content into the active config dir and
|
|
140
|
+
* keep the global ~/.claude copy up to date.
|
|
141
|
+
*/
|
|
142
|
+
normalizeMarketplaceRegistryPaths(configDir) {
|
|
143
|
+
(0, plugin_metadata_normalizer_1.normalizeMarketplaceRegistryPaths)(this.roots, configDir);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Migrate from v3.1.1 (copied data in ~/.ccs/shared/) to v3.2.0 (symlinks
|
|
147
|
+
* to ~/.claude/). Runs once on upgrade.
|
|
148
|
+
*/
|
|
149
|
+
migrateFromV311() {
|
|
150
|
+
(0, migrations_1.migrateFromV311)(this.roots);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Migrate existing instances from isolated to shared settings.json
|
|
154
|
+
* (v4.4+). Runs once on upgrade.
|
|
155
|
+
*/
|
|
156
|
+
migrateToSharedSettings() {
|
|
157
|
+
(0, migrations_1.migrateToSharedSettings)(this.roots);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
exports.default = SharedManager;
|
|
161
|
+
//# sourceMappingURL=orchestrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/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IAED;;;OAGG;IACH,eAAe;QACb,IAAA,4BAAe,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,uBAAuB;QACrB,IAAA,oCAAuB,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACF;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SharedManager - plugin layout linking internals.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from shared-dir-linker.ts to keep each file focused and under
|
|
5
|
+
* the 400 LOC target. Owns the four plugin-layout primitives:
|
|
6
|
+
*
|
|
7
|
+
* - ensureSharedPluginLayoutDefaults: provision ~/.claude/plugins defaults
|
|
8
|
+
* - linkInstancePlugins: link shared plugin entries into an instance
|
|
9
|
+
* - getSharedPluginLinkItems: enumerate plugin entries to link
|
|
10
|
+
* - detachManagedPluginLayout: reverse link + reconcile local registry
|
|
11
|
+
*/
|
|
12
|
+
import type { PluginMetadataRoots } from './plugin-metadata-normalizer';
|
|
13
|
+
import type { SharedItem } from './types';
|
|
14
|
+
/**
|
|
15
|
+
* Roots for the plugin-layout internals. Same shape as PluginMetadataRoots.
|
|
16
|
+
*/
|
|
17
|
+
export type PluginLayoutRoots = PluginMetadataRoots;
|
|
18
|
+
/**
|
|
19
|
+
* Ensure the plugin layout default directories (cache, marketplaces) and
|
|
20
|
+
* registry files (installed_plugins.json, known_marketplaces.json) exist
|
|
21
|
+
* under ~/.claude/plugins.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ensureSharedPluginLayoutDefaults(claudeDir: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Link shared plugins directory entries into an instance, creating the
|
|
26
|
+
* instance plugins directory first if needed.
|
|
27
|
+
*/
|
|
28
|
+
export declare function linkInstancePlugins(roots: PluginLayoutRoots, instancePath: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Build the list of plugin entries to link from the shared plugins dir.
|
|
31
|
+
* Always includes the default SHARED_PLUGIN_ENTRIES; adds any additional
|
|
32
|
+
* entries physically present on disk, skipping instance-local metadata.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getSharedPluginLinkItems(sharedDir: string): SharedItem[];
|
|
35
|
+
/**
|
|
36
|
+
* Detach managed plugin layout from an instance. Removes the symlinked
|
|
37
|
+
* plugin entries that point back at the shared plugins dir and reconciles
|
|
38
|
+
* the local marketplace registry. Removes the plugins directory entirely
|
|
39
|
+
* if it ends up empty.
|
|
40
|
+
*/
|
|
41
|
+
export declare function detachManagedPluginLayout(roots: PluginLayoutRoots, instancePath: string): void;
|
|
42
|
+
//# sourceMappingURL=plugin-layout-internals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-layout-internals.d.ts","sourceRoot":"","sources":["../../../src/management/shared-manager/plugin-layout-internals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAOxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAsBxE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CA6CxF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,EAAE,CAgCxE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAgD9F"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SharedManager - plugin layout linking internals.
|
|
4
|
+
*
|
|
5
|
+
* Extracted from shared-dir-linker.ts to keep each file focused and under
|
|
6
|
+
* the 400 LOC target. Owns the four plugin-layout primitives:
|
|
7
|
+
*
|
|
8
|
+
* - ensureSharedPluginLayoutDefaults: provision ~/.claude/plugins defaults
|
|
9
|
+
* - linkInstancePlugins: link shared plugin entries into an instance
|
|
10
|
+
* - getSharedPluginLinkItems: enumerate plugin entries to link
|
|
11
|
+
* - detachManagedPluginLayout: reverse link + reconcile local registry
|
|
12
|
+
*/
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.detachManagedPluginLayout = exports.getSharedPluginLinkItems = exports.linkInstancePlugins = exports.ensureSharedPluginLayoutDefaults = void 0;
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const ui_1 = require("../../utils/ui");
|
|
41
|
+
const fs_helpers_1 = require("./fs-helpers");
|
|
42
|
+
const plugin_metadata_normalizer_1 = require("./plugin-metadata-normalizer");
|
|
43
|
+
const types_1 = require("./types");
|
|
44
|
+
/**
|
|
45
|
+
* Ensure the plugin layout default directories (cache, marketplaces) and
|
|
46
|
+
* registry files (installed_plugins.json, known_marketplaces.json) exist
|
|
47
|
+
* under ~/.claude/plugins.
|
|
48
|
+
*/
|
|
49
|
+
function ensureSharedPluginLayoutDefaults(claudeDir) {
|
|
50
|
+
const pluginsDir = path.join(claudeDir, 'plugins');
|
|
51
|
+
fs.mkdirSync(pluginsDir, { recursive: true, mode: 0o700 });
|
|
52
|
+
for (const entry of types_1.SHARED_PLUGIN_ENTRIES) {
|
|
53
|
+
const entryPath = path.join(pluginsDir, entry.name);
|
|
54
|
+
if (fs.existsSync(entryPath)) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (entry.type === 'directory') {
|
|
58
|
+
fs.mkdirSync(entryPath, { recursive: true, mode: 0o700 });
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
fs.writeFileSync(entryPath, types_1.DEFAULT_INSTALLED_PLUGIN_REGISTRY, 'utf8');
|
|
62
|
+
}
|
|
63
|
+
const marketplaceRegistryPath = path.join(pluginsDir, 'known_marketplaces.json');
|
|
64
|
+
if (!fs.existsSync(marketplaceRegistryPath)) {
|
|
65
|
+
fs.writeFileSync(marketplaceRegistryPath, JSON.stringify({}, null, 2), 'utf8');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.ensureSharedPluginLayoutDefaults = ensureSharedPluginLayoutDefaults;
|
|
69
|
+
/**
|
|
70
|
+
* Link shared plugins directory entries into an instance, creating the
|
|
71
|
+
* instance plugins directory first if needed.
|
|
72
|
+
*/
|
|
73
|
+
function linkInstancePlugins(roots, instancePath) {
|
|
74
|
+
const linkPath = path.join(instancePath, 'plugins');
|
|
75
|
+
const targetPath = path.join(roots.sharedDir, 'plugins');
|
|
76
|
+
let linkStats = null;
|
|
77
|
+
try {
|
|
78
|
+
linkStats = fs.lstatSync(linkPath);
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
if (err.code !== 'ENOENT') {
|
|
82
|
+
throw err;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (linkStats?.isSymbolicLink() || (linkStats && !linkStats.isDirectory())) {
|
|
86
|
+
(0, fs_helpers_1.removeExistingPath)(linkPath, linkStats.isDirectory() ? 'directory' : 'file');
|
|
87
|
+
}
|
|
88
|
+
if (!linkStats || !linkStats.isDirectory()) {
|
|
89
|
+
fs.mkdirSync(linkPath, { recursive: true, mode: 0o700 });
|
|
90
|
+
}
|
|
91
|
+
for (const item of getSharedPluginLinkItems(roots.sharedDir)) {
|
|
92
|
+
const targetEntryPath = path.join(targetPath, item.name);
|
|
93
|
+
const linkEntryPath = path.join(linkPath, item.name);
|
|
94
|
+
(0, fs_helpers_1.removeExistingPath)(linkEntryPath, item.type);
|
|
95
|
+
try {
|
|
96
|
+
const symlinkType = item.type === 'directory' ? 'dir' : 'file';
|
|
97
|
+
fs.symlinkSync(targetEntryPath, linkEntryPath, symlinkType);
|
|
98
|
+
}
|
|
99
|
+
catch (_err) {
|
|
100
|
+
if (process.platform === 'win32') {
|
|
101
|
+
if (item.type === 'directory') {
|
|
102
|
+
(0, fs_helpers_1.copyDirectoryFallback)(targetEntryPath, linkEntryPath);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
fs.copyFileSync(targetEntryPath, linkEntryPath);
|
|
106
|
+
}
|
|
107
|
+
console.log((0, ui_1.warn)(`Symlink failed for plugins/${item.name}, copied instead (enable Developer Mode)`));
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
throw _err;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.linkInstancePlugins = linkInstancePlugins;
|
|
116
|
+
/**
|
|
117
|
+
* Build the list of plugin entries to link from the shared plugins dir.
|
|
118
|
+
* Always includes the default SHARED_PLUGIN_ENTRIES; adds any additional
|
|
119
|
+
* entries physically present on disk, skipping instance-local metadata.
|
|
120
|
+
*/
|
|
121
|
+
function getSharedPluginLinkItems(sharedDir) {
|
|
122
|
+
const sharedPluginsPath = path.join(sharedDir, 'plugins');
|
|
123
|
+
const items = new Map(types_1.SHARED_PLUGIN_ENTRIES.map((entry) => [entry.name, { ...entry }]));
|
|
124
|
+
for (const entry of fs.readdirSync(sharedPluginsPath, { withFileTypes: true })) {
|
|
125
|
+
if (items.has(entry.name) || types_1.INSTANCE_LOCAL_PLUGIN_METADATA_FILES.has(entry.name)) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
const entryPath = path.join(sharedPluginsPath, entry.name);
|
|
129
|
+
let stats;
|
|
130
|
+
try {
|
|
131
|
+
stats = fs.statSync(entryPath);
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
const code = err.code;
|
|
135
|
+
console.log((0, ui_1.warn)(`Skipping plugins/${entry.name}: unable to inspect shared plugin entry${code ? ` (${code})` : ''}`));
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
items.set(entry.name, {
|
|
139
|
+
name: entry.name,
|
|
140
|
+
type: stats.isDirectory() ? 'directory' : 'file',
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return [...items.values()];
|
|
144
|
+
}
|
|
145
|
+
exports.getSharedPluginLinkItems = getSharedPluginLinkItems;
|
|
146
|
+
/**
|
|
147
|
+
* Detach managed plugin layout from an instance. Removes the symlinked
|
|
148
|
+
* plugin entries that point back at the shared plugins dir and reconciles
|
|
149
|
+
* the local marketplace registry. Removes the plugins directory entirely
|
|
150
|
+
* if it ends up empty.
|
|
151
|
+
*/
|
|
152
|
+
function detachManagedPluginLayout(roots, instancePath) {
|
|
153
|
+
const pluginsPath = path.join(instancePath, 'plugins');
|
|
154
|
+
if (!fs.existsSync(pluginsPath)) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const stats = fs.lstatSync(pluginsPath);
|
|
158
|
+
const sharedPluginsPath = path.join(roots.sharedDir, 'plugins');
|
|
159
|
+
if (stats.isSymbolicLink()) {
|
|
160
|
+
if ((0, fs_helpers_1.symlinkPointsTo)(pluginsPath, sharedPluginsPath)) {
|
|
161
|
+
(0, fs_helpers_1.removeExistingPath)(pluginsPath, 'directory');
|
|
162
|
+
}
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (!stats.isDirectory()) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
let removedManagedEntries = false;
|
|
169
|
+
for (const item of getSharedPluginLinkItems(roots.sharedDir)) {
|
|
170
|
+
const pluginEntryPath = path.join(pluginsPath, item.name);
|
|
171
|
+
if (!fs.existsSync(pluginEntryPath)) {
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
const entryStats = fs.lstatSync(pluginEntryPath);
|
|
175
|
+
if (!entryStats.isSymbolicLink()) {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if ((0, fs_helpers_1.symlinkPointsTo)(pluginEntryPath, path.join(sharedPluginsPath, item.name))) {
|
|
179
|
+
(0, fs_helpers_1.removeExistingPath)(pluginEntryPath, item.type);
|
|
180
|
+
removedManagedEntries = true;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (!removedManagedEntries) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
(0, plugin_metadata_normalizer_1.reconcileLocalMarketplaceRegistry)(roots, instancePath);
|
|
187
|
+
if (fs.readdirSync(pluginsPath).length === 0) {
|
|
188
|
+
fs.rmSync(pluginsPath, { recursive: true, force: true });
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
exports.detachManagedPluginLayout = detachManagedPluginLayout;
|
|
192
|
+
//# sourceMappingURL=plugin-layout-internals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-layout-internals.js","sourceRoot":"","sources":["../../../src/management/shared-manager/plugin-layout-internals.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAE7B,uCAAsC;AACtC,6CAA0F;AAE1F,6EAAiF;AACjF,mCAIiB;AAQjB;;;;GAIG;AACH,SAAgB,gCAAgC,CAAC,SAAiB;IAChE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACnD,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAE3D,KAAK,MAAM,KAAK,IAAI,6BAAqB,EAAE,CAAC;QAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,SAAS;QACX,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YAC/B,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YAC1D,SAAS;QACX,CAAC;QAED,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE,yCAAiC,EAAE,MAAM,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,uBAAuB,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,yBAAyB,CAAC,CAAC;IACjF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,C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AC;IAED,IAAA,8DAAiC,EAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAEvD,IAAI,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7C,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC;AAhDD,8DAgDC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SharedManager - plugin metadata normalization and marketplace reconciliation.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from the original monolithic shared-manager.ts. These helpers
|
|
5
|
+
* normalize installed_plugins.json and known_marketplaces.json contents so
|
|
6
|
+
* plugin metadata refers to canonical ~/.claude/ paths rather than
|
|
7
|
+
* instance-specific paths, and reconcile the marketplace registry against
|
|
8
|
+
* the on-disk marketplace directories.
|
|
9
|
+
*
|
|
10
|
+
* All filesystem roots (claudeDir, sharedDir, instancesDir) are passed
|
|
11
|
+
* explicitly to keep this module stateless and testable in isolation.
|
|
12
|
+
*/
|
|
13
|
+
import type { SharedItem } from './types';
|
|
14
|
+
/**
|
|
15
|
+
* Roots that plugin-metadata normalization operates on. The SharedManager
|
|
16
|
+
* orchestrator supplies its own private fields when constructing this
|
|
17
|
+
* object.
|
|
18
|
+
*/
|
|
19
|
+
export interface PluginMetadataRoots {
|
|
20
|
+
claudeDir: string;
|
|
21
|
+
sharedDir: string;
|
|
22
|
+
instancesDir: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Normalize every installed_plugins.json file reachable from the given roots
|
|
26
|
+
* so its embedded paths are canonical ~/.claude/ paths.
|
|
27
|
+
*/
|
|
28
|
+
export declare function normalizePluginRegistryPaths(roots: PluginMetadataRoots, configDir?: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Reconcile marketplace registry content into the active config dir while
|
|
31
|
+
* keeping the global ~/.claude copy up to date for non-instance flows.
|
|
32
|
+
*/
|
|
33
|
+
export declare function normalizeMarketplaceRegistryPaths(roots: PluginMetadataRoots, configDir?: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Discover physical marketplace directories on disk. Skips hidden dirs and
|
|
36
|
+
* Claude Code rename-dance leftovers (.staging/.bak).
|
|
37
|
+
*/
|
|
38
|
+
export declare function discoverMarketplaceEntries(targetConfigDir: string): Record<string, {
|
|
39
|
+
installLocation: string;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Write a plugin metadata file, creating parent dirs first and skipping
|
|
43
|
+
* when the content is unchanged.
|
|
44
|
+
*/
|
|
45
|
+
export declare function writePluginMetadataFile(registryPath: string, content: string, successMessage: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Reconcile the local marketplace registry against on-disk directories,
|
|
48
|
+
* removing the registry file entirely when no marketplaces remain and
|
|
49
|
+
* otherwise re-normalizing each entry.
|
|
50
|
+
*/
|
|
51
|
+
export declare function reconcileLocalMarketplaceRegistry(_roots: PluginMetadataRoots, configDir: string): void;
|
|
52
|
+
export type { SharedItem };
|
|
53
|
+
//# sourceMappingURL=plugin-metadata-normalizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-metadata-normalizer.d.ts","sourceRoot":"","sources":["../../../src/management/shared-manager/plugin-metadata-normalizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,mBAAmB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAQjG;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,mBAAmB,EAC1B,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAsBN;AAsID;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,GACtB,MAAM,CAAC,MAAM,EAAE;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC,CAuB7C;AAUD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,GACrB,IAAI,CAUN;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,MAAM,GAChB,IAAI,CA+CN;AAGD,YAAY,EAAE,UAAU,EAAE,CAAC"}
|