@mcptoolshop/loadout-os 0.0.0 → 1.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 ADDED
@@ -0,0 +1,26 @@
1
+ # Changelog — @mcptoolshop/loadout-os
2
+
3
+ All notable changes to the unified `loadout-os` CLI are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/).
7
+
8
+ > This is the published package's changelog. For the full monorepo consolidation
9
+ > history (workspace wiring, the runtime hook, the adapters), see the
10
+ > [root CHANGELOG](../../CHANGELOG.md).
11
+
12
+ ## [Unreleased]
13
+
14
+ ### Added
15
+
16
+ - Unified `loadout-os` binary wrapping the kernel + memories + rules surfaces under one
17
+ arg parser and one structured `CliError { code, message, hint }` shape.
18
+ - Namespaced adapter commands (`memories`, `rules`) and flat kernel verbs (`resolve`,
19
+ `explain`, `usage`, `dead`, `overlaps`, `budget`, `validate`).
20
+ - Operational rituals: `doctor` (read-only health screen), `report` (read-only
21
+ observability), and `refresh` (Index Freshness Ritual with andon halt + `.bak`
22
+ compensator); plus `hook test`.
23
+ - Per-command `--help` (synopsis, arguments, flags, example, exit codes) for every leaf
24
+ command.
25
+
26
+ <!-- ## [1.0.0] - YYYY-MM-DD -->
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mcp-tool-shop
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,89 @@
1
1
  # @mcptoolshop/loadout-os
2
2
 
3
- Placeholder release. Real package coming soon.
3
+ The unified **Knowledge OS** CLI. One `loadout-os` binary that wraps the three
4
+ library packages of this workspace and absorbs the operational rituals that used
5
+ to be a multi-step manual sequence.
4
6
 
5
- Source: <https://github.com/mcp-tool-shop-org/loadout-os>
7
+ It wraps:
8
+
9
+ - **kernel** — [`@mcptoolshop/ai-loadout`](../kernel) — the knowledge router (resolve / match / budget / usage analysis)
10
+ - **memories** — [`@mcptoolshop/claude-memories`](../memories) — MEMORY.md → dispatch index
11
+ - **rules** — [`@mcptoolshop/claude-rules`](../rules) — CLAUDE.md section analysis + rule-file linting
12
+ - the **runtime hook** — [`apps/hook/loadout-hook.mjs`](../../apps/hook) — the `UserPromptSubmit` pointer-injector
13
+
14
+ Every wrapped surface calls the library export directly (one process, one arg
15
+ parser, one structured-error shape) — `loadout-os` does not shell out to the
16
+ legacy `ai-loadout` / `claude-memories` / `claude-rules` bins.
17
+
18
+ ## Command tree
19
+
20
+ ### Namespaces (wrapped library surfaces)
21
+
22
+ ```
23
+ loadout-os memories index <MEMORY.md> [--lazy] [--json]
24
+ loadout-os memories validate <MEMORY.md> [--json]
25
+ loadout-os memories stats <MEMORY.md> [--json]
26
+ loadout-os memories health [path] [--json]
27
+
28
+ loadout-os rules analyze <CLAUDE.md> [--rules-dir <dir>] [--json]
29
+ loadout-os rules validate [--rules-dir <dir>] [--lazy] [--repo-root <dir>] [--json]
30
+ loadout-os rules stats <CLAUDE.md> [--rules-dir <dir>] [--json]
31
+ loadout-os rules split # interactive — wrapped via passthrough to the claude-rules bin
32
+ ```
33
+
34
+ ### Flat verbs (knowledge router / kernel)
35
+
36
+ ```
37
+ loadout-os resolve # resolve layered loadouts (global → org → project → session)
38
+ loadout-os explain <entry-id> # how an entry resolved across layers
39
+ loadout-os usage <jsonl> # usage summary from the event log
40
+ loadout-os dead <index> <jsonl> # entries never loaded
41
+ loadout-os overlaps <index> # keyword routing ambiguities
42
+ loadout-os budget <index> [jsonl] # token budget breakdown
43
+ loadout-os validate <index> # validate index STRUCTURE (kernel)
44
+ ```
45
+
46
+ > **Name collision, resolved by namespacing.** The flat `validate <index>` is the
47
+ > kernel's index-structure validator. The store/rules linters are namespaced —
48
+ > `memories validate <MEMORY.md>` and `rules validate` — so all three coexist.
49
+
50
+ ### Rituals
51
+
52
+ ```
53
+ loadout-os doctor [--json] # read-only health screen
54
+ loadout-os report [--index <p>] [--jsonl <p>] # observability over usage.jsonl
55
+ loadout-os hook test [--prompt "<text>"] # drive the runtime hook on a sample prompt
56
+ loadout-os refresh [--store <d>] [--dest <p>] [--dry-run] # index → validate → publish
57
+ ```
58
+
59
+ - **`doctor`** — one read-only screen: store `MEMORY.md` validates, the global
60
+ index parses + validates, the runtime hook mirror matches the repo source (drift
61
+ check), no malformed resolver layers, at least one core entry, observability
62
+ loop wired, hook wired in `settings.json`, and `usage.jsonl` growing. `--json`
63
+ emits `{ checks: [{ id, status, message, hint }], ok }`. Exit 0 when all checks
64
+ pass or warn; exit 1 on any fail. **Never writes.**
65
+ - **`report`** — composes usage summary + dead-entry detection + token budget,
66
+ plus a score distribution when usage events carry a `score`. `--json` for the
67
+ machine-readable shape. Exit 2 when an input is missing. **Read-only.**
68
+ - **`hook test`** — runs the real `loadout-hook.mjs` against a sample prompt in an
69
+ isolated HOME so the live `usage.jsonl` is never written.
70
+ - **`refresh`** — folds the Index Freshness Ritual into one command: regenerate the
71
+ store index → validate (andon halt on any error) → rewrite relative paths to
72
+ absolute + publish to `~/.ai-loadout/index.json`. The irreversible write is guarded
73
+ by a `.bak` named compensator (restored on failure, undo line printed); `--dry-run`
74
+ previews without writing. Exit `1` on validation/write failure, `2` on a missing store.
75
+
76
+ ## Build & test
77
+
78
+ ```
79
+ npm run build # tsc
80
+ npm test # node --test dist/tests/*.test.js
81
+ npm run verify # tsc --noEmit && node --test dist/tests/*.test.js
82
+ ```
83
+
84
+ ## SDK use
85
+
86
+ Importing the package is side-effect-free — the dispatcher only runs when the
87
+ file is the process entrypoint. Composable exports: `dispatch`, `runDoctor` /
88
+ `buildReport` / `runHookTest` (and their `print*` renderers + `default*Paths`
89
+ helpers).