feat(bundle): ship dsh-base, dsh-web-app, and dsh-headless profile bundles
Profile bundles are npm packages declaring dsh.patch in their manifest: dsh-base carries the former base.cordis.yml rows as one insert over the empty profile root; dsh-web-app carries the web overlay plus a runtime glue plugin owning what used to be launcher code (frontend dist resolution via frontend-static, the web-surface prompt section, bash runtime variables, the readiness-gated URL line); dsh-headless carries the one-shot runner driving a task turn through the in-process API carrier under the launcher-provided ctx.headlessIo seam.
This commit is contained in:
23
packages/bundle/base/tests/base.spec.ts
Normal file
23
packages/bundle/base/tests/base.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* The bundle's substance is its patch file: the convenience export must point
|
||||
* at the real, parseable patch list the `dsh.patch` manifest field declares.
|
||||
*/
|
||||
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import * as yaml from 'js-yaml'
|
||||
import { entryListSchema } from '@cordisjs/plugin-include'
|
||||
import { patchPath } from '../src/index.ts'
|
||||
|
||||
describe('dsh-base bundle', () => {
|
||||
it('exports the path of a parseable patch list matching the manifest declaration', () => {
|
||||
const manifest = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')) as { dsh?: { patch?: string } }
|
||||
expect(manifest.dsh?.patch).toBe('./cordis.patch.yml')
|
||||
const parsed = yaml.load(readFileSync(patchPath, 'utf8'), { schema: entryListSchema })
|
||||
expect(Array.isArray(parsed)).toBe(true)
|
||||
// The base layer is one insert list over the empty profile root.
|
||||
const rows = (parsed as { insert?: { id?: string }[] }[]).flatMap(patch => patch.insert ?? [])
|
||||
expect(rows.length).toBeGreaterThan(50)
|
||||
expect(rows.some(row => row.id === 'agent-loop')).toBe(true)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user