geneseed 4.32.0 → 5.0.0
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 +85 -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 +4 -2
- 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 +116 -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 +126 -68
- package/harness.config.json +1 -1
- package/js/README.md +10 -6
- 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/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 +55 -167
- 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 +189 -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 +106 -30
- 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 +22 -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 +79 -89
- 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 +130 -74
- 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 +14 -5
- package/js/web/routes.mjs +17 -19
- package/js/web/state.mjs +78 -19
- package/js/web/update-check.mjs +25 -10
- package/js/web/user-files.mjs +50 -105
- 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 +69 -0
- package/src/skills/rule/consolidate.md +3 -3
- package/src/skills/rule.md +13 -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-D8G4eClY.js +1 -0
- package/web/dist/assets/ActivityDetail-BtOBYk3M.js +1 -0
- package/web/dist/assets/AgentGlyph-k6o3gCM1.js +1 -0
- package/web/dist/assets/Bonsai-B_y20b3i.js +1 -0
- package/web/dist/assets/{CopyButton-C5Li6awl.js → CopyButton-CHQte7Ap.js} +1 -1
- package/web/dist/assets/Dashboard-B8uXeJZ_.js +2 -0
- package/web/dist/assets/Docs-Dgv_MWfT.js +5 -0
- package/web/dist/assets/GreenhouseView-CSzTMSl_.js +1 -0
- package/web/dist/assets/Installs-BDk9lqBI.js +3 -0
- package/web/dist/assets/JournalView-CvRk1-m5.js +1 -0
- package/web/dist/assets/Kits-CoITzxWM.js +1 -0
- package/web/dist/assets/Laws-Ctf5r9rE.js +3 -0
- package/web/dist/assets/Library-DNwHYVXt.js +3 -0
- package/web/dist/assets/{Loops-CzitjxGV.js → Loops-S85PMQ8m.js} +2 -2
- package/web/dist/assets/{Markdown-C4S4tTA7.js → Markdown-0ORz7tAc.js} +21 -21
- package/web/dist/assets/OperatorHudView-DuGz_sTk.js +1 -0
- package/web/dist/assets/Personal-afJNwvRS.js +2 -0
- package/web/dist/assets/{RailCats-D5weYPCS.js → RailCats-AW92uhsX.js} +1 -1
- package/web/dist/assets/Settings-CGDFz-6j.js +1 -0
- package/web/dist/assets/Tabs-1qLrnqmn.js +1 -0
- package/web/dist/assets/api-C46vAuqp.js +1 -0
- package/web/dist/assets/controls-D4wmg_pl.js +1 -0
- package/web/dist/assets/index-COTd4TRZ.js +3 -0
- package/web/dist/assets/index-CtorA7uK.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
package/js/ui/cli.mjs
CHANGED
|
@@ -1,38 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `js/cli-table.json` — the CLI as data, and the one place either implementation describes it.
|
|
3
3
|
*
|
|
4
|
-
* WHY THIS FILE EXISTS.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* verbs `bin/geneseed-cli.mjs` cannot even run. This port's standing rule is that a copy of a
|
|
9
|
-
* value under test stops being the value under test, and that would have been the largest
|
|
10
|
-
* copy in it.
|
|
4
|
+
* WHY THIS FILE EXISTS. The CLI surface is 26 invocable names (`update` aliases `upgrade`),
|
|
5
|
+
* and a hand-written copy of it for the console's `cli` docs page would describe verbs
|
|
6
|
+
* `bin/geneseed-cli.mjs` cannot even run. A copy of a value under test stops being the value
|
|
7
|
+
* under test, and that would have been the largest copy in the tree.
|
|
11
8
|
*
|
|
12
|
-
*
|
|
13
|
-
* a since-deleted Python script and read by both sides. P2 finishes the thought: the table is
|
|
14
|
-
* no longer GENERATED from anything, it is the OWNED document, and it lives here on a product
|
|
9
|
+
* So the metadata is DATA: the table is the OWNED document, and it lives here on a product
|
|
15
10
|
* path because that is where a document npm ships belongs. `package.json`'s `files[]` already
|
|
16
11
|
* carries `js/`, so it needs no row of its own, and nothing has to import out of `tests/`.
|
|
17
12
|
*
|
|
18
13
|
* ITS READERS, and each one takes a different view of the same rows:
|
|
19
14
|
*
|
|
20
|
-
* * `cliReference()` — `js/web/docs.mjs`'s `cli` kind
|
|
15
|
+
* * `cliReference()` — `js/web/docs.mjs`'s `cli` kind. STRIPS the
|
|
21
16
|
* hidden arguments and the two fields the page never carried;
|
|
22
|
-
* * `cliSpec()` — `bin/geneseed-cli.mjs`'s argument parser.
|
|
23
|
-
*
|
|
24
|
-
* subparsers by name only, so `VERBS` is now `{ fn }` per row and everything
|
|
25
|
-
* argparse-shaped is derived here. KEEPS the hidden arguments, `--port`'s int type and
|
|
17
|
+
* * `cliSpec()` — `bin/geneseed-cli.mjs`'s argument parser. `VERBS` is `{ fn }` per row
|
|
18
|
+
* and everything argparse-shaped is derived here. KEEPS the hidden arguments, `--port`'s int type and
|
|
26
19
|
* `theme`'s mutex group, none of which the page may show;
|
|
27
20
|
* * `cliCommand()`/`printHelp()` — `--help` on BOTH entry points, so the table owes a row to
|
|
28
21
|
* every verb `bin/geneseed-hook.mjs` dispatches as well, not only to the CLI entry's.
|
|
29
22
|
*
|
|
30
23
|
* THE STORED SHAPE IS THE UNION AND MUST STAY ONE. Neither reader's shape can be the file's:
|
|
31
24
|
* a file filtered for the page breaks the CLI, and a file in `cliSpec`'s shape cannot render
|
|
32
|
-
* the docs.
|
|
25
|
+
* the docs.
|
|
33
26
|
*
|
|
34
|
-
* WHAT GUARDS IT. The
|
|
35
|
-
* against argparse; the table is now simply the source of truth and is edited directly.
|
|
27
|
+
* WHAT GUARDS IT. The table is the source of truth and is edited directly.
|
|
36
28
|
* `tests/unit/cli_table.test.mjs` checks the WHOLE table.
|
|
37
29
|
*
|
|
38
30
|
* THE COST, NAMED: this entry cannot parse anything without this file. `js/build/source.mjs`
|
|
@@ -57,10 +49,9 @@ const PAGE_ARG_KEYS = ['names', 'dest', 'metavar', 'help', 'choices', 'default',
|
|
|
57
49
|
* `js/cli-table.json`, parsed. An unreadable file is the empty reference; the entry points
|
|
58
50
|
* turn that into a refusal that names itself rather than a parse with no rules.
|
|
59
51
|
*
|
|
60
|
-
* NOT MEMOISED
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* reviewer would look for. One re-read of a file this size is not a cost worth buying that with.
|
|
52
|
+
* NOT MEMOISED: a cache here would leave a running daemon showing the table it started with
|
|
53
|
+
* after the file was edited, a divergence no cell can reach and no reviewer would look for.
|
|
54
|
+
* One re-read of a file this size is not a cost worth buying that with.
|
|
64
55
|
*/
|
|
65
56
|
function load() {
|
|
66
57
|
try {
|
|
@@ -99,9 +90,9 @@ export function cliReference() {
|
|
|
99
90
|
/**
|
|
100
91
|
* `-h/--help`, which the table does NOT carry.
|
|
101
92
|
*
|
|
102
|
-
* argparse adds it at parser construction,
|
|
103
|
-
* is absent from every command in the file and present in every help text
|
|
104
|
-
*
|
|
93
|
+
* argparse adds it at parser construction, so it
|
|
94
|
+
* is absent from every command in the file and present in every help text.
|
|
95
|
+
* It is a row here rather than special-cased in the renderer, because it is
|
|
105
96
|
* first in the options section and first in the usage line for every verb the table carries —
|
|
106
97
|
* a position it only gets by being an action like the others.
|
|
107
98
|
*/
|
|
@@ -153,8 +144,7 @@ function actionInvocation(a, positional) {
|
|
|
153
144
|
// hyphenated word into two chunks, so it can break a line inside `back-compat` where a
|
|
154
145
|
// space-only wrap cannot. Measured before deciding: every help string then in the table disagreed
|
|
155
146
|
// with a greedy wrap at some width, the widest at 175 — so "the branch is dead" was simply
|
|
156
|
-
// false
|
|
157
|
-
// the run that first asserted it. The rules are transcribed instead.
|
|
147
|
+
// false. The rules are transcribed instead.
|
|
158
148
|
//
|
|
159
149
|
// Python's classes, spelled for a `u`-flagged JavaScript regex: `\w` is letters, numbers and
|
|
160
150
|
// underscore; `[^\d\W]` is that minus the DECIMAL digits, which leaves the letter-ish half
|
|
@@ -305,28 +295,18 @@ function formatAction(a, positional, helpPosition, width) {
|
|
|
305
295
|
/**
|
|
306
296
|
* `parser.format_help()` for one subcommand, byte for byte with argparse.
|
|
307
297
|
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
* `
|
|
311
|
-
*
|
|
312
|
-
* absence of the surface, on the binary that survives the reference's deletion.
|
|
298
|
+
* `prog` IS AN ARGUMENT: a user who typed `geneseed status --help` is shown
|
|
299
|
+
* `usage: geneseed status`, which is also how every error this entry prints already spells
|
|
300
|
+
* itself (`die`). The layout is pinned by the written-out `formatHelp` rows in
|
|
301
|
+
* `tests/unit/text_layout.test.mjs`.
|
|
313
302
|
*
|
|
314
|
-
* `
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
* answers through here with `prog` set to the reference's own, so the layout was gated byte for
|
|
319
|
-
* byte and the rename was the only thing that moved. That corpus is gone; the layout is now
|
|
320
|
-
* pinned by the written-out `formatHelp` rows in `tests/unit/text_layout.test.mjs`.
|
|
303
|
+
* `catalog`, `mcp` and `memory` have no subparser to render from, so they are held
|
|
304
|
+
* ABSOLUTELY instead — and `tests/unit/hook_cli.test.mjs`'s `NATIVE` list names that
|
|
305
|
+
* population and fails a verb that falls into neither, which is what keeps "no recorded
|
|
306
|
+
* text" from meaning "no gate".
|
|
321
307
|
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* `tests/unit/hook_cli.test.mjs`'s `NATIVE` list still names that population and fails a verb
|
|
325
|
-
* that falls into neither, which is what keeps "no recorded text" from meaning "no gate".
|
|
326
|
-
*
|
|
327
|
-
* The alias rides on the same argument: argparse gives `update` the parser object it built for
|
|
328
|
-
* `upgrade`, so `harness.py update --help` printed `usage: harness upgrade`. The recorded prog
|
|
329
|
-
* map reproduced that; the shipped call passes `geneseed update`, which is what the user typed.
|
|
308
|
+
* The alias rides on the same argument: the shipped call passes `geneseed update`, which is
|
|
309
|
+
* what the user typed.
|
|
330
310
|
*
|
|
331
311
|
* `width` is argparse's `shutil.get_terminal_size().columns - 2`, passed in rather than read,
|
|
332
312
|
* because a recorded help text whose wrap column came from the recorder's terminal is a corpus
|
|
@@ -401,16 +381,14 @@ export function formatHelp(cmd, prog, width) {
|
|
|
401
381
|
* reads `COLUMNS` before it asks the tty, and falls back to 80 when neither answers, which is
|
|
402
382
|
* every pipe both implementations write help into.)
|
|
403
383
|
*
|
|
404
|
-
* `parseIntStrict`, NOT `Number.parseInt`, and the tree already owned it. `get_terminal_size`
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
* why a unit test is the gate rather than a cell. A non-positive value falls through on both
|
|
413
|
-
* sides, which is Python's `if columns <= 0` and was already right here.
|
|
384
|
+
* `parseIntStrict`, NOT `Number.parseInt`, and the tree already owned it. `get_terminal_size`
|
|
385
|
+
* parses `$COLUMNS` with `int()`, and `int` is not `parseInt` (`tests/unit/cli_table.test.mjs`'s
|
|
386
|
+
* 'the help width is the terminal width less two, and COLUMNS wins' keeps a written-out part
|
|
387
|
+
* of the corpus): `COLUMNS=1_0` is 10 to `int` and 1 to `parseInt`, `COLUMNS=٣` is 3 and
|
|
388
|
+
* NaN, `COLUMNS=' 80 '` is 80 and NaN. `COLUMNS=80abc` is a ValueError to `int` and 80 to
|
|
389
|
+
* `parseInt` — the same answer down a PIPE, where the fallback is 80 either way, and a
|
|
390
|
+
* different one on any terminal that is not 80 wide, which is why a unit test is the gate
|
|
391
|
+
* rather than a cell. A non-positive value falls through on both sides.
|
|
414
392
|
*
|
|
415
393
|
* `stripWhitespace` because THIS is the caller `parseIntStrict`'s docblock did not have: its other two
|
|
416
394
|
* strip before calling, and `$COLUMNS` arrives however the shell set it — `int(' 80 ')` is 80.
|
|
@@ -471,7 +449,7 @@ const camel = (dest) => dest.replace(/_([a-z])/g, (_m, c) => c.toUpperCase());
|
|
|
471
449
|
* EVERY ROW OF THIS MAPPING WAS A HAND-WRITTEN COMMENT IN THAT FILE'S `VERBS` TABLE, and each
|
|
472
450
|
* one names a failure it prevents:
|
|
473
451
|
*
|
|
474
|
-
* * a positional with `nargs="?"` is OPTIONAL — `link [dir]`, `upgrade [
|
|
452
|
+
* * a positional with `nargs="?"` is OPTIONAL — `link [dir]`, `upgrade [theme]`;
|
|
475
453
|
* * a positional with `nargs="*"` is the trailing SINK (`bootstrap extra`), and `parse`
|
|
476
454
|
* keeps it from absorbing options, which is what stops `bootstrap --no-setpu` from
|
|
477
455
|
* running a full update-and-wizard while the user believes they asked for neither;
|
package/js/ui/menu.mjs
CHANGED
|
@@ -1,36 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `menu` and `home` —
|
|
2
|
+
* `menu` and `home` — the two dispatchers.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* `cmdMenu` is a FORK, not a menu. Off a TTY it prints five lines of command list and
|
|
5
|
+
* returns 0. On a TTY it falls back to the same command list rather than inventing a
|
|
6
|
+
* second menu: there is no full-screen panel, by decision, and it is stated as such on
|
|
7
|
+
* stderr. A numbered line-menu built out of `js/maintain/setup.mjs`'s `askChoice` was
|
|
8
|
+
* considered and refused: it would be a separate user interface, unreachable from every cell
|
|
9
|
+
* (no cell has a TTY), for a panel that was rejected outright rather than deferred. The
|
|
10
|
+
* off-TTY arm is what every cell can reach.
|
|
6
11
|
*
|
|
7
|
-
* `
|
|
8
|
-
*
|
|
9
|
-
* panel, which is P7c's and is not here. The fork's off-TTY arm is what every cell of this
|
|
10
|
-
* port can reach, and it is ported byte for byte.
|
|
12
|
+
* `cmdHome` is the default for a bare `geneseed`. Its two arms are `webFirstOk()` — the
|
|
13
|
+
* web console, started by `startDaemon` — and `cmdMenu` above.
|
|
11
14
|
*
|
|
12
|
-
*
|
|
13
|
-
* has that behaviour: `cmd_menu` wraps the panel in `except Exception`, writes `[menu] TUI
|
|
14
|
-
* unavailable (<reason>)` to stderr and prints the same command list. Node's reason is
|
|
15
|
-
* permanent rather than accidental, and it is stated as such.
|
|
16
|
-
*
|
|
17
|
-
* ⚠ THE REASON THIS HEADER ORIGINALLY GAVE WAS WRONG, and P7b measured it: it said the
|
|
18
|
-
* reference reaches that arm often because "`import curses` fails on stock Windows Python".
|
|
19
|
-
* A bare `import curses` does fail here, but `rituals/_harness_core.py` installs
|
|
20
|
-
* `rituals/_winterm.py` under the name `curses` when it does — so inside the harness the
|
|
21
|
-
* import succeeds, the panel opens, and it is the PORT that has no window. The fallback is
|
|
22
|
-
* still the right shape; only its explanation moved. The alternative that was considered and
|
|
23
|
-
* refused: building a numbered line-menu out of `js/maintain/setup.mjs`'s `askChoice`. That is not a
|
|
24
|
-
* port of `_main_menu` — it is a THIRD user interface, differing from the reference on every
|
|
25
|
-
* screen, unreachable from every cell (no cell has a TTY), for a panel that was rejected
|
|
26
|
-
* outright rather than deferred. The fallback is the reference's own contract for "no
|
|
27
|
-
* full-screen menu available here"; a new UI would not be.
|
|
28
|
-
*
|
|
29
|
-
* `cmd_home` is the default for a bare `geneseed`, and it crosses WHOLE. Its two arms are
|
|
30
|
-
* `_web_first_ok()` — the web console, which is P6h's `startDaemon` and is fully ported —
|
|
31
|
-
* and `cmd_menu` above. Nothing in it was deferred.
|
|
32
|
-
*
|
|
33
|
-
* `_web_first_ok`'s FIVE REFUSALS ARE THE PAYLOAD, and only two of them are reachable from a
|
|
15
|
+
* `webFirstOk`'s FIVE REFUSALS ARE THE PAYLOAD, and only two of them are reachable from a
|
|
34
16
|
* cell: a cell's stdin is a pipe, so `isTTY` is false and everything past it is dead. The
|
|
35
17
|
* other three (SSH, the Linux display server, the browser) are gated by
|
|
36
18
|
* `tests/unit/web_first.test.mjs`, which drives this function through
|
|
@@ -40,7 +22,7 @@ import { printOut, printErr } from '../lib/fs.mjs';
|
|
|
40
22
|
import { which } from '../lib/paths.mjs';
|
|
41
23
|
import { startDaemon } from '../web/daemon.mjs';
|
|
42
24
|
|
|
43
|
-
/**
|
|
25
|
+
/** The off-TTY arm, and the fallback both TTY arms end in. */
|
|
44
26
|
function menuHelp() {
|
|
45
27
|
printOut('Geneseed — no interactive menu here. Get started with: geneseed setup\n');
|
|
46
28
|
printOut('Other commands: bootstrap · update · build · doctor · diff · tui · web\n');
|
|
@@ -57,12 +39,10 @@ function menuHelp() {
|
|
|
57
39
|
* `cmd /c start` on Windows and `open` on macOS are OS builtins that are always there, and
|
|
58
40
|
* everywhere else it is `xdg-open`, which is not.
|
|
59
41
|
*
|
|
60
|
-
* DECLARED
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* here), and closing it would mean reproducing `webbrowser`'s registry — a table of browser
|
|
65
|
-
* names that would go stale silently, which is the shape this port refuses.
|
|
42
|
+
* DECLARED LIMIT: on Linux this does not consult `$BROWSER` or a list of a dozen browser
|
|
43
|
+
* binaries, so a box with `firefox` on PATH and no `xdg-open` answers false. Closing it
|
|
44
|
+
* would mean reproducing `webbrowser`'s registry — a table of browser names that would go
|
|
45
|
+
* stale silently, which is the shape this code refuses.
|
|
66
46
|
*/
|
|
67
47
|
function browserAvailable() {
|
|
68
48
|
if (process.platform === 'win32' || process.platform === 'darwin') return true;
|
|
@@ -70,8 +50,8 @@ function browserAvailable() {
|
|
|
70
50
|
}
|
|
71
51
|
|
|
72
52
|
/**
|
|
73
|
-
*
|
|
74
|
-
* Deliberately conservative
|
|
53
|
+
* Whether a bare `geneseed` opens the web UI rather than the TUI menu.
|
|
54
|
+
* Deliberately conservative: any doubt falls back to the menu, so
|
|
75
55
|
* a server box is never dropped into a browser launch that cannot open.
|
|
76
56
|
*/
|
|
77
57
|
export function webFirstOk() {
|
|
@@ -86,18 +66,15 @@ export function webFirstOk() {
|
|
|
86
66
|
return browserAvailable();
|
|
87
67
|
}
|
|
88
68
|
|
|
89
|
-
/**
|
|
69
|
+
/** See this module's header for why the TTY arm falls back. */
|
|
90
70
|
export function cmdMenu() {
|
|
91
71
|
if (!process.stdin.isTTY) return menuHelp();
|
|
92
|
-
//
|
|
93
|
-
// than machine-dependent. stderr, and CRLF on Windows, because `sys.stderr.write` does.
|
|
72
|
+
// stderr, and CRLF on Windows.
|
|
94
73
|
//
|
|
95
74
|
// The reason is on THIS side: there is no window implementation, by decision, and that is
|
|
96
75
|
// what the message says (`tests/unit/no_panel.test.mjs` keeps it so).
|
|
97
|
-
// NOTHING TO POINT AT
|
|
98
|
-
//
|
|
99
|
-
// is the Python this migration deletes, and a refusal that sends a user to a file which
|
|
100
|
-
// will not be there is worse than one that simply says the screen does not exist.
|
|
76
|
+
// NOTHING TO POINT AT: a refusal that sends a user to a file which will not be there is
|
|
77
|
+
// worse than one that simply says the screen does not exist.
|
|
101
78
|
printErr('[menu] TUI unavailable (this entry has no full-screen menu).\n');
|
|
102
79
|
return menuHelp();
|
|
103
80
|
}
|
package/js/ui/tui.mjs
CHANGED
|
@@ -1,59 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `tui` — and the TUI's pure half
|
|
2
|
+
* `tui` — and the TUI's pure half: the layout helpers that have no screen in them.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* `cmdTui` is an entry with no full-screen panel. Off a TTY it prints one line and returns 1;
|
|
5
|
+
* on a TTY it prints a refusal that names the console and returns 1, rather than inventing
|
|
6
|
+
* a screen — the same decision `js/ui/menu.mjs` makes. `tests/unit/no_panel.test.mjs` fakes
|
|
7
|
+
* `isTTY` true in a child and asserts BOTH arms — the exit code, and that the refusal names
|
|
8
|
+
* the console rather than pretending to draw.
|
|
5
9
|
*
|
|
6
|
-
*
|
|
7
|
-
* prints one line and returns 1; when `import curses` fails it prints one line and returns
|
|
8
|
-
* 1; otherwise it builds the inventory and hands the screen to `curses.wrapper(_tui_loop)`.
|
|
9
|
-
* NO CELL COULD EVER GIVE `cmd_tui` A TTY while the acceptance matrix was the gate, so the
|
|
10
|
-
* off-TTY arm was the whole of its reachable behaviour. That changed with the matrix:
|
|
11
|
-
* `tests/unit/no_panel.test.mjs` fakes `isTTY` true in a child and asserts BOTH arms — the
|
|
12
|
-
* exit code, and that the refusal names the console rather than pretending to draw.
|
|
13
|
-
*
|
|
14
|
-
* THE PANEL ITSELF IS P7C'S, AND THIS ENTRY FALLS BACK RATHER THAN INVENTING ONE — the same
|
|
15
|
-
* decision `js/ui/menu.mjs` made in P7a, for the same reason. `cmd_tui` already owns a fourth
|
|
16
|
-
* path: an `except Exception` around `curses.wrapper` that prints `[tui] full-screen panel
|
|
17
|
-
* unavailable (<reason>)` and returns 1, written for the Windows shim's `Unsupported`. That
|
|
18
|
-
* is the reference's own contract for "no full-screen panel is available here", so the port
|
|
19
|
-
* speaks it with a reason that is permanent rather than machine-dependent. A Node panel that
|
|
20
|
-
* differed from the reference on every screen, that no cell could reach, and that would be
|
|
21
|
-
* deleted the day the real one crossed, would be a second user interface and not a port.
|
|
22
|
-
*
|
|
23
|
-
* WHAT DOES CROSS is the alignment contract — the functions below that decide what a row
|
|
10
|
+
* What lives here is the alignment contract — the functions below that decide what a row
|
|
24
11
|
* looks like: display width, fitting, glyph tiers, the catalogue's entries and detail lines.
|
|
25
12
|
* Each has a caller outside this file (the catalogue, the status panel, the web console).
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* readers — were deleted rather than kept waiting for a screen that will not come.
|
|
29
|
-
*
|
|
30
|
-
* WHAT IS DELIBERATELY NOT HERE: `_bx` (its non-ASCII arm returned `curses.ACS_*` chtype
|
|
31
|
-
* ints, which belonged with the window) and every `(stdscr, curses, pal)` drawing helper.
|
|
32
|
-
* `_wrap_lines` is NOT deferred but RETIRED — it reflowed a body into a fixed-width detail
|
|
33
|
-
* pane, the pane is gone, and the web console does its own wrapping.
|
|
13
|
+
* There is no panel, so nothing exists only for one: no spinner, wordmark, scroll clamping,
|
|
14
|
+
* progress bar or theme preview.
|
|
34
15
|
*
|
|
35
|
-
* **DO NOT WRITE A SECOND LINE BREAKER.**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* Anything that needs wrapping wraps THAT. `_parse_laws`, `load_registry`, `entity_status` and
|
|
40
|
-
* `_tui_inventory` crossed in P6c and live in `js/inspect/inventory.mjs`.
|
|
16
|
+
* **DO NOT WRITE A SECOND LINE BREAKER.** `wrapText` in `js/ui/cli.mjs` is the one,
|
|
17
|
+
* pinned by the written-out rows in `tests/unit/text_layout.test.mjs`. Anything that needs
|
|
18
|
+
* wrapping wraps THAT. The law parser, registry and inventory walk live in
|
|
19
|
+
* `js/inspect/inventory.mjs`.
|
|
41
20
|
*/
|
|
42
21
|
import { splitLines } from '../lib/udiff.mjs';
|
|
43
22
|
import { printOut } from '../lib/fs.mjs';
|
|
44
23
|
|
|
45
24
|
// ---- display tiers -------------------------------------------------------------------
|
|
46
25
|
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
// same reason. `bool(os.environ.get(x))` and `!!process.env.x` agree on the case that
|
|
51
|
-
// matters: an EMPTY value is not set.
|
|
26
|
+
// Read into MODULE CONSTANTS at import time, so a process answers one way for its whole
|
|
27
|
+
// life and a probe runs one process per mode rather than monkeypatching. An EMPTY value is
|
|
28
|
+
// not set.
|
|
52
29
|
const TUI_ASCII = !!process.env.GENESEED_TUI_ASCII;
|
|
53
30
|
const TUI_PLAIN = !!process.env.GENESEED_TUI_PLAIN;
|
|
54
31
|
const TUI_EMOJI = !(TUI_ASCII || TUI_PLAIN);
|
|
55
32
|
|
|
56
|
-
/**
|
|
33
|
+
/** The one glyph table for the whole TUI, unicode or ASCII stand-ins. */
|
|
57
34
|
export function glyphs(asciiMode) {
|
|
58
35
|
return {
|
|
59
36
|
sel: asciiMode ? '>' : '▸',
|
|
@@ -77,7 +54,7 @@ export const GLYPH = glyphs(TUI_ASCII);
|
|
|
77
54
|
// `Mc` with combining class 0 and a great many `Mn` have class 0 too. So the tables below
|
|
78
55
|
// are the port's own, and no dependency was added to get them.
|
|
79
56
|
|
|
80
|
-
//: East_Asian_Width W or F, below U+1F000 — above it the
|
|
57
|
+
//: East_Asian_Width W or F, below U+1F000 — above it the `>= 0x1F000` rule
|
|
81
58
|
//: already answers 2, so the table stops where that rule takes over.
|
|
82
59
|
const WIDE = [
|
|
83
60
|
0x1100, 0x115F, 0x231A, 0x231B, 0x2329, 0x232A, 0x23E9, 0x23EC, 0x23F0, 0x23F0,
|
|
@@ -265,12 +242,11 @@ export function mark(kind) {
|
|
|
265
242
|
// ---- the inventory's two consumers ----------------------------------------------------
|
|
266
243
|
|
|
267
244
|
/**
|
|
268
|
-
*
|
|
245
|
+
* The ordered (kind, label, data) rows for the left list. `head` is a
|
|
269
246
|
* section divider and is not selectable.
|
|
270
247
|
*
|
|
271
|
-
* ⚠ THE TWO NEW TIERS ARE GUARDED, AND THE GUARD IS NOT DEFENSIVENESS.
|
|
272
|
-
*
|
|
273
|
-
* argument was a synthetic inventory carrying exactly `{agents, skills, laws, theme}`. Reading
|
|
248
|
+
* ⚠ THE TWO NEW TIERS ARE GUARDED, AND THE GUARD IS NOT DEFENSIVENESS. A synthetic inventory
|
|
249
|
+
* carrying exactly `{agents, skills, laws, theme}` is a valid argument. Reading
|
|
274
250
|
* `inv.doctrines.length` on such an inventory THROWS; emitting a head unconditionally changes
|
|
275
251
|
* the result array. Keyed on presence, an inventory without the tiers renders as it always did
|
|
276
252
|
* and a real inventory gets all three tiers.
|
|
@@ -312,25 +288,11 @@ export function tuiEntries(inv) {
|
|
|
312
288
|
}
|
|
313
289
|
|
|
314
290
|
/**
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
* The reference falls off the end for every other `kind`, so it returns `None` — not `[]`.
|
|
318
|
-
* `null` here, because a caller that treated the two alike would render an empty pane where
|
|
319
|
-
* the reference renders nothing at all.
|
|
320
|
-
*
|
|
321
|
-
* ⚠ A REFERENCE BUG LIVES ON THIS RETURN, FOUND BY P7B'S CORPUS AND DELIBERATELY NOT FIXED
|
|
322
|
-
* (it is in the panel, which is P7c's). `_tui_loop` does, at `_harness_tui.py`:614:
|
|
323
|
-
*
|
|
324
|
-
* wrapped = _wrap_lines(_detail_lines(kind, label, data), riw)
|
|
291
|
+
* Right-pane content for the selected entry.
|
|
325
292
|
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
* `if not selectable: sel = 0`, and row 0 is always the AGENTS header. So an inventory with
|
|
330
|
-
* no agents, no skills AND no laws crashes the panel on its first frame instead of drawing
|
|
331
|
-
* an empty state. `_TUI_INV_EMPTY` in the former Python parity suite is the corpus
|
|
332
|
-
* entry that surfaced it. **P7c must not reproduce the crash when it ports `_tui_loop`** —
|
|
333
|
-
* the fix is one `or []` at the call site, and it belongs in the same change as the port.
|
|
293
|
+
* Every other `kind` returns `null` — not `[]`. A caller that treated the two alike would
|
|
294
|
+
* render an empty pane where nothing should render at all, and a caller that iterates the
|
|
295
|
+
* result must guard for `null` (a `head` row is the one that reaches it).
|
|
334
296
|
*
|
|
335
297
|
* Its only consumer with direct assertions is `tests/unit/setup.test.mjs`.
|
|
336
298
|
*/
|
|
@@ -348,16 +310,14 @@ export function detailLines(kind, label, data) {
|
|
|
348
310
|
// ---- the verb ------------------------------------------------------------------------
|
|
349
311
|
|
|
350
312
|
/**
|
|
351
|
-
* `
|
|
352
|
-
*
|
|
313
|
+
* The `tui` verb. Arm one is the reachable one; there is no panel, so the TTY arm
|
|
314
|
+
* refuses — see this module's header.
|
|
353
315
|
*/
|
|
354
316
|
export function cmdTui() {
|
|
355
317
|
if (!process.stdin.isTTY) {
|
|
356
318
|
printOut('[tui] not an interactive terminal. Use `geneseed setup`, `geneseed doctor`, or `geneseed build`.\n');
|
|
357
319
|
return 1;
|
|
358
320
|
}
|
|
359
|
-
// The pointer to the Python panel is gone for `js/ui/menu.mjs`'s reason: the
|
|
360
|
-
// panel it named is the Python being deleted. What is left is true and stays true.
|
|
361
321
|
printOut('[tui] full-screen panel unavailable (this entry carries the TUI\'s layout '
|
|
362
322
|
+ 'half, not its screens). Use `geneseed setup`, `geneseed doctor`, or `geneseed build`.\n');
|
|
363
323
|
return 1;
|
package/js/web/actions.mjs
CHANGED
|
@@ -37,7 +37,7 @@ import { emitGlobalInto } from '../build/driver.mjs';
|
|
|
37
37
|
import {
|
|
38
38
|
ROOT, discoverNames, knownRuleIds, loadKits, PACK_ORDER,
|
|
39
39
|
} from '../build/source.mjs';
|
|
40
|
-
import { diffCollect, drifted, withStdoutSwallowed } from '../inspect/diff.mjs';
|
|
40
|
+
import { diffCollect, drifted, renderMemo, withStdoutSwallowed } from '../inspect/diff.mjs';
|
|
41
41
|
import { SESSION_FILES } from '../hosts/hooks-context.mjs';
|
|
42
42
|
import { excludeAdd, excludeRemove } from '../inspect/excludes.mjs';
|
|
43
43
|
import { installProfile, setupBuildArgs } from '../build/generate.mjs';
|
|
@@ -48,9 +48,9 @@ import {
|
|
|
48
48
|
opencodeConfigDir, resolvePath,
|
|
49
49
|
} from '../hosts/hosts.mjs';
|
|
50
50
|
import {
|
|
51
|
-
EMIT_HOST_SCOPE, doctrinesForBuild, excludedRulesOfDir, excludedSkillsOfDir, kitsOfDir,
|
|
51
|
+
EMIT_HOST_SCOPE, doctrinesForBuild, excludedRulesOfDir, excludedSkillsOfDir, kitsOfDir, sharedTierOfDir, renderedTier,
|
|
52
52
|
footprintOfDir, gatesOfDir,
|
|
53
|
-
installState, installTargets,
|
|
53
|
+
installState, installTargets, modeOfDir, postureOfDir, themeOfDir,
|
|
54
54
|
trustOfDir,
|
|
55
55
|
} from '../hosts/installs.mjs';
|
|
56
56
|
import {
|
|
@@ -65,6 +65,7 @@ import { memoryDelete } from '../maintain/memory.mjs';
|
|
|
65
65
|
import { installDeactivate, installReactivate, installUninstall } from '../maintain/uninstall.mjs';
|
|
66
66
|
import { emitChoices, themeChoices, viewCfg } from './api.mjs';
|
|
67
67
|
import { actionCommands } from './jobs.mjs';
|
|
68
|
+
import { emitOf } from '../inspect/status.mjs';
|
|
68
69
|
import { webState } from './state.mjs';
|
|
69
70
|
import { NotFound, deployed, memoryDir } from './catalog.mjs';
|
|
70
71
|
|
|
@@ -136,7 +137,7 @@ function bodyExcludeRules(body) {
|
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
/**
|
|
139
|
-
* A request body's `kits` — REPLACES the install's kits (the Kits
|
|
140
|
+
* A request body's `kits` — REPLACES the install's kits (the Kits page sends the whole set it
|
|
140
141
|
* wants): `[]`/`'none'` give `[]`, an omitted key gives `null` (keep the install's own), and an
|
|
141
142
|
* unknown name gives `null` too, which `apiInstallCmd` refuses for a body that HAS the key.
|
|
142
143
|
*/
|
|
@@ -144,6 +145,15 @@ function bodyKits(body) {
|
|
|
144
145
|
return bodyList(body, 'kits', () => [...loadKits().keys()]);
|
|
145
146
|
}
|
|
146
147
|
|
|
148
|
+
/**
|
|
149
|
+
* A request body's `sharedTier` — the project install's switch for reading the machine tier. Only
|
|
150
|
+
* a real JSON boolean counts, as a gate's does: anything else keeps the install's own answer.
|
|
151
|
+
*/
|
|
152
|
+
function bodySharedTier(body, root, host) {
|
|
153
|
+
const said = bget(body, 'sharedTier');
|
|
154
|
+
return typeof said === 'boolean' ? said : sharedTierOfDir(root, host);
|
|
155
|
+
}
|
|
156
|
+
|
|
147
157
|
/**
|
|
148
158
|
* The gate switches across the trust boundary (`deletionGate`, `secretsGate`, `doneGate`,
|
|
149
159
|
* `ownershipGate`), each on its own: only a real JSON boolean counts. Anything else — a string
|
|
@@ -221,8 +231,10 @@ export function targetView(base, [host, scope, root]) {
|
|
|
221
231
|
if (v === undefined) {
|
|
222
232
|
const target = viewCfg(host, scope, root);
|
|
223
233
|
v = webState(null, target);
|
|
224
|
-
v.selectView(target, root);
|
|
234
|
+
v.selectView(target, root, emitOf(host, scope));
|
|
225
235
|
v.pinned = true;
|
|
236
|
+
// The daemon's one memo: a render is keyed on what it read, not on who asked for it.
|
|
237
|
+
v.renderMemo = (base.renderMemo ??= renderMemo());
|
|
226
238
|
v.refresh = base.refresh;
|
|
227
239
|
v.daemonStale = () => base.daemonStale?.();
|
|
228
240
|
v.jobBusy = () => base.jobBusy?.();
|
|
@@ -234,7 +246,7 @@ export function targetView(base, [host, scope, root]) {
|
|
|
234
246
|
// ---- OS-native folder picker ---------------------------------------------------------------
|
|
235
247
|
|
|
236
248
|
/**
|
|
237
|
-
* ms before an open dialog is abandoned.
|
|
249
|
+
* ms before an open dialog is abandoned. 300 s, kept as a named
|
|
238
250
|
* constant rather than a literal in the spawn call. `GENESEED_PICK_TIMEOUT_MS` is a TEST HOOK
|
|
239
251
|
* ONLY — it overrides the constant so the timeout path can be proven in seconds instead of
|
|
240
252
|
* five minutes (nobody is at the dialog to cancel it in an automated run); the 300 s default
|
|
@@ -256,8 +268,7 @@ const PICK_SCRIPT_WIN = 'Add-Type -AssemblyName System.Windows.Forms; '
|
|
|
256
268
|
+ 'if ($d.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) '
|
|
257
269
|
+ '{ Write-Output $d.SelectedPath }';
|
|
258
270
|
|
|
259
|
-
//
|
|
260
|
-
// `api_pick_folder`) — same prompt text, same AppleScript shape. `choose folder` is a
|
|
271
|
+
// The prompt text and the AppleScript shape are fixed. `choose folder` is a
|
|
261
272
|
// StandardAdditions command that runs in-process inside `osascript`, so it needs no
|
|
262
273
|
// automation-consent prompt the way scripting another app would.
|
|
263
274
|
const PICK_SCRIPT_MAC = 'set f to POSIX path of (choose folder with prompt '
|
|
@@ -560,7 +571,8 @@ export function globalEmitHostFor(emit) {
|
|
|
560
571
|
* user's after the first build. Derived from `SESSION_FILES`, the one list of them.
|
|
561
572
|
*/
|
|
562
573
|
const SEED_FILES = new Set(SESSION_FILES.filter((r) => !r.includes('/')));
|
|
563
|
-
|
|
574
|
+
// `anamnesis` is the memory store's older name: no longer a session file, still the user's.
|
|
575
|
+
const SEED_DIRS = new Set(['anamnesis', ...SESSION_FILES.filter((r) => r.includes('/')).map((r) => r.split('/')[0])]);
|
|
564
576
|
const isSeedOnce = (rel) => SEED_FILES.has(rel) || SEED_DIRS.has(rel.split('/')[0]);
|
|
565
577
|
|
|
566
578
|
/**
|
|
@@ -626,12 +638,15 @@ export function apiRestore(state, files) {
|
|
|
626
638
|
// behind it — prompt and boundary disagreeing by a WRITE, the write-side twin of the
|
|
627
639
|
// read-side hole `diffCollect` had (and the reason the panel offered the file at all).
|
|
628
640
|
doctrines: doctrinesForBuild(target),
|
|
641
|
+
// Its own tier root, or a restored file names a tier this install does not read.
|
|
642
|
+
sharedRoot: renderedTier(target, globalEmitHostFor(state.emit)).root,
|
|
629
643
|
// The excluded rules for the same boundary reason: without them a restored AGENT.md
|
|
630
644
|
// re-states a rule whose hook gate the install deliberately left unwired.
|
|
631
645
|
excludeRules: excludedRulesOfDir(target),
|
|
632
646
|
excludeSkills: excludedSkillsOfDir(target),
|
|
633
647
|
// The kits: a restored AGENT.md keeps its Kits block and `Active kits:` line.
|
|
634
648
|
kits: kitsOfDir(target),
|
|
649
|
+
sharedTier: sharedTierOfDir(target),
|
|
635
650
|
// The gate switches: a restored AGENT.md must keep the install's `<gate>: off` lines.
|
|
636
651
|
...gatesOfDir(target),
|
|
637
652
|
}));
|
|
@@ -709,20 +724,11 @@ export function apiInstallCmd(state, body) {
|
|
|
709
724
|
if (installState(root, host, scope) === 'disabled') {
|
|
710
725
|
return { error: 'install is disabled — reactivate it before (re)building' };
|
|
711
726
|
}
|
|
712
|
-
// A LEGACY CARRIER IS REFUSED, NEVER REBUILT — same guard as `rebuild-all`/`migrate` (see
|
|
713
|
-
// `legacyProcessCarrierOfDir`'s docblock): `doctrinesForBuild`/`excludedRulesOfDir` below
|
|
714
|
-
// read a pre-comms carrier exactly as written, and this endpoint's `{cmd}` is EXECUTED by
|
|
715
|
-
// `startJob` (`js/web/handler.mjs`'s `install` action) — building that argv here would write
|
|
716
|
-
// the same permanent loss a console click away.
|
|
717
|
-
if (legacyProcessCarrierOfDir(root, host)) {
|
|
718
|
-
return { error: `${host}:${scope} (${root}) predates the comms pack (its carrier names `
|
|
719
|
-
+ "'process 8') — run `geneseed setup` for it before rebuilding from the console" };
|
|
720
|
-
}
|
|
721
727
|
const emit = EMIT_FOR.get(`${host} ${scope}`);
|
|
722
728
|
if (emit === undefined) return { error: `no install mode for ${host}:${scope}` };
|
|
723
729
|
// Every read-back below is narrowed to `host`'s OWN carrier (host-compat B1) — see the
|
|
724
730
|
// comment at `installProfile` in `js/build/generate.mjs`.
|
|
725
|
-
// The theme default is THIS install's own, not the viewed one's: the Kits
|
|
731
|
+
// The theme default is THIS install's own, not the viewed one's: the Kits page acts on any row.
|
|
726
732
|
// An ABSENT row has no footprint of its own (`footprintOfDir` answers its no-marker `full`),
|
|
727
733
|
// so a new install takes the CLI's default, lean — see `apiDeployCmd` below.
|
|
728
734
|
const { theme, footprint: fp, posture: pos, mode, trust } = bodyAxes(body, {
|
|
@@ -755,10 +761,15 @@ export function apiInstallCmd(state, body) {
|
|
|
755
761
|
+ [...loadKits().keys()].join(', ') };
|
|
756
762
|
}
|
|
757
763
|
} catch (e) { return { error: String(e?.message ?? e) }; }
|
|
764
|
+
// D11: the shared tier is a project install's option; a global install owns it.
|
|
765
|
+
const sharedTier = scope === 'global' ? false : bodySharedTier(body, root, host);
|
|
766
|
+
if (scope === 'global' && bget(body, 'sharedTier') === true) {
|
|
767
|
+
return { error: 'the shared tier is a project option — a global install already owns it' };
|
|
768
|
+
}
|
|
758
769
|
const out = scope === 'global' ? null : String(root);
|
|
759
770
|
const argv = setupBuildArgs(theme || 'neutral', emit, out, out, fp, pos, mode, doctrines,
|
|
760
771
|
PACK_ORDER, excludeRules, trust, excludedSkillsOfDir(root, host), gates,
|
|
761
|
-
kits ?? kitsOfDir(root, host));
|
|
772
|
+
kits ?? kitsOfDir(root, host), sharedTier);
|
|
762
773
|
return { cmd: [process.execPath, path.join(ROOT, 'bin', 'build-driver.mjs'), ...argv] };
|
|
763
774
|
}
|
|
764
775
|
|
|
@@ -772,7 +783,7 @@ export function apiInstallCmd(state, body) {
|
|
|
772
783
|
* built from the REGISTRY's host/scope/root, never from body strings, and it is what `rebuildAll`
|
|
773
784
|
* replays (`installProfile`), so a console rebuild of one row equals the CLI's of all of them.
|
|
774
785
|
*
|
|
775
|
-
* ALL OR NOTHING: one unknown
|
|
786
|
+
* ALL OR NOTHING: one unknown or inactive entry (or a malformed body) is `{ error }` and no
|
|
776
787
|
* job starts. `detectedInstall`'s `NotFound` would answer 404; a refusal here means the world
|
|
777
788
|
* changed under the client, so the dispatcher answers 409, as for `install`. The shape is checked
|
|
778
789
|
* before the registry is read, so a bad body never costs a detect.
|
|
@@ -791,11 +802,6 @@ export function rebuildCmds(body) {
|
|
|
791
802
|
const hit = active.findLast(([host, , root]) => JSON.stringify([host, String(root)]) === key);
|
|
792
803
|
if (hit === undefined) return { error: `not an active install: ${key}` };
|
|
793
804
|
const [host, scope, root] = hit;
|
|
794
|
-
// Asked BEFORE `installProfile`, as `rebuildAll` does: a legacy carrier must never be rebuilt.
|
|
795
|
-
if (legacyProcessCarrierOfDir(root, host)) {
|
|
796
|
-
return { error: `${host}:${scope} (${root}) predates the comms pack (its carrier names `
|
|
797
|
-
+ "'process 8') — run `geneseed setup` for it before rebuilding from the console" };
|
|
798
|
-
}
|
|
799
805
|
steps.push(...actionCommands('build', { buildArgv: installProfile(host, scope, root).argv }));
|
|
800
806
|
}
|
|
801
807
|
return { cmds: steps };
|
|
@@ -877,13 +883,6 @@ export function apiDeployCmd(state, body) {
|
|
|
877
883
|
if (cfgdirs.has(root)) {
|
|
878
884
|
return { error: "that's a host global config dir — use its existing row to build a global install" };
|
|
879
885
|
}
|
|
880
|
-
// Same guard as `apiInstallCmd` above: a landing folder that already holds a pre-comms
|
|
881
|
-
// install must not be rebuilt through `doctrinesForBuild`/`excludedRulesOfDir` below. A
|
|
882
|
-
// fresh, never-built folder has no carrier at all, so this is a no-op for the common case.
|
|
883
|
-
if (legacyProcessCarrierOfDir(root, host)) {
|
|
884
|
-
return { error: `${root} predates the comms pack (its carrier names 'process 8') — `
|
|
885
|
-
+ 'run `geneseed setup` for it before deploying over it' };
|
|
886
|
-
}
|
|
887
886
|
// A fresh deploy is LEAN, at the default register, mode and trust: the same default as the
|
|
888
887
|
// CLI's `--footprint`, which the user chose (2026-10-24) over the console's old `full` — a
|
|
889
888
|
// console install and a CLI install of the same folder must not differ in always-on text for
|
|
@@ -902,6 +901,7 @@ export function apiDeployCmd(state, body) {
|
|
|
902
901
|
const gates = bodyGates(body, root, host);
|
|
903
902
|
// project-scope emit name == host name (opencode / claude / bob / openclaude)
|
|
904
903
|
const argv = setupBuildArgs(theme || 'neutral', host, root, root, fp, pos, mode, doctrines,
|
|
905
|
-
PACK_ORDER, excludeRules, trust, excludedSkillsOfDir(root, host), gates, kitsOfDir(root, host)
|
|
904
|
+
PACK_ORDER, excludeRules, trust, excludedSkillsOfDir(root, host), gates, kitsOfDir(root, host),
|
|
905
|
+
bodySharedTier(body, root, host));
|
|
906
906
|
return { cmd: [process.execPath, path.join(ROOT, 'bin', 'build-driver.mjs'), ...argv] };
|
|
907
907
|
}
|