@wipcomputer/wip-ldm-os 0.4.0 → 0.4.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/SKILL.md +1 -1
- package/bin/wip-install.js +8 -0
- package/docs/universal-installer/SPEC.md +206 -0
- package/lib/bootstrap.mjs +92 -0
- package/package.json +2 -1
package/SKILL.md
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// wip-install: thin bootstrap + delegate to ldm install.
|
|
3
|
+
// If ldm is on PATH, delegates immediately.
|
|
4
|
+
// If not, installs LDM OS from npm, then delegates.
|
|
5
|
+
// Replaces the standalone 700-line install.js from wip-ai-devops-toolbox.
|
|
6
|
+
|
|
7
|
+
import { run } from '../lib/bootstrap.mjs';
|
|
8
|
+
run(process.argv.slice(2));
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# The Universal Interface Specification
|
|
2
|
+
|
|
3
|
+
Every tool is a sensor, an actuator, or both. Every tool should be accessible through multiple interfaces. We call this the Universal Interface.
|
|
4
|
+
|
|
5
|
+
This is the spec.
|
|
6
|
+
|
|
7
|
+
## The Six Interfaces
|
|
8
|
+
|
|
9
|
+
### 1. CLI
|
|
10
|
+
|
|
11
|
+
A shell command. The most universal interface. If it has a terminal, it works.
|
|
12
|
+
|
|
13
|
+
**Convention:** `package.json` with a `bin` field.
|
|
14
|
+
|
|
15
|
+
**Detection:** `pkg.bin` exists.
|
|
16
|
+
|
|
17
|
+
**Install:** `npm install -g .` or `npm link`.
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"bin": {
|
|
22
|
+
"wip-grok": "./cli.mjs"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 2. Module
|
|
28
|
+
|
|
29
|
+
An importable ES module. The programmatic interface. Other tools compose with it.
|
|
30
|
+
|
|
31
|
+
**Convention:** `package.json` with `main` or `exports` field. File is `core.mjs` by convention.
|
|
32
|
+
|
|
33
|
+
**Detection:** `pkg.main` or `pkg.exports` exists.
|
|
34
|
+
|
|
35
|
+
**Install:** `npm install <package>` or import directly from path.
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"type": "module",
|
|
40
|
+
"main": "core.mjs",
|
|
41
|
+
"exports": {
|
|
42
|
+
".": "./core.mjs",
|
|
43
|
+
"./cli": "./cli.mjs"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 3. MCP Server
|
|
49
|
+
|
|
50
|
+
A JSON-RPC server implementing the Model Context Protocol. Any MCP-compatible agent can use it.
|
|
51
|
+
|
|
52
|
+
**Convention:** `mcp-server.mjs` (or `.js`, `.ts`) at the repo root. Uses `@modelcontextprotocol/sdk`.
|
|
53
|
+
|
|
54
|
+
**Detection:** One of `mcp-server.mjs`, `mcp-server.js`, `mcp-server.ts`, `dist/mcp-server.js` exists.
|
|
55
|
+
|
|
56
|
+
**Install:** Add to `.mcp.json`:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"tool-name": {
|
|
61
|
+
"command": "node",
|
|
62
|
+
"args": ["/path/to/mcp-server.mjs"]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 4. OpenClaw Plugin
|
|
68
|
+
|
|
69
|
+
A plugin for OpenClaw agents. Lifecycle hooks, tool registration, settings.
|
|
70
|
+
|
|
71
|
+
**Convention:** `openclaw.plugin.json` at the repo root.
|
|
72
|
+
|
|
73
|
+
**Detection:** `openclaw.plugin.json` exists.
|
|
74
|
+
|
|
75
|
+
**Install:** Copy to `~/.openclaw/extensions/<name>/`, run `npm install --omit=dev`.
|
|
76
|
+
|
|
77
|
+
### 5. Skill (SKILL.md)
|
|
78
|
+
|
|
79
|
+
A markdown file that teaches agents when and how to use the tool. The instruction interface.
|
|
80
|
+
|
|
81
|
+
**Convention:** `SKILL.md` at the repo root. YAML frontmatter with name, version, description, metadata.
|
|
82
|
+
|
|
83
|
+
**Detection:** `SKILL.md` exists.
|
|
84
|
+
|
|
85
|
+
**Install:** Referenced by path. Agents read it when they need the tool.
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
---
|
|
89
|
+
name: wip-grok
|
|
90
|
+
version: 1.0.0
|
|
91
|
+
description: xAI Grok API. Search the web, search X, generate images.
|
|
92
|
+
metadata:
|
|
93
|
+
category: search,media
|
|
94
|
+
capabilities:
|
|
95
|
+
- web-search
|
|
96
|
+
- image-generation
|
|
97
|
+
---
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 6. Claude Code Hook
|
|
101
|
+
|
|
102
|
+
A hook that runs during Claude Code's tool lifecycle (PreToolUse, Stop, etc.).
|
|
103
|
+
|
|
104
|
+
**Convention:** `guard.mjs` at repo root, or `claudeCode.hook` in `package.json`.
|
|
105
|
+
|
|
106
|
+
**Detection:** `guard.mjs` exists, or `pkg.claudeCode.hook` is defined.
|
|
107
|
+
|
|
108
|
+
**Install:** Added to `~/.claude/settings.json` under `hooks`.
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"hooks": {
|
|
113
|
+
"PreToolUse": [{
|
|
114
|
+
"matcher": "Edit|Write",
|
|
115
|
+
"hooks": [{
|
|
116
|
+
"type": "command",
|
|
117
|
+
"command": "node /path/to/guard.mjs",
|
|
118
|
+
"timeout": 5
|
|
119
|
+
}]
|
|
120
|
+
}]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Architecture
|
|
126
|
+
|
|
127
|
+
Every repo that follows this spec has the same basic structure:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
your-tool/
|
|
131
|
+
core.mjs pure logic, zero or minimal deps
|
|
132
|
+
cli.mjs thin CLI wrapper around core
|
|
133
|
+
mcp-server.mjs MCP server wrapping core functions as tools
|
|
134
|
+
SKILL.md agent instructions with YAML frontmatter
|
|
135
|
+
package.json name, bin, main, exports, type: module
|
|
136
|
+
README.md human documentation
|
|
137
|
+
ai/ development process (plans, todos, notes)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Not every tool needs all six interfaces. Build the ones that make sense.
|
|
141
|
+
|
|
142
|
+
The minimum viable agent-native tool has two interfaces: **Module** (importable) and **Skill** (agent instructions). Add CLI for humans. Add MCP for agents that speak MCP. Add OpenClaw/CC Hook for specific platforms.
|
|
143
|
+
|
|
144
|
+
## The `ai/` Folder
|
|
145
|
+
|
|
146
|
+
Every repo should have an `ai/` folder. This is where agents and humans collaborate on the project ... plans, todos, dev updates, research notes, conversations.
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
ai/
|
|
150
|
+
plan/ architecture plans, roadmaps
|
|
151
|
+
dev-updates/ what was built, session logs
|
|
152
|
+
todos/
|
|
153
|
+
PUNCHLIST.md blockers to ship
|
|
154
|
+
inboxes/ per-agent action items
|
|
155
|
+
notes/ research, references, raw conversation logs
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The `ai/` folder is the development process. It is not part of the published product.
|
|
159
|
+
|
|
160
|
+
**Public/private split:** If a repo is public, the `ai/` folder should not ship. The recommended pattern is to maintain a private working repo (with `ai/`) and a public repo (everything except `ai/`). The public repo has everything an LLM or human needs to understand and use the tool. The `ai/` folder is operational context for the team building it.
|
|
161
|
+
|
|
162
|
+
## The Reference Installer
|
|
163
|
+
|
|
164
|
+
`ldm install` is the primary installer (part of LDM OS). `wip-install` is the standalone fallback. Both scan a repo, detect which interfaces exist, and install them all. One command.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
ldm install /path/to/repo # local (via LDM OS)
|
|
168
|
+
ldm install org/repo # from GitHub
|
|
169
|
+
ldm install org/repo --dry-run # detect only
|
|
170
|
+
wip-install /path/to/repo # standalone fallback (bootstraps LDM OS if needed)
|
|
171
|
+
wip-install --json /path/to/repo # JSON output
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
For toolbox repos (with a `tools/` directory containing sub-tools), the installer enters toolbox mode and installs each sub-tool.
|
|
175
|
+
|
|
176
|
+
## Examples
|
|
177
|
+
|
|
178
|
+
### AI DevOps Toolbox (this repo)
|
|
179
|
+
|
|
180
|
+
| # | Tool | Interfaces |
|
|
181
|
+
|---|------|------------|
|
|
182
|
+
| | **Repo Management** | |
|
|
183
|
+
| 1 | [Repo Visibility Guard](tools/wip-repo-permissions-hook/) | CLI + Module + MCP + OpenClaw + Skill + CC Hook |
|
|
184
|
+
| 2 | [Repo Manifest Reconciler](tools/wip-repos/) | CLI + Module + MCP + Skill |
|
|
185
|
+
| 3 | [Repo Init](tools/wip-repo-init/) | CLI + Skill |
|
|
186
|
+
| 4 | [README Formatter](tools/wip-readme-format/) | CLI + Skill |
|
|
187
|
+
| 5 | [Branch Guard](tools/wip-branch-guard/) | CLI + Module + CC Hook |
|
|
188
|
+
| | **License, Compliance, and Protection** | |
|
|
189
|
+
| 6 | [Identity File Protection](tools/wip-file-guard/) | CLI + Module + OpenClaw + Skill + CC Hook |
|
|
190
|
+
| 7 | [License Guard](tools/wip-license-guard/) | CLI + Skill |
|
|
191
|
+
| 8 | [License Rug-Pull Detection](tools/wip-license-hook/) | CLI + Module + MCP + Skill |
|
|
192
|
+
| | **Release & Deploy** | |
|
|
193
|
+
| 9 | [Release Pipeline](tools/wip-release/) | CLI + Module + MCP + Skill |
|
|
194
|
+
| 10 | [Private-to-Public Sync](tools/deploy-public/) | CLI + Skill |
|
|
195
|
+
| 11 | [Post-Merge Branch Naming](tools/post-merge-rename/) | CLI + Skill |
|
|
196
|
+
| 12 | [Universal Installer](tools/wip-universal-installer/) | CLI + Module + Skill |
|
|
197
|
+
|
|
198
|
+
### Other WIP Computer Tools
|
|
199
|
+
|
|
200
|
+
| Repo | Interfaces |
|
|
201
|
+
|------|------------|
|
|
202
|
+
| [Memory Crystal](https://github.com/wipcomputer/memory-crystal) | CLI + Module + MCP + OpenClaw + Skill |
|
|
203
|
+
| [LDM OS](https://github.com/wipcomputer/wip-ldm-os) | CLI + Module + Skill + CC Hook |
|
|
204
|
+
| [wip-grok](https://github.com/wipcomputer/wip-grok) | CLI + Module + MCP + Skill |
|
|
205
|
+
| [wip-x](https://github.com/wipcomputer/wip-x) | CLI + Module + MCP + Skill |
|
|
206
|
+
| [Markdown Viewer](https://github.com/wipcomputer/wip-markdown-viewer) | CLI + Module |
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/bootstrap.mjs
|
|
3
|
+
* Thin bootstrap for wip-install.
|
|
4
|
+
* If ldm is on PATH, delegates to ldm install.
|
|
5
|
+
* If not, installs LDM OS from npm, then delegates.
|
|
6
|
+
* This replaces the 700-line standalone install.js from the toolbox.
|
|
7
|
+
* Zero external dependencies.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { execSync } from 'node:child_process';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Check if ldm CLI is available on PATH.
|
|
14
|
+
* @returns {boolean}
|
|
15
|
+
*/
|
|
16
|
+
export function isLdmAvailable() {
|
|
17
|
+
try {
|
|
18
|
+
execSync('ldm --version', { stdio: 'pipe', timeout: 5000 });
|
|
19
|
+
return true;
|
|
20
|
+
} catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Install LDM OS from npm registry.
|
|
27
|
+
* @returns {boolean} true if install succeeded
|
|
28
|
+
*/
|
|
29
|
+
export function bootstrapLdmOs() {
|
|
30
|
+
try {
|
|
31
|
+
execSync('npm install -g @wipcomputer/wip-ldm-os', { stdio: 'pipe', timeout: 120000 });
|
|
32
|
+
execSync('ldm init --yes --none', { stdio: 'pipe', timeout: 30000 });
|
|
33
|
+
return isLdmAvailable();
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Delegate to ldm install with the given arguments.
|
|
41
|
+
* @param {string} target - what to install (org/repo, path, or empty for update-all)
|
|
42
|
+
* @param {string[]} flags - CLI flags (--dry-run, --json, etc.)
|
|
43
|
+
*/
|
|
44
|
+
export function delegateToLdm(target, flags = []) {
|
|
45
|
+
const cmd = target
|
|
46
|
+
? `ldm install ${target} ${flags.join(' ')}`
|
|
47
|
+
: `ldm install ${flags.join(' ')}`;
|
|
48
|
+
execSync(cmd.trim(), { stdio: 'inherit' });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Full bootstrap + delegate flow.
|
|
53
|
+
* Called by wip-install as the entry point.
|
|
54
|
+
* @param {string[]} argv - process.argv.slice(2)
|
|
55
|
+
*/
|
|
56
|
+
export function run(argv) {
|
|
57
|
+
const target = argv.find(a => !a.startsWith('--'));
|
|
58
|
+
const flags = argv.filter(a => a.startsWith('--'));
|
|
59
|
+
const jsonOutput = flags.includes('--json');
|
|
60
|
+
|
|
61
|
+
if (isLdmAvailable()) {
|
|
62
|
+
if (!jsonOutput) {
|
|
63
|
+
console.log('');
|
|
64
|
+
console.log(' LDM OS detected. Delegating to ldm install...');
|
|
65
|
+
console.log('');
|
|
66
|
+
}
|
|
67
|
+
delegateToLdm(target, flags);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// LDM not on PATH, try bootstrap
|
|
72
|
+
if (!jsonOutput) {
|
|
73
|
+
console.log('');
|
|
74
|
+
console.log(' LDM OS not found. Installing...');
|
|
75
|
+
console.log('');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (bootstrapLdmOs()) {
|
|
79
|
+
if (!jsonOutput) {
|
|
80
|
+
console.log(' LDM OS installed. Delegating to ldm install...');
|
|
81
|
+
console.log('');
|
|
82
|
+
}
|
|
83
|
+
delegateToLdm(target, flags);
|
|
84
|
+
} else {
|
|
85
|
+
if (!jsonOutput) {
|
|
86
|
+
console.log(' LDM OS could not be installed automatically.');
|
|
87
|
+
console.log(' Install manually: npm install -g @wipcomputer/wip-ldm-os');
|
|
88
|
+
console.log('');
|
|
89
|
+
}
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wipcomputer/wip-ldm-os",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "LDM OS: identity, memory, and sovereignty infrastructure for AI agents",
|
|
6
6
|
"main": "src/boot/boot-hook.mjs",
|
|
7
7
|
"bin": {
|
|
8
8
|
"ldm": "bin/ldm.js",
|
|
9
9
|
"wip-ldm-os": "bin/ldm.js",
|
|
10
|
+
"wip-install": "bin/wip-install.js",
|
|
10
11
|
"ldm-scaffold": "bin/scaffold.sh",
|
|
11
12
|
"ldm-boot-install": "src/boot/install-cli.js",
|
|
12
13
|
"lesa": "dist/bridge/cli.js"
|