Files
deepseek-harness/packages/boot/plugin-market/tests/parse-worker.spec.ts
T
turtle1999 3de3a977e0 feat(plugin-market): add the Custom plugin markets bundle and Discover tab
Read configured plugin market indexes on the Host, search them with fuzzy
multilingual matching, and install a chosen version from the Plugins page.

- dsh-plugin-market-index validates format-1 indexes and builds install
  arguments; inline icons are capped at 32 KiB.
- The pluginMarket service fetches configured http(s) URLs, parses bodies in
  a Worker Thread, caches documents, and pages filtered, ordered results with
  installation status and engines.dsh compatibility.
- Discover is an opt-in experimental bundle; the Plugins page gains a
  plugins.tab slot and confirmed installs.
- The plugin_market tool lists indexes, plugins, and versions for Creator mode.
- Plugin compatibility reads engines.dsh before DSH peer dependencies.
2026-10-15 05:37:44 +08:00

15 lines
751 B
TypeScript

/** The source-mode parse Worker, run end to end. */
import { expect, it } from 'vitest'
import { parseIndexInWorker } from '../src/parse-thread.ts'
const URL_A = 'https://market.example/index.json'
const bytes = (text: string): Uint8Array => new TextEncoder().encode(text)
it('parses a body in a Worker and transfers its buffer', async () => {
const body = bytes(JSON.stringify({ format: 1, title: 'M', plugins: [] }))
const result = await parseIndexInWorker(body, URL_A, new AbortController().signal)
expect(result).toMatchObject({ ok: true, index: { title: 'M', plugins: [] } })
expect(body.byteLength).toBe(0)
expect(await parseIndexInWorker(bytes('{'), URL_A, new AbortController().signal)).toMatchObject({ ok: false, path: '$' })
})