ccdeck 3.46.0 → 3.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -43
- package/bin/cli/startup.js +23 -0
- package/bin/deck.js +32 -1
- package/dist/web/assets/BrowserWatchModal-Bau0ttnH.js +1 -0
- package/dist/web/assets/IntegrationModal-8tTi25gA.js +6 -0
- package/dist/web/assets/{RadioPanel-biw_BbZq.js → RadioPanel-DbmJJPsz.js} +1 -1
- package/dist/web/assets/TrafficRadar-CPjAXd5e.js +8 -0
- package/dist/web/assets/{UsageHistoryModal-Bd-JRAa4.js → UsageHistoryModal-qfmvXdWJ.js} +1 -1
- package/dist/web/assets/app-BFFG6Wz8.js +321 -0
- package/dist/web/assets/app-DfcfHvcX.css +1 -0
- package/dist/web/assets/claude-settings-index-1Qg1AUda.js +1 -0
- package/dist/web/assets/{index-DmENqVdt.js → index-Ca87aJP9.js} +1 -1
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/release-notes.json +30 -0
- package/src/server/ccusage-install.mjs +58 -1
- package/src/server/ccusage-registry.mjs +289 -0
- package/src/server/ccusage-runner.mjs +9 -2
- package/src/server/claude-accounts.mjs +21 -0
- package/src/server/claude-login.mjs +21 -3
- package/src/server/claude-settings-catalog.d.mts +37 -0
- package/src/server/claude-settings-catalog.mjs +169 -0
- package/src/server/claude-settings-docs.mjs +109 -0
- package/src/server/claude-settings-index.json +251 -0
- package/src/server/claude-settings-routes.mjs +46 -0
- package/src/server/claude-settings.mjs +406 -0
- package/src/server/cli-arrival.mjs +64 -0
- package/src/server/index.mjs +18 -2
- package/src/server/integrations/proxy.mjs +11 -2
- package/src/server/integrations/routes.mjs +6 -4
- package/src/server/quota-close-watch.mjs +81 -0
- package/src/server/quota-closes.mjs +181 -0
- package/src/server/quota-history.mjs +8 -1
- package/src/server/quota-shape.mjs +12 -0
- package/src/server/quota.mjs +28 -1
- package/src/server/request-gates.mjs +3 -1
- package/src/server/tool-audit-operations.mjs +30 -10
- package/src/server/tool-audit-report.mjs +79 -7
- package/src/server/tool-audit-routes.mjs +1 -1
- package/src/server/tool-audit-skills.mjs +8 -3
- package/src/server/tool-audit.mjs +55 -5
- package/src/server/traffic-radar-capture.mjs +3 -3
- package/src/server/traffic-radar-config.mjs +10 -3
- package/src/server/traffic-radar-monitor.mjs +8 -5
- package/src/server/traffic-radar-permission.mjs +162 -0
- package/src/server/traffic-radar-platform.mjs +9 -3
- package/src/server/traffic-radar-routes.mjs +8 -18
- package/src/server/traffic-radar-service.mjs +76 -92
- package/src/server/usage-routes.mjs +14 -2
- package/dist/web/assets/BrowserWatchModal-CoX9FIUE.js +0 -1
- package/dist/web/assets/IntegrationModal-B1ypkK-E.js +0 -5
- package/dist/web/assets/TrafficRadar-nhtFoYVv.js +0 -8
- package/dist/web/assets/app-BlRY6EME.css +0 -1
- package/dist/web/assets/app-DhGvSH7o.js +0 -319
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="https://code.claude.com/docs/en/settings-reference.md",n=JSON.parse('[{"key":"advisorModel","topic":"Model and responses","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"advisormodel"},{"key":"alwaysThinkingEnabled","topic":"Model and responses","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"alwaysthinkingenabled"},{"key":"availableModels","topic":"Model and responses","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"availablemodels"},{"key":"availableModelsMatch","topic":"Model and responses","scope":"Managed","kind":"choice","options":["prefix","exact"],"default":"\\"prefix\\"","since":"2.1.283","anchor":"availablemodelsmatch"},{"key":"deniedModels","topic":"Model and responses","scope":"Managed","kind":"structured","default":null,"since":"2.1.283","anchor":"deniedmodels"},{"key":"effortLevel","topic":"Model and responses","scope":"Any file","kind":"choice","options":["low","medium","high","xhigh"],"default":"unset","since":null,"anchor":"effortlevel"},{"key":"enforceAvailableModels","topic":"Model and responses","scope":"Any file","kind":"boolean","default":"false","since":"2.1.175","anchor":"enforceavailablemodels"},{"key":"fallbackModel","topic":"Model and responses","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"fallbackmodel"},{"key":"fastMode","topic":"Model and responses","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"fastmode"},{"key":"fastModePerSessionOptIn","topic":"Model and responses","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"fastmodepersessionoptin"},{"key":"language","topic":"Model and responses","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"language"},{"key":"maxEffortLevel","topic":"Model and responses","scope":"Any file","kind":"text","default":null,"since":"2.1.267","anchor":"maxeffortlevel"},{"key":"model","topic":"Model and responses","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"model"},{"key":"modelOverrides","topic":"Model and responses","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"modeloverrides"},{"key":"modelPicker","topic":"Model and responses","scope":"User or managed","kind":"structured","default":null,"since":"2.1.242","anchor":"modelpicker"},{"key":"modelPricing","topic":"Model and responses","scope":"Managed","kind":"structured","default":null,"since":"2.1.242","anchor":"modelpricing"},{"key":"modelSettings","topic":"Model and responses","scope":"Any file","kind":"structured","default":"unset","since":"2.1.251","anchor":"modelsettings"},{"key":"outputStyle","topic":"Model and responses","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"outputstyle"},{"key":"promptCacheTtl","topic":"Model and responses","scope":"Any file","kind":"choice","options":["5m","1h"],"default":null,"since":"2.1.242","anchor":"promptcachettl"},{"key":"showThinkingSummaries","topic":"Model and responses","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"showthinkingsummaries"},{"key":"subagentPromptCacheTtl","topic":"Model and responses","scope":"Any file","kind":"choice","options":["5m","1h"],"default":null,"since":"2.1.242","anchor":"subagentpromptcachettl"},{"key":"switchModelsOnFlag","topic":"Model and responses","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"switchmodelsonflag"},{"key":"ultracode","topic":"Model and responses","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"ultracode"},{"key":"allowManagedPermissionRulesOnly","topic":"Permission settings","scope":"Managed","kind":"boolean","default":null,"since":null,"anchor":"allowmanagedpermissionrulesonly"},{"key":"autoMode","topic":"Permission settings","scope":"User or managed","kind":"structured","default":null,"since":null,"anchor":"automode"},{"key":"autoMode.classifyAllShell","topic":"Permission settings","scope":"User or managed","kind":"boolean","default":"false","since":"2.1.193","anchor":"automode-classifyallshell"},{"key":"disableAutoMode","topic":"Permission settings","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"disableautomode"},{"key":"permissions","topic":"Permission settings","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"permissions"},{"key":"useAutoModeDuringPlan","topic":"Permission settings","scope":"User, local, or managed","kind":"boolean","default":"true","since":null,"anchor":"useautomodeduringplan"},{"key":"permissions.allow","topic":"Permission settings","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"permissions-allow"},{"key":"permissions.ask","topic":"Permission settings","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"permissions-ask"},{"key":"permissions.deny","topic":"Permission settings","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"permissions-deny"},{"key":"permissions.additionalDirectories","topic":"Permission settings","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"permissions-additionaldirectories"},{"key":"permissions.blockReadsOutsideWorkingDirectories","topic":"Permission settings","scope":"Any file","kind":"boolean","default":null,"since":"2.1.257","anchor":"permissions-blockreadsoutsideworkingdirectories"},{"key":"permissions.defaultMode","topic":"Permission settings","scope":"Any file","kind":"choice","options":["default","acceptEdits","plan","auto","dontAsk","bypassPermissions","manual"],"default":"unset","since":null,"anchor":"permissions-defaultmode"},{"key":"permissions.disableBypassPermissionsMode","topic":"Permission settings","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"permissions-disablebypasspermissionsmode"},{"key":"skipAutoPermissionPrompt","topic":"Permission settings","scope":"User or managed","kind":"boolean","default":null,"since":null,"anchor":"skipautopermissionprompt"},{"key":"skipDangerousModePermissionPrompt","topic":"Permission settings","scope":"User, local, or managed","kind":"boolean","default":null,"since":null,"anchor":"skipdangerousmodepermissionprompt"},{"key":"sandbox","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"sandbox"},{"key":"sandbox.enabled","topic":"Sandbox settings","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"sandbox-enabled"},{"key":"sandbox.failIfUnavailable","topic":"Sandbox settings","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"sandbox-failifunavailable"},{"key":"sandbox.autoAllowBashIfSandboxed","topic":"Sandbox settings","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"sandbox-autoallowbashifsandboxed"},{"key":"sandbox.excludedCommands","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"sandbox-excludedcommands"},{"key":"sandbox.allowUnsandboxedCommands","topic":"Sandbox settings","scope":"Any file","kind":"boolean","default":"true","since":"2.1.285","anchor":"sandbox-allowunsandboxedcommands"},{"key":"sandbox.filesystem","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"sandbox-filesystem"},{"key":"sandbox.filesystem.allowWrite","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"sandbox-filesystem-allowwrite"},{"key":"sandbox.filesystem.denyWrite","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"sandbox-filesystem-denywrite"},{"key":"sandbox.filesystem.denyRead","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"sandbox-filesystem-denyread"},{"key":"sandbox.filesystem.allowRead","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"sandbox-filesystem-allowread"},{"key":"sandbox.filesystem.allowManagedReadPathsOnly","topic":"Sandbox settings","scope":"Managed","kind":"boolean","default":"false","since":null,"anchor":"sandbox-filesystem-allowmanagedreadpathsonly"},{"key":"sandbox.filesystem.disabled","topic":"Sandbox settings","scope":"User or managed","kind":"boolean","default":null,"since":"2.1.216","anchor":"sandbox-filesystem-disabled"},{"key":"sandbox.ignoreViolations","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"sandbox-ignoreviolations"},{"key":"sandbox.enableWeakerNestedSandbox","topic":"Sandbox settings","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"sandbox-enableweakernestedsandbox"},{"key":"sandbox.enableWeakerNetworkIsolation","topic":"Sandbox settings","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"sandbox-enableweakernetworkisolation"},{"key":"sandbox.allowAppleEvents","topic":"Sandbox settings","scope":"User or managed","kind":"boolean","default":"false","since":null,"anchor":"sandbox-allowappleevents"},{"key":"sandbox.allowNestedUserNamespaces","topic":"Sandbox settings","scope":"User or managed","kind":"boolean","default":"false","since":"2.1.305","anchor":"sandbox-allownestedusernamespaces"},{"key":"sandbox.ripgrep","topic":"Sandbox settings","scope":"User or managed","kind":"structured","default":null,"since":null,"anchor":"sandbox-ripgrep"},{"key":"sandbox.bwrapPath","topic":"Sandbox settings","scope":"Managed","kind":"text","default":null,"since":null,"anchor":"sandbox-bwrappath"},{"key":"sandbox.socatPath","topic":"Sandbox settings","scope":"Managed","kind":"text","default":null,"since":null,"anchor":"sandbox-socatpath"},{"key":"sandbox.credentials","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"sandbox-credentials"},{"key":"sandbox.credentials.files","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":"2.1.221","anchor":"sandbox-credentials-files"},{"key":"sandbox.credentials.envVars","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"sandbox-credentials-envvars"},{"key":"sandbox.credentials.allowPlaintextInject","topic":"Sandbox settings","scope":"User or managed","kind":"boolean","default":"false","since":null,"anchor":"sandbox-credentials-allowplaintextinject"},{"key":"sandbox.credentials.awsPairs","topic":"Sandbox settings","scope":"User or managed","kind":"structured","default":null,"since":"2.1.224","anchor":"sandbox-credentials-awspairs"},{"key":"sandbox.credentials.sigv4","topic":"Sandbox settings","scope":"User or managed","kind":"structured","default":null,"since":"2.1.224","anchor":"sandbox-credentials-sigv4"},{"key":"sandbox.network","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"sandbox-network"},{"key":"sandbox.network.allowUnixSockets","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"sandbox-network-allowunixsockets"},{"key":"sandbox.network.allowAllUnixSockets","topic":"Sandbox settings","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"sandbox-network-allowallunixsockets"},{"key":"sandbox.network.allowLocalBinding","topic":"Sandbox settings","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"sandbox-network-allowlocalbinding"},{"key":"sandbox.network.allowMachLookup","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"sandbox-network-allowmachlookup"},{"key":"sandbox.network.allowedDomains","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":null,"since":"2.1.229","anchor":"sandbox-network-alloweddomains"},{"key":"sandbox.network.deniedDomains","topic":"Sandbox settings","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"sandbox-network-denieddomains"},{"key":"sandbox.network.strictAllowlist","topic":"Sandbox settings","scope":"User or managed","kind":"boolean","default":"false","since":"2.1.219","anchor":"sandbox-network-strictallowlist"},{"key":"sandbox.network.allowManagedDomainsOnly","topic":"Sandbox settings","scope":"Managed","kind":"boolean","default":"false","since":null,"anchor":"sandbox-network-allowmanageddomainsonly"},{"key":"sandbox.network.httpProxyPort","topic":"Sandbox settings","scope":"Any file","kind":"number","default":null,"since":null,"anchor":"sandbox-network-httpproxyport"},{"key":"sandbox.network.socksProxyPort","topic":"Sandbox settings","scope":"Any file","kind":"number","default":null,"since":null,"anchor":"sandbox-network-socksproxyport"},{"key":"sandbox.network.tlsTerminate","topic":"Sandbox settings","scope":"User or managed","kind":"structured","default":null,"since":null,"anchor":"sandbox-network-tlsterminate"},{"key":"autoCompactEnabled","topic":"Memory and context","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"autocompactenabled"},{"key":"autoCompactWindow","topic":"Memory and context","scope":"Any file","kind":"number","default":null,"since":null,"anchor":"autocompactwindow"},{"key":"autoMemoryDirectory","topic":"Memory and context","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"automemorydirectory"},{"key":"autoMemoryEnabled","topic":"Memory and context","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"automemoryenabled"},{"key":"bashOutputMaxChars","topic":"Memory and context","scope":"Any file","kind":"number","default":null,"since":"2.1.261","anchor":"bashoutputmaxchars"},{"key":"claudeMd","topic":"Memory and context","scope":"Managed","kind":"text","default":"unset","since":null,"anchor":"claudemd"},{"key":"claudeMdExcludes","topic":"Memory and context","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"claudemdexcludes"},{"key":"env","topic":"Memory and context","scope":"Any file","kind":"structured","default":"unset","since":"2.1.224","anchor":"env"},{"key":"fileCheckpointingEnabled","topic":"Memory and context","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"filecheckpointingenabled"},{"key":"idleCompaction","topic":"Memory and context","scope":"Any file","kind":"boolean","default":"true","since":"2.1.290","anchor":"idlecompaction"},{"key":"plansDirectory","topic":"Memory and context","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"plansdirectory"},{"key":"skillListingBudgetFraction","topic":"Memory and context","scope":"Any file","kind":"number","default":null,"since":null,"anchor":"skilllistingbudgetfraction"},{"key":"skillListingMaxDescChars","topic":"Memory and context","scope":"Any file","kind":"number","default":"1536","since":null,"anchor":"skilllistingmaxdescchars"},{"key":"taskOutputMaxChars","topic":"Memory and context","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"taskoutputmaxchars"},{"key":"askUserQuestionTimeout","topic":"Interface and terminal","scope":"User or managed","kind":"text","default":"\\"never\\"","since":null,"anchor":"askuserquestiontimeout"},{"key":"autoContinueAtUsageLimit","topic":"Interface and terminal","scope":"User or managed","kind":"boolean","default":"true","since":"2.1.234","anchor":"autocontinueatusagelimit"},{"key":"autoScrollEnabled","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"autoscrollenabled"},{"key":"axScreenReader","topic":"Interface and terminal","scope":"User or managed","kind":"boolean","default":null,"since":null,"anchor":"axscreenreader"},{"key":"bashEditDiffEnabled","topic":"Interface and terminal","scope":"User or managed","kind":"boolean","default":null,"since":"2.1.269","anchor":"basheditdiffenabled"},{"key":"companyAnnouncements","topic":"Interface and terminal","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"companyannouncements"},{"key":"defaultShell","topic":"Interface and terminal","scope":"Any file","kind":"choice","options":["bash","powershell"],"default":null,"since":null,"anchor":"defaultshell"},{"key":"dialogExpiry","topic":"Interface and terminal","scope":"User or managed","kind":"text","default":"\\"5m\\"","since":"2.1.224","anchor":"dialogexpiry"},{"key":"editorMode","topic":"Interface and terminal","scope":"Any file","kind":"choice","options":["normal","vim"],"default":"\\"normal\\"","since":null,"anchor":"editormode"},{"key":"emojiCompletionEnabled","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"true","since":"2.1.217","anchor":"emojicompletionenabled"},{"key":"fileSuggestion","topic":"Interface and terminal","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"filesuggestion"},{"key":"footerLinksRegexes","topic":"Interface and terminal","scope":"User or managed","kind":"structured","default":null,"since":null,"anchor":"footerlinksregexes"},{"key":"keybindingFlavor","topic":"Interface and terminal","scope":"Any file","kind":"text","default":"unset","since":null,"anchor":"keybindingflavor"},{"key":"maxProseWidth","topic":"Interface and terminal","scope":"Any file","kind":"number","default":null,"since":"2.1.282","anchor":"maxprosewidth"},{"key":"prefersReducedMotion","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"prefersreducedmotion"},{"key":"promptSuggestionEnabled","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"promptsuggestionenabled"},{"key":"respectGitignore","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"respectgitignore"},{"key":"respondToBashCommands","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"respondtobashcommands"},{"key":"showClearContextOnPlanAccept","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"showclearcontextonplanaccept"},{"key":"showTurnDuration","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"showturnduration"},{"key":"spellcheck","topic":"Interface and terminal","scope":"User or managed","kind":"structured","default":null,"since":"2.1.235","anchor":"spellcheck"},{"key":"spinnerTipsEnabled","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"spinnertipsenabled"},{"key":"spinnerTipsOverride","topic":"Interface and terminal","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"spinnertipsoverride"},{"key":"spinnerVerbs","topic":"Interface and terminal","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"spinnerverbs"},{"key":"statusLine","topic":"Interface and terminal","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"statusline"},{"key":"subagentStatusLine","topic":"Interface and terminal","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"subagentstatusline"},{"key":"syntaxHighlightingDisabled","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"syntaxhighlightingdisabled"},{"key":"terminalProgressBarEnabled","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"terminalprogressbarenabled"},{"key":"terminalTitleFromRename","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"terminaltitlefromrename"},{"key":"theme","topic":"Interface and terminal","scope":"Any file","kind":"choice","options":["auto","dark","light","dark-daltonized","light-daltonized","dark-ansi","light-ansi","custom:<slug>"],"default":"\\"dark\\"","since":null,"anchor":"theme"},{"key":"timeFormat","topic":"Interface and terminal","scope":"Any file","kind":"choice","options":["auto","12-hour","24-hour","24-hour-utc"],"default":"\\"auto\\"","since":"2.1.257","anchor":"timeformat"},{"key":"timeZone","topic":"Interface and terminal","scope":"Any file","kind":"text","default":null,"since":"2.1.257","anchor":"timezone"},{"key":"tui","topic":"Interface and terminal","scope":"Any file","kind":"choice","options":["default","fullscreen"],"default":null,"since":null,"anchor":"tui"},{"key":"verbose","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"verbose"},{"key":"viewMode","topic":"Interface and terminal","scope":"Any file","kind":"choice","options":["default","verbose","focus"],"default":null,"since":null,"anchor":"viewmode"},{"key":"vimInsertModeRemaps","topic":"Interface and terminal","scope":"User or managed","kind":"structured","default":"unset","since":null,"anchor":"viminsertmoderemaps"},{"key":"voice","topic":"Interface and terminal","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"voice"},{"key":"voiceEnabled","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"unset","since":null,"anchor":"voiceenabled"},{"key":"wheelScrollAccelerationEnabled","topic":"Interface and terminal","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"wheelscrollaccelerationenabled"},{"key":"attribution","topic":"Git and attribution","scope":"Any file","kind":"structured","default":null,"since":"2.1.281","anchor":"attribution"},{"key":"includeCoAuthoredBy","topic":"Git and attribution","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"includecoauthoredby"},{"key":"includeGitInstructions","topic":"Git and attribution","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"includegitinstructions"},{"key":"prUrlTemplate","topic":"Git and attribution","scope":"Any file","kind":"text","default":"unset","since":null,"anchor":"prurltemplate"},{"key":"attribution.commit","topic":"Git and attribution","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"attribution-commit"},{"key":"attribution.pr","topic":"Git and attribution","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"attribution-pr"},{"key":"attribution.sessionUrl","topic":"Git and attribution","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"attribution-sessionurl"},{"key":"allowedHttpHookUrls","topic":"Hooks and automation","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"allowedhttphookurls"},{"key":"allowManagedHooksOnly","topic":"Hooks and automation","scope":"Managed","kind":"boolean","default":null,"since":"2.1.238","anchor":"allowmanagedhooksonly"},{"key":"disableAllHooks","topic":"Hooks and automation","scope":"Any file","kind":"boolean","default":null,"since":"2.1.242","anchor":"disableallhooks"},{"key":"disableWorkflows","topic":"Hooks and automation","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"disableworkflows"},{"key":"enableWorkflows","topic":"Hooks and automation","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"enableworkflows"},{"key":"hooks","topic":"Hooks and automation","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"hooks"},{"key":"httpHookAllowedEnvVars","topic":"Hooks and automation","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"httphookallowedenvvars"},{"key":"workflowKeywordTriggerEnabled","topic":"Hooks and automation","scope":"Any file","kind":"boolean","default":"true","since":null,"anchor":"workflowkeywordtriggerenabled"},{"key":"workflowSizeGuideline","topic":"Hooks and automation","scope":"Any file","kind":"choice","options":["unrestricted","small","medium","large"],"default":null,"since":"2.1.219","anchor":"workflowsizeguideline"},{"key":"disableBundledSkills","topic":"Plugins and skills","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"disablebundledskills"},{"key":"disableSkillShellExecution","topic":"Plugins and skills","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"disableskillshellexecution"},{"key":"skillOverrides","topic":"Plugins and skills","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"skilloverrides"},{"key":"syncClaudeAiSkills","topic":"Plugins and skills","scope":"User, local, or managed","kind":"boolean","default":null,"since":null,"anchor":"syncclaudeaiskills"},{"key":"syncClaudeAiPlugins","topic":"Plugins and skills","scope":"User, local, or managed","kind":"boolean","default":null,"since":"2.1.273","anchor":"syncclaudeaiplugins"},{"key":"allowedChannelPlugins","topic":"Plugins and skills","scope":"Managed","kind":"structured","default":null,"since":"2.1.267","anchor":"allowedchannelplugins"},{"key":"blockedMarketplaces","topic":"Plugins and skills","scope":"Managed","kind":"structured","default":null,"since":"2.1.223","anchor":"blockedmarketplaces"},{"key":"channelsEnabled","topic":"Plugins and skills","scope":"Managed","kind":"boolean","default":null,"since":null,"anchor":"channelsenabled"},{"key":"disableCommandPluginSources","topic":"Plugins and skills","scope":"Managed","kind":"boolean","default":null,"since":"2.1.229","anchor":"disablecommandpluginsources"},{"key":"pluginSuggestionMarketplaces","topic":"Plugins and skills","scope":"Managed","kind":"structured","default":null,"since":null,"anchor":"pluginsuggestionmarketplaces"},{"key":"pluginTrustMessage","topic":"Plugins and skills","scope":"Managed","kind":"text","default":null,"since":null,"anchor":"plugintrustmessage"},{"key":"strictKnownMarketplaces","topic":"Plugins and skills","scope":"Managed","kind":"structured","default":null,"since":null,"anchor":"strictknownmarketplaces"},{"key":"strictPluginOnlyCustomization","topic":"Plugins and skills","scope":"Managed","kind":"structured","default":null,"since":null,"anchor":"strictpluginonlycustomization"},{"key":"strictPluginOnlyCustomization.skills","topic":"Plugins and skills","scope":"Managed","kind":"structured","default":null,"since":null,"anchor":"strictpluginonlycustomization-skills"},{"key":"strictPluginOnlyCustomization.agents","topic":"Plugins and skills","scope":"Managed","kind":"structured","default":null,"since":null,"anchor":"strictpluginonlycustomization-agents"},{"key":"strictPluginOnlyCustomization.hooks","topic":"Plugins and skills","scope":"Managed","kind":"structured","default":null,"since":null,"anchor":"strictpluginonlycustomization-hooks"},{"key":"strictPluginOnlyCustomization.mcp","topic":"Plugins and skills","scope":"Managed","kind":"structured","default":null,"since":null,"anchor":"strictpluginonlycustomization-mcp"},{"key":"enabledPlugins","topic":"Plugins and skills","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"enabledplugins"},{"key":"extraKnownMarketplaces","topic":"Plugins and skills","scope":"Any file","kind":"structured","default":"unset","since":"2.1.238","anchor":"extraknownmarketplaces"},{"key":"pluginConfigs","topic":"Plugins and skills","scope":"User or managed","kind":"structured","default":"unset","since":null,"anchor":"pluginconfigs"},{"key":"prependPlugins","topic":"Plugins and skills","scope":"User or managed","kind":"structured","default":"unset","since":null,"anchor":"prependplugins"},{"key":"appendPlugins","topic":"Plugins and skills","scope":"User or managed","kind":"structured","default":"unset","since":null,"anchor":"appendplugins"},{"key":"allowAllClaudeAiMcps","topic":"MCP","scope":"Managed","kind":"boolean","default":null,"since":null,"anchor":"allowallclaudeaimcps"},{"key":"allowClaudeInChromeWithManagedMcp","topic":"MCP","scope":"Managed","kind":"boolean","default":null,"since":"2.1.282","anchor":"allowclaudeinchromewithmanagedmcp"},{"key":"allowedMcpServers","topic":"MCP","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"allowedmcpservers"},{"key":"allowManagedMcpServersOnly","topic":"MCP","scope":"Managed","kind":"boolean","default":null,"since":null,"anchor":"allowmanagedmcpserversonly"},{"key":"deniedMcpServers","topic":"MCP","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"deniedmcpservers"},{"key":"disableClaudeAiConnectors","topic":"MCP","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"disableclaudeaiconnectors"},{"key":"disabledMcpjsonServers","topic":"MCP","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"disabledmcpjsonservers"},{"key":"enableAllProjectMcpServers","topic":"MCP","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"enableallprojectmcpservers"},{"key":"enabledMcpjsonServers","topic":"MCP","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"enabledmcpjsonservers"},{"key":"managedMcpServers","topic":"MCP","scope":"Managed","kind":"structured","default":null,"since":"2.1.259","anchor":"managedmcpservers"},{"key":"agent","topic":"Agents, sessions, and worktrees","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"agent"},{"key":"crossSessionInbound","topic":"Agents, sessions, and worktrees","scope":"Any file","kind":"choice","options":["accept","hold","refuse"],"default":null,"since":"2.1.224","anchor":"crosssessioninbound"},{"key":"disableAgentView","topic":"Agents, sessions, and worktrees","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"disableagentview"},{"key":"isolatePeerMachines","topic":"Agents, sessions, and worktrees","scope":"Any file","kind":"boolean","default":null,"since":"2.1.224","anchor":"isolatepeermachines"},{"key":"processWrapper","topic":"Agents, sessions, and worktrees","scope":"User or managed","kind":"text","default":null,"since":"2.1.210","anchor":"processwrapper"},{"key":"teammateMode","topic":"Agents, sessions, and worktrees","scope":"Any file","kind":"choice","options":["in-process","auto","tmux","iterm2"],"default":"\\"in-process\\"","since":null,"anchor":"teammatemode"},{"key":"worktree","topic":"Agents, sessions, and worktrees","scope":"Any file","kind":"structured","default":"unset","since":null,"anchor":"worktree"},{"key":"worktree.baseRef","topic":"Agents, sessions, and worktrees","scope":"Any file","kind":"choice","options":["fresh","head"],"default":"\\"fresh\\"","since":null,"anchor":"worktree-baseref"},{"key":"worktree.symlinkDirectories","topic":"Agents, sessions, and worktrees","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"worktree-symlinkdirectories"},{"key":"worktree.sparsePaths","topic":"Agents, sessions, and worktrees","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"worktree-sparsepaths"},{"key":"worktree.bgIsolation","topic":"Agents, sessions, and worktrees","scope":"Any file","kind":"choice","options":["worktree","none"],"default":"\\"worktree\\"","since":null,"anchor":"worktree-bgisolation"},{"key":"worktree.location","topic":"Agents, sessions, and worktrees","scope":"User","kind":"text","default":null,"since":null,"anchor":"worktree-location"},{"key":"agentPushNotifEnabled","topic":"Remote, desktop, and notifications","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"agentpushnotifenabled"},{"key":"awaySummaryEnabled","topic":"Remote, desktop, and notifications","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"awaysummaryenabled"},{"key":"disableArtifact","topic":"Remote, desktop, and notifications","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"disableartifact"},{"key":"disableDeepLinkRegistration","topic":"Remote, desktop, and notifications","scope":"Any file","kind":"structured","default":null,"since":null,"anchor":"disabledeeplinkregistration"},{"key":"disableDesktopLocalSessions","topic":"Remote, desktop, and notifications","scope":"Managed","kind":"boolean","default":null,"since":null,"anchor":"disabledesktoplocalsessions"},{"key":"disableRemoteControl","topic":"Remote, desktop, and notifications","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"disableremotecontrol"},{"key":"enableArtifact","topic":"Remote, desktop, and notifications","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"enableartifact"},{"key":"inputNeededNotifEnabled","topic":"Remote, desktop, and notifications","scope":"Any file","kind":"boolean","default":"false","since":null,"anchor":"inputneedednotifenabled"},{"key":"preferredNotifChannel","topic":"Remote, desktop, and notifications","scope":"Any file","kind":"choice","options":["auto","terminal_bell","iterm2","iterm2_with_bell","kitty","ghostty","notifications_disabled"],"default":"\\"auto\\"","since":null,"anchor":"preferrednotifchannel"},{"key":"remote.defaultEnvironmentId","topic":"Remote, desktop, and notifications","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"remote-defaultenvironmentid"},{"key":"remoteControlAtStartup","topic":"Remote, desktop, and notifications","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"remotecontrolatstartup"},{"key":"sshConfigs","topic":"Remote, desktop, and notifications","scope":"User or managed","kind":"structured","default":"unset","since":null,"anchor":"sshconfigs"},{"key":"sshHostAllowlist","topic":"Remote, desktop, and notifications","scope":"Managed","kind":"structured","default":null,"since":null,"anchor":"sshhostallowlist"},{"key":"allowedProviders","topic":"Authentication and providers","scope":"Managed","kind":"structured","default":null,"since":"2.1.285","anchor":"allowedproviders"},{"key":"apiKeyHelper","topic":"Authentication and providers","scope":"Any file","kind":"text","default":null,"since":"2.1.246","anchor":"apikeyhelper"},{"key":"awsAuthRefresh","topic":"Authentication and providers","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"awsauthrefresh"},{"key":"awsCredentialExport","topic":"Authentication and providers","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"awscredentialexport"},{"key":"forceLoginMethod","topic":"Authentication and providers","scope":"Any file","kind":"choice","options":["claudeai","console","gateway"],"default":null,"since":null,"anchor":"forceloginmethod"},{"key":"forceLoginGatewayUrl","topic":"Authentication and providers","scope":"User or managed","kind":"text","default":null,"since":null,"anchor":"forcelogingatewayurl"},{"key":"forceLoginOrgUUID","topic":"Authentication and providers","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"forceloginorguuid"},{"key":"gatewayInternalNetworks","topic":"Authentication and providers","scope":"Managed","kind":"structured","default":null,"since":"2.1.268","anchor":"gatewayinternalnetworks"},{"key":"gcpAuthRefresh","topic":"Authentication and providers","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"gcpauthrefresh"},{"key":"otelHeadersHelper","topic":"Authentication and providers","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"otelheadershelper"},{"key":"autoUpdatesChannel","topic":"Updates and versioning","scope":"Any file","kind":"choice","options":["latest","stable"],"default":null,"since":null,"anchor":"autoupdateschannel"},{"key":"minimumVersion","topic":"Updates and versioning","scope":"Any file","kind":"text","default":null,"since":null,"anchor":"minimumversion"},{"key":"requiredMaximumVersion","topic":"Updates and versioning","scope":"Managed","kind":"text","default":null,"since":"2.1.163","anchor":"requiredmaximumversion"},{"key":"requiredMinimumVersion","topic":"Updates and versioning","scope":"Managed","kind":"text","default":null,"since":"2.1.163","anchor":"requiredminimumversion"},{"key":"browserExternalPageTools","topic":"Tools","scope":"Managed","kind":"text","default":null,"since":null,"anchor":"browserexternalpagetools"},{"key":"disableBrowserExternalNavigation","topic":"Tools","scope":"Managed","kind":"boolean","default":null,"since":null,"anchor":"disablebrowserexternalnavigation"},{"key":"disableMobileSimulatorTools","topic":"Tools","scope":"Managed","kind":"boolean","default":null,"since":null,"anchor":"disablemobilesimulatortools"},{"key":"cleanupPeriodDays","topic":"Privacy and telemetry","scope":"Any file","kind":"number","default":"30","since":null,"anchor":"cleanupperioddays"},{"key":"desktopSessionCleanupPeriodDays","topic":"Privacy and telemetry","scope":"User or managed","kind":"number","default":null,"since":"2.1.248","anchor":"desktopsessioncleanupperioddays"},{"key":"feedbackDrafts","topic":"Privacy and telemetry","scope":"User or managed","kind":"choice","options":["notify","quiet","off"],"default":"\\"notify\\"","since":null,"anchor":"feedbackdrafts"},{"key":"feedbackSurveyRate","topic":"Privacy and telemetry","scope":"Any file","kind":"number","default":null,"since":null,"anchor":"feedbacksurveyrate"},{"key":"skipWebFetchPreflight","topic":"Privacy and telemetry","scope":"Any file","kind":"boolean","default":null,"since":null,"anchor":"skipwebfetchpreflight"},{"key":"disableSideloadFlags","topic":"Enterprise and managed settings","scope":"Managed","kind":"boolean","default":"false","since":"2.1.193","anchor":"disablesideloadflags"},{"key":"forceRemoteSettingsRefresh","topic":"Enterprise and managed settings","scope":"Managed","kind":"boolean","default":"false","since":null,"anchor":"forceremotesettingsrefresh"},{"key":"managedSourcesBehavior","topic":"Enterprise and managed settings","scope":"Managed","kind":"choice","options":["first-wins","merge"],"default":"\\"first-wins\\"","since":"2.1.242","anchor":"managedsourcesbehavior"},{"key":"parentSettingsBehavior","topic":"Enterprise and managed settings","scope":"Managed","kind":"choice","options":["first-wins","merge"],"default":"\\"first-wins\\"","since":null,"anchor":"parentsettingsbehavior"},{"key":"policyHelper","topic":"Enterprise and managed settings","scope":"Managed","kind":"structured","default":null,"since":null,"anchor":"policyhelper"},{"key":"policyHelper.path","topic":"Enterprise and managed settings","scope":"Managed","kind":"text","default":null,"since":null,"anchor":"policyhelper-path"},{"key":"policyHelper.timeoutMs","topic":"Enterprise and managed settings","scope":"Managed","kind":"number","default":"10000","since":null,"anchor":"policyhelper-timeoutms"},{"key":"policyHelper.refreshIntervalMs","topic":"Enterprise and managed settings","scope":"Managed","kind":"number","default":null,"since":null,"anchor":"policyhelper-refreshintervalms"},{"key":"wslInheritsWindowsSettings","topic":"Enterprise and managed settings","scope":"Managed","kind":"boolean","default":null,"since":"2.1.282","anchor":"wslinheritswindowssettings"},{"key":"autoConnectIde","topic":"Global config settings","scope":"Global config","kind":"boolean","default":"false","since":null,"anchor":"autoconnectide"},{"key":"autoInstallIdeExtension","topic":"Global config settings","scope":"Global config","kind":"boolean","default":"true","since":null,"anchor":"autoinstallideextension"},{"key":"claudeInChromeDefaultEnabled","topic":"Global config settings","scope":"Global config","kind":"boolean","default":null,"since":null,"anchor":"claudeinchromedefaultenabled"},{"key":"copyFullResponse","topic":"Global config settings","scope":"Global config","kind":"boolean","default":"false","since":null,"anchor":"copyfullresponse"},{"key":"copyOnSelect","topic":"Global config settings","scope":"Global config","kind":"boolean","default":"true","since":null,"anchor":"copyonselect"},{"key":"defaultToAgentsView","topic":"Global config settings","scope":"Global config","kind":"boolean","default":"false","since":null,"anchor":"defaulttoagentsview"},{"key":"diffTool","topic":"Global config settings","scope":"Global config","kind":"choice","options":["auto","terminal"],"default":"\\"auto\\"","since":null,"anchor":"difftool"},{"key":"externalEditorContext","topic":"Global config settings","scope":"Global config","kind":"boolean","default":"false","since":null,"anchor":"externaleditorcontext"},{"key":"leftArrowOpensAgents","topic":"Global config settings","scope":"Global config","kind":"boolean","default":"true","since":null,"anchor":"leftarrowopensagents"},{"key":"permissionExplainerEnabled","topic":"Global config settings","scope":"Global config","kind":"boolean","default":"true","since":null,"anchor":"permissionexplainerenabled"},{"key":"prStatusFooterEnabled","topic":"Global config settings","scope":"Global config","kind":"boolean","default":"true","since":null,"anchor":"prstatusfooterenabled"},{"key":"teammateDefaultModel","topic":"Global config settings","scope":"Global config","kind":"text","default":"unset","since":null,"anchor":"teammatedefaultmodel"}]'),o={source:e,keys:n};export{o as default,n as keys,e as source};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./app-
|
|
1
|
+
import"./app-BFFG6Wz8.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})();
|
package/dist/web/index.html
CHANGED
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
document.documentElement.setAttribute("data-density", density === "tightest" || density === "tighter" || density === "compact" || density === "comfortable" ? density : "default");
|
|
78
78
|
})();
|
|
79
79
|
</script>
|
|
80
|
-
<script type="module" crossorigin src="/assets/index-
|
|
81
|
-
<link rel="modulepreload" crossorigin href="/assets/app-
|
|
82
|
-
<link rel="stylesheet" crossorigin href="/assets/app-
|
|
80
|
+
<script type="module" crossorigin src="/assets/index-Ca87aJP9.js"></script>
|
|
81
|
+
<link rel="modulepreload" crossorigin href="/assets/app-BFFG6Wz8.js">
|
|
82
|
+
<link rel="stylesheet" crossorigin href="/assets/app-DfcfHvcX.css">
|
|
83
83
|
</head>
|
|
84
84
|
<body>
|
|
85
85
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccdeck",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.47.0",
|
|
4
4
|
"description": "Local dashboard for Claude Code and Codex CLI sessions: which Claude Code session needs input, every tool call and Claude Code subagent live, token cost and quota, several Claude accounts. Run npx ccdeck.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/release-notes.json
CHANGED
|
@@ -80,6 +80,36 @@
|
|
|
80
80
|
"3.43.1",
|
|
81
81
|
"3.43.3"
|
|
82
82
|
],
|
|
83
|
+
"3.47.0": [
|
|
84
|
+
{
|
|
85
|
+
"title": "⌨️ Quick open: Cmd/Ctrl+K reaches any panel, setting, session or theme by name",
|
|
86
|
+
"body": "Type a few letters to open a panel, land on a setting inside Settings, jump to a session or switch the theme. It is also Search on the bar."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"title": "⚙️ Settings › Claude Code changes Claude Code's own settings from the deck",
|
|
90
|
+
"body": "Twelve settings in five groups, from auto memory and compaction to the Co-Authored-By credit and the update channel, written to your settings.json on this computer."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"title": "📡 Radar monitors all the time, and packet capture is one explained step",
|
|
94
|
+
"body": "There is no Start or Stop any more: Radar finds Claude Code's collector by itself. Where capture needs a permission, Allow packet capture once asks for it on your press only."
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"title": "⏱️ Tool activity shows where the time went, and Skill activity who starts your skills",
|
|
98
|
+
"body": "Tool activity splits the turns' time between Claude, this machine and you. Skill activity shows how many skill uses Claude, Codex or you started, overall and per skill."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"title": "📊 Usage remembers how full each quota week ended, and names your Claude plan",
|
|
102
|
+
"body": "Under each 7-day bar a line says how full the last weeks were at their reset. The Claude quota card shows your plan beside its title, as the Codex card does."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"title": "🗂️ Stripes, dialogs and floating panels are organized more evenly",
|
|
106
|
+
"body": "The doors on both edge stripes sit in named groups, dialogs share one frame, and T switches the theme inside any dialog too."
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"title": "🪟 The desktop app works on a first run without Node, and integrations got fixes",
|
|
110
|
+
"body": "Usage no longer needs npm, and Claude Code installed while the app is open is picked up. Jira and GitLab avatars load, and panels reopen where you left them."
|
|
111
|
+
}
|
|
112
|
+
],
|
|
83
113
|
"3.46.0": [
|
|
84
114
|
{
|
|
85
115
|
"title": "🔗 Jira, GitHub and GitLab panels are easier to read and navigate",
|
|
@@ -12,14 +12,20 @@
|
|
|
12
12
|
// the current call always serves from the already-installed copy. If the
|
|
13
13
|
// managed install is missing/broken we fall back to the old npx path so the
|
|
14
14
|
// feature still works on a fresh machine.
|
|
15
|
+
//
|
|
16
|
+
// A machine with no npm at all, which is what the desktop app runs on when its
|
|
17
|
+
// user never installed Node, gets the same managed install fetched straight from
|
|
18
|
+
// the registry instead (ccusage-registry.mjs), and no npx fallback, because npx
|
|
19
|
+
// is part of the npm it does not have.
|
|
15
20
|
import { spawn } from "node:child_process";
|
|
16
21
|
import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
17
22
|
import path from "node:path";
|
|
18
23
|
import os from "node:os";
|
|
19
|
-
import { killTree, shimPath, spawnSpec } from "./exec.mjs";
|
|
24
|
+
import { killTree, pathLookup, shimPath, spawnSpec } from "./exec.mjs";
|
|
20
25
|
import { npmCliLaunch } from "./npx.mjs";
|
|
21
26
|
import { oneLine } from "./term.mjs";
|
|
22
27
|
import { note } from "./ccusage-failure.mjs";
|
|
28
|
+
import { fetchCcusage, latestCcusage } from "./ccusage-registry.mjs";
|
|
23
29
|
|
|
24
30
|
const INSTALL_TIMEOUT_MS = 120_000; // first-run npm install can be slow
|
|
25
31
|
const UPDATE_CHECK_MS = 24 * 3600_000; // check npm for a newer ccusage once/day
|
|
@@ -77,6 +83,21 @@ export const installSpec = (spec = "latest", platform = process.platform, deps)
|
|
|
77
83
|
npmSpec(["install", `ccusage@${spec}`, "--prefix", CACHE_DIR,
|
|
78
84
|
"--no-save", "--no-audit", "--no-fund", "--loglevel", "error"], platform, deps);
|
|
79
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Whether there is an npm here for npmSpec to launch: the shim it would hand
|
|
88
|
+
* cmd.exe on Windows, and elsewhere the npm-cli.js beside this Node or an `npm`
|
|
89
|
+
* on PATH. The same places npmSpec looks, so a yes is an npm it can reach.
|
|
90
|
+
*
|
|
91
|
+
* A no is the machine the registry fetch is for. Asked per call rather than
|
|
92
|
+
* once, so an npm installed while the deck runs is used from the next install.
|
|
93
|
+
* Exported for tests, with the platform and the file system injectable as
|
|
94
|
+
* everywhere else in this module.
|
|
95
|
+
*/
|
|
96
|
+
export function npmAvailable(platform = process.platform, deps) {
|
|
97
|
+
if (platform === "win32") return shimPath("npm.cmd", deps) !== null;
|
|
98
|
+
return npmCliLaunch([], { platform, ...deps }) !== null || pathLookup("npm", platform, deps) !== null;
|
|
99
|
+
}
|
|
100
|
+
|
|
80
101
|
let _installing = null; // Promise guard so concurrent calls share one install
|
|
81
102
|
let _checkedThisRun = false; // only kick the daily check once per process boot
|
|
82
103
|
|
|
@@ -285,8 +306,35 @@ function installTreeReport() {
|
|
|
285
306
|
* fields spawnSync used to hand it — a failure to LAUNCH in `error`, the exit
|
|
286
307
|
* status, and both output streams, because npm has never confined itself to
|
|
287
308
|
* stderr.
|
|
309
|
+
*
|
|
310
|
+
* With no npm to run, the same install comes from the registry instead — see
|
|
311
|
+
* registryInstall below.
|
|
288
312
|
*/
|
|
289
313
|
function install(spec = "latest") {
|
|
314
|
+
return npmAvailable() ? npmInstall(spec) : registryInstall(spec);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* The managed install for a machine with no npm: ccusage and its native
|
|
319
|
+
* package, fetched and checked by ccusage-registry.mjs, unpacked where npm
|
|
320
|
+
* would have put them.
|
|
321
|
+
*
|
|
322
|
+
* Its failure carries the reason first, for the room it is cut to (#1672), and
|
|
323
|
+
* says there was no npm, because that is why the deck went to the registry
|
|
324
|
+
* itself and the reader cannot otherwise know it did.
|
|
325
|
+
*/
|
|
326
|
+
async function registryInstall(spec = "latest") {
|
|
327
|
+
try {
|
|
328
|
+
await fetchCcusage({ spec, pkgDir: PKG_DIR, timeoutMs: INSTALL_TIMEOUT_MS });
|
|
329
|
+
} catch (e) {
|
|
330
|
+
throw new Error(`could not download ccusage from the npm registry (this machine has no npm): ${e?.message ?? e}`);
|
|
331
|
+
}
|
|
332
|
+
if (!resolveEntry()) {
|
|
333
|
+
throw new Error(`the ccusage downloaded from the npm registry left nothing runnable: ${installTreeReport()}, under ${CACHE_DIR}`);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function npmInstall(spec = "latest") {
|
|
290
338
|
return new Promise((resolve, reject) => {
|
|
291
339
|
mkdirSync(CACHE_DIR, { recursive: true });
|
|
292
340
|
const { file, args, opts } = installSpec(spec);
|
|
@@ -382,6 +430,15 @@ export function maybeBackgroundUpdate(installedVersion) {
|
|
|
382
430
|
if (!backgroundUpdateDue()) return;
|
|
383
431
|
_checkedThisRun = true;
|
|
384
432
|
touchMarker();
|
|
433
|
+
// No npm to ask, so the registry is asked directly. Without this a copy
|
|
434
|
+
// fetched by registryInstall would be the version it was on its first day,
|
|
435
|
+
// for good.
|
|
436
|
+
if (!npmAvailable()) {
|
|
437
|
+
latestCcusage()
|
|
438
|
+
.then(latest => { if (latest && latest !== installedVersion) installInBackground(latest); })
|
|
439
|
+
.catch(() => { /* best-effort, like the npm check below */ });
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
385
442
|
try {
|
|
386
443
|
const { file, args, opts } = npmSpec(["view", "ccusage", "version"]);
|
|
387
444
|
const child = spawn(file, args, { windowsHide: true, ...opts });
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
// ccusage fetched straight from the npm registry, for a machine with no npm.
|
|
2
|
+
//
|
|
3
|
+
// The managed install in ccusage-install.mjs is `npm install ccusage --prefix`,
|
|
4
|
+
// and the fallback after it is `npx -y ccusage@latest`. Both need Node's npm,
|
|
5
|
+
// and the desktop app is the one way of running this deck that never needed
|
|
6
|
+
// Node at all: it runs the deck on its own Electron binary. Reproduced on a
|
|
7
|
+
// clean Windows VM with the 3.46.0 app and no Node: the boot logged
|
|
8
|
+
// `'"npm.cmd"' is not recognized`, the npx fallback failed the same way, and the
|
|
9
|
+
// Usage panel never had anything from ccusage to show — on the machine of a
|
|
10
|
+
// first-time user, which is the one that judges the tool.
|
|
11
|
+
//
|
|
12
|
+
// What npm would have done here is small enough to do without it. ccusage 20
|
|
13
|
+
// has no dependencies. Its package is a cli.js that runs a native binary, and
|
|
14
|
+
// that binary ships as one optional dependency per platform
|
|
15
|
+
// (`@ccusage/ccusage-<platform>-<arch>`, a few MB, no install scripts). So this
|
|
16
|
+
// asks the registry for the two packages, checks each tarball against the
|
|
17
|
+
// sha512 the registry publishes for it, which is the check npm itself makes, and
|
|
18
|
+
// unpacks them into the same directory npm would have produced, so
|
|
19
|
+
// resolveEntry, nativeCcusage and cli.js find everything where they always have.
|
|
20
|
+
//
|
|
21
|
+
// Nothing is installed anywhere but the deck's own cache directory, and no
|
|
22
|
+
// package script is run, because npm would not run one for these two either.
|
|
23
|
+
import { createHash } from "node:crypto";
|
|
24
|
+
import { existsSync } from "node:fs";
|
|
25
|
+
import { mkdir, rename, rm, writeFile } from "node:fs/promises";
|
|
26
|
+
import path from "node:path";
|
|
27
|
+
import { gunzip } from "node:zlib";
|
|
28
|
+
import { promisify } from "node:util";
|
|
29
|
+
|
|
30
|
+
const gunzipAsync = promisify(gunzip);
|
|
31
|
+
|
|
32
|
+
/** The registry this asks, unless the environment names another. npm exports
|
|
33
|
+
* `npm_config_registry` to everything it runs, and a user who set it by hand
|
|
34
|
+
* has said where their packages come from. */
|
|
35
|
+
export function registryBase(env = process.env) {
|
|
36
|
+
const named = String(env.npm_config_registry ?? env.NPM_CONFIG_REGISTRY ?? "").trim();
|
|
37
|
+
return (named || "https://registry.npmjs.org").replace(/\/+$/, "");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** ccusage's platform package for this machine, named the way its cli.js names
|
|
41
|
+
* it, or null on a platform ccusage publishes no binary for. */
|
|
42
|
+
export function nativePackageName(platform = process.platform, arch = process.arch) {
|
|
43
|
+
if (!["darwin", "linux", "win32"].includes(platform)) return null;
|
|
44
|
+
if (arch !== "x64" && arch !== "arm64") return null;
|
|
45
|
+
return `@ccusage/ccusage-${platform}-${arch}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Bigger than either package by an order of magnitude, and a stop for a
|
|
49
|
+
* registry or proxy that answers with something that is not a package. */
|
|
50
|
+
const MAX_TARBALL_BYTES = 64 << 20;
|
|
51
|
+
|
|
52
|
+
// A dist-tag or an exact version. Anything else would be put into a URL path.
|
|
53
|
+
const SPEC = /^[0-9A-Za-z][0-9A-Za-z.+-]*$/;
|
|
54
|
+
|
|
55
|
+
async function getJson(url, { fetch, signal }) {
|
|
56
|
+
const res = await fetch(url, { headers: { accept: "application/json" }, signal });
|
|
57
|
+
if (!res.ok) throw new Error(`${url} answered ${res.status}`);
|
|
58
|
+
return res.json();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The registry's record of one version of one package: its version, where its
|
|
63
|
+
* tarball is, the integrity string that tarball has to match, and its optional
|
|
64
|
+
* dependencies. `spec` is a dist-tag ("latest") or an exact version.
|
|
65
|
+
*/
|
|
66
|
+
export async function packageVersion(name, spec, { fetch = globalThis.fetch, base = registryBase(), signal } = {}) {
|
|
67
|
+
if (!SPEC.test(String(spec))) throw new Error(`not a version or tag: ${spec}`);
|
|
68
|
+
// A scoped name keeps its `@` and has its `/` escaped, which is how the
|
|
69
|
+
// registry spells it in a path.
|
|
70
|
+
const url = `${base}/${name.replace("/", "%2F")}/${spec}`;
|
|
71
|
+
const doc = await getJson(url, { fetch, signal });
|
|
72
|
+
const tarball = doc?.dist?.tarball;
|
|
73
|
+
const integrity = doc?.dist?.integrity;
|
|
74
|
+
if (typeof doc?.version !== "string" || typeof tarball !== "string" || typeof integrity !== "string") {
|
|
75
|
+
throw new Error(`${url} did not describe a package version`);
|
|
76
|
+
}
|
|
77
|
+
if (!/^https?:\/\//.test(tarball)) throw new Error(`${name}@${doc.version} has no usable tarball URL`);
|
|
78
|
+
return { name, version: doc.version, tarball, integrity, optional: doc.optionalDependencies ?? {} };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Whether `bytes` are what `integrity` says, by the sha512 entries in it.
|
|
83
|
+
*
|
|
84
|
+
* An integrity string is space-separated `<algo>-<base64>` entries. Only sha512
|
|
85
|
+
* is accepted: the registry publishes it for every package this fetches, and a
|
|
86
|
+
* record that offers only something weaker is not one to trust a binary to.
|
|
87
|
+
*/
|
|
88
|
+
export function integrityMatches(bytes, integrity) {
|
|
89
|
+
const wanted = String(integrity ?? "").split(/\s+/)
|
|
90
|
+
.filter(e => e.startsWith("sha512-"))
|
|
91
|
+
.map(e => e.slice("sha512-".length).split("?")[0]);
|
|
92
|
+
if (!wanted.length) return false;
|
|
93
|
+
const got = createHash("sha512").update(bytes).digest("base64");
|
|
94
|
+
return wanted.includes(got);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async function download(pkg, { fetch, signal }) {
|
|
98
|
+
const res = await fetch(pkg.tarball, { signal });
|
|
99
|
+
if (!res.ok) throw new Error(`${pkg.tarball} answered ${res.status}`);
|
|
100
|
+
const declared = Number(res.headers?.get?.("content-length"));
|
|
101
|
+
if (declared > MAX_TARBALL_BYTES) throw new Error(`${pkg.name}@${pkg.version} is ${declared} bytes, more than a ccusage package should be`);
|
|
102
|
+
const bytes = Buffer.from(await res.arrayBuffer());
|
|
103
|
+
if (bytes.length > MAX_TARBALL_BYTES) throw new Error(`${pkg.name}@${pkg.version} is ${bytes.length} bytes, more than a ccusage package should be`);
|
|
104
|
+
if (!integrityMatches(bytes, pkg.integrity)) {
|
|
105
|
+
throw new Error(`${pkg.name}@${pkg.version} does not match the integrity the registry published for it`);
|
|
106
|
+
}
|
|
107
|
+
return bytes;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const text = (buf, start, len) => {
|
|
111
|
+
const raw = buf.subarray(start, start + len);
|
|
112
|
+
const end = raw.indexOf(0);
|
|
113
|
+
return raw.subarray(0, end === -1 ? raw.length : end).toString("utf8");
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const octal = (buf, start, len) => {
|
|
117
|
+
if (buf[start] & 0x80) throw new Error("tar entry uses a size encoding no npm package needs");
|
|
118
|
+
const s = text(buf, start, len).trim();
|
|
119
|
+
return s ? parseInt(s, 8) : 0;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/** The `path` record out of a pax extended header, or null. */
|
|
123
|
+
function paxPath(body) {
|
|
124
|
+
for (const line of body.toString("utf8").split("\n")) {
|
|
125
|
+
const m = /^\d+ path=(.*)$/.exec(line);
|
|
126
|
+
if (m) return m[1];
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The entries of an uncompressed tar archive: `{ name, mode, type, body }`.
|
|
133
|
+
*
|
|
134
|
+
* Only what npm tarballs use: ustar headers with their prefix field, pax `path`
|
|
135
|
+
* records and GNU long names. Everything is read out of one buffer that has
|
|
136
|
+
* already passed the integrity check, so a truncated archive is the one
|
|
137
|
+
* malformation worth naming.
|
|
138
|
+
*
|
|
139
|
+
* Exported for tests.
|
|
140
|
+
*/
|
|
141
|
+
export function* tarEntries(buf) {
|
|
142
|
+
let off = 0;
|
|
143
|
+
let longName = null;
|
|
144
|
+
while (off + 512 <= buf.length) {
|
|
145
|
+
const head = buf.subarray(off, off + 512);
|
|
146
|
+
if (head.every(b => b === 0)) return;
|
|
147
|
+
const size = octal(head, 124, 12);
|
|
148
|
+
const type = head[156] ? String.fromCharCode(head[156]) : "0";
|
|
149
|
+
const prefix = text(head, 257, 6).startsWith("ustar") ? text(head, 345, 155) : "";
|
|
150
|
+
const start = off + 512;
|
|
151
|
+
if (start + size > buf.length) throw new Error("the package archive is truncated");
|
|
152
|
+
const body = buf.subarray(start, start + size);
|
|
153
|
+
off = start + Math.ceil(size / 512) * 512;
|
|
154
|
+
if (type === "x" || type === "L") { longName = type === "x" ? paxPath(body) : text(body, 0, body.length); continue; }
|
|
155
|
+
if (type === "g") continue;
|
|
156
|
+
const short = text(head, 0, 100);
|
|
157
|
+
const name = longName ?? (prefix ? `${prefix}/${short}` : short);
|
|
158
|
+
longName = null;
|
|
159
|
+
yield { name, mode: octal(head, 100, 8), type, body };
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Unpack an npm tarball into `dest`, without its top directory (`package/` in
|
|
165
|
+
* every tarball npm publishes).
|
|
166
|
+
*
|
|
167
|
+
* Regular files and directories only. npm drops links out of a package too,
|
|
168
|
+
* and a link is the one entry that could make a later write land outside
|
|
169
|
+
* `dest`. Every name is also checked to stay inside `dest`: a `..`, a drive
|
|
170
|
+
* letter or a colon, which on Windows names a stream of another file, fails the
|
|
171
|
+
* whole unpack rather than skipping one entry, because a package that contains
|
|
172
|
+
* one of those is not one to run.
|
|
173
|
+
*
|
|
174
|
+
* Exported for tests.
|
|
175
|
+
*/
|
|
176
|
+
export async function unpack(tgz, dest) {
|
|
177
|
+
const tar = await gunzipAsync(tgz);
|
|
178
|
+
const root = path.resolve(dest);
|
|
179
|
+
await mkdir(root, { recursive: true });
|
|
180
|
+
for (const entry of tarEntries(tar)) {
|
|
181
|
+
if (entry.type !== "0" && entry.type !== "5") continue;
|
|
182
|
+
const parts = entry.name.replace(/\\/g, "/").split("/").filter(p => p && p !== ".");
|
|
183
|
+
parts.shift();
|
|
184
|
+
if (!parts.length) continue;
|
|
185
|
+
if (parts.some(p => p === ".." || p.includes(":"))) {
|
|
186
|
+
throw new Error(`the package archive names a path outside itself: ${entry.name}`);
|
|
187
|
+
}
|
|
188
|
+
const target = path.resolve(root, ...parts);
|
|
189
|
+
if (!target.startsWith(root + path.sep)) {
|
|
190
|
+
throw new Error(`the package archive names a path outside itself: ${entry.name}`);
|
|
191
|
+
}
|
|
192
|
+
if (entry.type === "5") { await mkdir(target, { recursive: true }); continue; }
|
|
193
|
+
await mkdir(path.dirname(target), { recursive: true });
|
|
194
|
+
// An executable bit is kept, as npm keeps it. ccusage's cli.js would set it
|
|
195
|
+
// on the native binary anyway before running it, but a copy that looks
|
|
196
|
+
// like npm's is one nothing downstream has to know about. Windows has no
|
|
197
|
+
// such bit and ignores the mode.
|
|
198
|
+
await writeFile(target, entry.body, { mode: entry.mode & 0o111 ? 0o755 : 0o644 });
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Put ccusage `spec` and this platform's native package into `pkgDir`, the
|
|
204
|
+
* directory npm would have made `node_modules/ccusage`.
|
|
205
|
+
*
|
|
206
|
+
* The native package goes INSIDE it, under `pkgDir/node_modules/@ccusage/…`,
|
|
207
|
+
* where Node's resolution from cli.js finds it first. That keeps the whole
|
|
208
|
+
* install one directory, so it is swapped in with one rename: a run that starts
|
|
209
|
+
* while this works sees the old copy or the new one, never half of each.
|
|
210
|
+
*
|
|
211
|
+
* Built in a sibling directory and renamed into place. If the old copy cannot
|
|
212
|
+
* be moved aside — on Windows, a ccusage.exe still running out of it — the new
|
|
213
|
+
* one is thrown away and the old one stays, which is the same outcome as an npm
|
|
214
|
+
* update that failed, and the next check tries again.
|
|
215
|
+
*
|
|
216
|
+
* Resolves to the version installed. `fetch` and `platform`/`arch` are
|
|
217
|
+
* injectable for tests.
|
|
218
|
+
*/
|
|
219
|
+
export async function fetchCcusage({
|
|
220
|
+
spec = "latest",
|
|
221
|
+
pkgDir,
|
|
222
|
+
fetch = globalThis.fetch,
|
|
223
|
+
base = registryBase(),
|
|
224
|
+
platform = process.platform,
|
|
225
|
+
arch = process.arch,
|
|
226
|
+
timeoutMs = 120_000,
|
|
227
|
+
} = {}) {
|
|
228
|
+
if (typeof fetch !== "function") throw new Error("this Node has no fetch");
|
|
229
|
+
const nativeName = nativePackageName(platform, arch);
|
|
230
|
+
if (!nativeName) throw new Error(`ccusage publishes no build for ${platform}-${arch}`);
|
|
231
|
+
const signal = AbortSignal.timeout(timeoutMs);
|
|
232
|
+
const opts = { fetch, base, signal };
|
|
233
|
+
|
|
234
|
+
const main = await packageVersion("ccusage", spec, opts);
|
|
235
|
+
const nativeSpec = main.optional[nativeName];
|
|
236
|
+
if (typeof nativeSpec !== "string" || !SPEC.test(nativeSpec)) {
|
|
237
|
+
throw new Error(`ccusage@${main.version} names no exact ${nativeName} version`);
|
|
238
|
+
}
|
|
239
|
+
const native = await packageVersion(nativeName, nativeSpec, opts);
|
|
240
|
+
const [mainTgz, nativeTgz] = await Promise.all([download(main, opts), download(native, opts)]);
|
|
241
|
+
|
|
242
|
+
const stamp = `${process.pid}-${Date.now()}`;
|
|
243
|
+
const staging = `${pkgDir}.fetching-${stamp}`;
|
|
244
|
+
const old = `${pkgDir}.old-${stamp}`;
|
|
245
|
+
try {
|
|
246
|
+
await unpack(mainTgz, staging);
|
|
247
|
+
await unpack(nativeTgz, path.join(staging, "node_modules", ...nativeName.split("/")));
|
|
248
|
+
await mkdir(path.dirname(pkgDir), { recursive: true });
|
|
249
|
+
const hadOld = existsSync(pkgDir);
|
|
250
|
+
if (hadOld) await renameSoon(pkgDir, old);
|
|
251
|
+
try {
|
|
252
|
+
await renameSoon(staging, pkgDir);
|
|
253
|
+
} catch (err) {
|
|
254
|
+
if (hadOld) await renameSoon(old, pkgDir).catch(() => {});
|
|
255
|
+
throw err;
|
|
256
|
+
}
|
|
257
|
+
// Only once the new copy is in place: until then `old` is the copy to put back.
|
|
258
|
+
if (hadOld) await rm(old, { recursive: true, force: true, maxRetries: 10, retryDelay: 25 }).catch(() => {});
|
|
259
|
+
} finally {
|
|
260
|
+
await rm(staging, { recursive: true, force: true }).catch(() => {});
|
|
261
|
+
}
|
|
262
|
+
return main.version;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* `rename`, given a moment when Windows says the file is busy.
|
|
267
|
+
*
|
|
268
|
+
* A freshly written ccusage.exe is opened by the antivirus scanner before
|
|
269
|
+
* anything else gets to it, and while it is open its directory cannot be
|
|
270
|
+
* renamed. That is a hold of a moment, not a refusal, and npm's own file system
|
|
271
|
+
* layer retries the same three codes for the same reason.
|
|
272
|
+
*/
|
|
273
|
+
async function renameSoon(from, to, tries = 8) {
|
|
274
|
+
for (let i = 1; ; i++) {
|
|
275
|
+
try {
|
|
276
|
+
return await rename(from, to);
|
|
277
|
+
} catch (err) {
|
|
278
|
+
if (i >= tries || !["EPERM", "EACCES", "EBUSY"].includes(err?.code)) throw err;
|
|
279
|
+
await new Promise(r => setTimeout(r, 50 * i));
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** The version the registry calls `latest`, for the daily update check on a
|
|
285
|
+
* machine with no `npm view` to ask. */
|
|
286
|
+
export async function latestCcusage({ fetch = globalThis.fetch, base = registryBase(), timeoutMs = 30_000 } = {}) {
|
|
287
|
+
const { version } = await packageVersion("ccusage", "latest", { fetch, base, signal: AbortSignal.timeout(timeoutMs) });
|
|
288
|
+
return version;
|
|
289
|
+
}
|