mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 16:03:26 +00:00
Adds Orca's experimental plugin system behind a settings flag: a supervised kernel, declarative content packs (VM recipes, commands and keybindings, language packs), sandboxed iframe panels, forked worker hosts, and a Git-backed marketplace v0 with consent, provenance and kill-list enforcement. Theme, icon-theme and terminal-theme contributions are deferred to a follow-up pass.
46 lines
1.6 KiB
JavaScript
46 lines
1.6 KiB
JavaScript
import { cp, mkdtemp, rm, writeFile } from 'node:fs/promises'
|
|
import { createRequire } from 'node:module'
|
|
import { tmpdir } from 'node:os'
|
|
import { join } from 'node:path'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const require = createRequire(import.meta.url)
|
|
const { verifyPackagedPluginResources } = require('./verify-packaged-plugin-resources.cjs')
|
|
|
|
describe('verify packaged plugin resources', () => {
|
|
it('accepts exact launch bytes copied into a packaged resources directory', async () => {
|
|
const resourcesDir = await mkdtemp(join(tmpdir(), 'orca-packaged-plugins-'))
|
|
try {
|
|
await cp(
|
|
join(process.cwd(), 'resources', 'plugins', 'launch'),
|
|
join(resourcesDir, 'plugins', 'launch'),
|
|
{ recursive: true }
|
|
)
|
|
|
|
expect(() => verifyPackagedPluginResources(resourcesDir)).not.toThrow()
|
|
} finally {
|
|
await rm(resourcesDir, { recursive: true, force: true })
|
|
}
|
|
})
|
|
|
|
it('rejects mutated bytes in the packaged output', async () => {
|
|
const resourcesDir = await mkdtemp(join(tmpdir(), 'orca-packaged-plugins-'))
|
|
try {
|
|
const launchRoot = join(resourcesDir, 'plugins', 'launch')
|
|
await cp(join(process.cwd(), 'resources', 'plugins', 'launch'), launchRoot, {
|
|
recursive: true
|
|
})
|
|
await writeFile(
|
|
join(launchRoot, 'stablyai.orca-navigation-shortcuts', 'extra.json'),
|
|
'{"mutated":true}\n'
|
|
)
|
|
|
|
expect(() => verifyPackagedPluginResources(resourcesDir)).toThrow(
|
|
'packaged bytes do not match stablyai.orca-navigation-shortcuts'
|
|
)
|
|
} finally {
|
|
await rm(resourcesDir, { recursive: true, force: true })
|
|
}
|
|
})
|
|
})
|