create-agentfs 0.1.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/LICENSE +21 -0
- package/README.md +238 -0
- package/dist/cli.d.ts +51 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +246 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/compile.d.ts +48 -0
- package/dist/commands/compile.d.ts.map +1 -0
- package/dist/commands/compile.js +228 -0
- package/dist/commands/compile.js.map +1 -0
- package/dist/commands/cron.d.ts +18 -0
- package/dist/commands/cron.d.ts.map +1 -0
- package/dist/commands/cron.js +95 -0
- package/dist/commands/cron.js.map +1 -0
- package/dist/commands/doctor.d.ts +11 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +199 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/memory.d.ts +19 -0
- package/dist/commands/memory.d.ts.map +1 -0
- package/dist/commands/memory.js +213 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/onboard.d.ts +31 -0
- package/dist/commands/onboard.d.ts.map +1 -0
- package/dist/commands/onboard.js +362 -0
- package/dist/commands/onboard.js.map +1 -0
- package/dist/commands/secret.d.ts +13 -0
- package/dist/commands/secret.d.ts.map +1 -0
- package/dist/commands/secret.js +109 -0
- package/dist/commands/secret.js.map +1 -0
- package/dist/commands/security.d.ts +16 -0
- package/dist/commands/security.d.ts.map +1 -0
- package/dist/commands/security.js +203 -0
- package/dist/commands/security.js.map +1 -0
- package/dist/commands/sync.d.ts +14 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +84 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/compilers/agent-map.d.ts +34 -0
- package/dist/compilers/agent-map.d.ts.map +1 -0
- package/dist/compilers/agent-map.js +66 -0
- package/dist/compilers/agent-map.js.map +1 -0
- package/dist/compilers/base.d.ts +67 -0
- package/dist/compilers/base.d.ts.map +1 -0
- package/dist/compilers/base.js +183 -0
- package/dist/compilers/base.js.map +1 -0
- package/dist/compilers/claude.d.ts +26 -0
- package/dist/compilers/claude.d.ts.map +1 -0
- package/dist/compilers/claude.js +151 -0
- package/dist/compilers/claude.js.map +1 -0
- package/dist/compilers/cursor.d.ts +11 -0
- package/dist/compilers/cursor.d.ts.map +1 -0
- package/dist/compilers/cursor.js +52 -0
- package/dist/compilers/cursor.js.map +1 -0
- package/dist/compilers/index.d.ts +14 -0
- package/dist/compilers/index.d.ts.map +1 -0
- package/dist/compilers/index.js +14 -0
- package/dist/compilers/index.js.map +1 -0
- package/dist/compilers/openclaw.d.ts +12 -0
- package/dist/compilers/openclaw.d.ts.map +1 -0
- package/dist/compilers/openclaw.js +51 -0
- package/dist/compilers/openclaw.js.map +1 -0
- package/dist/cron/index.d.ts +10 -0
- package/dist/cron/index.d.ts.map +1 -0
- package/dist/cron/index.js +9 -0
- package/dist/cron/index.js.map +1 -0
- package/dist/cron/jobs/consolidate.d.ts +16 -0
- package/dist/cron/jobs/consolidate.d.ts.map +1 -0
- package/dist/cron/jobs/consolidate.js +61 -0
- package/dist/cron/jobs/consolidate.js.map +1 -0
- package/dist/cron/jobs/heartbeat.d.ts +11 -0
- package/dist/cron/jobs/heartbeat.d.ts.map +1 -0
- package/dist/cron/jobs/heartbeat.js +66 -0
- package/dist/cron/jobs/heartbeat.js.map +1 -0
- package/dist/cron/jobs/inbox-triage.d.ts +11 -0
- package/dist/cron/jobs/inbox-triage.d.ts.map +1 -0
- package/dist/cron/jobs/inbox-triage.js +85 -0
- package/dist/cron/jobs/inbox-triage.js.map +1 -0
- package/dist/cron/runner.d.ts +32 -0
- package/dist/cron/runner.d.ts.map +1 -0
- package/dist/cron/runner.js +69 -0
- package/dist/cron/runner.js.map +1 -0
- package/dist/cron/types.d.ts +21 -0
- package/dist/cron/types.d.ts.map +1 -0
- package/dist/cron/types.js +6 -0
- package/dist/cron/types.js.map +1 -0
- package/dist/generators/filesystem.d.ts +52 -0
- package/dist/generators/filesystem.d.ts.map +1 -0
- package/dist/generators/filesystem.js +155 -0
- package/dist/generators/filesystem.js.map +1 -0
- package/dist/generators/ignore.d.ts +38 -0
- package/dist/generators/ignore.d.ts.map +1 -0
- package/dist/generators/ignore.js +154 -0
- package/dist/generators/ignore.js.map +1 -0
- package/dist/generators/index.d.ts +14 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +14 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/init.d.ts +37 -0
- package/dist/generators/init.d.ts.map +1 -0
- package/dist/generators/init.js +169 -0
- package/dist/generators/init.js.map +1 -0
- package/dist/generators/manifest.d.ts +31 -0
- package/dist/generators/manifest.d.ts.map +1 -0
- package/dist/generators/manifest.js +123 -0
- package/dist/generators/manifest.js.map +1 -0
- package/dist/generators/memory.d.ts +36 -0
- package/dist/generators/memory.d.ts.map +1 -0
- package/dist/generators/memory.js +106 -0
- package/dist/generators/memory.js.map +1 -0
- package/dist/generators/profiles.d.ts +22 -0
- package/dist/generators/profiles.d.ts.map +1 -0
- package/dist/generators/profiles.js +92 -0
- package/dist/generators/profiles.js.map +1 -0
- package/dist/generators/prompts.d.ts +24 -0
- package/dist/generators/prompts.d.ts.map +1 -0
- package/dist/generators/prompts.js +122 -0
- package/dist/generators/prompts.js.map +1 -0
- package/dist/generators/scaffold.d.ts +29 -0
- package/dist/generators/scaffold.d.ts.map +1 -0
- package/dist/generators/scaffold.js +90 -0
- package/dist/generators/scaffold.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/confidence.d.ts +69 -0
- package/dist/memory/confidence.d.ts.map +1 -0
- package/dist/memory/confidence.js +125 -0
- package/dist/memory/confidence.js.map +1 -0
- package/dist/memory/episodic.d.ts +40 -0
- package/dist/memory/episodic.d.ts.map +1 -0
- package/dist/memory/episodic.js +139 -0
- package/dist/memory/episodic.js.map +1 -0
- package/dist/memory/index.d.ts +17 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +17 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/parser.d.ts +73 -0
- package/dist/memory/parser.d.ts.map +1 -0
- package/dist/memory/parser.js +156 -0
- package/dist/memory/parser.js.map +1 -0
- package/dist/memory/procedural.d.ts +43 -0
- package/dist/memory/procedural.d.ts.map +1 -0
- package/dist/memory/procedural.js +126 -0
- package/dist/memory/procedural.js.map +1 -0
- package/dist/secrets/exfil-guard.d.ts +31 -0
- package/dist/secrets/exfil-guard.d.ts.map +1 -0
- package/dist/secrets/exfil-guard.js +51 -0
- package/dist/secrets/exfil-guard.js.map +1 -0
- package/dist/secrets/index.d.ts +8 -0
- package/dist/secrets/index.d.ts.map +1 -0
- package/dist/secrets/index.js +7 -0
- package/dist/secrets/index.js.map +1 -0
- package/dist/secrets/vault.d.ts +63 -0
- package/dist/secrets/vault.d.ts.map +1 -0
- package/dist/secrets/vault.js +163 -0
- package/dist/secrets/vault.js.map +1 -0
- package/dist/security/claude-compiler.d.ts +28 -0
- package/dist/security/claude-compiler.d.ts.map +1 -0
- package/dist/security/claude-compiler.js +66 -0
- package/dist/security/claude-compiler.js.map +1 -0
- package/dist/security/index.d.ts +7 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +7 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/parser.d.ts +47 -0
- package/dist/security/parser.d.ts.map +1 -0
- package/dist/security/parser.js +136 -0
- package/dist/security/parser.js.map +1 -0
- package/dist/sync/index.d.ts +7 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +6 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/sync.d.ts +46 -0
- package/dist/sync/sync.d.ts.map +1 -0
- package/dist/sync/sync.js +174 -0
- package/dist/sync/sync.js.map +1 -0
- package/dist/types/compiler.d.ts +81 -0
- package/dist/types/compiler.d.ts.map +1 -0
- package/dist/types/compiler.js +10 -0
- package/dist/types/compiler.js.map +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/manifest.d.ts +112 -0
- package/dist/types/manifest.d.ts.map +1 -0
- package/dist/types/manifest.js +10 -0
- package/dist/types/manifest.js.map +1 -0
- package/dist/types/memory.d.ts +85 -0
- package/dist/types/memory.d.ts.map +1 -0
- package/dist/types/memory.js +20 -0
- package/dist/types/memory.js.map +1 -0
- package/dist/types/security.d.ts +67 -0
- package/dist/types/security.d.ts.map +1 -0
- package/dist/types/security.js +10 -0
- package/dist/types/security.js.map +1 -0
- package/dist/types/setup.d.ts +54 -0
- package/dist/types/setup.d.ts.map +1 -0
- package/dist/types/setup.js +9 -0
- package/dist/types/setup.js.map +1 -0
- package/dist/utils/fhs-mapping.d.ts +76 -0
- package/dist/utils/fhs-mapping.d.ts.map +1 -0
- package/dist/utils/fhs-mapping.js +189 -0
- package/dist/utils/fhs-mapping.js.map +1 -0
- package/package.json +58 -0
- package/templates/compilers/agent-map.md.hbs +36 -0
- package/templates/compilers/claude.md.hbs +95 -0
- package/templates/procedural/code-review.md +54 -0
- package/templates/procedural/debugging.md +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AgentFS Contributors
|
|
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
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# AgentFS: The OS for AI Agents in Your Vault
|
|
2
|
+
|
|
3
|
+
**AgentFS is a CLI tool that turns your Obsidian vault into a standardized "Operating System" for AI agents.** It provides a single source of truth for your identity, memory, and security, allowing multiple AI agents (Claude, Cursor, OpenClaw) to work in perfect harmony in the same space.
|
|
4
|
+
|
|
5
|
+
## 🔴 The Problem: Agent Fragmentation
|
|
6
|
+
Currently, every AI tool is a silo.
|
|
7
|
+
- **Claude Code** needs `CLAUDE.md`.
|
|
8
|
+
- **Cursor** needs `.cursorrules`.
|
|
9
|
+
- **OpenClaw** needs `.omc/project-memory.json`.
|
|
10
|
+
|
|
11
|
+
When you use multiple agents, you have to maintain your rules, identity, and context in three different places. They don't share memory. They don't respect the same security rules. They are strangers in your vault every time you start a new session.
|
|
12
|
+
|
|
13
|
+
## 🟢 The Solution: A Unified Kernel
|
|
14
|
+
AgentFS introduces a **Kernel Space** (`.agentos/`) to your vault. You define who you are and what you remember once, and AgentFS **compiles** that state into native configurations for every agent you use.
|
|
15
|
+
|
|
16
|
+
- **One Source of Truth**: Edit your identity in one place; update all agents with one command.
|
|
17
|
+
- **Persistent Memory**: A standardized memory system (Tulving's taxonomy) that agents actually use and update.
|
|
18
|
+
- **AppArmor-Style Security**: Real enforcement that prevents agents from reading your secrets or core system files.
|
|
19
|
+
- **Linux-Style FHS**: A predictable directory structure that agents understand immediately.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
┌─────────────────────────────────────────────────┐
|
|
23
|
+
│ USER SPACE (vault/) │
|
|
24
|
+
│ Human-readable folders, notes, content │
|
|
25
|
+
│ Obsidian sees and renders everything │
|
|
26
|
+
├─────────────────────────────────────────────────┤
|
|
27
|
+
│ NATIVE RUNTIMES (per-agent) │
|
|
28
|
+
│ .claude/ .omc/ .cursor/ .obsidian/ │
|
|
29
|
+
│ Native configs — each agent reads its own │
|
|
30
|
+
├─────────────────────────────────────────────────┤
|
|
31
|
+
│ KERNEL SPACE (.agentos/) │
|
|
32
|
+
│ Source of truth → compiles to native formats │
|
|
33
|
+
│ manifest.yaml, init.d/, memory/, cron.d/ │
|
|
34
|
+
└─────────────────────────────────────────────────┘
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Five rules, stolen from Unix:
|
|
38
|
+
|
|
39
|
+
1. **Everything is a file.** Memory, tasks, skills, configs — markdown. The agent doesn't query a database. It reads files.
|
|
40
|
+
2. **Do one thing well.** Each file is responsible for one thing. `stack.md` = stack. `brief.md` = vision. Don't mix.
|
|
41
|
+
3. **Programs work together.** Frontmatter is the API contract between human, agent, and Obsidian. Wikilinks are pipes.
|
|
42
|
+
4. **Text is the universal interface.** Markdown is human-readable, agent-parseable, Obsidian-renderable.
|
|
43
|
+
5. **No captive UI.** The vault works without Obsidian, without any agent, without cloud. `cat` and `grep` are enough.
|
|
44
|
+
|
|
45
|
+
## How It Works
|
|
46
|
+
|
|
47
|
+
### Kernel Space: `.agentos/`
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
.agentos/
|
|
51
|
+
├── manifest.yaml ← what is this vault (name, profile, paths, agents)
|
|
52
|
+
├── init.d/ ← boot sequence (agent-agnostic)
|
|
53
|
+
│ ├── 00-identity.md ← who am I, whose vault, roles
|
|
54
|
+
│ ├── 10-memory.md ← load memory (semantic on boot, rest lazy)
|
|
55
|
+
│ ├── 20-today.md ← load daily note + tasks
|
|
56
|
+
│ └── 30-projects.md ← load active projects
|
|
57
|
+
├── compile.d/ ← per-agent "drivers"
|
|
58
|
+
│ ├── claude/ ← manifest → CLAUDE.md + .claude/settings.json
|
|
59
|
+
│ ├── openclaw/ ← manifest → SOUL.md + .omc/
|
|
60
|
+
│ └── cursor/ ← manifest → .cursorrules
|
|
61
|
+
├── security/ ← AppArmor-style profiles + secrets vault
|
|
62
|
+
│ ├── policy.yaml ← Mandatory Access Control rules
|
|
63
|
+
│ ├── modules/ ← domain-specific security (crypto, web, infra)
|
|
64
|
+
│ └── secrets/ ← SOPS/age encrypted values (agent CANNOT read)
|
|
65
|
+
├── cron.d/ ← scheduled jobs
|
|
66
|
+
│ ├── heartbeat.md ← status updates
|
|
67
|
+
│ ├── memory-consolidation.md ← end-of-session memory snapshot
|
|
68
|
+
│ ├── distillation.md ← deep cross-session pattern analysis (every 2 days)
|
|
69
|
+
│ └── inbox-triage.md ← classify new files
|
|
70
|
+
├── memory/ ← persistent agent state (Tulving's taxonomy)
|
|
71
|
+
│ ├── semantic.md ← facts, preferences (always loaded at boot)
|
|
72
|
+
│ ├── episodic/ ← timestamped events (lazy-loaded by date)
|
|
73
|
+
│ ├── procedural/ ← learned skills (lazy-loaded by name)
|
|
74
|
+
│ └── corrections.md ← past mistakes
|
|
75
|
+
└── proc/ ← runtime state (ephemeral, gitignored)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Compile Pipeline
|
|
79
|
+
|
|
80
|
+
Write once in `.agentos/`, compile to all native formats:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
.agentos/
|
|
84
|
+
manifest.yaml
|
|
85
|
+
init.d/ + memory/
|
|
86
|
+
│
|
|
87
|
+
agentfs compile
|
|
88
|
+
│
|
|
89
|
+
┌──────────┼──────────┐
|
|
90
|
+
▼ ▼ ▼
|
|
91
|
+
claude/ openclaw/ cursor/
|
|
92
|
+
│ │ │
|
|
93
|
+
▼ ▼ ▼
|
|
94
|
+
CLAUDE.md SOUL.md .cursorrules
|
|
95
|
+
.claude/ .omc/ .cursor/
|
|
96
|
+
settings project-
|
|
97
|
+
memory.json
|
|
98
|
+
|
|
99
|
+
+ AGENTS.md (vault router)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
agentfs compile # manifest → all native formats
|
|
104
|
+
agentfs compile claude # only Claude configs
|
|
105
|
+
agentfs compile --dry-run # preview changes
|
|
106
|
+
agentfs import memory # sync memory from native → canonical
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Linux FHS Mapping
|
|
110
|
+
|
|
111
|
+
Vault directories map to Linux filesystem hierarchy:
|
|
112
|
+
|
|
113
|
+
| Linux FHS | Vault Path | Purpose |
|
|
114
|
+
|-----------|-----------|---------|
|
|
115
|
+
| `/tmp` | `Inbox/` | Entry point for new notes |
|
|
116
|
+
| `/var/log` | `Daily/` | Daily journals |
|
|
117
|
+
| `/var/spool` | `Tasks/` | Task queues |
|
|
118
|
+
| `/home` | `Projects/` | Active projects |
|
|
119
|
+
| `/srv` | `Content/` | Content for publishing |
|
|
120
|
+
| `/usr/share` | `Knowledge/` | Shared knowledge base |
|
|
121
|
+
| `/etc` | `.agentos/` | System configuration |
|
|
122
|
+
| `/var/lib` | `.agentos/memory/` | Persistent agent state |
|
|
123
|
+
| `/etc/init.d` | `.agentos/init.d/` | Boot scripts |
|
|
124
|
+
| `/etc/cron.d` | `.agentos/cron.d/` | Scheduled jobs |
|
|
125
|
+
| `/proc` | `.agentos/proc/` | Runtime state (ephemeral) |
|
|
126
|
+
|
|
127
|
+
### Memory System (Tulving's Taxonomy)
|
|
128
|
+
|
|
129
|
+
Agent memory is split into three types based on cognitive science:
|
|
130
|
+
|
|
131
|
+
**Semantic** (`semantic.md`) — context-free facts. Always loaded at boot. ~10x token savings vs loading everything.
|
|
132
|
+
```
|
|
133
|
+
PREF: no emoji in headings
|
|
134
|
+
FACT: [active] primary stack is Kubernetes + ArgoCD
|
|
135
|
+
PATTERN: [confidence:0.85] more productive in the morning
|
|
136
|
+
AVOID: don't suggest LangChain
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Episodic** (`episodic/YYYY-MM-DD.md`) — timestamped events. Lazy-loaded when needed.
|
|
140
|
+
|
|
141
|
+
**Procedural** (`procedural/{skill}.md`) — learned skills and workflows. Lazy-loaded by name.
|
|
142
|
+
|
|
143
|
+
Confidence scoring with decay: new patterns start at 0.3, confirmed +0.2, denied -0.3, inactive 30 days -0.1. Below 0.1 = superseded. Facts use immutable append — never deleted, marked as `[superseded:{date}]`.
|
|
144
|
+
|
|
145
|
+
### Security Model (5-Level Defense in Depth)
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
Level 5: ENCRYPTION AT REST — SOPS/age for secrets, git-crypt for PII
|
|
149
|
+
Level 4: SECRETS VAULT — agent NEVER sees raw values, only references
|
|
150
|
+
Level 3: APPARMOR PROFILES — policy.yaml → .claude/settings.json deny rules
|
|
151
|
+
Level 2: AGENT POLICY — .agentignore + Security Policy in CLAUDE.md
|
|
152
|
+
Level 1: GIT HYGIENE — .gitignore for runtime state
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
`policy.yaml` defines what the agent can read, write, and execute. It compiles into real enforcement — Claude Code's `permissions.deny[]` actually blocks file access. For agents without enforcement (OpenClaw), it falls back to advisory text.
|
|
156
|
+
|
|
157
|
+
Composable security modules: base policy + domain-specific extensions (crypto, web, infra, cloud, ci-cd).
|
|
158
|
+
|
|
159
|
+
### Boot Sequence (SysVinit Runlevels)
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
Runlevel 0: HALT — agent off
|
|
163
|
+
Runlevel 1: IDENTITY — load who I am, whose vault
|
|
164
|
+
Runlevel 2: MEMORY — load semantic memory (episodic + procedural lazy)
|
|
165
|
+
Runlevel 3: CONTEXT — load today's daily note + tasks
|
|
166
|
+
Runlevel 4: PROJECTS — load active projects
|
|
167
|
+
Runlevel 5: FULL — interactive mode (all systems go)
|
|
168
|
+
Runlevel 6: SHUTDOWN — memory consolidation, save state
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Progressive disclosure: only semantic memory loaded at boot. Episodic and procedural memory loaded on demand. Reduces boot context by ~10x.
|
|
172
|
+
|
|
173
|
+
## Three Profiles
|
|
174
|
+
|
|
175
|
+
| Profile | For | Key Features |
|
|
176
|
+
|---------|-----|-------------|
|
|
177
|
+
| `personal` | Solo engineer, creator, builder | Career pipeline, content publishing, engineering knowledge base |
|
|
178
|
+
| `company` | Team with shared knowledge | RBAC, team directories, ADR, postmortems, onboarding path |
|
|
179
|
+
| `shared` | Multi-user collaborative | Per-user spaces, shared projects, user config files |
|
|
180
|
+
|
|
181
|
+
## CLI
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Scaffold
|
|
185
|
+
npx create-agentfs # interactive setup
|
|
186
|
+
|
|
187
|
+
# Compile
|
|
188
|
+
agentfs compile # all native formats
|
|
189
|
+
agentfs compile claude --dry-run # preview Claude changes
|
|
190
|
+
|
|
191
|
+
# Memory
|
|
192
|
+
agentfs memory show # show semantic memory
|
|
193
|
+
agentfs memory consolidate # manual consolidation
|
|
194
|
+
|
|
195
|
+
# Security
|
|
196
|
+
agentfs security mode enforce # enforce | complain | disabled
|
|
197
|
+
agentfs security add crypto # add domain-specific module
|
|
198
|
+
agentfs security test # dry-run policy check
|
|
199
|
+
|
|
200
|
+
# Maintenance
|
|
201
|
+
agentfs doctor # vault health check (+ agnix 385 rules)
|
|
202
|
+
agentfs triage # classify Inbox/ files
|
|
203
|
+
agentfs onboard # agent-led interview → identity + memory
|
|
204
|
+
agentfs sync # bidirectional manifest ↔ compiled outputs
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Release v0.1.0** — Core architecture and all planned epics are fully implemented.
|
|
208
|
+
|
|
209
|
+
### Core Documentation
|
|
210
|
+
- 🚀 **[Quick Start Guide](docs/quickstart.md)** — Go here if you are a human.
|
|
211
|
+
- 🤖 **[AI Agent Manual](docs/ai-manual.md)** — Tell your AI to read this file first. Yes, AgentFS is 100% **AI-Native** and provides an explicit instruction manual for the AI itself.
|
|
212
|
+
- 🏛️ **[Architecture Document](docs/architecture.md)** — Full design document (v3, 17 sections).
|
|
213
|
+
- 🔍 **[Competitive Research](docs/competitive-research.md)** — Analysis of 12 existing repos and what we took from them.
|
|
214
|
+
- 🗺️ **[AGENTS.md](AGENTS.md)** — Vault router (generated).
|
|
215
|
+
|
|
216
|
+
## Roadmap
|
|
217
|
+
|
|
218
|
+
All phases (1 through 11) have been successfully completed:
|
|
219
|
+
- ✅ Phase 1: Spec → review → approve
|
|
220
|
+
- ✅ Phase 2: MVP — npx create-agentfs: personal + compile.d/claude
|
|
221
|
+
- ✅ Phase 2.5: Onboard — agent-led interview
|
|
222
|
+
- ✅ Phase 3: Memory — Tulving taxonomy + confidence scoring
|
|
223
|
+
- ✅ Phase 4: Cron — consolidation + distillation + inbox-triage
|
|
224
|
+
- ✅ Phase 5: Security — policy.yaml + AppArmor + input validation
|
|
225
|
+
- ✅ Phase 6: Secrets — SOPS/age + exec --with-secrets
|
|
226
|
+
- ✅ Phase 7: Sync — bidirectional manifest ↔ CLAUDE.md
|
|
227
|
+
- ✅ Phase 8: compile.d/openclaw + memory sync
|
|
228
|
+
- ✅ Phase 9: Company + Shared profiles
|
|
229
|
+
- ✅ Phase 10: Full CLI (doctor + agnix, triage, migrate)
|
|
230
|
+
- ✅ Phase 11: Community — npm publish, contributing guide
|
|
231
|
+
|
|
232
|
+
## Contributing
|
|
233
|
+
|
|
234
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on adding agent compilers and security modules.
|
|
235
|
+
|
|
236
|
+
## License
|
|
237
|
+
|
|
238
|
+
MIT
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* AgentFS CLI entry point.
|
|
4
|
+
*
|
|
5
|
+
* Invoked as `npx create-agentfs` or `agentfs <subcommand>`.
|
|
6
|
+
*
|
|
7
|
+
* When run with no arguments (the `npx create-agentfs` case) it prints a
|
|
8
|
+
* welcome message and exits — scaffolding is not yet implemented.
|
|
9
|
+
*
|
|
10
|
+
* When run with a known subcommand it prints a "not yet implemented" stub
|
|
11
|
+
* message. When run with an unknown subcommand it prints usage help.
|
|
12
|
+
*
|
|
13
|
+
* No external arg-parsing library is used; everything is read from
|
|
14
|
+
* `process.argv` directly.
|
|
15
|
+
*
|
|
16
|
+
* @module cli
|
|
17
|
+
*/
|
|
18
|
+
/** CLI version — kept in sync with package.json by convention. */
|
|
19
|
+
export declare const VERSION = "0.1.0";
|
|
20
|
+
/**
|
|
21
|
+
* All subcommands recognised by the CLI.
|
|
22
|
+
*
|
|
23
|
+
* - `init` — scaffold a new AgentFS vault (same as create-agentfs)
|
|
24
|
+
* - `compile` — compile .agentos/ kernel into native agent configs
|
|
25
|
+
* - `onboard` — interactive first-run wizard (create-agentfs flow)
|
|
26
|
+
* - `memory` — inspect / edit Tulving memory layers
|
|
27
|
+
* - `security` — manage AppArmor-style security policy
|
|
28
|
+
* - `doctor` — health-check the vault and diagnose problems
|
|
29
|
+
* - `triage` — process Inbox/ using cron triage rules
|
|
30
|
+
* - `migrate` — migrate an existing vault to AgentFS layout
|
|
31
|
+
* - `sync` — sync compiled outputs to all registered agents
|
|
32
|
+
* - `import` — import external notes/files into the vault
|
|
33
|
+
* - `exec` — run a one-off .agentos/cron.d/ job manually
|
|
34
|
+
* - `status` — print current vault and agent runtime status
|
|
35
|
+
*/
|
|
36
|
+
export type Subcommand = 'compile' | 'onboard' | 'memory' | 'cron' | 'security' | 'secret' | 'doctor' | 'triage' | 'migrate' | 'sync' | 'import' | 'exec' | 'status';
|
|
37
|
+
/**
|
|
38
|
+
* CLI main function.
|
|
39
|
+
*
|
|
40
|
+
* Reads `process.argv`, dispatches to the appropriate handler, and calls
|
|
41
|
+
* `process.exit` with the resolved exit code.
|
|
42
|
+
*
|
|
43
|
+
* Exported so that tests can invoke the CLI programmatically without
|
|
44
|
+
* spawning a child process.
|
|
45
|
+
*
|
|
46
|
+
* @param argv - Argument vector (defaults to `process.argv`). The first two
|
|
47
|
+
* entries (node executable + script path) are always skipped.
|
|
48
|
+
* @returns The exit code that was (or would be) passed to `process.exit`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function main(argv?: string[]): Promise<number>;
|
|
51
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;GAeG;AA6BH,kEAAkE;AAClE,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,SAAS,GACT,QAAQ,GACR,MAAM,GACN,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,GACN,QAAQ,GACR,MAAM,GACN,QAAQ,CAAC;AAyIb;;;;;;;;;;;;GAYG;AACH,wBAAsB,IAAI,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAkDzE"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* AgentFS CLI entry point.
|
|
4
|
+
*
|
|
5
|
+
* Invoked as `npx create-agentfs` or `agentfs <subcommand>`.
|
|
6
|
+
*
|
|
7
|
+
* When run with no arguments (the `npx create-agentfs` case) it prints a
|
|
8
|
+
* welcome message and exits — scaffolding is not yet implemented.
|
|
9
|
+
*
|
|
10
|
+
* When run with a known subcommand it prints a "not yet implemented" stub
|
|
11
|
+
* message. When run with an unknown subcommand it prints usage help.
|
|
12
|
+
*
|
|
13
|
+
* No external arg-parsing library is used; everything is read from
|
|
14
|
+
* `process.argv` directly.
|
|
15
|
+
*
|
|
16
|
+
* @module cli
|
|
17
|
+
*/
|
|
18
|
+
// Suppress "declared but never read" errors for the imported types — they are
|
|
19
|
+
// intentional forward references that document what each stub will receive.
|
|
20
|
+
void 0;
|
|
21
|
+
void 0;
|
|
22
|
+
void 0;
|
|
23
|
+
import { compileCommand } from './commands/compile.js';
|
|
24
|
+
import { onboardCommand } from './commands/onboard.js';
|
|
25
|
+
import { memoryCommand } from './commands/memory.js';
|
|
26
|
+
import { cronCommand } from './commands/cron.js';
|
|
27
|
+
import { securityCommand } from './commands/security.js';
|
|
28
|
+
import { secretCommand } from './commands/secret.js';
|
|
29
|
+
import { importCommand, syncCommand } from './commands/sync.js';
|
|
30
|
+
import { doctorCommand, triageCommand, migrateCommand } from './commands/doctor.js';
|
|
31
|
+
import { runSetupPrompts, createDefaultAnswers } from './generators/prompts.js';
|
|
32
|
+
import { scaffold, formatScaffoldSummary } from './generators/scaffold.js';
|
|
33
|
+
/** CLI version — kept in sync with package.json by convention. */
|
|
34
|
+
export const VERSION = '0.1.0';
|
|
35
|
+
/** Set used for O(1) membership checks without type widening. */
|
|
36
|
+
const KNOWN_SUBCOMMANDS = new Set([
|
|
37
|
+
'compile',
|
|
38
|
+
'onboard',
|
|
39
|
+
'memory',
|
|
40
|
+
'cron',
|
|
41
|
+
'security',
|
|
42
|
+
'secret',
|
|
43
|
+
'doctor',
|
|
44
|
+
'triage',
|
|
45
|
+
'migrate',
|
|
46
|
+
'sync',
|
|
47
|
+
'import',
|
|
48
|
+
'exec',
|
|
49
|
+
'status',
|
|
50
|
+
]);
|
|
51
|
+
/** Returns true when `value` is a recognised subcommand. */
|
|
52
|
+
function isSubcommand(value) {
|
|
53
|
+
return KNOWN_SUBCOMMANDS.has(value);
|
|
54
|
+
}
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
// Output helpers
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
/** Print a line to stdout. */
|
|
59
|
+
function print(line) {
|
|
60
|
+
process.stdout.write(line + '\n');
|
|
61
|
+
}
|
|
62
|
+
/** Print a line to stderr. */
|
|
63
|
+
function printErr(line) {
|
|
64
|
+
process.stderr.write(line + '\n');
|
|
65
|
+
}
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
// Message templates
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
/** Printed when the binary is invoked with no arguments (`npx create-agentfs`). */
|
|
70
|
+
function printWelcome() {
|
|
71
|
+
print('');
|
|
72
|
+
print(`AgentFS v${VERSION}`);
|
|
73
|
+
print('Scaffold your Obsidian vault as a filesystem-based OS for AI agents.');
|
|
74
|
+
print('');
|
|
75
|
+
}
|
|
76
|
+
/** Parses flags for the scaffold command. */
|
|
77
|
+
async function runScaffold(args) {
|
|
78
|
+
printWelcome();
|
|
79
|
+
let targetDir;
|
|
80
|
+
let profile;
|
|
81
|
+
let nonInteractive = false;
|
|
82
|
+
// Simple ad-hoc parser
|
|
83
|
+
for (let i = 0; i < args.length; i++) {
|
|
84
|
+
const arg = args[i];
|
|
85
|
+
if (arg === '--output' || arg === '-o') {
|
|
86
|
+
targetDir = args[++i];
|
|
87
|
+
}
|
|
88
|
+
else if (arg === '--profile' || arg === '-p') {
|
|
89
|
+
profile = args[++i];
|
|
90
|
+
}
|
|
91
|
+
else if (arg === '--non-interactive') {
|
|
92
|
+
nonInteractive = true;
|
|
93
|
+
}
|
|
94
|
+
else if (!arg.startsWith('-') && !targetDir) {
|
|
95
|
+
// Positional target directory
|
|
96
|
+
targetDir = arg;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
let answers;
|
|
100
|
+
if (nonInteractive) {
|
|
101
|
+
answers = createDefaultAnswers({
|
|
102
|
+
targetDir: targetDir ?? process.cwd(),
|
|
103
|
+
profile: profile ?? 'personal',
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
answers = await runSetupPrompts(targetDir);
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
const result = await scaffold(answers);
|
|
111
|
+
print(formatScaffoldSummary(result));
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
printErr(`Scaffolding failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
116
|
+
return 1;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/** Printed when an unknown subcommand is supplied. */
|
|
120
|
+
function printUsage() {
|
|
121
|
+
print('');
|
|
122
|
+
print(`agentfs v${VERSION} — filesystem-based OS for AI agents`);
|
|
123
|
+
print('');
|
|
124
|
+
print('Usage:');
|
|
125
|
+
print(' npx create-agentfs [dir] [opts] Scaffold a new AgentFS vault');
|
|
126
|
+
print(' agentfs <subcommand> [opts] Run a post-init command');
|
|
127
|
+
print('');
|
|
128
|
+
print('Scaffold Options:');
|
|
129
|
+
print(' --output, -o <dir> Target directory');
|
|
130
|
+
print(' --profile, -p <name> Vault profile (personal/company/shared)');
|
|
131
|
+
print(' --non-interactive Bypass prompts and use default values');
|
|
132
|
+
print('');
|
|
133
|
+
print('Subcommands:');
|
|
134
|
+
print(' init Alias for npx create-agentfs');
|
|
135
|
+
print(' compile Compile .agentos/ kernel into native agent configs');
|
|
136
|
+
print(' onboard Interactive first-run setup wizard');
|
|
137
|
+
print(' memory Inspect and edit Tulving memory layers');
|
|
138
|
+
print(' security Manage AppArmor-style security policy');
|
|
139
|
+
print(' doctor Health-check the vault and diagnose problems');
|
|
140
|
+
print(' triage Process Inbox/ using cron triage rules');
|
|
141
|
+
print(' migrate Migrate an existing vault to AgentFS layout');
|
|
142
|
+
print(' sync Sync compiled outputs to all registered agents');
|
|
143
|
+
print(' import Import external notes/files into the vault');
|
|
144
|
+
print(' exec Run a one-off cron.d/ job manually');
|
|
145
|
+
print(' status Print current vault and agent runtime status');
|
|
146
|
+
print('');
|
|
147
|
+
print('Examples:');
|
|
148
|
+
print(' agentfs compile --dry-run');
|
|
149
|
+
print(' agentfs status');
|
|
150
|
+
print(' agentfs doctor');
|
|
151
|
+
print('');
|
|
152
|
+
}
|
|
153
|
+
/** Printed when a known subcommand stub is invoked. */
|
|
154
|
+
function printStub(subcommand) {
|
|
155
|
+
print(`agentfs ${subcommand}: not yet implemented`);
|
|
156
|
+
}
|
|
157
|
+
// ---------------------------------------------------------------------------
|
|
158
|
+
// Main
|
|
159
|
+
// ---------------------------------------------------------------------------
|
|
160
|
+
/**
|
|
161
|
+
* CLI main function.
|
|
162
|
+
*
|
|
163
|
+
* Reads `process.argv`, dispatches to the appropriate handler, and calls
|
|
164
|
+
* `process.exit` with the resolved exit code.
|
|
165
|
+
*
|
|
166
|
+
* Exported so that tests can invoke the CLI programmatically without
|
|
167
|
+
* spawning a child process.
|
|
168
|
+
*
|
|
169
|
+
* @param argv - Argument vector (defaults to `process.argv`). The first two
|
|
170
|
+
* entries (node executable + script path) are always skipped.
|
|
171
|
+
* @returns The exit code that was (or would be) passed to `process.exit`.
|
|
172
|
+
*/
|
|
173
|
+
export async function main(argv = process.argv) {
|
|
174
|
+
// argv[0] = node, argv[1] = script path, argv[2+] = user args
|
|
175
|
+
const args = argv.slice(2);
|
|
176
|
+
const subcommand = args[0];
|
|
177
|
+
// Help flags — delegate to usage first (can be used with no subcommands).
|
|
178
|
+
if (subcommand === '--help' || subcommand === '-h' || subcommand === 'help') {
|
|
179
|
+
printUsage();
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
// Version flags.
|
|
183
|
+
if (subcommand === '--version' || subcommand === '-v') {
|
|
184
|
+
print(VERSION);
|
|
185
|
+
return 0;
|
|
186
|
+
}
|
|
187
|
+
// Detect if running as create-agentfs
|
|
188
|
+
const isCreateBin = argv[1] && (argv[1].endsWith('create-agentfs') || argv[1].endsWith('create-agentfs.js'));
|
|
189
|
+
// If no arguments or the command starts with a flag (like npx create-agentfs --non-interactive)
|
|
190
|
+
// or it is explicitly "init", run the scaffolder.
|
|
191
|
+
if (subcommand === undefined || subcommand.startsWith('-') || subcommand === 'init' || (isCreateBin && !isSubcommand(subcommand))) {
|
|
192
|
+
// If it's pure "init", slice it out so we just parse the trailing args.
|
|
193
|
+
const scaffoldArgs = subcommand === 'init' ? args.slice(1) : args;
|
|
194
|
+
return runScaffold(scaffoldArgs);
|
|
195
|
+
}
|
|
196
|
+
// Known subcommand — dispatch to implemented handlers, stub the rest.
|
|
197
|
+
if (isSubcommand(subcommand)) {
|
|
198
|
+
const subArgs = args.slice(1);
|
|
199
|
+
if (subcommand === 'compile')
|
|
200
|
+
return compileCommand(subArgs);
|
|
201
|
+
if (subcommand === 'onboard')
|
|
202
|
+
return onboardCommand(subArgs);
|
|
203
|
+
if (subcommand === 'memory')
|
|
204
|
+
return memoryCommand(subArgs);
|
|
205
|
+
if (subcommand === 'cron')
|
|
206
|
+
return cronCommand(subArgs);
|
|
207
|
+
if (subcommand === 'security')
|
|
208
|
+
return securityCommand(subArgs);
|
|
209
|
+
if (subcommand === 'secret')
|
|
210
|
+
return secretCommand(subArgs);
|
|
211
|
+
if (subcommand === 'import')
|
|
212
|
+
return importCommand(subArgs);
|
|
213
|
+
if (subcommand === 'sync')
|
|
214
|
+
return syncCommand(subArgs);
|
|
215
|
+
if (subcommand === 'doctor')
|
|
216
|
+
return doctorCommand(subArgs);
|
|
217
|
+
if (subcommand === 'triage')
|
|
218
|
+
return triageCommand(subArgs);
|
|
219
|
+
if (subcommand === 'migrate')
|
|
220
|
+
return migrateCommand(subArgs);
|
|
221
|
+
printStub(subcommand);
|
|
222
|
+
return 0;
|
|
223
|
+
}
|
|
224
|
+
// Unknown subcommand → usage + non-zero exit.
|
|
225
|
+
printErr(`agentfs: unknown subcommand '${subcommand}'`);
|
|
226
|
+
printUsage();
|
|
227
|
+
return 1;
|
|
228
|
+
}
|
|
229
|
+
// ---------------------------------------------------------------------------
|
|
230
|
+
// Bootstrap — only run when executed directly (not imported in tests).
|
|
231
|
+
// ---------------------------------------------------------------------------
|
|
232
|
+
// In ESM with NodeNext module resolution the canonical way to detect the
|
|
233
|
+
// main module is to compare import.meta.url against the resolved entry URL.
|
|
234
|
+
// We call `process.exit` here so tests that import `main` are not affected.
|
|
235
|
+
const isEntryPoint =
|
|
236
|
+
// On POSIX the argv[1] path matches the file URL when run via `node`.
|
|
237
|
+
process.argv[1] !== undefined &&
|
|
238
|
+
import.meta.url.endsWith(
|
|
239
|
+
// Normalise Windows backslashes just in case.
|
|
240
|
+
process.argv[1].replace(/\\/g, '/').split('/').pop() ?? '');
|
|
241
|
+
if (isEntryPoint) {
|
|
242
|
+
main().then((code) => {
|
|
243
|
+
process.exit(code);
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;GAeG;AAWH,8EAA8E;AAC9E,4EAA4E;AAC5E,KAAM,CAAyB,CAAC;AAChC,KAAM,CAA8B,CAAC;AACrC,KAAM,CAA+B,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,eAA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,UAAU,GAAG,CAAC,CAAC;IACxD,UAAU,EAAE,CAAC;IACb,OAAO,CAAC,CAAC;AACX,CAAC;AAED,8EAA8E;AAC9E,uEAAuE;AACvE,8EAA8E;AAE9E,yEAAyE;AACzE,4EAA4E;AAC5E,4EAA4E;AAC5E,MAAM,YAAY;AAChB,sEAAsE;AACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS;IAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ;IACtB,8CAA8C;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAC3D,CAAC;AAEJ,IAAI,YAAY,EAAE,CAAC;IACjB,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;QACnB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agentfs compile` command implementation.
|
|
3
|
+
*
|
|
4
|
+
* Reads `.agentos/manifest.yaml`, runs the appropriate compiler driver(s),
|
|
5
|
+
* always regenerates `AGENT-MAP.md`, and writes only files marked as managed
|
|
6
|
+
* (`output.managed === true`).
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```
|
|
10
|
+
* agentfs compile # compile all agents from manifest
|
|
11
|
+
* agentfs compile claude # compile one agent only
|
|
12
|
+
* agentfs compile --dry-run # preview without writing
|
|
13
|
+
* agentfs compile claude --dry-run # preview for one agent
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @module commands/compile
|
|
17
|
+
*/
|
|
18
|
+
import type { CompileContext } from '../types/index.js';
|
|
19
|
+
/**
|
|
20
|
+
* Validate the compile context and return a list of warning messages.
|
|
21
|
+
*
|
|
22
|
+
* These are advisory only — warnings do not block compilation.
|
|
23
|
+
* Callers should print warnings to stderr before proceeding.
|
|
24
|
+
*
|
|
25
|
+
* @param context - The compile context to validate
|
|
26
|
+
* @returns Array of human-readable warning strings (empty if all clear)
|
|
27
|
+
*/
|
|
28
|
+
export declare function validateContext(context: CompileContext): string[];
|
|
29
|
+
/**
|
|
30
|
+
* Entry point for the `agentfs compile` subcommand.
|
|
31
|
+
*
|
|
32
|
+
* Orchestrates:
|
|
33
|
+
* 1. Building the compile context (reads manifest + init.d + memory).
|
|
34
|
+
* 2. Running the requested compiler driver(s).
|
|
35
|
+
* 3. Always generating AGENT-MAP.md.
|
|
36
|
+
* 4. Writing only outputs where `managed === true` (ownership protection).
|
|
37
|
+
* 5. Printing a human-readable summary.
|
|
38
|
+
*
|
|
39
|
+
* Ownership protection: this function never writes a file where
|
|
40
|
+
* `output.managed === false`. Unmanaged files are reported in the summary
|
|
41
|
+
* as skipped so callers can observe the decision.
|
|
42
|
+
*
|
|
43
|
+
* @param args - Arguments after the `compile` subcommand token
|
|
44
|
+
* (i.e. `process.argv.slice(3)` when called from the CLI)
|
|
45
|
+
* @returns 0 on success, 1 on error
|
|
46
|
+
*/
|
|
47
|
+
export declare function compileCommand(args: string[]): Promise<number>;
|
|
48
|
+
//# sourceMappingURL=compile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/commands/compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAgB,cAAc,EAAgC,MAAM,mBAAmB,CAAC;AAwHpG;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,EAAE,CAmBjE;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAyGpE"}
|