dsh-home-hosted 0.7.7 → 0.8.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 CHANGED
@@ -179,7 +179,7 @@ Topic docs, one per area — written for whoever has to touch it next:
179
179
 
180
180
  One entry (`dsh`), one toggle: the panel keeps it alive, restarts it and reclaims its port. A
181
181
  detached restart is recognised on macOS and Linux (`follow`); Windows cannot prove identity through
182
- a `.cmd` shim, so it uses `onPortConflict: kill`. The plugin pins home-hosted 0.7+, so every key it
182
+ a `.cmd` shim, so it uses `onPortConflict: kill`. The plugin pins home-hosted 0.8+, so every key it
183
183
  writes is one that panel parses.
184
184
  <sub>Web only — see **dsh Desktop** above.</sub>
185
185
 
package/docs/BOOT.md CHANGED
@@ -232,7 +232,7 @@ would be: `BootStatus.recommended` is the host's own `recommend()` answer, and `
232
232
  to it when nothing is installed (`pickOf(mechanism ?? before.mechanism ?? before.recommended)`). So
233
233
  "Automatic" says which mechanism the next install would use, instead of leaving a person to install it
234
234
  and read the result. The sentence is only shown while nothing is installed under that mechanism, and it
235
- is absent — never "undefined" — when an older panel does not send the field.
235
+ is absent — never "undefined" — when a response omits the field.
236
236
 
237
237
  The `Details` block describes the mechanism that is actually **installed**, which is a different one
238
238
  while a switch is pending, so both it and the picker read one shared lookup rather than each formatting
package/docs/DESIGN.md CHANGED
@@ -35,12 +35,14 @@ its page.
35
35
 
36
36
  ## Config compatibility was dropped, deliberately
37
37
 
38
- `onPortConflict: kill` arrived in home-hosted 0.6.0 and `persistent` in 0.6.3, and an older panel
39
- handed either key can refuse to *boot* from the config. The plugin used to consult the answering
40
- panel's version and refuse or drop them (`KILL_UNSUPPORTED`). That is gone on purpose: it pins
41
- `home-hosted@^0.7.21` and autostarts its own copy, so a panel older than those keys is only reachable by
42
- deliberately preferring an old global install — and this is pre-1.0. Supporting older panels again means
43
- bringing that check back from history, not re-deriving it.
38
+ `onPortConflict: kill` (0.6.0), `persistent` (0.6.3), `restart <id>` (0.7.13) and the nullable-`label`
39
+ patch (0.7.21) all predate the release this plugin pins. The plugin used to consult the answering
40
+ panel's version and refuse or drop those keys (`KILL_UNSUPPORTED`), and later to retry a `restart` as a
41
+ stop-then-start pair. Both are gone: it pins `home-hosted@^0.8.0`, which refuses an older panel
42
+ outright, so neither check could ever fire again.
43
+
44
+ An old state root is upgraded by running the latest 0.7.x **once, before installing 0.8** — its first
45
+ run moves the state into `.hh/`.
44
46
 
45
47
  ## Tests
46
48
 
package/docs/PANEL.md CHANGED
@@ -51,9 +51,16 @@ Verified against a real 0.7.20 panel and its own CLI: `PATCH {port:null}` delete
51
51
  and `bootstrap` have a schema that admits `null`; `_hh` is still exactly four routes; and every route,
52
52
  subcommand and flag this plugin drives is unchanged. The console **file** — `.hh/.logs/home-hosted.log`
53
53
  plus its `.1`, and the 5 MB rotation — is unchanged too, and this plugin's reader still matches
54
- `home-hosted logs` line for line. A capability that needs a *newer* 0.7.x degrades rather than raising
55
- the floor: `logs` (0.7.12) is a file read either way, and `restart <id>` (0.7.13) falls back to the
56
- stop/start pair it replaced.
54
+ `home-hosted logs` line for line.
55
+
56
+ **0.8.0 is the release that stopped relocating an old state root, and this plugin follows it.** A
57
+ 0.6.x root used to be moved into `.hh/` on the first run of 0.7; 0.8 refuses such a root instead, before
58
+ any command resolves a path into it, so that a config sitting at the old paths is never read as an empty
59
+ panel. Nothing is changed or deleted by that refusal. **If you are upgrading from 0.7 or earlier, run
60
+ the latest 0.7.x once first** — that release performs the move — **then install 0.8.** The plugin's own
61
+ floor is `0.8.0` for the same reason: a 0.7.x panel is one it cannot drive, so it says so rather than
62
+ degrading. That removed the last version-conditional code here — a stop-then-start fallback for a panel
63
+ without `restart <id>` — along with the `panel.migrate` action, whose CLI no longer performs that move.
57
64
 
58
65
  **0.7.21 widens that nullable set by one field, and it closed a bug here.** Clearing a server's label
59
66
  sent an empty string, which the panel accepts and saves — so the entry kept a blank label instead of
@@ -42,8 +42,8 @@ machines. The RPC endpoint still defaults an absent value (the page always sends
42
42
  call should not break), but a model is never left to guess.
43
43
 
44
44
  A pre-0.7 root is not read or written at all. It is recognised (`legacyRoot` on the status), refused on
45
- every write, and fixed through one action that runs `home-hosted migrate --yes` — the same relocation a
46
- first 0.7 start does on its own.
45
+ every write, and the refusal names the one remedy: run the latest 0.7.x once — its first run moves the
46
+ state into `.hh/` — before installing 0.8. Nothing is changed or deleted by the refusal.
47
47
 
48
48
  ## Several panels on one machine
49
49
 
@@ -76,12 +76,8 @@ that endpoint has, least invasive first:
76
76
  credential, but no live status either, and a running panel applies a changed definition at that
77
77
  entry's next start;
78
78
  - `cli` runs the CLI against its state root — the only runtime path the panel itself offers.
79
- `start`/`stop` act on one entry; a restart is now the CLI's own `restart <id>` (home-hosted
80
- 0.7.13), which is what the panel's UI does and leaves no window in which the entry is down. A
81
- local panel older than that refused the command before touching anything, so the plugin falls
82
- back to the stop-then-start pair and reports `downgraded` in the result — the refusal is
83
- detected from the CLI's own text, including the `Unexpected argument` a 0.7.12 CLI prints for
84
- the positional id;
79
+ `start`/`stop` act on one entry, and a restart is the CLI's own `restart <id>`, which is what the
80
+ panel's UI does and leaves no window in which the entry is down;
85
81
  - `api` mints a token for that panel, enrols it and uses its HTTP API — the only way to get live
86
82
  status, and it replaces any token that panel had, which the question says outright.
87
83
 
package/lib/client.js CHANGED
@@ -1,12 +1,12 @@
1
1
  window.__ModuleLoader__.load({ id: "dsh-home-hosted", factory: (require) => {
2
2
  var module = { exports: {} }; var exports = module.exports;
3
- "use strict";var Me=Object.defineProperty;var Jt=Object.getOwnPropertyDescriptor;var Xt=Object.getOwnPropertyNames;var Zt=Object.prototype.hasOwnProperty;var Qt=(e,t)=>{for(var n in t)Me(e,n,{get:t[n],enumerable:!0})},en=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Xt(t))!Zt.call(e,o)&&o!==n&&Me(e,o,{get:()=>t[o],enumerable:!(r=Jt(t,o))||r.enumerable});return e};var tn=e=>en(Me({},"__esModule",{value:!0}),e);var _n={};Qt(_n,{apply:()=>On,inject:()=>Dn});module.exports=tn(_n);var xe="homeHosted",Le={tab:"Home Hosted",loading:"Loading\u2026",refresh:"Refresh",retry:"Retry",errorTitle:"Error",statusUnavailable:"The panel did not answer.",yes:"Yes",no:"No",copy:"Copy",copied:"Copied",details:"Details",uiStyleLabel:"Page style",uiStyleDetailed:"Detailed",uiStyleCompact:"Compact",workspacesTitle:"Workspaces",workspacesHint:"Every workspace this panel serves. Viewing one decides what this page lists.",workspacesViewLabel:"Workspace to view",workspacesEmpty:"The panel reports no workspaces yet.",workspacesManagedTag:"managed by the plugin",workspacesViewingTag:"viewing",workspacesCounts:"{servers} servers \xB7 {running} running",workspacesCountsFile:"{servers} in the config files",workspacesDegraded:"The panel is not answering, so these counts \u2014 and the entry list below \u2014 come from the workspace config files, not from live state.",workspaceLegacyTitle:"This state root still uses the pre-0.7 layout",workspaceLegacyBody:"The plugin cannot read or write its files until they move into .hh. Starting the panel once does the same move; this runs it directly.",workspaceMigrate:"Migrate state root",workspaceMigrateFailed:"The migration did not run.",workspaceMigrateDone:"The state root was migrated.",sigPanel:"Panel",sigAutostart:"Autostart",sigEntry:"{id} entry",stateAnswering:"answering",stateNotAnswering:"not answering",stateManaged:"managed",stateNotManaged:"not managed",stateWebOnly:"web only",panelTitle:"Panel",panelCopy:"Which copy runs the panel",panelCopyHint:"The pinned copy ships with this plugin; the global one is on PATH.",optionsPreferPinned:"Pinned dependency",optionsPreferGlobal:"Global install",optionsRecommended:"recommended",optionsConfigOverride:"The plugin row sets homeHostedCommand, and that always wins.",optionsInstallLabel:"Install a global copy",optionsInstallHint:"No global install was found. Install the pinned range, then choose it above:",optionsInstall:"Install globally",panelHome:"Panel root",panelUrl:"URL",panelVersion:"Version",panelPid:"PID",panelWriteVia:"Writes via",panelToken:"API token",panelCliSource:"CLI",panelCliPath:"CLI path",panelCliConfig:"configured command",panelCliDependency:"pinned dependency",panelCliPathSource:"global install (PATH)",panelCliMissing:"not found",panelCliNotPinned:"This host resolved a global home-hosted instead of the pinned copy ({range}).",panelCliUnsupported:"This home-hosted is older than the oldest release the plugin supports.",panelCliLauncherFailed:"The boot launcher did not answer, so a boot entry may fail to start the panel.",panelPort:"Panel port",panelPortHint:"Only changeable while the panel is stopped.",panelPortFree:"Leave empty to use the port in the config.",panelPortInvalid:"Enter a port between 1 and 65535.",panelStart:"Start the panel",panelStop:"Stop the panel",panelStopTitle:"Stop the running panel?",panelStopBody:"This stops the panel and all non-persistent servers it supervises. Persistent entries keep running. An autostart entry starts the rest again at the next panel start.",panelStopping:"Stopping the panel\u2026",panelStopped:"The panel stopped.",panelStopFailed:"The panel did not stop: {message}",panelStartFailed:"The panel did not start: {message}",panelReplaceFailed:"The panel was not replaced: {message}",panelInstallFailed:"Installing home-hosted globally failed: {message}",panelRootLegacy:"Adopted from ~/.home-hosted. Set HHOSTED_HOME to give this dsh its own panel.",confirmStop:"Stop",panelOutdated:"Outdated panel",panelReplace:"Restart with {copy}",panelCopyPinned:"pinned dependency",panelCopyGlobal:"global install",panelTakeoverTitle:"Restart the running panel?",panelTakeoverBody:"This stops the panel and all non-persistent servers it supervises. Persistent entries keep running. It needs the {id} entry adopted with autostart on.",confirmCancel:"Cancel",confirmReplace:"Restart",writeViaApi:"authenticated API",writeViaFile:"config file",writeViaNone:"unavailable",tokenEnrolled:"enrolled",tokenPresent:"present",tokenAbsent:"absent",tokenStale:"stale",tokenUnknown:"unknown",panelTokenWarningTitle:"The panel API token is missing or refused",panelTokenWarnAbsent:"This plugin has no API token for the panel, so it cannot read or write the panel; regenerate one.",panelTokenWarnPresent:"home-hosted holds an API token this plugin does not have, so the plugin cannot authenticate; regenerate one to replace it.",panelTokenWarnStale:"The panel refused this plugin's API token; regenerate it.",panelTokenWarnUnreachable:"The plugin could not reach the panel to check its API token, so it cannot read or write the panel; the panel may need starting.",panelTokenWarnPanelDown:"The panel is not answering right now, so it may need starting too.",panelTokenRegenerate:"Regenerate token",panelTokenRegenerated:"A fresh API token was enrolled for the panel.",panelTokenRegenerateFailed:"The token was not replaced: {message}",panelInstances:"{count} panels found",panelInstanceManaged:"managed by this plugin",panelInstanceOther:"another panel",panelInstanceHosts:"hosts this dsh",panelInstancesHint:"This plugin drives only the managed one; the others are read from their state roots and never written to.",bootTitle:"Autostart",bootEnabled:"Enable autostart",bootUninstall:"Uninstall",bootSwitchMode:"Switch autostart",bootRecheck:"Re-check",bootMechanism:"Mechanism",bootMechanismAuto:"Automatic",bootMechanismAutoHint:"Picked from what this machine can actually use, preferring a mechanism that starts before you log in.",bootMechanismAutoPicks:"The next install would use {mechanism}.",bootState:"State",bootStateNotInstalled:"not installed",bootStateInstalledDisabled:"installed, off",bootStateEnabledRunning:"enabled, running",bootStateEnabledFailing:"enabled, failing",bootStateUnsupported:"unsupported",bootBootCapable:"Starts before login",bootPrivileged:"This process can install it",bootUnitPath:"Unit path",bootCommandsLabel:"Install by hand",bootCommandsExplain:"This process cannot elevate. Run these commands to install autostart:",bootRequestedNotInstalled:"Autostart is requested, but no boot entry is installed.",bootHandover:"Enabling this stops the panel this plugin started and starts it through the entry. Persistent entries keep running, so this session stays up and the page keeps working; it shows the panel again once it answers.",bootSwitchRetires:"Switching stops the panel and removes the previous autostart entry. Persistent entries keep running, so this session stays up and the page keeps working; it shows the panel again once the entry starts one.",bootActionInstall:"install",bootActionUninstall:"uninstall",bootAttemptFailed:"{action} failed",bootAttemptSucceeded:"{action} succeeded \u2014 {detail}",bootAttemptNoDetail:"The host did not explain the refusal.",bootAttemptCommands:"Run these yourself:",entriesTitle:"Managed entry",entriesManage:"Manage {id}",entriesManageNote:"Hands {id} to home-hosted: boot autostart, panel control, port reclaim.",entriesManageDesktop:"Available for dsh web only. Desktop starts its own profile, so it is never one of the panel's entries \u2014 servers are still managed here.",entriesManageWinWarning:"On Windows, `{id}` is managed via the `kill` onPortConflict policy, so when it is restarted detached by another plugin it may briefly fail to boot while home-hosted reclaims the process and port.",entriesEmpty:"{id} is not managed yet.",entriesExists:"exists",entriesMissing:"missing",entriesManaged:"managed",entriesUnmanaged:"unmanaged",entriesDrift:"drift",entriesNotRunning:"not running",agentTitle:"Agent tools",agentCount:"{enabled} of {total} on",agentMaster:"Let the agent use these tools",agentApproval:"Tools that change something ask for approval first.",agentApprovalBadge:"approval",reclaimAutoLabel:"Regenerate token automatically",reclaimAutoHint:"A tool call that finds a refused token re-enrols one and retries instead of failing.",instancesNoticeLabel:"Tell the agent about other panels",instancesNoticeHint:"Adds the panel inventory to the agent's context, and asks which panel to act on when several exist.",agentToolStatus:"Status",agentToolWorkspacesList:"List workspaces",agentToolServersList:"List servers",agentToolServersLifecycle:"Start, stop, restart",agentToolServersEdit:"Create, update, delete",agentToolAutostartManage:"Manage boot autostart",agentToolUiManage:"Manage Panel UI",agentToolPanelLogs:"Panel Logs",agentToolDescStatus:"Read the panel, the CLI copy in use and the managed entry. Nothing changes.",agentToolDescWorkspacesList:"List every workspace the panel serves, with its entry and running counts. A server id is only unique inside a workspace.",agentToolDescServersList:"List the servers of one workspace, with status, port and URL.",agentToolDescServersLifecycle:"Start, stop and restart supervised servers.",agentToolDescServersEdit:"Create, update and delete server entries.",agentToolDescAutostartManage:"Install or remove the boot entry that starts the panel.",agentToolDescUiManage:"Inspect, update, revert or install an official UI build.",agentToolDescPanelLogs:"Read the panel's own console output. Needs no API token, so it works when the panel is up but not answering.",serversTitle:"Servers",serversCount:"{running} of {total} running",serversHintPanel:"Entries are managed in the home-hosted panel:",serversHintNoPanel:"Entries cannot be managed right now: the panel is not running.",serversEmpty:"The panel reports no servers.",serversPid:"PID",serversUrl:"URL",serversCommand:"Command",serversArgs:"Args",serversCwd:"Working dir",serversPort:"Port",serversOnPortConflict:"On port conflict",serversAutostart:"Autostart",serversPersistent:"Persistent",serversPersistentHint:"Run by home-hosted's own nanny, so stopping or restarting the panel leaves it alive.",serversHealth:"Health",serversRestartPolicy:"Restart",serversConfiguration:"Configuration",serversRawConfig:"Raw config",serversDisabled:"disabled",serversEnabled:"enabled",serversHealthHttp:"HTTP {status} on {path}",serversHealthHttpBelow:"HTTP <{status} on {path}",serversHealthHttpProbe:"HTTP probe on {path}",serversHealthPort:"port {port}",serversHealthProbe:"port probe",serversHealthEvery:"every {seconds}",serversRestartSummary:"{retries} retries \xB7 {base} \u2192 \xD7{factor}",serversStart:"Start",serversStop:"Stop",serversRestart:"Restart",serversWorkspace:"Workspace",serversAdd:"Add server",serversEdit:"Edit",serversEditTitle:"Edit {id}",serversCreateTitle:"Add a server",serversEditorHint:"Only the fields you change are written. These are the common ones \u2014 the panel link above edits every field, including bootstrap, env files, resources and restart policy.",serversCreate:"Create",serversSave:"Save",serversDelete:"Delete",serversDeleteTitle:"Delete {id}?",serversDeleteBody:"This removes the entry from workspace {workspace}. A running server is stopped with it.",serversDeleteGo:"Delete",serversFreePort:"Free port",serversFreePortTitle:"Free port {port}?",serversFreePortBody:"Stops whatever holds the port, unless the panel supervises it. Processes get SIGTERM first, then a forced stop.",serversFreePortGo:"Free",serversPortFreed:"Port {port} is free.",serversPortHeld:"Port {port} is still held.",serversPortSkipped:"The listener belongs to a server the panel supervises, so it was left alone.",serversPortRefused:"The port was not freed: {message}",fieldId:"Id",fieldIdHint:"Lowercase letters, digits, `_` and `-`; unique inside the workspace.",fieldIdInvalid:"An id starts with a lowercase letter or digit and uses only a-z, 0-9, _ and -.",fieldLabel:"Label",fieldCommand:"Command",fieldArgs:"Arguments",fieldArgsHint:"One argument per line.",fieldCwd:"Working directory",fieldPort:"Port",fieldPortHint:"Empty means the entry has no port.",fieldPortInvalid:"Enter a port between 1 and 65535, or leave it empty.",fieldAutostart:"Start with the panel",fieldOnPortConflict:"On port conflict",fieldInherit:"Inherit",fieldRequired:"Id and command are required."},$e={tab:"Home Hosted",loading:"\u52A0\u8F7D\u4E2D\u2026",refresh:"\u5237\u65B0",retry:"\u91CD\u8BD5",errorTitle:"\u9519\u8BEF",statusUnavailable:"\u9762\u677F\u6CA1\u6709\u54CD\u5E94\u3002",yes:"\u662F",no:"\u5426",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",details:"\u8BE6\u60C5",uiStyleLabel:"\u9875\u9762\u6837\u5F0F",uiStyleDetailed:"\u8BE6\u7EC6",uiStyleCompact:"\u7D27\u51D1",workspacesTitle:"\u5DE5\u4F5C\u533A",workspacesHint:"\u6B64\u9762\u677F\u63D0\u4F9B\u7684\u6240\u6709\u5DE5\u4F5C\u533A\u3002\u67E5\u770B\u54EA\u4E2A\u5C31\u5217\u51FA\u54EA\u4E2A\u3002",workspacesViewLabel:"\u8981\u67E5\u770B\u7684\u5DE5\u4F5C\u533A",workspacesEmpty:"\u9762\u677F\u5C1A\u672A\u62A5\u544A\u4EFB\u4F55\u5DE5\u4F5C\u533A\u3002",workspacesManagedTag:"\u7531\u63D2\u4EF6\u7BA1\u7406",workspacesViewingTag:"\u6B63\u5728\u67E5\u770B",workspacesCounts:"{servers} \u4E2A\u670D\u52A1\u5668 \xB7 {running} \u4E2A\u8FD0\u884C\u4E2D",workspacesCountsFile:"\u914D\u7F6E\u6587\u4EF6\u4E2D {servers} \u4E2A",workspacesDegraded:"\u9762\u677F\u6CA1\u6709\u54CD\u5E94\uFF0C\u56E0\u6B64\u8FD9\u4E9B\u8BA1\u6570\u2014\u2014\u4EE5\u53CA\u4E0B\u65B9\u7684\u6761\u76EE\u5217\u8868\u2014\u2014\u6765\u81EA\u5DE5\u4F5C\u533A\u914D\u7F6E\u6587\u4EF6\uFF0C\u800C\u4E0D\u662F\u5B9E\u65F6\u72B6\u6001\u3002",workspaceLegacyTitle:"\u8BE5\u72B6\u6001\u76EE\u5F55\u4ECD\u662F 0.7 \u4E4B\u524D\u7684\u5E03\u5C40",workspaceLegacyBody:"\u5728\u6587\u4EF6\u79FB\u5165 .hh \u4E4B\u524D\uFF0C\u63D2\u4EF6\u65E0\u6CD5\u8BFB\u53D6\u6216\u5199\u5165\u5B83\u4EEC\u3002\u542F\u52A8\u4E00\u6B21\u9762\u677F\u5373\u53EF\u5B8C\u6210\u540C\u6837\u7684\u8FC1\u79FB\uFF1B\u6B64\u6309\u94AE\u76F4\u63A5\u6267\u884C\u8BE5\u547D\u4EE4\u3002",workspaceMigrate:"\u8FC1\u79FB\u72B6\u6001\u76EE\u5F55",workspaceMigrateFailed:"\u8FC1\u79FB\u6CA1\u6709\u6267\u884C\u3002",workspaceMigrateDone:"\u72B6\u6001\u76EE\u5F55\u5DF2\u8FC1\u79FB\u3002",sigPanel:"\u9762\u677F",sigAutostart:"\u5F00\u673A\u81EA\u542F",sigEntry:"{id} \u6761\u76EE",stateAnswering:"\u54CD\u5E94\u4E2D",stateNotAnswering:"\u672A\u54CD\u5E94",stateManaged:"\u5DF2\u63A5\u7BA1",stateNotManaged:"\u672A\u63A5\u7BA1",stateWebOnly:"\u4EC5 web",panelTitle:"\u9762\u677F",panelCopy:"\u7531\u54EA\u4E2A\u526F\u672C\u8FD0\u884C\u9762\u677F",panelCopyHint:"\u56FA\u5B9A\u526F\u672C\u968F\u63D2\u4EF6\u4E00\u8D77\u5B89\u88C5\uFF1B\u5168\u5C40\u526F\u672C\u6765\u81EA PATH\u3002",optionsPreferPinned:"\u56FA\u5B9A\u4F9D\u8D56",optionsPreferGlobal:"\u5168\u5C40\u5B89\u88C5",optionsRecommended:"\u63A8\u8350",optionsConfigOverride:"\u63D2\u4EF6\u884C\u4E2D\u7684 homeHostedCommand \u4F18\u5148\u7EA7\u6700\u9AD8\uFF0C\u59CB\u7EC8\u751F\u6548\u3002",optionsInstallLabel:"\u5B89\u88C5\u5168\u5C40\u526F\u672C",optionsInstallHint:"\u672A\u627E\u5230\u5168\u5C40\u5B89\u88C5\u3002\u5B89\u88C5\u56FA\u5B9A\u7248\u672C\u8303\u56F4\u540E\uFF0C\u5728\u4E0A\u65B9\u9009\u62E9\u5B83\uFF1A",optionsInstall:"\u5168\u5C40\u5B89\u88C5",panelHome:"\u9762\u677F\u6839\u76EE\u5F55",panelUrl:"URL",panelVersion:"\u7248\u672C",panelPid:"PID",panelWriteVia:"\u5199\u5165\u65B9\u5F0F",panelToken:"API \u4EE4\u724C",panelCliSource:"CLI",panelCliPath:"CLI \u8DEF\u5F84",panelCliConfig:"\u914D\u7F6E\u7684\u547D\u4EE4",panelCliDependency:"\u56FA\u5B9A\u7684\u4F9D\u8D56\u7248\u672C",panelCliPathSource:"\u5168\u5C40\u5B89\u88C5\uFF08PATH\uFF09",panelCliMissing:"\u672A\u627E\u5230",panelCliNotPinned:"\u6B64\u5BBF\u4E3B\u89E3\u6790\u5230\u7684\u662F\u5168\u5C40 home-hosted\uFF0C\u800C\u4E0D\u662F\u56FA\u5B9A\u526F\u672C\uFF08{range}\uFF09\u3002",panelCliUnsupported:"\u6B64 home-hosted \u65E9\u4E8E\u63D2\u4EF6\u652F\u6301\u7684\u6700\u8001\u7248\u672C\u3002",panelCliLauncherFailed:"\u5F00\u673A\u542F\u52A8\u5668\u6CA1\u6709\u5E94\u7B54\uFF0C\u5F00\u673A\u9879\u53EF\u80FD\u65E0\u6CD5\u542F\u52A8\u9762\u677F\u3002",panelPort:"\u9762\u677F\u7AEF\u53E3",panelPortHint:"\u4EC5\u5728\u9762\u677F\u505C\u6B62\u65F6\u53EF\u4FEE\u6539\u3002",panelPortFree:"\u7559\u7A7A\u5219\u4F7F\u7528\u914D\u7F6E\u6587\u4EF6\u4E2D\u7684\u7AEF\u53E3\u3002",panelPortInvalid:"\u8BF7\u8F93\u5165 1 \u5230 65535 \u4E4B\u95F4\u7684\u7AEF\u53E3\u3002",panelStart:"\u542F\u52A8\u9762\u677F",panelStop:"\u505C\u6B62\u9762\u677F",panelStopTitle:"\u505C\u6B62\u6B63\u5728\u8FD0\u884C\u7684\u9762\u677F\uFF1F",panelStopBody:"\u8FD9\u4F1A\u505C\u6B62\u9762\u677F\u4EE5\u53CA\u5B83\u76D1\u7BA1\u7684\u6240\u6709\u975E\u6301\u4E45\u5316\u670D\u52A1\u5668\uFF1B\u6301\u4E45\u5316\u6761\u76EE\u4F1A\u7EE7\u7EED\u8FD0\u884C\u3002\u5E26\u6709\u81EA\u542F\u7684\u6761\u76EE\u4F1A\u5728\u4E0B\u6B21\u542F\u52A8\u9762\u677F\u65F6\u91CD\u65B0\u542F\u52A8\u3002",panelStopping:"\u6B63\u5728\u505C\u6B62\u9762\u677F\u2026",panelStopped:"\u9762\u677F\u5DF2\u505C\u6B62\u3002",panelStopFailed:"\u9762\u677F\u672A\u80FD\u505C\u6B62\uFF1A{message}",panelStartFailed:"\u9762\u677F\u672A\u80FD\u542F\u52A8\uFF1A{message}",panelReplaceFailed:"\u9762\u677F\u672A\u80FD\u66FF\u6362\uFF1A{message}",panelInstallFailed:"\u5168\u5C40\u5B89\u88C5 home-hosted \u5931\u8D25\uFF1A{message}",panelRootLegacy:"\u6CBF\u7528\u4E86 ~/.home-hosted\u3002\u8BBE\u7F6E HHOSTED_HOME \u53EF\u8BA9\u6B64 dsh \u4F7F\u7528\u81EA\u5DF1\u7684\u9762\u677F\u3002",confirmStop:"\u505C\u6B62",panelOutdated:"\u9762\u677F\u5DF2\u8FC7\u65F6",panelReplace:"\u4F7F\u7528{copy}\u91CD\u542F",panelCopyPinned:"\u56FA\u5B9A\u4F9D\u8D56",panelCopyGlobal:"\u5168\u5C40\u5B89\u88C5",panelTakeoverTitle:"\u91CD\u542F\u6B63\u5728\u8FD0\u884C\u7684\u9762\u677F\uFF1F",panelTakeoverBody:"\u8FD9\u4F1A\u505C\u6B62\u9762\u677F\u4EE5\u53CA\u5B83\u76D1\u7BA1\u7684\u6240\u6709\u975E\u6301\u4E45\u5316\u670D\u52A1\u5668\uFF1B\u6301\u4E45\u5316\u6761\u76EE\u4F1A\u7EE7\u7EED\u8FD0\u884C\u3002\u4EC5\u5F53 {id} \u6761\u76EE\u5DF2\u88AB\u63A5\u7BA1\u4E14\u542F\u7528\u81EA\u542F\u65F6\u624D\u53EF\u7528\u3002",confirmCancel:"\u53D6\u6D88",confirmReplace:"\u91CD\u542F",writeViaApi:"\u5DF2\u8BA4\u8BC1 API",writeViaFile:"\u914D\u7F6E\u6587\u4EF6",writeViaNone:"\u4E0D\u53EF\u7528",tokenEnrolled:"\u5DF2\u767B\u8BB0",tokenPresent:"\u5DF2\u5B58\u5728",tokenAbsent:"\u4E0D\u5B58\u5728",tokenStale:"\u5DF2\u5931\u6548",tokenUnknown:"\u672A\u77E5",panelTokenWarningTitle:"\u9762\u677F API \u4EE4\u724C\u7F3A\u5931\u6216\u5DF2\u88AB\u62D2\u7EDD",panelTokenWarnAbsent:"\u672C\u63D2\u4EF6\u6CA1\u6709\u6B64\u9762\u677F\u7684 API \u4EE4\u724C\uFF0C\u65E0\u6CD5\u8BFB\u53D6\u6216\u5199\u5165\u9762\u677F\uFF1B\u8BF7\u91CD\u65B0\u751F\u6210\u4E00\u4E2A\u3002",panelTokenWarnPresent:"home-hosted \u6301\u6709\u4E00\u4E2A\u672C\u63D2\u4EF6\u6CA1\u6709\u7684 API \u4EE4\u724C\uFF0C\u63D2\u4EF6\u65E0\u6CD5\u901A\u8FC7\u8BA4\u8BC1\uFF1B\u8BF7\u91CD\u65B0\u751F\u6210\u4E00\u4E2A\u4EE5\u66FF\u6362\u5B83\u3002",panelTokenWarnStale:"\u9762\u677F\u62D2\u7EDD\u4E86\u672C\u63D2\u4EF6\u7684 API \u4EE4\u724C\uFF1B\u8BF7\u91CD\u65B0\u751F\u6210\u3002",panelTokenWarnUnreachable:"\u672C\u63D2\u4EF6\u65E0\u6CD5\u8BBF\u95EE\u9762\u677F\u4EE5\u68C0\u67E5\u5176 API \u4EE4\u724C\uFF0C\u56E0\u6B64\u65E0\u6CD5\u8BFB\u53D6\u6216\u5199\u5165\u9762\u677F\uFF1B\u9762\u677F\u53EF\u80FD\u8FD8\u9700\u8981\u5148\u542F\u52A8\u3002",panelTokenWarnPanelDown:"\u9762\u677F\u5F53\u524D\u6CA1\u6709\u54CD\u5E94\uFF0C\u53EF\u80FD\u8FD8\u9700\u8981\u5148\u542F\u52A8\u9762\u677F\u3002",panelTokenRegenerate:"\u91CD\u65B0\u751F\u6210\u4EE4\u724C",panelTokenRegenerated:"\u5DF2\u4E3A\u9762\u677F\u767B\u8BB0\u65B0\u4EE4\u724C\u3002",panelTokenRegenerateFailed:"\u4EE4\u724C\u672A\u66FF\u6362\uFF1A{message}",panelInstances:"\u53D1\u73B0 {count} \u4E2A\u9762\u677F",panelInstanceManaged:"\u7531\u672C\u63D2\u4EF6\u7BA1\u7406",panelInstanceOther:"\u5176\u4ED6\u9762\u677F",panelInstanceHosts:"\u6258\u7BA1\u5F53\u524D dsh",panelInstancesHint:"\u672C\u63D2\u4EF6\u53EA\u9A71\u52A8\u88AB\u7BA1\u7406\u7684\u90A3\u4E00\u4E2A\uFF1B\u5176\u4ED6\u9762\u677F\u4EC5\u4ECE\u5176\u72B6\u6001\u76EE\u5F55\u8BFB\u53D6\uFF0C\u7EDD\u4E0D\u5199\u5165\u3002",bootTitle:"\u5F00\u673A\u81EA\u542F",bootEnabled:"\u542F\u7528\u5F00\u673A\u81EA\u542F",bootUninstall:"\u5378\u8F7D",bootSwitchMode:"\u5207\u6362\u81EA\u542F\u673A\u5236",bootRecheck:"\u91CD\u65B0\u68C0\u67E5",bootMechanism:"\u673A\u5236",bootMechanismAuto:"\u81EA\u52A8",bootMechanismAutoHint:"\u6839\u636E\u672C\u673A\u5B9E\u9645\u53EF\u7528\u7684\u65B9\u5F0F\u81EA\u52A8\u9009\u62E9\uFF0C\u4F18\u5148\u9009\u62E9\u5728\u767B\u5F55\u524D\u5373\u53EF\u542F\u52A8\u7684\u673A\u5236\u3002",bootMechanismAutoPicks:"\u4E0B\u6B21\u5B89\u88C5\u5C06\u4F7F\u7528 {mechanism}\u3002",bootState:"\u72B6\u6001",bootStateNotInstalled:"\u672A\u5B89\u88C5",bootStateInstalledDisabled:"\u5DF2\u5B89\u88C5\uFF0C\u672A\u542F\u7528",bootStateEnabledRunning:"\u5DF2\u542F\u7528\uFF0C\u8FD0\u884C\u4E2D",bootStateEnabledFailing:"\u5DF2\u542F\u7528\uFF0C\u542F\u52A8\u5931\u8D25",bootStateUnsupported:"\u4E0D\u652F\u6301",bootBootCapable:"\u767B\u5F55\u524D\u542F\u52A8",bootPrivileged:"\u672C\u8FDB\u7A0B\u53EF\u5B89\u88C5",bootUnitPath:"\u5355\u5143\u6587\u4EF6\u8DEF\u5F84",bootCommandsLabel:"\u624B\u52A8\u5B89\u88C5",bootCommandsExplain:"\u672C\u8FDB\u7A0B\u65E0\u6CD5\u63D0\u6743\u3002\u8BF7\u81EA\u884C\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u6765\u5B89\u88C5\u81EA\u542F\uFF1A",bootRequestedNotInstalled:"\u5DF2\u8BF7\u6C42\u5F00\u673A\u81EA\u542F\uFF0C\u4F46\u5C1A\u672A\u5B89\u88C5\u4EFB\u4F55\u5F00\u673A\u9879\u3002",bootHandover:"\u542F\u7528\u540E\u4F1A\u505C\u6B62\u672C\u63D2\u4EF6\u542F\u52A8\u7684\u9762\u677F\uFF0C\u6539\u7531\u8BE5\u5F00\u673A\u9879\u542F\u52A8\u3002\u6301\u4E45\u5316\u6761\u76EE\u4F1A\u7EE7\u7EED\u8FD0\u884C\uFF0C\u56E0\u6B64\u672C\u4F1A\u8BDD\u4E0D\u53D7\u5F71\u54CD\u3001\u9875\u9762\u4FDD\u6301\u53EF\u7528\uFF1B\u9762\u677F\u6062\u590D\u5E94\u7B54\u540E\u9875\u9762\u4F1A\u91CD\u65B0\u663E\u793A\u5B83\u3002",bootSwitchRetires:"\u5207\u6362\u4F1A\u505C\u6B62\u9762\u677F\u5E76\u79FB\u9664\u5148\u524D\u7684\u81EA\u542F\u9879\u3002\u6301\u4E45\u5316\u6761\u76EE\u4F1A\u7EE7\u7EED\u8FD0\u884C\uFF0C\u56E0\u6B64\u672C\u4F1A\u8BDD\u4E0D\u53D7\u5F71\u54CD\u3001\u9875\u9762\u4FDD\u6301\u53EF\u7528\uFF1B\u8BE5\u5F00\u673A\u9879\u542F\u52A8\u65B0\u9762\u677F\u540E\u9875\u9762\u4F1A\u91CD\u65B0\u663E\u793A\u5B83\u3002",bootActionInstall:"\u5B89\u88C5",bootActionUninstall:"\u5378\u8F7D",bootAttemptFailed:"{action}\u5931\u8D25",bootAttemptSucceeded:"{action}\u6210\u529F \u2014 {detail}",bootAttemptNoDetail:"\u5BBF\u4E3B\u6CA1\u6709\u8BF4\u660E\u5931\u8D25\u539F\u56E0\u3002",bootAttemptCommands:"\u4F60\u53EF\u4EE5\u81EA\u884C\u8FD0\u884C\u4EE5\u4E0B\u547D\u4EE4\uFF1A",entriesTitle:"\u53D7\u7BA1\u6761\u76EE",entriesManage:"\u63A5\u7BA1 {id}",entriesManageNote:"\u628A {id} \u4EA4\u7ED9 home-hosted\uFF1A\u5F00\u673A\u81EA\u542F\u3001\u9762\u677F\u63A7\u5236\u3001\u7AEF\u53E3\u56DE\u6536\u3002",entriesManageDesktop:"\u4EC5\u9002\u7528\u4E8E dsh web\u3002Desktop \u542F\u52A8\u81EA\u5DF1\u7684 profile\uFF0C\u56E0\u6B64\u5B83\u6C38\u8FDC\u4E0D\u4F1A\u6210\u4E3A\u9762\u677F\u4E2D\u7684\u6761\u76EE\u2014\u2014\u670D\u52A1\u5668\u4ECD\u53EF\u5728\u6B64\u7BA1\u7406\u3002",entriesManageWinWarning:"\u5728 Windows \u4E0A\uFF0C`{id}` \u901A\u8FC7 `kill` \u7AEF\u53E3\u51B2\u7A81\u7B56\u7565\u7BA1\u7406\uFF1B\u5F53\u5B83\u88AB\u5176\u4ED6\u63D2\u4EF6\u4EE5\u5206\u79BB\u65B9\u5F0F\u91CD\u542F\u65F6\uFF0Chome-hosted \u56DE\u6536\u8FDB\u7A0B\u4E0E\u7AEF\u53E3\u671F\u95F4\u53EF\u80FD\u77ED\u6682\u65E0\u6CD5\u542F\u52A8\u3002",entriesEmpty:"\u5C1A\u672A\u63A5\u7BA1 {id}\u3002",entriesExists:"\u5B58\u5728",entriesMissing:"\u7F3A\u5931",entriesManaged:"\u5DF2\u63A5\u7BA1",entriesUnmanaged:"\u672A\u63A5\u7BA1",entriesDrift:"\u6F02\u79FB",entriesNotRunning:"\u672A\u8FD0\u884C",agentTitle:"Agent \u5DE5\u5177",agentCount:"\u5DF2\u5F00\u542F {enabled}/{total}",agentMaster:"\u5141\u8BB8 Agent \u8C03\u7528\u8FD9\u4E9B\u5DE5\u5177",agentApproval:"\u4F1A\u6539\u53D8\u72B6\u6001\u7684\u5DE5\u5177\u5728\u8FD0\u884C\u524D\u4F1A\u8BF7\u6C42\u6279\u51C6\u3002",agentApprovalBadge:"\u9700\u6279\u51C6",reclaimAutoLabel:"\u88AB\u62D2\u7EDD\u65F6\u81EA\u52A8\u91CD\u65B0\u751F\u6210\u4EE4\u724C",reclaimAutoHint:"\u5DE5\u5177\u8C03\u7528\u9047\u5230\u88AB\u62D2\u7EDD\u7684\u4EE4\u724C\u65F6\u4F1A\u91CD\u65B0\u767B\u8BB0\u5E76\u91CD\u8BD5\uFF0C\u800C\u4E0D\u662F\u76F4\u63A5\u5931\u8D25\u3002",instancesNoticeLabel:"\u5411 Agent \u8BF4\u660E\u5176\u4ED6\u9762\u677F",instancesNoticeHint:"\u628A\u9762\u677F\u6E05\u5355\u52A0\u5165 Agent \u4E0A\u4E0B\u6587\uFF1B\u5B58\u5728\u591A\u4E2A\u9762\u677F\u65F6\u4F1A\u5148\u8BE2\u95EE\u8981\u64CD\u4F5C\u54EA\u4E00\u4E2A\u3002",agentToolStatus:"\u67E5\u770B\u72B6\u6001",agentToolWorkspacesList:"\u5217\u51FA\u5DE5\u4F5C\u533A",agentToolServersList:"\u5217\u51FA\u670D\u52A1\u5668",agentToolServersLifecycle:"\u542F\u52A8\u3001\u505C\u6B62\u3001\u91CD\u542F",agentToolServersEdit:"\u521B\u5EFA\u3001\u66F4\u65B0\u3001\u5220\u9664",agentToolAutostartManage:"\u7BA1\u7406\u5F00\u673A\u81EA\u542F",agentToolUiManage:"\u7BA1\u7406\u9762\u677F UI",agentToolPanelLogs:"\u9762\u677F\u65E5\u5FD7",agentToolDescStatus:"\u8BFB\u53D6\u9762\u677F\u3001\u6B63\u5728\u4F7F\u7528\u7684 CLI \u526F\u672C\u548C\u53D7\u7BA1\u6761\u76EE\u3002\u4E0D\u6539\u53D8\u4EFB\u4F55\u72B6\u6001\u3002",agentToolDescWorkspacesList:"\u5217\u51FA\u9762\u677F\u63D0\u4F9B\u7684\u6240\u6709\u5DE5\u4F5C\u533A\u53CA\u5176\u6761\u76EE\u6570\u548C\u8FD0\u884C\u6570\u3002\u670D\u52A1\u5668 id \u53EA\u5728\u5DE5\u4F5C\u533A\u5185\u552F\u4E00\u3002",agentToolDescServersList:"\u5217\u51FA\u67D0\u4E2A\u5DE5\u4F5C\u533A\u4E2D\u88AB\u76D1\u7BA1\u7684\u670D\u52A1\u5668\u53CA\u5176\u72B6\u6001\u3001\u7AEF\u53E3\u548C URL\u3002",agentToolDescServersLifecycle:"\u542F\u52A8\u3001\u505C\u6B62\u548C\u91CD\u542F\u53D7\u76D1\u7BA1\u7684\u670D\u52A1\u5668\u3002",agentToolDescServersEdit:"\u521B\u5EFA\u3001\u66F4\u65B0\u548C\u5220\u9664\u670D\u52A1\u5668\u6761\u76EE\u3002",agentToolDescAutostartManage:"\u5B89\u88C5\u6216\u79FB\u9664\u542F\u52A8\u9762\u677F\u7684\u5F00\u673A\u9879\u3002",agentToolDescUiManage:"\u67E5\u770B\u3001\u66F4\u65B0\u3001\u56DE\u9000\u6216\u5B89\u88C5\u5B98\u65B9 UI \u6784\u5EFA\u3002",agentToolDescPanelLogs:"\u8BFB\u53D6\u9762\u677F\u81EA\u8EAB\u7684\u63A7\u5236\u53F0\u8F93\u51FA\u3002\u65E0\u9700 API \u4EE4\u724C\uFF0C\u56E0\u6B64\u9762\u677F\u5728\u8FD0\u884C\u4F46\u65E0\u54CD\u5E94\u65F6\u4E5F\u80FD\u4F7F\u7528\u3002",serversTitle:"\u670D\u52A1\u5668",serversCount:"{total} \u4E2A\u4E2D {running} \u4E2A\u8FD0\u884C\u4E2D",serversHintPanel:"\u5728 home-hosted \u9762\u677F\u4E2D\u7BA1\u7406\u6761\u76EE\uFF1A",serversHintNoPanel:"\u5F53\u524D\u65E0\u6CD5\u7BA1\u7406\u6761\u76EE\uFF1A\u9762\u677F\u6CA1\u6709\u8FD0\u884C\u3002",serversEmpty:"\u9762\u677F\u672A\u62A5\u544A\u4EFB\u4F55\u670D\u52A1\u5668\u3002",serversPid:"PID",serversUrl:"URL",serversCommand:"\u547D\u4EE4",serversArgs:"\u53C2\u6570",serversCwd:"\u5DE5\u4F5C\u76EE\u5F55",serversPort:"\u7AEF\u53E3",serversOnPortConflict:"\u7AEF\u53E3\u51B2\u7A81\u65F6",serversAutostart:"\u81EA\u542F",serversPersistent:"\u6301\u4E45\u5316",serversPersistentHint:"\u7531 home-hosted \u81EA\u5E26\u7684 nanny \u6258\u7BA1\uFF0C\u505C\u6B62\u6216\u91CD\u542F\u9762\u677F\u4E0D\u4F1A\u505C\u6B62\u5B83\u3002",serversHealth:"\u5065\u5EB7\u68C0\u67E5",serversRestartPolicy:"\u91CD\u542F",serversConfiguration:"\u914D\u7F6E",serversRawConfig:"\u539F\u59CB\u914D\u7F6E",serversDisabled:"\u5DF2\u505C\u7528",serversEnabled:"\u5DF2\u542F\u7528",serversHealthHttp:"HTTP {status} \u4E8E {path}",serversHealthHttpBelow:"HTTP <{status} \u4E8E {path}",serversHealthHttpProbe:"HTTP \u63A2\u6D4B {path}",serversHealthPort:"\u7AEF\u53E3 {port}",serversHealthProbe:"\u7AEF\u53E3\u63A2\u6D4B",serversHealthEvery:"\u6BCF {seconds}",serversRestartSummary:"{retries} \u6B21\u91CD\u8BD5 \xB7 {base} \u2192 \xD7{factor}",serversStart:"\u542F\u52A8",serversStop:"\u505C\u6B62",serversRestart:"\u91CD\u542F",serversWorkspace:"\u5DE5\u4F5C\u533A",serversAdd:"\u6DFB\u52A0\u670D\u52A1\u5668",serversEdit:"\u7F16\u8F91",serversEditTitle:"\u7F16\u8F91 {id}",serversCreateTitle:"\u6DFB\u52A0\u670D\u52A1\u5668",serversEditorHint:"\u53EA\u5199\u5165\u4F60\u6539\u52A8\u7684\u5B57\u6BB5\u3002\u8FD9\u91CC\u53EA\u5217\u51FA\u5E38\u7528\u5B57\u6BB5\u2014\u2014\u4E0A\u65B9\u9762\u677F\u94FE\u63A5\u53EF\u7F16\u8F91\u5168\u90E8\u5B57\u6BB5\uFF0C\u5305\u62EC\u5F15\u5BFC\u547D\u4EE4\u3001\u73AF\u5883\u53D8\u91CF\u6587\u4EF6\u3001\u8D44\u6E90\u9650\u5236\u4E0E\u91CD\u542F\u7B56\u7565\u3002",serversCreate:"\u521B\u5EFA",serversSave:"\u4FDD\u5B58",serversDelete:"\u5220\u9664",serversDeleteTitle:"\u5220\u9664 {id}\uFF1F",serversDeleteBody:"\u8FD9\u4F1A\u4ECE\u5DE5\u4F5C\u533A {workspace} \u4E2D\u79FB\u9664\u8BE5\u6761\u76EE\uFF0C\u8FD0\u884C\u4E2D\u7684\u670D\u52A1\u5668\u4E5F\u4F1A\u968F\u4E4B\u505C\u6B62\u3002",serversDeleteGo:"\u5220\u9664",serversFreePort:"\u91CA\u653E\u7AEF\u53E3",serversFreePortTitle:"\u91CA\u653E\u7AEF\u53E3 {port}\uFF1F",serversFreePortBody:"\u505C\u6B62\u5360\u7528\u8BE5\u7AEF\u53E3\u7684\u8FDB\u7A0B\uFF0C\u9664\u975E\u5B83\u7531\u9762\u677F\u76D1\u7BA1\u3002\u8FDB\u7A0B\u5148\u6536\u5230 SIGTERM\uFF0C\u4E4B\u540E\u4F1A\u88AB\u5F3A\u5236\u505C\u6B62\u3002",serversFreePortGo:"\u91CA\u653E",serversPortFreed:"\u7AEF\u53E3 {port} \u5DF2\u91CA\u653E\u3002",serversPortHeld:"\u7AEF\u53E3 {port} \u4ECD\u88AB\u5360\u7528\u3002",serversPortSkipped:"\u8BE5\u76D1\u542C\u8005\u5C5E\u4E8E\u9762\u677F\u76D1\u7BA1\u7684\u670D\u52A1\u5668\uFF0C\u56E0\u6B64\u672A\u88AB\u52A8\u5B83\u3002",serversPortRefused:"\u7AEF\u53E3\u672A\u80FD\u91CA\u653E\uFF1A{message}",fieldId:"Id",fieldIdHint:"\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001`_` \u548C `-`\uFF1B\u5728\u5DE5\u4F5C\u533A\u5185\u552F\u4E00\u3002",fieldIdInvalid:"id \u4EE5\u5C0F\u5199\u5B57\u6BCD\u6216\u6570\u5B57\u5F00\u5934\uFF0C\u53EA\u80FD\u5305\u542B a-z\u30010-9\u3001_ \u548C -\u3002",fieldLabel:"\u6807\u7B7E",fieldCommand:"\u547D\u4EE4",fieldArgs:"\u53C2\u6570",fieldArgsHint:"\u6BCF\u884C\u4E00\u4E2A\u53C2\u6570\u3002",fieldCwd:"\u5DE5\u4F5C\u76EE\u5F55",fieldPort:"\u7AEF\u53E3",fieldPortHint:"\u7559\u7A7A\u8868\u793A\u8BE5\u6761\u76EE\u6CA1\u6709\u7AEF\u53E3\u3002",fieldPortInvalid:"\u8BF7\u8F93\u5165 1 \u5230 65535 \u4E4B\u95F4\u7684\u7AEF\u53E3\uFF0C\u6216\u7559\u7A7A\u3002",fieldAutostart:"\u968F\u9762\u677F\u542F\u52A8",fieldOnPortConflict:"\u7AEF\u53E3\u51B2\u7A81\u65F6",fieldInherit:"\u7EE7\u627F",fieldRequired:"Id \u548C\u547D\u4EE4\u4E3A\u5FC5\u586B\u3002"};function nn(e,t){return t===void 0?e:e.replace(/\{(\w+)\}/g,(n,r)=>Object.prototype.hasOwnProperty.call(t,r)?String(t[r]):n)}var je=(e,t)=>nn(Le[e]??e,t);function Ge(e){if(e!==void 0)try{let t=e.bind(xe);if(typeof t=="function")return t}catch{}return je}function ze(e,t=je){return e===void 0?t:(n,r)=>{let o;try{o=e(n,r)}catch{o=void 0}return o===void 0||o.length===0||o===n?t(n,r):o}}var V=require("react");var ie=require("react");var Ke="/home-hosted";var Ye="default";function ne(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var qe=["block","warn","follow","reclaim","kill"];var ue=["status","workspaces_list","servers_list","servers_lifecycle","servers_edit","autostart_manage","ui_manage","panel_logs"],Je=["servers_lifecycle","servers_edit","autostart_manage","ui_manage"],on=3,Vn={version:on,autostart:{enabled:!1,mechanism:"auto"},manageDsh:!1,entries:[],agentTools:{enabled:!0,allow:[...ue]},panel:{port:null},authNotice:!0,reclaimToken:!0,instancesNotice:!0,uiStyle:"detailed",cli:{prefer:"pinned"}};var rn="/api";function oe(e,t,n){return{ok:!1,error:n===void 0?{code:e,message:t}:{code:e,message:t,detail:n}}}function an(e){return e instanceof Error?e.message:String(e)}function sn(e){if(!ne(e))return oe("bad-response","The panel returned a non-object response");if(typeof e.v=="number"&&e.v!==1)return oe("version-mismatch",`Response protocol v${e.v} does not match the expected v${1}`);let t=e.result;if(!ne(t))return oe("bad-response","The panel returned no result");if(t.ok===!0)return"value"in t?{ok:!0,value:t.value}:oe("bad-response","A successful response carried no value");if(t.ok===!1){let n=t.error;return ne(n)&&typeof n.message=="string"?oe(typeof n.code=="string"?n.code:"error",n.message,n.detail):oe("error","The panel reported a failure without a message")}return oe("bad-response","The panel returned an unrecognised result")}async function k(e,t,n={}){let r=n.fetch??globalThis.fetch;if(typeof r!="function")return oe("no-fetch","No fetch implementation is available");let o={v:1,endpoint:e,payload:t},a;try{a=await r(`${rn}${Ke}`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(o)})}catch(s){return oe("network",an(s))}if(!a.ok){let s=a.statusText.length>0?` ${a.statusText}`:"";return oe("http",`HTTP ${a.status}${s}`)}let i;try{i=await a.json()}catch{return oe("bad-json","The panel returned invalid JSON")}return sn(i)}function Xe(e,t={}){return k("settings.update",{patch:e},t)}var ln=5e3;function Ze(e=ln){let[t,n]=(0,ie.useState)(null),[r,o]=(0,ie.useState)(null),[a,i]=(0,ie.useState)(!0),s=(0,ie.useRef)(!0),p=(0,ie.useCallback)(async()=>{let h=await k("status",{});s.current&&(h.ok?(n(h.value),o(null)):o(h.error),i(!1))},[]);return(0,ie.useEffect)(()=>{s.current=!0,p();let h=setInterval(()=>{p()},e);return()=>{s.current=!1,clearInterval(h)}},[p,e]),{data:t,error:r,loading:a,refresh:p}}var y=require("react/jsx-runtime");function se({size:e=14,children:t}){return(0,y.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:t})}function Qe(e){return(0,y.jsxs)(se,{...e,children:[(0,y.jsx)("rect",{x:"2.2",y:"3",width:"11.6",height:"7.6",rx:"1.6"}),(0,y.jsx)("path",{d:"M6.6 13.4h2.8M8 10.6v2.8"})]})}function et(e){return(0,y.jsxs)(se,{...e,children:[(0,y.jsx)("path",{d:"M8 2.4v5.2"}),(0,y.jsx)("path",{d:"M11.6 4.4a5 5 0 1 1-7.2 0"})]})}function tt(e){return(0,y.jsxs)(se,{...e,children:[(0,y.jsx)("rect",{x:"2.2",y:"2.8",width:"11.6",height:"10.4",rx:"1.6"}),(0,y.jsx)("path",{d:"M5.2 6.9l1.8 1.8-1.8 1.8M8.7 10.5h2.2"})]})}function nt(e){return(0,y.jsxs)(se,{...e,children:[(0,y.jsx)("path",{d:"M2.4 5.4h11.2M2.4 10.6h11.2"}),(0,y.jsx)("circle",{cx:"6",cy:"5.4",r:"1.6",fill:"currentColor",stroke:"none"}),(0,y.jsx)("circle",{cx:"10.4",cy:"10.6",r:"1.6",fill:"currentColor",stroke:"none"})]})}function ke(e){return(0,y.jsxs)(se,{...e,children:[(0,y.jsx)("path",{d:"M8 2.3l5.4 2.9L8 8.1 2.6 5.2z"}),(0,y.jsx)("path",{d:"M2.6 8.6l5.4 2.9 5.4-2.9"}),(0,y.jsx)("path",{d:"M2.6 11.4l5.4 2.9 5.4-2.9"})]})}function ot(e){return(0,y.jsxs)(se,{...e,children:[(0,y.jsx)("path",{d:"M13.4 9.4A5.5 5.5 0 1 1 12.2 4.4"}),(0,y.jsx)("path",{d:"M12.8 1.7v2.9h-2.9"})]})}function rt(e){return(0,y.jsx)(se,{...e,children:(0,y.jsx)("path",{d:"M6.2 3.8L10.4 8l-4.2 4.2"})})}function at(e){return(0,y.jsxs)(se,{...e,children:[(0,y.jsx)("path",{d:"M6.6 3.4H3.4v9.2h9.2V9.4"}),(0,y.jsx)("path",{d:"M9.4 3.4h3.2v3.2M12.6 3.4L7.8 8.2"})]})}function Te(e){return(0,y.jsxs)(se,{...e,children:[(0,y.jsx)("path",{d:"M8 2.6l5.7 10.2H2.3z"}),(0,y.jsx)("path",{d:"M8 6.4v3.1M8 11.5h.01"})]})}function it(e){return(0,y.jsx)(se,{...e,children:(0,y.jsx)("path",{d:"M3 8.4l3.3 3.3L13 5"})})}var J="\u2014";function H(e){if(e==null)return J;let t=String(e);return t.length>0?t:J}function st(e){return e.length>0?e.map(cn).join(", "):J}function cn(e){let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim().toLowerCase();return t.length===0?e:t.charAt(0).toUpperCase()+t.slice(1)}function Be(e){return Je.includes(e)}var De={status:"agentToolStatus",workspaces_list:"agentToolWorkspacesList",servers_list:"agentToolServersList",servers_lifecycle:"agentToolServersLifecycle",servers_edit:"agentToolServersEdit",autostart_manage:"agentToolAutostartManage",ui_manage:"agentToolUiManage",panel_logs:"agentToolPanelLogs"},lt={status:"agentToolDescStatus",workspaces_list:"agentToolDescWorkspacesList",servers_list:"agentToolDescServersList",servers_lifecycle:"agentToolDescServersLifecycle",servers_edit:"agentToolDescServersEdit",autostart_manage:"agentToolDescAutostartManage",ui_manage:"agentToolDescUiManage",panel_logs:"agentToolDescPanelLogs"},ct={api:"writeViaApi",file:"writeViaFile",none:"writeViaNone"},dt={enrolled:"tokenEnrolled",present:"tokenPresent",absent:"tokenAbsent",stale:"tokenStale",unknown:"tokenUnknown"},Pe={"not-installed":"bootStateNotInstalled","installed-disabled":"bootStateInstalledDisabled","enabled-running":"bootStateEnabledRunning","enabled-failing":"bootStateEnabledFailing",unsupported:"bootStateUnsupported"},pt={config:"panelCliConfig",dependency:"panelCliDependency",path:"panelCliPathSource",none:"panelCliMissing"};function Ce(e,t=52){if(e.length<=t)return e;let n=e.includes("\\")?"\\":"/",r=e.split(/[\\/]/).filter(s=>s.length>0);if(r.length<4)return e;let o=/^[A-Za-z]:$/.test(r[0]??"")?3:2;if(r.length<=o)return e;let i=`${/^[\\/]/.test(e)?n:""}${r.slice(0,o).join(n)}${n}\u2026${n}${r.slice(-2).join(n)}`;return i.length<e.length?i:e}function ht(e){let t=n=>e.source===n&&e.path!==null?{source:n,path:e.path,version:e.version}:null;return{dependency:e.dependency??t("dependency"),global:e.global??t("path")}}function dn(e,t){if(Object.is(e,t))return!0;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function ut(e,t){let n={};for(let r of Object.keys(t)){let o=e[r],a=t[r];if(ne(o)&&ne(a)){let i=ut(o,a);Object.keys(i).length>0&&(n[r]=i)}else dn(o,a)||(n[r]=a)}return n}function gt(e,t){return ut(e,t)}function mt(e,t,n){let r=new Set(e);return n?r.add(t):r.delete(t),ue.filter(o=>r.has(o))}var vt=require("react");async function ft(e){try{if(typeof navigator<"u"&&navigator.clipboard!==void 0)return await navigator.clipboard.writeText(e),!0}catch{}return!1}var d=require("react/jsx-runtime");function pn(...e){return e.filter(t=>typeof t=="string"&&t.length>0).join(" ")}function X({icon:e,title:t,action:n,children:r}){return(0,d.jsxs)("section",{className:"hh-section",children:[(0,d.jsxs)("header",{className:"hh-section-head",children:[e===void 0?null:(0,d.jsx)("span",{className:"hh-section-icon",children:e}),(0,d.jsx)("h3",{className:"hh-section-title",children:t}),(0,d.jsx)("span",{className:"hh-section-rule","aria-hidden":"true"}),n===void 0?null:(0,d.jsx)("span",{className:"hh-section-action",children:n})]}),(0,d.jsx)("div",{className:"hh-section-body",children:r})]})}function C({label:e,children:t}){return(0,d.jsxs)("div",{className:"hh-spec",children:[(0,d.jsx)("span",{className:"hh-spec-label",children:e}),(0,d.jsx)("span",{className:"hh-spec-value",children:t})]})}function re({children:e}){return(0,d.jsx)("code",{className:"hh-code",children:e})}function m({children:e}){return typeof e=="string"&&e.length===0?null:(0,d.jsx)("p",{className:"hh-hint",children:e})}function U({tone:e,children:t}){return(0,d.jsx)("span",{className:"hh-chip","data-tone":e??"idle",children:t})}function pe({href:e,children:t}){return(0,d.jsxs)("a",{className:"hh-link",href:e,target:"_blank",rel:"noreferrer noopener",children:[t??e,(0,d.jsx)("span",{className:"hh-link-icon","aria-hidden":"true",children:(0,d.jsx)(at,{size:11})})]})}function le({label:e,open:t=!1,children:n}){return(0,d.jsxs)("details",{className:"hh-details",open:t||void 0,children:[(0,d.jsxs)("summary",{className:"hh-summary",children:[(0,d.jsx)("span",{className:"hh-chevron","aria-hidden":"true",children:(0,d.jsx)(rt,{size:12})}),e]}),(0,d.jsx)("div",{className:"hh-details-body",children:n})]})}function G({tone:e="bad",icon:t=!0,title:n,children:r}){return(0,d.jsxs)("div",{className:"hh-note","data-tone":e,role:e==="bad"?"alert":"note",children:[t?(0,d.jsx)("span",{className:"hh-note-icon","aria-hidden":"true",children:(0,d.jsx)(Te,{size:13})}):null,(0,d.jsxs)("div",{className:"hh-note-body",children:[n===void 0?null:(0,d.jsx)("span",{className:"hh-note-title",children:n}),typeof r=="string"?(0,d.jsx)("p",{children:r}):r]})]})}function Ne({title:e,detail:t}){return(0,d.jsxs)("div",{className:"hh-note",role:"alert",children:[(0,d.jsx)("span",{className:"hh-note-icon","aria-hidden":"true",children:(0,d.jsx)(Te,{size:13})}),(0,d.jsxs)("div",{className:"hh-note-body",children:[(0,d.jsx)("strong",{children:e}),t.length>0?(0,d.jsx)("p",{children:t}):null]})]})}function ye({error:e,title:t}){return e===null?null:(0,d.jsxs)("div",{className:"hh-note",role:"alert",children:[(0,d.jsx)("span",{className:"hh-note-icon","aria-hidden":"true",children:(0,d.jsx)(Te,{size:13})}),(0,d.jsxs)("div",{className:"hh-note-body",children:[(0,d.jsx)("strong",{children:t}),(0,d.jsxs)("p",{children:[(0,d.jsx)("code",{children:e.code})," \u2014 ",e.message]})]})]})}function hn(){return(0,d.jsx)("span",{className:"hh-spinner","aria-hidden":"true"})}function b({children:e,onClick:t,disabled:n,busy:r,variant:o="default",icon:a,title:i}){let s=n===!0||r===!0;return(0,d.jsxs)("button",{type:"button",className:pn("hh-btn",o!=="default"&&`hh-btn-${o}`),onClick:t,disabled:s,title:i,children:[r===!0?(0,d.jsx)(hn,{}):a,e]})}function ve({label:e,checked:t,disabled:n,onChange:r}){return(0,d.jsxs)("button",{type:"button",role:"switch",className:"hh-switch","aria-checked":t,disabled:n,onClick:()=>r(!t),children:[(0,d.jsx)("span",{className:"hh-switch-track","aria-hidden":"true",children:(0,d.jsx)("span",{className:"hh-switch-knob"})}),(0,d.jsx)("span",{className:"hh-check-label",children:e})]})}function bt({label:e,checked:t,disabled:n,onChange:r}){return(0,d.jsxs)("label",{className:"hh-check",children:[(0,d.jsx)("input",{type:"checkbox",checked:t,disabled:n,onChange:o=>r(o.target.checked)}),(0,d.jsx)("span",{className:"hh-check-label",children:e})]})}function fe({value:e,options:t,disabled:n,label:r,onChange:o}){return(0,d.jsx)("select",{className:"hh-select",value:e,disabled:n,"aria-label":r,onChange:a=>o(a.target.value),children:t.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))})}function we({label:e,meta:t,path:n,hint:r,checked:o,disabled:a,onChange:i}){return(0,d.jsxs)("label",{className:"hh-choice-option","data-disabled":a===!0,children:[(0,d.jsx)("input",{type:"radio",checked:o,disabled:a,onChange:()=>i()}),(0,d.jsxs)("span",{className:"hh-choice-label",children:[(0,d.jsx)("span",{children:e}),r]}),t===void 0?null:(0,d.jsx)("span",{className:"hh-choice-meta",children:t}),n===void 0?null:(0,d.jsx)("span",{className:"hh-choice-path",title:n,children:Ce(n)})]})}function Ee({children:e}){return(0,d.jsxs)(U,{tone:"accent",children:[(0,d.jsx)(it,{size:10}),e]})}function Se({text:e,copyLabel:t,copiedLabel:n}){let[r,o]=(0,vt.useState)(!1);return(0,d.jsxs)("div",{className:"hh-code-box",children:[(0,d.jsx)("textarea",{className:"hh-code-text",readOnly:!0,value:e,rows:Math.min(e.split(`
4
- `).length,4)}),(0,d.jsx)("div",{className:"hh-btn-row",children:(0,d.jsx)(b,{variant:"ghost",onClick:()=>{ft(e).then(o)},children:r?n:t})})]})}var T=require("react/jsx-runtime");function yt({t:e,status:t,updateSettings:n,busy:r,uiStyle:o}){let a=t.settings.agentTools,i=a.allow??[],s=ue.filter(h=>i.includes(h)).length,p=(h,g)=>{n(v=>({...v,agentTools:{...v.agentTools,allow:mt(v.agentTools.allow??[],h,g)}}))};return(0,T.jsxs)(X,{icon:(0,T.jsx)(nt,{}),title:e("agentTitle"),action:(0,T.jsx)(U,{children:e("agentCount",{enabled:s,total:ue.length})}),children:[(0,T.jsx)(ve,{label:e("agentMaster"),checked:a.enabled,disabled:r==="settings",onChange:h=>n(g=>({...g,agentTools:{...g.agentTools,enabled:h}}))}),(0,T.jsxs)("div",{className:"hh-field-block",children:[(0,T.jsx)(ve,{label:e("reclaimAutoLabel"),checked:t.settings.reclaimToken!==!1,disabled:r==="settings",onChange:h=>n(g=>({...g,reclaimToken:h}))}),(0,T.jsx)(m,{children:e("reclaimAutoHint")})]}),(0,T.jsxs)("div",{className:"hh-field-block",children:[(0,T.jsx)(ve,{label:e("instancesNoticeLabel"),checked:t.settings.instancesNotice!==!1,disabled:r==="settings",onChange:h=>n(g=>({...g,instancesNotice:h}))}),(0,T.jsx)(m,{children:e("instancesNoticeHint")})]}),(0,T.jsx)(m,{children:e("agentApproval")}),o==="detailed"?(0,T.jsx)("div",{className:"hh-tool-cards",children:ue.map(h=>(0,T.jsxs)("label",{className:"hh-tool-card",children:[(0,T.jsx)("input",{type:"checkbox",checked:i.includes(h),disabled:!a.enabled,onChange:g=>p(h,g.target.checked)}),(0,T.jsxs)("span",{className:"hh-tool-card-body",children:[(0,T.jsxs)("span",{className:"hh-tool-card-head",children:[(0,T.jsx)("span",{className:"hh-tool-card-name",children:e(De[h])}),Be(h)?(0,T.jsx)(U,{tone:"warn",children:e("agentApprovalBadge")}):null]}),(0,T.jsx)("span",{className:"hh-tool-card-desc",children:e(lt[h])})]})]},h))}):(0,T.jsx)("div",{className:"hh-tools",children:ue.map(h=>(0,T.jsx)(bt,{label:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("span",{className:"hh-check-text",children:e(De[h])}),Be(h)?(0,T.jsx)(U,{tone:"warn",children:e("agentApprovalBadge")}):null]}),checked:i.includes(h),disabled:!a.enabled,onChange:g=>p(h,g)},h))})]})}var Ct=require("react");function wt(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function St(e){if(typeof e!="object"||e===null)return null;let t=e.result;if(typeof t!="object"||t===null)return null;let{ok:n,detail:r,commands:o}=t;return n!==!1?null:{detail:typeof r=="string"?r:"",commands:wt(o)}}function xt(e){return typeof e!="object"||e===null||Array.isArray(e)?null:{ok:e.ok===!0,action:e.action==="uninstall"?"uninstall":"install",detail:typeof e.detail=="string"?e.detail:"",commands:wt(e.commands),mechanism:e.mechanism??null}}var un=["enabled-running","enabled-failing","installed-disabled"];function kt(e,t){let n=e.filter(a=>a.available).map(a=>a.mechanism),r=n.filter(a=>a!=="unsupported"),o=["auto",...r.length>0?r:n];return o.includes(t)||o.push(t),o}function Tt(e,t){return e!==null&&e!==t}function gn(e,t){return e===null||e.ok?!1:e.action==="install"?un.includes(t):t==="not-installed"}function Pt(e,t,n,r){return e!==null&&e.state===n&&e.mechanism===r?e:t!==null&&t.mechanism!==r||gn(t,n)?null:t}var w=require("react/jsx-runtime");function Nt({t:e,status:t,run:n,updateSettings:r,busy:o,uiStyle:a}){let i=t.boot,s=t.settings.autostart,p=i.candidates??[],h=i.commands??[],[g,v]=(0,Ct.useState)(null),F=o==="boot.install"||o==="boot.uninstall",R=kt(p,s.mechanism).map(L=>({value:L,label:L==="auto"?e("bootMechanismAuto"):L})),A=Tt(i.mechanism,s.mechanism),z=L=>p.find(E=>E.mechanism===L)?.reason??null,$=typeof i.recommended=="string"&&i.recommended.length>0&&i.recommended!==i.mechanism?i.recommended:null,S=$===null?e("bootMechanismAutoHint"):`${e("bootMechanismAutoHint")} ${e("bootMechanismAutoPicks",{mechanism:$})}`,B=s.mechanism==="auto"?S:z(s.mechanism),q=i.mechanism===null?null:z(i.mechanism),K=i.mechanism!==null,ae=t.panel.reachable&&!A&&!K,Q=t.panel.reachable&&A,de=L=>e(L==="install"?"bootActionInstall":"bootActionUninstall"),ee=async L=>{let E=await n(`boot.${L}`,async()=>L==="install"?k("boot.install",s.mechanism==="auto"?{}:{mechanism:s.mechanism}):k("boot.uninstall",{}));if(!E.ok){v(null);return}let D=St(E.value);v(D===null?null:{ok:!1,action:L,detail:D.detail,commands:D.commands,state:i.state,mechanism:i.mechanism})},te=xt(s.lastAttempt),N=Pt(g,te,i.state,i.mechanism);return(0,w.jsxs)(X,{icon:(0,w.jsx)(et,{}),title:e("bootTitle"),action:(0,w.jsx)(fe,{value:s.mechanism,options:R,label:e("bootMechanism"),disabled:o==="settings"||F,onChange:L=>r(E=>({...E,autostart:{...E.autostart,mechanism:L}}))}),children:[B!==null&&B.length>0?(0,w.jsx)(m,{children:B}):null,ae?(0,w.jsx)(m,{children:e("bootHandover")}):null,Q?(0,w.jsx)(G,{tone:"warn",children:e("bootSwitchRetires")}):null,(0,w.jsxs)("div",{className:"hh-btn-row",children:[(0,w.jsx)(b,{variant:K?"default":"primary",disabled:s.mechanism==="unsupported",busy:o==="boot.install",onClick:()=>{ee("install")},children:e(A?"bootSwitchMode":"bootEnabled")}),(0,w.jsx)(b,{disabled:!K,busy:o==="boot.uninstall",onClick:()=>{ee("uninstall")},children:e("bootUninstall")}),(0,w.jsx)(b,{variant:"ghost",busy:o==="boot.verify",onClick:()=>{n("boot.verify",()=>k("boot.verify",{}))},children:e("bootRecheck")})]}),s.enabled&&i.state==="not-installed"?(0,w.jsx)(G,{tone:"warn",children:e("bootRequestedNotInstalled")}):null,N!==null&&!N.ok?(0,w.jsxs)("div",{className:"hh-section-body",children:[(0,w.jsx)(Ne,{title:e("bootAttemptFailed",{action:de(N.action)}),detail:N.detail.length>0?N.detail:e("bootAttemptNoDetail")}),N.commands.length>0?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(m,{children:e("bootAttemptCommands")}),(0,w.jsx)(Se,{text:N.commands.join(`
5
- `),copyLabel:e("copy"),copiedLabel:e("copied")})]}):null]}):null,N!==null&&N.ok?(0,w.jsx)(m,{children:e("bootAttemptSucceeded",{action:de(N.action),detail:N.detail})}):null,h.length>0?(0,w.jsxs)(le,{label:e("bootCommandsLabel"),open:a==="detailed",children:[(0,w.jsx)(m,{children:e("bootCommandsExplain")}),(0,w.jsx)(Se,{text:h.join(`
6
- `),copyLabel:e("copy"),copiedLabel:e("copied")})]}):null,(0,w.jsxs)(le,{label:e("details"),open:a==="detailed",children:[(0,w.jsx)(C,{label:e("bootState"),children:e(Pe[i.state]??"bootStateUnsupported")}),(0,w.jsx)(C,{label:e("bootBootCapable"),children:i.bootCapable?e("yes"):e("no")}),(0,w.jsx)(C,{label:e("bootPrivileged"),children:i.privileged?e("yes"):e("no")}),(0,w.jsx)(C,{label:e("bootUnitPath"),children:(0,w.jsx)(re,{children:H(i.unitPath)})}),(0,w.jsx)(C,{label:e("bootMechanism"),children:H(i.mechanism)}),q===null?null:(0,w.jsx)(m,{children:q}),i.detail.length>0?(0,w.jsx)(m,{children:i.detail}):null]})]})}var O=require("react/jsx-runtime");function mn(e){return e.defaultEntryId??"dsh"}function Et({t:e,status:t,run:n,busy:r}){let o=t.entries??[],a=t.settings.manageDsh===!0,i=t.boot.platform==="win32",s=t.surface==="desktop",p=mn(t),h=g=>{if(g){let v={id:p,autostart:!0};n("entries.apply",()=>k("entries.apply",{intents:[v]}))}else n("entries.remove",()=>k("entries.remove",{id:p}))};return(0,O.jsxs)(X,{icon:(0,O.jsx)(tt,{}),title:e("entriesTitle"),children:[(0,O.jsx)(ve,{label:e("entriesManage",{id:p}),checked:s?!1:a,disabled:r!==null||s,onChange:h}),s?(0,O.jsx)(G,{tone:"warn",children:e("entriesManageDesktop",{id:p})}):(0,O.jsx)(m,{children:e("entriesManageNote",{id:p})}),i?(0,O.jsx)(G,{tone:"warn",children:e("entriesManageWinWarning",{id:p})}):null,o.length===0?(0,O.jsx)(m,{children:e("entriesEmpty",{id:p})}):(0,O.jsx)("div",{className:"hh-list",children:o.map(g=>{let v=g.live;return(0,O.jsxs)("div",{className:"hh-item",children:[(0,O.jsxs)("span",{className:"hh-item-main",children:[(0,O.jsx)("span",{className:"hh-item-name",children:g.intent.id}),(0,O.jsx)(U,{tone:g.exists?"ok":"bad",children:g.exists?e("entriesExists"):e("entriesMissing")}),(0,O.jsx)(U,{children:g.managed?e("entriesManaged"):e("entriesUnmanaged")}),g.drift.length>0?(0,O.jsx)(U,{tone:"warn",children:`${e("entriesDrift")} ${st(g.drift)}`}):null]}),(0,O.jsx)("span",{className:"hh-item-spacer"}),(0,O.jsx)("span",{className:"hh-item-meta",children:v===null?e("entriesNotRunning"):`${H(v.status)}${v.pid===null?"":` \xB7 pid ${v.pid}`}`})]},g.intent.id)})})]})}var ce=require("react");var l=require("react/jsx-runtime"),fn={absent:"panelTokenWarnAbsent",present:"panelTokenWarnPresent",stale:"panelTokenWarnStale"};function vn(e){if(e.token!=="enrolled")return e.token!=="unknown"?fn[e.token]:e.url===null?void 0:"panelTokenWarnUnreachable"}function bn(e,t){if(!e.ok)return t("panelTokenRegenerateFailed",{message:e.error.message});let n=e.value?.panel;return n!==void 0&&n.detail.length>0?n.detail:t("panelTokenRegenerated")}var yn=new Set(["network","no-fetch","client"]);function wn(e,t){return e.ok?e.value?.detail||t("panelStopped"):yn.has(e.error.code)?t("panelStopping"):t("panelStopFailed",{message:e.error.message})}function Rt(e,t,n){let r=n==="start"?"panelStartFailed":"panelReplaceFailed";if(!e.ok)return t(r,{message:e.error.message});let o=e.value;return o?.ok===!1?t(r,{message:o.detail??""}):o?.detail&&o.detail.length>0?o.detail:null}function Sn({value:e,label:t,hint:n,invalidLabel:r,placeholder:o,disabled:a,onChange:i}){let[s,p]=(0,ce.useState)(e===null?"":String(e));(0,ce.useEffect)(()=>{p(e===null?"":String(e))},[e]);let h=s.trim()===""?null:Number(s),g=h!==null&&(!Number.isInteger(h)||h<1||h>65535),v=()=>{if(g){p(e===null?"":String(e));return}h!==e&&i(h)};return(0,l.jsxs)("div",{className:"hh-field-block",children:[(0,l.jsxs)("div",{className:"hh-field",children:[(0,l.jsx)("label",{className:"hh-field-label",htmlFor:"hh-panel-port",children:t}),(0,l.jsx)("input",{id:"hh-panel-port",className:"hh-input",type:"number",value:s,placeholder:o,disabled:a,onChange:F=>p(F.target.value),onBlur:v,onKeyDown:F=>{F.key==="Enter"&&v()}})]}),(0,l.jsx)(m,{children:g?r:n})]})}function At({t:e,status:t,run:n,updateSettings:r,busy:o,uiStyle:a}){let i=t.panel,s=t.cli,p=t.instances??[],h=s?.prefer??t.settings.cli?.prefer??"pinned",[g,v]=(0,ce.useState)(!1),[F,M]=(0,ce.useState)(null),[R,A]=(0,ce.useState)(null),[z,$]=(0,ce.useState)(!1),[S,B]=(0,ce.useState)(null),[q,K]=(0,ce.useState)(null),ae=vn(i),Q=s?.version??null,de=Q!==null&&i.version!==null,ee=i.reachable&&de&&Q!==i.version,{dependency:te,global:N}=s===void 0?{dependency:null,global:null}:ht(s),L=s===void 0?[]:[`pnpm add -g home-hosted@${s.expectedRange}`,`npm install -g home-hosted@${s.expectedRange}`],E=P=>{r(_=>({..._,cli:{..._.cli,prefer:P}}))},D=async()=>{let P=await n("cli.installGlobal",()=>k("cli.installGlobal",{}));if(!P.ok){M(e("panelInstallFailed",{message:P.error.message}));return}let _=P.value;_?.ok===!1?M(_.output&&_.output.length>0?_.output:e("panelInstallFailed",{message:_.detail??""})):M(typeof _?.output=="string"?_.output:null)},j=async()=>{A(bn(await n("panel.reclaimToken",()=>k("panel.reclaimToken",{})),e))},u=async()=>{K(Rt(await n("panel.start",()=>k("panel.start",{})),e,"start"))},Y=async()=>{v(!1),K(Rt(await n("panel.takeover",()=>k("panel.takeover",{})),e,"replace"))},I=async()=>{$(!1),B(e("panelStopping")),B(wn(await n("panel.stop",()=>k("panel.stop",{})),e))};return(0,l.jsxs)(X,{icon:(0,l.jsx)(Qe,{}),title:e("panelTitle"),children:[ae===void 0?null:(0,l.jsxs)(G,{tone:"warn",title:e("panelTokenWarningTitle"),children:[(0,l.jsx)("p",{children:e(ae)}),i.reachable||i.token==="unknown"?null:(0,l.jsx)("p",{children:e("panelTokenWarnPanelDown")}),(0,l.jsx)("div",{className:"hh-note-actions",children:(0,l.jsx)(b,{variant:"primary",busy:o==="panel.reclaimToken",onClick:()=>{j()},children:e("panelTokenRegenerate")})})]}),R===null?null:(0,l.jsx)(m,{children:R}),s===void 0?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"hh-choice",role:"radiogroup","aria-label":e("panelCopy"),children:[(0,l.jsx)(we,{label:e("optionsPreferPinned"),hint:(0,l.jsx)(Ee,{children:e("optionsRecommended")}),meta:te===null?void 0:H(te.version),path:te?.path??void 0,checked:h==="pinned",disabled:te===null||o==="settings",onChange:()=>E("pinned")}),(0,l.jsx)(we,{label:e("optionsPreferGlobal"),meta:N===null?void 0:H(N.version),path:N?.path??void 0,checked:h==="global",disabled:N===null||o==="settings",onChange:()=>E("global")})]}),(0,l.jsx)(m,{children:e("panelCopyHint")}),s.source==="config"?(0,l.jsx)(m,{children:e("optionsConfigOverride")}):null,s.source==="path"&&h!=="global"?(0,l.jsx)(m,{children:e("panelCliNotPinned",{range:s.expectedRange})}):null,s.supported?null:(0,l.jsx)(G,{tone:"warn",children:e("panelCliUnsupported")}),s.launcherPath!=null&&s.launcherVersion==null?(0,l.jsx)(G,{tone:"warn",children:e("panelCliLauncherFailed")}):null]}),(0,l.jsx)(Sn,{value:t.settings.panel?.port??null,label:e("panelPort"),hint:i.reachable?e("panelPortHint"):e("panelPortFree"),invalidLabel:e("panelPortInvalid"),placeholder:i.configPort==null?void 0:String(i.configPort),disabled:i.reachable||o!==null,onChange:P=>r(_=>({..._,panel:{..._.panel,port:P}}))}),t.panelRootSource!=="legacy"?null:(0,l.jsx)(m,{children:e("panelRootLegacy")}),p.length<=1?null:(0,l.jsxs)(le,{label:e("panelInstances",{count:p.length}),open:a==="detailed",children:[p.map(P=>(0,l.jsxs)(C,{label:P.managed?e("panelInstanceManaged"):e("panelInstanceOther"),children:[(0,l.jsx)(re,{children:P.home}),P.url===null?null:(0,l.jsxs)(l.Fragment,{children:[" \xB7 ",(0,l.jsx)(pe,{href:P.url,children:P.url})]}),` \xB7 ${P.running?e("stateAnswering"):e("stateNotAnswering")}`,P.version===null?null:` \xB7 ${P.version}`,P.hosting?` \xB7 ${e("panelInstanceHosts")}`:null]},P.home)),(0,l.jsx)(m,{children:e("panelInstancesHint")})]}),ee?(0,l.jsx)(m,{children:e("panelOutdated")}):null,(0,l.jsxs)("div",{className:"hh-btn-row",children:[i.reachable?null:(0,l.jsx)(b,{variant:"primary",busy:o==="panel.start",onClick:()=>{u()},children:e("panelStart")}),i.reachable?(0,l.jsx)(b,{variant:"danger",disabled:o!==null,onClick:()=>$(!0),children:e("panelStop")}):null,ee&&!g?(0,l.jsx)(b,{variant:"primary",onClick:()=>v(!0),children:e("panelReplace",{copy:e(h==="global"?"panelCopyGlobal":"panelCopyPinned")})}):null]}),S===null?null:(0,l.jsx)(m,{children:S}),q===null?null:(0,l.jsx)(m,{children:q}),z?(0,l.jsx)("div",{className:"hh-note",role:"alertdialog","aria-label":e("panelStopTitle"),children:(0,l.jsxs)("div",{className:"hh-note-body",children:[(0,l.jsx)("strong",{children:e("panelStopTitle")}),(0,l.jsx)("p",{children:e("panelStopBody")}),(0,l.jsxs)("div",{className:"hh-note-actions",children:[(0,l.jsx)(b,{onClick:()=>$(!1),children:e("confirmCancel")}),(0,l.jsx)(b,{variant:"danger",busy:o==="panel.stop",onClick:()=>{I()},children:e("confirmStop")})]})]})}):null,ee&&g?(0,l.jsx)("div",{className:"hh-note",role:"alertdialog","aria-label":e("panelTakeoverTitle"),children:(0,l.jsxs)("div",{className:"hh-note-body",children:[(0,l.jsx)("strong",{children:e("panelTakeoverTitle")}),(0,l.jsx)("p",{children:e("panelTakeoverBody",{id:t.defaultEntryId??"dsh"})}),(0,l.jsxs)("div",{className:"hh-note-actions",children:[(0,l.jsx)(b,{onClick:()=>v(!1),children:e("confirmCancel")}),(0,l.jsx)(b,{variant:"danger",busy:o==="panel.takeover",onClick:()=>{Y()},children:e("confirmReplace")})]})]})}):null,s!==void 0&&N===null?(0,l.jsxs)(le,{label:e("optionsInstallLabel"),open:a==="detailed",children:[(0,l.jsx)(m,{children:e("optionsInstallHint")}),(0,l.jsx)(Se,{text:L.join(`
7
- `),copyLabel:e("copy"),copiedLabel:e("copied")}),(0,l.jsx)("div",{className:"hh-btn-row",children:(0,l.jsx)(b,{busy:o==="cli.installGlobal",onClick:()=>{D()},children:e("optionsInstall")})}),F===null?null:(0,l.jsx)("pre",{className:"hh-output",children:F})]}):null,(0,l.jsxs)(le,{label:e("details"),open:a==="detailed",children:[(0,l.jsxs)(C,{label:e("panelHome"),children:[(0,l.jsx)(re,{children:i.home}),t.bootUnitName===void 0?null:(0,l.jsxs)(l.Fragment,{children:[" \xB7 ",t.bootUnitName]})]}),(0,l.jsx)(C,{label:e("panelUrl"),children:i.url===null?H(i.url):(0,l.jsx)(pe,{href:i.url,children:i.url})}),(0,l.jsx)(C,{label:e("panelVersion"),children:H(i.version)}),(0,l.jsx)(C,{label:e("panelPid"),children:H(i.pid)}),(0,l.jsx)(C,{label:e("panelWriteVia"),children:e(ct[i.writeVia]??"writeViaNone")}),(0,l.jsx)(C,{label:e("panelToken"),children:e(dt[i.token]??"tokenUnknown")}),s===void 0?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(C,{label:e("panelCliSource"),children:`${e(pt[s.source]??"panelCliMissing")} \xB7 ${H(s.version)}`}),(0,l.jsx)(C,{label:e("panelCliPath"),children:(0,l.jsx)(re,{children:H(s.path)})})]}),i.detail.length>0?(0,l.jsx)(m,{children:i.detail}):null]})]})}var me=require("react");var It=require("react");var x=require("react/jsx-runtime");function Oe(e){return{id:e.id,label:e.label??"",command:e.command??"",args:(e.args??[]).join(`
3
+ "use strict";var Me=Object.defineProperty;var qt=Object.getOwnPropertyDescriptor;var Jt=Object.getOwnPropertyNames;var Xt=Object.prototype.hasOwnProperty;var Zt=(e,t)=>{for(var n in t)Me(e,n,{get:t[n],enumerable:!0})},Qt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Jt(t))!Xt.call(e,o)&&o!==n&&Me(e,o,{get:()=>t[o],enumerable:!(r=qt(t,o))||r.enumerable});return e};var en=e=>Qt(Me({},"__esModule",{value:!0}),e);var On={};Zt(On,{apply:()=>Dn,inject:()=>Bn});module.exports=en(On);var we="homeHosted",Le={tab:"Home Hosted",loading:"Loading\u2026",refresh:"Refresh",retry:"Retry",errorTitle:"Error",statusUnavailable:"The panel did not answer.",yes:"Yes",no:"No",copy:"Copy",copied:"Copied",details:"Details",uiStyleLabel:"Page style",uiStyleDetailed:"Detailed",uiStyleCompact:"Compact",workspacesTitle:"Workspaces",workspacesHint:"Every workspace this panel serves. Viewing one decides what this page lists.",workspacesViewLabel:"Workspace to view",workspacesEmpty:"The panel reports no workspaces yet.",workspacesManagedTag:"managed by the plugin",workspacesViewingTag:"viewing",workspacesCounts:"{servers} servers \xB7 {running} running",workspacesCountsFile:"{servers} in the config files",workspacesDegraded:"The panel is not answering, so these counts \u2014 and the entry list below \u2014 come from the workspace config files, not from live state.",workspaceLegacyTitle:"This state root still uses the pre-0.7 layout",workspaceLegacyBody:"home-hosted 0.8 no longer relocates it, and the plugin cannot read or write these files until they move into .hh. Install the latest 0.7.x once \u2014 its first run does the move \u2014 then start this release. Nothing has been changed or deleted.",sigPanel:"Panel",sigAutostart:"Autostart",sigEntry:"{id} entry",stateAnswering:"answering",stateNotAnswering:"not answering",stateManaged:"managed",stateNotManaged:"not managed",stateWebOnly:"web only",panelTitle:"Panel",panelCopy:"Which copy runs the panel",panelCopyHint:"The pinned copy ships with this plugin; the global one is on PATH.",optionsPreferPinned:"Pinned dependency",optionsPreferGlobal:"Global install",optionsRecommended:"recommended",optionsConfigOverride:"The plugin row sets homeHostedCommand, and that always wins.",optionsInstallLabel:"Install a global copy",optionsInstallHint:"No global install was found. Install the pinned range, then choose it above:",optionsInstall:"Install globally",panelHome:"Panel root",panelUrl:"URL",panelVersion:"Version",panelPid:"PID",panelWriteVia:"Writes via",panelToken:"API token",panelCliSource:"CLI",panelCliPath:"CLI path",panelCliConfig:"configured command",panelCliDependency:"pinned dependency",panelCliPathSource:"global install (PATH)",panelCliMissing:"not found",panelCliNotPinned:"This host resolved a global home-hosted instead of the pinned copy ({range}).",panelCliUnsupported:"This home-hosted is older than the oldest release the plugin supports.",panelCliLauncherFailed:"The boot launcher did not answer, so a boot entry may fail to start the panel.",panelPort:"Panel port",panelPortHint:"Only changeable while the panel is stopped.",panelPortFree:"Leave empty to use the port in the config.",panelPortInvalid:"Enter a port between 1 and 65535.",panelStart:"Start the panel",panelStop:"Stop the panel",panelStopTitle:"Stop the running panel?",panelStopBody:"This stops the panel and all non-persistent servers it supervises. Persistent entries keep running. An autostart entry starts the rest again at the next panel start.",panelStopping:"Stopping the panel\u2026",panelStopped:"The panel stopped.",panelStopFailed:"The panel did not stop: {message}",panelStartFailed:"The panel did not start: {message}",panelReplaceFailed:"The panel was not replaced: {message}",panelInstallFailed:"Installing home-hosted globally failed: {message}",panelRootLegacy:"Adopted from ~/.home-hosted. Set HHOSTED_HOME to give this dsh its own panel.",confirmStop:"Stop",panelOutdated:"Outdated panel",panelReplace:"Restart with {copy}",panelCopyPinned:"pinned dependency",panelCopyGlobal:"global install",panelTakeoverTitle:"Restart the running panel?",panelTakeoverBody:"This stops the panel and all non-persistent servers it supervises. Persistent entries keep running. It needs the {id} entry adopted with autostart on.",confirmCancel:"Cancel",confirmReplace:"Restart",writeViaApi:"authenticated API",writeViaFile:"config file",writeViaNone:"unavailable",tokenEnrolled:"enrolled",tokenPresent:"present",tokenAbsent:"absent",tokenStale:"stale",tokenUnknown:"unknown",panelTokenWarningTitle:"The panel API token is missing or refused",panelTokenWarnAbsent:"This plugin has no API token for the panel, so it cannot read or write the panel; regenerate one.",panelTokenWarnPresent:"home-hosted holds an API token this plugin does not have, so the plugin cannot authenticate; regenerate one to replace it.",panelTokenWarnStale:"The panel refused this plugin's API token; regenerate it.",panelTokenWarnUnreachable:"The plugin could not reach the panel to check its API token, so it cannot read or write the panel; the panel may need starting.",panelTokenWarnPanelDown:"The panel is not answering right now, so it may need starting too.",panelTokenRegenerate:"Regenerate token",panelTokenRegenerated:"A fresh API token was enrolled for the panel.",panelTokenRegenerateFailed:"The token was not replaced: {message}",panelInstances:"{count} panels found",panelInstanceManaged:"managed by this plugin",panelInstanceOther:"another panel",panelInstanceHosts:"hosts this dsh",panelInstancesHint:"This plugin drives only the managed one; the others are read from their state roots and never written to.",bootTitle:"Autostart",bootEnabled:"Enable autostart",bootUninstall:"Uninstall",bootSwitchMode:"Switch autostart",bootRecheck:"Re-check",bootMechanism:"Mechanism",bootMechanismAuto:"Automatic",bootMechanismAutoHint:"Picked from what this machine can actually use, preferring a mechanism that starts before you log in.",bootMechanismAutoPicks:"The next install would use {mechanism}.",bootState:"State",bootStateNotInstalled:"not installed",bootStateInstalledDisabled:"installed, off",bootStateEnabledRunning:"enabled, running",bootStateEnabledFailing:"enabled, failing",bootStateUnsupported:"unsupported",bootBootCapable:"Starts before login",bootPrivileged:"This process can install it",bootUnitPath:"Unit path",bootCommandsLabel:"Install by hand",bootCommandsExplain:"This process cannot elevate. Run these commands to install autostart:",bootRequestedNotInstalled:"Autostart is requested, but no boot entry is installed.",bootHandover:"Enabling this stops the panel this plugin started and starts it through the entry. Persistent entries keep running, so this session stays up and the page keeps working; it shows the panel again once it answers.",bootSwitchRetires:"Switching stops the panel and removes the previous autostart entry. Persistent entries keep running, so this session stays up and the page keeps working; it shows the panel again once the entry starts one.",bootActionInstall:"install",bootActionUninstall:"uninstall",bootAttemptFailed:"{action} failed",bootAttemptSucceeded:"{action} succeeded \u2014 {detail}",bootAttemptNoDetail:"The host did not explain the refusal.",bootAttemptCommands:"Run these yourself:",entriesTitle:"Managed entry",entriesManage:"Manage {id}",entriesManageNote:"Hands {id} to home-hosted: boot autostart, panel control, port reclaim.",entriesManageDesktop:"Available for dsh web only. Desktop starts its own profile, so it is never one of the panel's entries \u2014 servers are still managed here.",entriesManageWinWarning:"On Windows, `{id}` is managed via the `kill` onPortConflict policy, so when it is restarted detached by another plugin it may briefly fail to boot while home-hosted reclaims the process and port.",entriesEmpty:"{id} is not managed yet.",entriesExists:"exists",entriesMissing:"missing",entriesManaged:"managed",entriesUnmanaged:"unmanaged",entriesDrift:"drift",entriesNotRunning:"not running",agentTitle:"Agent tools",agentCount:"{enabled} of {total} on",agentMaster:"Let the agent use these tools",agentApproval:"Tools that change something ask for approval first.",agentApprovalBadge:"approval",reclaimAutoLabel:"Regenerate token automatically",reclaimAutoHint:"A tool call that finds a refused token re-enrols one and retries instead of failing.",instancesNoticeLabel:"Tell the agent about other panels",instancesNoticeHint:"Adds the panel inventory to the agent's context, and asks which panel to act on when several exist.",agentToolStatus:"Status",agentToolWorkspacesList:"List workspaces",agentToolServersList:"List servers",agentToolServersLifecycle:"Start, stop, restart",agentToolServersEdit:"Create, update, delete",agentToolAutostartManage:"Manage boot autostart",agentToolUiManage:"Manage Panel UI",agentToolPanelLogs:"Panel Logs",agentToolDescStatus:"Read the panel, the CLI copy in use and the managed entry. Nothing changes.",agentToolDescWorkspacesList:"List every workspace the panel serves, with its entry and running counts. A server id is only unique inside a workspace.",agentToolDescServersList:"List the servers of one workspace, with status, port and URL.",agentToolDescServersLifecycle:"Start, stop and restart supervised servers.",agentToolDescServersEdit:"Create, update and delete server entries.",agentToolDescAutostartManage:"Install or remove the boot entry that starts the panel.",agentToolDescUiManage:"Inspect, update, revert or install an official UI build.",agentToolDescPanelLogs:"Read the panel's own console output. Needs no API token, so it works when the panel is up but not answering.",serversTitle:"Servers",serversCount:"{running} of {total} running",serversHintPanel:"Entries are managed in the home-hosted panel:",serversHintNoPanel:"Entries cannot be managed right now: the panel is not running.",serversEmpty:"The panel reports no servers.",serversPid:"PID",serversUrl:"URL",serversCommand:"Command",serversArgs:"Args",serversCwd:"Working dir",serversPort:"Port",serversOnPortConflict:"On port conflict",serversAutostart:"Autostart",serversPersistent:"Persistent",serversPersistentHint:"Run by home-hosted's own nanny, so stopping or restarting the panel leaves it alive.",serversHealth:"Health",serversRestartPolicy:"Restart",serversConfiguration:"Configuration",serversRawConfig:"Raw config",serversDisabled:"disabled",serversEnabled:"enabled",serversHealthHttp:"HTTP {status} on {path}",serversHealthHttpBelow:"HTTP <{status} on {path}",serversHealthHttpProbe:"HTTP probe on {path}",serversHealthPort:"port {port}",serversHealthProbe:"port probe",serversHealthEvery:"every {seconds}",serversRestartSummary:"{retries} retries \xB7 {base} \u2192 \xD7{factor}",serversStart:"Start",serversStop:"Stop",serversRestart:"Restart",serversWorkspace:"Workspace",serversAdd:"Add server",serversEdit:"Edit",serversEditTitle:"Edit {id}",serversCreateTitle:"Add a server",serversEditorHint:"Only the fields you change are written. These are the common ones \u2014 the panel link above edits every field, including bootstrap, env files, resources and restart policy.",serversCreate:"Create",serversSave:"Save",serversDelete:"Delete",serversDeleteTitle:"Delete {id}?",serversDeleteBody:"This removes the entry from workspace {workspace}. A running server is stopped with it.",serversDeleteGo:"Delete",serversFreePort:"Free port",serversFreePortTitle:"Free port {port}?",serversFreePortBody:"Stops whatever holds the port, unless the panel supervises it. Processes get SIGTERM first, then a forced stop.",serversFreePortGo:"Free",serversPortFreed:"Port {port} is free.",serversPortHeld:"Port {port} is still held.",serversPortSkipped:"The listener belongs to a server the panel supervises, so it was left alone.",serversPortRefused:"The port was not freed: {message}",fieldId:"Id",fieldIdHint:"Lowercase letters, digits, `_` and `-`; unique inside the workspace.",fieldIdInvalid:"An id starts with a lowercase letter or digit and uses only a-z, 0-9, _ and -.",fieldLabel:"Label",fieldCommand:"Command",fieldArgs:"Arguments",fieldArgsHint:"One argument per line.",fieldCwd:"Working directory",fieldPort:"Port",fieldPortHint:"Empty means the entry has no port.",fieldPortInvalid:"Enter a port between 1 and 65535, or leave it empty.",fieldAutostart:"Start with the panel",fieldOnPortConflict:"On port conflict",fieldInherit:"Inherit",fieldRequired:"Id and command are required."},$e={tab:"Home Hosted",loading:"\u52A0\u8F7D\u4E2D\u2026",refresh:"\u5237\u65B0",retry:"\u91CD\u8BD5",errorTitle:"\u9519\u8BEF",statusUnavailable:"\u9762\u677F\u6CA1\u6709\u54CD\u5E94\u3002",yes:"\u662F",no:"\u5426",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",details:"\u8BE6\u60C5",uiStyleLabel:"\u9875\u9762\u6837\u5F0F",uiStyleDetailed:"\u8BE6\u7EC6",uiStyleCompact:"\u7D27\u51D1",workspacesTitle:"\u5DE5\u4F5C\u533A",workspacesHint:"\u6B64\u9762\u677F\u63D0\u4F9B\u7684\u6240\u6709\u5DE5\u4F5C\u533A\u3002\u67E5\u770B\u54EA\u4E2A\u5C31\u5217\u51FA\u54EA\u4E2A\u3002",workspacesViewLabel:"\u8981\u67E5\u770B\u7684\u5DE5\u4F5C\u533A",workspacesEmpty:"\u9762\u677F\u5C1A\u672A\u62A5\u544A\u4EFB\u4F55\u5DE5\u4F5C\u533A\u3002",workspacesManagedTag:"\u7531\u63D2\u4EF6\u7BA1\u7406",workspacesViewingTag:"\u6B63\u5728\u67E5\u770B",workspacesCounts:"{servers} \u4E2A\u670D\u52A1\u5668 \xB7 {running} \u4E2A\u8FD0\u884C\u4E2D",workspacesCountsFile:"\u914D\u7F6E\u6587\u4EF6\u4E2D {servers} \u4E2A",workspacesDegraded:"\u9762\u677F\u6CA1\u6709\u54CD\u5E94\uFF0C\u56E0\u6B64\u8FD9\u4E9B\u8BA1\u6570\u2014\u2014\u4EE5\u53CA\u4E0B\u65B9\u7684\u6761\u76EE\u5217\u8868\u2014\u2014\u6765\u81EA\u5DE5\u4F5C\u533A\u914D\u7F6E\u6587\u4EF6\uFF0C\u800C\u4E0D\u662F\u5B9E\u65F6\u72B6\u6001\u3002",workspaceLegacyTitle:"\u8BE5\u72B6\u6001\u76EE\u5F55\u4ECD\u662F 0.7 \u4E4B\u524D\u7684\u5E03\u5C40",workspaceLegacyBody:"home-hosted 0.8 \u4E0D\u518D\u8FC1\u79FB\u8BE5\u5E03\u5C40\uFF0C\u5728\u8FD9\u4E9B\u6587\u4EF6\u79FB\u5165 .hh \u4E4B\u524D\uFF0C\u63D2\u4EF6\u65E0\u6CD5\u8BFB\u53D6\u6216\u5199\u5165\u5B83\u4EEC\u3002\u8BF7\u5148\u5B89\u88C5\u5E76\u8FD0\u884C\u4E00\u6B21\u6700\u65B0\u7684 0.7.x\u2014\u2014\u5B83\u9996\u6B21\u8FD0\u884C\u5373\u5B8C\u6210\u8FC1\u79FB\u2014\u2014\u7136\u540E\u542F\u52A8\u672C\u7248\u672C\u3002\u4E0D\u4F1A\u6539\u52A8\u6216\u5220\u9664\u4EFB\u4F55\u5185\u5BB9\u3002",sigPanel:"\u9762\u677F",sigAutostart:"\u5F00\u673A\u81EA\u542F",sigEntry:"{id} \u6761\u76EE",stateAnswering:"\u54CD\u5E94\u4E2D",stateNotAnswering:"\u672A\u54CD\u5E94",stateManaged:"\u5DF2\u63A5\u7BA1",stateNotManaged:"\u672A\u63A5\u7BA1",stateWebOnly:"\u4EC5 web",panelTitle:"\u9762\u677F",panelCopy:"\u7531\u54EA\u4E2A\u526F\u672C\u8FD0\u884C\u9762\u677F",panelCopyHint:"\u56FA\u5B9A\u526F\u672C\u968F\u63D2\u4EF6\u4E00\u8D77\u5B89\u88C5\uFF1B\u5168\u5C40\u526F\u672C\u6765\u81EA PATH\u3002",optionsPreferPinned:"\u56FA\u5B9A\u4F9D\u8D56",optionsPreferGlobal:"\u5168\u5C40\u5B89\u88C5",optionsRecommended:"\u63A8\u8350",optionsConfigOverride:"\u63D2\u4EF6\u884C\u4E2D\u7684 homeHostedCommand \u4F18\u5148\u7EA7\u6700\u9AD8\uFF0C\u59CB\u7EC8\u751F\u6548\u3002",optionsInstallLabel:"\u5B89\u88C5\u5168\u5C40\u526F\u672C",optionsInstallHint:"\u672A\u627E\u5230\u5168\u5C40\u5B89\u88C5\u3002\u5B89\u88C5\u56FA\u5B9A\u7248\u672C\u8303\u56F4\u540E\uFF0C\u5728\u4E0A\u65B9\u9009\u62E9\u5B83\uFF1A",optionsInstall:"\u5168\u5C40\u5B89\u88C5",panelHome:"\u9762\u677F\u6839\u76EE\u5F55",panelUrl:"URL",panelVersion:"\u7248\u672C",panelPid:"PID",panelWriteVia:"\u5199\u5165\u65B9\u5F0F",panelToken:"API \u4EE4\u724C",panelCliSource:"CLI",panelCliPath:"CLI \u8DEF\u5F84",panelCliConfig:"\u914D\u7F6E\u7684\u547D\u4EE4",panelCliDependency:"\u56FA\u5B9A\u7684\u4F9D\u8D56\u7248\u672C",panelCliPathSource:"\u5168\u5C40\u5B89\u88C5\uFF08PATH\uFF09",panelCliMissing:"\u672A\u627E\u5230",panelCliNotPinned:"\u6B64\u5BBF\u4E3B\u89E3\u6790\u5230\u7684\u662F\u5168\u5C40 home-hosted\uFF0C\u800C\u4E0D\u662F\u56FA\u5B9A\u526F\u672C\uFF08{range}\uFF09\u3002",panelCliUnsupported:"\u6B64 home-hosted \u65E9\u4E8E\u63D2\u4EF6\u652F\u6301\u7684\u6700\u8001\u7248\u672C\u3002",panelCliLauncherFailed:"\u5F00\u673A\u542F\u52A8\u5668\u6CA1\u6709\u5E94\u7B54\uFF0C\u5F00\u673A\u9879\u53EF\u80FD\u65E0\u6CD5\u542F\u52A8\u9762\u677F\u3002",panelPort:"\u9762\u677F\u7AEF\u53E3",panelPortHint:"\u4EC5\u5728\u9762\u677F\u505C\u6B62\u65F6\u53EF\u4FEE\u6539\u3002",panelPortFree:"\u7559\u7A7A\u5219\u4F7F\u7528\u914D\u7F6E\u6587\u4EF6\u4E2D\u7684\u7AEF\u53E3\u3002",panelPortInvalid:"\u8BF7\u8F93\u5165 1 \u5230 65535 \u4E4B\u95F4\u7684\u7AEF\u53E3\u3002",panelStart:"\u542F\u52A8\u9762\u677F",panelStop:"\u505C\u6B62\u9762\u677F",panelStopTitle:"\u505C\u6B62\u6B63\u5728\u8FD0\u884C\u7684\u9762\u677F\uFF1F",panelStopBody:"\u8FD9\u4F1A\u505C\u6B62\u9762\u677F\u4EE5\u53CA\u5B83\u76D1\u7BA1\u7684\u6240\u6709\u975E\u6301\u4E45\u5316\u670D\u52A1\u5668\uFF1B\u6301\u4E45\u5316\u6761\u76EE\u4F1A\u7EE7\u7EED\u8FD0\u884C\u3002\u5E26\u6709\u81EA\u542F\u7684\u6761\u76EE\u4F1A\u5728\u4E0B\u6B21\u542F\u52A8\u9762\u677F\u65F6\u91CD\u65B0\u542F\u52A8\u3002",panelStopping:"\u6B63\u5728\u505C\u6B62\u9762\u677F\u2026",panelStopped:"\u9762\u677F\u5DF2\u505C\u6B62\u3002",panelStopFailed:"\u9762\u677F\u672A\u80FD\u505C\u6B62\uFF1A{message}",panelStartFailed:"\u9762\u677F\u672A\u80FD\u542F\u52A8\uFF1A{message}",panelReplaceFailed:"\u9762\u677F\u672A\u80FD\u66FF\u6362\uFF1A{message}",panelInstallFailed:"\u5168\u5C40\u5B89\u88C5 home-hosted \u5931\u8D25\uFF1A{message}",panelRootLegacy:"\u6CBF\u7528\u4E86 ~/.home-hosted\u3002\u8BBE\u7F6E HHOSTED_HOME \u53EF\u8BA9\u6B64 dsh \u4F7F\u7528\u81EA\u5DF1\u7684\u9762\u677F\u3002",confirmStop:"\u505C\u6B62",panelOutdated:"\u9762\u677F\u5DF2\u8FC7\u65F6",panelReplace:"\u4F7F\u7528{copy}\u91CD\u542F",panelCopyPinned:"\u56FA\u5B9A\u4F9D\u8D56",panelCopyGlobal:"\u5168\u5C40\u5B89\u88C5",panelTakeoverTitle:"\u91CD\u542F\u6B63\u5728\u8FD0\u884C\u7684\u9762\u677F\uFF1F",panelTakeoverBody:"\u8FD9\u4F1A\u505C\u6B62\u9762\u677F\u4EE5\u53CA\u5B83\u76D1\u7BA1\u7684\u6240\u6709\u975E\u6301\u4E45\u5316\u670D\u52A1\u5668\uFF1B\u6301\u4E45\u5316\u6761\u76EE\u4F1A\u7EE7\u7EED\u8FD0\u884C\u3002\u4EC5\u5F53 {id} \u6761\u76EE\u5DF2\u88AB\u63A5\u7BA1\u4E14\u542F\u7528\u81EA\u542F\u65F6\u624D\u53EF\u7528\u3002",confirmCancel:"\u53D6\u6D88",confirmReplace:"\u91CD\u542F",writeViaApi:"\u5DF2\u8BA4\u8BC1 API",writeViaFile:"\u914D\u7F6E\u6587\u4EF6",writeViaNone:"\u4E0D\u53EF\u7528",tokenEnrolled:"\u5DF2\u767B\u8BB0",tokenPresent:"\u5DF2\u5B58\u5728",tokenAbsent:"\u4E0D\u5B58\u5728",tokenStale:"\u5DF2\u5931\u6548",tokenUnknown:"\u672A\u77E5",panelTokenWarningTitle:"\u9762\u677F API \u4EE4\u724C\u7F3A\u5931\u6216\u5DF2\u88AB\u62D2\u7EDD",panelTokenWarnAbsent:"\u672C\u63D2\u4EF6\u6CA1\u6709\u6B64\u9762\u677F\u7684 API \u4EE4\u724C\uFF0C\u65E0\u6CD5\u8BFB\u53D6\u6216\u5199\u5165\u9762\u677F\uFF1B\u8BF7\u91CD\u65B0\u751F\u6210\u4E00\u4E2A\u3002",panelTokenWarnPresent:"home-hosted \u6301\u6709\u4E00\u4E2A\u672C\u63D2\u4EF6\u6CA1\u6709\u7684 API \u4EE4\u724C\uFF0C\u63D2\u4EF6\u65E0\u6CD5\u901A\u8FC7\u8BA4\u8BC1\uFF1B\u8BF7\u91CD\u65B0\u751F\u6210\u4E00\u4E2A\u4EE5\u66FF\u6362\u5B83\u3002",panelTokenWarnStale:"\u9762\u677F\u62D2\u7EDD\u4E86\u672C\u63D2\u4EF6\u7684 API \u4EE4\u724C\uFF1B\u8BF7\u91CD\u65B0\u751F\u6210\u3002",panelTokenWarnUnreachable:"\u672C\u63D2\u4EF6\u65E0\u6CD5\u8BBF\u95EE\u9762\u677F\u4EE5\u68C0\u67E5\u5176 API \u4EE4\u724C\uFF0C\u56E0\u6B64\u65E0\u6CD5\u8BFB\u53D6\u6216\u5199\u5165\u9762\u677F\uFF1B\u9762\u677F\u53EF\u80FD\u8FD8\u9700\u8981\u5148\u542F\u52A8\u3002",panelTokenWarnPanelDown:"\u9762\u677F\u5F53\u524D\u6CA1\u6709\u54CD\u5E94\uFF0C\u53EF\u80FD\u8FD8\u9700\u8981\u5148\u542F\u52A8\u9762\u677F\u3002",panelTokenRegenerate:"\u91CD\u65B0\u751F\u6210\u4EE4\u724C",panelTokenRegenerated:"\u5DF2\u4E3A\u9762\u677F\u767B\u8BB0\u65B0\u4EE4\u724C\u3002",panelTokenRegenerateFailed:"\u4EE4\u724C\u672A\u66FF\u6362\uFF1A{message}",panelInstances:"\u53D1\u73B0 {count} \u4E2A\u9762\u677F",panelInstanceManaged:"\u7531\u672C\u63D2\u4EF6\u7BA1\u7406",panelInstanceOther:"\u5176\u4ED6\u9762\u677F",panelInstanceHosts:"\u6258\u7BA1\u5F53\u524D dsh",panelInstancesHint:"\u672C\u63D2\u4EF6\u53EA\u9A71\u52A8\u88AB\u7BA1\u7406\u7684\u90A3\u4E00\u4E2A\uFF1B\u5176\u4ED6\u9762\u677F\u4EC5\u4ECE\u5176\u72B6\u6001\u76EE\u5F55\u8BFB\u53D6\uFF0C\u7EDD\u4E0D\u5199\u5165\u3002",bootTitle:"\u5F00\u673A\u81EA\u542F",bootEnabled:"\u542F\u7528\u5F00\u673A\u81EA\u542F",bootUninstall:"\u5378\u8F7D",bootSwitchMode:"\u5207\u6362\u81EA\u542F\u673A\u5236",bootRecheck:"\u91CD\u65B0\u68C0\u67E5",bootMechanism:"\u673A\u5236",bootMechanismAuto:"\u81EA\u52A8",bootMechanismAutoHint:"\u6839\u636E\u672C\u673A\u5B9E\u9645\u53EF\u7528\u7684\u65B9\u5F0F\u81EA\u52A8\u9009\u62E9\uFF0C\u4F18\u5148\u9009\u62E9\u5728\u767B\u5F55\u524D\u5373\u53EF\u542F\u52A8\u7684\u673A\u5236\u3002",bootMechanismAutoPicks:"\u4E0B\u6B21\u5B89\u88C5\u5C06\u4F7F\u7528 {mechanism}\u3002",bootState:"\u72B6\u6001",bootStateNotInstalled:"\u672A\u5B89\u88C5",bootStateInstalledDisabled:"\u5DF2\u5B89\u88C5\uFF0C\u672A\u542F\u7528",bootStateEnabledRunning:"\u5DF2\u542F\u7528\uFF0C\u8FD0\u884C\u4E2D",bootStateEnabledFailing:"\u5DF2\u542F\u7528\uFF0C\u542F\u52A8\u5931\u8D25",bootStateUnsupported:"\u4E0D\u652F\u6301",bootBootCapable:"\u767B\u5F55\u524D\u542F\u52A8",bootPrivileged:"\u672C\u8FDB\u7A0B\u53EF\u5B89\u88C5",bootUnitPath:"\u5355\u5143\u6587\u4EF6\u8DEF\u5F84",bootCommandsLabel:"\u624B\u52A8\u5B89\u88C5",bootCommandsExplain:"\u672C\u8FDB\u7A0B\u65E0\u6CD5\u63D0\u6743\u3002\u8BF7\u81EA\u884C\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u6765\u5B89\u88C5\u81EA\u542F\uFF1A",bootRequestedNotInstalled:"\u5DF2\u8BF7\u6C42\u5F00\u673A\u81EA\u542F\uFF0C\u4F46\u5C1A\u672A\u5B89\u88C5\u4EFB\u4F55\u5F00\u673A\u9879\u3002",bootHandover:"\u542F\u7528\u540E\u4F1A\u505C\u6B62\u672C\u63D2\u4EF6\u542F\u52A8\u7684\u9762\u677F\uFF0C\u6539\u7531\u8BE5\u5F00\u673A\u9879\u542F\u52A8\u3002\u6301\u4E45\u5316\u6761\u76EE\u4F1A\u7EE7\u7EED\u8FD0\u884C\uFF0C\u56E0\u6B64\u672C\u4F1A\u8BDD\u4E0D\u53D7\u5F71\u54CD\u3001\u9875\u9762\u4FDD\u6301\u53EF\u7528\uFF1B\u9762\u677F\u6062\u590D\u5E94\u7B54\u540E\u9875\u9762\u4F1A\u91CD\u65B0\u663E\u793A\u5B83\u3002",bootSwitchRetires:"\u5207\u6362\u4F1A\u505C\u6B62\u9762\u677F\u5E76\u79FB\u9664\u5148\u524D\u7684\u81EA\u542F\u9879\u3002\u6301\u4E45\u5316\u6761\u76EE\u4F1A\u7EE7\u7EED\u8FD0\u884C\uFF0C\u56E0\u6B64\u672C\u4F1A\u8BDD\u4E0D\u53D7\u5F71\u54CD\u3001\u9875\u9762\u4FDD\u6301\u53EF\u7528\uFF1B\u8BE5\u5F00\u673A\u9879\u542F\u52A8\u65B0\u9762\u677F\u540E\u9875\u9762\u4F1A\u91CD\u65B0\u663E\u793A\u5B83\u3002",bootActionInstall:"\u5B89\u88C5",bootActionUninstall:"\u5378\u8F7D",bootAttemptFailed:"{action}\u5931\u8D25",bootAttemptSucceeded:"{action}\u6210\u529F \u2014 {detail}",bootAttemptNoDetail:"\u5BBF\u4E3B\u6CA1\u6709\u8BF4\u660E\u5931\u8D25\u539F\u56E0\u3002",bootAttemptCommands:"\u4F60\u53EF\u4EE5\u81EA\u884C\u8FD0\u884C\u4EE5\u4E0B\u547D\u4EE4\uFF1A",entriesTitle:"\u53D7\u7BA1\u6761\u76EE",entriesManage:"\u63A5\u7BA1 {id}",entriesManageNote:"\u628A {id} \u4EA4\u7ED9 home-hosted\uFF1A\u5F00\u673A\u81EA\u542F\u3001\u9762\u677F\u63A7\u5236\u3001\u7AEF\u53E3\u56DE\u6536\u3002",entriesManageDesktop:"\u4EC5\u9002\u7528\u4E8E dsh web\u3002Desktop \u542F\u52A8\u81EA\u5DF1\u7684 profile\uFF0C\u56E0\u6B64\u5B83\u6C38\u8FDC\u4E0D\u4F1A\u6210\u4E3A\u9762\u677F\u4E2D\u7684\u6761\u76EE\u2014\u2014\u670D\u52A1\u5668\u4ECD\u53EF\u5728\u6B64\u7BA1\u7406\u3002",entriesManageWinWarning:"\u5728 Windows \u4E0A\uFF0C`{id}` \u901A\u8FC7 `kill` \u7AEF\u53E3\u51B2\u7A81\u7B56\u7565\u7BA1\u7406\uFF1B\u5F53\u5B83\u88AB\u5176\u4ED6\u63D2\u4EF6\u4EE5\u5206\u79BB\u65B9\u5F0F\u91CD\u542F\u65F6\uFF0Chome-hosted \u56DE\u6536\u8FDB\u7A0B\u4E0E\u7AEF\u53E3\u671F\u95F4\u53EF\u80FD\u77ED\u6682\u65E0\u6CD5\u542F\u52A8\u3002",entriesEmpty:"\u5C1A\u672A\u63A5\u7BA1 {id}\u3002",entriesExists:"\u5B58\u5728",entriesMissing:"\u7F3A\u5931",entriesManaged:"\u5DF2\u63A5\u7BA1",entriesUnmanaged:"\u672A\u63A5\u7BA1",entriesDrift:"\u6F02\u79FB",entriesNotRunning:"\u672A\u8FD0\u884C",agentTitle:"Agent \u5DE5\u5177",agentCount:"\u5DF2\u5F00\u542F {enabled}/{total}",agentMaster:"\u5141\u8BB8 Agent \u8C03\u7528\u8FD9\u4E9B\u5DE5\u5177",agentApproval:"\u4F1A\u6539\u53D8\u72B6\u6001\u7684\u5DE5\u5177\u5728\u8FD0\u884C\u524D\u4F1A\u8BF7\u6C42\u6279\u51C6\u3002",agentApprovalBadge:"\u9700\u6279\u51C6",reclaimAutoLabel:"\u88AB\u62D2\u7EDD\u65F6\u81EA\u52A8\u91CD\u65B0\u751F\u6210\u4EE4\u724C",reclaimAutoHint:"\u5DE5\u5177\u8C03\u7528\u9047\u5230\u88AB\u62D2\u7EDD\u7684\u4EE4\u724C\u65F6\u4F1A\u91CD\u65B0\u767B\u8BB0\u5E76\u91CD\u8BD5\uFF0C\u800C\u4E0D\u662F\u76F4\u63A5\u5931\u8D25\u3002",instancesNoticeLabel:"\u5411 Agent \u8BF4\u660E\u5176\u4ED6\u9762\u677F",instancesNoticeHint:"\u628A\u9762\u677F\u6E05\u5355\u52A0\u5165 Agent \u4E0A\u4E0B\u6587\uFF1B\u5B58\u5728\u591A\u4E2A\u9762\u677F\u65F6\u4F1A\u5148\u8BE2\u95EE\u8981\u64CD\u4F5C\u54EA\u4E00\u4E2A\u3002",agentToolStatus:"\u67E5\u770B\u72B6\u6001",agentToolWorkspacesList:"\u5217\u51FA\u5DE5\u4F5C\u533A",agentToolServersList:"\u5217\u51FA\u670D\u52A1\u5668",agentToolServersLifecycle:"\u542F\u52A8\u3001\u505C\u6B62\u3001\u91CD\u542F",agentToolServersEdit:"\u521B\u5EFA\u3001\u66F4\u65B0\u3001\u5220\u9664",agentToolAutostartManage:"\u7BA1\u7406\u5F00\u673A\u81EA\u542F",agentToolUiManage:"\u7BA1\u7406\u9762\u677F UI",agentToolPanelLogs:"\u9762\u677F\u65E5\u5FD7",agentToolDescStatus:"\u8BFB\u53D6\u9762\u677F\u3001\u6B63\u5728\u4F7F\u7528\u7684 CLI \u526F\u672C\u548C\u53D7\u7BA1\u6761\u76EE\u3002\u4E0D\u6539\u53D8\u4EFB\u4F55\u72B6\u6001\u3002",agentToolDescWorkspacesList:"\u5217\u51FA\u9762\u677F\u63D0\u4F9B\u7684\u6240\u6709\u5DE5\u4F5C\u533A\u53CA\u5176\u6761\u76EE\u6570\u548C\u8FD0\u884C\u6570\u3002\u670D\u52A1\u5668 id \u53EA\u5728\u5DE5\u4F5C\u533A\u5185\u552F\u4E00\u3002",agentToolDescServersList:"\u5217\u51FA\u67D0\u4E2A\u5DE5\u4F5C\u533A\u4E2D\u88AB\u76D1\u7BA1\u7684\u670D\u52A1\u5668\u53CA\u5176\u72B6\u6001\u3001\u7AEF\u53E3\u548C URL\u3002",agentToolDescServersLifecycle:"\u542F\u52A8\u3001\u505C\u6B62\u548C\u91CD\u542F\u53D7\u76D1\u7BA1\u7684\u670D\u52A1\u5668\u3002",agentToolDescServersEdit:"\u521B\u5EFA\u3001\u66F4\u65B0\u548C\u5220\u9664\u670D\u52A1\u5668\u6761\u76EE\u3002",agentToolDescAutostartManage:"\u5B89\u88C5\u6216\u79FB\u9664\u542F\u52A8\u9762\u677F\u7684\u5F00\u673A\u9879\u3002",agentToolDescUiManage:"\u67E5\u770B\u3001\u66F4\u65B0\u3001\u56DE\u9000\u6216\u5B89\u88C5\u5B98\u65B9 UI \u6784\u5EFA\u3002",agentToolDescPanelLogs:"\u8BFB\u53D6\u9762\u677F\u81EA\u8EAB\u7684\u63A7\u5236\u53F0\u8F93\u51FA\u3002\u65E0\u9700 API \u4EE4\u724C\uFF0C\u56E0\u6B64\u9762\u677F\u5728\u8FD0\u884C\u4F46\u65E0\u54CD\u5E94\u65F6\u4E5F\u80FD\u4F7F\u7528\u3002",serversTitle:"\u670D\u52A1\u5668",serversCount:"{total} \u4E2A\u4E2D {running} \u4E2A\u8FD0\u884C\u4E2D",serversHintPanel:"\u5728 home-hosted \u9762\u677F\u4E2D\u7BA1\u7406\u6761\u76EE\uFF1A",serversHintNoPanel:"\u5F53\u524D\u65E0\u6CD5\u7BA1\u7406\u6761\u76EE\uFF1A\u9762\u677F\u6CA1\u6709\u8FD0\u884C\u3002",serversEmpty:"\u9762\u677F\u672A\u62A5\u544A\u4EFB\u4F55\u670D\u52A1\u5668\u3002",serversPid:"PID",serversUrl:"URL",serversCommand:"\u547D\u4EE4",serversArgs:"\u53C2\u6570",serversCwd:"\u5DE5\u4F5C\u76EE\u5F55",serversPort:"\u7AEF\u53E3",serversOnPortConflict:"\u7AEF\u53E3\u51B2\u7A81\u65F6",serversAutostart:"\u81EA\u542F",serversPersistent:"\u6301\u4E45\u5316",serversPersistentHint:"\u7531 home-hosted \u81EA\u5E26\u7684 nanny \u6258\u7BA1\uFF0C\u505C\u6B62\u6216\u91CD\u542F\u9762\u677F\u4E0D\u4F1A\u505C\u6B62\u5B83\u3002",serversHealth:"\u5065\u5EB7\u68C0\u67E5",serversRestartPolicy:"\u91CD\u542F",serversConfiguration:"\u914D\u7F6E",serversRawConfig:"\u539F\u59CB\u914D\u7F6E",serversDisabled:"\u5DF2\u505C\u7528",serversEnabled:"\u5DF2\u542F\u7528",serversHealthHttp:"HTTP {status} \u4E8E {path}",serversHealthHttpBelow:"HTTP <{status} \u4E8E {path}",serversHealthHttpProbe:"HTTP \u63A2\u6D4B {path}",serversHealthPort:"\u7AEF\u53E3 {port}",serversHealthProbe:"\u7AEF\u53E3\u63A2\u6D4B",serversHealthEvery:"\u6BCF {seconds}",serversRestartSummary:"{retries} \u6B21\u91CD\u8BD5 \xB7 {base} \u2192 \xD7{factor}",serversStart:"\u542F\u52A8",serversStop:"\u505C\u6B62",serversRestart:"\u91CD\u542F",serversWorkspace:"\u5DE5\u4F5C\u533A",serversAdd:"\u6DFB\u52A0\u670D\u52A1\u5668",serversEdit:"\u7F16\u8F91",serversEditTitle:"\u7F16\u8F91 {id}",serversCreateTitle:"\u6DFB\u52A0\u670D\u52A1\u5668",serversEditorHint:"\u53EA\u5199\u5165\u4F60\u6539\u52A8\u7684\u5B57\u6BB5\u3002\u8FD9\u91CC\u53EA\u5217\u51FA\u5E38\u7528\u5B57\u6BB5\u2014\u2014\u4E0A\u65B9\u9762\u677F\u94FE\u63A5\u53EF\u7F16\u8F91\u5168\u90E8\u5B57\u6BB5\uFF0C\u5305\u62EC\u5F15\u5BFC\u547D\u4EE4\u3001\u73AF\u5883\u53D8\u91CF\u6587\u4EF6\u3001\u8D44\u6E90\u9650\u5236\u4E0E\u91CD\u542F\u7B56\u7565\u3002",serversCreate:"\u521B\u5EFA",serversSave:"\u4FDD\u5B58",serversDelete:"\u5220\u9664",serversDeleteTitle:"\u5220\u9664 {id}\uFF1F",serversDeleteBody:"\u8FD9\u4F1A\u4ECE\u5DE5\u4F5C\u533A {workspace} \u4E2D\u79FB\u9664\u8BE5\u6761\u76EE\uFF0C\u8FD0\u884C\u4E2D\u7684\u670D\u52A1\u5668\u4E5F\u4F1A\u968F\u4E4B\u505C\u6B62\u3002",serversDeleteGo:"\u5220\u9664",serversFreePort:"\u91CA\u653E\u7AEF\u53E3",serversFreePortTitle:"\u91CA\u653E\u7AEF\u53E3 {port}\uFF1F",serversFreePortBody:"\u505C\u6B62\u5360\u7528\u8BE5\u7AEF\u53E3\u7684\u8FDB\u7A0B\uFF0C\u9664\u975E\u5B83\u7531\u9762\u677F\u76D1\u7BA1\u3002\u8FDB\u7A0B\u5148\u6536\u5230 SIGTERM\uFF0C\u4E4B\u540E\u4F1A\u88AB\u5F3A\u5236\u505C\u6B62\u3002",serversFreePortGo:"\u91CA\u653E",serversPortFreed:"\u7AEF\u53E3 {port} \u5DF2\u91CA\u653E\u3002",serversPortHeld:"\u7AEF\u53E3 {port} \u4ECD\u88AB\u5360\u7528\u3002",serversPortSkipped:"\u8BE5\u76D1\u542C\u8005\u5C5E\u4E8E\u9762\u677F\u76D1\u7BA1\u7684\u670D\u52A1\u5668\uFF0C\u56E0\u6B64\u672A\u88AB\u52A8\u5B83\u3002",serversPortRefused:"\u7AEF\u53E3\u672A\u80FD\u91CA\u653E\uFF1A{message}",fieldId:"Id",fieldIdHint:"\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001`_` \u548C `-`\uFF1B\u5728\u5DE5\u4F5C\u533A\u5185\u552F\u4E00\u3002",fieldIdInvalid:"id \u4EE5\u5C0F\u5199\u5B57\u6BCD\u6216\u6570\u5B57\u5F00\u5934\uFF0C\u53EA\u80FD\u5305\u542B a-z\u30010-9\u3001_ \u548C -\u3002",fieldLabel:"\u6807\u7B7E",fieldCommand:"\u547D\u4EE4",fieldArgs:"\u53C2\u6570",fieldArgsHint:"\u6BCF\u884C\u4E00\u4E2A\u53C2\u6570\u3002",fieldCwd:"\u5DE5\u4F5C\u76EE\u5F55",fieldPort:"\u7AEF\u53E3",fieldPortHint:"\u7559\u7A7A\u8868\u793A\u8BE5\u6761\u76EE\u6CA1\u6709\u7AEF\u53E3\u3002",fieldPortInvalid:"\u8BF7\u8F93\u5165 1 \u5230 65535 \u4E4B\u95F4\u7684\u7AEF\u53E3\uFF0C\u6216\u7559\u7A7A\u3002",fieldAutostart:"\u968F\u9762\u677F\u542F\u52A8",fieldOnPortConflict:"\u7AEF\u53E3\u51B2\u7A81\u65F6",fieldInherit:"\u7EE7\u627F",fieldRequired:"Id \u548C\u547D\u4EE4\u4E3A\u5FC5\u586B\u3002"};function tn(e,t){return t===void 0?e:e.replace(/\{(\w+)\}/g,(n,r)=>Object.prototype.hasOwnProperty.call(t,r)?String(t[r]):n)}var je=(e,t)=>tn(Le[e]??e,t);function Ge(e){if(e!==void 0)try{let t=e.bind(we);if(typeof t=="function")return t}catch{}return je}function ze(e,t=je){return e===void 0?t:(n,r)=>{let o;try{o=e(n,r)}catch{o=void 0}return o===void 0||o.length===0||o===n?t(n,r):o}}var _=require("react");var ie=require("react");var Ke="/home-hosted";var Ye="default";function ne(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var qe=["block","warn","follow","reclaim","kill"];var ue=["status","workspaces_list","servers_list","servers_lifecycle","servers_edit","autostart_manage","ui_manage","panel_logs"],Je=["servers_lifecycle","servers_edit","autostart_manage","ui_manage"],nn=3,Wn={version:nn,autostart:{enabled:!1,mechanism:"auto"},manageDsh:!1,entries:[],agentTools:{enabled:!0,allow:[...ue]},panel:{port:null},authNotice:!0,reclaimToken:!0,instancesNotice:!0,uiStyle:"detailed",cli:{prefer:"pinned"}};var on="/api";function oe(e,t,n){return{ok:!1,error:n===void 0?{code:e,message:t}:{code:e,message:t,detail:n}}}function rn(e){return e instanceof Error?e.message:String(e)}function an(e){if(!ne(e))return oe("bad-response","The panel returned a non-object response");if(typeof e.v=="number"&&e.v!==1)return oe("version-mismatch",`Response protocol v${e.v} does not match the expected v${1}`);let t=e.result;if(!ne(t))return oe("bad-response","The panel returned no result");if(t.ok===!0)return"value"in t?{ok:!0,value:t.value}:oe("bad-response","A successful response carried no value");if(t.ok===!1){let n=t.error;return ne(n)&&typeof n.message=="string"?oe(typeof n.code=="string"?n.code:"error",n.message,n.detail):oe("error","The panel reported a failure without a message")}return oe("bad-response","The panel returned an unrecognised result")}async function E(e,t,n={}){let r=n.fetch??globalThis.fetch;if(typeof r!="function")return oe("no-fetch","No fetch implementation is available");let o={v:1,endpoint:e,payload:t},a;try{a=await r(`${on}${Ke}`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(o)})}catch(s){return oe("network",rn(s))}if(!a.ok){let s=a.statusText.length>0?` ${a.statusText}`:"";return oe("http",`HTTP ${a.status}${s}`)}let i;try{i=await a.json()}catch{return oe("bad-json","The panel returned invalid JSON")}return an(i)}function Xe(e,t={}){return E("settings.update",{patch:e},t)}var sn=5e3;function Ze(e=sn){let[t,n]=(0,ie.useState)(null),[r,o]=(0,ie.useState)(null),[a,i]=(0,ie.useState)(!0),s=(0,ie.useRef)(!0),h=(0,ie.useCallback)(async()=>{let d=await E("status",{});s.current&&(d.ok?(n(d.value),o(null)):o(d.error),i(!1))},[]);return(0,ie.useEffect)(()=>{s.current=!0,h();let d=setInterval(()=>{h()},e);return()=>{s.current=!1,clearInterval(d)}},[h,e]),{data:t,error:r,loading:a,refresh:h}}var v=require("react/jsx-runtime");function se({size:e=14,children:t}){return(0,v.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:t})}function Qe(e){return(0,v.jsxs)(se,{...e,children:[(0,v.jsx)("rect",{x:"2.2",y:"3",width:"11.6",height:"7.6",rx:"1.6"}),(0,v.jsx)("path",{d:"M6.6 13.4h2.8M8 10.6v2.8"})]})}function et(e){return(0,v.jsxs)(se,{...e,children:[(0,v.jsx)("path",{d:"M8 2.4v5.2"}),(0,v.jsx)("path",{d:"M11.6 4.4a5 5 0 1 1-7.2 0"})]})}function tt(e){return(0,v.jsxs)(se,{...e,children:[(0,v.jsx)("rect",{x:"2.2",y:"2.8",width:"11.6",height:"10.4",rx:"1.6"}),(0,v.jsx)("path",{d:"M5.2 6.9l1.8 1.8-1.8 1.8M8.7 10.5h2.2"})]})}function nt(e){return(0,v.jsxs)(se,{...e,children:[(0,v.jsx)("path",{d:"M2.4 5.4h11.2M2.4 10.6h11.2"}),(0,v.jsx)("circle",{cx:"6",cy:"5.4",r:"1.6",fill:"currentColor",stroke:"none"}),(0,v.jsx)("circle",{cx:"10.4",cy:"10.6",r:"1.6",fill:"currentColor",stroke:"none"})]})}function ke(e){return(0,v.jsxs)(se,{...e,children:[(0,v.jsx)("path",{d:"M8 2.3l5.4 2.9L8 8.1 2.6 5.2z"}),(0,v.jsx)("path",{d:"M2.6 8.6l5.4 2.9 5.4-2.9"}),(0,v.jsx)("path",{d:"M2.6 11.4l5.4 2.9 5.4-2.9"})]})}function ot(e){return(0,v.jsxs)(se,{...e,children:[(0,v.jsx)("path",{d:"M13.4 9.4A5.5 5.5 0 1 1 12.2 4.4"}),(0,v.jsx)("path",{d:"M12.8 1.7v2.9h-2.9"})]})}function rt(e){return(0,v.jsx)(se,{...e,children:(0,v.jsx)("path",{d:"M6.2 3.8L10.4 8l-4.2 4.2"})})}function at(e){return(0,v.jsxs)(se,{...e,children:[(0,v.jsx)("path",{d:"M6.6 3.4H3.4v9.2h9.2V9.4"}),(0,v.jsx)("path",{d:"M9.4 3.4h3.2v3.2M12.6 3.4L7.8 8.2"})]})}function Te(e){return(0,v.jsxs)(se,{...e,children:[(0,v.jsx)("path",{d:"M8 2.6l5.7 10.2H2.3z"}),(0,v.jsx)("path",{d:"M8 6.4v3.1M8 11.5h.01"})]})}function it(e){return(0,v.jsx)(se,{...e,children:(0,v.jsx)("path",{d:"M3 8.4l3.3 3.3L13 5"})})}var Y="\u2014";function A(e){if(e==null)return Y;let t=String(e);return t.length>0?t:Y}function st(e){return e.length>0?e.map(ln).join(", "):Y}function ln(e){let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim().toLowerCase();return t.length===0?e:t.charAt(0).toUpperCase()+t.slice(1)}function Be(e){return Je.includes(e)}var De={status:"agentToolStatus",workspaces_list:"agentToolWorkspacesList",servers_list:"agentToolServersList",servers_lifecycle:"agentToolServersLifecycle",servers_edit:"agentToolServersEdit",autostart_manage:"agentToolAutostartManage",ui_manage:"agentToolUiManage",panel_logs:"agentToolPanelLogs"},lt={status:"agentToolDescStatus",workspaces_list:"agentToolDescWorkspacesList",servers_list:"agentToolDescServersList",servers_lifecycle:"agentToolDescServersLifecycle",servers_edit:"agentToolDescServersEdit",autostart_manage:"agentToolDescAutostartManage",ui_manage:"agentToolDescUiManage",panel_logs:"agentToolDescPanelLogs"},ct={api:"writeViaApi",file:"writeViaFile",none:"writeViaNone"},dt={enrolled:"tokenEnrolled",present:"tokenPresent",absent:"tokenAbsent",stale:"tokenStale",unknown:"tokenUnknown"},Pe={"not-installed":"bootStateNotInstalled","installed-disabled":"bootStateInstalledDisabled","enabled-running":"bootStateEnabledRunning","enabled-failing":"bootStateEnabledFailing",unsupported:"bootStateUnsupported"},pt={config:"panelCliConfig",dependency:"panelCliDependency",path:"panelCliPathSource",none:"panelCliMissing"};function Ce(e,t=52){if(e.length<=t)return e;let n=e.includes("\\")?"\\":"/",r=e.split(/[\\/]/).filter(s=>s.length>0);if(r.length<4)return e;let o=/^[A-Za-z]:$/.test(r[0]??"")?3:2;if(r.length<=o)return e;let i=`${/^[\\/]/.test(e)?n:""}${r.slice(0,o).join(n)}${n}\u2026${n}${r.slice(-2).join(n)}`;return i.length<e.length?i:e}function ht(e){let t=n=>e.source===n&&e.path!==null?{source:n,path:e.path,version:e.version}:null;return{dependency:e.dependency??t("dependency"),global:e.global??t("path")}}function cn(e,t){if(Object.is(e,t))return!0;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function ut(e,t){let n={};for(let r of Object.keys(t)){let o=e[r],a=t[r];if(ne(o)&&ne(a)){let i=ut(o,a);Object.keys(i).length>0&&(n[r]=i)}else cn(o,a)||(n[r]=a)}return n}function gt(e,t){return ut(e,t)}function mt(e,t,n){let r=new Set(e);return n?r.add(t):r.delete(t),ue.filter(o=>r.has(o))}var vt=require("react");async function ft(e){try{if(typeof navigator<"u"&&navigator.clipboard!==void 0)return await navigator.clipboard.writeText(e),!0}catch{}return!1}var p=require("react/jsx-runtime");function dn(...e){return e.filter(t=>typeof t=="string"&&t.length>0).join(" ")}function q({icon:e,title:t,action:n,children:r}){return(0,p.jsxs)("section",{className:"hh-section",children:[(0,p.jsxs)("header",{className:"hh-section-head",children:[e===void 0?null:(0,p.jsx)("span",{className:"hh-section-icon",children:e}),(0,p.jsx)("h3",{className:"hh-section-title",children:t}),(0,p.jsx)("span",{className:"hh-section-rule","aria-hidden":"true"}),n===void 0?null:(0,p.jsx)("span",{className:"hh-section-action",children:n})]}),(0,p.jsx)("div",{className:"hh-section-body",children:r})]})}function P({label:e,children:t}){return(0,p.jsxs)("div",{className:"hh-spec",children:[(0,p.jsx)("span",{className:"hh-spec-label",children:e}),(0,p.jsx)("span",{className:"hh-spec-value",children:t})]})}function re({children:e}){return(0,p.jsx)("code",{className:"hh-code",children:e})}function m({children:e}){return typeof e=="string"&&e.length===0?null:(0,p.jsx)("p",{className:"hh-hint",children:e})}function O({tone:e,children:t}){return(0,p.jsx)("span",{className:"hh-chip","data-tone":e??"idle",children:t})}function pe({href:e,children:t}){return(0,p.jsxs)("a",{className:"hh-link",href:e,target:"_blank",rel:"noreferrer noopener",children:[t??e,(0,p.jsx)("span",{className:"hh-link-icon","aria-hidden":"true",children:(0,p.jsx)(at,{size:11})})]})}function le({label:e,open:t=!1,children:n}){return(0,p.jsxs)("details",{className:"hh-details",open:t||void 0,children:[(0,p.jsxs)("summary",{className:"hh-summary",children:[(0,p.jsx)("span",{className:"hh-chevron","aria-hidden":"true",children:(0,p.jsx)(rt,{size:12})}),e]}),(0,p.jsx)("div",{className:"hh-details-body",children:n})]})}function V({tone:e="bad",icon:t=!0,title:n,children:r}){return(0,p.jsxs)("div",{className:"hh-note","data-tone":e,role:e==="bad"?"alert":"note",children:[t?(0,p.jsx)("span",{className:"hh-note-icon","aria-hidden":"true",children:(0,p.jsx)(Te,{size:13})}):null,(0,p.jsxs)("div",{className:"hh-note-body",children:[n===void 0?null:(0,p.jsx)("span",{className:"hh-note-title",children:n}),typeof r=="string"?(0,p.jsx)("p",{children:r}):r]})]})}function Ne({title:e,detail:t}){return(0,p.jsxs)("div",{className:"hh-note",role:"alert",children:[(0,p.jsx)("span",{className:"hh-note-icon","aria-hidden":"true",children:(0,p.jsx)(Te,{size:13})}),(0,p.jsxs)("div",{className:"hh-note-body",children:[(0,p.jsx)("strong",{children:e}),t.length>0?(0,p.jsx)("p",{children:t}):null]})]})}function ye({error:e,title:t}){return e===null?null:(0,p.jsxs)("div",{className:"hh-note",role:"alert",children:[(0,p.jsx)("span",{className:"hh-note-icon","aria-hidden":"true",children:(0,p.jsx)(Te,{size:13})}),(0,p.jsxs)("div",{className:"hh-note-body",children:[(0,p.jsx)("strong",{children:t}),(0,p.jsxs)("p",{children:[(0,p.jsx)("code",{children:e.code})," \u2014 ",e.message]})]})]})}function pn(){return(0,p.jsx)("span",{className:"hh-spinner","aria-hidden":"true"})}function b({children:e,onClick:t,disabled:n,busy:r,variant:o="default",icon:a,title:i}){let s=n===!0||r===!0;return(0,p.jsxs)("button",{type:"button",className:dn("hh-btn",o!=="default"&&`hh-btn-${o}`),onClick:t,disabled:s,title:i,children:[r===!0?(0,p.jsx)(pn,{}):a,e]})}function ve({label:e,checked:t,disabled:n,onChange:r}){return(0,p.jsxs)("button",{type:"button",role:"switch",className:"hh-switch","aria-checked":t,disabled:n,onClick:()=>r(!t),children:[(0,p.jsx)("span",{className:"hh-switch-track","aria-hidden":"true",children:(0,p.jsx)("span",{className:"hh-switch-knob"})}),(0,p.jsx)("span",{className:"hh-check-label",children:e})]})}function bt({label:e,checked:t,disabled:n,onChange:r}){return(0,p.jsxs)("label",{className:"hh-check",children:[(0,p.jsx)("input",{type:"checkbox",checked:t,disabled:n,onChange:o=>r(o.target.checked)}),(0,p.jsx)("span",{className:"hh-check-label",children:e})]})}function fe({value:e,options:t,disabled:n,label:r,onChange:o}){return(0,p.jsx)("select",{className:"hh-select",value:e,disabled:n,"aria-label":r,onChange:a=>o(a.target.value),children:t.map(a=>(0,p.jsx)("option",{value:a.value,children:a.label},a.value))})}function Se({label:e,meta:t,path:n,hint:r,checked:o,disabled:a,onChange:i}){return(0,p.jsxs)("label",{className:"hh-choice-option","data-disabled":a===!0,children:[(0,p.jsx)("input",{type:"radio",checked:o,disabled:a,onChange:()=>i()}),(0,p.jsxs)("span",{className:"hh-choice-label",children:[(0,p.jsx)("span",{children:e}),r]}),t===void 0?null:(0,p.jsx)("span",{className:"hh-choice-meta",children:t}),n===void 0?null:(0,p.jsx)("span",{className:"hh-choice-path",title:n,children:Ce(n)})]})}function Ee({children:e}){return(0,p.jsxs)(O,{tone:"accent",children:[(0,p.jsx)(it,{size:10}),e]})}function xe({text:e,copyLabel:t,copiedLabel:n}){let[r,o]=(0,vt.useState)(!1);return(0,p.jsxs)("div",{className:"hh-code-box",children:[(0,p.jsx)("textarea",{className:"hh-code-text",readOnly:!0,value:e,rows:Math.min(e.split(`
4
+ `).length,4)}),(0,p.jsx)("div",{className:"hh-btn-row",children:(0,p.jsx)(b,{variant:"ghost",onClick:()=>{ft(e).then(o)},children:r?n:t})})]})}var k=require("react/jsx-runtime");function yt({t:e,status:t,updateSettings:n,busy:r,uiStyle:o}){let a=t.settings.agentTools,i=a.allow??[],s=ue.filter(d=>i.includes(d)).length,h=(d,g)=>{n(S=>({...S,agentTools:{...S.agentTools,allow:mt(S.agentTools.allow??[],d,g)}}))};return(0,k.jsxs)(q,{icon:(0,k.jsx)(nt,{}),title:e("agentTitle"),action:(0,k.jsx)(O,{children:e("agentCount",{enabled:s,total:ue.length})}),children:[(0,k.jsx)(ve,{label:e("agentMaster"),checked:a.enabled,disabled:r==="settings",onChange:d=>n(g=>({...g,agentTools:{...g.agentTools,enabled:d}}))}),(0,k.jsxs)("div",{className:"hh-field-block",children:[(0,k.jsx)(ve,{label:e("reclaimAutoLabel"),checked:t.settings.reclaimToken!==!1,disabled:r==="settings",onChange:d=>n(g=>({...g,reclaimToken:d}))}),(0,k.jsx)(m,{children:e("reclaimAutoHint")})]}),(0,k.jsxs)("div",{className:"hh-field-block",children:[(0,k.jsx)(ve,{label:e("instancesNoticeLabel"),checked:t.settings.instancesNotice!==!1,disabled:r==="settings",onChange:d=>n(g=>({...g,instancesNotice:d}))}),(0,k.jsx)(m,{children:e("instancesNoticeHint")})]}),(0,k.jsx)(m,{children:e("agentApproval")}),o==="detailed"?(0,k.jsx)("div",{className:"hh-tool-cards",children:ue.map(d=>(0,k.jsxs)("label",{className:"hh-tool-card",children:[(0,k.jsx)("input",{type:"checkbox",checked:i.includes(d),disabled:!a.enabled,onChange:g=>h(d,g.target.checked)}),(0,k.jsxs)("span",{className:"hh-tool-card-body",children:[(0,k.jsxs)("span",{className:"hh-tool-card-head",children:[(0,k.jsx)("span",{className:"hh-tool-card-name",children:e(De[d])}),Be(d)?(0,k.jsx)(O,{tone:"warn",children:e("agentApprovalBadge")}):null]}),(0,k.jsx)("span",{className:"hh-tool-card-desc",children:e(lt[d])})]})]},d))}):(0,k.jsx)("div",{className:"hh-tools",children:ue.map(d=>(0,k.jsx)(bt,{label:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{className:"hh-check-text",children:e(De[d])}),Be(d)?(0,k.jsx)(O,{tone:"warn",children:e("agentApprovalBadge")}):null]}),checked:i.includes(d),disabled:!a.enabled,onChange:g=>h(d,g)},d))})]})}var Ct=require("react");function St(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function xt(e){if(typeof e!="object"||e===null)return null;let t=e.result;if(typeof t!="object"||t===null)return null;let{ok:n,detail:r,commands:o}=t;return n!==!1?null:{detail:typeof r=="string"?r:"",commands:St(o)}}function wt(e){return typeof e!="object"||e===null||Array.isArray(e)?null:{ok:e.ok===!0,action:e.action==="uninstall"?"uninstall":"install",detail:typeof e.detail=="string"?e.detail:"",commands:St(e.commands),mechanism:e.mechanism??null}}var hn=["enabled-running","enabled-failing","installed-disabled"];function kt(e,t){let n=e.filter(a=>a.available).map(a=>a.mechanism),r=n.filter(a=>a!=="unsupported"),o=["auto",...r.length>0?r:n];return o.includes(t)||o.push(t),o}function Tt(e,t){return e!==null&&e!==t}function un(e,t){return e===null||e.ok?!1:e.action==="install"?hn.includes(t):t==="not-installed"}function Pt(e,t,n,r){return e!==null&&e.state===n&&e.mechanism===r?e:t!==null&&t.mechanism!==r||un(t,n)?null:t}var y=require("react/jsx-runtime");function Nt({t:e,status:t,run:n,updateSettings:r,busy:o,uiStyle:a}){let i=t.boot,s=t.settings.autostart,h=i.candidates??[],d=i.commands??[],[g,S]=(0,Ct.useState)(null),$=o==="boot.install"||o==="boot.uninstall",X=kt(h,s.mechanism).map(I=>({value:I,label:I==="auto"?e("bootMechanismAuto"):I})),L=Tt(i.mechanism,s.mechanism),Z=I=>h.find(N=>N.mechanism===I)?.reason??null,U=typeof i.recommended=="string"&&i.recommended.length>0&&i.recommended!==i.mechanism?i.recommended:null,x=U===null?e("bootMechanismAutoHint"):`${e("bootMechanismAutoHint")} ${e("bootMechanismAutoPicks",{mechanism:U})}`,H=s.mechanism==="auto"?x:Z(s.mechanism),K=i.mechanism===null?null:Z(i.mechanism),G=i.mechanism!==null,ae=t.panel.reachable&&!L&&!G,Q=t.panel.reachable&&L,de=I=>e(I==="install"?"bootActionInstall":"bootActionUninstall"),ee=async I=>{let N=await n(`boot.${I}`,async()=>I==="install"?E("boot.install",s.mechanism==="auto"?{}:{mechanism:s.mechanism}):E("boot.uninstall",{}));if(!N.ok){S(null);return}let F=xt(N.value);S(F===null?null:{ok:!1,action:I,detail:F.detail,commands:F.commands,state:i.state,mechanism:i.mechanism})},te=wt(s.lastAttempt),C=Pt(g,te,i.state,i.mechanism);return(0,y.jsxs)(q,{icon:(0,y.jsx)(et,{}),title:e("bootTitle"),action:(0,y.jsx)(fe,{value:s.mechanism,options:X,label:e("bootMechanism"),disabled:o==="settings"||$,onChange:I=>r(N=>({...N,autostart:{...N.autostart,mechanism:I}}))}),children:[H!==null&&H.length>0?(0,y.jsx)(m,{children:H}):null,ae?(0,y.jsx)(m,{children:e("bootHandover")}):null,Q?(0,y.jsx)(V,{tone:"warn",children:e("bootSwitchRetires")}):null,(0,y.jsxs)("div",{className:"hh-btn-row",children:[(0,y.jsx)(b,{variant:G?"default":"primary",disabled:s.mechanism==="unsupported",busy:o==="boot.install",onClick:()=>{ee("install")},children:e(L?"bootSwitchMode":"bootEnabled")}),(0,y.jsx)(b,{disabled:!G,busy:o==="boot.uninstall",onClick:()=>{ee("uninstall")},children:e("bootUninstall")}),(0,y.jsx)(b,{variant:"ghost",busy:o==="boot.verify",onClick:()=>{n("boot.verify",()=>E("boot.verify",{}))},children:e("bootRecheck")})]}),s.enabled&&i.state==="not-installed"?(0,y.jsx)(V,{tone:"warn",children:e("bootRequestedNotInstalled")}):null,C!==null&&!C.ok?(0,y.jsxs)("div",{className:"hh-section-body",children:[(0,y.jsx)(Ne,{title:e("bootAttemptFailed",{action:de(C.action)}),detail:C.detail.length>0?C.detail:e("bootAttemptNoDetail")}),C.commands.length>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(m,{children:e("bootAttemptCommands")}),(0,y.jsx)(xe,{text:C.commands.join(`
5
+ `),copyLabel:e("copy"),copiedLabel:e("copied")})]}):null]}):null,C!==null&&C.ok?(0,y.jsx)(m,{children:e("bootAttemptSucceeded",{action:de(C.action),detail:C.detail})}):null,d.length>0?(0,y.jsxs)(le,{label:e("bootCommandsLabel"),open:a==="detailed",children:[(0,y.jsx)(m,{children:e("bootCommandsExplain")}),(0,y.jsx)(xe,{text:d.join(`
6
+ `),copyLabel:e("copy"),copiedLabel:e("copied")})]}):null,(0,y.jsxs)(le,{label:e("details"),open:a==="detailed",children:[(0,y.jsx)(P,{label:e("bootState"),children:e(Pe[i.state]??"bootStateUnsupported")}),(0,y.jsx)(P,{label:e("bootBootCapable"),children:i.bootCapable?e("yes"):e("no")}),(0,y.jsx)(P,{label:e("bootPrivileged"),children:i.privileged?e("yes"):e("no")}),(0,y.jsx)(P,{label:e("bootUnitPath"),children:(0,y.jsx)(re,{children:A(i.unitPath)})}),(0,y.jsx)(P,{label:e("bootMechanism"),children:A(i.mechanism)}),K===null?null:(0,y.jsx)(m,{children:K}),i.detail.length>0?(0,y.jsx)(m,{children:i.detail}):null]})]})}var B=require("react/jsx-runtime");function gn(e){return e.defaultEntryId??"dsh"}function Et({t:e,status:t,run:n,busy:r}){let o=t.entries??[],a=t.settings.manageDsh===!0,i=t.boot.platform==="win32",s=t.surface==="desktop",h=gn(t),d=g=>{if(g){let S={id:h,autostart:!0};n("entries.apply",()=>E("entries.apply",{intents:[S]}))}else n("entries.remove",()=>E("entries.remove",{id:h}))};return(0,B.jsxs)(q,{icon:(0,B.jsx)(tt,{}),title:e("entriesTitle"),children:[(0,B.jsx)(ve,{label:e("entriesManage",{id:h}),checked:s?!1:a,disabled:r!==null||s,onChange:d}),s?(0,B.jsx)(V,{tone:"warn",children:e("entriesManageDesktop",{id:h})}):(0,B.jsx)(m,{children:e("entriesManageNote",{id:h})}),i?(0,B.jsx)(V,{tone:"warn",children:e("entriesManageWinWarning",{id:h})}):null,o.length===0?(0,B.jsx)(m,{children:e("entriesEmpty",{id:h})}):(0,B.jsx)("div",{className:"hh-list",children:o.map(g=>{let S=g.live;return(0,B.jsxs)("div",{className:"hh-item",children:[(0,B.jsxs)("span",{className:"hh-item-main",children:[(0,B.jsx)("span",{className:"hh-item-name",children:g.intent.id}),(0,B.jsx)(O,{tone:g.exists?"ok":"bad",children:g.exists?e("entriesExists"):e("entriesMissing")}),(0,B.jsx)(O,{children:g.managed?e("entriesManaged"):e("entriesUnmanaged")}),g.drift.length>0?(0,B.jsx)(O,{tone:"warn",children:`${e("entriesDrift")} ${st(g.drift)}`}):null]}),(0,B.jsx)("span",{className:"hh-item-spacer"}),(0,B.jsx)("span",{className:"hh-item-meta",children:S===null?e("entriesNotRunning"):`${A(S.status)}${S.pid===null?"":` \xB7 pid ${S.pid}`}`})]},g.intent.id)})})]})}var ce=require("react");var l=require("react/jsx-runtime"),mn={absent:"panelTokenWarnAbsent",present:"panelTokenWarnPresent",stale:"panelTokenWarnStale"};function fn(e){if(e.token!=="enrolled")return e.token!=="unknown"?mn[e.token]:e.url===null?void 0:"panelTokenWarnUnreachable"}function vn(e,t){if(!e.ok)return t("panelTokenRegenerateFailed",{message:e.error.message});let n=e.value?.panel;return n!==void 0&&n.detail.length>0?n.detail:t("panelTokenRegenerated")}var bn=new Set(["network","no-fetch","client"]);function yn(e,t){return e.ok?e.value?.detail||t("panelStopped"):bn.has(e.error.code)?t("panelStopping"):t("panelStopFailed",{message:e.error.message})}function Rt(e,t,n){let r=n==="start"?"panelStartFailed":"panelReplaceFailed";if(!e.ok)return t(r,{message:e.error.message});let o=e.value;return o?.ok===!1?t(r,{message:o.detail??""}):o?.detail&&o.detail.length>0?o.detail:null}function Sn({value:e,label:t,hint:n,invalidLabel:r,placeholder:o,disabled:a,onChange:i}){let[s,h]=(0,ce.useState)(e===null?"":String(e));(0,ce.useEffect)(()=>{h(e===null?"":String(e))},[e]);let d=s.trim()===""?null:Number(s),g=d!==null&&(!Number.isInteger(d)||d<1||d>65535),S=()=>{if(g){h(e===null?"":String(e));return}d!==e&&i(d)};return(0,l.jsxs)("div",{className:"hh-field-block",children:[(0,l.jsxs)("div",{className:"hh-field",children:[(0,l.jsx)("label",{className:"hh-field-label",htmlFor:"hh-panel-port",children:t}),(0,l.jsx)("input",{id:"hh-panel-port",className:"hh-input",type:"number",value:s,placeholder:o,disabled:a,onChange:$=>h($.target.value),onBlur:S,onKeyDown:$=>{$.key==="Enter"&&S()}})]}),(0,l.jsx)(m,{children:g?r:n})]})}function At({t:e,status:t,run:n,updateSettings:r,busy:o,uiStyle:a}){let i=t.panel,s=t.cli,h=t.instances??[],d=s?.prefer??t.settings.cli?.prefer??"pinned",[g,S]=(0,ce.useState)(!1),[$,M]=(0,ce.useState)(null),[X,L]=(0,ce.useState)(null),[Z,U]=(0,ce.useState)(!1),[x,H]=(0,ce.useState)(null),[K,G]=(0,ce.useState)(null),ae=fn(i),Q=s?.version??null,de=Q!==null&&i.version!==null,ee=i.reachable&&de&&Q!==i.version,{dependency:te,global:C}=s===void 0?{dependency:null,global:null}:ht(s),I=s===void 0?[]:[`pnpm add -g home-hosted@${s.expectedRange}`,`npm install -g home-hosted@${s.expectedRange}`],N=T=>{r(D=>({...D,cli:{...D.cli,prefer:T}}))},F=async()=>{let T=await n("cli.installGlobal",()=>E("cli.installGlobal",{}));if(!T.ok){M(e("panelInstallFailed",{message:T.error.message}));return}let D=T.value;D?.ok===!1?M(D.output&&D.output.length>0?D.output:e("panelInstallFailed",{message:D.detail??""})):M(typeof D?.output=="string"?D.output:null)},W=async()=>{L(vn(await n("panel.reclaimToken",()=>E("panel.reclaimToken",{})),e))},u=async()=>{G(Rt(await n("panel.start",()=>E("panel.start",{})),e,"start"))},z=async()=>{S(!1),G(Rt(await n("panel.takeover",()=>E("panel.takeover",{})),e,"replace"))},R=async()=>{U(!1),H(e("panelStopping")),H(yn(await n("panel.stop",()=>E("panel.stop",{})),e))};return(0,l.jsxs)(q,{icon:(0,l.jsx)(Qe,{}),title:e("panelTitle"),children:[ae===void 0?null:(0,l.jsxs)(V,{tone:"warn",title:e("panelTokenWarningTitle"),children:[(0,l.jsx)("p",{children:e(ae)}),i.reachable||i.token==="unknown"?null:(0,l.jsx)("p",{children:e("panelTokenWarnPanelDown")}),(0,l.jsx)("div",{className:"hh-note-actions",children:(0,l.jsx)(b,{variant:"primary",busy:o==="panel.reclaimToken",onClick:()=>{W()},children:e("panelTokenRegenerate")})})]}),X===null?null:(0,l.jsx)(m,{children:X}),s===void 0?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"hh-choice",role:"radiogroup","aria-label":e("panelCopy"),children:[(0,l.jsx)(Se,{label:e("optionsPreferPinned"),hint:(0,l.jsx)(Ee,{children:e("optionsRecommended")}),meta:te===null?void 0:A(te.version),path:te?.path??void 0,checked:d==="pinned",disabled:te===null||o==="settings",onChange:()=>N("pinned")}),(0,l.jsx)(Se,{label:e("optionsPreferGlobal"),meta:C===null?void 0:A(C.version),path:C?.path??void 0,checked:d==="global",disabled:C===null||o==="settings",onChange:()=>N("global")})]}),(0,l.jsx)(m,{children:e("panelCopyHint")}),s.source==="config"?(0,l.jsx)(m,{children:e("optionsConfigOverride")}):null,s.source==="path"&&d!=="global"?(0,l.jsx)(m,{children:e("panelCliNotPinned",{range:s.expectedRange})}):null,s.supported?null:(0,l.jsx)(V,{tone:"warn",children:e("panelCliUnsupported")}),s.launcherPath!=null&&s.launcherVersion==null?(0,l.jsx)(V,{tone:"warn",children:e("panelCliLauncherFailed")}):null]}),(0,l.jsx)(Sn,{value:t.settings.panel?.port??null,label:e("panelPort"),hint:i.reachable?e("panelPortHint"):e("panelPortFree"),invalidLabel:e("panelPortInvalid"),placeholder:i.configPort==null?void 0:String(i.configPort),disabled:i.reachable||o!==null,onChange:T=>r(D=>({...D,panel:{...D.panel,port:T}}))}),t.panelRootSource!=="legacy"?null:(0,l.jsx)(m,{children:e("panelRootLegacy")}),h.length<=1?null:(0,l.jsxs)(le,{label:e("panelInstances",{count:h.length}),open:a==="detailed",children:[h.map(T=>(0,l.jsxs)(P,{label:T.managed?e("panelInstanceManaged"):e("panelInstanceOther"),children:[(0,l.jsx)(re,{children:T.home}),T.url===null?null:(0,l.jsxs)(l.Fragment,{children:[" \xB7 ",(0,l.jsx)(pe,{href:T.url,children:T.url})]}),` \xB7 ${T.running?e("stateAnswering"):e("stateNotAnswering")}`,T.version===null?null:` \xB7 ${T.version}`,T.hosting?` \xB7 ${e("panelInstanceHosts")}`:null]},T.home)),(0,l.jsx)(m,{children:e("panelInstancesHint")})]}),ee?(0,l.jsx)(m,{children:e("panelOutdated")}):null,(0,l.jsxs)("div",{className:"hh-btn-row",children:[i.reachable?null:(0,l.jsx)(b,{variant:"primary",busy:o==="panel.start",onClick:()=>{u()},children:e("panelStart")}),i.reachable?(0,l.jsx)(b,{variant:"danger",disabled:o!==null,onClick:()=>U(!0),children:e("panelStop")}):null,ee&&!g?(0,l.jsx)(b,{variant:"primary",onClick:()=>S(!0),children:e("panelReplace",{copy:e(d==="global"?"panelCopyGlobal":"panelCopyPinned")})}):null]}),x===null?null:(0,l.jsx)(m,{children:x}),K===null?null:(0,l.jsx)(m,{children:K}),Z?(0,l.jsx)("div",{className:"hh-note",role:"alertdialog","aria-label":e("panelStopTitle"),children:(0,l.jsxs)("div",{className:"hh-note-body",children:[(0,l.jsx)("strong",{children:e("panelStopTitle")}),(0,l.jsx)("p",{children:e("panelStopBody")}),(0,l.jsxs)("div",{className:"hh-note-actions",children:[(0,l.jsx)(b,{onClick:()=>U(!1),children:e("confirmCancel")}),(0,l.jsx)(b,{variant:"danger",busy:o==="panel.stop",onClick:()=>{R()},children:e("confirmStop")})]})]})}):null,ee&&g?(0,l.jsx)("div",{className:"hh-note",role:"alertdialog","aria-label":e("panelTakeoverTitle"),children:(0,l.jsxs)("div",{className:"hh-note-body",children:[(0,l.jsx)("strong",{children:e("panelTakeoverTitle")}),(0,l.jsx)("p",{children:e("panelTakeoverBody",{id:t.defaultEntryId??"dsh"})}),(0,l.jsxs)("div",{className:"hh-note-actions",children:[(0,l.jsx)(b,{onClick:()=>S(!1),children:e("confirmCancel")}),(0,l.jsx)(b,{variant:"danger",busy:o==="panel.takeover",onClick:()=>{z()},children:e("confirmReplace")})]})]})}):null,s!==void 0&&C===null?(0,l.jsxs)(le,{label:e("optionsInstallLabel"),open:a==="detailed",children:[(0,l.jsx)(m,{children:e("optionsInstallHint")}),(0,l.jsx)(xe,{text:I.join(`
7
+ `),copyLabel:e("copy"),copiedLabel:e("copied")}),(0,l.jsx)("div",{className:"hh-btn-row",children:(0,l.jsx)(b,{busy:o==="cli.installGlobal",onClick:()=>{F()},children:e("optionsInstall")})}),$===null?null:(0,l.jsx)("pre",{className:"hh-output",children:$})]}):null,(0,l.jsxs)(le,{label:e("details"),open:a==="detailed",children:[(0,l.jsxs)(P,{label:e("panelHome"),children:[(0,l.jsx)(re,{children:i.home}),t.bootUnitName===void 0?null:(0,l.jsxs)(l.Fragment,{children:[" \xB7 ",t.bootUnitName]})]}),(0,l.jsx)(P,{label:e("panelUrl"),children:i.url===null?A(i.url):(0,l.jsx)(pe,{href:i.url,children:i.url})}),(0,l.jsx)(P,{label:e("panelVersion"),children:A(i.version)}),(0,l.jsx)(P,{label:e("panelPid"),children:A(i.pid)}),(0,l.jsx)(P,{label:e("panelWriteVia"),children:e(ct[i.writeVia]??"writeViaNone")}),(0,l.jsx)(P,{label:e("panelToken"),children:e(dt[i.token]??"tokenUnknown")}),s===void 0?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(P,{label:e("panelCliSource"),children:`${e(pt[s.source]??"panelCliMissing")} \xB7 ${A(s.version)}`}),(0,l.jsx)(P,{label:e("panelCliPath"),children:(0,l.jsx)(re,{children:A(s.path)})})]}),i.detail.length>0?(0,l.jsx)(m,{children:i.detail}):null]})]})}var me=require("react");var It=require("react");var w=require("react/jsx-runtime");function Oe(e){return{id:e.id,label:e.label??"",command:e.command??"",args:(e.args??[]).join(`
8
8
  `),cwd:e.cwd??"",port:e.port===null||e.port===void 0?"":String(e.port),autostart:e.autostart===void 0?"inherit":e.autostart?"on":"off",onPortConflict:e.onPortConflict??""}}function Ht(e){return e.split(`
9
- `).map(t=>t.trim()).filter(t=>t.length>0)}function _e(e){let t=e.trim();if(t.length===0)return null;let n=Number(t);return!Number.isInteger(n)||n<1||n>65535?"invalid":n}function Mt(e){return/^[a-z0-9][a-z0-9_-]*$/.test(e)}function xn(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Lt(e){let t=e.id.trim(),n=e.command.trim();if(!Mt(t)||n.length===0)return null;let r={id:t,command:n},o=e.label.trim();o.length>0&&(r.label=o);let a=Ht(e.args);a.length>0&&(r.args=a);let i=e.cwd.trim();i.length>0&&(r.cwd=i);let s=_e(e.port);return s!=="invalid"&&s!==null&&(r.port=s),e.autostart==="on"&&(r.autostart=!0),e.onPortConflict!==""&&(r.onPortConflict=e.onPortConflict),r}function Ft(e,t){let n={},r=t.label.trim();r!==(e.label??"")&&(n.label=r.length>0?r:null);let o=t.command.trim();o.length>0&&o!==(e.command??"")&&(n.command=o);let a=Ht(t.args);xn(a,e.args??[])||(n.args=a);let i=t.cwd.trim();i.length>0&&i!==(e.cwd??"")&&(n.cwd=i);let s=_e(t.port);if(s!=="invalid"&&s!==(e.port??null)&&(n.port=s),t.autostart!=="inherit"){let p=t.autostart==="on";e.autostart!==p&&(n.autostart=p)}return t.onPortConflict!==""&&t.onPortConflict!==e.onPortConflict&&(n.onPortConflict=t.onPortConflict),Object.keys(n).length>0?n:null}function ge({label:e,hint:t,children:n}){return(0,x.jsxs)("div",{className:"hh-field-block",children:[(0,x.jsxs)("div",{className:"hh-field",children:[(0,x.jsx)("span",{className:"hh-field-label",children:e}),n]}),t===void 0?null:(0,x.jsx)(m,{children:t})]})}function Ue({t:e,title:t,initial:n,submitLabel:r,busy:o,lockId:a,onSubmit:i,onCancel:s}){let[p,h]=(0,It.useState)(n),g=(S,B)=>h(q=>({...q,[S]:B})),v=p.id.trim(),F=!a&&v.length>0&&!Mt(v),M=_e(p.port),R=!a&&v.length===0,A=p.command.trim().length===0,z=o||R||A||F||M==="invalid",$=e(R||A?"fieldRequired":F?"fieldIdInvalid":"fieldPortInvalid");return(0,x.jsx)("div",{className:"hh-note",role:"group","aria-label":t,children:(0,x.jsxs)("div",{className:"hh-note-body",children:[(0,x.jsx)("strong",{children:t}),(0,x.jsx)(ge,{label:e("fieldId"),hint:e("fieldIdHint"),children:(0,x.jsx)("input",{className:"hh-input",value:p.id,readOnly:a,disabled:o,onChange:S=>g("id",S.target.value)})}),(0,x.jsx)(ge,{label:e("fieldCommand"),children:(0,x.jsx)("input",{className:"hh-input",value:p.command,disabled:o,onChange:S=>g("command",S.target.value)})}),(0,x.jsx)(ge,{label:e("fieldArgs"),hint:e("fieldArgsHint"),children:(0,x.jsx)("textarea",{className:"hh-input",rows:3,value:p.args,disabled:o,onChange:S=>g("args",S.target.value)})}),(0,x.jsx)(ge,{label:e("fieldCwd"),children:(0,x.jsx)("input",{className:"hh-input",value:p.cwd,disabled:o,onChange:S=>g("cwd",S.target.value)})}),(0,x.jsx)(ge,{label:e("fieldLabel"),children:(0,x.jsx)("input",{className:"hh-input",value:p.label,disabled:o,onChange:S=>g("label",S.target.value)})}),(0,x.jsx)(ge,{label:e("fieldPort"),hint:e("fieldPortHint"),children:(0,x.jsx)("input",{className:"hh-input",type:"number",value:p.port,placeholder:"\u2014",disabled:o,onChange:S=>g("port",S.target.value)})}),(0,x.jsx)(ge,{label:e("fieldAutostart"),children:(0,x.jsx)(fe,{value:p.autostart,label:e("fieldAutostart"),disabled:o,options:[{value:"inherit",label:e("fieldInherit")},{value:"on",label:e("yes")},{value:"off",label:e("no")}],onChange:S=>g("autostart",S)})}),(0,x.jsx)(ge,{label:e("fieldOnPortConflict"),children:(0,x.jsx)(fe,{value:p.onPortConflict,label:e("fieldOnPortConflict"),disabled:o,options:[{value:"",label:e("fieldInherit")},...qe.map(S=>({value:S,label:S}))],onChange:S=>g("onPortConflict",S)})}),(0,x.jsx)(m,{children:e("serversEditorHint")}),z&&!o?(0,x.jsx)(m,{children:$}):null,(0,x.jsxs)("div",{className:"hh-btn-row",children:[(0,x.jsx)(b,{variant:"primary",busy:o,disabled:z,onClick:()=>i(p),children:r}),(0,x.jsx)(b,{variant:"ghost",disabled:o,onClick:s,children:e("confirmCancel")})]})]})})}var kn=5e3;function be(e,t){let n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Bt(e,t){let n=e[t];return typeof n=="string"&&n.length>0?n:null}function Dt(e){let t=e/1e3;return`${Number.isInteger(t)?t:t.toFixed(1)}s`}function Ot(e,t,n){if(!ne(e))return J;if(e.enabled!==!0)return n("serversDisabled");let r=Bt(e,"mode"),o=ne(e.http)?e.http:null,a;if(r==="http"||r===null&&o!==null){let s=(o===null?null:Bt(o,"path"))??"/",p=o===null?null:be(o,"expectStatus"),h=o===null?null:be(o,"expectStatusBelow");a=p!==null?n("serversHealthHttp",{status:p,path:s}):h!==null?n("serversHealthHttpBelow",{status:h,path:s}):n("serversHealthHttpProbe",{path:s})}else t!==null?a=n("serversHealthPort",{port:t}):a=n("serversHealthProbe");let i=be(e,"intervalMs");return i!==null&&i!==kn?`${a} \xB7 ${n("serversHealthEvery",{seconds:Dt(i)})}`:a}function _t(e,t){if(!ne(e))return J;if(e.enabled===!1)return t("serversDisabled");let n=be(e,"maxRetries"),r=be(e,"baseDelayMs"),o=be(e,"factor");return n===null||r===null||o===null?t("serversEnabled"):t("serversRestartSummary",{retries:n,base:Dt(r),factor:o})}var Tn={"not-installed":"idle","installed-disabled":"warn","enabled-running":"ok","enabled-failing":"bad",unsupported:"idle"};function Pn(...e){return e.filter(t=>t!==null&&t.length>0).join(" \xB7 ")}function Cn(e,t){let{panel:n}=e;return n.reachable?{key:"panel",tone:"ok",name:t("sigPanel"),state:t("stateAnswering"),meta:H(n.version),href:n.url}:{key:"panel",tone:e.lastError===null?"idle":"bad",name:t("sigPanel"),state:t("stateNotAnswering"),meta:n.home,href:null}}function Nn(e,t){let{boot:n}=e,o=e.settings.autostart.enabled&&n.state==="not-installed"?"warn":Tn[n.state]??"idle",a=n.mechanism??(e.settings.autostart.mechanism==="auto"?null:e.settings.autostart.mechanism);return{key:"autostart",tone:o,name:t("sigAutostart"),state:t(Pe[n.state]??"bootStateUnsupported"),meta:a??"",href:null}}function En(e,t){let n=e.entries??[],r=t("sigEntry",{id:e.defaultEntryId??"dsh"}),o=e.settings.manageDsh===!0,a=e.surface==="desktop",i=n.filter(g=>!g.exists).length,s=n.filter(g=>g.drift.length>0).length,p=n.find(g=>g.live!==null)?.live??null;return{key:"entry",tone:a?"idle":o?i>0?"bad":s>0?"warn":p!==null?"ok":"warn":"idle",name:r,state:t(a?"stateWebOnly":o?"stateManaged":"stateNotManaged"),meta:p===null?t("entriesNotRunning"):Pn(H(p.status),p.pid===null?null:`pid ${p.pid}`),href:null}}function Ut(e,t){return[Cn(e,t),Nn(e,t),En(e,t)]}function Wt(e,t){let n=e.filter(r=>r.status==="running").length;return t("serversCount",{running:n,total:e.length})}var c=require("react/jsx-runtime");function Ae(e,t){return{workspace:e,id:t}}function Rn(e,t){return{workspace:e,entry:t}}function An(e,t,n){return{workspace:e,id:t,patch:n}}function In(e,t){return{workspace:e,id:t}}function Z(e,t,n){return`${t}:${e}/${n}`}function Re(e,t){return t!==null&&t.workspace===e?t.value:null}function Hn({t:e,workspace:t,server:n,run:r,busy:o,offline:a,onEdit:i,onDelete:s,onFreePort:p}){let h=n.status==="running";return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(b,{variant:"ghost",disabled:a||h,busy:o===Z(t,"servers.start",n.id),onClick:()=>{r(Z(t,"servers.start",n.id),()=>k("servers.start",Ae(t,n.id)))},children:e("serversStart")}),(0,c.jsx)(b,{variant:"ghost",disabled:a||!h,busy:o===Z(t,"servers.stop",n.id),onClick:()=>{r(Z(t,"servers.stop",n.id),()=>k("servers.stop",Ae(t,n.id)))},children:e("serversStop")}),(0,c.jsx)(b,{variant:"ghost",disabled:a||!h,busy:o===Z(t,"servers.restart",n.id),onClick:()=>{r(Z(t,"servers.restart",n.id),()=>k("servers.restart",Ae(t,n.id)))},children:e("serversRestart")}),(0,c.jsx)(b,{variant:"ghost",disabled:a,onClick:i,children:e("serversEdit")}),(0,c.jsx)(b,{variant:"ghost",disabled:a,onClick:s,children:e("serversDelete")}),n.config.port==null?null:(0,c.jsx)(b,{variant:"ghost",disabled:a,onClick:p,children:e("serversFreePort")})]})}function Mn({text:e}){return e.length===0?(0,c.jsx)(c.Fragment,{children:J}):(0,c.jsx)("span",{className:"hh-nowrap",title:e,children:(0,c.jsx)(re,{children:e})})}function Vt({t:e,status:t,run:n,busy:r,uiStyle:o,workspace:a,servers:i,serversError:s}){let p=!t.panel.reachable||r!==null,h=new Map(a===t.workspace?(t.entries??[]).map(u=>[u.intent.id,u.intent]):[]),[g,v]=(0,me.useState)(!1),[F,M]=(0,me.useState)(null),[R,A]=(0,me.useState)(null),[z,$]=(0,me.useState)(null),[S,B]=(0,me.useState)(null),q=Re(a,F),K=Re(a,R),ae=Re(a,z),Q=Re(a,S),de=()=>{v(!0),M(null),A(null),$(null)},ee=u=>{v(!1),M({workspace:a,value:u}),A(null),$(null)},te=()=>{v(!1),M(null)},N=async u=>{let Y=Lt(u);if(Y===null)return;(await n("servers.create",()=>k("servers.create",Rn(a,Y)))).ok&&te()},L=async(u,Y,I)=>{let P=Ft(I.config,Y);if(P===null){M(null);return}(await n(Z(a,"servers.update",u),()=>k("servers.update",An(a,u,P)))).ok&&M(null)},E=async u=>{A(null),await n(Z(a,"servers.delete",u),()=>k("servers.delete",In(a,u)))},D=async u=>{$(null);let Y=await n(Z(a,"servers.freePort",u.id),()=>k("servers.freePort",Ae(a,u.id)));if(!Y.ok){B({workspace:a,value:e("serversPortRefused",{message:Y.error.message})});return}let I=Y.value,P=I?.port??u.config.port??J;if(I?.free===!0){B({workspace:a,value:e("serversPortFreed",{port:P})});return}B({workspace:a,value:I?.skipped!==void 0&&I.skipped.length>0?e("serversPortSkipped"):e("serversPortHeld",{port:P})})},j=ae===null?null:i.find(u=>u.id===ae)??null;return(0,c.jsxs)(X,{icon:(0,c.jsx)(ke,{}),title:e("serversTitle"),action:(0,c.jsx)(U,{children:Wt(i,e)}),children:[(0,c.jsxs)(m,{children:[`${e("serversWorkspace")} `,(0,c.jsx)(re,{children:a})," \xB7 ",t.panel.url===null?e("serversHintNoPanel"):(0,c.jsxs)(c.Fragment,{children:[`${e("serversHintPanel")} `,(0,c.jsx)(pe,{href:t.panel.url,children:t.panel.url})]})]}),s===null?null:(0,c.jsx)(Ne,{title:e("errorTitle"),detail:`${s.code} \u2014 ${s.message}`}),(0,c.jsx)("div",{className:"hh-btn-row",children:(0,c.jsx)(b,{variant:"primary",disabled:p||g,onClick:de,children:e("serversAdd")})}),g?(0,c.jsx)(Ue,{t:e,title:e("serversCreateTitle"),initial:Oe({id:"",command:""}),submitLabel:e("serversCreate"),busy:r==="servers.create",lockId:!1,onSubmit:u=>{N(u)},onCancel:te},"create"):null,j===null?null:(0,c.jsxs)(G,{tone:"warn",title:e("serversFreePortTitle",{port:H(j.config.port)}),children:[(0,c.jsx)("p",{children:e("serversFreePortBody")}),(0,c.jsxs)("div",{className:"hh-note-actions",children:[(0,c.jsx)(b,{onClick:()=>$(null),children:e("confirmCancel")}),(0,c.jsx)(b,{variant:"danger",busy:r===Z(a,"servers.freePort",j.id),onClick:()=>{D(j)},children:e("serversFreePortGo")})]})]}),Q===null?null:(0,c.jsx)(m,{children:Q}),i.length===0?(0,c.jsx)(m,{children:e("serversEmpty")}):(0,c.jsx)("div",{className:o==="detailed"?"hh-cards":"hh-list",children:i.map(u=>{let Y=u.status==="running",I=u.config,P=q===u.id?(0,c.jsx)(Ue,{t:e,title:e("serversEditTitle",{id:u.id}),initial:Oe(I),submitLabel:e("serversSave"),busy:r===Z(a,"servers.update",u.id),lockId:!0,onSubmit:Ie=>{L(u.id,Ie,u)},onCancel:()=>M(null)},`edit:${u.id}`):null,_=K===u.id?(0,c.jsxs)(G,{tone:"warn",title:e("serversDeleteTitle",{id:u.id}),children:[(0,c.jsx)("p",{children:e("serversDeleteBody",{workspace:a})}),(0,c.jsxs)("div",{className:"hh-note-actions",children:[(0,c.jsx)(b,{onClick:()=>A(null),children:e("confirmCancel")}),(0,c.jsx)(b,{variant:"danger",busy:r===Z(a,"servers.delete",u.id),onClick:()=>{E(u.id)},children:e("serversDeleteGo")})]})]}):null,Ve=(0,c.jsx)(Hn,{t:e,workspace:a,server:u,run:n,busy:r,offline:p,onEdit:()=>ee(u.id),onDelete:()=>{A({workspace:a,value:u.id}),M(null),v(!1)},onFreePort:()=>{$({workspace:a,value:u.id}),M(null),v(!1)}});if(o==="detailed"){let Ie=(I.args??[]).join(" "),He=I.cwd??"",qt=h.get(u.id)?.persistent;return(0,c.jsxs)("article",{className:"hh-card",children:[(0,c.jsxs)("div",{className:"hh-card-head",children:[(0,c.jsx)("span",{className:"hh-item-name",children:u.id}),(0,c.jsx)(U,{tone:Y?"ok":"idle",children:H(u.status)}),qt===!0?(0,c.jsx)("span",{title:e("serversPersistentHint"),children:(0,c.jsx)(U,{tone:"accent",children:e("serversPersistent")})}):null,(0,c.jsx)("span",{className:"hh-item-spacer"}),(0,c.jsx)("span",{className:"hh-item-actions",children:Ve})]}),(0,c.jsxs)("div",{className:"hh-card-facts",children:[(0,c.jsx)(C,{label:e("serversUrl"),children:u.url===null?H(u.url):(0,c.jsx)(pe,{href:u.url,children:u.url})}),(0,c.jsx)(C,{label:e("serversPid"),children:H(u.pid)}),(0,c.jsx)(C,{label:e("serversPort"),children:H(I.port)}),(0,c.jsx)(C,{label:e("serversAutostart"),children:I.autostart===void 0?J:I.autostart?e("yes"):e("no")})]}),(0,c.jsxs)(le,{label:e("serversConfiguration"),children:[(0,c.jsx)(C,{label:e("serversCommand"),children:I.command===void 0||I.command.length===0?J:(0,c.jsx)("span",{className:"hh-nowrap",title:I.command,children:(0,c.jsx)(re,{children:I.command})})}),(0,c.jsx)(C,{label:e("serversArgs"),children:(0,c.jsx)(Mn,{text:Ie})}),(0,c.jsx)(C,{label:e("serversCwd"),children:He.length===0?J:(0,c.jsx)("span",{className:"hh-nowrap",title:He,children:(0,c.jsx)(re,{children:Ce(He)})})}),(0,c.jsx)(C,{label:e("serversOnPortConflict"),children:H(I.onPortConflict)}),(0,c.jsx)(C,{label:e("serversHealth"),children:Ot(I.health,I.port??null,e)}),(0,c.jsx)(C,{label:e("serversRestartPolicy"),children:_t(I.restart,e)})]}),(0,c.jsx)(le,{label:e("serversRawConfig"),children:(0,c.jsx)("pre",{className:"hh-output",children:JSON.stringify(I,null,2)})}),P,_]},u.id)}return(0,c.jsxs)(me.Fragment,{children:[(0,c.jsxs)("div",{className:"hh-item",children:[(0,c.jsxs)("span",{className:"hh-item-main",children:[(0,c.jsx)("span",{className:"hh-item-name",children:u.id}),(0,c.jsx)(U,{tone:Y?"ok":"idle",children:H(u.status)}),u.url===null?null:(0,c.jsx)(pe,{href:u.url,children:u.url})]}),(0,c.jsx)("span",{className:"hh-item-spacer"}),u.pid===null?null:(0,c.jsx)("span",{className:"hh-item-meta",children:`${e("serversPid")} ${u.pid}`}),(0,c.jsx)("span",{className:"hh-item-actions",children:Ve})]}),P,_]},u.id)})})]})}var $t=require("react");var W=require("react/jsx-runtime");function Ln(e){let t=typeof e.label=="string"?e.label.trim():"";return t.length===0||t===e.id?e.id:`${e.id} \u2014 ${t}`}function Fn(e,t){return e.source==="file"?t("workspacesCountsFile",{servers:e.servers}):t("workspacesCounts",{servers:e.servers,running:e.running})}function jt({t:e,status:t,run:n,busy:r,viewing:o,onView:a}){let i=t.workspaces??[],s=t.workspace??Ye,p=t.defaultEntryId??"dsh",h=t.legacyRoot===!0||(t.lastError??"").includes("pre-0.7"),g=i.some(R=>R.source==="file"),[v,F]=(0,$t.useState)(null),M=async()=>{let R=await n("panel.migrate",()=>k("panel.migrate",{}));if(!R.ok){F(`${e("workspaceMigrateFailed")} ${R.error.message}`);return}let A=R.value,z=typeof A?.detail=="string"&&A.detail.length>0?A.detail:null;A?.ok===!1?F(z??e("workspaceMigrateFailed")):F(z??e("workspaceMigrateDone"))};return(0,W.jsxs)(X,{icon:(0,W.jsx)(ke,{}),title:e("workspacesTitle"),action:(0,W.jsx)(U,{tone:"accent",children:o}),children:[(0,W.jsx)(m,{children:e("workspacesHint",{id:p})}),i.length===0?(0,W.jsx)(m,{children:e("workspacesEmpty")}):(0,W.jsx)("div",{className:"hh-choice",role:"radiogroup","aria-label":e("workspacesViewLabel"),children:i.map(R=>{let A=R.id===s?(0,W.jsx)(Ee,{children:e("workspacesManagedTag")}):R.id===o?(0,W.jsx)(U,{tone:"accent",children:e("workspacesViewingTag")}):void 0;return(0,W.jsx)(we,{label:Ln(R),meta:Fn(R,e),hint:A,checked:R.id===o,onChange:()=>a(R.id)},R.id)})}),g?(0,W.jsx)(G,{tone:"warn",children:e("workspacesDegraded")}):null,h?(0,W.jsxs)(G,{tone:"warn",title:e("workspaceLegacyTitle"),children:[(0,W.jsx)("p",{children:e("workspaceLegacyBody")}),(0,W.jsx)("div",{className:"hh-note-actions",children:(0,W.jsx)(b,{variant:"primary",busy:r==="panel.migrate",onClick:()=>{M()},children:e("workspaceMigrate")})})]}):null,v===null?null:(0,W.jsx)(m,{children:v})]})}var We=`
9
+ `).map(t=>t.trim()).filter(t=>t.length>0)}function _e(e){let t=e.trim();if(t.length===0)return null;let n=Number(t);return!Number.isInteger(n)||n<1||n>65535?"invalid":n}function Mt(e){return/^[a-z0-9][a-z0-9_-]*$/.test(e)}function xn(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Lt(e){let t=e.id.trim(),n=e.command.trim();if(!Mt(t)||n.length===0)return null;let r={id:t,command:n},o=e.label.trim();o.length>0&&(r.label=o);let a=Ht(e.args);a.length>0&&(r.args=a);let i=e.cwd.trim();i.length>0&&(r.cwd=i);let s=_e(e.port);return s!=="invalid"&&s!==null&&(r.port=s),e.autostart==="on"&&(r.autostart=!0),e.onPortConflict!==""&&(r.onPortConflict=e.onPortConflict),r}function Ft(e,t){let n={},r=t.label.trim();r!==(e.label??"")&&(n.label=r.length>0?r:null);let o=t.command.trim();o.length>0&&o!==(e.command??"")&&(n.command=o);let a=Ht(t.args);xn(a,e.args??[])||(n.args=a);let i=t.cwd.trim();i.length>0&&i!==(e.cwd??"")&&(n.cwd=i);let s=_e(t.port);if(s!=="invalid"&&s!==(e.port??null)&&(n.port=s),t.autostart!=="inherit"){let h=t.autostart==="on";e.autostart!==h&&(n.autostart=h)}return t.onPortConflict!==""&&t.onPortConflict!==e.onPortConflict&&(n.onPortConflict=t.onPortConflict),Object.keys(n).length>0?n:null}function ge({label:e,hint:t,children:n}){return(0,w.jsxs)("div",{className:"hh-field-block",children:[(0,w.jsxs)("div",{className:"hh-field",children:[(0,w.jsx)("span",{className:"hh-field-label",children:e}),n]}),t===void 0?null:(0,w.jsx)(m,{children:t})]})}function Ue({t:e,title:t,initial:n,submitLabel:r,busy:o,lockId:a,onSubmit:i,onCancel:s}){let[h,d]=(0,It.useState)(n),g=(x,H)=>d(K=>({...K,[x]:H})),S=h.id.trim(),$=!a&&S.length>0&&!Mt(S),M=_e(h.port),X=!a&&S.length===0,L=h.command.trim().length===0,Z=o||X||L||$||M==="invalid",U=e(X||L?"fieldRequired":$?"fieldIdInvalid":"fieldPortInvalid");return(0,w.jsx)("div",{className:"hh-note",role:"group","aria-label":t,children:(0,w.jsxs)("div",{className:"hh-note-body",children:[(0,w.jsx)("strong",{children:t}),(0,w.jsx)(ge,{label:e("fieldId"),hint:e("fieldIdHint"),children:(0,w.jsx)("input",{className:"hh-input",value:h.id,readOnly:a,disabled:o,onChange:x=>g("id",x.target.value)})}),(0,w.jsx)(ge,{label:e("fieldCommand"),children:(0,w.jsx)("input",{className:"hh-input",value:h.command,disabled:o,onChange:x=>g("command",x.target.value)})}),(0,w.jsx)(ge,{label:e("fieldArgs"),hint:e("fieldArgsHint"),children:(0,w.jsx)("textarea",{className:"hh-input",rows:3,value:h.args,disabled:o,onChange:x=>g("args",x.target.value)})}),(0,w.jsx)(ge,{label:e("fieldCwd"),children:(0,w.jsx)("input",{className:"hh-input",value:h.cwd,disabled:o,onChange:x=>g("cwd",x.target.value)})}),(0,w.jsx)(ge,{label:e("fieldLabel"),children:(0,w.jsx)("input",{className:"hh-input",value:h.label,disabled:o,onChange:x=>g("label",x.target.value)})}),(0,w.jsx)(ge,{label:e("fieldPort"),hint:e("fieldPortHint"),children:(0,w.jsx)("input",{className:"hh-input",type:"number",value:h.port,placeholder:"\u2014",disabled:o,onChange:x=>g("port",x.target.value)})}),(0,w.jsx)(ge,{label:e("fieldAutostart"),children:(0,w.jsx)(fe,{value:h.autostart,label:e("fieldAutostart"),disabled:o,options:[{value:"inherit",label:e("fieldInherit")},{value:"on",label:e("yes")},{value:"off",label:e("no")}],onChange:x=>g("autostart",x)})}),(0,w.jsx)(ge,{label:e("fieldOnPortConflict"),children:(0,w.jsx)(fe,{value:h.onPortConflict,label:e("fieldOnPortConflict"),disabled:o,options:[{value:"",label:e("fieldInherit")},...qe.map(x=>({value:x,label:x}))],onChange:x=>g("onPortConflict",x)})}),(0,w.jsx)(m,{children:e("serversEditorHint")}),Z&&!o?(0,w.jsx)(m,{children:U}):null,(0,w.jsxs)("div",{className:"hh-btn-row",children:[(0,w.jsx)(b,{variant:"primary",busy:o,disabled:Z,onClick:()=>i(h),children:r}),(0,w.jsx)(b,{variant:"ghost",disabled:o,onClick:s,children:e("confirmCancel")})]})]})})}var wn=5e3;function be(e,t){let n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Bt(e,t){let n=e[t];return typeof n=="string"&&n.length>0?n:null}function Dt(e){let t=e/1e3;return`${Number.isInteger(t)?t:t.toFixed(1)}s`}function Ot(e,t,n){if(!ne(e))return Y;if(e.enabled!==!0)return n("serversDisabled");let r=Bt(e,"mode"),o=ne(e.http)?e.http:null,a;if(r==="http"||r===null&&o!==null){let s=(o===null?null:Bt(o,"path"))??"/",h=o===null?null:be(o,"expectStatus"),d=o===null?null:be(o,"expectStatusBelow");a=h!==null?n("serversHealthHttp",{status:h,path:s}):d!==null?n("serversHealthHttpBelow",{status:d,path:s}):n("serversHealthHttpProbe",{path:s})}else t!==null?a=n("serversHealthPort",{port:t}):a=n("serversHealthProbe");let i=be(e,"intervalMs");return i!==null&&i!==wn?`${a} \xB7 ${n("serversHealthEvery",{seconds:Dt(i)})}`:a}function _t(e,t){if(!ne(e))return Y;if(e.enabled===!1)return t("serversDisabled");let n=be(e,"maxRetries"),r=be(e,"baseDelayMs"),o=be(e,"factor");return n===null||r===null||o===null?t("serversEnabled"):t("serversRestartSummary",{retries:n,base:Dt(r),factor:o})}var kn={"not-installed":"idle","installed-disabled":"warn","enabled-running":"ok","enabled-failing":"bad",unsupported:"idle"};function Tn(...e){return e.filter(t=>t!==null&&t.length>0).join(" \xB7 ")}function Pn(e,t){let{panel:n}=e;return n.reachable?{key:"panel",tone:"ok",name:t("sigPanel"),state:t("stateAnswering"),meta:A(n.version),href:n.url}:{key:"panel",tone:e.lastError===null?"idle":"bad",name:t("sigPanel"),state:t("stateNotAnswering"),meta:n.home,href:null}}function Cn(e,t){let{boot:n}=e,o=e.settings.autostart.enabled&&n.state==="not-installed"?"warn":kn[n.state]??"idle",a=n.mechanism??(e.settings.autostart.mechanism==="auto"?null:e.settings.autostart.mechanism);return{key:"autostart",tone:o,name:t("sigAutostart"),state:t(Pe[n.state]??"bootStateUnsupported"),meta:a??"",href:null}}function Nn(e,t){let n=e.entries??[],r=t("sigEntry",{id:e.defaultEntryId??"dsh"}),o=e.settings.manageDsh===!0,a=e.surface==="desktop",i=n.filter(g=>!g.exists).length,s=n.filter(g=>g.drift.length>0).length,h=n.find(g=>g.live!==null)?.live??null;return{key:"entry",tone:a?"idle":o?i>0?"bad":s>0?"warn":h!==null?"ok":"warn":"idle",name:r,state:t(a?"stateWebOnly":o?"stateManaged":"stateNotManaged"),meta:h===null?t("entriesNotRunning"):Tn(A(h.status),h.pid===null?null:`pid ${h.pid}`),href:null}}function Ut(e,t){return[Pn(e,t),Cn(e,t),Nn(e,t)]}function Wt(e,t){let n=e.filter(r=>r.status==="running").length;return t("serversCount",{running:n,total:e.length})}var c=require("react/jsx-runtime");function Ae(e,t){return{workspace:e,id:t}}function En(e,t){return{workspace:e,entry:t}}function Rn(e,t,n){return{workspace:e,id:t,patch:n}}function An(e,t){return{workspace:e,id:t}}function J(e,t,n){return`${t}:${e}/${n}`}function Re(e,t){return t!==null&&t.workspace===e?t.value:null}function In({t:e,workspace:t,server:n,run:r,busy:o,offline:a,onEdit:i,onDelete:s,onFreePort:h}){let d=n.status==="running";return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(b,{variant:"ghost",disabled:a||d,busy:o===J(t,"servers.start",n.id),onClick:()=>{r(J(t,"servers.start",n.id),()=>E("servers.start",Ae(t,n.id)))},children:e("serversStart")}),(0,c.jsx)(b,{variant:"ghost",disabled:a||!d,busy:o===J(t,"servers.stop",n.id),onClick:()=>{r(J(t,"servers.stop",n.id),()=>E("servers.stop",Ae(t,n.id)))},children:e("serversStop")}),(0,c.jsx)(b,{variant:"ghost",disabled:a||!d,busy:o===J(t,"servers.restart",n.id),onClick:()=>{r(J(t,"servers.restart",n.id),()=>E("servers.restart",Ae(t,n.id)))},children:e("serversRestart")}),(0,c.jsx)(b,{variant:"ghost",disabled:a,onClick:i,children:e("serversEdit")}),(0,c.jsx)(b,{variant:"ghost",disabled:a,onClick:s,children:e("serversDelete")}),n.config.port==null?null:(0,c.jsx)(b,{variant:"ghost",disabled:a,onClick:h,children:e("serversFreePort")})]})}function Hn({text:e}){return e.length===0?(0,c.jsx)(c.Fragment,{children:Y}):(0,c.jsx)("span",{className:"hh-nowrap",title:e,children:(0,c.jsx)(re,{children:e})})}function Vt({t:e,status:t,run:n,busy:r,uiStyle:o,workspace:a,servers:i,serversError:s}){let h=!t.panel.reachable||r!==null,d=new Map(a===t.workspace?(t.entries??[]).map(u=>[u.intent.id,u.intent]):[]),[g,S]=(0,me.useState)(!1),[$,M]=(0,me.useState)(null),[X,L]=(0,me.useState)(null),[Z,U]=(0,me.useState)(null),[x,H]=(0,me.useState)(null),K=Re(a,$),G=Re(a,X),ae=Re(a,Z),Q=Re(a,x),de=()=>{S(!0),M(null),L(null),U(null)},ee=u=>{S(!1),M({workspace:a,value:u}),L(null),U(null)},te=()=>{S(!1),M(null)},C=async u=>{let z=Lt(u);if(z===null)return;(await n("servers.create",()=>E("servers.create",En(a,z)))).ok&&te()},I=async(u,z,R)=>{let T=Ft(R.config,z);if(T===null){M(null);return}(await n(J(a,"servers.update",u),()=>E("servers.update",Rn(a,u,T)))).ok&&M(null)},N=async u=>{L(null),await n(J(a,"servers.delete",u),()=>E("servers.delete",An(a,u)))},F=async u=>{U(null);let z=await n(J(a,"servers.freePort",u.id),()=>E("servers.freePort",Ae(a,u.id)));if(!z.ok){H({workspace:a,value:e("serversPortRefused",{message:z.error.message})});return}let R=z.value,T=R?.port??u.config.port??Y;if(R?.free===!0){H({workspace:a,value:e("serversPortFreed",{port:T})});return}H({workspace:a,value:R?.skipped!==void 0&&R.skipped.length>0?e("serversPortSkipped"):e("serversPortHeld",{port:T})})},W=ae===null?null:i.find(u=>u.id===ae)??null;return(0,c.jsxs)(q,{icon:(0,c.jsx)(ke,{}),title:e("serversTitle"),action:(0,c.jsx)(O,{children:Wt(i,e)}),children:[(0,c.jsxs)(m,{children:[`${e("serversWorkspace")} `,(0,c.jsx)(re,{children:a})," \xB7 ",t.panel.url===null?e("serversHintNoPanel"):(0,c.jsxs)(c.Fragment,{children:[`${e("serversHintPanel")} `,(0,c.jsx)(pe,{href:t.panel.url,children:t.panel.url})]})]}),s===null?null:(0,c.jsx)(Ne,{title:e("errorTitle"),detail:`${s.code} \u2014 ${s.message}`}),(0,c.jsx)("div",{className:"hh-btn-row",children:(0,c.jsx)(b,{variant:"primary",disabled:h||g,onClick:de,children:e("serversAdd")})}),g?(0,c.jsx)(Ue,{t:e,title:e("serversCreateTitle"),initial:Oe({id:"",command:""}),submitLabel:e("serversCreate"),busy:r==="servers.create",lockId:!1,onSubmit:u=>{C(u)},onCancel:te},"create"):null,W===null?null:(0,c.jsxs)(V,{tone:"warn",title:e("serversFreePortTitle",{port:A(W.config.port)}),children:[(0,c.jsx)("p",{children:e("serversFreePortBody")}),(0,c.jsxs)("div",{className:"hh-note-actions",children:[(0,c.jsx)(b,{onClick:()=>U(null),children:e("confirmCancel")}),(0,c.jsx)(b,{variant:"danger",busy:r===J(a,"servers.freePort",W.id),onClick:()=>{F(W)},children:e("serversFreePortGo")})]})]}),Q===null?null:(0,c.jsx)(m,{children:Q}),i.length===0?(0,c.jsx)(m,{children:e("serversEmpty")}):(0,c.jsx)("div",{className:o==="detailed"?"hh-cards":"hh-list",children:i.map(u=>{let z=u.status==="running",R=u.config,T=K===u.id?(0,c.jsx)(Ue,{t:e,title:e("serversEditTitle",{id:u.id}),initial:Oe(R),submitLabel:e("serversSave"),busy:r===J(a,"servers.update",u.id),lockId:!0,onSubmit:Ie=>{I(u.id,Ie,u)},onCancel:()=>M(null)},`edit:${u.id}`):null,D=G===u.id?(0,c.jsxs)(V,{tone:"warn",title:e("serversDeleteTitle",{id:u.id}),children:[(0,c.jsx)("p",{children:e("serversDeleteBody",{workspace:a})}),(0,c.jsxs)("div",{className:"hh-note-actions",children:[(0,c.jsx)(b,{onClick:()=>L(null),children:e("confirmCancel")}),(0,c.jsx)(b,{variant:"danger",busy:r===J(a,"servers.delete",u.id),onClick:()=>{N(u.id)},children:e("serversDeleteGo")})]})]}):null,Ve=(0,c.jsx)(In,{t:e,workspace:a,server:u,run:n,busy:r,offline:h,onEdit:()=>ee(u.id),onDelete:()=>{L({workspace:a,value:u.id}),M(null),S(!1)},onFreePort:()=>{U({workspace:a,value:u.id}),M(null),S(!1)}});if(o==="detailed"){let Ie=(R.args??[]).join(" "),He=R.cwd??"",Yt=d.get(u.id)?.persistent;return(0,c.jsxs)("article",{className:"hh-card",children:[(0,c.jsxs)("div",{className:"hh-card-head",children:[(0,c.jsx)("span",{className:"hh-item-name",children:u.id}),(0,c.jsx)(O,{tone:z?"ok":"idle",children:A(u.status)}),Yt===!0?(0,c.jsx)("span",{title:e("serversPersistentHint"),children:(0,c.jsx)(O,{tone:"accent",children:e("serversPersistent")})}):null,(0,c.jsx)("span",{className:"hh-item-spacer"}),(0,c.jsx)("span",{className:"hh-item-actions",children:Ve})]}),(0,c.jsxs)("div",{className:"hh-card-facts",children:[(0,c.jsx)(P,{label:e("serversUrl"),children:u.url===null?A(u.url):(0,c.jsx)(pe,{href:u.url,children:u.url})}),(0,c.jsx)(P,{label:e("serversPid"),children:A(u.pid)}),(0,c.jsx)(P,{label:e("serversPort"),children:A(R.port)}),(0,c.jsx)(P,{label:e("serversAutostart"),children:R.autostart===void 0?Y:R.autostart?e("yes"):e("no")})]}),(0,c.jsxs)(le,{label:e("serversConfiguration"),children:[(0,c.jsx)(P,{label:e("serversCommand"),children:R.command===void 0||R.command.length===0?Y:(0,c.jsx)("span",{className:"hh-nowrap",title:R.command,children:(0,c.jsx)(re,{children:R.command})})}),(0,c.jsx)(P,{label:e("serversArgs"),children:(0,c.jsx)(Hn,{text:Ie})}),(0,c.jsx)(P,{label:e("serversCwd"),children:He.length===0?Y:(0,c.jsx)("span",{className:"hh-nowrap",title:He,children:(0,c.jsx)(re,{children:Ce(He)})})}),(0,c.jsx)(P,{label:e("serversOnPortConflict"),children:A(R.onPortConflict)}),(0,c.jsx)(P,{label:e("serversHealth"),children:Ot(R.health,R.port??null,e)}),(0,c.jsx)(P,{label:e("serversRestartPolicy"),children:_t(R.restart,e)})]}),(0,c.jsx)(le,{label:e("serversRawConfig"),children:(0,c.jsx)("pre",{className:"hh-output",children:JSON.stringify(R,null,2)})}),T,D]},u.id)}return(0,c.jsxs)(me.Fragment,{children:[(0,c.jsxs)("div",{className:"hh-item",children:[(0,c.jsxs)("span",{className:"hh-item-main",children:[(0,c.jsx)("span",{className:"hh-item-name",children:u.id}),(0,c.jsx)(O,{tone:z?"ok":"idle",children:A(u.status)}),u.url===null?null:(0,c.jsx)(pe,{href:u.url,children:u.url})]}),(0,c.jsx)("span",{className:"hh-item-spacer"}),u.pid===null?null:(0,c.jsx)("span",{className:"hh-item-meta",children:`${e("serversPid")} ${u.pid}`}),(0,c.jsx)("span",{className:"hh-item-actions",children:Ve})]}),T,D]},u.id)})})]})}var j=require("react/jsx-runtime");function Mn(e){let t=typeof e.label=="string"?e.label.trim():"";return t.length===0||t===e.id?e.id:`${e.id} \u2014 ${t}`}function Ln(e,t){return e.source==="file"?t("workspacesCountsFile",{servers:e.servers}):t("workspacesCounts",{servers:e.servers,running:e.running})}function $t({t:e,status:t,viewing:n,onView:r}){let o=t.workspaces??[],a=t.workspace??Ye,i=t.defaultEntryId??"dsh",s=t.legacyRoot===!0||(t.lastError??"").includes("pre-0.7"),h=o.some(d=>d.source==="file");return(0,j.jsxs)(q,{icon:(0,j.jsx)(ke,{}),title:e("workspacesTitle"),action:(0,j.jsx)(O,{tone:"accent",children:n}),children:[(0,j.jsx)(m,{children:e("workspacesHint",{id:i})}),o.length===0?(0,j.jsx)(m,{children:e("workspacesEmpty")}):(0,j.jsx)("div",{className:"hh-choice",role:"radiogroup","aria-label":e("workspacesViewLabel"),children:o.map(d=>{let g=d.id===a?(0,j.jsx)(Ee,{children:e("workspacesManagedTag")}):d.id===n?(0,j.jsx)(O,{tone:"accent",children:e("workspacesViewingTag")}):void 0;return(0,j.jsx)(Se,{label:Mn(d),meta:Ln(d,e),hint:g,checked:d.id===n,onChange:()=>r(d.id)},d.id)})}),h?(0,j.jsx)(V,{tone:"warn",children:e("workspacesDegraded")}):null,s?(0,j.jsx)(V,{tone:"warn",title:e("workspaceLegacyTitle"),children:(0,j.jsx)("p",{children:e("workspaceLegacyBody")})}):null]})}var We=`
10
10
  .hh-root {
11
11
  --hh-line: var(--dsw-alias-border-l2, rgba(128, 128, 128, 0.25));
12
12
  --hh-line-soft: var(--dsw-alias-border-l1, rgba(128, 128, 128, 0.15));
@@ -760,6 +760,6 @@ var module = { exports: {} }; var exports = module.exports;
760
760
  .hh-tool-cards { grid-template-columns: minmax(0, 1fr); }
761
761
  .hh-card-facts { grid-template-columns: minmax(0, 1fr); }
762
762
  }
763
- `;var f=require("react/jsx-runtime");function Bn({signal:e}){return(0,f.jsxs)("div",{className:"hh-signal","data-tone":e.tone,children:[(0,f.jsx)("span",{className:"hh-signal-dot","aria-hidden":"true"}),(0,f.jsx)("span",{className:"hh-signal-name",children:e.name}),(0,f.jsx)("span",{className:"hh-signal-state",children:e.state}),e.meta.length===0&&e.href===null?null:(0,f.jsxs)("span",{className:"hh-signal-meta",children:[e.meta,e.href===null?null:(0,f.jsxs)(f.Fragment,{children:[e.meta.length===0?null:" \xB7 ",(0,f.jsx)(pe,{href:e.href,children:e.href})]})]})]})}function Gt(e){let t=ze(e.t),{data:n,error:r,loading:o,refresh:a}=Ze(),[i,s]=(0,V.useState)(null),[p,h]=(0,V.useState)(null),[g,v]=(0,V.useState)(null),[F,M]=(0,V.useState)([]),[R,A]=(0,V.useState)(null),[z,$]=(0,V.useState)(0),S=(0,V.useRef)(null),B=g??n?.workspace??null,q=(0,V.useCallback)(async E=>{let D=await k("servers.list",{workspace:E});D.ok?(M(D.value),A(null)):A(D.error)},[]);(0,V.useEffect)(()=>{B!==null&&(S.current!==B&&(S.current=B,M([]),A(null)),q(B))},[B,z,q]);let K=(0,V.useCallback)((E,D)=>(h(E),s(null),(async()=>{try{let j=await D();return j.ok||s(j.error),j}catch(j){let u={code:"client",message:j instanceof Error?j.message:String(j)};return s(u),{ok:!1,error:u}}finally{h(null),await a(),$(j=>j+1)}})()),[a]),ae=(0,V.useCallback)(E=>{if(n===null)return;let D=gt(n.settings,E(n.settings));Object.keys(D).length!==0&&K("settings",()=>Xe(D))},[n,K]),Q=n?.settings.uiStyle??"detailed",[de,ee]=(0,V.useState)(Q);(0,V.useEffect)(()=>{ee(Q)},[Q]);let te=E=>{ee(E),ae(D=>({...D,uiStyle:E}))};if(n===null)return(0,f.jsxs)("div",{className:"hh-root",children:[(0,f.jsx)("style",{children:We}),o?(0,f.jsx)(m,{children:t("loading")}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ye,{error:r??{code:"status",message:t("statusUnavailable")},title:t("errorTitle")}),(0,f.jsx)("div",{className:"hh-btn-row",children:(0,f.jsx)(b,{onClick:()=>{a()},children:t("retry")})})]})]});let N={t,status:n,run:K,updateSettings:ae,busy:p,uiStyle:de},L=B??n.workspace??"default";return(0,f.jsxs)("div",{className:"hh-root",children:[(0,f.jsx)("style",{children:We}),(0,f.jsxs)("header",{className:"hh-head",children:[(0,f.jsx)("h2",{className:"hh-title",children:t("tab")}),(0,f.jsx)("span",{className:"hh-head-spacer"}),(0,f.jsx)(fe,{value:de,label:t("uiStyleLabel"),disabled:p==="settings",options:[{value:"detailed",label:t("uiStyleDetailed")},{value:"compact",label:t("uiStyleCompact")}],onChange:E=>te(E)}),(0,f.jsx)(b,{variant:"ghost",icon:(0,f.jsx)(ot,{size:13}),busy:p==="status.refresh",onClick:()=>{K("status.refresh",()=>k("status",{refresh:!0}))},children:t("refresh")})]}),(0,f.jsx)("div",{className:"hh-signals","data-busy":p!==null,children:Ut(n,t).map(E=>(0,f.jsx)(Bn,{signal:E},E.key))}),n.lastError===null?null:(0,f.jsx)(ye,{error:{code:"panel",message:n.lastError},title:t("errorTitle")}),(0,f.jsx)(ye,{error:r,title:t("errorTitle")}),(0,f.jsx)(ye,{error:i,title:t("errorTitle")}),(0,f.jsx)(At,{...N}),(0,f.jsx)(Nt,{...N}),(0,f.jsx)(Et,{...N}),(0,f.jsx)(yt,{...N}),(0,f.jsx)(jt,{...N,viewing:L,onView:v}),(0,f.jsx)(Vt,{...N,workspace:L,servers:F,serversError:R})]})}var Dn=["slots","locale"],zt="[dsh-home-hosted]";function he(e,t){t===void 0?console.warn(`${zt} ${e}`):console.warn(`${zt} ${e}`,t)}function Kt(e,t){try{let n=e.get?.(t);if(n!=null)return n}catch{}try{let n=e[t];if(n!=null)return n}catch{}}function Yt(e,t,n){if(typeof e.effect=="function")try{e.effect(t,n);return}catch(r){he(`registering the effect "${n}" failed`,r);return}try{t()}catch(r){he(`the effect "${n}" failed`,r)}}function On(e){try{let t=Kt(e,"locale"),n=Ge(t);t===void 0?he("the locale service is unavailable; the page keeps its bundled English copy"):Yt(e,()=>{let o=[];try{o.push(t.register(xe,{en:Le,zh:$e}))}catch(a){he("registering the dictionaries failed",a)}return()=>{for(let a of o)try{a()}catch(i){he("disposing a dictionary failed",i)}}},"dsh-home-hosted: dictionaries");let r=Kt(e,"slots");if(r===void 0){he("the slots service is unavailable; the settings section was not registered");return}Yt(e,()=>{try{return r.inject("settings.section",()=>{try{return r.register({name:"settings.section",id:"home-hosted",order:60,label:()=>n("tab"),locale:xe,inject:()=>({t:n})},Gt)}catch(o){return he("registering the settings section failed",o),()=>{}}})}catch(o){return he("injecting into settings.section failed",o),()=>{}}},"dsh-home-hosted: settings section")}catch(t){he("client bootstrap failed",t)}}
763
+ `;var f=require("react/jsx-runtime");function Fn({signal:e}){return(0,f.jsxs)("div",{className:"hh-signal","data-tone":e.tone,children:[(0,f.jsx)("span",{className:"hh-signal-dot","aria-hidden":"true"}),(0,f.jsx)("span",{className:"hh-signal-name",children:e.name}),(0,f.jsx)("span",{className:"hh-signal-state",children:e.state}),e.meta.length===0&&e.href===null?null:(0,f.jsxs)("span",{className:"hh-signal-meta",children:[e.meta,e.href===null?null:(0,f.jsxs)(f.Fragment,{children:[e.meta.length===0?null:" \xB7 ",(0,f.jsx)(pe,{href:e.href,children:e.href})]})]})]})}function jt(e){let t=ze(e.t),{data:n,error:r,loading:o,refresh:a}=Ze(),[i,s]=(0,_.useState)(null),[h,d]=(0,_.useState)(null),[g,S]=(0,_.useState)(null),[$,M]=(0,_.useState)([]),[X,L]=(0,_.useState)(null),[Z,U]=(0,_.useState)(0),x=(0,_.useRef)(null),H=g??n?.workspace??null,K=(0,_.useCallback)(async N=>{let F=await E("servers.list",{workspace:N});F.ok?(M(F.value),L(null)):L(F.error)},[]);(0,_.useEffect)(()=>{H!==null&&(x.current!==H&&(x.current=H,M([]),L(null)),K(H))},[H,Z,K]);let G=(0,_.useCallback)((N,F)=>(d(N),s(null),(async()=>{try{let W=await F();return W.ok||s(W.error),W}catch(W){let u={code:"client",message:W instanceof Error?W.message:String(W)};return s(u),{ok:!1,error:u}}finally{d(null),await a(),U(W=>W+1)}})()),[a]),ae=(0,_.useCallback)(N=>{if(n===null)return;let F=gt(n.settings,N(n.settings));Object.keys(F).length!==0&&G("settings",()=>Xe(F))},[n,G]),Q=n?.settings.uiStyle??"detailed",[de,ee]=(0,_.useState)(Q);(0,_.useEffect)(()=>{ee(Q)},[Q]);let te=N=>{ee(N),ae(F=>({...F,uiStyle:N}))};if(n===null)return(0,f.jsxs)("div",{className:"hh-root",children:[(0,f.jsx)("style",{children:We}),o?(0,f.jsx)(m,{children:t("loading")}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ye,{error:r??{code:"status",message:t("statusUnavailable")},title:t("errorTitle")}),(0,f.jsx)("div",{className:"hh-btn-row",children:(0,f.jsx)(b,{onClick:()=>{a()},children:t("retry")})})]})]});let C={t,status:n,run:G,updateSettings:ae,busy:h,uiStyle:de},I=H??n.workspace??"default";return(0,f.jsxs)("div",{className:"hh-root",children:[(0,f.jsx)("style",{children:We}),(0,f.jsxs)("header",{className:"hh-head",children:[(0,f.jsx)("h2",{className:"hh-title",children:t("tab")}),(0,f.jsx)("span",{className:"hh-head-spacer"}),(0,f.jsx)(fe,{value:de,label:t("uiStyleLabel"),disabled:h==="settings",options:[{value:"detailed",label:t("uiStyleDetailed")},{value:"compact",label:t("uiStyleCompact")}],onChange:N=>te(N)}),(0,f.jsx)(b,{variant:"ghost",icon:(0,f.jsx)(ot,{size:13}),busy:h==="status.refresh",onClick:()=>{G("status.refresh",()=>E("status",{refresh:!0}))},children:t("refresh")})]}),(0,f.jsx)("div",{className:"hh-signals","data-busy":h!==null,children:Ut(n,t).map(N=>(0,f.jsx)(Fn,{signal:N},N.key))}),n.lastError===null?null:(0,f.jsx)(ye,{error:{code:"panel",message:n.lastError},title:t("errorTitle")}),(0,f.jsx)(ye,{error:r,title:t("errorTitle")}),(0,f.jsx)(ye,{error:i,title:t("errorTitle")}),(0,f.jsx)(At,{...C}),(0,f.jsx)(Nt,{...C}),(0,f.jsx)(Et,{...C}),(0,f.jsx)(yt,{...C}),(0,f.jsx)($t,{...C,viewing:I,onView:S}),(0,f.jsx)(Vt,{...C,workspace:I,servers:$,serversError:X})]})}var Bn=["slots","locale"],Gt="[dsh-home-hosted]";function he(e,t){t===void 0?console.warn(`${Gt} ${e}`):console.warn(`${Gt} ${e}`,t)}function zt(e,t){try{let n=e.get?.(t);if(n!=null)return n}catch{}try{let n=e[t];if(n!=null)return n}catch{}}function Kt(e,t,n){if(typeof e.effect=="function")try{e.effect(t,n);return}catch(r){he(`registering the effect "${n}" failed`,r);return}try{t()}catch(r){he(`the effect "${n}" failed`,r)}}function Dn(e){try{let t=zt(e,"locale"),n=Ge(t);t===void 0?he("the locale service is unavailable; the page keeps its bundled English copy"):Kt(e,()=>{let o=[];try{o.push(t.register(we,{en:Le,zh:$e}))}catch(a){he("registering the dictionaries failed",a)}return()=>{for(let a of o)try{a()}catch(i){he("disposing a dictionary failed",i)}}},"dsh-home-hosted: dictionaries");let r=zt(e,"slots");if(r===void 0){he("the slots service is unavailable; the settings section was not registered");return}Kt(e,()=>{try{return r.inject("settings.section",()=>{try{return r.register({name:"settings.section",id:"home-hosted",order:60,label:()=>n("tab"),locale:we,inject:()=>({t:n})},jt)}catch(o){return he("registering the settings section failed",o),()=>{}}})}catch(o){return he("injecting into settings.section failed",o),()=>{}}},"dsh-home-hosted: settings section")}catch(t){he("client bootstrap failed",t)}}
764
764
 
765
765
  return module.exports; } });