mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-06 20:43:27 -05:00
The add-on declares the three index files of the person's notes (capabilities.contextFiles, manifest API 2), so the host loads them into the prompt and serves their topics with context_read. It ships two skills: memory, whose description asks the model to read the matching topic before it answers almost anything and to save a note only as a proposal the person confirms, and memory-check-own-files, which says what the model can and cannot read. Its executable serves no tool, and its page explains the notes and opens the Memory tab of the account. The add-on joins the packaging matrix, the release workflow, the library index and the case inventory. The declared capabilities the host hands to an add-on now include the context files. Assisted-by: Claude:claude-sonnet-5-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
24 lines
1.1 KiB
JavaScript
24 lines
1.1 KiB
JavaScript
// Runs the node unit tests of the Web UI package and prints one JSON line
|
|
// per test, the same shape as the host's runner (core/http/react-ui/tests/unit):
|
|
// {"case":"unit: <name>","status":"passed"|"failed"|"skipped"}
|
|
import { run } from 'node:test'
|
|
import { readdirSync } from 'node:fs'
|
|
import { dirname, join } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const here = dirname(fileURLToPath(import.meta.url))
|
|
const names = readdirSync(here).filter(f => f.endsWith('.test.mjs')).sort()
|
|
let failed = false
|
|
const stream = run({ files: names.map(f => join(here, f)), concurrency: 1 })
|
|
stream.on('test:pass', ({ name, skip, todo, nesting }) => {
|
|
if (nesting > 0) return
|
|
console.log(JSON.stringify({ case: `unit: ${name}`, status: skip || todo ? 'skipped' : 'passed' }))
|
|
})
|
|
stream.on('test:fail', ({ name, nesting, details }) => {
|
|
if (nesting > 0) return
|
|
failed = true
|
|
console.log(JSON.stringify({ case: `unit: ${name}`, status: 'failed', error: String(details && details.error && details.error.message || 'failed').slice(0, 400) }))
|
|
})
|
|
stream.on('end', () => { process.exit(failed ? 1 : 0) })
|
|
stream.resume()
|