This commit is contained in:
2026-08-18 18:11:34 -04:00
parent bbaf47028f
commit 05dab1f18a
263 changed files with 895 additions and 872 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ Or `node packages/bare-os-coreutils/build.mjs`.
**Source of truth:** **`lib/commands.mjs`** — **`COREUTILS_COMMANDS`** (imported by **`build.mjs`** and **`scripts/build-man-db.mjs`**). Each name must have `**man/pages/<name>.json`**. **186** Tier-1 commands in the current tree (**`sshd`**s `/bin` body is emitted by **`bare-os-openssh`**); root **`pretest`** runs **`verify-man-coverage.mjs`** against this list (do not hand-maintain a duplicate comma-separated inventory here—use **`lib/commands.mjs`**, **`ls /bin`** in the guest, or **`man -k`**).
**`edit`** is a full-screen TTY buffer editor (syntax highlighting, search, save). **`nano`** is built from the same **`src/edit.js`** with the same **`lib/edit-*.js`** preamble; **`/bin/nano`** exists for familiarity, and the stock shell alias `**nano``edit**` routes **`nano`** to that utility (see **`packages/bare-os-booter/lib/shell.js`**). Both require a real TTY (**`stdout.isTTY`**).
**`edit`** is a full-screen TTY buffer editor (syntax highlighting, search, save). **`nano`** is built from the same **`src/edit.js`** with the same **`lib/edit-*.js`** preamble; **`/bin/nano`** exists for familiarity, and the stock shell alias `**nano``edit**` routes **`nano`** to that utility (see **`packages/bare-os-booter/lib/shell/shell.js`**). Both require a real TTY (**`stdout.isTTY`**).
**`baretop`** is the stock **`top`** alias target: a multi-tab TTY dashboard over **`/proc/bare_os/*`** (session metrics, Pear, replication, initd, scrollable overview, process tree/sort, optional mouse, …). **`btop`** is the same bundle as **`/bin/baretop`** (short name); the stock shell alias `**btop``baretop**` matches `**nano``edit**`. The booter may expose **`ctx.bareOsReadBareTopSnapshot`** (optional **`{ lite: true }`**) to batch-read the same mirrors **`baretop`** would **`vfs.readFile`** individually; the return value can include **`metricsLiveText`** so **`metrics_live.json`** need not be read twice. **`BARE_TOP_INCREMENTAL=2`** enables experimental line-diff redraws; **`BARE_TOP_LAYOUT_AUTO=1`** picks a wide split on large terminals. Rebuild **`kernel/bin/baretop`** and **`kernel/bin/btop`** with **`node packages/bare-os-coreutils/build.mjs`** after editing **`lib/baretop-snapshot.js`**, **`lib/baretop-ui-helpers.js`**, or **`lib/baretop-tui.js`**.
+25 -3
View File
@@ -1,3 +1,4 @@
import { existsSync } from 'fs'
import { readFile, writeFile, mkdir, cp } from 'fs/promises'
import { dirname, join } from 'path'
import { fileURLToPath, pathToFileURL } from 'url'
@@ -189,9 +190,30 @@ function stripRunExport(src) {
return src.replace(/\r?\nexport\s*\{\s*run\s*\}\s*;?\s*$/m, '')
}
const LIB_SUBJECT_DIRS = [
'agent',
'baretop',
'edit',
'engines',
'irc',
'p2p',
'pear',
'summon'
]
/** Resolve a coreutils lib basename after the subject-folder layout. */
function coreutilsLibPath(name) {
const direct = join(__dirname, 'lib', name)
if (existsSync(direct)) return direct
for (const sub of LIB_SUBJECT_DIRS) {
const p = join(__dirname, 'lib', sub, name)
if (existsSync(p)) return p
}
return direct
}
export async function build() {
await buildManDb()
const runtime = await readFile(join(__dirname, 'lib/runtime.js'), 'utf8')
await mkdir(kernelBin, { recursive: true })
await mkdir(seederKernelBin, { recursive: true })
@@ -207,9 +229,9 @@ export async function build() {
: f === 'bare-os-discord-commands-guest.cjs'
? join(
repoRoot,
'packages/bare-os-booter/lib/bare-os-discord-commands-guest.cjs'
'packages/bare-os-booter/lib/services/bare-os-discord-commands-guest.cjs'
)
: join(__dirname, 'lib', f)
: coreutilsLibPath(f)
let chunk = await readFile(chunkPath, 'utf8')
if (f === 'bare-os-lscolors.js')
chunk = stripLscolorsBundleExport(chunk)
@@ -25,7 +25,7 @@
"section": 1
}
],
"bareOsNotes": "Implementation: packages/bare-os-booter/lib/bare-cron.js. Dependency: **kernel-logger** before **bare-cron** in the default initd graph.",
"bareOsNotes": "Implementation: packages/bare-os-booter/lib/initd/bare-cron.js. Dependency: **kernel-logger** before **bare-cron** in the default initd graph.",
"examples": [
{
"caption": "list scheduler unit",
@@ -12,7 +12,7 @@
"bare-os",
"coreutils"
],
"bareOsNotes": "Uses vfs.chown with preserved uid; system image paths are read-only. See packages/bare-os-booter/lib/vfs.js.",
"bareOsNotes": "Uses vfs.chown with preserved uid; system image paths are read-only. See packages/bare-os-booter/lib/vfs/vfs.js.",
"examples": [
{
"caption": "set group by name",
@@ -358,7 +358,7 @@ EXTRA.chgrp = {
description:
'Updates group metadata on the personal Hyperdrive for writable paths (session home, $HOME, /tmp, /var/log).',
bareOsNotes:
'Uses vfs.chown with preserved uid; system image paths are read-only. See packages/bare-os-booter/lib/vfs.js.'
'Uses vfs.chown with preserved uid; system image paths are read-only. See packages/bare-os-booter/lib/vfs/vfs.js.'
}
EXTRA.chown = {
description:
@@ -853,7 +853,7 @@ function bareCronPage() {
{ name: 'crontab', section: 1 }
],
bareOsNotes:
'Implementation: packages/bare-os-booter/lib/bare-cron.js. Dependency: **kernel-logger** before **bare-cron** in the default initd graph.',
'Implementation: packages/bare-os-booter/lib/initd/bare-cron.js. Dependency: **kernel-logger** before **bare-cron** in the default initd graph.',
examples: [
{ caption: 'list scheduler unit', code: 'systemctl status bare-cron' },
{
@@ -73,4 +73,4 @@ run_command "appstore setup"
- `docs/guides/guest-pear-and-appstore-workflow.md`
- `docs/design/p2p-app-store.md`
- `packages/bare-os-coreutils/lib/appstore-pear.js`
- `packages/bare-os-coreutils/lib/pear/appstore-pear.js`
@@ -10,7 +10,7 @@ requires: [read_file, read_proc_file, run_js_script]
## When to use
Use this skill when you (or the user) need to **author or debug** Bare OS **JavaScript** that runs **inside the guest** (kernel init, `/bin/*` utilities, `kernel.ext.d`, user `.mjs` run via **`run_js_script`**, or Pear/booter-hosted scripts). It complements repo docs: treat **`developer-guide/02-the-context-object.md`** and **`packages/bare-os-booter/lib/bare-os-ctx.d.ts`** as the canonical deep dives; this file is the **fast mental model**.
Use this skill when you (or the user) need to **author or debug** Bare OS **JavaScript** that runs **inside the guest** (kernel init, `/bin/*` utilities, `kernel.ext.d`, user `.mjs` run via **`run_js_script`**, or Pear/booter-hosted scripts). It complements repo docs: treat **`developer-guide/02-the-context-object.md`** and **`packages/bare-os-booter/lib/ctx/bare-os-ctx.d.ts`** as the canonical deep dives; this file is the **fast mental model**.
## Core model
@@ -9,8 +9,8 @@ requires: [read_proc_file, verification_hints]
## Touch list
- packages/bare-os-booter/lib/bare-os-ctx-api.js
- packages/bare-os-booter/lib/bare-os-ctx.d.ts
- packages/bare-os-booter/lib/ctx/bare-os-ctx-api.js
- packages/bare-os-booter/lib/ctx/bare-os-ctx.d.ts
- docs/reference/compatibility-matrix.md
- packages/bare-os-booter/CHANGELOG.md
@@ -15,7 +15,7 @@ Use when the user asks about **HDMS** (Hyperdrive Management): **`hdms`** CLI, *
## Prerequisites
- **HDMS activates after identity unlock.** Guest sessions can **list** mounts that are already open; **mutating** commands (**`create`**, **`add`**, registry edits, **`invite`**, **`pair`**, etc.) go through **`assertLoggedIn`**: require `**ctx.identity.state === 'unlocked'`** and an active HDMS controller.
- Implementation: **`packages/bare-os-booter/lib/hdms-manager.js`** (**`runHdmsCli`**, **`HdmsController`**), exposed as **`ctx.runHdms(argv)`** in **`packages/bare-os-booter/index.js`**.
- Implementation: **`packages/bare-os-booter/lib/p2p/hdms-manager.js`** (**`runHdmsCli`**, **`HdmsController`**), exposed as **`ctx.runHdms(argv)`** in **`packages/bare-os-booter/index.js`**.
## Registry and VFS
@@ -43,7 +43,7 @@ High-level behavior (details and caveats in **`handbook/05-identity-vault-and-hd
## Execution steps (for the agent)
1. If the user is **guest**, explain that **mutations** require **`login`** / **`login --new`** first; **`hdms list`** may still work for existing mounts.
2. For **subcommands and flags**, prefer **`read_man_page hdms`** when available; otherwise cite **`handbook/05-identity-vault-and-hdms.md`** and **`packages/bare-os-booter/lib/hdms-manager.js`**.
2. For **subcommands and flags**, prefer **`read_man_page hdms`** when available; otherwise cite **`handbook/05-identity-vault-and-hdms.md`** and **`packages/bare-os-booter/lib/p2p/hdms-manager.js`**.
3. For **pairing failures**, check timeout env vars, bootstrap connectivity, and whether **`--read-only`** was used inappropriately on invites.
## Constraints
@@ -14,7 +14,7 @@ Use when the user asks about **Holesail** in this repo: exposing TCP/UDP through
## Mental model
1. **Integration** lives in **`packages/bare-os-booter/lib/bare-holesail.js`** (initd + optional early “kernel-path” instance), **`bare-holesail-managed.js`** ( **`state.json`** rows, **`ensure`**, **`SyncPersistedServerKey`** ), **`holesail-cli.js`** (**`ctx.bareOsRunHolesailCli`** for **`/bin/holesail`**), **`bare-os-www-holesail.js`**, **`bare-os-ssh-holesail.js`**.
1. **Integration** lives in **`packages/bare-os-booter/lib/p2p/bare-holesail.js`** (initd + optional early “kernel-path” instance), **`bare-holesail-managed.js`** ( **`state.json`** rows, **`ensure`**, **`SyncPersistedServerKey`** ), **`holesail-cli.js`** (**`ctx.bareOsRunHolesailCli`** for **`/bin/holesail`**), **`bare-os-www-holesail.js`**, **`bare-os-ssh-holesail.js`**.
2. **Resolution order** under **`pear run`**: the booter prefers **`ctx.bare.holesail`** ( **`/lib/bare/bundles/holesail.js`** after drive merge), else host **`import.meta.resolve('holesail')`**, else eval of the drive IIFE bundle via **`ctx.vfs`** — **`/bin`** and **`/boot/init.js`** are **not** Node modules, so scripts must not **`require('holesail')`**.
3. **Stock default**: initd unit **`bare-holesail`** is **on** when **`BARE_OS_HOLESAIL_INITD`** and **`BARE_OS_HOLESAIL_MANAGED`** are left at defaults (**`1`** in stock **`shellEnv`** unless the host clears them). Disable with **`BARE_OS_HOLESAIL_INITD=0`** or **`systemctl disable bare-holesail`** (`**~/.config/bare-os/initd/disabled.txt`**).
4. **Stock auto-rows****`bare-www-<port>`** after **`bare-os-www`** listens (**`BARE_OS_WWW_HOLESAIL=0`** disables merge). **`bare-ssh-<port>`** after **`bare-openssh`** listens (**`BARE_OS_SSH_HOLESAIL=0`** disables). **`bare-user-session-stack`** re-ensures SSH tunnel after **`bare-holesail`** starts if sshd was already listening.
@@ -34,7 +34,7 @@ Use for any work that touches the **governed kernel expansion** (Batch C items,
- The specific word-N verifier if adding bits
- Full `npm test` (or at minimum the kernel-program + doc subset) before any PR
- For a new **proc builder** or **ctx.bareOs*** method: copy the exact pattern from a word-11 file (e.g. `bare-os-proc-hypercore-pack-hrpc-lifecycle.js` + emitter in index.js + entry in bare-os-ctx-api.js + .d.ts). Update the programVersion / schema note in kernel-program.md.
- For **agent skills** supporting kernel program work: keep this skill + bareos-code-change in the requires list and update `BARE_AGENT_SKILL_SEED_REL` in `packages/bare-os-coreutils/lib/agent-workspace.js` (the source of truth for seeding).
- For **agent skills** supporting kernel program work: keep this skill + bareos-code-change in the requires list and update `BARE_AGENT_SKILL_SEED_REL` in `packages/bare-os-coreutils/lib/agent/agent-workspace.js` (the source of truth for seeding).
## Output contract (what you must produce)
- Updated `feature-roadmap.md` table row(s) with status "in progress" or "done — links to PR + verifier".
@@ -69,6 +69,6 @@ Release creates (or reuses) a writable HDMS mount `pear-<app-name>` at `/mnt/pea
## Files & References
- Plan: `docs/design/ctx-pear-surface-and-bare-audit-plan.md`
- Staging: `packages/bare-os-coreutils/lib/pear-stage.js`
- Release: `packages/bare-os-coreutils/lib/pear-release.js`
- Staging: `packages/bare-os-coreutils/lib/pear/pear-stage.js`
- Release: `packages/bare-os-coreutils/lib/pear/pear-release.js`
- Command: `packages/bare-os-coreutils/src/pear.js`
+1 -1
View File
@@ -11,7 +11,7 @@ async function run(ctx, argv) {
}
}
/* Keep in sync with packages/bare-os-booter/lib/terminal-escapes.js XTERM_CLEAR_SCROLLBACK_AND_VIEWPORT */
/* Keep in sync with packages/bare-os-booter/lib/cli/terminal-escapes.js XTERM_CLEAR_SCROLLBACK_AND_VIEWPORT */
const seq = '\x1b[H\x1b[3J\x1b[2J\x1b[0m'
const term = String(ctx.vfs?.env?.TERM || globalThis.process?.env?.TERM || '')
if (term === 'dumb') return
@@ -2,25 +2,25 @@ import test from 'brittle'
import { readFileSync } from 'node:fs'
const STATE = readFileSync(
new URL('../lib/agent-state.js', import.meta.url),
new URL('../lib/agent/agent-state.js', import.meta.url),
'utf8'
)
const TOOLS =
readFileSync(new URL('../lib/agent-tools.js', import.meta.url), 'utf8') +
readFileSync(new URL('../lib/agent/agent-tools.js', import.meta.url), 'utf8') +
readFileSync(
new URL('../lib/agent-tool-definitions.js', import.meta.url),
new URL('../lib/agent/agent-tool-definitions.js', import.meta.url),
'utf8'
) +
readFileSync(
new URL('../lib/agent-tool-dispatch.js', import.meta.url),
new URL('../lib/agent/agent-tool-dispatch.js', import.meta.url),
'utf8'
)
const OPENAI = readFileSync(
new URL('../lib/agent-openai.js', import.meta.url),
new URL('../lib/agent/agent-openai.js', import.meta.url),
'utf8'
)
const TUI = readFileSync(
new URL('../lib/agent-tui.js', import.meta.url),
new URL('../lib/agent/agent-tui.js', import.meta.url),
'utf8'
)
const CLI = readFileSync(new URL('../src/agent.js', import.meta.url), 'utf8')
@@ -5,25 +5,25 @@ import test from 'brittle'
import { readFileSync } from 'node:fs'
import vm from 'node:vm'
const STATE_SRC = readFileSync(new URL('../lib/agent-state.js', import.meta.url), 'utf8')
const STATE_SRC = readFileSync(new URL('../lib/agent/agent-state.js', import.meta.url), 'utf8')
const HELPERS_SRC = readFileSync(
new URL('../lib/agent-helpers.js', import.meta.url),
new URL('../lib/agent/agent-helpers.js', import.meta.url),
'utf8'
)
const PORT_SRC = readFileSync(
new URL('../lib/agent-grok-port.js', import.meta.url),
new URL('../lib/agent/agent-grok-port.js', import.meta.url),
'utf8'
)
const TOOLS_SRC =
readFileSync(new URL('../lib/agent-tools.js', import.meta.url), 'utf8') +
readFileSync(new URL('../lib/agent/agent-tools.js', import.meta.url), 'utf8') +
'\n' +
readFileSync(
new URL('../lib/agent-tool-definitions.js', import.meta.url),
new URL('../lib/agent/agent-tool-definitions.js', import.meta.url),
'utf8'
) +
'\n' +
readFileSync(
new URL('../lib/agent-tool-dispatch.js', import.meta.url),
new URL('../lib/agent/agent-tool-dispatch.js', import.meta.url),
'utf8'
)
@@ -5,7 +5,7 @@ import test from 'brittle'
import { readFileSync } from 'node:fs'
import vm from 'node:vm'
const CODE = readFileSync(new URL('../lib/agent-helpers.js', import.meta.url), 'utf8')
const CODE = readFileSync(new URL('../lib/agent/agent-helpers.js', import.meta.url), 'utf8')
function load() {
const sandbox = { TextDecoder, TextEncoder, Uint8Array, console }
@@ -2,7 +2,7 @@ import test from 'brittle'
import { readFileSync } from 'node:fs'
import vm from 'node:vm'
const SRC = readFileSync(new URL('../lib/agent-models.js', import.meta.url), 'utf8')
const SRC = readFileSync(new URL('../lib/agent/agent-models.js', import.meta.url), 'utf8')
function load() {
const sandbox = { console }
@@ -2,7 +2,7 @@ import test from 'brittle'
import { readFileSync } from 'node:fs'
import vm from 'node:vm'
const QVAC_SRC = readFileSync(new URL('../lib/agent-qvac.js', import.meta.url), 'utf8')
const QVAC_SRC = readFileSync(new URL('../lib/agent/agent-qvac.js', import.meta.url), 'utf8')
/** Eval concat-style preamble helpers into a sandbox (same shape as /bin/agent). */
function loadAgentQvacHelpers() {
@@ -6,10 +6,10 @@ import { readFileSync } from 'node:fs'
import vm from 'node:vm'
const WORKSPACE = readFileSync(
new URL('../lib/agent-workspace.js', import.meta.url),
new URL('../lib/agent/agent-workspace.js', import.meta.url),
'utf8'
)
const SKILLS = readFileSync(new URL('../lib/agent-skills.js', import.meta.url), 'utf8')
const SKILLS = readFileSync(new URL('../lib/agent/agent-skills.js', import.meta.url), 'utf8')
/** @returns {Record<string, unknown>} */
function loadSandbox() {
@@ -39,7 +39,7 @@ function loadFns(rel, names) {
}
test('markdown renders headings lists and bold', () => {
const api = loadFns('../lib/agent-markdown.js', ['bareAgentRenderMarkdown'])
const api = loadFns('../lib/agent/agent-markdown.js', ['bareAgentRenderMarkdown'])
const out = api.bareAgentRenderMarkdown(
'# Title\n\nI use **bold** and `code`.\n\n1. One\n2. Two\n\n- Alpha\n- Beta\n',
{ useColor: false, width: 72 }
@@ -52,7 +52,7 @@ test('markdown renders headings lists and bold', () => {
})
test('markdown fences keep code body', () => {
const api = loadFns('../lib/agent-markdown.js', ['bareAgentRenderMarkdown'])
const api = loadFns('../lib/agent/agent-markdown.js', ['bareAgentRenderMarkdown'])
const out = api.bareAgentRenderMarkdown('```js\nconst x = 1\n```\n', {
useColor: false,
width: 72
@@ -62,7 +62,7 @@ test('markdown fences keep code body', () => {
})
test('think panel scrollbar and scroll keys', () => {
const api = loadFns('../lib/agent-think-panel.js', [
const api = loadFns('../lib/agent/agent-think-panel.js', [
'bareAgentCreateThinkPanel',
'bareAgentThinkScrollbar'
])
@@ -96,7 +96,7 @@ test('think panel scrollbar and scroll keys', () => {
})
test('term cols use full width without 120 cap', () => {
const api = loadFns('../lib/agent-think-panel.js', [
const api = loadFns('../lib/agent/agent-think-panel.js', [
'bareAgentResolveTermCols'
])
const w = api.bareAgentResolveTermCols(
@@ -109,7 +109,7 @@ test('term cols use full width without 120 cap', () => {
})
test('empty think panel never draws', () => {
const api = loadFns('../lib/agent-think-panel.js', [
const api = loadFns('../lib/agent/agent-think-panel.js', [
'bareAgentCreateThinkPanel'
])
/** @type {string[]} */
@@ -134,7 +134,7 @@ test('empty think panel never draws', () => {
})
test('think tag splitter still works', () => {
const api = loadFns('../lib/agent-think-panel.js', [
const api = loadFns('../lib/agent/agent-think-panel.js', [
'bareAgentCreateThinkTagSplitter'
])
/** @type {string[]} */
@@ -8,7 +8,7 @@ import vm from 'node:vm'
const dir = dirname(fileURLToPath(import.meta.url))
function loadToolCallFns() {
const src = readFileSync(join(dir, '../lib/agent-tui.js'), 'utf8')
const src = readFileSync(join(dir, '../lib/agent/agent-tui.js'), 'utf8')
const start = src.indexOf('function bareAgentMergeToolCallDelta')
const end = src.indexOf('function bareAgentReasoningSettings')
assert.ok(start >= 0 && end > start, 'tool-call helpers missing in agent-tui.js')
@@ -3,15 +3,15 @@ import { readFileSync } from 'node:fs'
import vm from 'node:vm'
const CODE =
readFileSync(new URL('../lib/agent-tools.js', import.meta.url), 'utf8') +
readFileSync(new URL('../lib/agent/agent-tools.js', import.meta.url), 'utf8') +
'\n' +
readFileSync(
new URL('../lib/agent-tool-definitions.js', import.meta.url),
new URL('../lib/agent/agent-tool-definitions.js', import.meta.url),
'utf8'
) +
'\n' +
readFileSync(
new URL('../lib/agent-tool-dispatch.js', import.meta.url),
new URL('../lib/agent/agent-tool-dispatch.js', import.meta.url),
'utf8'
)
@@ -2,9 +2,9 @@ import test from 'brittle'
import { readFileSync } from 'node:fs'
import vm from 'node:vm'
const STATE_SRC = readFileSync(new URL('../lib/agent-state.js', import.meta.url), 'utf8')
const STATE_SRC = readFileSync(new URL('../lib/agent/agent-state.js', import.meta.url), 'utf8')
const COMPACT_SRC = readFileSync(
new URL('../lib/agent-compact.js', import.meta.url),
new URL('../lib/agent/agent-compact.js', import.meta.url),
'utf8'
)
@@ -6,7 +6,7 @@ import { readFileSync } from 'node:fs'
import vm from 'node:vm'
const CODE = readFileSync(
new URL('../lib/agent-web-fetch.js', import.meta.url),
new URL('../lib/agent/agent-web-fetch.js', import.meta.url),
'utf8'
)
@@ -6,7 +6,7 @@ import { readFileSync } from 'node:fs'
import vm from 'node:vm'
const CODE = readFileSync(
new URL('../lib/agent-workspace.js', import.meta.url),
new URL('../lib/agent/agent-workspace.js', import.meta.url),
'utf8'
)
@@ -9,8 +9,8 @@ const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor
async function loadAppstoreBin() {
const runtime = await readFile(path.join(__dirname, '../lib/runtime.js'), 'utf8')
const p2p = await readFile(path.join(__dirname, '../lib/p2p-suite.js'), 'utf8')
const pear = await readFile(path.join(__dirname, '../lib/appstore-pear.js'), 'utf8')
const p2p = await readFile(path.join(__dirname, '../lib/p2p/p2p-suite.js'), 'utf8')
const pear = await readFile(path.join(__dirname, '../lib/pear/appstore-pear.js'), 'utf8')
const body = await readFile(path.join(__dirname, '../src/appstore.js'), 'utf8')
return new AsyncFunction(
'ctx',
@@ -5,7 +5,7 @@ import { readFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import test from 'brittle'
import { bareAwkRun } from '../lib/awk-engine.js'
import { bareAwkRun } from '../lib/engines/awk-engine.js'
const __dirname = dirname(fileURLToPath(import.meta.url))
const srcDir = join(__dirname, '../src')
@@ -24,7 +24,7 @@ test('awk.js exists and wires field parsing', async (t) => {
})
test('awk-engine supports delete arr[key] statement', async (t) => {
const s = await readFile(join(__dirname, '../lib/awk-engine.js'), 'utf8')
const s = await readFile(join(__dirname, '../lib/engines/awk-engine.js'), 'utf8')
t.ok(s.includes("id === 'delete'"))
t.ok(s.includes("case 'delete':"))
})
@@ -4,7 +4,7 @@ import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
const tuiPath = join(__dirname, '../lib/baretop-tui.js')
const tuiPath = join(__dirname, '../lib/baretop/baretop-tui.js')
const kernelBaretop = join(__dirname, '../../../kernel/bin/baretop')
const kernelBtop = join(__dirname, '../../../kernel/bin/btop')
@@ -5,8 +5,8 @@ import { fileURLToPath } from 'node:url'
import { createContext, runInContext } from 'node:vm'
const __dirname = dirname(fileURLToPath(import.meta.url))
const helpersPath = join(__dirname, '../lib/baretop-ui-helpers.js')
const composePath = join(__dirname, '../lib/baretop-compose.js')
const helpersPath = join(__dirname, '../lib/baretop/baretop-ui-helpers.js')
const composePath = join(__dirname, '../lib/baretop/baretop-compose.js')
const fixturePath = join(__dirname, 'fixtures/baretop-process-table.json')
test('bareTopComposeSmokeTestFrame golden lines', async (t) => {
@@ -11,8 +11,8 @@ const largeProcessTableFixture = join(
__dirname,
'fixtures/baretop-large-process-table.json'
)
const helpersPath = join(__dirname, '../lib/baretop-ui-helpers.js')
const snapPath = join(__dirname, '../lib/baretop-snapshot.js')
const helpersPath = join(__dirname, '../lib/baretop/baretop-ui-helpers.js')
const snapPath = join(__dirname, '../lib/baretop/baretop-snapshot.js')
test('fixture metrics_live-shaped JSON parses with expected keys', async (t) => {
const raw = await readFile(fixturePath, 'utf8')
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url'
import { createContext, runInContext } from 'node:vm'
const __dirname = dirname(fileURLToPath(import.meta.url))
const composePath = join(__dirname, '../lib/baretop-compose.js')
const composePath = join(__dirname, '../lib/baretop/baretop-compose.js')
test('incremental line-diff patch is smaller than full frame when one line changes', async (t) => {
const compose = await readFile(composePath, 'utf8')
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url'
import { createContext, runInContext } from 'node:vm'
const __dirname = dirname(fileURLToPath(import.meta.url))
const tuiPath = join(__dirname, '../lib/baretop-tui.js')
const tuiPath = join(__dirname, '../lib/baretop/baretop-tui.js')
test('bareTopModalSleepMs prioritizes buffered input', async (t) => {
const src = await readFile(tuiPath, 'utf8')
@@ -5,9 +5,9 @@ import { fileURLToPath } from 'node:url'
import { createContext, runInContext } from 'node:vm'
const __dirname = dirname(fileURLToPath(import.meta.url))
const snapshotPath = join(__dirname, '../lib/baretop-snapshot.js')
const helpersPath = join(__dirname, '../lib/baretop-ui-helpers.js')
const tuiPath = join(__dirname, '../lib/baretop-tui.js')
const snapshotPath = join(__dirname, '../lib/baretop/baretop-snapshot.js')
const helpersPath = join(__dirname, '../lib/baretop/baretop-ui-helpers.js')
const tuiPath = join(__dirname, '../lib/baretop/baretop-tui.js')
test('baretop snapshot supports extended missing-signal hints', async (t) => {
const src = await readFile(snapshotPath, 'utf8')
@@ -5,8 +5,8 @@ import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
const helpersPath = join(__dirname, '../lib/baretop-ui-helpers.js')
const composePath = join(__dirname, '../lib/baretop-compose.js')
const helpersPath = join(__dirname, '../lib/baretop/baretop-ui-helpers.js')
const composePath = join(__dirname, '../lib/baretop/baretop-compose.js')
const largeProcPath = join(__dirname, 'fixtures/baretop-large-process-table.json')
const largeNetPath = join(__dirname, 'fixtures/baretop-large-net-summary.json')
@@ -5,8 +5,8 @@ import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
const helpersPath = join(__dirname, '../lib/baretop-ui-helpers.js')
const composePath = join(__dirname, '../lib/baretop-compose.js')
const helpersPath = join(__dirname, '../lib/baretop/baretop-ui-helpers.js')
const composePath = join(__dirname, '../lib/baretop/baretop-compose.js')
test('stress synthetic snapshots do not crash compose loop', async (t) => {
const helpers = await readFile(helpersPath, 'utf8')
@@ -3,7 +3,7 @@ import { readFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/bare-os-tui-sdk.js'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/services/bare-os-tui-sdk.js'
const __dirname = dirname(fileURLToPath(import.meta.url))
const lib = (name) => join(__dirname, '../lib', name)
@@ -5,7 +5,7 @@ import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
const helpersPath = join(__dirname, '../lib/baretop-ui-helpers.js')
const helpersPath = join(__dirname, '../lib/baretop/baretop-ui-helpers.js')
const largeNetFixture = join(
__dirname,
'fixtures/baretop-large-net-summary.json'
@@ -3,10 +3,10 @@ import { readFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/bare-os-tui-sdk.js'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/services/bare-os-tui-sdk.js'
const __dirname = dirname(fileURLToPath(import.meta.url))
const libPath = join(__dirname, '../lib/chat-tui.js')
const libPath = join(__dirname, '../lib/edit/chat-tui.js')
async function loadChatTui() {
const src = await readFile(libPath, 'utf8')
@@ -7,7 +7,7 @@ import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
const parseSrc = readFileSync(join(__dirname, '../lib/edit-key-parse.js'), 'utf8')
const parseSrc = readFileSync(join(__dirname, '../lib/edit/edit-key-parse.js'), 'utf8')
const hook = {}
new Function(
'exports',
@@ -4,7 +4,7 @@ import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
const tuiPath = join(__dirname, '../lib/edit-tui.js')
const tuiPath = join(__dirname, '../lib/edit/edit-tui.js')
const kernelEditPath = join(__dirname, '../../../kernel/bin/edit')
test('edit-tui finally tears down alternate screen or clears display', async (t) => {
@@ -3,7 +3,7 @@ import { readFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/bare-os-tui-sdk.js'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/services/bare-os-tui-sdk.js'
const __dirname = dirname(fileURLToPath(import.meta.url))
const lib = (name) => join(__dirname, '../lib', name)
@@ -8,12 +8,12 @@ const __dirname = dirname(fileURLToPath(import.meta.url))
async function load() {
const parts = await Promise.all([
readFile(join(__dirname, '../lib/irc-parse.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-isupport.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-sasl.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-state.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-config.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-client.js'), 'utf8')
readFile(join(__dirname, '../lib/irc/irc-parse.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-isupport.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-sasl.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-state.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-config.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-client.js'), 'utf8')
])
const hook = {}
new Function(
@@ -7,13 +7,13 @@ const __dirname = dirname(fileURLToPath(import.meta.url))
async function load() {
const parts = await Promise.all([
readFile(join(__dirname, '../lib/irc-parse.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-isupport.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-sasl.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-state.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-config.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-client.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-commands.js'), 'utf8')
readFile(join(__dirname, '../lib/irc/irc-parse.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-isupport.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-sasl.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-state.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-config.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-client.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-commands.js'), 'utf8')
])
const hook = {}
new Function(
@@ -7,8 +7,8 @@ const __dirname = dirname(fileURLToPath(import.meta.url))
async function load() {
const parts = await Promise.all([
readFile(join(__dirname, '../lib/irc-config.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-dial.js'), 'utf8')
readFile(join(__dirname, '../lib/irc/irc-config.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-dial.js'), 'utf8')
])
const hook = {}
new Function(
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
async function load() {
const src = await readFile(join(__dirname, '../lib/irc-parse.js'), 'utf8')
const src = await readFile(join(__dirname, '../lib/irc/irc-parse.js'), 'utf8')
const hook = {}
new Function(
'exports',
@@ -3,21 +3,21 @@ import { readFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/bare-os-tui-sdk.js'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/services/bare-os-tui-sdk.js'
const __dirname = dirname(fileURLToPath(import.meta.url))
async function load() {
const parts = await Promise.all([
readFile(join(__dirname, '../lib/irc-parse.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-isupport.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-sasl.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-state.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-config.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-client.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-dial.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-commands.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc-tui.js'), 'utf8')
readFile(join(__dirname, '../lib/irc/irc-parse.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-isupport.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-sasl.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-state.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-config.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-client.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-dial.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-commands.js'), 'utf8'),
readFile(join(__dirname, '../lib/irc/irc-tui.js'), 'utf8')
])
const hook = {}
new Function(
@@ -10,7 +10,7 @@ const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor
async function loadLoginBin() {
const runtime = await readFile(path.join(__dirname, '../lib/runtime.js'), 'utf8')
const preamble = await readFile(
path.join(__dirname, '../lib/interactive-masked-line.js'),
path.join(__dirname, '../lib/edit/interactive-masked-line.js'),
'utf8'
)
const body = await readFile(path.join(__dirname, '../src/login.js'), 'utf8')
@@ -3,10 +3,10 @@ import { readFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/bare-os-tui-sdk.js'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/services/bare-os-tui-sdk.js'
const __dirname = dirname(fileURLToPath(import.meta.url))
const libPath = join(__dirname, '../lib/p2p-suite-tui.js')
const libPath = join(__dirname, '../lib/p2p/p2p-suite-tui.js')
async function loadP2pTui() {
const src = await readFile(libPath, 'utf8')
@@ -9,8 +9,8 @@ const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor
async function loadPearBin() {
const runtime = await readFile(path.join(__dirname, '../lib/runtime.js'), 'utf8')
const stage = await readFile(path.join(__dirname, '../lib/pear-stage.js'), 'utf8')
const release = await readFile(path.join(__dirname, '../lib/pear-release.js'), 'utf8')
const stage = await readFile(path.join(__dirname, '../lib/pear/pear-stage.js'), 'utf8')
const release = await readFile(path.join(__dirname, '../lib/pear/pear-release.js'), 'utf8')
const body = await readFile(path.join(__dirname, '../src/pear.js'), 'utf8')
return new AsyncFunction(
'ctx',
@@ -9,7 +9,7 @@ const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor
async function loadPearBin() {
const runtime = await readFile(path.join(__dirname, '../lib/runtime.js'), 'utf8')
const stage = await readFile(path.join(__dirname, '../lib/pear-stage.js'), 'utf8')
const stage = await readFile(path.join(__dirname, '../lib/pear/pear-stage.js'), 'utf8')
const body = await readFile(path.join(__dirname, '../src/pear.js'), 'utf8')
return new AsyncFunction(
'ctx',
@@ -8,7 +8,7 @@ import vm from 'node:vm'
import test from 'brittle'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const sha224Lib = path.join(__dirname, '../lib/sha224.js')
const sha224Lib = path.join(__dirname, '../lib/engines/sha224.js')
function loadBareSha224() {
const src = readFileSync(sha224Lib, 'utf8')
@@ -7,16 +7,16 @@ const __dirname = dirname(fileURLToPath(import.meta.url))
async function load() {
const parts = await Promise.all([
readFile(join(__dirname, '../lib/summon-url.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-cookie.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-http.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-html.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-css.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-layout.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-form.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-dom.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-js.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-session.js'), 'utf8')
readFile(join(__dirname, '../lib/summon/summon-url.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-cookie.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-http.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-html.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-css.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-layout.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-form.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-dom.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-js.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-session.js'), 'utf8')
])
const hook = {}
new Function(
@@ -3,23 +3,23 @@ import { readFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/bare-os-tui-sdk.js'
import { attachBareOsTuiSdk } from '../../bare-os-booter/lib/services/bare-os-tui-sdk.js'
const __dirname = dirname(fileURLToPath(import.meta.url))
async function load() {
const parts = await Promise.all([
readFile(join(__dirname, '../lib/summon-url.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-cookie.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-http.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-html.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-css.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-layout.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-form.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-dom.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-js.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-session.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon-tui.js'), 'utf8')
readFile(join(__dirname, '../lib/summon/summon-url.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-cookie.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-http.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-html.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-css.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-layout.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-form.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-dom.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-js.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-session.js'), 'utf8'),
readFile(join(__dirname, '../lib/summon/summon-tui.js'), 'utf8')
])
const hook = {}
new Function(