chore(sync): re-base the fork onto upstream dsh-better-sidebar v0.19.1

The fork was pinned at upstream v0.18.0. That is the entire reason the window
ran TWO sidebars and TWO near-identical panel toggles: DSH 2.0.10 ships its own
right sidebar (@deepseek-ai/dsh-client-ui-sidebar-right), and upstream only
adopted it in v0.19.0-alpha.1 — which arrived after our fork point. v0.19.1 is
also the one upstream line whose support range actually matches our host
(engines.dsh >=0.1.5-rc.1, 14 DSH peers ^0.1.5-rc.1, host = 0.1.5-rc.2), so it
is the only tag the host's startup precheck accepts.

What upstream v0.18.0 → v0.19.1 brings
- src/client/native/{index,surface,tab-adapter}.tsx: every tab the plugin can
  draw becomes an OFFICIAL native tab type + body, and an external plugin's
  descriptor registered later gets its native type too. This is what retires
  the fork's own right panel — and with it the duplicate toggle cluster
  (`toggleCluster` is gone from v0.19.1).
- native tab-chip icons via the `sidebar.right.pane.tab.title` seat, coloured
  built-in tab icons, file/folder glyphs from DSH's own `FileTypeIcon`.
- guide descriptions (DSH renders them while the guide lists <= 4 entries),
  tab bodies that fill the panel, and the 0.1.5-rc.2 adaptation work we were
  carrying by hand (peer/devDep pinning, primitives' transitive devDeps).

How the sync was done
Rebuilt the tree from the v0.19.1 tag rather than resolving 53 conflicted
files: our v0.18.0 delta was measured first and is only (a) one mechanical
rename `dsh-better-sidebar` -> `dsh-apes-sidebar` and (b) ten real edits. So:
tag tree + rename (scoped: code/config/scripts/tests/README, while the 46
historical docs/plans records and switch.sh's upstream package name stay
untouched) + re-applied deltas + our apes module.

Fork deltas re-applied on the new base
- src/client/apes/ (icons / locales / tabs): the three apes:* information-layer
  tabs (agents / apps / profile), registered through the same BetterSidebarService
  as the builtins — which is exactly why they now ride upstream's native adapter
  into the official sidebar for free.
- identity: package.json (name/version 1.2.0/description/forkedFrom), dsh.plugin.json
  (id/version), SIDEBAR_SERVICE_VERSION 1.2.0, README fork notice,
  docs/external-plugin-guide.md.
- scripts/switch.sh + the pnpm switch* scripts (apes <-> upstream two-line switch).
- tests/apes-tabs.spec.ts (unescaped: it starts from the v0.19.1 base).

Dropped
- the Phase A native-registration spike (`apes/native-tabs.tsx` + its spec): it
  re-derived by hand exactly what upstream's native layer already does — the
  hand-written bridge is dead weight now, and v0.19.1's own e2e/jsdom lanes
  cover the same seat contract far better.
- the unused apesProfileGuideDesc key and the two package.json.bak.* backups.

Verified on the new base: typecheck clean; build clean; 1351 passed / 9 skipped
(128 files), up from 1255 on the old base.
This commit is contained in:
figmar
2026-10-03 22:51:09 +08:00
parent 8753096a58
commit 5a7e2139a0
90 changed files with 1483 additions and 796 deletions
+122
View File
@@ -0,0 +1,122 @@
/**
* apes:* tab registration tests (Phase 1/1b, C6: 3 tabs). The fork registers
* its three information-layer tabs (agents / apps / profile) through the same
* BetterSidebarService the upstream builtins use (dogfood). `apes:tasks` was
* removed in C6 — it overlaps the official DSH session tree in the native
* sidebar. The spec pins the registration contract (id / single / order /
* component presence) and the isolated i18n contract (the apes namespace
* resolves zh vs en through the attached locale service, and every apesZh
* key has an apesEn entry).
*
* Runs in the node vitest environment like builtins.spec.ts — no DOM, no
* real DSH host (a live cordis scratch mount is Phase 2+).
*/
import { describe, expect, it } from 'vitest'
// Browser globals before the client graph loads (mirror of builtins.spec.ts).
import './browser-globals.ts'
import type { Context } from '../src/context-types.ts'
import { createBetterSidebarService } from '../src/client/service.ts'
import { createSidebarStore } from '../src/client/state.ts'
import { registerApesTabs } from '../src/client/apes/index.ts'
import { apesZh, apesEn, attachApesLocale, t, type ApesCopyKey } from '../src/client/apes/locales.ts'
function setup(): {
service: ReturnType<typeof createBetterSidebarService>
store: ReturnType<typeof createSidebarStore>
dispose: () => void
} {
const store = createSidebarStore()
const service = createBetterSidebarService(store)
const dispose = registerApesTabs({} as Context, service)
return { service, store, dispose }
}
describe('apes:* tab registrations', () => {
it('registers the 3 apes tabs with the apes: namespace', () => {
const { service, dispose } = setup()
try {
expect(service.getTabs().map(t => t.id).sort()).toEqual(
['apes:agents', 'apes:apps', 'apes:profile'],
)
} finally {
dispose()
}
})
it('every apes tab is single-instance, visible, and component-carrying', () => {
const { service, dispose } = setup()
try {
for (const id of ['apes:agents', 'apes:apps', 'apes:profile']) {
const tab = service.getTab(id)
expect(tab, `${id} registered`).toBeDefined()
expect(tab?.single, `${id} single`).toBe(true)
expect(tab?.hidden, `${id} hidden`).not.toBe(true)
expect(tab?.component, `${id} component`).toBeDefined()
expect(tab?.icon, `${id} icon`).toBeDefined()
}
} finally {
dispose()
}
})
it('apes tabs sort after the upstream builtins (order 40+)', () => {
const { service, dispose } = setup()
try {
const orders = {
agents: service.getTab('apes:agents')?.order,
apps: service.getTab('apes:apps')?.order,
profile: service.getTab('apes:profile')?.order,
}
// C8: order 40-50 places apes tabs immediately after the native builtins
// (10-35), not in a far-away 900+ band — visual unity in the tab strip.
expect(orders.agents).toBeGreaterThanOrEqual(40)
expect(orders.apps).toBeGreaterThanOrEqual(40)
expect(orders.profile).toBeGreaterThanOrEqual(40)
// Strictly ordered: agents < apps < profile.
expect(orders.agents!).toBeLessThan(orders.apps!)
expect(orders.apps!).toBeLessThan(orders.profile!)
} finally {
dispose()
}
})
it('the disposer unregisters all apes tabs (HMR-safe)', () => {
const store = createSidebarStore()
const service = createBetterSidebarService(store)
const dispose = registerApesTabs({} as Context, service)
expect(service.getTabs()).toHaveLength(3)
dispose()
expect(service.getTabs()).toHaveLength(0)
})
})
describe('apes i18n contract', () => {
it('every apesZh key has an apesEn entry (no missing translations)', () => {
const zhKeys = Object.keys(apesZh) as ApesCopyKey[]
for (const key of zhKeys) {
expect(apesEn[key], `en entry for ${key}`).toBeDefined()
expect(typeof apesEn[key]).toBe('string')
expect((apesEn[key] ?? '').length).toBeGreaterThan(0)
}
})
it('resolves zh when the DSH preference is zh', () => {
attachApesLocale({ getSnapshot: () => ({ active: 'zh-CN' }) })
expect(t('apesAgentsTitle')).toBe('智能体')
expect(t('apesAppsTitle')).toBe('应用')
expect(t('apesProfileTitle')).toBe('画像')
})
it('resolves en when the DSH preference is en', () => {
attachApesLocale({ getSnapshot: () => ({ active: 'en' }) })
expect(t('apesAgentsTitle')).toBe('Agents')
expect(t('apesAppsTitle')).toBe('Apps')
expect(t('apesProfileTitle')).toBe('Profile')
})
it('falls back to zh when no locale service is attached', () => {
attachApesLocale(undefined)
expect(t('apesAgentsTitle')).toBe('智能体')
})
})
+1 -1
View File
@@ -8,7 +8,7 @@
*
* Mirrors the "external consumer" fixture: what is importable here from
* `../src/client/service.ts` must also be importable from
* `dsh-better-sidebar/client/service` in the built package.
* `dsh-apes-sidebar/client/service` in the built package.
*/
import type {} from '../src/client/service.ts'
import {
+10 -10
View File
@@ -10,7 +10,7 @@
* (the same `workspace.create` / `session.create` calls the UI makes),
* so the sidebar has a real session to render;
* 2. loads the page in headless Chromium and asserts the shell and the
* plugin's `[data-dsh-better-sidebar]` host mount;
* plugin's `[data-dsh-apes-sidebar]` host mount;
* 3. asserts the plugin's crash markers never appear (no RenderBoundary /
* fail() strips, no `pageerror`, no plugin-prefixed console errors);
* 4. expands DSH's native right Sidebar, sweeps every built-in tab type
@@ -54,7 +54,7 @@ const SEEDED_README_FILE = 'readme-style.md'
* renders a strip whose text starts with these prefixes instead of crashing
* (see src/client/index.tsx `fail()` and src/client/RenderBoundary.tsx).
*/
const CRASH_STRIP_PATTERNS = [/^dsh-better-sidebar:/, /^\[dsh-better-sidebar\]/]
const CRASH_STRIP_PATTERNS = [/^dsh-apes-sidebar:/, /^\[dsh-apes-sidebar\]/]
/** Built-in tab titles the sweep drives (en-US copy; follows DSH locale). */
const NATIVE_TABS = ['files', 'git', 'subagent', 'sidechat', 'terminal', 'browser']
@@ -150,7 +150,7 @@ test('plugin mounts into the DSH shell and survives a built-in tab sweep', async
})
// Load the shell. The app renders into #root; the plugin appends its own
// [data-dsh-better-sidebar] host once its client half activates.
// [data-dsh-apes-sidebar] host once its client half activates.
//
// The editor chunk (client-editor.js) loads as soon as ANY files-window tab
// renders — the seeded home tab mounts the moment the panel expands, long
@@ -162,7 +162,7 @@ test('plugin mounts into the DSH shell and survives a built-in tab sweep', async
)
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
const sidebar = page.locator('[data-dsh-better-sidebar]')
const sidebar = page.locator('[data-dsh-apes-sidebar]')
await expect(sidebar).toBeAttached({ timeout: 90_000 })
// The unified panel host: the fixed containing block every panel lives in
// (data-dsh-panel-host). Its presence is part of the injection contract.
@@ -249,7 +249,7 @@ test('plugin mounts into the DSH shell and survives a built-in tab sweep', async
}).map((node) => (node.textContent ?? '').trim()),
CRASH_STRIP_PATTERNS,
)
expect(stripTexts, 'a dsh-better-sidebar error strip is present in the sidebar').toEqual([])
expect(stripTexts, 'a dsh-apes-sidebar error strip is present in the sidebar').toEqual([])
}
// The native Sidebar's way in lives in the conversation header's corner,
@@ -550,7 +550,7 @@ test('plugin mounts into the DSH shell and survives a built-in tab sweep', async
// The plugin's own console prefix must never appear in errors, and no
// unhandled rejection may escape the sweep.
const pluginErrors = consoleErrors.filter((text) => /dsh-better-sidebar|Unhandled/.test(text))
const pluginErrors = consoleErrors.filter((text) => /dsh-apes-sidebar|Unhandled/.test(text))
expect(pluginErrors, 'plugin-prefixed or unhandled console errors during the sweep').toEqual([])
expect(pageErrors, 'pageerrors during the sweep').toEqual([])
@@ -566,7 +566,7 @@ test('conservative auto: URL stamps alone never modify the layout; plugin chrome
// semantics) — the strip/body attribute appear only for real standard
// geometry (see the WCO scenario below) or an opt-in preset.
await gotoPage(page, { 'dsh-desktop-mode': 'advanced', 'dsh-desktop-platform': 'win32' })
await expect(page.locator('[data-dsh-better-sidebar]')).toBeAttached({ timeout: 90_000 })
await expect(page.locator('[data-dsh-apes-sidebar]')).toBeAttached({ timeout: 90_000 })
await expect(
page.locator('body[data-dsh-title-bar-compat]'),
'stamps alone must NOT auto-enable title-bar compatibility under auto',
@@ -616,7 +616,7 @@ test('standard WCO geometry drives the strip reactively (issue #257)', async ({
}
})
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
await expect(page.locator('[data-dsh-better-sidebar]')).toBeAttached({ timeout: 90_000 })
await expect(page.locator('[data-dsh-apes-sidebar]')).toBeAttached({ timeout: 90_000 })
// Real reported height (36px, not a hardcoded 32) drives the strip.
await expect(page.locator('body[data-dsh-title-bar-compat]')).toBeAttached({ timeout: 90_000 })
await expect
@@ -643,7 +643,7 @@ test('opt-in shell preset applies its strip when WCO is absent (data-driven, man
expect(update.ok(), `settings.update: ${update.status()}`).toBe(true)
try {
await gotoPage(page, { 'dsh-desktop-mode': 'advanced', 'dsh-desktop-platform': 'win32' })
await expect(page.locator('[data-dsh-better-sidebar]')).toBeAttached({ timeout: 90_000 })
await expect(page.locator('[data-dsh-apes-sidebar]')).toBeAttached({ timeout: 90_000 })
await expect(page.locator('body[data-dsh-title-bar-compat]')).toBeAttached({ timeout: 90_000 })
await expect
.poll(() => page.evaluate(() => document.documentElement.style.getPropertyValue('--dsh-title-bar-strip')))
@@ -668,7 +668,7 @@ test('custom scheme injects the user stylesheet live', async ({ request, page })
expect(update.ok(), `settings.update: ${update.status()}`).toBe(true)
try {
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
await expect(page.locator('[data-dsh-better-sidebar]')).toBeAttached({ timeout: 90_000 })
await expect(page.locator('[data-dsh-apes-sidebar]')).toBeAttached({ timeout: 90_000 })
await expect(page.locator('style[data-dsh-custom-css="custom"]')).toBeAttached()
// The injected CSS is live (a custom property the page can read back).
const marker = await page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue('--dsh-e2e-marker').trim())
+6 -6
View File
@@ -5,7 +5,7 @@
* It exists to put NUMBERS on the sidebar's client-side cost in a real
* mounted `dsh web` (the same scratch-profile boot as scripts/e2e-mount.sh):
*
* 1. mount latency — navigationStart → `[data-dsh-better-sidebar]`
* 1. mount latency — navigationStart → `[data-dsh-apes-sidebar]`
* attached, sampled by an init-script probe (rAF loop, so it catches
* the attach even before Playwright's first poll);
* 2. longtasks — every >50ms main-thread task from first paint
@@ -63,7 +63,7 @@ const PERF_PROBE = `(() => {
for (const entry of list.getEntries()) perf.longtasks.push({ start: entry.startTime, duration: entry.duration })
}).observe({ entryTypes: ['longtask'] })
const check = () => {
if (document.querySelector('[data-dsh-better-sidebar]') !== null) { perf.mountAt = performance.now(); return }
if (document.querySelector('[data-dsh-apes-sidebar]') !== null) { perf.mountAt = performance.now(); return }
requestAnimationFrame(check)
}
requestAnimationFrame(check)
@@ -114,7 +114,7 @@ test('measure: mount latency, longtasks and bundle cost through a full tab sweep
await page.addInitScript(PERF_PROBE)
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
const sidebar = page.locator('[data-dsh-better-sidebar]')
const sidebar = page.locator('[data-dsh-apes-sidebar]')
await expect(sidebar).toBeAttached({ timeout: 90_000 })
const mountLatency = await page.evaluate(() =>
@@ -183,7 +183,7 @@ test('measure: bottom-strip drag frame pacing', async ({ page }) => {
await page.addInitScript(PERF_PROBE)
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
const sidebar = page.locator('[data-dsh-better-sidebar]')
const sidebar = page.locator('[data-dsh-apes-sidebar]')
await expect(sidebar).toBeAttached({ timeout: 90_000 })
await dismissOnboarding(page)
@@ -227,7 +227,7 @@ test('measure: bottom-strip drag frame pacing', async ({ page }) => {
await expect
.poll(async () => {
const probe = await page.evaluate(() => {
const bottom = document.querySelector('[data-dsh-better-sidebar] [data-dsh-bottom-panel]')
const bottom = document.querySelector('[data-dsh-apes-sidebar] [data-dsh-bottom-panel]')
if (bottom === null) return null
const strip = [...bottom.querySelectorAll<HTMLElement>('*')].find(el => getComputedStyle(el).cursor === 'row-resize')
if (strip === undefined) return null
@@ -239,7 +239,7 @@ test('measure: bottom-strip drag frame pacing', async ({ page }) => {
}, { timeout: 30_000 })
.toBeLessThanOrEqual(8)
const stripPoint = await page.evaluate(() => {
const bottom = document.querySelector('[data-dsh-better-sidebar] [data-dsh-bottom-panel]')
const bottom = document.querySelector('[data-dsh-apes-sidebar] [data-dsh-bottom-panel]')
if (bottom === null) return null
const strip = [...bottom.querySelectorAll<HTMLElement>('*')].find(el => getComputedStyle(el).cursor === 'row-resize')
if (strip === undefined) return null
+2 -2
View File
@@ -1,7 +1,7 @@
# Fixture aggregate bundle: mounts dsh-better-sidebar under its own entry id,
# Fixture aggregate bundle: mounts dsh-apes-sidebar under its own entry id,
# the way real aggregate bundles (e.g. @linxin666/dsh-web-ui-all) do. Used by
# scripts/e2e-aggregate-mount.sh to prove the plugin's own bundle patch backs
# off when another enabled entry already mounts the same package.
- insert:
- id: aggregate-better-sidebar
name: 'dsh-better-sidebar'
name: 'dsh-apes-sidebar'
+2 -2
View File
@@ -6,9 +6,9 @@ import { join, resolve } from 'node:path'
import { parseWorktreeList, resolveWorktree, status, worktrees } from '../src/git.ts'
const IDENTITY = {
GIT_AUTHOR_NAME: 'dsh-better-sidebar-test',
GIT_AUTHOR_NAME: 'dsh-apes-sidebar-test',
GIT_AUTHOR_EMAIL: 'test@dsh.invalid',
GIT_COMMITTER_NAME: 'dsh-better-sidebar-test',
GIT_COMMITTER_NAME: 'dsh-apes-sidebar-test',
GIT_COMMITTER_EMAIL: 'test@dsh.invalid',
}
+1 -1
View File
@@ -20,7 +20,7 @@ const canonical = (path: string): string => normalizePath(realpathSync.native(pa
describe('git parsing', () => {
it('discovers and selects direct child repositories under a workspace directory', async () => {
const workspace = await mkdtemp(join(tmpdir(), 'dsh-better-sidebar-git-'))
const workspace = await mkdtemp(join(tmpdir(), 'dsh-apes-sidebar-git-'))
const first = join(workspace, 'first-repo')
const second = join(workspace, 'second-repo')
try {
+2 -2
View File
@@ -60,7 +60,7 @@ function assertInMemoryInvocation(executable: string): void {
const output = `${result.stdout}\n${result.stderr}`
expect(result.status, output).toBe(0)
expect(output).toContain('dsh-better-sidebar@0.11.0')
expect(output).toContain('dsh-apes-sidebar@0.11.0')
expect(output).toContain('[dry-run]')
expect(output).not.toContain('False False')
}
@@ -126,7 +126,7 @@ describe('PowerShell installer entry points', { timeout: 30_000 }, () => {
const output = `${result.stdout}\n${result.stderr}`
expect(result.status, output).toBe(0)
expect(output).toContain('dsh-better-sidebar@0.11.0')
expect(output).toContain('dsh-apes-sidebar@0.11.0')
expect(output).toContain('[dry-run]')
})
+4 -4
View File
@@ -210,9 +210,9 @@ describe('registerNativeSurface lifecycle (service-driven registration)', () =>
}
runInjected?.()
expect(registered.map(entry => entry.kind).sort()).toEqual(['browser', 'editor', 'files', 'terminal'])
expect(registered.map(entry => entry.id)).toContain('dsh-better-sidebar:files')
expect(slotKeys).toContain('dsh-better-sidebar:terminal')
expect(slotKeys).toContain('dsh-better-sidebar:files')
expect(registered.map(entry => entry.id)).toContain('dsh-apes-sidebar:files')
expect(slotKeys).toContain('dsh-apes-sidebar:terminal')
expect(slotKeys).toContain('dsh-apes-sidebar:files')
// A resource tab is titled by the FILE it shows (the descriptor's own
// title would make every open file look identical in the strip), while a
@@ -261,7 +261,7 @@ describe('NativeTabBody full-height host wrapper', () => {
// definite height, not a flex container — our tab roots (`flex: 1;
// min-height: 0`) collapse there without a column-flex wrapper of
// height:100%. The stable `data-dsh-native-tab-host` marker (mirroring
// `data-dsh-better-sidebar`) lets the e2e lane assert the fill; this
// `data-dsh-apes-sidebar`) lets the e2e lane assert the fill; this
// unit check pins the structure: the marker wrapper exists and the
// descriptor's output is INSIDE it (before the fix the component was
// rendered bare, with no wrapper at all).
+3 -3
View File
@@ -8,7 +8,7 @@ import * as sidebar from '../src/index.ts'
* the official plugin repos ship (dsh-external/turtle-ui,
* packages/ui/jsonrpc).
*/
describe('dsh-better-sidebar plugin export shape', () => {
describe('dsh-apes-sidebar plugin export shape', () => {
it('has the namespace-plugin export shape (no stray default) so the Loader keeps name/inject/Config/apply', () => {
expect('default' in sidebar).toBe(false)
expect(typeof sidebar.apply).toBe('function')
@@ -16,7 +16,7 @@ describe('dsh-better-sidebar plugin export shape', () => {
const loader = Object.create(Loader.prototype) as Loader
const unwrapped = loader.unwrapExports(sidebar) as Record<string, unknown>
expect(unwrapped).toBe(sidebar)
expect(unwrapped.name).toBe('dsh-better-sidebar')
expect(unwrapped.name).toBe('dsh-apes-sidebar')
expect(unwrapped.inject).toEqual(['webServer', 'sessions', 'webRuntime', 'tools'])
expect(unwrapped.Config).toBeDefined()
expect(typeof unwrapped.apply).toBe('function')
@@ -53,7 +53,7 @@ describe('dsh-better-sidebar plugin export shape', () => {
it('registers the side card preferences schema with the documented defaults', async () => {
const { PrefsSchema, SIDEBAR_PREFS_NS, SIDEBAR_PREFS_DEFAULTS } = await import('../src/config.ts')
expect(SIDEBAR_PREFS_NS).toBe('dsh-better-sidebar')
expect(SIDEBAR_PREFS_NS).toBe('dsh-apes-sidebar')
const resolved = (PrefsSchema as unknown as {
(input: Record<string, unknown> | undefined): Record<string, unknown>
})(undefined)
+6 -6
View File
@@ -114,12 +114,12 @@ describe('findProfileDir / findPluginRoot', () => {
beforeEach(() => {
root = mkdtempSync(join(tmpdir(), 'pty-deps-'))
// A fake plugin module deep inside the profile's pnpm node_modules.
const pkgRoot = join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-better-sidebar@0.0.0', 'node_modules', 'dsh-better-sidebar')
const pkgRoot = join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-apes-sidebar@0.0.0', 'node_modules', 'dsh-apes-sidebar')
const libDir = join(pkgRoot, 'lib')
mkdirSync(libDir, { recursive: true })
writeFileSync(join(root, 'profiles', 'web', 'package.json'), JSON.stringify({ name: 'dsh-profile-web' }))
writeFileSync(join(root, 'profiles', 'web', 'pnpm-workspace.yaml'), '')
writeFileSync(join(pkgRoot, 'package.json'), JSON.stringify({ name: 'dsh-better-sidebar' }))
writeFileSync(join(pkgRoot, 'package.json'), JSON.stringify({ name: 'dsh-apes-sidebar' }))
moduleFile = join(libDir, 'index.js')
writeFileSync(moduleFile, '')
})
@@ -131,7 +131,7 @@ describe('findProfileDir / findPluginRoot', () => {
})
it('walks up to the plugin package root by package.json name', () => {
expect(findPluginRoot(moduleFile)).toBe(realpathSync(join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-better-sidebar@0.0.0', 'node_modules', 'dsh-better-sidebar')))
expect(findPluginRoot(moduleFile)).toBe(realpathSync(join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-apes-sidebar@0.0.0', 'node_modules', 'dsh-apes-sidebar')))
})
it('falls back to $DSH_HOME/profiles/web when no ancestor looks like a profile', () => {
@@ -161,12 +161,12 @@ describe('depsStatus', () => {
beforeEach(() => {
root = mkdtempSync(join(tmpdir(), 'pty-deps-'))
const pkgRoot = join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-better-sidebar@0.0.0', 'node_modules', 'dsh-better-sidebar')
const pkgRoot = join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-apes-sidebar@0.0.0', 'node_modules', 'dsh-apes-sidebar')
mkdirSync(join(pkgRoot, 'scripts'), { recursive: true })
mkdirSync(join(pkgRoot, 'lib'), { recursive: true })
writeFileSync(join(root, 'profiles', 'web', 'package.json'), JSON.stringify({ name: 'dsh-profile-web' }))
writeFileSync(join(root, 'profiles', 'web', 'pnpm-workspace.yaml'), '')
writeFileSync(join(pkgRoot, 'package.json'), JSON.stringify({ name: 'dsh-better-sidebar' }))
writeFileSync(join(pkgRoot, 'package.json'), JSON.stringify({ name: 'dsh-apes-sidebar' }))
writeFileSync(join(pkgRoot, 'scripts', 'install.sh'), '#!/usr/bin/env bash\n')
writeFileSync(join(pkgRoot, 'scripts', 'install.ps1'), '# repair fixture\n')
moduleFile = join(pkgRoot, 'lib', 'index.js')
@@ -190,7 +190,7 @@ describe('depsStatus', () => {
if (status.ok) throw new Error('unreachable')
expect(status.cause).toBe('Cannot find package node-pty')
const scriptName = process.platform === 'win32' ? 'install.ps1' : 'install.sh'
const script = realpathSync(join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-better-sidebar@0.0.0', 'node_modules', 'dsh-better-sidebar', 'scripts', scriptName))
const script = realpathSync(join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-apes-sidebar@0.0.0', 'node_modules', 'dsh-apes-sidebar', 'scripts', scriptName))
expect(status.command).toBe(process.platform === 'win32'
? `powershell -ExecutionPolicy Bypass -File "${script}" -Repair -Profile "web"`
: `bash "${script}" --repair --profile "web"`)
+1 -1
View File
@@ -399,7 +399,7 @@ function threadLog(): Array<ReturnType<typeof ev>> {
ev('turn/end', 1, { turn: 0, reason: { kind: 'completed' } }),
ev('session/end-seed', 2),
ev('subagent/descriptor', 3, { mode: 'continuable' }),
ev('user/message', 4, { content: [{ type: 'text', text: 'Side conversation boundary.' }], source: { kind: 'plugin', plugin: 'dsh-better-sidebar' } }),
ev('user/message', 4, { content: [{ type: 'text', text: 'Side conversation boundary.' }], source: { kind: 'plugin', plugin: 'dsh-apes-sidebar' } }),
ev('user/message', 5, { content: [{ type: 'text', text: 'the side question' }], source: { kind: 'user' } }),
ev('assistant/attempt', 6, { turn: 1, step: 1, stream: [] }),
ev('assistant/attempt', 7, { turn: 1, step: 1, stream: [] }),
+3 -3
View File
@@ -393,9 +393,9 @@ describe('host plugin smoke', () => {
*/
describe('git destructive operations (scratch repository)', () => {
const FIXTURE_IDENTITY = {
GIT_AUTHOR_NAME: 'dsh-better-sidebar-test',
GIT_AUTHOR_NAME: 'dsh-apes-sidebar-test',
GIT_AUTHOR_EMAIL: 'test@dsh.invalid',
GIT_COMMITTER_NAME: 'dsh-better-sidebar-test',
GIT_COMMITTER_NAME: 'dsh-apes-sidebar-test',
GIT_COMMITTER_EMAIL: 'test@dsh.invalid',
}
@@ -949,7 +949,7 @@ describe('side card settings routes', () => {
it('shell.get reflects the settings-page override with the quotes stripped', async () => {
const route = mountWithSettings(createFakeSettings({
'dsh-better-sidebar': {
'dsh-apes-sidebar': {
terminalShell: '"C:\\Program Files\\PowerShell\\7\\pwsh.exe"',
terminalShellArgs: '-NoLogo',
},
+1 -1
View File
@@ -25,7 +25,7 @@ setupReactAct()
const deps = {
ok: false as const,
cause: 'Cannot find package node-pty',
command: 'bash "/Users/u/.dsh/profiles/web/node_modules/.pnpm/dsh-better-sidebar@0.0.0/node_modules/dsh-better-sidebar/scripts/install.sh" --repair --profile "web"',
command: 'bash "/Users/u/.dsh/profiles/web/node_modules/.pnpm/dsh-apes-sidebar@0.0.0/node_modules/dsh-apes-sidebar/scripts/install.sh" --repair --profile "web"',
profile: 'web',
}
+1 -1
View File
@@ -98,7 +98,7 @@ describe('turn-tail interception registration (issue #15)', () => {
const { options, component } = fake.registered[0]!
expect(options.name).toBe('conversation.chat.turnTail')
expect(options.priority).toBe(-1)
expect(options.registrant).toBe('dsh-better-sidebar')
expect(options.registrant).toBe('dsh-apes-sidebar')
expect(options.select).toBeTypeOf('function')
expect(options.inject).toBeTypeOf('function')
expect(component).toBeTypeOf('function')