@kirkchinese/harness-forge 0.4.0 → 0.5.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 +4 -0
- package/docs/DETAIL.zh.md +47 -0
- package/lib/agents/presets.d.ts +7 -0
- package/lib/agents/presets.js +11 -1
- package/lib/agents/profiles.js +3 -2
- package/lib/agents/row.js +3 -1
- package/lib/client/paths.d.ts +12 -0
- package/lib/client/paths.js +68 -0
- package/lib/client/typert.d.ts +12 -1
- package/lib/client/typert.js +54 -6
- package/lib/client.js +1593 -270
- package/lib/commands/row.js +1 -1
- package/lib/context/instructions.js +5 -5
- package/lib/dsh/host.d.ts +3 -0
- package/lib/dsh/host.js +3 -0
- package/lib/forge/contract.d.ts +42 -2
- package/lib/forge/contract.js +3 -1
- package/lib/forge/follow.d.ts +30 -0
- package/lib/forge/follow.js +73 -0
- package/lib/forge/ledger.d.ts +70 -7
- package/lib/forge/ledger.js +314 -42
- package/lib/forge/projects.d.ts +5 -2
- package/lib/forge/projects.js +23 -16
- package/lib/forge/remote/archive.d.ts +65 -0
- package/lib/forge/remote/archive.js +565 -0
- package/lib/forge/remote/code-parts.d.ts +18 -0
- package/lib/forge/remote/code-parts.js +76 -0
- package/lib/forge/remote/fetch.d.ts +265 -0
- package/lib/forge/remote/fetch.js +1133 -0
- package/lib/forge/remote/service.d.ts +256 -0
- package/lib/forge/remote/service.js +868 -0
- package/lib/forge/service.d.ts +19 -9
- package/lib/forge/service.js +47 -31
- package/lib/forge/settings.d.ts +5 -3
- package/lib/forge/settings.js +11 -4
- package/lib/forge/state.d.ts +60 -0
- package/lib/forge/state.js +174 -58
- package/lib/hooks/broker/engine.js +2 -8
- package/lib/hooks/broker/session-events.d.ts +5 -0
- package/lib/hooks/broker/session-events.js +12 -3
- package/lib/hooks/broker/types.d.ts +7 -5
- package/lib/hooks/condition.d.ts +78 -2
- package/lib/hooks/condition.js +494 -73
- package/lib/hooks/config.d.ts +1 -1
- package/lib/hooks/config.js +4 -0
- package/lib/hooks/glob.d.ts +41 -0
- package/lib/hooks/glob.js +114 -0
- package/lib/hooks/permissions.d.ts +8 -3
- package/lib/hooks/permissions.js +119 -26
- package/lib/hooks/powershell-aliases.d.ts +19 -0
- package/lib/hooks/powershell-aliases.js +58 -0
- package/lib/hooks/process.d.ts +17 -0
- package/lib/hooks/process.js +156 -1
- package/lib/hooks/row.js +2 -0
- package/lib/hooks/runner.d.ts +17 -4
- package/lib/hooks/runner.js +42 -13
- package/lib/hooks/shell-commands.d.ts +10 -1
- package/lib/hooks/shell-commands.js +74 -10
- package/lib/hooks/shell.d.ts +3 -2
- package/lib/hooks/shell.js +5 -2
- package/lib/hooks/vocabulary.js +3 -1
- package/lib/mcp/catalog.d.ts +5 -2
- package/lib/mcp/catalog.js +18 -10
- package/lib/mcp/mount.d.ts +40 -2
- package/lib/mcp/mount.js +131 -31
- package/lib/mcp/policy.d.ts +42 -0
- package/lib/mcp/policy.js +43 -0
- package/lib/mcp/remote.js +5 -15
- package/lib/mcp/row.js +111 -17
- package/lib/mods/loader.js +4 -0
- package/lib/mods/service/turns.d.ts +8 -7
- package/lib/mods/service/turns.js +10 -35
- package/lib/opencode/bun.js +14 -2
- package/lib/opencode/row.d.ts +14 -1
- package/lib/opencode/row.js +38 -20
- package/lib/opencode/runtime/server.js +2 -1
- package/lib/porting/adapter-paths.d.ts +13 -0
- package/lib/porting/adapter-paths.js +120 -0
- package/lib/porting/port-gap.d.ts +10 -4
- package/lib/porting/port-gap.js +43 -7
- package/lib/porting/prompt.js +9 -7
- package/lib/porting/row.js +7 -5
- package/lib/porting/verify-port.d.ts +3 -10
- package/lib/porting/verify-port.js +12 -34
- package/lib/sessions/chat-import.d.ts +48 -0
- package/lib/sessions/chat-import.js +44 -0
- package/lib/sessions/claude.d.ts +16 -10
- package/lib/sessions/claude.js +76 -55
- package/lib/sessions/codex-discover.d.ts +34 -0
- package/lib/sessions/codex-discover.js +205 -0
- package/lib/sessions/codex-meta.d.ts +63 -0
- package/lib/sessions/codex-meta.js +148 -0
- package/lib/sessions/codex-text.d.ts +9 -0
- package/lib/sessions/codex-text.js +44 -0
- package/lib/sessions/codex.d.ts +34 -22
- package/lib/sessions/codex.js +150 -183
- package/lib/sessions/opencode.d.ts +15 -9
- package/lib/sessions/opencode.js +77 -58
- package/lib/sessions/persist.d.ts +162 -0
- package/lib/sessions/persist.js +377 -0
- package/lib/sessions/row.d.ts +2 -1
- package/lib/sessions/row.js +75 -9
- package/lib/sessions/turns.d.ts +31 -0
- package/lib/sessions/turns.js +63 -0
- package/lib/sessions/zstd.d.ts +15 -0
- package/lib/sessions/zstd.js +152 -0
- package/lib/shared/render.d.ts +30 -1
- package/lib/shared/render.js +813 -48
- package/lib/skills/provider.d.ts +2 -0
- package/lib/skills/provider.js +8 -2
- package/lib/skills/row.js +1 -1
- package/lib/workbench/adapter-coverage.d.ts +20 -2
- package/lib/workbench/adapter-coverage.js +46 -7
- package/lib/workbench/overview.d.ts +77 -27
- package/lib/workbench/overview.js +99 -12
- package/lib/workbench/remote.d.ts +64 -21
- package/lib/workbench/remote.js +181 -42
- package/lib/workbench/settings.d.ts +5 -1
- package/lib/workbench/settings.js +6 -2
- package/lib/workbench/workbench.d.ts +34 -4
- package/lib/workbench/workbench.js +147 -46
- package/locale/zh.json +2 -1
- package/package.json +3 -2
- package/lib/forge/marketplace-install.d.ts +0 -3
- package/lib/forge/marketplace-install.js +0 -64
package/lib/client.js
CHANGED
|
@@ -29,14 +29,17 @@ window.__ModuleLoader__.load({
|
|
|
29
29
|
tabMigrated: "Migrated",
|
|
30
30
|
tabGaps: "Gaps",
|
|
31
31
|
more: "More",
|
|
32
|
+
moreActions: "Harness Forge: more actions",
|
|
32
33
|
menuSessions: "Import sessions",
|
|
33
34
|
menuSettings: "Settings",
|
|
34
35
|
menuDiagnostics: "Diagnostics",
|
|
35
36
|
back: "Back",
|
|
37
|
+
backLabel: "Harness Forge: back",
|
|
36
38
|
refresh: "Refresh",
|
|
37
39
|
loading: "Looking at this computer…",
|
|
38
40
|
cancel: "Cancel",
|
|
39
41
|
close: "Close",
|
|
42
|
+
closeTaskLabel: "Harness Forge: close the task",
|
|
40
43
|
verdictWorks: "Works",
|
|
41
44
|
verdictPartly: "Partly works",
|
|
42
45
|
verdictNone: "Not possible",
|
|
@@ -49,25 +52,83 @@ window.__ModuleLoader__.load({
|
|
|
49
52
|
stateUnsupported: "Not possible",
|
|
50
53
|
stateFailed: "Error",
|
|
51
54
|
stateInactive: "Inactive",
|
|
55
|
+
stateProvided: "Provided",
|
|
52
56
|
stateOff: "Off",
|
|
53
57
|
ownSettings: "Your own settings",
|
|
54
58
|
migrate: "Migrate",
|
|
55
59
|
migrateAll: "Migrate all ({n})",
|
|
56
60
|
migrating: "Migrating…",
|
|
57
61
|
migratedTag: "Migrated",
|
|
62
|
+
disabledInTag: "Off in {harness}",
|
|
63
|
+
disabledInNote: "Switched off in {harness}: Migrate all leaves it out. Migrating it here turns it on in DSH.",
|
|
64
|
+
enabledUnknownTag: "Maybe off in {harness}",
|
|
65
|
+
enabledUnknownNote: "Whether {harness} runs it can't be told: an entry in its config switches plugins by id, and this plugin's id {why}. Migrate all leaves it out; migrate it on its own if you use it.",
|
|
66
|
+
pluginIdMissing: "is declared by no Plugin.define({ id }) that can be read",
|
|
67
|
+
pluginIdAmbiguous: "is declared more than once",
|
|
68
|
+
pluginIdDynamic: "is computed, not a plain string",
|
|
69
|
+
pluginIdEscape: "is written with an escape JavaScript refuses in a module",
|
|
58
70
|
allMigrated: "All migrated",
|
|
59
71
|
migrateDone: "Migrated {n}.",
|
|
60
72
|
migrateFailed: "{n} could not be migrated:",
|
|
61
73
|
nothingFound: "No {name} plugins or settings were found on this computer.",
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
marketLead: "A marketplace is a folder with a .claude-plugin/marketplace.json file, such as one under ~/.claude/plugins/marketplaces. Enter its path to see and install its plugins.",
|
|
66
|
-
marketPath: "Marketplace folder or marketplace.json",
|
|
74
|
+
marketTitle: "Get plugins",
|
|
75
|
+
marketLead: "Install Claude Code, Codex and OpenCode plugins straight from the internet; you don't need those harnesses installed. Paste a marketplace or a plugin, or open one of the marketplaces below.",
|
|
76
|
+
marketPath: "owner/repo, git URL, marketplace.json URL, or npm package",
|
|
67
77
|
marketOpen: "Open",
|
|
68
|
-
marketOpening: "
|
|
78
|
+
marketOpening: "Fetching…",
|
|
69
79
|
marketEmpty: "This marketplace lists no plugins.",
|
|
70
|
-
marketUnsupported: "
|
|
80
|
+
marketUnsupported: "This plugin cannot be installed: {reason}.",
|
|
81
|
+
marketDefaults: "Marketplaces",
|
|
82
|
+
marketLocal: "On this computer: marketplaces your harnesses added. Their plugins are not migrated with the rest; install the ones you want.",
|
|
83
|
+
marketForget: "Remove {name} from the list",
|
|
84
|
+
marketNoGit: "git is not installed: GitHub sources are downloaded over HTTPS; other git hosts need git.",
|
|
85
|
+
marketFilter: "Filter {n} plugins",
|
|
86
|
+
marketMore: "{n} more; narrow the filter to see them.",
|
|
87
|
+
marketInstalledTag: "Installed",
|
|
88
|
+
marketPlugin: "Plugin",
|
|
89
|
+
marketFrom: "from {from}",
|
|
90
|
+
confirmTitle: "Install {name}?",
|
|
91
|
+
confirmSource: "Source",
|
|
92
|
+
confirmRevision: "Commit or version",
|
|
93
|
+
confirmHarness: "Made for",
|
|
94
|
+
confirmParts: "What it contains",
|
|
95
|
+
confirmWorks: "{works} of {total} parts work in DSH",
|
|
96
|
+
confirmNoCode: "Nothing in this plugin runs code; it adds only text the agent reads.",
|
|
97
|
+
confirmTrust: "Install plugins only from a source you trust.",
|
|
98
|
+
confirmCodeRuns: "These parts run code with your permissions once installed: {names}.",
|
|
99
|
+
confirmCodeNone: "Nothing in this plugin runs code in DSH until you build an adapter for {names}.",
|
|
100
|
+
confirmCodeAdapter: "An adapter you build later runs its own code with your permissions.",
|
|
101
|
+
codeNameSeparator: ", ",
|
|
102
|
+
codePartLine: "{name} ({kind}) — {what}: {state}",
|
|
103
|
+
codeRunsInDsh: "runs in DSH once installed.",
|
|
104
|
+
codeGapInDsh: "a gap, runs nothing in DSH.",
|
|
105
|
+
codeWhatHooks: "hooks on {detail}",
|
|
106
|
+
codeWhatMcp: "command {detail}",
|
|
107
|
+
codeWhatShell: "shell lines {detail}",
|
|
108
|
+
codeWhatScript: "script {detail}",
|
|
109
|
+
codeWhatCode: "plugin code {detail}",
|
|
110
|
+
codeWhatEnvironment: "environment variables {detail}",
|
|
111
|
+
codeWhatAgent: "declares {detail}",
|
|
112
|
+
confirmReinstall: "It is already installed; installing replaces it with this copy.",
|
|
113
|
+
confirmRegistry: "npm registry",
|
|
114
|
+
confirmUpdateTitle: "Update {name}?",
|
|
115
|
+
confirmUpdateRevision: "Update",
|
|
116
|
+
confirmUpdate: "Update",
|
|
117
|
+
confirmRemoved: "No longer included: {names}",
|
|
118
|
+
partNew: "New",
|
|
119
|
+
partChanged: "Changed",
|
|
120
|
+
confirmDependencies: "Its npm dependencies ({n} declared) will be installed from {registry} when you confirm.",
|
|
121
|
+
confirmInstall: "Install",
|
|
122
|
+
confirmCancel: "Cancel",
|
|
123
|
+
remoteInstalled: "Installed through Get plugins",
|
|
124
|
+
remoteLocalMarketplace: "local marketplace: {name}",
|
|
125
|
+
remoteCheck: "Check for updates",
|
|
126
|
+
remoteChecking: "Checking…",
|
|
127
|
+
remoteUpToDate: "Up to date",
|
|
128
|
+
remoteUpdate: "Update to {latest}",
|
|
129
|
+
remoteUpdating: "Updating…",
|
|
130
|
+
remoteUpdated: "Updated {name} to {revision}.",
|
|
131
|
+
remoteRemoveHint: "Remove a plugin in Migrated; its downloaded files are deleted with it.",
|
|
71
132
|
install: "Install",
|
|
72
133
|
installing: "Installing…",
|
|
73
134
|
installedName: "Installed {name}.",
|
|
@@ -76,18 +137,32 @@ window.__ModuleLoader__.load({
|
|
|
76
137
|
manualPath: "Plugin folder",
|
|
77
138
|
manualAdd: "Add",
|
|
78
139
|
pathRequired: "Enter a path first.",
|
|
140
|
+
startsInNewSessions: "Takes effect in new sessions; sessions already open keep what they started with.",
|
|
79
141
|
migratedLead: "Everything that is active in DSH, plugin by plugin. Switch single parts off, or remove a plugin to undo its migration.",
|
|
80
142
|
migratedEmpty: "Nothing is migrated yet. Start in Discover & migrate.",
|
|
81
143
|
ready: "Ready",
|
|
82
144
|
attention: "{n} need attention",
|
|
83
145
|
remove: "Remove",
|
|
84
146
|
removeConfirm: "Remove {name} from DSH? Its own files stay where they are, and you can migrate it again later.",
|
|
147
|
+
removeConfirmFetched: "Remove {name} from DSH? It was downloaded by Get plugins, so its downloaded files are deleted too; you can install it again later.",
|
|
85
148
|
removed: "Removed {name}.",
|
|
149
|
+
keep: "Keep",
|
|
150
|
+
kept: "Kept {name} as your own copy.",
|
|
151
|
+
detachedLabel: "Not running",
|
|
152
|
+
detachedUninstalled: "No longer installed in {harness}, so nothing of it runs.",
|
|
153
|
+
detachedSwitchedOff: "Switched off in {harness}, so nothing of it runs.",
|
|
154
|
+
detachedNeverInstalled: "Not installed in {harness}: an earlier version of Harness Forge migrated it from {harness}'s folders anyway. Nothing of it runs.",
|
|
155
|
+
detachedMisread: "An earlier version of Harness Forge migrated this {harness} plugin as another harness's. Nothing of it runs; migrate the {harness} plugin again from Discover.",
|
|
156
|
+
detachedChoose: "Keep it as your own copy (it stays where it is and no longer follows {harness}), or remove it.",
|
|
157
|
+
detachedFolderGone: "Its folder is gone too: remove it.",
|
|
158
|
+
updatedBy: "Updated by {harness} from {from} to {to}",
|
|
159
|
+
reasonFolderGone: "The plugin's folder is gone:",
|
|
160
|
+
reasonNotFollowed: "Not running: {harness} no longer runs this plugin.",
|
|
161
|
+
applying: "Applying migrated plugins: {done} of {total} done…",
|
|
86
162
|
partOffByYou: "Off — you switched it off",
|
|
87
163
|
partInactiveRow: "Inactive — {row} is off",
|
|
88
164
|
partInactiveHint: "Turn on “{row}” in Plugin Manager to use it.",
|
|
89
165
|
switchLabel: "Use {name}",
|
|
90
|
-
switchUnavailable: "This DSH can't switch single parts on and off.",
|
|
91
166
|
signInTitle: "Sign-in needed",
|
|
92
167
|
signInLead: "These MCP servers work after you sign in.",
|
|
93
168
|
signIn: "Sign in",
|
|
@@ -102,6 +177,7 @@ window.__ModuleLoader__.load({
|
|
|
102
177
|
openSession: "Open session",
|
|
103
178
|
coveredTitle: "Covered by adapters",
|
|
104
179
|
coveredLead: "These gaps are already filled by adapters installed in DSH.",
|
|
180
|
+
providedBy: "Provided by {name}",
|
|
105
181
|
coveredBy: "Covered by {name}",
|
|
106
182
|
reasonEventsNeverRaised: "DSH never raises these events, so their hooks don't run:",
|
|
107
183
|
reasonCannotBlock: "DSH reports these events after the fact, so a hook can't stop them:",
|
|
@@ -112,6 +188,10 @@ window.__ModuleLoader__.load({
|
|
|
112
188
|
reasonNotMapped: "DSH has nothing that does this:",
|
|
113
189
|
reasonHostedConnector: "This is an app connector hosted by OpenAI; it only works signed in to ChatGPT or Codex.",
|
|
114
190
|
reasonUnknownTransport: "It isn't clear how to connect to this MCP server.",
|
|
191
|
+
reasonDisabledInPlugin: "The plugin switched this MCP server off, so DSH doesn't start it.",
|
|
192
|
+
reasonDisabledInConfig: "config.toml switched this MCP server off, so DSH doesn't start it.",
|
|
193
|
+
reasonDisabledInClaudeCode: "Claude Code has this project MCP server switched off (disabledMcpjsonServers), so DSH doesn't start it.",
|
|
194
|
+
reasonNeedsChatgptSignIn: "This MCP server needs a ChatGPT sign-in, which DSH can't provide; an adapter can't either.",
|
|
115
195
|
reasonRunFailed: "It failed when it ran in DSH:",
|
|
116
196
|
reasonSetupFailed: "It failed to start:",
|
|
117
197
|
reasonUnreadable: "Its files can no longer be read (moved or deleted?):",
|
|
@@ -139,10 +219,28 @@ window.__ModuleLoader__.load({
|
|
|
139
219
|
sessionsLoading: "Looking for conversations…",
|
|
140
220
|
sessionImport: "Import",
|
|
141
221
|
sessionImporting: "Importing…",
|
|
142
|
-
|
|
222
|
+
sessionsMore: "Show more",
|
|
223
|
+
sessionArchived: "archived in Codex",
|
|
224
|
+
sessionTooLarge: "This session is too large to import ({size}; the limit is {limit}).",
|
|
225
|
+
sessionTooLargeDecoded: "This session is too large to import: decompressed, it is over the limit of {limit}.",
|
|
226
|
+
sessionUntitled: "Untitled session",
|
|
227
|
+
sessionMaybeImported: "An earlier import may already hold this conversation: open that session, or import this one as a new session.",
|
|
228
|
+
sessionOpenExisting: "Open existing",
|
|
229
|
+
sessionUnarchived: "You had archived this session in DSH; it is back in the session list.",
|
|
230
|
+
sessionStillArchived: "You archived this session in DSH and it can't be taken out of the archive from here. Unarchive it under DSH's archived sessions, then open it.",
|
|
231
|
+
sessionImportAsNew: "Import as new",
|
|
232
|
+
chatImportPitch: "For session import, try dsh-chat-import: it brings conversations from Claude Code, Codex, OpenCode and 40+ other agents into DSH as sessions you can continue.",
|
|
233
|
+
chatImportInstall: "Install",
|
|
234
|
+
chatImportInstalling: "Installing…",
|
|
235
|
+
chatImportConfirm: "Install dsh-chat-import from npm into this DSH?",
|
|
236
|
+
chatImportCommand: "Install it from DSH's Plugins page, or run: {command}",
|
|
237
|
+
chatImportRestart: "dsh-chat-import is installed; it starts after DSH restarts.",
|
|
238
|
+
chatImportInstalledLater: "dsh-chat-import is installed; reload this page if its Import sessions button does not show yet.",
|
|
239
|
+
chatImportProvided: "Session import is provided by dsh-chat-import — use its Import sessions button in the sidebar.",
|
|
143
240
|
settingsLead: "Where Harness Forge looks for plugins, and what it adds to new sessions.",
|
|
144
241
|
discoveryRoots: "Where to look for plugins",
|
|
145
242
|
discoveryRootsHint: "One folder per line.",
|
|
243
|
+
discoverySkipped: "Skipped: {message}",
|
|
146
244
|
missingRoots: "Not found: {list}",
|
|
147
245
|
autoDiscover: "Look for plugins when this page opens",
|
|
148
246
|
save: "Save",
|
|
@@ -158,9 +256,13 @@ window.__ModuleLoader__.load({
|
|
|
158
256
|
diagRun: "Check again",
|
|
159
257
|
diagChecking: "Checking…",
|
|
160
258
|
diagRows: "Harness Forge parts",
|
|
161
|
-
diagRowsOk: "
|
|
259
|
+
diagRowsOk: "Harness Forge itself started normally; the migrated parts below did not.",
|
|
260
|
+
diagAllOk: "Harness Forge and every migrated part started normally.",
|
|
162
261
|
diagFaults: "{n} problems reported",
|
|
163
|
-
diagFailedMounts: "
|
|
262
|
+
diagFailedMounts: "{n} migrated parts failed to start",
|
|
263
|
+
diagMountEvents: "{kind} ({name}): {events}",
|
|
264
|
+
diagMountPart: "{kind}: {name}",
|
|
265
|
+
listSeparator: ", ",
|
|
164
266
|
diagBash: "Bash (for hooks and commands)",
|
|
165
267
|
diagPowershell: "PowerShell",
|
|
166
268
|
diagBun: "Bun (for OpenCode plugins)",
|
|
@@ -192,7 +294,11 @@ window.__ModuleLoader__.load({
|
|
|
192
294
|
viewTask: "View task",
|
|
193
295
|
openConversation: "Open conversation",
|
|
194
296
|
portInProgress: "In progress",
|
|
195
|
-
portVerified: "Done — verified"
|
|
297
|
+
portVerified: "Done — verified",
|
|
298
|
+
workbenchOff: "“Harness Forge page” is turned off. Turn it on in Plugins.",
|
|
299
|
+
modExpand: "Expand pane",
|
|
300
|
+
modCollapse: "Collapse pane",
|
|
301
|
+
modClose: "Close pane"
|
|
196
302
|
};
|
|
197
303
|
//#endregion
|
|
198
304
|
//#region src/client/locale/zh.json
|
|
@@ -206,14 +312,17 @@ window.__ModuleLoader__.load({
|
|
|
206
312
|
tabMigrated: "已迁移",
|
|
207
313
|
tabGaps: "缺口",
|
|
208
314
|
more: "更多",
|
|
315
|
+
moreActions: "Harness Forge:更多操作",
|
|
209
316
|
menuSessions: "导入会话",
|
|
210
317
|
menuSettings: "设置",
|
|
211
318
|
menuDiagnostics: "诊断",
|
|
212
319
|
back: "返回",
|
|
320
|
+
backLabel: "Harness Forge:返回",
|
|
213
321
|
refresh: "刷新",
|
|
214
322
|
loading: "正在查看这台电脑…",
|
|
215
323
|
cancel: "取消",
|
|
216
324
|
close: "关闭",
|
|
325
|
+
closeTaskLabel: "Harness Forge:关闭任务",
|
|
217
326
|
verdictWorks: "可用",
|
|
218
327
|
verdictPartly: "部分可用",
|
|
219
328
|
verdictNone: "无法使用",
|
|
@@ -226,25 +335,83 @@ window.__ModuleLoader__.load({
|
|
|
226
335
|
stateUnsupported: "无法使用",
|
|
227
336
|
stateFailed: "出错",
|
|
228
337
|
stateInactive: "未生效",
|
|
338
|
+
stateProvided: "已提供",
|
|
229
339
|
stateOff: "已关闭",
|
|
230
340
|
ownSettings: "你自己的设置",
|
|
231
341
|
migrate: "迁移",
|
|
232
342
|
migrateAll: "全部迁移({n})",
|
|
233
343
|
migrating: "正在迁移…",
|
|
234
344
|
migratedTag: "已迁移",
|
|
345
|
+
disabledInTag: "已在 {harness} 中关闭",
|
|
346
|
+
disabledInNote: "已在 {harness} 中关闭:“全部迁移”不会带上它。在这里单独迁移会让它在 DSH 中启用。",
|
|
347
|
+
enabledUnknownTag: "在 {harness} 中可能已关闭",
|
|
348
|
+
enabledUnknownNote: "无法判断 {harness} 是否运行它:配置里有按 id 开关插件的条目,而这个插件的 id {why}。“全部迁移”不会带上它;如果你在用,可以单独迁移。",
|
|
349
|
+
pluginIdMissing: "没有用能读出的 Plugin.define({ id }) 声明",
|
|
350
|
+
pluginIdAmbiguous: "声明了不止一次",
|
|
351
|
+
pluginIdDynamic: "是运行时算出来的,不是固定字符串",
|
|
352
|
+
pluginIdEscape: "用了模块里 JavaScript 不接受的转义写法",
|
|
235
353
|
allMigrated: "已全部迁移",
|
|
236
354
|
migrateDone: "已迁移 {n} 项。",
|
|
237
355
|
migrateFailed: "{n} 项未能迁移:",
|
|
238
356
|
nothingFound: "这台电脑上没有找到 {name} 的插件或设置。",
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
marketLead: "插件市场是一个带有 .claude-plugin/marketplace.json 的文件夹,例如 ~/.claude/plugins/marketplaces 下的目录。输入它的路径即可查看并安装其中的插件。",
|
|
243
|
-
marketPath: "市场文件夹或 marketplace.json",
|
|
357
|
+
marketTitle: "获取插件",
|
|
358
|
+
marketLead: "直接从网络安装 Claude Code、Codex 和 OpenCode 插件,无需先安装这些工具。粘贴一个插件市场或插件,或打开下面的插件市场。",
|
|
359
|
+
marketPath: "owner/repo、git 地址、marketplace.json 地址或 npm 包名",
|
|
244
360
|
marketOpen: "打开",
|
|
245
|
-
marketOpening: "
|
|
361
|
+
marketOpening: "正在获取…",
|
|
246
362
|
marketEmpty: "这个市场里没有插件。",
|
|
247
|
-
marketUnsupported: "
|
|
363
|
+
marketUnsupported: "无法安装这个插件:{reason}。",
|
|
364
|
+
marketDefaults: "插件市场",
|
|
365
|
+
marketLocal: "本机:各 harness 添加过的插件市场。其中的插件不会随“全部迁移”一起迁移,需要哪个就单独安装。",
|
|
366
|
+
marketForget: "从列表中移除 {name}",
|
|
367
|
+
marketNoGit: "未安装 git:GitHub 上的来源会通过 HTTPS 下载,其他 git 托管站点需要 git。",
|
|
368
|
+
marketFilter: "筛选 {n} 个插件",
|
|
369
|
+
marketMore: "还有 {n} 个,缩小筛选范围即可看到。",
|
|
370
|
+
marketInstalledTag: "已安装",
|
|
371
|
+
marketPlugin: "插件",
|
|
372
|
+
marketFrom: "来自 {from}",
|
|
373
|
+
confirmTitle: "安装 {name}?",
|
|
374
|
+
confirmSource: "来源",
|
|
375
|
+
confirmRevision: "提交或版本",
|
|
376
|
+
confirmHarness: "适用于",
|
|
377
|
+
confirmParts: "包含的内容",
|
|
378
|
+
confirmWorks: "{total} 个部分中有 {works} 个可在 DSH 中使用",
|
|
379
|
+
confirmNoCode: "这个插件不运行任何代码,只添加供代理阅读的文字。",
|
|
380
|
+
confirmTrust: "只安装来自你信任的来源的插件。",
|
|
381
|
+
confirmCodeRuns: "这些部分安装后会以你的权限运行代码:{names}。",
|
|
382
|
+
confirmCodeNone: "在你为 {names} 制作适配器之前,这个插件在 DSH 中不运行任何代码。",
|
|
383
|
+
confirmCodeAdapter: "之后制作的适配器会以你的权限运行它自己的代码。",
|
|
384
|
+
codeNameSeparator: "、",
|
|
385
|
+
codePartLine: "{name}({kind})— {what}:{state}",
|
|
386
|
+
codeRunsInDsh: "安装后在 DSH 中运行。",
|
|
387
|
+
codeGapInDsh: "缺口,在 DSH 中不运行。",
|
|
388
|
+
codeWhatHooks: "在 {detail} 上的 hook",
|
|
389
|
+
codeWhatMcp: "命令 {detail}",
|
|
390
|
+
codeWhatShell: "shell 行 {detail}",
|
|
391
|
+
codeWhatScript: "脚本 {detail}",
|
|
392
|
+
codeWhatCode: "插件代码 {detail}",
|
|
393
|
+
codeWhatEnvironment: "环境变量 {detail}",
|
|
394
|
+
codeWhatAgent: "声明了 {detail}",
|
|
395
|
+
confirmReinstall: "它已经安装过了;继续安装会用这份副本替换它。",
|
|
396
|
+
confirmRegistry: "npm 仓库",
|
|
397
|
+
confirmUpdateTitle: "更新 {name}?",
|
|
398
|
+
confirmUpdateRevision: "更新",
|
|
399
|
+
confirmUpdate: "更新",
|
|
400
|
+
confirmRemoved: "不再包含:{names}",
|
|
401
|
+
partNew: "新增",
|
|
402
|
+
partChanged: "有改动",
|
|
403
|
+
confirmDependencies: "确认后,会从 {registry} 安装它的 npm 依赖(声明了 {n} 个)。",
|
|
404
|
+
confirmInstall: "安装",
|
|
405
|
+
confirmCancel: "取消",
|
|
406
|
+
remoteInstalled: "通过“获取插件”安装",
|
|
407
|
+
remoteLocalMarketplace: "本地插件市场:{name}",
|
|
408
|
+
remoteCheck: "检查更新",
|
|
409
|
+
remoteChecking: "正在检查…",
|
|
410
|
+
remoteUpToDate: "已是最新",
|
|
411
|
+
remoteUpdate: "更新到 {latest}",
|
|
412
|
+
remoteUpdating: "正在更新…",
|
|
413
|
+
remoteUpdated: "已将 {name} 更新到 {revision}。",
|
|
414
|
+
remoteRemoveHint: "在“已迁移”中移除插件,它下载的文件会一并删除。",
|
|
248
415
|
install: "安装",
|
|
249
416
|
installing: "正在安装…",
|
|
250
417
|
installedName: "已安装 {name}。",
|
|
@@ -253,18 +420,32 @@ window.__ModuleLoader__.load({
|
|
|
253
420
|
manualPath: "插件文件夹",
|
|
254
421
|
manualAdd: "添加",
|
|
255
422
|
pathRequired: "请先填写路径。",
|
|
423
|
+
startsInNewSessions: "新会话中生效;已打开的会话保持开始时的状态。",
|
|
256
424
|
migratedLead: "DSH 中正在使用的全部内容,按插件列出。可以单独关闭某个部分,或移除整个插件来撤销迁移。",
|
|
257
425
|
migratedEmpty: "还没有迁移任何内容。从「发现与迁移」开始吧。",
|
|
258
426
|
ready: "就绪",
|
|
259
427
|
attention: "{n} 项需要留意",
|
|
260
428
|
remove: "移除",
|
|
261
429
|
removeConfirm: "要从 DSH 中移除 {name} 吗?它自己的文件会保留在原处,之后可以重新迁移。",
|
|
430
|
+
removeConfirmFetched: "把 {name} 从 DSH 移除?它是通过“获取插件”下载的,下载的文件也会一并删除;以后可以重新安装。",
|
|
262
431
|
removed: "已移除 {name}。",
|
|
432
|
+
keep: "保留",
|
|
433
|
+
kept: "已把 {name} 保留为你自己的副本。",
|
|
434
|
+
detachedLabel: "未运行",
|
|
435
|
+
detachedUninstalled: "它已不再安装在 {harness} 中,所以它的各个部分都不运行。",
|
|
436
|
+
detachedSwitchedOff: "它在 {harness} 中被关闭了,所以它的各个部分都不运行。",
|
|
437
|
+
detachedNeverInstalled: "{harness} 并没有安装它:是早期版本的 Harness Forge 从 {harness} 的文件夹里把它迁移过来的。它的各个部分都不运行。",
|
|
438
|
+
detachedMisread: "早期版本的 Harness Forge 把这个 {harness} 插件当成了别的工具的插件来迁移。它的各个部分都不运行;请在“发现”中重新迁移这个 {harness} 插件。",
|
|
439
|
+
detachedChoose: "可以把它保留为你自己的副本(留在原处,不再跟随 {harness}),或者移除它。",
|
|
440
|
+
detachedFolderGone: "它的文件夹也已经不在了:请移除它。",
|
|
441
|
+
updatedBy: "已随 {harness} 从 {from} 更新到 {to}",
|
|
442
|
+
reasonFolderGone: "插件的文件夹不见了:",
|
|
443
|
+
reasonNotFollowed: "未运行:{harness} 已不再运行这个插件。",
|
|
444
|
+
applying: "正在应用已迁移的插件:已完成 {done} / {total}…",
|
|
263
445
|
partOffByYou: "已关闭 — 由你关闭",
|
|
264
446
|
partInactiveRow: "未生效 — {row} 已关闭",
|
|
265
447
|
partInactiveHint: "在插件管理中打开「{row}」即可使用。",
|
|
266
448
|
switchLabel: "使用 {name}",
|
|
267
|
-
switchUnavailable: "当前 DSH 不支持单独开关某个部分。",
|
|
268
449
|
signInTitle: "需要登录",
|
|
269
450
|
signInLead: "这些 MCP 服务登录后才能使用。",
|
|
270
451
|
signIn: "登录",
|
|
@@ -279,6 +460,7 @@ window.__ModuleLoader__.load({
|
|
|
279
460
|
openSession: "打开会话",
|
|
280
461
|
coveredTitle: "已由适配器补上",
|
|
281
462
|
coveredLead: "这些缺口已经由 DSH 中安装的适配器补上。",
|
|
463
|
+
providedBy: "由 {name} 提供",
|
|
282
464
|
coveredBy: "由 {name} 补上",
|
|
283
465
|
reasonEventsNeverRaised: "DSH 不会触发这些事件,对应的 hook 不会运行:",
|
|
284
466
|
reasonCannotBlock: "DSH 只在事后通知这些事件,hook 无法拦截:",
|
|
@@ -289,6 +471,10 @@ window.__ModuleLoader__.load({
|
|
|
289
471
|
reasonNotMapped: "DSH 里没有对应的功能:",
|
|
290
472
|
reasonHostedConnector: "这是 OpenAI 托管的应用连接器,只能在登录 ChatGPT 或 Codex 时使用。",
|
|
291
473
|
reasonUnknownTransport: "看不出该如何连接这个 MCP 服务。",
|
|
474
|
+
reasonDisabledInPlugin: "插件把这个 MCP 服务关掉了,所以 DSH 不会启动它。",
|
|
475
|
+
reasonDisabledInConfig: "config.toml 把这个 MCP 服务关掉了,所以 DSH 不会启动它。",
|
|
476
|
+
reasonDisabledInClaudeCode: "Claude Code 把这个项目的 MCP 服务关掉了(disabledMcpjsonServers),所以 DSH 不会启动它。",
|
|
477
|
+
reasonNeedsChatgptSignIn: "这个 MCP 服务需要登录 ChatGPT,DSH 提供不了,适配器也做不到。",
|
|
292
478
|
reasonRunFailed: "在 DSH 中运行时失败:",
|
|
293
479
|
reasonSetupFailed: "启动时失败:",
|
|
294
480
|
reasonUnreadable: "它的文件读不到了(被移动或删除了?):",
|
|
@@ -316,10 +502,28 @@ window.__ModuleLoader__.load({
|
|
|
316
502
|
sessionsLoading: "正在查找对话…",
|
|
317
503
|
sessionImport: "导入",
|
|
318
504
|
sessionImporting: "正在导入…",
|
|
319
|
-
|
|
505
|
+
sessionsMore: "显示更多",
|
|
506
|
+
sessionArchived: "Codex 已归档",
|
|
507
|
+
sessionTooLarge: "这个会话太大,无法导入({size},上限 {limit})。",
|
|
508
|
+
sessionTooLargeDecoded: "这个会话太大,无法导入:解压后超过上限 {limit}。",
|
|
509
|
+
sessionUntitled: "未命名会话",
|
|
510
|
+
sessionMaybeImported: "以前的导入可能已经包含这段对话:可以打开那个会话,或者把这段对话作为新会话导入。",
|
|
511
|
+
sessionOpenExisting: "打开已有会话",
|
|
512
|
+
sessionUnarchived: "这个会话你在 DSH 里归档过,现在已移出归档,回到会话列表。",
|
|
513
|
+
sessionStillArchived: "这个会话你在 DSH 里归档了,从这里没法移出归档。请先在 DSH 的已归档会话里取消归档,再打开。",
|
|
514
|
+
sessionImportAsNew: "作为新会话导入",
|
|
515
|
+
chatImportPitch: "导入会话推荐使用 dsh-chat-import:它能把 Claude Code、Codex、OpenCode 等 40 多种智能体的对话导入 DSH,成为可以继续的会话。",
|
|
516
|
+
chatImportInstall: "安装",
|
|
517
|
+
chatImportInstalling: "正在安装…",
|
|
518
|
+
chatImportConfirm: "从 npm 把 dsh-chat-import 安装到这个 DSH?",
|
|
519
|
+
chatImportCommand: "可在 DSH 的插件页安装,或运行:{command}",
|
|
520
|
+
chatImportRestart: "dsh-chat-import 已安装,DSH 重启后生效。",
|
|
521
|
+
chatImportInstalledLater: "dsh-chat-import 已安装;如果侧边栏还没有它的「导入会话」按钮,请刷新页面。",
|
|
522
|
+
chatImportProvided: "会话导入由 dsh-chat-import 提供——请使用侧边栏里它的「导入会话」按钮。",
|
|
320
523
|
settingsLead: "Harness Forge 在哪里查找插件,以及它会给新会话加入什么。",
|
|
321
524
|
discoveryRoots: "查找插件的位置",
|
|
322
525
|
discoveryRootsHint: "每行一个文件夹。",
|
|
526
|
+
discoverySkipped: "已跳过:{message}",
|
|
323
527
|
missingRoots: "找不到:{list}",
|
|
324
528
|
autoDiscover: "打开本页时查找插件",
|
|
325
529
|
save: "保存",
|
|
@@ -335,9 +539,13 @@ window.__ModuleLoader__.load({
|
|
|
335
539
|
diagRun: "重新检查",
|
|
336
540
|
diagChecking: "正在检查…",
|
|
337
541
|
diagRows: "Harness Forge 各部分",
|
|
338
|
-
diagRowsOk: "
|
|
542
|
+
diagRowsOk: "Harness Forge 本身正常启动了,但下面这些迁移过来的部分没有。",
|
|
543
|
+
diagAllOk: "Harness Forge 和所有迁移过来的部分都正常启动了。",
|
|
339
544
|
diagFaults: "报告了 {n} 个问题",
|
|
340
|
-
diagFailedMounts: "
|
|
545
|
+
diagFailedMounts: "{n} 个迁移过来的部分启动失败",
|
|
546
|
+
diagMountEvents: "{kind}({name}):{events}",
|
|
547
|
+
diagMountPart: "{kind}:{name}",
|
|
548
|
+
listSeparator: "、",
|
|
341
549
|
diagBash: "Bash(用于 hook 和命令)",
|
|
342
550
|
diagPowershell: "PowerShell",
|
|
343
551
|
diagBun: "Bun(用于 OpenCode 插件)",
|
|
@@ -369,7 +577,11 @@ window.__ModuleLoader__.load({
|
|
|
369
577
|
viewTask: "查看任务",
|
|
370
578
|
openConversation: "打开对话",
|
|
371
579
|
portInProgress: "进行中",
|
|
372
|
-
portVerified: "已完成 — 已验证"
|
|
580
|
+
portVerified: "已完成 — 已验证",
|
|
581
|
+
workbenchOff: "“Harness Forge 页面”已关闭,请在“插件”中打开它。",
|
|
582
|
+
modExpand: "展开面板",
|
|
583
|
+
modCollapse: "收起面板",
|
|
584
|
+
modClose: "关闭面板"
|
|
373
585
|
};
|
|
374
586
|
//#endregion
|
|
375
587
|
//#region ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/util.js
|
|
@@ -19480,12 +19692,47 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19480
19692
|
true
|
|
19481
19693
|
],
|
|
19482
19694
|
[
|
|
19483
|
-
"
|
|
19695
|
+
"keepPlugin",
|
|
19484
19696
|
"unary",
|
|
19485
19697
|
true
|
|
19486
19698
|
],
|
|
19487
19699
|
[
|
|
19488
|
-
"
|
|
19700
|
+
"remoteSources",
|
|
19701
|
+
"unary",
|
|
19702
|
+
false
|
|
19703
|
+
],
|
|
19704
|
+
[
|
|
19705
|
+
"remoteOpen",
|
|
19706
|
+
"unary",
|
|
19707
|
+
true
|
|
19708
|
+
],
|
|
19709
|
+
[
|
|
19710
|
+
"remoteForget",
|
|
19711
|
+
"unary",
|
|
19712
|
+
true
|
|
19713
|
+
],
|
|
19714
|
+
[
|
|
19715
|
+
"remotePrepare",
|
|
19716
|
+
"unary",
|
|
19717
|
+
true
|
|
19718
|
+
],
|
|
19719
|
+
[
|
|
19720
|
+
"remoteInstall",
|
|
19721
|
+
"unary",
|
|
19722
|
+
true
|
|
19723
|
+
],
|
|
19724
|
+
[
|
|
19725
|
+
"remoteCancel",
|
|
19726
|
+
"unary",
|
|
19727
|
+
true
|
|
19728
|
+
],
|
|
19729
|
+
[
|
|
19730
|
+
"remoteCheckUpdates",
|
|
19731
|
+
"unary",
|
|
19732
|
+
true
|
|
19733
|
+
],
|
|
19734
|
+
[
|
|
19735
|
+
"remotePrepareUpdate",
|
|
19489
19736
|
"unary",
|
|
19490
19737
|
true
|
|
19491
19738
|
],
|
|
@@ -19509,6 +19756,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19509
19756
|
"unary",
|
|
19510
19757
|
true
|
|
19511
19758
|
],
|
|
19759
|
+
[
|
|
19760
|
+
"openImported",
|
|
19761
|
+
"unary",
|
|
19762
|
+
true
|
|
19763
|
+
],
|
|
19764
|
+
[
|
|
19765
|
+
"sessionImport",
|
|
19766
|
+
"unary",
|
|
19767
|
+
false
|
|
19768
|
+
],
|
|
19769
|
+
[
|
|
19770
|
+
"installChatImport",
|
|
19771
|
+
"unary",
|
|
19772
|
+
false
|
|
19773
|
+
],
|
|
19512
19774
|
[
|
|
19513
19775
|
"modSurfaces",
|
|
19514
19776
|
"stream",
|
|
@@ -19602,14 +19864,51 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19602
19864
|
if (ready === void 0) throw new Error(`Harness Forge is not reachable: ${mountError ?? "the Remote namespace did not mount"}`);
|
|
19603
19865
|
return ready;
|
|
19604
19866
|
}
|
|
19605
|
-
/**
|
|
19867
|
+
/** A failed call: the Host's reason, and the Remote error code and its details when there are. */
|
|
19868
|
+
var CallError = class extends Error {
|
|
19869
|
+
code;
|
|
19870
|
+
details;
|
|
19871
|
+
constructor(message, code, details) {
|
|
19872
|
+
super(message);
|
|
19873
|
+
this.code = code;
|
|
19874
|
+
this.details = details;
|
|
19875
|
+
this.name = "CallError";
|
|
19876
|
+
}
|
|
19877
|
+
};
|
|
19878
|
+
/** Gateway codes for an endpoint that no running Host service answers: the workbench row is off. */
|
|
19879
|
+
const NOT_SERVED = /* @__PURE__ */ new Set([
|
|
19880
|
+
"gateway/invocation-unavailable",
|
|
19881
|
+
"gateway/service-unavailable",
|
|
19882
|
+
"gateway/method-unavailable",
|
|
19883
|
+
"gateway/definition-unavailable"
|
|
19884
|
+
]);
|
|
19885
|
+
/**
|
|
19886
|
+
* Whether a failed call means the `harness-forge-workbench` row is switched off: the page is
|
|
19887
|
+
* there (the client is declared once per package) but nothing on the Host answers `harnessCompat`.
|
|
19888
|
+
*/
|
|
19889
|
+
function isWorkbenchOff(error) {
|
|
19890
|
+
if (!(error instanceof Error)) return false;
|
|
19891
|
+
const code = error.code;
|
|
19892
|
+
if (typeof code === "string" && NOT_SERVED.has(code)) return true;
|
|
19893
|
+
return /harness-forge-workbench/u.test(error.message) || /\/api\/harnessCompat\/\w+: HTTP 404\b/u.test(error.message) || /harnessCompat\/\w+.*(?:no active Remote method|active Service .* is unavailable|has no callable method|definition was withdrawn)/u.test(error.message);
|
|
19894
|
+
}
|
|
19895
|
+
function recordOf(value) {
|
|
19896
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
19897
|
+
}
|
|
19898
|
+
/** Call one workbench method; a failure throws a CallError carrying the Host's reason. */
|
|
19606
19899
|
async function call(method, request) {
|
|
19607
19900
|
const target = (await namespace())[method];
|
|
19608
|
-
if (typeof target !== "function") throw new
|
|
19609
|
-
|
|
19901
|
+
if (typeof target !== "function") throw new CallError(`Harness Forge has no method ${method}`);
|
|
19902
|
+
let result;
|
|
19903
|
+
try {
|
|
19904
|
+
result = await (request === void 0 ? target() : target(request));
|
|
19905
|
+
} catch (error) {
|
|
19906
|
+
const { code, details } = error ?? {};
|
|
19907
|
+
throw new CallError(error instanceof Error ? error.message : String(error), typeof code === "string" ? code : void 0, recordOf(details));
|
|
19908
|
+
}
|
|
19610
19909
|
if (typeof result === "object" && result !== null && "ok" in result) {
|
|
19611
19910
|
const outcome = result;
|
|
19612
|
-
if (!outcome.ok) throw new
|
|
19911
|
+
if (!outcome.ok) throw new CallError(outcome.error?.message ?? outcome.error?.code ?? `${method} failed`, outcome.error?.code, recordOf(outcome.error?.details));
|
|
19613
19912
|
return outcome.value;
|
|
19614
19913
|
}
|
|
19615
19914
|
return result;
|
|
@@ -20141,7 +20440,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20141
20440
|
style.textContent = CSS;
|
|
20142
20441
|
document.head.append(style);
|
|
20143
20442
|
}
|
|
20144
|
-
function ModsDock({ sessionId, useSurfaces, store }) {
|
|
20443
|
+
function ModsDock({ sessionId, useSurfaces, store, t }) {
|
|
20145
20444
|
ensureStyles();
|
|
20146
20445
|
const snapshot = useSurfaces((value) => value);
|
|
20147
20446
|
const [busy, setBusy] = (0, react.useState)(void 0);
|
|
@@ -20222,7 +20521,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20222
20521
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
20223
20522
|
type: "button",
|
|
20224
20523
|
className: "hf-mods-icon",
|
|
20225
|
-
"aria-label": folded.has(pane.id) ? "
|
|
20524
|
+
"aria-label": t(folded.has(pane.id) ? "modExpand" : "modCollapse"),
|
|
20226
20525
|
onClick: () => {
|
|
20227
20526
|
setFolded((current) => {
|
|
20228
20527
|
const next = new Set(current);
|
|
@@ -20236,7 +20535,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20236
20535
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
20237
20536
|
type: "button",
|
|
20238
20537
|
className: "hf-mods-icon",
|
|
20239
|
-
"aria-label": "
|
|
20538
|
+
"aria-label": t("modClose"),
|
|
20240
20539
|
onClick: () => {
|
|
20241
20540
|
close(pane.id);
|
|
20242
20541
|
},
|
|
@@ -20305,7 +20604,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20305
20604
|
});
|
|
20306
20605
|
}
|
|
20307
20606
|
/** Register the dock entry that draws a session's mods. */
|
|
20308
|
-
function registerModsDock(ctx) {
|
|
20607
|
+
function registerModsDock(ctx, t) {
|
|
20309
20608
|
const stores = /* @__PURE__ */ new Map();
|
|
20310
20609
|
ctx.effect(() => () => {
|
|
20311
20610
|
for (const store of stores.values()) store.dispose();
|
|
@@ -20332,7 +20631,64 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20332
20631
|
hooks: { surfaces: store }
|
|
20333
20632
|
};
|
|
20334
20633
|
}
|
|
20335
|
-
},
|
|
20634
|
+
}, ((props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModsDock, {
|
|
20635
|
+
...props,
|
|
20636
|
+
t
|
|
20637
|
+
}))));
|
|
20638
|
+
}
|
|
20639
|
+
/** A home folder written the Windows way: a drive (`C:`) or a network share (`\\server`). */
|
|
20640
|
+
const WINDOWS_HOME = /^(?:[A-Za-z]:|[\\/]{2})/u;
|
|
20641
|
+
/** A home that is only a drive: too wide to fold everything under it. */
|
|
20642
|
+
const DRIVE_ROOT = /^[A-Za-z]:$/u;
|
|
20643
|
+
const WINDOWS_SEPARATOR = "\\";
|
|
20644
|
+
const POSIX_SEPARATOR = "/";
|
|
20645
|
+
/** What may follow the home folder in a message: anything but a character that would continue a folder name. */
|
|
20646
|
+
const NAME_CHARACTER = "[\\p{L}\\p{N}_.-]";
|
|
20647
|
+
/** What may precede it: anything but a character that would make it the tail of a longer path. */
|
|
20648
|
+
const PATH_CHARACTER = "[\\p{L}\\p{N}_.~/\\\\-]";
|
|
20649
|
+
/** The home folder as it matches paths: no trailing separator; nothing for an empty home or a root. */
|
|
20650
|
+
function homeOf(home) {
|
|
20651
|
+
if (home === void 0) return void 0;
|
|
20652
|
+
const windows = WINDOWS_HOME.test(home);
|
|
20653
|
+
const text = home.replace(windows ? /[\\/]+$/u : /\/+$/u, "");
|
|
20654
|
+
if (text.length === 0 || windows && DRIVE_ROOT.test(text)) return void 0;
|
|
20655
|
+
return {
|
|
20656
|
+
text,
|
|
20657
|
+
windows
|
|
20658
|
+
};
|
|
20659
|
+
}
|
|
20660
|
+
/** Show `path` with the home folder as `~`; a path elsewhere, or no home known, is returned as it is. */
|
|
20661
|
+
function displayPath(path, home) {
|
|
20662
|
+
const folder = homeOf(home);
|
|
20663
|
+
if (folder === void 0 || path.length < folder.text.length) return path;
|
|
20664
|
+
const prefix = path.slice(0, folder.text.length);
|
|
20665
|
+
if (folder.windows ? prefix.toLowerCase() !== folder.text.toLowerCase() : prefix !== folder.text) return path;
|
|
20666
|
+
if (path.length === folder.text.length) return "~";
|
|
20667
|
+
const next = path.charAt(folder.text.length);
|
|
20668
|
+
if (next !== POSIX_SEPARATOR && !(folder.windows && next === WINDOWS_SEPARATOR)) return path;
|
|
20669
|
+
return `~${folder.windows ? WINDOWS_SEPARATOR : POSIX_SEPARATOR}${path.slice(folder.text.length + 1)}`;
|
|
20670
|
+
}
|
|
20671
|
+
function escaped(text) {
|
|
20672
|
+
return text.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
20673
|
+
}
|
|
20674
|
+
/** Show the home folder as `~` wherever a message (an error, a log line) names it, as whole folders only. */
|
|
20675
|
+
function displayText(text, home) {
|
|
20676
|
+
const folder = homeOf(home);
|
|
20677
|
+
if (folder === void 0) return text;
|
|
20678
|
+
const pattern = new RegExp(`(?<!${PATH_CHARACTER})${escaped(folder.text)}(?!${NAME_CHARACTER})`, folder.windows ? "giu" : "gu");
|
|
20679
|
+
return text.replace(pattern, "~");
|
|
20680
|
+
}
|
|
20681
|
+
/** The home folder the Host reported, for the screens below the page. */
|
|
20682
|
+
const HomeContext = (0, react.createContext)(void 0);
|
|
20683
|
+
/** `displayPath` over the Host's home folder. */
|
|
20684
|
+
function usePath() {
|
|
20685
|
+
const home = (0, react.useContext)(HomeContext);
|
|
20686
|
+
return (path) => displayPath(path, home);
|
|
20687
|
+
}
|
|
20688
|
+
/** `displayText` over the Host's home folder. */
|
|
20689
|
+
function useText() {
|
|
20690
|
+
const home = (0, react.useContext)(HomeContext);
|
|
20691
|
+
return (text) => displayText(text, home);
|
|
20336
20692
|
}
|
|
20337
20693
|
//#endregion
|
|
20338
20694
|
//#region src/client/shared.tsx
|
|
@@ -20361,7 +20717,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20361
20717
|
unsupported: "var(--dsw-alias-label-tertiary)",
|
|
20362
20718
|
failed: "var(--dsw-alias-state-error-primary)",
|
|
20363
20719
|
inactive: "var(--dsw-alias-label-tertiary)",
|
|
20364
|
-
off: "var(--dsw-alias-label-tertiary)"
|
|
20720
|
+
off: "var(--dsw-alias-label-tertiary)",
|
|
20721
|
+
provided: "var(--dsw-alias-label-tertiary)"
|
|
20365
20722
|
};
|
|
20366
20723
|
const STATE_LABEL = {
|
|
20367
20724
|
works: "stateWorks",
|
|
@@ -20370,7 +20727,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20370
20727
|
unsupported: "stateUnsupported",
|
|
20371
20728
|
failed: "stateFailed",
|
|
20372
20729
|
inactive: "stateInactive",
|
|
20373
|
-
off: "stateOff"
|
|
20730
|
+
off: "stateOff",
|
|
20731
|
+
provided: "stateProvided"
|
|
20374
20732
|
};
|
|
20375
20733
|
const REASON_LABEL = {
|
|
20376
20734
|
"events-never-raised": "reasonEventsNeverRaised",
|
|
@@ -20382,9 +20740,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20382
20740
|
"not-mapped": "reasonNotMapped",
|
|
20383
20741
|
"hosted-connector": "reasonHostedConnector",
|
|
20384
20742
|
"unknown-transport": "reasonUnknownTransport",
|
|
20743
|
+
"disabled-in-plugin": "reasonDisabledInPlugin",
|
|
20744
|
+
"disabled-in-config": "reasonDisabledInConfig",
|
|
20745
|
+
"disabled-in-claude-code": "reasonDisabledInClaudeCode",
|
|
20746
|
+
"needs-chatgpt-sign-in": "reasonNeedsChatgptSignIn",
|
|
20385
20747
|
"run-failed": "reasonRunFailed",
|
|
20386
20748
|
"setup-failed": "reasonSetupFailed",
|
|
20387
20749
|
unreadable: "reasonUnreadable",
|
|
20750
|
+
"folder-gone": "reasonFolderGone",
|
|
20751
|
+
"not-followed": "reasonNotFollowed",
|
|
20388
20752
|
"row-off": "reasonRowOff",
|
|
20389
20753
|
other: void 0
|
|
20390
20754
|
};
|
|
@@ -20416,13 +20780,43 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20416
20780
|
const key = KIND_LABEL[kind];
|
|
20417
20781
|
return key !== void 0 ? t(key) : kind;
|
|
20418
20782
|
}
|
|
20783
|
+
/** A migrated part that failed to start, as Diagnostics lists it: its kind, name and, for hooks, its events. */
|
|
20784
|
+
function mountLabel(mount, t) {
|
|
20785
|
+
const kind = kindLabel(mount.kind, t);
|
|
20786
|
+
return mount.events !== void 0 && mount.events.length > 0 ? fill(t("diagMountEvents"), {
|
|
20787
|
+
kind,
|
|
20788
|
+
name: mount.name,
|
|
20789
|
+
events: mount.events.join(t("listSeparator"))
|
|
20790
|
+
}) : fill(t("diagMountPart"), {
|
|
20791
|
+
kind,
|
|
20792
|
+
name: mount.name
|
|
20793
|
+
});
|
|
20794
|
+
}
|
|
20419
20795
|
/** A part that can't fully run in DSH (the Gaps screen lists these). */
|
|
20420
20796
|
function isGap(part) {
|
|
20421
20797
|
return part.adapter === void 0 && (part.state === "partial" || part.state === "needs-port" || part.state === "unsupported" || part.state === "failed");
|
|
20422
20798
|
}
|
|
20799
|
+
/** The states a part that acts at the start of a session can be in and still start, or start once it is switched on. */
|
|
20800
|
+
const STARTABLE = /* @__PURE__ */ new Set([
|
|
20801
|
+
"works",
|
|
20802
|
+
"partial",
|
|
20803
|
+
"off"
|
|
20804
|
+
]);
|
|
20805
|
+
/** Whether a part acts at the start of a session and could run (switched off counts: switching it on starts it). */
|
|
20806
|
+
function startsWithSession(part) {
|
|
20807
|
+
return part.atStart === true && STARTABLE.has(part.state);
|
|
20808
|
+
}
|
|
20809
|
+
/** Whether any of these plugins has a part that acts at the start of a session. */
|
|
20810
|
+
function hasSessionStartPart(items) {
|
|
20811
|
+
return items.some((item) => item.parts.some(startsWithSession));
|
|
20812
|
+
}
|
|
20813
|
+
/** The plugins that are migrated now but were not before (`before`: the ids of those that were). */
|
|
20814
|
+
function newlyMigrated(before, items) {
|
|
20815
|
+
return items.filter((item) => item.installed && !before.has(item.id));
|
|
20816
|
+
}
|
|
20423
20817
|
/** Parts the person or a row switched off don't count toward a verdict. */
|
|
20424
20818
|
function counted(item) {
|
|
20425
|
-
return item.parts.filter((part) => part.state !== "off" && part.state !== "inactive");
|
|
20819
|
+
return item.parts.filter((part) => part.state !== "off" && part.state !== "inactive" && part.state !== "provided");
|
|
20426
20820
|
}
|
|
20427
20821
|
function verdictOf(item) {
|
|
20428
20822
|
const parts = counted(item);
|
|
@@ -20474,13 +20868,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20474
20868
|
}
|
|
20475
20869
|
/** A part's reasons in words, with the specifics in small monospace. */
|
|
20476
20870
|
function Reasons({ part, t }) {
|
|
20871
|
+
const shown = useText();
|
|
20872
|
+
const provider = part.providedBy;
|
|
20873
|
+
if (provider !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
20874
|
+
className: "hf-reason",
|
|
20875
|
+
children: [fill(t("providedBy"), { name: provider.name }), provider.adapter !== void 0 ? ` · ${fill(t("coveredBy"), { name: provider.adapter })}` : ""]
|
|
20876
|
+
});
|
|
20477
20877
|
if (part.reasons.length === 0) return null;
|
|
20478
20878
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: part.reasons.map((reason, index) => {
|
|
20479
20879
|
const lead = REASON_LABEL[reason.code];
|
|
20480
|
-
const detail = reason.code === "row-off" ? "" : reason.detail;
|
|
20880
|
+
const detail = reason.code === "row-off" || reason.code === "not-followed" ? "" : shown(reason.detail);
|
|
20481
20881
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
20482
20882
|
className: "hf-reason",
|
|
20483
|
-
children: [lead !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [t(lead), " "] }) : null, detail.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
20883
|
+
children: [lead !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [reason.code === "not-followed" ? fill(t(lead), { harness: harnessName(reason.detail) }) : t(lead), " "] }) : null, detail.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
20484
20884
|
className: "hf-code",
|
|
20485
20885
|
children: detail
|
|
20486
20886
|
}) : null]
|
|
@@ -20523,24 +20923,103 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20523
20923
|
return item.own ? t("ownSettings") : item.name;
|
|
20524
20924
|
}
|
|
20525
20925
|
function Notice({ kind = "ok", children }) {
|
|
20926
|
+
const shown = useText();
|
|
20526
20927
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
20527
20928
|
className: "hf-notice",
|
|
20528
20929
|
"data-kind": kind,
|
|
20529
20930
|
role: kind === "error" ? "alert" : "status",
|
|
20530
|
-
children
|
|
20931
|
+
children: typeof children === "string" ? shown(children) : children
|
|
20531
20932
|
});
|
|
20532
20933
|
}
|
|
20533
20934
|
//#endregion
|
|
20935
|
+
//#region src/client/code-notice.tsx
|
|
20936
|
+
/**
|
|
20937
|
+
* The install confirmation's code warning, worded from the parts that would
|
|
20938
|
+
* run code: which of them run in DSH once installed, which are gaps that run
|
|
20939
|
+
* nothing until an adapter is built (with the overview's reasons), and that an
|
|
20940
|
+
* adapter runs code of its own.
|
|
20941
|
+
* @module @kirkchinese/harness-forge/client
|
|
20942
|
+
*/
|
|
20943
|
+
/** The words for what a part runs, with `{detail}`. */
|
|
20944
|
+
const WHAT = {
|
|
20945
|
+
hooks: "codeWhatHooks",
|
|
20946
|
+
mcp: "codeWhatMcp",
|
|
20947
|
+
shell: "codeWhatShell",
|
|
20948
|
+
script: "codeWhatScript",
|
|
20949
|
+
code: "codeWhatCode",
|
|
20950
|
+
environment: "codeWhatEnvironment",
|
|
20951
|
+
agent: "codeWhatAgent"
|
|
20952
|
+
};
|
|
20953
|
+
/** The overview's reasons as one sentence run, as `Reasons` shows them. */
|
|
20954
|
+
function reasonsText(reasons, t) {
|
|
20955
|
+
return reasons.map((reason) => {
|
|
20956
|
+
const lead = REASON_LABEL[reason.code];
|
|
20957
|
+
return [lead !== void 0 ? t(lead) : "", reason.detail].filter((text) => text.length > 0).join(" ");
|
|
20958
|
+
}).filter((text) => text.length > 0).join(" ");
|
|
20959
|
+
}
|
|
20960
|
+
function partLine(part, t) {
|
|
20961
|
+
const state = part.runs ? t("codeRunsInDsh") : [t("codeGapInDsh"), reasonsText(part.reasons ?? [], t)].filter((text) => text.length > 0).join(" ");
|
|
20962
|
+
const what = WHAT[part.what] !== void 0 ? fill(t(WHAT[part.what]), { detail: part.detail }) : part.detail;
|
|
20963
|
+
return fill(t("codePartLine"), {
|
|
20964
|
+
name: part.name,
|
|
20965
|
+
kind: kindLabel(part.kind, t),
|
|
20966
|
+
what,
|
|
20967
|
+
state
|
|
20968
|
+
});
|
|
20969
|
+
}
|
|
20970
|
+
/**
|
|
20971
|
+
* The warning: an alarm when something runs once installed, else a note
|
|
20972
|
+
* that nothing does until an adapter is built, or that the plugin is text.
|
|
20973
|
+
* @returns its kind and lines, the summary first.
|
|
20974
|
+
*/
|
|
20975
|
+
function codeNotice(parts, t) {
|
|
20976
|
+
if (parts.length === 0) return {
|
|
20977
|
+
kind: "ok",
|
|
20978
|
+
lines: [t("confirmNoCode"), t("confirmTrust")]
|
|
20979
|
+
};
|
|
20980
|
+
const names = (items) => items.map((part) => part.name).join(t("codeNameSeparator"));
|
|
20981
|
+
const running = parts.filter((part) => part.runs);
|
|
20982
|
+
const gaps = parts.filter((part) => !part.runs);
|
|
20983
|
+
const summary = running.length > 0 ? fill(t("confirmCodeRuns"), { names: names(running) }) : fill(t("confirmCodeNone"), { names: names(gaps) });
|
|
20984
|
+
return {
|
|
20985
|
+
kind: running.length > 0 ? "error" : "ok",
|
|
20986
|
+
lines: [
|
|
20987
|
+
summary,
|
|
20988
|
+
...parts.map((part) => partLine(part, t)),
|
|
20989
|
+
t("confirmCodeAdapter"),
|
|
20990
|
+
t("confirmTrust")
|
|
20991
|
+
]
|
|
20992
|
+
};
|
|
20993
|
+
}
|
|
20994
|
+
//#endregion
|
|
20534
20995
|
//#region src/client/discover.tsx
|
|
20535
20996
|
/**
|
|
20536
20997
|
* Discover & migrate: for each harness, what this computer has (plugins and
|
|
20537
20998
|
* the person's own settings), whether it works in DSH, and a button to migrate
|
|
20538
|
-
* one or all;
|
|
20999
|
+
* one or all; below, plugins to get from the internet (a pasted marketplace or
|
|
21000
|
+
* plugin, or a default marketplace) and a path to add by hand.
|
|
20539
21001
|
* @module @kirkchinese/harness-forge/client
|
|
20540
21002
|
*/
|
|
21003
|
+
/** The key of the words for why a plugin's id cannot be told. */
|
|
21004
|
+
const PLUGIN_ID_PROBLEM = {
|
|
21005
|
+
missing: "pluginIdMissing",
|
|
21006
|
+
ambiguous: "pluginIdAmbiguous",
|
|
21007
|
+
dynamic: "pluginIdDynamic",
|
|
21008
|
+
escape: "pluginIdEscape"
|
|
21009
|
+
};
|
|
21010
|
+
/** Why "Migrate all" leaves a plugin out: switched off in its harness, or not known to run there, and why. */
|
|
21011
|
+
function holdNote(item, t) {
|
|
21012
|
+
const harness = harnessName(item.source);
|
|
21013
|
+
if (item.enabled === false) return fill(t("disabledInNote"), { harness });
|
|
21014
|
+
if (item.enabledUnknown !== void 0) return fill(t("enabledUnknownNote"), {
|
|
21015
|
+
harness,
|
|
21016
|
+
why: t(PLUGIN_ID_PROBLEM[item.enabledUnknown])
|
|
21017
|
+
});
|
|
21018
|
+
}
|
|
20541
21019
|
/** One plugin or the person's settings, with its parts behind an expander. */
|
|
20542
21020
|
function ItemRow({ item, t, busy, onMigrate }) {
|
|
20543
21021
|
const [open, setOpen] = (0, react.useState)(false);
|
|
21022
|
+
const shown = usePath();
|
|
20544
21023
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
20545
21024
|
className: "hf-item",
|
|
20546
21025
|
"data-open": open,
|
|
@@ -20555,16 +21034,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20555
21034
|
},
|
|
20556
21035
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chevron, { open }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
20557
21036
|
className: "hf-item-main",
|
|
20558
|
-
children: [
|
|
20559
|
-
|
|
20560
|
-
|
|
20561
|
-
|
|
20562
|
-
|
|
20563
|
-
|
|
20564
|
-
|
|
20565
|
-
|
|
20566
|
-
|
|
20567
|
-
|
|
21037
|
+
children: [
|
|
21038
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21039
|
+
className: "hf-item-title",
|
|
21040
|
+
children: [
|
|
21041
|
+
itemName(item, t),
|
|
21042
|
+
item.installed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21043
|
+
className: "hf-tag",
|
|
21044
|
+
children: t("migratedTag")
|
|
21045
|
+
}) : null,
|
|
21046
|
+
item.enabled === false ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21047
|
+
className: "hf-tag",
|
|
21048
|
+
children: fill(t("disabledInTag"), { harness: harnessName(item.source) })
|
|
21049
|
+
}) : null,
|
|
21050
|
+
item.enabledUnknown !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21051
|
+
className: "hf-tag",
|
|
21052
|
+
children: fill(t("enabledUnknownTag"), { harness: harnessName(item.source) })
|
|
21053
|
+
}) : null
|
|
21054
|
+
]
|
|
21055
|
+
}),
|
|
21056
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21057
|
+
className: "hf-item-desc",
|
|
21058
|
+
children: [item.version !== void 0 ? `${item.version} · ` : "", shown(item.root)]
|
|
21059
|
+
}),
|
|
21060
|
+
holdNote(item, t) !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21061
|
+
className: "hf-reason",
|
|
21062
|
+
children: holdNote(item, t)
|
|
21063
|
+
}) : null
|
|
21064
|
+
]
|
|
20568
21065
|
})]
|
|
20569
21066
|
}),
|
|
20570
21067
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(VerdictBar, {
|
|
@@ -20581,6 +21078,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20581
21078
|
children: item.installed ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
20582
21079
|
className: "hf-btn",
|
|
20583
21080
|
disabled: busy,
|
|
21081
|
+
title: holdNote(item, t),
|
|
20584
21082
|
onClick: () => {
|
|
20585
21083
|
onMigrate(item);
|
|
20586
21084
|
},
|
|
@@ -20616,44 +21114,222 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20616
21114
|
}) : null]
|
|
20617
21115
|
});
|
|
20618
21116
|
}
|
|
20619
|
-
|
|
20620
|
-
|
|
20621
|
-
|
|
21117
|
+
/** Entries listed at once; a filter finds the rest of a large marketplace. */
|
|
21118
|
+
const SHOWN = 60;
|
|
21119
|
+
/** What a plugin contains and where it comes from, to confirm before it is installed. */
|
|
21120
|
+
function ConfirmInstall({ t, plan, busy, onConfirm, onCancel }) {
|
|
21121
|
+
const title = fill(t(plan.update !== void 0 ? "confirmUpdateTitle" : "confirmTitle"), { name: plan.name });
|
|
21122
|
+
const warning = codeNotice(plan.codeParts, t);
|
|
21123
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21124
|
+
className: "hf-card",
|
|
21125
|
+
role: "dialog",
|
|
21126
|
+
"aria-label": title,
|
|
21127
|
+
style: { marginTop: 12 },
|
|
21128
|
+
children: [
|
|
21129
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21130
|
+
className: "hf-section-title",
|
|
21131
|
+
style: { marginBottom: 8 },
|
|
21132
|
+
children: title
|
|
21133
|
+
}),
|
|
21134
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
|
|
21135
|
+
className: "hf-facts",
|
|
21136
|
+
children: [
|
|
21137
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("confirmSource") }),
|
|
21138
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: plan.page !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
21139
|
+
href: plan.page,
|
|
21140
|
+
target: "_blank",
|
|
21141
|
+
rel: "noreferrer",
|
|
21142
|
+
children: plan.source
|
|
21143
|
+
}) : plan.source }),
|
|
21144
|
+
plan.registry !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("confirmRegistry") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21145
|
+
className: "hf-code",
|
|
21146
|
+
children: plan.registry
|
|
21147
|
+
}) })] }) : null,
|
|
21148
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: plan.update !== void 0 ? t("confirmUpdateRevision") : t("confirmRevision") }),
|
|
21149
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", { children: [
|
|
21150
|
+
plan.update !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21151
|
+
className: "hf-code",
|
|
21152
|
+
children: plan.update.from
|
|
21153
|
+
}), " → "] }) : null,
|
|
21154
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21155
|
+
className: "hf-code",
|
|
21156
|
+
children: plan.revision
|
|
21157
|
+
}),
|
|
21158
|
+
plan.version !== void 0 ? ` · ${plan.version}` : ""
|
|
21159
|
+
] }),
|
|
21160
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("confirmHarness") }),
|
|
21161
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: harnessName(plan.harness) }),
|
|
21162
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("confirmParts") }),
|
|
21163
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", { children: [
|
|
21164
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21165
|
+
className: "hf-muted",
|
|
21166
|
+
style: { marginBottom: 4 },
|
|
21167
|
+
children: fill(t("confirmWorks"), {
|
|
21168
|
+
works: plan.works,
|
|
21169
|
+
total: plan.total
|
|
21170
|
+
})
|
|
21171
|
+
}),
|
|
21172
|
+
plan.parts.map((part) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
21173
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21174
|
+
className: "hf-part-kind",
|
|
21175
|
+
children: kindLabel(part.kind, t)
|
|
21176
|
+
}),
|
|
21177
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21178
|
+
className: "hf-part-name",
|
|
21179
|
+
children: part.name
|
|
21180
|
+
}),
|
|
21181
|
+
part.change !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21182
|
+
className: "hf-tag",
|
|
21183
|
+
children: t(part.change === "new" ? "partNew" : "partChanged")
|
|
21184
|
+
}) : null,
|
|
21185
|
+
part.reasons !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Reasons, {
|
|
21186
|
+
part: { reasons: part.reasons },
|
|
21187
|
+
t
|
|
21188
|
+
}) : part.gap !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21189
|
+
className: "hf-reason",
|
|
21190
|
+
children: part.gap
|
|
21191
|
+
}) : null
|
|
21192
|
+
] }, `${part.kind}:${part.name}`)),
|
|
21193
|
+
plan.update !== void 0 && plan.update.removed.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21194
|
+
className: "hf-muted",
|
|
21195
|
+
style: { marginTop: 4 },
|
|
21196
|
+
children: fill(t("confirmRemoved"), { names: plan.update.removed.join(", ") })
|
|
21197
|
+
}) : null
|
|
21198
|
+
] })
|
|
21199
|
+
]
|
|
21200
|
+
}),
|
|
21201
|
+
plan.dependencies !== void 0 && plan.dependencies > 0 && plan.registry !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21202
|
+
className: "hf-muted",
|
|
21203
|
+
style: { marginBottom: 8 },
|
|
21204
|
+
children: fill(t("confirmDependencies"), {
|
|
21205
|
+
n: plan.dependencies,
|
|
21206
|
+
registry: plan.registry
|
|
21207
|
+
})
|
|
21208
|
+
}) : null,
|
|
21209
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Notice, {
|
|
21210
|
+
kind: warning.kind,
|
|
21211
|
+
children: [warning.lines.join("\n"), plan.alreadyInstalled ? `\n${t("confirmReinstall")}` : ""]
|
|
21212
|
+
}),
|
|
21213
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21214
|
+
className: "hf-form",
|
|
21215
|
+
style: { marginTop: 12 },
|
|
21216
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21217
|
+
className: "hf-btn hf-btn-primary",
|
|
21218
|
+
disabled: busy,
|
|
21219
|
+
onClick: onConfirm,
|
|
21220
|
+
children: busy ? t(plan.update !== void 0 ? "remoteUpdating" : "installing") : t(plan.update !== void 0 ? "confirmUpdate" : "confirmInstall")
|
|
21221
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21222
|
+
className: "hf-btn",
|
|
21223
|
+
disabled: busy,
|
|
21224
|
+
onClick: onCancel,
|
|
21225
|
+
children: t("confirmCancel")
|
|
21226
|
+
})]
|
|
21227
|
+
})
|
|
21228
|
+
]
|
|
21229
|
+
});
|
|
21230
|
+
}
|
|
21231
|
+
/** Get plugins: paste a marketplace or plugin, or open a default marketplace; confirm, install; check for updates. */
|
|
21232
|
+
function GetPlugins({ t, onInstalled }) {
|
|
21233
|
+
const shown = usePath();
|
|
21234
|
+
const [input, setInput] = (0, react.useState)("");
|
|
21235
|
+
const [sources, setSources] = (0, react.useState)(void 0);
|
|
21236
|
+
const [view, setView] = (0, react.useState)(void 0);
|
|
21237
|
+
const [filter, setFilter] = (0, react.useState)("");
|
|
21238
|
+
const [plan, setPlan] = (0, react.useState)(void 0);
|
|
21239
|
+
const [updates, setUpdates] = (0, react.useState)(/* @__PURE__ */ new Map());
|
|
20622
21240
|
const [busy, setBusy] = (0, react.useState)(void 0);
|
|
20623
21241
|
const [error, setError] = (0, react.useState)(void 0);
|
|
20624
21242
|
const [notice, setNotice] = (0, react.useState)(void 0);
|
|
20625
|
-
const
|
|
20626
|
-
if (path.trim().length === 0) {
|
|
20627
|
-
setError(t("pathRequired"));
|
|
20628
|
-
return;
|
|
20629
|
-
}
|
|
20630
|
-
setBusy("open");
|
|
20631
|
-
setError(void 0);
|
|
21243
|
+
const refresh = async () => {
|
|
20632
21244
|
try {
|
|
20633
|
-
|
|
21245
|
+
setSources(await call("remoteSources"));
|
|
20634
21246
|
} catch (cause) {
|
|
20635
21247
|
setError(messageOf(cause));
|
|
20636
|
-
} finally {
|
|
20637
|
-
setBusy(void 0);
|
|
20638
21248
|
}
|
|
20639
21249
|
};
|
|
20640
|
-
|
|
20641
|
-
|
|
21250
|
+
(0, react.useEffect)(() => {
|
|
21251
|
+
refresh();
|
|
21252
|
+
}, []);
|
|
21253
|
+
const run = async (key, work) => {
|
|
21254
|
+
setBusy(key);
|
|
20642
21255
|
setError(void 0);
|
|
20643
21256
|
setNotice(void 0);
|
|
20644
21257
|
try {
|
|
20645
|
-
await
|
|
20646
|
-
path: path.trim(),
|
|
20647
|
-
name
|
|
20648
|
-
});
|
|
20649
|
-
setNotice(fill(t("installedName"), { name }));
|
|
20650
|
-
onInstalled();
|
|
21258
|
+
await work();
|
|
20651
21259
|
} catch (cause) {
|
|
20652
|
-
setError(
|
|
21260
|
+
setError(messageOf(cause));
|
|
20653
21261
|
} finally {
|
|
20654
21262
|
setBusy(void 0);
|
|
20655
21263
|
}
|
|
20656
21264
|
};
|
|
21265
|
+
const open = (value) => {
|
|
21266
|
+
if (value.trim().length === 0) {
|
|
21267
|
+
setError(t("pathRequired"));
|
|
21268
|
+
return Promise.resolve();
|
|
21269
|
+
}
|
|
21270
|
+
setInput(value);
|
|
21271
|
+
return run("open", async () => {
|
|
21272
|
+
setPlan(void 0);
|
|
21273
|
+
setFilter("");
|
|
21274
|
+
setView(await call("remoteOpen", { input: value.trim() }));
|
|
21275
|
+
await refresh();
|
|
21276
|
+
});
|
|
21277
|
+
};
|
|
21278
|
+
const prepare = (entry) => run(entry ?? "plugin", async () => {
|
|
21279
|
+
if (view === void 0) return;
|
|
21280
|
+
if (plan !== void 0) await call("remoteCancel", { token: plan.token }).catch(() => void 0);
|
|
21281
|
+
setPlan(await call("remotePrepare", {
|
|
21282
|
+
input: view.input,
|
|
21283
|
+
...entry !== void 0 ? { entry } : {}
|
|
21284
|
+
}));
|
|
21285
|
+
});
|
|
21286
|
+
const confirm = () => run("confirm", async () => {
|
|
21287
|
+
if (plan === void 0) return;
|
|
21288
|
+
const report = await call("remoteInstall", { token: plan.token });
|
|
21289
|
+
setPlan(void 0);
|
|
21290
|
+
if (report.updated === true) {
|
|
21291
|
+
setNotice(fill(t("remoteUpdated"), {
|
|
21292
|
+
name: plan.name,
|
|
21293
|
+
revision: report.revision ?? plan.revision
|
|
21294
|
+
}));
|
|
21295
|
+
setUpdates((previous) => new Map([...previous].filter(([id]) => id !== plan.pluginId)));
|
|
21296
|
+
} else setNotice(fill(t("installedName"), { name: report.plugin?.name ?? plan.name }));
|
|
21297
|
+
onInstalled();
|
|
21298
|
+
if (view !== void 0) setView(await call("remoteOpen", { input: view.input }).catch(() => view));
|
|
21299
|
+
await refresh();
|
|
21300
|
+
});
|
|
21301
|
+
const cancel = () => {
|
|
21302
|
+
if (plan !== void 0) call("remoteCancel", { token: plan.token }).catch(() => void 0);
|
|
21303
|
+
setPlan(void 0);
|
|
21304
|
+
};
|
|
21305
|
+
const forget = (value) => run("forget", async () => {
|
|
21306
|
+
await call("remoteForget", { input: value });
|
|
21307
|
+
await refresh();
|
|
21308
|
+
});
|
|
21309
|
+
const check = () => run("check", async () => {
|
|
21310
|
+
const result = await call("remoteCheckUpdates", {});
|
|
21311
|
+
setUpdates(new Map(result.updates.map((item) => [item.pluginId, item])));
|
|
21312
|
+
});
|
|
21313
|
+
const update = (install, token) => run(install.pluginId, async () => {
|
|
21314
|
+
if (plan !== void 0) await call("remoteCancel", { token: plan.token }).catch(() => void 0);
|
|
21315
|
+
setPlan(await call("remotePrepareUpdate", {
|
|
21316
|
+
pluginId: install.pluginId,
|
|
21317
|
+
token
|
|
21318
|
+
}));
|
|
21319
|
+
});
|
|
21320
|
+
const needle = filter.trim().toLowerCase();
|
|
21321
|
+
const matching = view?.entries.filter((entry) => needle.length === 0 || `${entry.name} ${entry.description ?? ""} ${entry.category ?? ""}`.toLowerCase().includes(needle)) ?? [];
|
|
21322
|
+
const marketplaces = [...(sources?.defaults ?? []).map((item) => ({
|
|
21323
|
+
input: item.input,
|
|
21324
|
+
name: item.id,
|
|
21325
|
+
harness: item.harness,
|
|
21326
|
+
removable: false
|
|
21327
|
+
})), ...(sources?.added ?? []).map((item) => ({
|
|
21328
|
+
input: item.input,
|
|
21329
|
+
name: item.name,
|
|
21330
|
+
harness: item.harness,
|
|
21331
|
+
removable: true
|
|
21332
|
+
}))];
|
|
20657
21333
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
20658
21334
|
className: "hf-section",
|
|
20659
21335
|
children: [
|
|
@@ -20672,15 +21348,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20672
21348
|
className: "hf-form",
|
|
20673
21349
|
onSubmit: (event) => {
|
|
20674
21350
|
event.preventDefault();
|
|
20675
|
-
open();
|
|
21351
|
+
open(input);
|
|
20676
21352
|
},
|
|
20677
21353
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
20678
21354
|
className: "hf-input",
|
|
20679
|
-
value:
|
|
21355
|
+
value: input,
|
|
20680
21356
|
placeholder: t("marketPath"),
|
|
20681
21357
|
"aria-label": t("marketPath"),
|
|
20682
21358
|
onChange: (event) => {
|
|
20683
|
-
|
|
21359
|
+
setInput(event.target.value);
|
|
20684
21360
|
}
|
|
20685
21361
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
20686
21362
|
className: "hf-btn",
|
|
@@ -20689,25 +21365,138 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20689
21365
|
children: busy === "open" ? t("marketOpening") : t("marketOpen")
|
|
20690
21366
|
})]
|
|
20691
21367
|
}),
|
|
21368
|
+
sources !== void 0 && !sources.git ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21369
|
+
className: "hf-muted",
|
|
21370
|
+
style: { marginTop: 6 },
|
|
21371
|
+
children: t("marketNoGit")
|
|
21372
|
+
}) : null,
|
|
21373
|
+
marketplaces.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21374
|
+
style: { marginTop: 12 },
|
|
21375
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21376
|
+
className: "hf-muted",
|
|
21377
|
+
style: { marginBottom: 6 },
|
|
21378
|
+
children: t("marketDefaults")
|
|
21379
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21380
|
+
className: "hf-form",
|
|
21381
|
+
children: marketplaces.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21382
|
+
style: {
|
|
21383
|
+
display: "inline-flex",
|
|
21384
|
+
alignItems: "center"
|
|
21385
|
+
},
|
|
21386
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
21387
|
+
className: "hf-btn",
|
|
21388
|
+
disabled: busy !== void 0,
|
|
21389
|
+
title: item.input,
|
|
21390
|
+
onClick: () => {
|
|
21391
|
+
open(item.input);
|
|
21392
|
+
},
|
|
21393
|
+
children: [item.name, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21394
|
+
className: "hf-tag",
|
|
21395
|
+
children: harnessName(item.harness)
|
|
21396
|
+
})]
|
|
21397
|
+
}), item.removable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21398
|
+
className: "hf-btn hf-btn-link",
|
|
21399
|
+
"aria-label": fill(t("marketForget"), { name: item.name }),
|
|
21400
|
+
title: fill(t("marketForget"), { name: item.name }),
|
|
21401
|
+
disabled: busy !== void 0,
|
|
21402
|
+
onClick: () => {
|
|
21403
|
+
forget(item.input);
|
|
21404
|
+
},
|
|
21405
|
+
children: "×"
|
|
21406
|
+
}) : null]
|
|
21407
|
+
}, item.input))
|
|
21408
|
+
})]
|
|
21409
|
+
}) : null,
|
|
21410
|
+
sources?.local !== void 0 && sources.local.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21411
|
+
style: { marginTop: 12 },
|
|
21412
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21413
|
+
className: "hf-muted",
|
|
21414
|
+
style: { marginBottom: 6 },
|
|
21415
|
+
children: t("marketLocal")
|
|
21416
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21417
|
+
className: "hf-form",
|
|
21418
|
+
children: sources.local.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
21419
|
+
className: "hf-btn",
|
|
21420
|
+
disabled: busy !== void 0,
|
|
21421
|
+
title: item.input,
|
|
21422
|
+
onClick: () => {
|
|
21423
|
+
open(item.input);
|
|
21424
|
+
},
|
|
21425
|
+
children: [item.name, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21426
|
+
className: "hf-tag",
|
|
21427
|
+
children: harnessName(item.harness)
|
|
21428
|
+
})]
|
|
21429
|
+
}, item.input))
|
|
21430
|
+
})]
|
|
21431
|
+
}) : null,
|
|
20692
21432
|
error !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Notice, {
|
|
20693
21433
|
kind: "error",
|
|
20694
21434
|
children: error
|
|
20695
21435
|
}) : null,
|
|
20696
21436
|
notice !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Notice, { children: notice }) : null,
|
|
20697
|
-
|
|
20698
|
-
|
|
20699
|
-
|
|
20700
|
-
|
|
20701
|
-
|
|
20702
|
-
|
|
20703
|
-
}
|
|
20704
|
-
|
|
20705
|
-
|
|
20706
|
-
|
|
20707
|
-
|
|
20708
|
-
|
|
20709
|
-
|
|
20710
|
-
|
|
21437
|
+
plan !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfirmInstall, {
|
|
21438
|
+
t,
|
|
21439
|
+
plan,
|
|
21440
|
+
busy: busy === "confirm",
|
|
21441
|
+
onConfirm: () => {
|
|
21442
|
+
confirm();
|
|
21443
|
+
},
|
|
21444
|
+
onCancel: cancel
|
|
21445
|
+
}) : null,
|
|
21446
|
+
view === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21447
|
+
style: { marginTop: 16 },
|
|
21448
|
+
children: [
|
|
21449
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21450
|
+
className: "hf-section-head",
|
|
21451
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21452
|
+
className: "hf-item-title",
|
|
21453
|
+
children: [view.name, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21454
|
+
className: "hf-tag",
|
|
21455
|
+
children: view.kind === "plugin" ? t("marketPlugin") : harnessName(view.harness)
|
|
21456
|
+
})]
|
|
21457
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21458
|
+
className: "hf-muted",
|
|
21459
|
+
children: [
|
|
21460
|
+
view.owner !== void 0 ? `${view.owner} · ` : "",
|
|
21461
|
+
view.page !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
21462
|
+
href: view.page,
|
|
21463
|
+
target: "_blank",
|
|
21464
|
+
rel: "noreferrer",
|
|
21465
|
+
children: shown(view.source)
|
|
21466
|
+
}) : shown(view.source),
|
|
21467
|
+
view.revision !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [" · ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21468
|
+
className: "hf-code",
|
|
21469
|
+
children: view.revision
|
|
21470
|
+
})] }) : null
|
|
21471
|
+
]
|
|
21472
|
+
})] }), view.kind === "marketplace" && view.entries.length > 12 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
21473
|
+
className: "hf-input",
|
|
21474
|
+
style: { flex: "0 1 260px" },
|
|
21475
|
+
value: filter,
|
|
21476
|
+
placeholder: fill(t("marketFilter"), { n: view.entries.length }),
|
|
21477
|
+
"aria-label": fill(t("marketFilter"), { n: view.entries.length }),
|
|
21478
|
+
onChange: (event) => {
|
|
21479
|
+
setFilter(event.target.value);
|
|
21480
|
+
}
|
|
21481
|
+
}) : null]
|
|
21482
|
+
}),
|
|
21483
|
+
view.kind === "plugin" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21484
|
+
className: "hf-form",
|
|
21485
|
+
style: { marginTop: 8 },
|
|
21486
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21487
|
+
className: "hf-btn hf-btn-primary",
|
|
21488
|
+
disabled: busy !== void 0,
|
|
21489
|
+
onClick: () => {
|
|
21490
|
+
prepare();
|
|
21491
|
+
},
|
|
21492
|
+
children: busy === "plugin" ? t("marketOpening") : t("install")
|
|
21493
|
+
})
|
|
21494
|
+
}) : view.entries.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21495
|
+
className: "hf-empty",
|
|
21496
|
+
children: t("marketEmpty")
|
|
21497
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
21498
|
+
className: "hf-list",
|
|
21499
|
+
children: matching.slice(0, SHOWN).map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
20711
21500
|
className: "hf-item",
|
|
20712
21501
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
20713
21502
|
className: "hf-item-head",
|
|
@@ -20715,28 +21504,111 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20715
21504
|
className: "hf-item-main",
|
|
20716
21505
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
20717
21506
|
className: "hf-item-title",
|
|
20718
|
-
children: [
|
|
20719
|
-
|
|
20720
|
-
|
|
20721
|
-
|
|
21507
|
+
children: [
|
|
21508
|
+
entry.name,
|
|
21509
|
+
entry.version !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21510
|
+
className: "hf-muted",
|
|
21511
|
+
children: entry.version
|
|
21512
|
+
}) : null,
|
|
21513
|
+
entry.installed !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21514
|
+
className: "hf-tag",
|
|
21515
|
+
children: t("marketInstalledTag")
|
|
21516
|
+
}) : null
|
|
21517
|
+
]
|
|
20722
21518
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
20723
21519
|
className: "hf-item-desc",
|
|
20724
|
-
|
|
21520
|
+
title: entry.description,
|
|
21521
|
+
children: entry.description ?? fill(t("marketFrom"), { from: entry.from })
|
|
20725
21522
|
})]
|
|
20726
21523
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
20727
21524
|
className: "hf-btn",
|
|
20728
|
-
disabled: busy !== void 0 ||
|
|
20729
|
-
title:
|
|
21525
|
+
disabled: busy !== void 0 || entry.unsupported !== void 0,
|
|
21526
|
+
title: entry.unsupported !== void 0 ? fill(t("marketUnsupported"), { reason: entry.unsupported }) : fill(t("marketFrom"), { from: entry.from }),
|
|
20730
21527
|
onClick: () => {
|
|
20731
|
-
|
|
21528
|
+
prepare(entry.name);
|
|
20732
21529
|
},
|
|
20733
|
-
children: busy === entry.name ? t("
|
|
21530
|
+
children: busy === entry.name ? t("marketOpening") : t("install")
|
|
20734
21531
|
})]
|
|
20735
21532
|
})
|
|
20736
|
-
}, entry.name)
|
|
21533
|
+
}, entry.name))
|
|
21534
|
+
}),
|
|
21535
|
+
matching.length > SHOWN ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21536
|
+
className: "hf-muted",
|
|
21537
|
+
children: fill(t("marketMore"), { n: matching.length - SHOWN })
|
|
21538
|
+
}) : null
|
|
21539
|
+
]
|
|
21540
|
+
}),
|
|
21541
|
+
sources !== void 0 && sources.installs.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21542
|
+
style: { marginTop: 20 },
|
|
21543
|
+
children: [
|
|
21544
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21545
|
+
className: "hf-section-head",
|
|
21546
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21547
|
+
className: "hf-muted",
|
|
21548
|
+
children: t("remoteInstalled")
|
|
21549
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21550
|
+
className: "hf-btn",
|
|
21551
|
+
disabled: busy !== void 0,
|
|
21552
|
+
onClick: () => {
|
|
21553
|
+
check();
|
|
21554
|
+
},
|
|
21555
|
+
children: busy === "check" ? t("remoteChecking") : t("remoteCheck")
|
|
21556
|
+
})]
|
|
21557
|
+
}),
|
|
21558
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
21559
|
+
className: "hf-list",
|
|
21560
|
+
children: sources.installs.map((install) => {
|
|
21561
|
+
const status = updates.get(install.pluginId);
|
|
21562
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
21563
|
+
className: "hf-item",
|
|
21564
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21565
|
+
className: "hf-item-head",
|
|
21566
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21567
|
+
className: "hf-item-main",
|
|
21568
|
+
children: [
|
|
21569
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21570
|
+
className: "hf-item-title",
|
|
21571
|
+
children: [install.name, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21572
|
+
className: "hf-code",
|
|
21573
|
+
children: install.revision.length === 40 ? install.revision.slice(0, 12) : install.revision
|
|
21574
|
+
})]
|
|
21575
|
+
}),
|
|
21576
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21577
|
+
className: "hf-item-desc",
|
|
21578
|
+
title: install.source,
|
|
21579
|
+
children: install.localMarketplace !== void 0 ? fill(t("remoteLocalMarketplace"), { name: install.localMarketplace }) : install.page !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
21580
|
+
href: install.page,
|
|
21581
|
+
target: "_blank",
|
|
21582
|
+
rel: "noreferrer",
|
|
21583
|
+
children: shown(install.source)
|
|
21584
|
+
}) : shown(install.source)
|
|
21585
|
+
}),
|
|
21586
|
+
status?.error !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21587
|
+
className: "hf-reason",
|
|
21588
|
+
children: status.error
|
|
21589
|
+
}) : null
|
|
21590
|
+
]
|
|
21591
|
+
}), status === void 0 ? null : status.update && status.latest !== void 0 && status.token !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21592
|
+
className: "hf-btn hf-btn-primary",
|
|
21593
|
+
disabled: busy !== void 0,
|
|
21594
|
+
onClick: () => {
|
|
21595
|
+
update(install, status.token);
|
|
21596
|
+
},
|
|
21597
|
+
children: busy === install.pluginId ? t("marketOpening") : fill(t("remoteUpdate"), { latest: status.latest })
|
|
21598
|
+
}) : status.error === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21599
|
+
className: "hf-muted",
|
|
21600
|
+
children: t("remoteUpToDate")
|
|
21601
|
+
}) : null]
|
|
21602
|
+
})
|
|
21603
|
+
}, install.pluginId);
|
|
21604
|
+
})
|
|
21605
|
+
}),
|
|
21606
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21607
|
+
className: "hf-muted",
|
|
21608
|
+
children: t("remoteRemoveHint")
|
|
20737
21609
|
})
|
|
20738
|
-
|
|
20739
|
-
})
|
|
21610
|
+
]
|
|
21611
|
+
}) : null
|
|
20740
21612
|
]
|
|
20741
21613
|
});
|
|
20742
21614
|
}
|
|
@@ -20897,7 +21769,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20897
21769
|
children: fill(t("nothingFound"), { name: harness.label })
|
|
20898
21770
|
}, harness.source))
|
|
20899
21771
|
}) : null,
|
|
20900
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
21772
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(GetPlugins, {
|
|
20901
21773
|
t,
|
|
20902
21774
|
onInstalled: () => {
|
|
20903
21775
|
reload();
|
|
@@ -20926,12 +21798,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20926
21798
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
20927
21799
|
className: "hf-part",
|
|
20928
21800
|
children: [
|
|
20929
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21801
|
+
part.state === "provided" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
20930
21802
|
className: "hf-switch",
|
|
20931
21803
|
role: "switch",
|
|
20932
21804
|
"aria-checked": on,
|
|
20933
21805
|
"aria-label": fill(t("switchLabel"), { name: part.name }),
|
|
20934
|
-
disabled: busy,
|
|
21806
|
+
disabled: busy || item.detached !== void 0,
|
|
20935
21807
|
onClick: () => {
|
|
20936
21808
|
onToggle(item, part, !on);
|
|
20937
21809
|
}
|
|
@@ -20950,7 +21822,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20950
21822
|
part.state === "off" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
20951
21823
|
className: "hf-reason",
|
|
20952
21824
|
children: t("partOffByYou")
|
|
20953
|
-
}) : part.state === "inactive" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21825
|
+
}) : part.state === "inactive" && row !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
20954
21826
|
className: "hf-reason",
|
|
20955
21827
|
children: fill(t("partInactiveRow"), { row: rowTitle ?? "" })
|
|
20956
21828
|
}), rowTitle !== void 0 && rowTitle.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -20969,10 +21841,55 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20969
21841
|
]
|
|
20970
21842
|
});
|
|
20971
21843
|
}
|
|
20972
|
-
|
|
21844
|
+
/** Why a migrated plugin's harness no longer runs it, by `Item.detached.reason`. */
|
|
21845
|
+
const DETACHED_TEXT = {
|
|
21846
|
+
uninstalled: "detachedUninstalled",
|
|
21847
|
+
"switched-off": "detachedSwitchedOff",
|
|
21848
|
+
"never-installed": "detachedNeverInstalled",
|
|
21849
|
+
misread: "detachedMisread"
|
|
21850
|
+
};
|
|
21851
|
+
/** What a plugin whose harness no longer runs it says, with what the person can do: keep it as their own, or remove it. */
|
|
21852
|
+
function Detached({ item, t, onKeep, onRemove, busy }) {
|
|
21853
|
+
const detached = item.detached;
|
|
21854
|
+
if (detached === void 0) return null;
|
|
21855
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21856
|
+
style: { padding: "0 8px 10px 34px" },
|
|
21857
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21858
|
+
className: "hf-notice hf-notice-row",
|
|
21859
|
+
style: { marginTop: 0 },
|
|
21860
|
+
role: "status",
|
|
21861
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
21862
|
+
fill(t(DETACHED_TEXT[detached.reason]), { harness: harnessName(detached.harness) }),
|
|
21863
|
+
" ",
|
|
21864
|
+
fill(t(detached.folderGone ? "detachedFolderGone" : "detachedChoose"), { harness: harnessName(detached.harness) })
|
|
21865
|
+
] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21866
|
+
style: {
|
|
21867
|
+
display: "flex",
|
|
21868
|
+
gap: 8
|
|
21869
|
+
},
|
|
21870
|
+
children: [detached.folderGone ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21871
|
+
className: "hf-btn",
|
|
21872
|
+
disabled: busy,
|
|
21873
|
+
onClick: () => {
|
|
21874
|
+
onKeep(item);
|
|
21875
|
+
},
|
|
21876
|
+
children: t("keep")
|
|
21877
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21878
|
+
className: "hf-btn hf-btn-danger",
|
|
21879
|
+
disabled: busy,
|
|
21880
|
+
onClick: onRemove,
|
|
21881
|
+
children: t("remove")
|
|
21882
|
+
})]
|
|
21883
|
+
})]
|
|
21884
|
+
})
|
|
21885
|
+
});
|
|
21886
|
+
}
|
|
21887
|
+
function PluginRow({ item, t, onToggle, onRemove, onKeep, busy }) {
|
|
20973
21888
|
const [open, setOpen] = (0, react.useState)(false);
|
|
20974
21889
|
const [confirming, setConfirming] = (0, react.useState)(false);
|
|
21890
|
+
const shown = usePath();
|
|
20975
21891
|
const attention = item.parts.filter((part) => isGap(part) || part.state === "inactive").length;
|
|
21892
|
+
const updated = item.updated;
|
|
20976
21893
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
20977
21894
|
className: "hf-item",
|
|
20978
21895
|
"data-open": open,
|
|
@@ -20988,16 +21905,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20988
21905
|
},
|
|
20989
21906
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chevron, { open }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
20990
21907
|
className: "hf-item-main",
|
|
20991
|
-
children: [
|
|
20992
|
-
|
|
20993
|
-
|
|
20994
|
-
|
|
20995
|
-
|
|
20996
|
-
|
|
20997
|
-
|
|
20998
|
-
|
|
20999
|
-
|
|
21000
|
-
|
|
21908
|
+
children: [
|
|
21909
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21910
|
+
className: "hf-item-title",
|
|
21911
|
+
children: [itemName(item, t), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21912
|
+
className: "hf-tag",
|
|
21913
|
+
children: harnessName(item.source)
|
|
21914
|
+
})]
|
|
21915
|
+
}),
|
|
21916
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21917
|
+
className: "hf-item-desc",
|
|
21918
|
+
children: [item.version !== void 0 ? `${item.version} · ` : "", shown(item.root)]
|
|
21919
|
+
}),
|
|
21920
|
+
updated !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21921
|
+
className: "hf-item-desc",
|
|
21922
|
+
children: fill(t("updatedBy"), {
|
|
21923
|
+
harness: harnessName(updated.harness),
|
|
21924
|
+
from: updated.from ?? "?",
|
|
21925
|
+
to: updated.to ?? "?"
|
|
21926
|
+
})
|
|
21927
|
+
}) : null
|
|
21928
|
+
]
|
|
21001
21929
|
})]
|
|
21002
21930
|
}),
|
|
21003
21931
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
@@ -21005,8 +21933,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21005
21933
|
style: { flex: "none" },
|
|
21006
21934
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21007
21935
|
className: "hf-dot",
|
|
21008
|
-
style: { background: attention === 0 ? "var(--dsw-alias-state-success-primary)" : "var(--dsw-alias-state-warn-primary)" }
|
|
21009
|
-
}), attention === 0 ? t("ready") : fill(t("attention"), { n: attention })]
|
|
21936
|
+
style: { background: attention === 0 && item.detached === void 0 ? "var(--dsw-alias-state-success-primary)" : "var(--dsw-alias-state-warn-primary)" }
|
|
21937
|
+
}), item.detached !== void 0 ? t("detachedLabel") : attention === 0 ? t("ready") : fill(t("attention"), { n: attention })]
|
|
21010
21938
|
}),
|
|
21011
21939
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21012
21940
|
className: "hf-btn hf-btn-danger",
|
|
@@ -21018,12 +21946,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21018
21946
|
})
|
|
21019
21947
|
]
|
|
21020
21948
|
}),
|
|
21949
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Detached, {
|
|
21950
|
+
item,
|
|
21951
|
+
t,
|
|
21952
|
+
onKeep,
|
|
21953
|
+
onRemove: () => {
|
|
21954
|
+
setConfirming(true);
|
|
21955
|
+
},
|
|
21956
|
+
busy
|
|
21957
|
+
}),
|
|
21021
21958
|
confirming ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21022
21959
|
style: { padding: "0 8px 10px 34px" },
|
|
21023
21960
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21024
21961
|
className: "hf-notice hf-notice-row",
|
|
21025
21962
|
style: { marginTop: 0 },
|
|
21026
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: fill(t("removeConfirm"), { name: itemName(item, t) }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21963
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: fill(t(item.fetched === true ? "removeConfirmFetched" : "removeConfirm"), { name: itemName(item, t) }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21027
21964
|
style: {
|
|
21028
21965
|
display: "flex",
|
|
21029
21966
|
gap: 8
|
|
@@ -21115,6 +22052,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21115
22052
|
function TrustBanners({ t, workspaces, reload }) {
|
|
21116
22053
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
21117
22054
|
const [error, setError] = (0, react.useState)(void 0);
|
|
22055
|
+
const folderOf = usePath();
|
|
21118
22056
|
const shown = workspaces.filter((item) => !item.trusted && !item.dismissed && item.waiting.length > 0);
|
|
21119
22057
|
if (shown.length === 0 && error === void 0) return null;
|
|
21120
22058
|
const decide = async (workspace, method) => {
|
|
@@ -21147,7 +22085,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21147
22085
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
21148
22086
|
className: "hf-lead",
|
|
21149
22087
|
style: { margin: "2px 0 6px" },
|
|
21150
|
-
children: fill(t("trustLead"), { folder: item.workspace })
|
|
22088
|
+
children: fill(t("trustLead"), { folder: folderOf(item.workspace) })
|
|
21151
22089
|
}),
|
|
21152
22090
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
21153
22091
|
className: "hf-muted",
|
|
@@ -21214,6 +22152,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21214
22152
|
});
|
|
21215
22153
|
});
|
|
21216
22154
|
};
|
|
22155
|
+
const keep = (item) => {
|
|
22156
|
+
run(async () => {
|
|
22157
|
+
await call("keepPlugin", { id: item.id });
|
|
22158
|
+
return fill(t("kept"), { name: itemName(item, t) });
|
|
22159
|
+
});
|
|
22160
|
+
};
|
|
21217
22161
|
const remove = (item) => {
|
|
21218
22162
|
run(async () => {
|
|
21219
22163
|
await call("removePlugin", { id: item.id });
|
|
@@ -21226,6 +22170,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21226
22170
|
style: { marginTop: 0 },
|
|
21227
22171
|
children: t("migratedLead")
|
|
21228
22172
|
}),
|
|
22173
|
+
hasSessionStartPart(items) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
22174
|
+
className: "hf-muted",
|
|
22175
|
+
style: { margin: "-8px 0 12px" },
|
|
22176
|
+
children: t("startsInNewSessions")
|
|
22177
|
+
}) : null,
|
|
21229
22178
|
error !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Notice, {
|
|
21230
22179
|
kind: "error",
|
|
21231
22180
|
children: error
|
|
@@ -21246,6 +22195,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21246
22195
|
t,
|
|
21247
22196
|
onToggle: toggle,
|
|
21248
22197
|
onRemove: remove,
|
|
22198
|
+
onKeep: keep,
|
|
21249
22199
|
busy
|
|
21250
22200
|
}, item.id))
|
|
21251
22201
|
})
|
|
@@ -21318,6 +22268,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21318
22268
|
},
|
|
21319
22269
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21320
22270
|
className: "hf-btn",
|
|
22271
|
+
"aria-label": t("closeTaskLabel"),
|
|
21321
22272
|
onClick: onClose,
|
|
21322
22273
|
children: t("close")
|
|
21323
22274
|
})
|
|
@@ -21452,6 +22403,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21452
22403
|
});
|
|
21453
22404
|
}
|
|
21454
22405
|
function GapsScreen({ t, items, openSession, language, reload }) {
|
|
22406
|
+
const shown = useText();
|
|
21455
22407
|
const gaps = items.flatMap((item) => item.parts.filter(isGap).map((part) => ({
|
|
21456
22408
|
item,
|
|
21457
22409
|
part
|
|
@@ -21529,7 +22481,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21529
22481
|
" ",
|
|
21530
22482
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21531
22483
|
className: "hf-code",
|
|
21532
|
-
children: porting.unavailable
|
|
22484
|
+
children: shown(porting.unavailable)
|
|
21533
22485
|
})
|
|
21534
22486
|
]
|
|
21535
22487
|
}) : null,
|
|
@@ -21616,24 +22568,195 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21616
22568
|
] });
|
|
21617
22569
|
}
|
|
21618
22570
|
//#endregion
|
|
22571
|
+
//#region src/client/chat-import.tsx
|
|
22572
|
+
/**
|
|
22573
|
+
* dsh-chat-import, recommended for session import: its pitch with an Install button (asking first), or, once it
|
|
22574
|
+
* runs, where its import is.
|
|
22575
|
+
* @module @kirkchinese/harness-forge/client
|
|
22576
|
+
*/
|
|
22577
|
+
/** Who imports sessions; `reload` reads it again. Undefined until known, or when the Host does not say. */
|
|
22578
|
+
function useSessionImport() {
|
|
22579
|
+
const [status, setStatus] = (0, react.useState)(void 0);
|
|
22580
|
+
const reload = (0, react.useCallback)(async () => {
|
|
22581
|
+
try {
|
|
22582
|
+
const value = await call("sessionImport");
|
|
22583
|
+
setStatus(value);
|
|
22584
|
+
return value;
|
|
22585
|
+
} catch {
|
|
22586
|
+
return;
|
|
22587
|
+
}
|
|
22588
|
+
}, []);
|
|
22589
|
+
(0, react.useEffect)(() => {
|
|
22590
|
+
reload();
|
|
22591
|
+
}, [reload]);
|
|
22592
|
+
return {
|
|
22593
|
+
status,
|
|
22594
|
+
reload
|
|
22595
|
+
};
|
|
22596
|
+
}
|
|
22597
|
+
/** Where session import is while dsh-chat-import runs. */
|
|
22598
|
+
function ChatImportProvided({ t }) {
|
|
22599
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22600
|
+
className: "hf-card",
|
|
22601
|
+
children: t("chatImportProvided")
|
|
22602
|
+
});
|
|
22603
|
+
}
|
|
22604
|
+
/** The pitch for dsh-chat-import with its Install action, which asks before it installs. */
|
|
22605
|
+
function ChatImportOffer({ t, status, reload }) {
|
|
22606
|
+
const [confirming, setConfirming] = (0, react.useState)(false);
|
|
22607
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
22608
|
+
const [error, setError] = (0, react.useState)(void 0);
|
|
22609
|
+
const [notice, setNotice] = (0, react.useState)(void 0);
|
|
22610
|
+
const install = async () => {
|
|
22611
|
+
setBusy(true);
|
|
22612
|
+
setError(void 0);
|
|
22613
|
+
setNotice(void 0);
|
|
22614
|
+
try {
|
|
22615
|
+
if ((await call("installChatImport")).application === "restart-required") {
|
|
22616
|
+
setNotice(t("chatImportRestart"));
|
|
22617
|
+
return;
|
|
22618
|
+
}
|
|
22619
|
+
for (let attempt = 0; attempt < 20; attempt++) {
|
|
22620
|
+
if ((await reload())?.provider === "dsh-chat-import") return;
|
|
22621
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
22622
|
+
}
|
|
22623
|
+
setNotice(t("chatImportInstalledLater"));
|
|
22624
|
+
} catch (cause) {
|
|
22625
|
+
setError(messageOf(cause));
|
|
22626
|
+
} finally {
|
|
22627
|
+
setBusy(false);
|
|
22628
|
+
setConfirming(false);
|
|
22629
|
+
}
|
|
22630
|
+
};
|
|
22631
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
22632
|
+
className: "hf-card",
|
|
22633
|
+
"aria-label": "dsh-chat-import",
|
|
22634
|
+
children: [
|
|
22635
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: t("chatImportPitch") }),
|
|
22636
|
+
status.canInstall ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22637
|
+
className: "hf-form",
|
|
22638
|
+
style: { marginTop: 10 },
|
|
22639
|
+
children: confirming ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
22640
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
22641
|
+
style: { fontSize: 13 },
|
|
22642
|
+
children: t("chatImportConfirm")
|
|
22643
|
+
}),
|
|
22644
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
22645
|
+
className: "hf-btn hf-btn-primary",
|
|
22646
|
+
disabled: busy,
|
|
22647
|
+
onClick: () => {
|
|
22648
|
+
install();
|
|
22649
|
+
},
|
|
22650
|
+
children: busy ? t("chatImportInstalling") : t("chatImportInstall")
|
|
22651
|
+
}),
|
|
22652
|
+
busy ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
22653
|
+
className: "hf-btn",
|
|
22654
|
+
onClick: () => {
|
|
22655
|
+
setConfirming(false);
|
|
22656
|
+
},
|
|
22657
|
+
children: t("cancel")
|
|
22658
|
+
})
|
|
22659
|
+
] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
22660
|
+
className: "hf-btn",
|
|
22661
|
+
onClick: () => {
|
|
22662
|
+
setConfirming(true);
|
|
22663
|
+
},
|
|
22664
|
+
children: t("chatImportInstall")
|
|
22665
|
+
})
|
|
22666
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22667
|
+
className: "hf-muted",
|
|
22668
|
+
style: { marginTop: 8 },
|
|
22669
|
+
children: fill(t("chatImportCommand"), { command: status.command })
|
|
22670
|
+
}),
|
|
22671
|
+
error !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Notice, {
|
|
22672
|
+
kind: "error",
|
|
22673
|
+
children: error
|
|
22674
|
+
}) : null,
|
|
22675
|
+
notice !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Notice, { children: notice }) : null
|
|
22676
|
+
]
|
|
22677
|
+
});
|
|
22678
|
+
}
|
|
22679
|
+
//#endregion
|
|
21619
22680
|
//#region src/client/secondary.tsx
|
|
21620
22681
|
/**
|
|
21621
|
-
* The pages behind "More": import sessions
|
|
21622
|
-
*
|
|
22682
|
+
* The pages behind "More": import sessions (or, while dsh-chat-import runs,
|
|
22683
|
+
* where its import is), settings (with what is added to new sessions, when
|
|
22684
|
+
* the Host reports it) and diagnostics.
|
|
21623
22685
|
* @module @kirkchinese/harness-forge/client
|
|
21624
22686
|
*/
|
|
22687
|
+
/** A row's key: a source's sessions can share a path (OpenCode's one database), never a source id. */
|
|
22688
|
+
function rowKey(session) {
|
|
22689
|
+
return `${session.source}\u0000${session.sourceId}`;
|
|
22690
|
+
}
|
|
22691
|
+
function sessionRowState(t, session, imported, busy) {
|
|
22692
|
+
const key = rowKey(session);
|
|
22693
|
+
const openId = imported[key] ?? session.importedId;
|
|
22694
|
+
const maybeId = openId === void 0 ? session.maybeImportedId : void 0;
|
|
22695
|
+
return {
|
|
22696
|
+
key,
|
|
22697
|
+
title: session.title ?? t("sessionUntitled"),
|
|
22698
|
+
...openId !== void 0 ? { openId } : {},
|
|
22699
|
+
...maybeId !== void 0 ? { maybeId } : {},
|
|
22700
|
+
importing: busy === key,
|
|
22701
|
+
...session.tooLarge === true ? { tooLarge: tooLargeText(t, session.bytes, session.limit ?? 0) } : {}
|
|
22702
|
+
};
|
|
22703
|
+
}
|
|
22704
|
+
/** Decimal megabytes, as the server's own messages say them. */
|
|
22705
|
+
function megabytes(bytes) {
|
|
22706
|
+
return bytes >= 1e9 ? `${(bytes / 1e9).toFixed(1)} GB` : `${Math.max(1, Math.round(bytes / 1e6))} MB`;
|
|
22707
|
+
}
|
|
22708
|
+
/** Why a session cannot be imported for its size, in the person's language; `size` is unknown for a compressed one cut off while decoding. */
|
|
22709
|
+
function tooLargeText(t, size, limit) {
|
|
22710
|
+
return size !== void 0 ? fill(t("sessionTooLarge"), {
|
|
22711
|
+
size: megabytes(size),
|
|
22712
|
+
limit: megabytes(limit)
|
|
22713
|
+
}) : fill(t("sessionTooLargeDecoded"), { limit: megabytes(limit) });
|
|
22714
|
+
}
|
|
22715
|
+
/** Why an import failed, in the person's language when the server said it with a code. */
|
|
22716
|
+
function importErrorText(t, cause) {
|
|
22717
|
+
if (cause instanceof CallError && cause.code === "harness-forge/session-too-large") {
|
|
22718
|
+
const { size, limit } = cause.details ?? {};
|
|
22719
|
+
if (typeof limit === "number") return tooLargeText(t, typeof size === "number" ? size : void 0, limit);
|
|
22720
|
+
}
|
|
22721
|
+
if (cause instanceof CallError && cause.code === "harness-forge/session-maybe-imported") return t("sessionMaybeImported");
|
|
22722
|
+
return messageOf(cause);
|
|
22723
|
+
}
|
|
21625
22724
|
function SessionsScreen({ t, openSession }) {
|
|
22725
|
+
const { status, reload } = useSessionImport();
|
|
22726
|
+
if (status?.provider === "dsh-chat-import") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChatImportProvided, { t });
|
|
22727
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [status !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22728
|
+
style: { marginBottom: 16 },
|
|
22729
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChatImportOffer, {
|
|
22730
|
+
t,
|
|
22731
|
+
status,
|
|
22732
|
+
reload
|
|
22733
|
+
})
|
|
22734
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ForgeSessions, {
|
|
22735
|
+
t,
|
|
22736
|
+
openSession
|
|
22737
|
+
})] });
|
|
22738
|
+
}
|
|
22739
|
+
/** Harness Forge's own import, while dsh-chat-import is not there. */
|
|
22740
|
+
function ForgeSessions({ t, openSession }) {
|
|
22741
|
+
const shown = usePath();
|
|
21626
22742
|
const [source, setSource] = (0, react.useState)("claude-code");
|
|
21627
22743
|
const [sessions, setSessions] = (0, react.useState)(void 0);
|
|
22744
|
+
const [next, setNext] = (0, react.useState)(void 0);
|
|
22745
|
+
const [more, setMore] = (0, react.useState)(false);
|
|
21628
22746
|
const [busy, setBusy] = (0, react.useState)(void 0);
|
|
21629
22747
|
const [imported, setImported] = (0, react.useState)({});
|
|
21630
22748
|
const [error, setError] = (0, react.useState)(void 0);
|
|
22749
|
+
const [notice, setNotice] = (0, react.useState)(void 0);
|
|
21631
22750
|
(0, react.useEffect)(() => {
|
|
21632
22751
|
let live = true;
|
|
21633
22752
|
setSessions(void 0);
|
|
22753
|
+
setNext(void 0);
|
|
21634
22754
|
setError(void 0);
|
|
21635
22755
|
call("sessions", { source }).then((result) => {
|
|
21636
|
-
if (live)
|
|
22756
|
+
if (live) {
|
|
22757
|
+
setSessions(result.sessions);
|
|
22758
|
+
setNext(result.next);
|
|
22759
|
+
}
|
|
21637
22760
|
}).catch((cause) => {
|
|
21638
22761
|
if (live) {
|
|
21639
22762
|
setSessions([]);
|
|
@@ -21644,21 +22767,59 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21644
22767
|
live = false;
|
|
21645
22768
|
};
|
|
21646
22769
|
}, [source]);
|
|
21647
|
-
const
|
|
21648
|
-
|
|
22770
|
+
const showMore = async () => {
|
|
22771
|
+
if (next === void 0) return;
|
|
22772
|
+
setMore(true);
|
|
22773
|
+
try {
|
|
22774
|
+
const result = await call("sessions", {
|
|
22775
|
+
source,
|
|
22776
|
+
cursor: next
|
|
22777
|
+
});
|
|
22778
|
+
setSessions((current) => [...current ?? [], ...result.sessions]);
|
|
22779
|
+
setNext(result.next);
|
|
22780
|
+
} catch (cause) {
|
|
22781
|
+
setError(messageOf(cause));
|
|
22782
|
+
} finally {
|
|
22783
|
+
setMore(false);
|
|
22784
|
+
}
|
|
22785
|
+
};
|
|
22786
|
+
/**
|
|
22787
|
+
* Open a session an import stored. DSH is asked to know it again first (workspace, live) and to take it out of
|
|
22788
|
+
* its archive: an archived session opens as an empty new-session page, so one that stays archived is not opened.
|
|
22789
|
+
*/
|
|
22790
|
+
const openOne = async (id) => {
|
|
22791
|
+
setError(void 0);
|
|
22792
|
+
setNotice(void 0);
|
|
22793
|
+
try {
|
|
22794
|
+
const opened = await call("openImported", { id });
|
|
22795
|
+
if (opened.archived) {
|
|
22796
|
+
setError(t("sessionStillArchived"));
|
|
22797
|
+
return;
|
|
22798
|
+
}
|
|
22799
|
+
if (opened.unarchived) setNotice(t("sessionUnarchived"));
|
|
22800
|
+
openSession(id);
|
|
22801
|
+
} catch (cause) {
|
|
22802
|
+
setError(messageOf(cause));
|
|
22803
|
+
}
|
|
22804
|
+
};
|
|
22805
|
+
/** Import a session; `targetId` imports it as a new session under that id. */
|
|
22806
|
+
const importOne = async (session, targetId) => {
|
|
22807
|
+
const key = rowKey(session);
|
|
22808
|
+
setBusy(key);
|
|
21649
22809
|
setError(void 0);
|
|
21650
22810
|
try {
|
|
21651
22811
|
const result = await call("importSession", {
|
|
21652
22812
|
path: session.path,
|
|
21653
|
-
source,
|
|
21654
|
-
sourceId: session.sourceId
|
|
22813
|
+
source: session.source,
|
|
22814
|
+
sourceId: session.sourceId,
|
|
22815
|
+
...targetId !== void 0 ? { targetId } : {}
|
|
21655
22816
|
});
|
|
21656
22817
|
setImported((current) => ({
|
|
21657
22818
|
...current,
|
|
21658
|
-
[
|
|
22819
|
+
[key]: result.id
|
|
21659
22820
|
}));
|
|
21660
22821
|
} catch (cause) {
|
|
21661
|
-
setError(
|
|
22822
|
+
setError(importErrorText(t, cause));
|
|
21662
22823
|
} finally {
|
|
21663
22824
|
setBusy(void 0);
|
|
21664
22825
|
}
|
|
@@ -21692,6 +22853,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21692
22853
|
kind: "error",
|
|
21693
22854
|
children: error
|
|
21694
22855
|
}) : null,
|
|
22856
|
+
notice !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Notice, { children: notice }) : null,
|
|
21695
22857
|
sessions === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21696
22858
|
className: "hf-empty",
|
|
21697
22859
|
children: t("sessionsLoading")
|
|
@@ -21701,41 +22863,86 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21701
22863
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
21702
22864
|
className: "hf-list",
|
|
21703
22865
|
children: sessions.map((session) => {
|
|
21704
|
-
const id = imported
|
|
22866
|
+
const { key, title, openId: id, maybeId: maybe, importing, tooLarge: sizeText } = sessionRowState(t, session, imported, busy);
|
|
21705
22867
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
21706
22868
|
className: "hf-item",
|
|
21707
22869
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21708
22870
|
className: "hf-item-head",
|
|
21709
22871
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21710
22872
|
className: "hf-item-main",
|
|
21711
|
-
children: [
|
|
21712
|
-
|
|
21713
|
-
|
|
21714
|
-
|
|
21715
|
-
|
|
21716
|
-
|
|
21717
|
-
|
|
22873
|
+
children: [
|
|
22874
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
22875
|
+
className: "hf-item-title",
|
|
22876
|
+
children: title
|
|
22877
|
+
}),
|
|
22878
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
22879
|
+
className: "hf-item-desc",
|
|
22880
|
+
children: [
|
|
22881
|
+
(session.updatedAt ?? session.createdAt) !== void 0 ? `${new Date(session.updatedAt ?? session.createdAt).toLocaleString()} · ` : "",
|
|
22882
|
+
session.archived === true ? `${t("sessionArchived")} · ` : "",
|
|
22883
|
+
shown(session.cwd ?? session.path)
|
|
22884
|
+
]
|
|
22885
|
+
}),
|
|
22886
|
+
sizeText !== void 0 && id === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
22887
|
+
className: "hf-item-desc",
|
|
22888
|
+
children: sizeText
|
|
22889
|
+
}) : null,
|
|
22890
|
+
maybe !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
22891
|
+
className: "hf-item-desc",
|
|
22892
|
+
children: t("sessionMaybeImported")
|
|
22893
|
+
}) : null
|
|
22894
|
+
]
|
|
21718
22895
|
}), id !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21719
22896
|
className: "hf-btn",
|
|
21720
22897
|
onClick: () => {
|
|
21721
|
-
|
|
22898
|
+
openOne(id);
|
|
21722
22899
|
},
|
|
21723
22900
|
children: t("openSession")
|
|
22901
|
+
}) : maybe !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
22902
|
+
className: "hf-form",
|
|
22903
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
22904
|
+
className: "hf-btn",
|
|
22905
|
+
onClick: () => {
|
|
22906
|
+
openOne(maybe);
|
|
22907
|
+
},
|
|
22908
|
+
children: t("sessionOpenExisting")
|
|
22909
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
22910
|
+
className: "hf-btn",
|
|
22911
|
+
disabled: busy !== void 0 || sizeText !== void 0,
|
|
22912
|
+
title: sizeText,
|
|
22913
|
+
onClick: () => {
|
|
22914
|
+
importOne(session, session.newId);
|
|
22915
|
+
},
|
|
22916
|
+
children: importing ? t("sessionImporting") : t("sessionImportAsNew")
|
|
22917
|
+
})]
|
|
21724
22918
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21725
22919
|
className: "hf-btn",
|
|
21726
|
-
disabled: busy !== void 0,
|
|
22920
|
+
disabled: busy !== void 0 || sizeText !== void 0,
|
|
22921
|
+
title: sizeText,
|
|
21727
22922
|
onClick: () => {
|
|
21728
22923
|
importOne(session);
|
|
21729
22924
|
},
|
|
21730
|
-
children:
|
|
22925
|
+
children: importing ? t("sessionImporting") : t("sessionImport")
|
|
21731
22926
|
})]
|
|
21732
22927
|
})
|
|
21733
|
-
},
|
|
22928
|
+
}, key);
|
|
21734
22929
|
})
|
|
21735
|
-
})
|
|
22930
|
+
}),
|
|
22931
|
+
next !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22932
|
+
style: { marginTop: 12 },
|
|
22933
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
22934
|
+
className: "hf-btn",
|
|
22935
|
+
disabled: more,
|
|
22936
|
+
onClick: () => {
|
|
22937
|
+
showMore();
|
|
22938
|
+
},
|
|
22939
|
+
children: more ? t("sessionsLoading") : t("sessionsMore")
|
|
22940
|
+
})
|
|
22941
|
+
}) : null
|
|
21736
22942
|
] });
|
|
21737
22943
|
}
|
|
21738
22944
|
function ContextSection({ t }) {
|
|
22945
|
+
const shown = usePath();
|
|
21739
22946
|
const [status, setStatus] = (0, react.useState)(void 0);
|
|
21740
22947
|
const [error, setError] = (0, react.useState)(void 0);
|
|
21741
22948
|
(0, react.useEffect)(() => {
|
|
@@ -21767,6 +22974,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21767
22974
|
kind: "error",
|
|
21768
22975
|
children: error
|
|
21769
22976
|
}) : null,
|
|
22977
|
+
status?.stopped !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Notice, {
|
|
22978
|
+
kind: "error",
|
|
22979
|
+
children: status.stopped
|
|
22980
|
+
}) : null,
|
|
21770
22981
|
status === void 0 ? null : status.yieldingTo !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21771
22982
|
className: "hf-card",
|
|
21772
22983
|
children: fill(t("contextYielding"), { name: status.yieldingTo })
|
|
@@ -21783,7 +22994,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21783
22994
|
children: t("contextActive")
|
|
21784
22995
|
}), status.files.map((file) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21785
22996
|
className: "hf-code",
|
|
21786
|
-
children: file.path
|
|
22997
|
+
children: shown(file.path)
|
|
21787
22998
|
}, file.path))]
|
|
21788
22999
|
}),
|
|
21789
23000
|
hostFiles.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -21794,7 +23005,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21794
23005
|
children: t("contextHost")
|
|
21795
23006
|
}), hostFiles.map((file) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21796
23007
|
className: "hf-code",
|
|
21797
|
-
children: file.path
|
|
23008
|
+
children: shown(file.path)
|
|
21798
23009
|
}, file.path))]
|
|
21799
23010
|
}) : null
|
|
21800
23011
|
]
|
|
@@ -21808,6 +23019,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21808
23019
|
};
|
|
21809
23020
|
/** The workspaces trusted here or dismissed with "Not now", each reversible. */
|
|
21810
23021
|
function TrustSection({ t, onChanged }) {
|
|
23022
|
+
const shown = usePath();
|
|
21811
23023
|
const [records, setRecords] = (0, react.useState)(void 0);
|
|
21812
23024
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
21813
23025
|
const [error, setError] = (0, react.useState)(void 0);
|
|
@@ -21892,7 +23104,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21892
23104
|
className: "hf-item-main",
|
|
21893
23105
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21894
23106
|
className: "hf-item-title hf-code",
|
|
21895
|
-
children: record.workspace
|
|
23107
|
+
children: shown(record.workspace)
|
|
21896
23108
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21897
23109
|
className: "hf-item-desc",
|
|
21898
23110
|
children: [record.trusted ? t("trustStateTrusted") : record.dismissed ? t("trustStateDismissed") : t("trustStateUndecided"), others.length > 0 ? ` · ${fill(t("trustAlsoBy"), { list: others.join(", ") })}` : ""]
|
|
@@ -21920,9 +23132,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21920
23132
|
});
|
|
21921
23133
|
}
|
|
21922
23134
|
function SettingsScreen({ t, onSaved }) {
|
|
23135
|
+
const shown = usePath();
|
|
23136
|
+
const shownText = useText();
|
|
21923
23137
|
const [roots, setRoots] = (0, react.useState)("");
|
|
21924
23138
|
const [autoDiscover, setAutoDiscover] = (0, react.useState)(true);
|
|
21925
23139
|
const [missing, setMissing] = (0, react.useState)([]);
|
|
23140
|
+
const [skipped, setSkipped] = (0, react.useState)([]);
|
|
21926
23141
|
const [saving, setSaving] = (0, react.useState)(false);
|
|
21927
23142
|
const [error, setError] = (0, react.useState)(void 0);
|
|
21928
23143
|
const [notice, setNotice] = (0, react.useState)(void 0);
|
|
@@ -21932,6 +23147,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21932
23147
|
setRoots(view.settings.discoveryRoots.join("\n"));
|
|
21933
23148
|
setAutoDiscover(view.settings.autoDiscover);
|
|
21934
23149
|
setMissing(view.missingRoots);
|
|
23150
|
+
setSkipped((view.warnings ?? []).map((warning) => warning.message));
|
|
21935
23151
|
} catch (cause) {
|
|
21936
23152
|
setError(messageOf(cause));
|
|
21937
23153
|
}
|
|
@@ -21986,8 +23202,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21986
23202
|
missing.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21987
23203
|
className: "hf-muted",
|
|
21988
23204
|
style: { marginTop: 6 },
|
|
21989
|
-
children: fill(t("missingRoots"), { list: missing.join(", ") })
|
|
23205
|
+
children: fill(t("missingRoots"), { list: missing.map(shown).join(", ") })
|
|
21990
23206
|
}) : null,
|
|
23207
|
+
skipped.map((message) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23208
|
+
className: "hf-muted",
|
|
23209
|
+
style: { marginTop: 6 },
|
|
23210
|
+
children: fill(t("discoverySkipped"), { message: shownText(message) })
|
|
23211
|
+
}, message)),
|
|
21991
23212
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
21992
23213
|
className: "hf-form",
|
|
21993
23214
|
style: {
|
|
@@ -22036,7 +23257,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22036
23257
|
dsh: "DSH",
|
|
22037
23258
|
node: "Node.js"
|
|
22038
23259
|
};
|
|
23260
|
+
/** A value with the home folder shown as `~` in every string it holds, for the technical details. */
|
|
23261
|
+
function withHomeShown(value, home) {
|
|
23262
|
+
if (typeof value === "string") return displayText(value, home);
|
|
23263
|
+
if (Array.isArray(value)) return value.map((item) => withHomeShown(item, home));
|
|
23264
|
+
if (typeof value === "object" && value !== null) return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, withHomeShown(item, home)]));
|
|
23265
|
+
return value;
|
|
23266
|
+
}
|
|
22039
23267
|
function DiagnosticsScreen({ t }) {
|
|
23268
|
+
const home = (0, react.useContext)(HomeContext);
|
|
23269
|
+
const shown = usePath();
|
|
23270
|
+
const shownText = useText();
|
|
22040
23271
|
const [value, setValue] = (0, react.useState)(void 0);
|
|
22041
23272
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
22042
23273
|
const [error, setError] = (0, react.useState)(void 0);
|
|
@@ -22087,7 +23318,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22087
23318
|
value.faults.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22088
23319
|
className: "hf-card",
|
|
22089
23320
|
style: { marginTop: 8 },
|
|
22090
|
-
children: t("diagRowsOk")
|
|
23321
|
+
children: t(value.failedMounts.length === 0 ? "diagAllOk" : "diagRowsOk")
|
|
22091
23322
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
22092
23323
|
className: "hf-card",
|
|
22093
23324
|
style: { marginTop: 8 },
|
|
@@ -22104,7 +23335,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22104
23335
|
" ",
|
|
22105
23336
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
22106
23337
|
className: "hf-code",
|
|
22107
|
-
children: fault.message
|
|
23338
|
+
children: shownText(fault.message)
|
|
22108
23339
|
})
|
|
22109
23340
|
]
|
|
22110
23341
|
}, index))]
|
|
@@ -22117,16 +23348,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22117
23348
|
fontSize: 13,
|
|
22118
23349
|
marginBottom: 6
|
|
22119
23350
|
},
|
|
22120
|
-
children: t("diagFailedMounts")
|
|
23351
|
+
children: fill(t("diagFailedMounts"), { n: value.failedMounts.length })
|
|
22121
23352
|
}), value.failedMounts.map((mount, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
22122
23353
|
className: "hf-reason",
|
|
22123
23354
|
children: [
|
|
22124
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: mount.
|
|
22125
|
-
" ",
|
|
22126
|
-
|
|
23355
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: mount.plugin ?? mount.pluginId }),
|
|
23356
|
+
" · ",
|
|
23357
|
+
mountLabel(mount, t),
|
|
23358
|
+
mount.error.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22127
23359
|
className: "hf-code",
|
|
22128
|
-
children: mount.error
|
|
22129
|
-
})
|
|
23360
|
+
children: shownText(mount.error)
|
|
23361
|
+
}) : null
|
|
22130
23362
|
]
|
|
22131
23363
|
}, index))]
|
|
22132
23364
|
}) : null
|
|
@@ -22138,10 +23370,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22138
23370
|
className: "hf-facts",
|
|
22139
23371
|
children: [
|
|
22140
23372
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("diagBash") }),
|
|
22141
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: value.hookShell.bash
|
|
23373
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: value.hookShell.bash === null ? t("diagMissing") : shown(value.hookShell.bash) }),
|
|
22142
23374
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("diagPowershell") }),
|
|
22143
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: value.hookShell.powershell }),
|
|
22144
|
-
value.bun !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("diagBun") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: value.bun
|
|
23375
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: shown(value.hookShell.powershell) }),
|
|
23376
|
+
value.bun !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("diagBun") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: value.bun === null ? t("diagBunMissing") : shown(value.bun) })] }) : null
|
|
22145
23377
|
]
|
|
22146
23378
|
})
|
|
22147
23379
|
}),
|
|
@@ -22167,7 +23399,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22167
23399
|
className: "hf-details",
|
|
22168
23400
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("diagDetails") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22169
23401
|
className: "hf-brief",
|
|
22170
|
-
children: JSON.stringify(value, null, 2)
|
|
23402
|
+
children: JSON.stringify(withHomeShown(value, home), null, 2)
|
|
22171
23403
|
})]
|
|
22172
23404
|
})
|
|
22173
23405
|
] })
|
|
@@ -22185,6 +23417,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22185
23417
|
const NS = "harnessForge";
|
|
22186
23418
|
const PANEL_ID = "harness-forge";
|
|
22187
23419
|
const INTRO_KEY = "harness-forge.intro-dismissed";
|
|
23420
|
+
/**
|
|
23421
|
+
* How often the page asks again while migrated plugins are still being applied: applying one takes about a second
|
|
23422
|
+
* (72 took some 70 s at startup), so the count moves visibly without asking more often than it can change.
|
|
23423
|
+
*/
|
|
23424
|
+
const APPLYING_POLL_MS = 2e3;
|
|
22188
23425
|
/** Services the browser half needs before apply runs. */
|
|
22189
23426
|
const inject = [
|
|
22190
23427
|
"slots",
|
|
@@ -22221,6 +23458,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22221
23458
|
return false;
|
|
22222
23459
|
}
|
|
22223
23460
|
}
|
|
23461
|
+
/**
|
|
23462
|
+
* "More" with a name of its own: DSH's sidebar has a "More" button too, and assistive technology and tests that
|
|
23463
|
+
* go by the name must tell the two apart. The visible text stays short.
|
|
23464
|
+
*/
|
|
22224
23465
|
function MoreMenu({ t, onPick }) {
|
|
22225
23466
|
const [open, setOpen] = (0, react.useState)(false);
|
|
22226
23467
|
const box = (0, react.useRef)(null);
|
|
@@ -22244,6 +23485,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22244
23485
|
style: { position: "relative" },
|
|
22245
23486
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
22246
23487
|
className: "hf-btn",
|
|
23488
|
+
"aria-label": t("moreActions"),
|
|
22247
23489
|
"aria-haspopup": "menu",
|
|
22248
23490
|
"aria-expanded": open,
|
|
22249
23491
|
onClick: () => {
|
|
@@ -22278,22 +23520,48 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22278
23520
|
}) : null]
|
|
22279
23521
|
});
|
|
22280
23522
|
}
|
|
23523
|
+
/** "Back" from a secondary screen, named for Harness Forge (DSH's own chrome has a "Back" too). */
|
|
23524
|
+
function BackButton({ t, onClick }) {
|
|
23525
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
23526
|
+
className: "hf-btn hf-btn-link hf-back",
|
|
23527
|
+
"aria-label": t("backLabel"),
|
|
23528
|
+
onClick,
|
|
23529
|
+
children: ["← ", t("back")]
|
|
23530
|
+
});
|
|
23531
|
+
}
|
|
22281
23532
|
function HarnessPage({ t }) {
|
|
22282
23533
|
const [screen, setScreen] = (0, react.useState)("discover");
|
|
22283
23534
|
const [harnesses, setHarnesses] = (0, react.useState)(void 0);
|
|
23535
|
+
const [fetched, setFetched] = (0, react.useState)([]);
|
|
22284
23536
|
const [workspaces, setWorkspaces] = (0, react.useState)([]);
|
|
22285
23537
|
const [signInWaiting, setSignInWaiting] = (0, react.useState)([]);
|
|
22286
23538
|
const [error, setError] = (0, react.useState)(void 0);
|
|
23539
|
+
const [home, setHome] = (0, react.useState)(void 0);
|
|
23540
|
+
/** A migration just added parts that act at the start of a session: said once, until the person goes elsewhere. */
|
|
23541
|
+
const [startNote, setStartNote] = (0, react.useState)(false);
|
|
23542
|
+
const [workbenchOff, setWorkbenchOff] = (0, react.useState)(false);
|
|
22287
23543
|
const [loading, setLoading] = (0, react.useState)(false);
|
|
23544
|
+
const [applying, setApplying] = (0, react.useState)(void 0);
|
|
22288
23545
|
const [introDismissed, setIntroDismissed] = (0, react.useState)(readDismissed);
|
|
23546
|
+
const sessionImport = useSessionImport();
|
|
23547
|
+
/** Read the overview; the plugins it lists, or nothing when it could not be read. */
|
|
22289
23548
|
const load = (0, react.useCallback)(async () => {
|
|
22290
23549
|
setLoading(true);
|
|
23550
|
+
let listed;
|
|
22291
23551
|
try {
|
|
22292
23552
|
const overview = await call("overview");
|
|
23553
|
+
setHome(overview.home);
|
|
22293
23554
|
setHarnesses(overview.harnesses);
|
|
23555
|
+
setApplying(overview.applying);
|
|
23556
|
+
setFetched(overview.fetched ?? []);
|
|
22294
23557
|
setWorkspaces(overview.workspaces ?? []);
|
|
22295
23558
|
setError(void 0);
|
|
23559
|
+
listed = [...overview.harnesses.flatMap((harness) => harness.items), ...overview.fetched ?? []];
|
|
22296
23560
|
} catch (cause) {
|
|
23561
|
+
if (isWorkbenchOff(cause)) {
|
|
23562
|
+
setWorkbenchOff(true);
|
|
23563
|
+
return;
|
|
23564
|
+
}
|
|
22297
23565
|
setError(messageOf(cause));
|
|
22298
23566
|
} finally {
|
|
22299
23567
|
setLoading(false);
|
|
@@ -22303,18 +23571,40 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22303
23571
|
}, () => {
|
|
22304
23572
|
setSignInWaiting([]);
|
|
22305
23573
|
});
|
|
23574
|
+
return listed;
|
|
22306
23575
|
}, []);
|
|
22307
23576
|
(0, react.useEffect)(() => {
|
|
22308
23577
|
load();
|
|
22309
23578
|
}, [load]);
|
|
23579
|
+
(0, react.useEffect)(() => {
|
|
23580
|
+
setStartNote(false);
|
|
23581
|
+
}, [screen]);
|
|
23582
|
+
(0, react.useEffect)(() => {
|
|
23583
|
+
if (applying === void 0) return;
|
|
23584
|
+
const timer = setTimeout(() => {
|
|
23585
|
+
load();
|
|
23586
|
+
}, APPLYING_POLL_MS);
|
|
23587
|
+
return () => {
|
|
23588
|
+
clearTimeout(timer);
|
|
23589
|
+
};
|
|
23590
|
+
}, [applying, load]);
|
|
22310
23591
|
const dismissIntro = () => {
|
|
22311
23592
|
setIntroDismissed(true);
|
|
22312
23593
|
try {
|
|
22313
23594
|
globalThis.localStorage?.setItem(INTRO_KEY, "1");
|
|
22314
23595
|
} catch {}
|
|
22315
23596
|
};
|
|
22316
|
-
const items = (harnesses ?? []).flatMap((harness) => harness.items);
|
|
23597
|
+
const items = [...(harnesses ?? []).flatMap((harness) => harness.items), ...fetched];
|
|
22317
23598
|
const migrated = items.filter((item) => item.installed);
|
|
23599
|
+
const afterMigration = async () => {
|
|
23600
|
+
const before = new Set(migrated.map((item) => item.id));
|
|
23601
|
+
setStartNote(false);
|
|
23602
|
+
const after = await load();
|
|
23603
|
+
if (after !== void 0 && hasSessionStartPart(newlyMigrated(before, after))) setStartNote(true);
|
|
23604
|
+
};
|
|
23605
|
+
const reload = async () => {
|
|
23606
|
+
await load();
|
|
23607
|
+
};
|
|
22318
23608
|
const gapCount = items.reduce((sum, item) => sum + item.parts.filter(isGap).length, 0);
|
|
22319
23609
|
const counts = {
|
|
22320
23610
|
discover: 0,
|
|
@@ -22322,120 +23612,151 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22322
23612
|
gaps: gapCount
|
|
22323
23613
|
};
|
|
22324
23614
|
const secondary = SECONDARY.find(([value]) => value === screen);
|
|
22325
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
23615
|
+
if (workbenchOff) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
22326
23616
|
className: "hf-page",
|
|
22327
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: CSS$1 }), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
23617
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: CSS$1 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22328
23618
|
className: "hf-column",
|
|
22329
|
-
children:
|
|
22330
|
-
|
|
22331
|
-
|
|
22332
|
-
|
|
22333
|
-
|
|
22334
|
-
|
|
22335
|
-
|
|
22336
|
-
|
|
22337
|
-
|
|
22338
|
-
|
|
22339
|
-
|
|
23619
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23620
|
+
className: "hf-empty",
|
|
23621
|
+
role: "alert",
|
|
23622
|
+
children: t("workbenchOff")
|
|
23623
|
+
})
|
|
23624
|
+
})]
|
|
23625
|
+
});
|
|
23626
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HomeContext.Provider, {
|
|
23627
|
+
value: home,
|
|
23628
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
23629
|
+
className: "hf-page",
|
|
23630
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: CSS$1 }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
23631
|
+
className: "hf-column",
|
|
23632
|
+
children: [
|
|
23633
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
23634
|
+
className: "hf-head",
|
|
23635
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
23636
|
+
style: { minWidth: 0 },
|
|
23637
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
23638
|
+
className: "hf-title",
|
|
23639
|
+
children: t("title")
|
|
23640
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
23641
|
+
className: "hf-subtitle",
|
|
23642
|
+
children: t("subtitle")
|
|
23643
|
+
})]
|
|
23644
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
23645
|
+
className: "hf-actions",
|
|
23646
|
+
children: [secondary === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
23647
|
+
className: "hf-btn",
|
|
23648
|
+
disabled: loading,
|
|
23649
|
+
onClick: () => {
|
|
23650
|
+
load();
|
|
23651
|
+
},
|
|
23652
|
+
children: t("refresh")
|
|
23653
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MoreMenu, {
|
|
23654
|
+
t,
|
|
23655
|
+
onPick: setScreen
|
|
23656
|
+
})]
|
|
22340
23657
|
})]
|
|
22341
|
-
}),
|
|
22342
|
-
|
|
22343
|
-
|
|
22344
|
-
|
|
22345
|
-
|
|
22346
|
-
|
|
22347
|
-
|
|
23658
|
+
}),
|
|
23659
|
+
!introDismissed && secondary === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
23660
|
+
className: "hf-intro",
|
|
23661
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
23662
|
+
style: {
|
|
23663
|
+
flex: 1,
|
|
23664
|
+
minWidth: 0
|
|
22348
23665
|
},
|
|
22349
|
-
children: t("
|
|
22350
|
-
|
|
22351
|
-
|
|
22352
|
-
|
|
23666
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("intro") }), sessionImport.status?.provider === "harness-forge" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23667
|
+
style: { marginTop: 10 },
|
|
23668
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChatImportOffer, {
|
|
23669
|
+
t,
|
|
23670
|
+
status: sessionImport.status,
|
|
23671
|
+
reload: sessionImport.reload
|
|
23672
|
+
})
|
|
23673
|
+
}) : null]
|
|
23674
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
23675
|
+
className: "hf-btn",
|
|
23676
|
+
onClick: dismissIntro,
|
|
23677
|
+
children: t("introDismiss")
|
|
22353
23678
|
})]
|
|
22354
|
-
})
|
|
22355
|
-
|
|
22356
|
-
|
|
22357
|
-
className: "hf-intro",
|
|
22358
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("intro") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
22359
|
-
className: "hf-btn",
|
|
22360
|
-
onClick: dismissIntro,
|
|
22361
|
-
children: t("introDismiss")
|
|
22362
|
-
})]
|
|
22363
|
-
}) : null,
|
|
22364
|
-
secondary !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
22365
|
-
className: "hf-btn hf-btn-link hf-back",
|
|
22366
|
-
onClick: () => {
|
|
22367
|
-
setScreen("discover");
|
|
22368
|
-
},
|
|
22369
|
-
children: ["← ", t("back")]
|
|
22370
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
22371
|
-
className: "hf-title",
|
|
22372
|
-
style: {
|
|
22373
|
-
fontSize: 16,
|
|
22374
|
-
margin: "4px 0 12px"
|
|
22375
|
-
},
|
|
22376
|
-
children: t(secondary[1])
|
|
22377
|
-
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22378
|
-
className: "hf-tabs",
|
|
22379
|
-
role: "tablist",
|
|
22380
|
-
children: MAIN.map(([value, label]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
22381
|
-
role: "tab",
|
|
22382
|
-
className: "hf-tab",
|
|
22383
|
-
"aria-selected": screen === value,
|
|
23679
|
+
}) : null,
|
|
23680
|
+
secondary !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BackButton, {
|
|
23681
|
+
t,
|
|
22384
23682
|
onClick: () => {
|
|
22385
|
-
setScreen(
|
|
23683
|
+
setScreen("discover");
|
|
23684
|
+
}
|
|
23685
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
23686
|
+
className: "hf-title",
|
|
23687
|
+
style: {
|
|
23688
|
+
fontSize: 16,
|
|
23689
|
+
margin: "4px 0 12px"
|
|
22386
23690
|
},
|
|
22387
|
-
children:
|
|
22388
|
-
|
|
22389
|
-
|
|
22390
|
-
|
|
22391
|
-
|
|
22392
|
-
|
|
22393
|
-
|
|
22394
|
-
|
|
22395
|
-
|
|
22396
|
-
|
|
22397
|
-
|
|
22398
|
-
|
|
22399
|
-
|
|
22400
|
-
|
|
22401
|
-
|
|
22402
|
-
|
|
22403
|
-
|
|
22404
|
-
|
|
22405
|
-
|
|
22406
|
-
|
|
22407
|
-
|
|
22408
|
-
harnesses,
|
|
22409
|
-
|
|
22410
|
-
|
|
22411
|
-
|
|
22412
|
-
t,
|
|
22413
|
-
|
|
22414
|
-
|
|
22415
|
-
|
|
22416
|
-
|
|
22417
|
-
|
|
22418
|
-
|
|
22419
|
-
|
|
22420
|
-
|
|
22421
|
-
|
|
22422
|
-
|
|
22423
|
-
|
|
22424
|
-
|
|
22425
|
-
|
|
22426
|
-
|
|
22427
|
-
|
|
22428
|
-
|
|
22429
|
-
|
|
22430
|
-
|
|
22431
|
-
|
|
22432
|
-
|
|
22433
|
-
|
|
22434
|
-
|
|
22435
|
-
|
|
22436
|
-
|
|
22437
|
-
|
|
22438
|
-
|
|
23691
|
+
children: t(secondary[1])
|
|
23692
|
+
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23693
|
+
className: "hf-tabs",
|
|
23694
|
+
role: "tablist",
|
|
23695
|
+
children: MAIN.map(([value, label]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
23696
|
+
role: "tab",
|
|
23697
|
+
className: "hf-tab",
|
|
23698
|
+
"aria-selected": screen === value,
|
|
23699
|
+
onClick: () => {
|
|
23700
|
+
setScreen(value);
|
|
23701
|
+
},
|
|
23702
|
+
children: [t(label), counts[value] > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
23703
|
+
className: "hf-count",
|
|
23704
|
+
children: counts[value]
|
|
23705
|
+
}) : null]
|
|
23706
|
+
}, value))
|
|
23707
|
+
}),
|
|
23708
|
+
error !== void 0 && secondary === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Notice, {
|
|
23709
|
+
kind: "error",
|
|
23710
|
+
children: error
|
|
23711
|
+
}) : null,
|
|
23712
|
+
secondary === void 0 && harnesses === void 0 && error === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23713
|
+
className: "hf-empty",
|
|
23714
|
+
children: t("loading")
|
|
23715
|
+
}) : null,
|
|
23716
|
+
applying !== void 0 && (screen === "discover" || screen === "migrated") ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Notice, { children: fill(t("applying"), {
|
|
23717
|
+
done: applying.done,
|
|
23718
|
+
total: applying.total
|
|
23719
|
+
}) }) : null,
|
|
23720
|
+
startNote && screen === "discover" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Notice, { children: t("startsInNewSessions") }) : null,
|
|
23721
|
+
screen === "discover" || screen === "migrated" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TrustBanners, {
|
|
23722
|
+
t,
|
|
23723
|
+
workspaces,
|
|
23724
|
+
reload
|
|
23725
|
+
}) : null,
|
|
23726
|
+
harnesses !== void 0 && screen === "discover" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DiscoverScreen, {
|
|
23727
|
+
t,
|
|
23728
|
+
harnesses,
|
|
23729
|
+
reload: afterMigration
|
|
23730
|
+
}) : null,
|
|
23731
|
+
harnesses !== void 0 && screen === "migrated" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MigratedScreen, {
|
|
23732
|
+
t,
|
|
23733
|
+
items: migrated,
|
|
23734
|
+
signInWaiting,
|
|
23735
|
+
reload
|
|
23736
|
+
}) : null,
|
|
23737
|
+
harnesses !== void 0 && screen === "gaps" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GapsScreen, {
|
|
23738
|
+
t,
|
|
23739
|
+
items,
|
|
23740
|
+
openSession,
|
|
23741
|
+
language: activeLanguage(),
|
|
23742
|
+
reload: () => {
|
|
23743
|
+
load();
|
|
23744
|
+
}
|
|
23745
|
+
}) : null,
|
|
23746
|
+
screen === "sessions" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionsScreen, {
|
|
23747
|
+
t,
|
|
23748
|
+
openSession
|
|
23749
|
+
}) : null,
|
|
23750
|
+
screen === "settings" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsScreen, {
|
|
23751
|
+
t,
|
|
23752
|
+
onSaved: () => {
|
|
23753
|
+
load();
|
|
23754
|
+
}
|
|
23755
|
+
}) : null,
|
|
23756
|
+
screen === "diagnostics" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DiagnosticsScreen, { t }) : null
|
|
23757
|
+
]
|
|
23758
|
+
})]
|
|
23759
|
+
})
|
|
22439
23760
|
});
|
|
22440
23761
|
}
|
|
22441
23762
|
function HarnessIcon({ size = 18 }) {
|
|
@@ -22477,7 +23798,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22477
23798
|
locale: NS,
|
|
22478
23799
|
label: () => t("panel")
|
|
22479
23800
|
}, HarnessIcon));
|
|
22480
|
-
registerModsDock(ctx);
|
|
23801
|
+
registerModsDock(ctx, t);
|
|
22481
23802
|
(async () => {
|
|
22482
23803
|
try {
|
|
22483
23804
|
const context = ctx;
|
|
@@ -22493,6 +23814,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22493
23814
|
})();
|
|
22494
23815
|
}
|
|
22495
23816
|
//#endregion
|
|
23817
|
+
exports.BackButton = BackButton;
|
|
23818
|
+
exports.MoreMenu = MoreMenu;
|
|
22496
23819
|
exports.apply = apply;
|
|
22497
23820
|
exports.inject = inject;
|
|
22498
23821
|
return module.exports;
|