geneseed 4.32.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/DESIGN.md +2 -2
- package/README.md +6 -5
- package/SHIPPED.md +4 -3
- package/adapters/bob/README.md +6 -5
- package/adapters/claude-code/README.md +4 -3
- package/adapters/claude-code/skills/geneseed/SKILL.md +1 -1
- package/adapters/openclaude/README.md +4 -3
- package/adapters/opencode/GLOBAL-HARNESS-SPEC.md +3 -1
- package/adapters/opencode/HOW-OPENCODE-LOADS.md +2 -1
- package/adapters/opencode/README.md +18 -18
- package/adapters/opencode/plugins/geneseed-activity.js +57 -1
- package/adapters/opencode/plugins/geneseed-context.js +85 -18
- package/adapters/opencode/plugins/geneseed-guard.js +437 -76
- package/adapters/opencode/plugins/geneseed-learn.js +97 -23
- package/bin/geneseed-cli.mjs +17 -25
- package/bin/geneseed-hook.mjs +23 -8
- package/docs/DESIGN.md +175 -0
- package/docs/PRD.md +111 -0
- package/docs/README.md +3 -2
- package/docs/architecture.md +145 -0
- package/docs/concepts/agents.md +1 -1
- package/docs/concepts/collaboration.md +1 -1
- package/docs/concepts/enforcement-table.md +1 -1
- package/docs/concepts/exclusions.md +5 -5
- package/docs/concepts/footprint.md +1 -1
- package/docs/concepts/foreman-mode.md +2 -2
- package/docs/concepts/hooks.md +22 -8
- package/docs/concepts/host-matrix.md +2 -2
- package/docs/concepts/hosts.md +1 -1
- package/docs/concepts/kits.md +3 -1
- package/docs/concepts/ownership.md +1 -1
- package/docs/concepts/rules.md +15 -2
- package/docs/concepts/shared-tier.md +73 -0
- package/docs/concepts/skills.md +2 -2
- package/docs/concepts/themes.md +1 -1
- package/docs/extending.md +13 -12
- package/docs/guides/install-claude-code.md +1 -1
- package/docs/guides/install-opencode.md +1 -1
- package/docs/guides/migrate.md +8 -4
- package/docs/guides/project-context.md +2 -2
- package/docs/guides/setup-footprint.md +1 -1
- package/docs/guides/uninstall.md +2 -1
- package/docs/guides/upgrade-to-5.md +118 -0
- package/docs/guides/upgrade.md +21 -9
- package/docs/guides/wiki.md +3 -3
- package/docs/reference/env-context.md +5 -3
- package/docs/reference/environment.md +1 -1
- package/docs/reference/glossary.md +2 -0
- package/docs/reference/opencode-plugins.md +3 -3
- package/docs/reference/plugin-activity.md +1 -1
- package/docs/reference/plugin-context.md +1 -0
- package/docs/reference/plugin-guard.md +14 -6
- package/docs/reference/plugin-learn.md +13 -6
- package/docs/reference/troubleshoot-hooks.md +3 -3
- package/docs/reference/troubleshoot-update.md +14 -0
- package/docs/token-footprint.md +4 -3
- package/docs/understand/a-day.md +2 -2
- package/docs/understand/design-choices-install.md +2 -1
- package/docs/understand/enforced-vs-asked.md +1 -1
- package/docs/understand/machine-bob.md +2 -0
- package/docs/understand/machine-claude.md +7 -5
- package/docs/understand/machine-opencode.md +7 -5
- package/docs/understand/on-your-machine.md +4 -0
- package/docs/understand/take-it-out.md +1 -1
- package/docs/web-ui.md +135 -70
- package/harness.config.json +1 -1
- package/js/README.md +12 -7
- package/js/build/args.mjs +10 -8
- package/js/build/bundle.mjs +11 -13
- package/js/build/driver.mjs +66 -65
- package/js/build/emit-claude.mjs +22 -16
- package/js/build/emit-common.mjs +4 -5
- package/js/build/emit-opencode.mjs +22 -22
- package/js/build/fold.mjs +515 -0
- package/js/build/generate.mjs +41 -52
- package/js/build/render.mjs +115 -29
- package/js/build/rule-decide.mjs +273 -0
- package/js/build/source.mjs +4 -1
- package/js/build/stubs.mjs +70 -9
- package/js/build/version.mjs +10 -10
- package/js/cli-table.json +23 -83
- package/js/hosts/activity.mjs +2 -2
- package/js/hosts/geneseed-dir.mjs +1 -1
- package/js/hosts/hooks-context.mjs +389 -99
- package/js/hosts/hooks-learn.mjs +38 -7
- package/js/hosts/hooks-prims.mjs +4 -2
- package/js/hosts/hooks.mjs +114 -39
- package/js/hosts/hosts.mjs +150 -51
- package/js/hosts/installs.mjs +59 -171
- package/js/hosts/link.mjs +3 -5
- package/js/hosts/mcp.mjs +1 -1
- package/js/hosts/memory-files.mjs +219 -17
- package/js/hosts/ownership-gate.mjs +1 -1
- package/js/hosts/settings.mjs +18 -13
- package/js/hosts/shim.mjs +4 -33
- package/js/hosts/store-watch.mjs +191 -0
- package/js/inspect/checks-authoring.mjs +3 -3
- package/js/inspect/checks-build.mjs +45 -18
- package/js/inspect/checks-counts.mjs +4 -4
- package/js/inspect/checks-repo.mjs +13 -14
- package/js/inspect/cost.mjs +24 -2
- package/js/inspect/diff.mjs +123 -123
- package/js/inspect/doctor.mjs +22 -27
- package/js/inspect/excludes.mjs +181 -62
- package/js/inspect/inventory.mjs +22 -27
- package/js/inspect/registry.mjs +110 -32
- package/js/inspect/scan.mjs +5 -5
- package/js/inspect/status.mjs +141 -119
- package/js/inspect/validate.mjs +22 -24
- package/js/lib/fs.mjs +47 -50
- package/js/lib/json.mjs +10 -17
- package/js/lib/machine-dir.mjs +73 -0
- package/js/lib/paths.mjs +35 -33
- package/js/lib/proc.mjs +1 -1
- package/js/lib/prompt.mjs +19 -27
- package/js/lib/text.mjs +8 -12
- package/js/lib/udiff.mjs +11 -15
- package/js/loop/catalog.mjs +2 -3
- package/js/maintain/memory.mjs +17 -17
- package/js/maintain/migrate.mjs +120 -92
- package/js/maintain/setup.mjs +43 -32
- package/js/maintain/uninstall.mjs +43 -61
- package/js/maintain/update.mjs +200 -93
- package/js/ui/anim.mjs +21 -35
- package/js/ui/cli.mjs +36 -58
- package/js/ui/menu.mjs +22 -45
- package/js/ui/tui.mjs +27 -67
- package/js/web/actions.mjs +34 -34
- package/js/web/api.mjs +142 -79
- package/js/web/catalog.mjs +175 -46
- package/js/web/docs.mjs +33 -12
- package/js/web/doctor-worker.mjs +14 -0
- package/js/web/handler.mjs +16 -5
- package/js/web/routes.mjs +24 -22
- package/js/web/state.mjs +78 -19
- package/js/web/update-check.mjs +27 -12
- package/js/web/user-files.mjs +76 -104
- package/package.json +7 -4
- package/registry.json +48 -55
- package/src/AGENT.md.tmpl +13 -14
- package/src/agents/_self-improvement.md +1 -1
- package/src/agents/_template.md +1 -1
- package/src/agents/advocate.md +1 -1
- package/src/agents/architect.md +1 -1
- package/src/agents/developer.md +1 -1
- package/src/agents/devops-engineer.md +1 -1
- package/src/agents/docker-expert.md +1 -1
- package/src/agents/docs.md +1 -1
- package/src/agents/empiricist.md +1 -1
- package/src/agents/explorer.md +1 -1
- package/src/agents/framer.md +1 -1
- package/src/agents/historian.md +1 -1
- package/src/agents/kubernetes-specialist.md +1 -1
- package/src/agents/memory-curator.md +2 -2
- package/src/agents/operator.md +1 -1
- package/src/agents/performance.md +1 -1
- package/src/agents/pragmatist.md +1 -1
- package/src/agents/react-engineer.md +1 -1
- package/src/agents/react-reviewer.md +1 -1
- package/src/agents/researcher.md +1 -1
- package/src/agents/reviewer.md +1 -1
- package/src/agents/security.md +1 -1
- package/src/agents/skeptic.md +1 -1
- package/src/agents/spring-boot-engineer.md +1 -1
- package/src/agents/spring-reviewer.md +1 -1
- package/src/agents/spring-security.md +1 -1
- package/src/agents/steward.md +1 -1
- package/src/agents/tester.md +1 -1
- package/src/agents/user-advocate.md +1 -1
- package/src/agents/visionary.md +1 -1
- package/src/memory/README.md +1 -1
- package/src/skills/_self-improvement.md +2 -2
- package/src/skills/daydream/SKILL.md +2 -2
- package/src/skills/daydream/instructions.md +1 -1
- package/src/skills/geneseed.md +1 -1
- package/src/skills/learn-mode.md +1 -2
- package/src/skills/profile.md +2 -2
- package/src/skills/rule/approve.md +75 -0
- package/src/skills/rule/consolidate.md +3 -3
- package/src/skills/rule.md +14 -5
- package/src/skills/skill-forge.md +1 -1
- package/src/skills/teach.md +29 -12
- package/src/skills/wiki.md +1 -1
- package/themes/_TEMPLATE.json +1 -2
- package/themes/biker.json +1 -2
- package/themes/commentator.json +1 -2
- package/themes/cyberpunk.json +1 -2
- package/themes/gamer.json +1 -2
- package/themes/imperial.json +1 -2
- package/themes/joker.json +1 -2
- package/themes/marvin.json +1 -2
- package/themes/mean.json +1 -2
- package/themes/military.json +1 -2
- package/themes/neutral.json +1 -2
- package/themes/pirate.json +1 -2
- package/themes/sports.json +1 -2
- package/themes/verstappen.json +1 -2
- package/themes/wizard.json +1 -2
- package/web/dist/assets/Activity-Ci4PZco3.js +1 -0
- package/web/dist/assets/ActivityDetail-C8hroCND.js +1 -0
- package/web/dist/assets/AgentGlyph-k6o3gCM1.js +1 -0
- package/web/dist/assets/Bonsai-C1iBAt4v.js +1 -0
- package/web/dist/assets/{CopyButton-C5Li6awl.js → CopyButton-DJ3a4N88.js} +1 -1
- package/web/dist/assets/Dashboard-C_On4KXw.js +2 -0
- package/web/dist/assets/Docs-Kffdg5uV.js +5 -0
- package/web/dist/assets/GreenhouseView-k56_cBSF.js +1 -0
- package/web/dist/assets/Installs-DtEKLC9h.js +3 -0
- package/web/dist/assets/JournalView-RQnk5l7I.js +1 -0
- package/web/dist/assets/Kits-CXkEBpnf.js +1 -0
- package/web/dist/assets/Laws-DhhIVqmh.js +3 -0
- package/web/dist/assets/Library-CAUiEoJo.js +3 -0
- package/web/dist/assets/{Loops-CzitjxGV.js → Loops-LKD8mF4E.js} +2 -2
- package/web/dist/assets/{Markdown-C4S4tTA7.js → Markdown-0ORz7tAc.js} +21 -21
- package/web/dist/assets/OperatorHudView-CM5jNPwL.js +1 -0
- package/web/dist/assets/Personal-B6Uoly3C.js +2 -0
- package/web/dist/assets/{RailCats-D5weYPCS.js → RailCats-DQxxYBEP.js} +1 -1
- package/web/dist/assets/Settings-BTe6-wda.js +1 -0
- package/web/dist/assets/Tabs-CbdDWTp_.js +1 -0
- package/web/dist/assets/api-D_r0Jtla.js +1 -0
- package/web/dist/assets/controls-D4wmg_pl.js +1 -0
- package/web/dist/assets/index-HfGmYXab.js +3 -0
- package/web/dist/assets/index-ao3M-Fhm.css +1 -0
- package/web/dist/assets/motion-RlUl1osO.js +1 -0
- package/web/dist/assets/{sections-ChwaobfW.js → sections-CtFz7HFH.js} +1 -1
- package/web/dist/index.html +5 -5
- package/src/skills/quiz.md +0 -44
- package/web/dist/assets/Activity-Bjy64wHC.js +0 -1
- package/web/dist/assets/ActivityDetail-B0AaipP8.js +0 -1
- package/web/dist/assets/Bonsai-CJniRqaH.js +0 -1
- package/web/dist/assets/Dashboard-B-6DTmae.js +0 -2
- package/web/dist/assets/Docs-LRc30XL9.js +0 -5
- package/web/dist/assets/GreenhouseView-CcoYlaWo.js +0 -1
- package/web/dist/assets/Installs-dp1epTcE.js +0 -3
- package/web/dist/assets/JournalView-nFP4poCf.js +0 -1
- package/web/dist/assets/KitApply-DwyZUj57.js +0 -1
- package/web/dist/assets/Kits-C0IEdZXe.js +0 -1
- package/web/dist/assets/Laws-CkykmQWu.js +0 -3
- package/web/dist/assets/Library-Guh9HBZU.js +0 -2
- package/web/dist/assets/OperatorHudView-DLGNulIY.js +0 -1
- package/web/dist/assets/Personal-BMtberL8.js +0 -2
- package/web/dist/assets/Tabs-uYJqfuQt.js +0 -1
- package/web/dist/assets/api-BxjLd7Qd.js +0 -1
- package/web/dist/assets/index-DA7BiaE5.js +0 -3
- package/web/dist/assets/index-dbbDGFDq.css +0 -1
- package/web/dist/assets/motion-Bccx3zE8.js +0 -1
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
//
|
|
29
29
|
// MACHINE WIKI (AGENT.md §8): the same block also carries the user's own knowledge
|
|
30
30
|
// base(s) — typically an Obsidian vault — declared once per machine in `geneseed-wiki.jsonc`
|
|
31
|
-
// ($GENESEED_WIKI -> $GENESEED_HARNESS/geneseed-wiki.jsonc -> beside this plugin's install
|
|
31
|
+
// ($GENESEED_WIKI -> $GENESEED_HARNESS/geneseed-wiki.jsonc -> beside this plugin's install ->
|
|
32
|
+
// the machine tier).
|
|
32
33
|
// Each wiki's eager entries inject in full and lazy entries list, drawing on the
|
|
33
34
|
// SAME budgets as the project context; its conventions/inbox/protected metadata is
|
|
34
35
|
// surfaced so the agent knows the house rules before writing. No wiki manifest, or an
|
|
@@ -116,8 +117,13 @@ async function mainWorktreeOf(dir) {
|
|
|
116
117
|
async function sovereignBypass(cwd) {
|
|
117
118
|
try {
|
|
118
119
|
const cfg = path.dirname(PLUGIN_DIR) // plugins/ sits directly in <cfg>
|
|
119
|
-
const
|
|
120
|
-
|
|
120
|
+
const listOf = async (file) => {
|
|
121
|
+
try { const l = JSON.parse(await fs.readFile(file, "utf8")).excludes; return Array.isArray(l) ? l : [] } catch { return [] }
|
|
122
|
+
}
|
|
123
|
+
const entries = await listOf(path.join(cfg, "excludes.json"))
|
|
124
|
+
// Shared list (<machineDir>/excludes.json): a GLOBAL install adds it, a project install never does.
|
|
125
|
+
const shared = await listOf(path.join(machineDir(), "excludes.json"))
|
|
126
|
+
if (shared.length && await readsTier(cfg)) entries.push(...shared)
|
|
121
127
|
const here = norm(cwd || process.cwd())
|
|
122
128
|
const main = await mainWorktreeOf(cwd || process.cwd())
|
|
123
129
|
const heres = main ? [here, norm(main)] : [here]
|
|
@@ -214,8 +220,9 @@ async function isDir(p) {
|
|
|
214
220
|
// tests/unit/claude.test.mjs gates both copies against SESSION_SEEDS in js/build/stubs.mjs.
|
|
215
221
|
// context.json is not here: it is a manifest, honoured by resolveSource. geneseed-wiki.jsonc
|
|
216
222
|
// is not here either: the MACHINE WIKI block below already renders it in full.
|
|
217
|
-
const SESSION_FILES = ["user-rules.md", "PROFILE.md", "memory/MEMORY.md", "
|
|
218
|
-
|
|
223
|
+
const SESSION_FILES = ["user-rules.md", "PROFILE.md", "memory/MEMORY.md", "notebook/NOTEBOOK.md"]
|
|
224
|
+
// The wiki manifest's names, newest first: WIKI_NAMES in js/lib/machine-dir.mjs.
|
|
225
|
+
const WIKI_NAMES = ["geneseed-wiki.jsonc", "wiki.jsonc", "wiki.json"]
|
|
219
226
|
const SEED_SHA256 = new Set([
|
|
220
227
|
"5c2e92fb1acde041e02d9ebf158460d8ff7a07cbc2b447859631604610130721", // user-rules.md
|
|
221
228
|
"29e012c3c4349ea62a9082cbd04bb25599a0ec280d62c33f6e10742809471816", // PROFILE.md
|
|
@@ -238,18 +245,72 @@ async function harnessDir() {
|
|
|
238
245
|
return null
|
|
239
246
|
}
|
|
240
247
|
|
|
241
|
-
//
|
|
248
|
+
// The machine tier: machineDir() in js/lib/machine-dir.mjs, which a plugin cannot import.
|
|
249
|
+
function machineDir() {
|
|
250
|
+
return path.join(process.env.XDG_CONFIG_HOME || path.join(homedir(), ".config"), "geneseed")
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Only a global install reads the tier: its .geneseed-emit names a -global emit, or it is the host's config dir.
|
|
254
|
+
// The host's own config dir counts as global too, whatever its marker says (the hook's
|
|
255
|
+
// isHostGlobalDir accepts both): OPENCODE_CONFIG_DIR, else <XDG config>/opencode.
|
|
256
|
+
const hostConfigDir = () => process.env.OPENCODE_CONFIG_DIR || path.join(process.env.XDG_CONFIG_HOME || path.join(homedir(), ".config"), "opencode")
|
|
257
|
+
async function isHostConfigDir(dir) {
|
|
258
|
+
const real = async (d) => { const r = await fs.realpath(path.resolve(d)).catch(() => path.resolve(d)); return process.platform === "win32" ? r.toLowerCase() : r }
|
|
259
|
+
return (await real(dir)) === (await real(hostConfigDir()))
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
async function readsTier(dir) {
|
|
263
|
+
try { if ((await fs.readFile(path.join(dir, ".geneseed-emit"), "utf8")).trim().endsWith("-global")) return true } catch { /* no marker */ }
|
|
264
|
+
return isHostConfigDir(dir)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// A PROJECT install with `Shared tier: on` in its AGENT.md reads the tier too (the hook's projectReadsTier),
|
|
268
|
+
// unless a global OpenCode install exists: its plugin loads beside this one and already injects it, so a
|
|
269
|
+
// second tier here would be a double. The global install's marker is <config dir>/.geneseed-emit.
|
|
270
|
+
async function projectReadsTier(dir) {
|
|
271
|
+
try {
|
|
272
|
+
if (!/^Shared tier:[ \t]*on[ \t]*\r?$/m.test(await fs.readFile(path.join(dir, "AGENT.md"), "utf8"))) return false
|
|
273
|
+
return !(await isFile(path.join(hostConfigDir(), ".geneseed-emit")))
|
|
274
|
+
} catch { return false }
|
|
275
|
+
}
|
|
276
|
+
async function tierFor(dir) { return (await readsTier(dir)) || (await projectReadsTier(dir)) }
|
|
277
|
+
|
|
278
|
+
// The fold's pending items, the twin of js/hosts/hooks-context.mjs `draftLine`: same line, same count.
|
|
279
|
+
async function draftLine() {
|
|
280
|
+
try {
|
|
281
|
+
const { items } = JSON.parse(await fs.readFile(path.join(machineDir(), ".fold-state.json"), "utf8"))
|
|
282
|
+
const n = Object.values(items ?? {}).filter((i) => i?.state === "pending").length
|
|
283
|
+
return n ? `[drafts] ${n} drafted item${n === 1 ? "" : "s"} in user-rules.draft.md wait${n === 1 ? "s" : ""} for the user's decision (the rule skill or the web console).` : null
|
|
284
|
+
} catch { return null }
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// A session file's text, CRLF-folded and trimmed; null when missing, unreadable or still its seed.
|
|
288
|
+
async function sessionText(abs) {
|
|
289
|
+
let text
|
|
290
|
+
try { text = (await fs.readFile(abs, "utf8")).replace(/\r\n/g, "\n") } catch { return null }
|
|
291
|
+
if (SEED_SHA256.has(createHash("sha256").update(text).digest("hex"))) return null
|
|
292
|
+
return text.replace(/\n+$/, "")
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Session files in force for the harness dir, changed from their seed: [{ rel, abs, text, label }],
|
|
296
|
+
// one per layer. A global install reads the tier first, then its own host layer; the notebook stays
|
|
297
|
+
// per host. PROFILE.md is whole, so a non-seed host copy replaces the shared one. The others
|
|
298
|
+
// concatenate. The (shared) and (host: …) labels appear only when the tier has a say in that file.
|
|
242
299
|
async function sessionFiles(dir) {
|
|
243
300
|
const found = []
|
|
244
301
|
if (!dir) return found
|
|
302
|
+
const tier = await tierFor(dir)
|
|
303
|
+
const entry = (rel, abs, text, label) => {
|
|
304
|
+
const nudge = rel === "memory/MEMORY.md" ? memoryNudge(text) : ""
|
|
305
|
+
found.push({ rel, abs, label, text: nudge ? `${text}\n${nudge}` : text })
|
|
306
|
+
}
|
|
245
307
|
for (const rel of SESSION_FILES) {
|
|
246
308
|
const abs = path.join(dir, rel)
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
found.push({ rel, abs, text: nudge ? `${text}\n${nudge}` : text })
|
|
309
|
+
const host = await sessionText(abs)
|
|
310
|
+
const sharedAbs = tier && rel !== "notebook/NOTEBOOK.md" ? path.join(machineDir(), rel) : null
|
|
311
|
+
const shared = sharedAbs ? await sessionText(sharedAbs) : null
|
|
312
|
+
if (shared !== null && !(host !== null && rel === "PROFILE.md")) entry(rel, sharedAbs, shared, "shared")
|
|
313
|
+
if (host !== null) entry(rel, abs, host, shared === null ? "" : "host: opencode")
|
|
253
314
|
}
|
|
254
315
|
return found
|
|
255
316
|
}
|
|
@@ -610,6 +671,7 @@ async function resolveSource(root, harness = null) {
|
|
|
610
671
|
// 1. $GENESEED_WIKI explicit manifest path
|
|
611
672
|
// 2. $GENESEED_HARNESS/geneseed-wiki.jsonc pinned install dir
|
|
612
673
|
// 3. <plugin dir>/../geneseed-wiki.jsonc auto-locate: beside the installed AGENT.md
|
|
674
|
+
// 4. <machine dir>/geneseed-wiki.jsonc global install only, when 2 and 3 are absent or a seed
|
|
613
675
|
async function resolveWikiFile() {
|
|
614
676
|
const explicit = process.env.GENESEED_WIKI
|
|
615
677
|
if (explicit && (await isFile(explicit))) return explicit
|
|
@@ -620,14 +682,18 @@ async function resolveWikiFile() {
|
|
|
620
682
|
const harness = await harnessDir()
|
|
621
683
|
if (harness) bases.push(harness)
|
|
622
684
|
bases.push(path.resolve(PLUGIN_DIR, ".."))
|
|
685
|
+
let host = null
|
|
623
686
|
for (const base of bases) {
|
|
624
|
-
|
|
625
|
-
for (const name of ["geneseed-wiki.jsonc", "wiki.jsonc", "wiki.json"]) {
|
|
687
|
+
for (const name of WIKI_NAMES) {
|
|
626
688
|
const p = path.join(base, name)
|
|
627
|
-
if (await isFile(p))
|
|
689
|
+
if (!host && (await isFile(p))) host = p
|
|
628
690
|
}
|
|
629
691
|
}
|
|
630
|
-
|
|
692
|
+
if (harness && (await tierFor(harness)) && (!host || (await sessionText(host)) === null)) {
|
|
693
|
+
const shared = path.join(machineDir(), WIKI_NAMES[0])
|
|
694
|
+
if ((await sessionText(shared)) !== null) return shared
|
|
695
|
+
}
|
|
696
|
+
return host
|
|
631
697
|
}
|
|
632
698
|
|
|
633
699
|
// Walk a vault folder for .md notes — like the project walk, but dot-folders are
|
|
@@ -806,7 +872,7 @@ async function buildBlock(sets, wikis = [], commands = [], session = [], done =
|
|
|
806
872
|
const ses = []
|
|
807
873
|
for (const s of session) {
|
|
808
874
|
const size = Buffer.byteLength(s.text, "utf8")
|
|
809
|
-
ses.push(`----- ${s.rel} -----`)
|
|
875
|
+
ses.push(`----- ${s.rel}${s.label ? ` (${s.label})` : ""} -----`)
|
|
810
876
|
if (size > EAGER_FILE_KB * 1024) {
|
|
811
877
|
ses.push(`[demoted: ${s.rel} exceeded ${EAGER_FILE_KB} KB — read ${s.abs} on demand]`, "")
|
|
812
878
|
continue
|
|
@@ -860,7 +926,8 @@ async function resolveBlock(root, judged = true) {
|
|
|
860
926
|
const done = (await doneGateOff()) ? null : await doneLine(root, judged).catch(() => null)
|
|
861
927
|
const owned = (await ownershipGateOff()) ? null : await ownershipLine(root).catch(() => null)
|
|
862
928
|
const floor = await runtimeFloorLine(root).catch(() => null)
|
|
863
|
-
const
|
|
929
|
+
const drafts = harness && (await tierFor(harness)) ? await draftLine() : null
|
|
930
|
+
const heads = [done, owned, floor, drafts].filter(Boolean).join("\n") || null
|
|
864
931
|
return { block: await buildBlock(sets, wikis, commands, await sessionFiles(harness), heads), src }
|
|
865
932
|
}
|
|
866
933
|
|