fmt(js): npm run fix on merge (#107454)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
248ff2d3e8
commit
110736c0bc
@@ -110,7 +110,10 @@ describe('reconcileUnifiedDesktopHalves', () => {
|
||||
JSON.stringify({ catalog_name: 'cat', repo: 'https://github.com/o/cat.git', sha: 'deadbeef' })
|
||||
)
|
||||
write(path.join(home, 'plugins', 'raw', 'desktop', 'plugin.js'), 'y')
|
||||
write(path.join(home, 'plugins', 'raw', '.git', 'config'), '[core]\n\tbare = false\n[remote "origin"]\n\turl = file:///srv/raw.git\n\tfetch = +refs/heads/*:refs/remotes/origin/*\n')
|
||||
write(
|
||||
path.join(home, 'plugins', 'raw', '.git', 'config'),
|
||||
'[core]\n\tbare = false\n[remote "origin"]\n\turl = file:///srv/raw.git\n\tfetch = +refs/heads/*:refs/remotes/origin/*\n'
|
||||
)
|
||||
|
||||
await reconcileUnifiedDesktopHalves(home, appRoot)
|
||||
|
||||
|
||||
@@ -141,7 +141,12 @@ export function registerFsIpc({
|
||||
return { ok: false, error: 'identifier is required' }
|
||||
}
|
||||
|
||||
return installDesktopPluginFromGit(resolveGitBinary(), identifier, await desktopPluginsRoot(), Boolean(payload?.force))
|
||||
return installDesktopPluginFromGit(
|
||||
resolveGitBinary(),
|
||||
identifier,
|
||||
await desktopPluginsRoot(),
|
||||
Boolean(payload?.force)
|
||||
)
|
||||
})
|
||||
|
||||
// Rename a file/folder in place. The renderer passes the existing path + a new
|
||||
|
||||
@@ -66,7 +66,14 @@ describe('PluginsTab', () => {
|
||||
media: { id: 'media', name: 'Media Studio', kind: 'disk', status: 'loaded', packageName: 'hermes-media-studio' }
|
||||
})
|
||||
$agentPlugins.set([
|
||||
{ description: '', key: 'hermes-media-studio', name: 'hermes-media-studio', source: 'git', status: 'disabled', version: '1' }
|
||||
{
|
||||
description: '',
|
||||
key: 'hermes-media-studio',
|
||||
name: 'hermes-media-studio',
|
||||
source: 'git',
|
||||
status: 'disabled',
|
||||
version: '1'
|
||||
}
|
||||
])
|
||||
|
||||
render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import { useStore } from '@nanostores/react'
|
||||
import { memo, type ReactNode, type PointerEvent as ReactPointerEvent, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import {
|
||||
memo,
|
||||
type ReactNode,
|
||||
type PointerEvent as ReactPointerEvent,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState
|
||||
} from 'react'
|
||||
|
||||
import { useGatewayRequest } from '@/app/gateway/hooks/use-gateway-request'
|
||||
import { Button } from '@/components/ui/button'
|
||||
@@ -276,71 +284,71 @@ function PackageRow({
|
||||
lacks shows a dash; a half it has but which is missing on this side
|
||||
shows the install affordance. */}
|
||||
<HalfCell label={p.halfDesktop}>
|
||||
{desktop ? (
|
||||
<Switch
|
||||
aria-label={`${p.halfDesktop}: ${pkg.name}`}
|
||||
checked={desktopOn}
|
||||
onCheckedChange={on => {
|
||||
triggerHaptic('selection')
|
||||
void setPluginEnabled(desktop.id, on)
|
||||
}}
|
||||
/>
|
||||
) : pkg.desktopMissing ? (
|
||||
<Tip label={p.desktopHalfPendingTip}>
|
||||
<span className="text-[0.65rem] text-(--ui-text-tertiary)">{p.desktopHalfPending}</span>
|
||||
</Tip>
|
||||
) : (
|
||||
<Dash />
|
||||
)}
|
||||
{desktop ? (
|
||||
<Switch
|
||||
aria-label={`${p.halfDesktop}: ${pkg.name}`}
|
||||
checked={desktopOn}
|
||||
onCheckedChange={on => {
|
||||
triggerHaptic('selection')
|
||||
void setPluginEnabled(desktop.id, on)
|
||||
}}
|
||||
/>
|
||||
) : pkg.desktopMissing ? (
|
||||
<Tip label={p.desktopHalfPendingTip}>
|
||||
<span className="text-[0.65rem] text-(--ui-text-tertiary)">{p.desktopHalfPending}</span>
|
||||
</Tip>
|
||||
) : (
|
||||
<Dash />
|
||||
)}
|
||||
</HalfCell>
|
||||
|
||||
<HalfCell label={p.halfAgentIn(scopeLabel)}>
|
||||
{agent ? (
|
||||
<>
|
||||
{agent.update_available && (
|
||||
<Button
|
||||
className="h-5 px-1.5 text-[0.65rem]"
|
||||
disabled={busy}
|
||||
onClick={() => onAgentUpdate(agent)}
|
||||
size="xs"
|
||||
variant="outline"
|
||||
>
|
||||
{p.updateToPin(agent.catalog_sha?.slice(0, 8) ?? '')}
|
||||
</Button>
|
||||
)}
|
||||
{busy && <Loader2 className="size-3.5 animate-spin text-(--ui-text-tertiary)" />}
|
||||
{agentToggleable ? (
|
||||
<Switch
|
||||
aria-label={`${p.halfAgent}: ${pkg.name}`}
|
||||
checked={agentOn}
|
||||
disabled={busy}
|
||||
onCheckedChange={on => onAgentToggle(agent, on)}
|
||||
/>
|
||||
) : (
|
||||
<Tip label={p.legacyBackend}>
|
||||
<span>
|
||||
<Switch aria-label={`${p.halfAgent}: ${pkg.name}`} checked={agentOn} disabled />
|
||||
</span>
|
||||
</Tip>
|
||||
)}
|
||||
</>
|
||||
) : pkg.agentMissingInProfile && desktop ? (
|
||||
<Tip label={desktop.packageOrigin?.repo ? p.installAgentHereTip(scopeLabel) : p.installAgentHereNoOrigin}>
|
||||
<span>
|
||||
<Button
|
||||
className="h-5 px-1.5 text-[0.65rem]"
|
||||
disabled={!desktop.packageOrigin?.repo}
|
||||
onClick={() => installAgentHalfHere(desktop, scope)}
|
||||
size="xs"
|
||||
variant="outline"
|
||||
>
|
||||
{p.installAgentHere}
|
||||
</Button>
|
||||
</span>
|
||||
</Tip>
|
||||
) : (
|
||||
<Dash />
|
||||
)}
|
||||
{agent ? (
|
||||
<>
|
||||
{agent.update_available && (
|
||||
<Button
|
||||
className="h-5 px-1.5 text-[0.65rem]"
|
||||
disabled={busy}
|
||||
onClick={() => onAgentUpdate(agent)}
|
||||
size="xs"
|
||||
variant="outline"
|
||||
>
|
||||
{p.updateToPin(agent.catalog_sha?.slice(0, 8) ?? '')}
|
||||
</Button>
|
||||
)}
|
||||
{busy && <Loader2 className="size-3.5 animate-spin text-(--ui-text-tertiary)" />}
|
||||
{agentToggleable ? (
|
||||
<Switch
|
||||
aria-label={`${p.halfAgent}: ${pkg.name}`}
|
||||
checked={agentOn}
|
||||
disabled={busy}
|
||||
onCheckedChange={on => onAgentToggle(agent, on)}
|
||||
/>
|
||||
) : (
|
||||
<Tip label={p.legacyBackend}>
|
||||
<span>
|
||||
<Switch aria-label={`${p.halfAgent}: ${pkg.name}`} checked={agentOn} disabled />
|
||||
</span>
|
||||
</Tip>
|
||||
)}
|
||||
</>
|
||||
) : pkg.agentMissingInProfile && desktop ? (
|
||||
<Tip label={desktop.packageOrigin?.repo ? p.installAgentHereTip(scopeLabel) : p.installAgentHereNoOrigin}>
|
||||
<span>
|
||||
<Button
|
||||
className="h-5 px-1.5 text-[0.65rem]"
|
||||
disabled={!desktop.packageOrigin?.repo}
|
||||
onClick={() => installAgentHalfHere(desktop, scope)}
|
||||
size="xs"
|
||||
variant="outline"
|
||||
>
|
||||
{p.installAgentHere}
|
||||
</Button>
|
||||
</span>
|
||||
</Tip>
|
||||
) : (
|
||||
<Dash />
|
||||
)}
|
||||
</HalfCell>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -86,7 +86,9 @@ describe('scanDiskPlugins (#66899)', () => {
|
||||
|
||||
if (dir === '/local/.hermes/desktop-plugins/my-feature') {
|
||||
return {
|
||||
entries: [{ isDirectory: false, name: 'README.md', path: '/local/.hermes/desktop-plugins/my-feature/README.md' }]
|
||||
entries: [
|
||||
{ isDirectory: false, name: 'README.md', path: '/local/.hermes/desktop-plugins/my-feature/README.md' }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +124,6 @@ describe('scanDiskPlugins (#66899)', () => {
|
||||
expect($pluginRecords.get().odd).toBeUndefined()
|
||||
})
|
||||
|
||||
|
||||
it('loads a unified desktop half (app-root copy + package marker) OPT-IN and tags it with its package', async () => {
|
||||
desktopPluginsRoot.mockResolvedValue('/local/.hermes/desktop-plugins')
|
||||
let desktopEntryPresent = true
|
||||
|
||||
@@ -1513,8 +1513,7 @@ export const en: Translations = {
|
||||
agentTitle: 'Agent plugins',
|
||||
agentBlurb:
|
||||
'Extend the agent for the selected profile — tools, hooks, providers. Take effect after a gateway restart.',
|
||||
pageBlurb:
|
||||
'One row per plugin. A plugin can extend this app, the agent, or both — each half has its own switch.',
|
||||
pageBlurb: 'One row per plugin. A plugin can extend this app, the agent, or both — each half has its own switch.',
|
||||
halfDesktop: 'Desktop',
|
||||
halfDesktopHint: 'this app, same for every profile',
|
||||
halfAgent: 'Agent',
|
||||
|
||||
@@ -1693,8 +1693,10 @@ export const zh: Translations = {
|
||||
kindDesktop: '桌面',
|
||||
kindBoth: 'Agent + 桌面',
|
||||
installAgentHere: '在此安装',
|
||||
installAgentHereTip: (profile: string) => `桌面部分已加载到本应用,但 agent 部分尚未安装到 ${profile}。在那里安装它。`,
|
||||
installAgentHereNoOrigin: '此配置未安装 agent 部分,且该包是手动复制的(无目录条目或 git 远程),无法从此处安装。请将其文件夹复制到该配置或从 Git 重新安装。',
|
||||
installAgentHereTip: (profile: string) =>
|
||||
`桌面部分已加载到本应用,但 agent 部分尚未安装到 ${profile}。在那里安装它。`,
|
||||
installAgentHereNoOrigin:
|
||||
'此配置未安装 agent 部分,且该包是手动复制的(无目录条目或 git 远程),无法从此处安装。请将其文件夹复制到该配置或从 Git 重新安装。',
|
||||
desktopHalfPending: '复制中…',
|
||||
desktopHalfPendingTip: '此包附带的桌面部分尚未复制到应用中。请重新扫描或重启应用。',
|
||||
emptyAll: '还没有插件。',
|
||||
|
||||
Reference in New Issue
Block a user