youmd 0.8.2 → 0.8.5

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.
Files changed (42) hide show
  1. package/dist/commands/chat.d.ts.map +1 -1
  2. package/dist/commands/chat.js +17 -0
  3. package/dist/commands/chat.js.map +1 -1
  4. package/dist/commands/env.d.ts +19 -4
  5. package/dist/commands/env.d.ts.map +1 -1
  6. package/dist/commands/env.js +243 -21
  7. package/dist/commands/env.js.map +1 -1
  8. package/dist/commands/stack.d.ts.map +1 -1
  9. package/dist/commands/stack.js +8 -2
  10. package/dist/commands/stack.js.map +1 -1
  11. package/dist/commands/status.d.ts.map +1 -1
  12. package/dist/commands/status.js +8 -1
  13. package/dist/commands/status.js.map +1 -1
  14. package/dist/commands/sync.d.ts +1 -0
  15. package/dist/commands/sync.d.ts.map +1 -1
  16. package/dist/commands/sync.js +184 -0
  17. package/dist/commands/sync.js.map +1 -1
  18. package/dist/index.js +40 -4
  19. package/dist/index.js.map +1 -1
  20. package/dist/lib/api.d.ts +74 -0
  21. package/dist/lib/api.d.ts.map +1 -1
  22. package/dist/lib/api.js +36 -0
  23. package/dist/lib/api.js.map +1 -1
  24. package/dist/lib/daemon.d.ts +3 -0
  25. package/dist/lib/daemon.d.ts.map +1 -1
  26. package/dist/lib/daemon.js +21 -0
  27. package/dist/lib/daemon.js.map +1 -1
  28. package/dist/lib/machine-bootstrap-prompt.d.ts.map +1 -1
  29. package/dist/lib/machine-bootstrap-prompt.js +305 -184
  30. package/dist/lib/machine-bootstrap-prompt.js.map +1 -1
  31. package/dist/lib/realtime-sync.d.ts +128 -0
  32. package/dist/lib/realtime-sync.d.ts.map +1 -0
  33. package/dist/lib/realtime-sync.js +215 -0
  34. package/dist/lib/realtime-sync.js.map +1 -0
  35. package/package.json +2 -1
  36. package/scripts/env-vault/README.md +9 -0
  37. package/scripts/env-vault/restore.sh +85 -12
  38. package/scripts/skillstack-sync/README.md +24 -6
  39. package/scripts/skillstack-sync/bootstrap-new-mac.sh +31 -0
  40. package/scripts/skillstack-sync/com.youmd.realtime-sync.plist +35 -0
  41. package/scripts/skillstack-sync/install-daemons.sh +4 -1
  42. package/skills/machine-bootstrap.md +88 -19
@@ -10,6 +10,7 @@
10
10
  # Usage: bash bootstrap-new-mac.sh
11
11
 
12
12
  set -euo pipefail
13
+ export PATH="${HOME}/.youmd/bin:${HOME}/.youmd/npm-global/bin:/opt/homebrew/opt/node@22/bin:/usr/local/opt/node@22/bin:/opt/homebrew/bin:/usr/local/bin:${PATH}"
13
14
 
14
15
  AGENT_SHARED="${HOME}/.agent-shared"
15
16
  SCISTACK="${HOME}/.claude/scistack"
@@ -33,6 +34,34 @@ warn() {
33
34
  echo " WARN: $*"
34
35
  }
35
36
 
37
+ ensure_github_auth() {
38
+ if ! command -v gh >/dev/null 2>&1; then
39
+ warn "GitHub CLI is missing. Install it with Homebrew first: brew install gh"
40
+ return 1
41
+ fi
42
+
43
+ if gh auth status >/dev/null 2>&1; then
44
+ info "GitHub auth ready."
45
+ return 0
46
+ fi
47
+
48
+ warn "GitHub auth is required before private skill/stack repos can clone."
49
+ if [ -t 0 ]; then
50
+ gh auth login -h github.com -p https -s repo || true
51
+ fi
52
+
53
+ if gh auth status >/dev/null 2>&1; then
54
+ info "GitHub auth ready."
55
+ return 0
56
+ fi
57
+
58
+ warn "GitHub auth still is not complete."
59
+ warn "Open a normal Terminal and run:"
60
+ warn " $(command -v gh || echo gh) auth login -h github.com -p https -s repo"
61
+ warn "Then rerun: youmd machine setup"
62
+ return 1
63
+ }
64
+
36
65
  # ---------------------------------------------------------------------------
37
66
  step "1. Install youmd CLI"
38
67
  # ---------------------------------------------------------------------------
@@ -47,6 +76,8 @@ fi
47
76
  # ---------------------------------------------------------------------------
48
77
  step "2. Clone agent-shared repo → ${AGENT_SHARED}"
49
78
  # ---------------------------------------------------------------------------
79
+ ensure_github_auth
80
+
50
81
  if [ -d "${AGENT_SHARED}/.git" ]; then
51
82
  info "Already present: ${AGENT_SHARED} — skipping clone."
52
83
  else
@@ -0,0 +1,35 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>Label</key>
6
+ <string>com.youmd.realtime-sync</string>
7
+
8
+ <key>ProgramArguments</key>
9
+ <array>
10
+ <string>/bin/zsh</string>
11
+ <string>-lc</string>
12
+ <string>youmd sync --live --daemon</string>
13
+ </array>
14
+
15
+ <key>RunAtLoad</key>
16
+ <true/>
17
+
18
+ <key>KeepAlive</key>
19
+ <true/>
20
+
21
+ <key>StandardOutPath</key>
22
+ <string>__HOME__/.youmd/logs/realtime-sync.out.log</string>
23
+
24
+ <key>StandardErrorPath</key>
25
+ <string>__HOME__/.youmd/logs/realtime-sync.err.log</string>
26
+
27
+ <key>EnvironmentVariables</key>
28
+ <dict>
29
+ <key>HOME</key>
30
+ <string>__HOME__</string>
31
+ <key>PATH</key>
32
+ <string>/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
33
+ </dict>
34
+ </dict>
35
+ </plist>
@@ -12,7 +12,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
12
12
  LAUNCH_AGENTS_DIR="${HOME}/Library/LaunchAgents"
13
13
  LOG_DIR="${HOME}/.youmd/logs"
14
14
 
15
- PLISTS="com.youmd.skillstack-sync com.youmd.identity-sync com.youmd.context-sync"
15
+ PLISTS="com.youmd.realtime-sync com.youmd.skillstack-sync com.youmd.identity-sync com.youmd.context-sync"
16
16
 
17
17
  echo "==> Creating log directory: ${LOG_DIR}"
18
18
  mkdir -p "${LOG_DIR}"
@@ -58,6 +58,8 @@ echo "================================================================"
58
58
  echo "Resident You.md daemons installed and running."
59
59
  echo ""
60
60
  echo "Log files:"
61
+ echo " ${LOG_DIR}/realtime-sync.out.log (Convex websocket sync stdout)"
62
+ echo " ${LOG_DIR}/realtime-sync.err.log (Convex websocket sync stderr)"
61
63
  echo " ${LOG_DIR}/skillstack-sync.log (combined sync log)"
62
64
  echo " ${LOG_DIR}/skillstack-sync.out.log (daemon stdout)"
63
65
  echo " ${LOG_DIR}/skillstack-sync.err.log (daemon stderr)"
@@ -68,6 +70,7 @@ echo " ${LOG_DIR}/context-sync.out.log (daemon stdout)"
68
70
  echo " ${LOG_DIR}/context-sync.err.log (daemon stderr)"
69
71
  echo ""
70
72
  echo "Check daemon status:"
73
+ echo " launchctl list com.youmd.realtime-sync"
71
74
  echo " launchctl list com.youmd.skillstack-sync"
72
75
  echo " launchctl list com.youmd.identity-sync"
73
76
  echo " launchctl list com.youmd.context-sync"
@@ -34,12 +34,14 @@ You.md is the brain. The new machine should become a runnable local agent workst
34
34
  for Claude Code or Codex on the new machine, generate it first:
35
35
 
36
36
  ```bash
37
- youmd machine prompt --root ~/Desktop/CODE_YOU --days 90
37
+ youmd machine prompt --root ~/Desktop/CODE_YOU --days 30 --limit 80 --require-env-vault
38
38
  ```
39
39
 
40
40
  If the web dashboard minted a scoped bootstrap key, the generated prompt may
41
41
  include `YOUMD_API_KEY`. Treat that prompt as secret-bearing local setup
42
42
  material and do not paste it into public chats, tickets, or docs.
43
+ Fresh-machine bootstrap keys must include the `vault` scope so the trusted
44
+ device can pull encrypted Secret Vault snapshots after login.
43
45
  For bounded proof runs on a clean local root, add
44
46
  `--max-clone-projects 2` or set `YOUMD_MAX_CLONE_PROJECTS=2`; omit that cap
45
47
  on the real new machine.
@@ -70,31 +72,40 @@ You.md is the brain. The new machine should become a runnable local agent workst
70
72
 
71
73
  6. Hydrate the portfolio graph from You.md/GitHub records before cloning, then
72
74
  preview the graph-backed setup plan before creating the desktop code workspace
73
- and syncing active projects:
75
+ and syncing truly active 30-day projects first:
76
+
77
+ ```bash
78
+ youmd project portfolio-hydrate --root ~/Desktop/CODE_YOU --days 30 --limit 80
79
+ youmd machine projects --root ~/Desktop/CODE_YOU --days 30 --recent-only --dry-run
80
+ youmd machine projects --root ~/Desktop/CODE_YOU --days 30 --recent-only
81
+ ```
82
+
83
+ 7. Ask whether Houston wants to expand the workspace to all active projects
84
+ from the last 90 days before calling the full project clone set complete:
74
85
 
75
86
  ```bash
76
87
  youmd project portfolio-hydrate --root ~/Desktop/CODE_YOU --days 90 --limit 80
77
- youmd machine projects --root ~/Desktop/CODE_YOU --days 90 --dry-run
78
- youmd machine projects --root ~/Desktop/CODE_YOU --days 90
88
+ youmd machine projects --root ~/Desktop/CODE_YOU --days 90 --recent-only --dry-run
89
+ youmd machine projects --root ~/Desktop/CODE_YOU --days 90 --recent-only
79
90
  ```
80
91
 
81
- 7. If GitHub auth is missing, help the user log in and rerun only the project
92
+ 8. If GitHub auth is missing, help the user log in and rerun only the project
82
93
  clone step:
83
94
 
84
95
  ```bash
85
96
  gh auth login
86
- youmd machine projects --root ~/Desktop/CODE_YOU --days 90
97
+ youmd machine projects --root ~/Desktop/CODE_YOU --days 30 --recent-only
87
98
  ```
88
99
 
89
- 8. After projects are cloned and any encrypted env vault is restored, hydrate the
100
+ 9. After projects are cloned and any encrypted env vault is restored, hydrate the
90
101
  portfolio graph again so local README, project-context, git, PR, and env-key
91
102
  evidence becomes visible to future agents:
92
103
 
93
104
  ```bash
94
- youmd project portfolio-hydrate --root ~/Desktop/CODE_YOU --days 90 --limit 80
105
+ youmd project portfolio-hydrate --root ~/Desktop/CODE_YOU --days 30 --limit 80
95
106
  ```
96
107
 
97
- 9. Run the secret-safe readiness audit and sync the proof summary:
108
+ 10. Run the secret-safe readiness audit and sync the proof summary:
98
109
 
99
110
  ```bash
100
111
  youmd machine verify --root ~/Desktop/CODE_YOU --max-projects 80 --write-report --sync-report
@@ -107,7 +118,7 @@ You.md is the brain. The new machine should become a runnable local agent workst
107
118
  summary to the You.md machine dashboard. It does not read secret values,
108
119
  upload raw logs, or launch every dev server.
109
120
 
110
- 10. Only when Houston explicitly wants deeper local proof or the clean host has
121
+ 11. Only when Houston explicitly wants deeper local proof or the clean host has
111
122
  enough time/CPU, run bounded package checks and dev-server probes:
112
123
 
113
124
  ```bash
@@ -119,11 +130,34 @@ You.md is the brain. The new machine should become a runnable local agent workst
119
130
  and dev-server probes are capped by default; tune with
120
131
  `--max-install-projects`, `--max-server-projects`, and timeout flags.
121
132
 
133
+ ## Behind-the-Scenes Agent Operation
134
+
135
+ - Use the You.md CLI and You Agent yourself before asking Houston to do manual
136
+ work. Prefer deterministic commands for setup and proof:
137
+ `youmd status`, `youmd whoami`, `youmd pull`, `youmd sync`,
138
+ `youmd machine prompt`, `youmd machine setup`,
139
+ `youmd skill install all`, `youmd skill sync`,
140
+ `youmd env vault list`, `youmd env vault pull`,
141
+ `youmd project portfolio-hydrate`, and `youmd machine verify`.
142
+ - Use `you` / `youmd chat` when you need the You Agent to synthesize context,
143
+ route a natural-language request, or produce the setup artifact, then turn the
144
+ result into concrete shell actions.
145
+ - Do not stop to ask "what next?" after each setup phase. Continue through the
146
+ command, verify the result, and report concise proof.
147
+ - Interrupt Houston only for true human-gated steps: GitHub browser auth,
148
+ macOS Keychain/passphrase entry, npm OTP, OS permissions, or the explicit
149
+ 90-day project expansion choice.
150
+ - If the installed CLI is stale, run the curl installer/update path first, then
151
+ retry the You.md command. Tell Houston when npm publish is needed for
152
+ `npx youmd@latest` or npm fallback installs.
153
+
122
154
  ## Project Bootstrap Rules
123
155
 
124
156
  - Use repo directory names from GitHub URLs. `https://github.com/houstongolden/foldermd` becomes `foldermd`.
125
- - Default to projects active in the last 90 days plus projects marked active/current in You.md.
126
- - Ask before including older, archived, paused, or dormant projects.
157
+ - Default to projects active in the last 30 days and marked active plus Top
158
+ Priority/Focusing in You.md. Ask before expanding to the 90-day active set.
159
+ - Ask before including older, archived, paused, inactive, on-ice, abandoned,
160
+ killed, dormant, or unsorted projects.
127
161
  - Create the workspace root on the Desktop if it is missing. `CODE_YOU` is the default fresh-machine root.
128
162
  - Use the You.md Portfolio Graph as the strategic source of truth, then merge
129
163
  authenticated GitHub recent-repo data and local bundle project records so repo
@@ -133,7 +167,9 @@ You.md is the brain. The new machine should become a runnable local agent workst
133
167
  local bundle plus authenticated GitHub scan and say so.
134
168
  - Clone with `gh repo clone owner/repo <target>` when `gh` is authenticated; otherwise fall back to `git clone`.
135
169
  - Skip non-empty directories instead of overwriting them.
136
- - Never print secrets. If `.env.local` files are needed, use the shared encrypted env backup/restore path or a password manager.
170
+ - Never print secrets. If `.env.local` files are needed, use You.md Secret Vault
171
+ or the shared encrypted env backup/restore path. Never paste raw env values
172
+ into chat.
137
173
  - After cloning, initialize missing per-repo agent context with `youmd skill init-project` from inside that repo.
138
174
 
139
175
  ## Secret-Safe Env Transfer
@@ -146,26 +182,59 @@ Audit local project env coverage before backup:
146
182
  youmd env backup --root ~/Desktop/CODE_2025 --preflight
147
183
  ```
148
184
 
149
- Create an encrypted archive from the old machine in an interactive macOS terminal:
185
+ Primary path: from the old/source machine, create an encrypted archive and push
186
+ only the ciphertext plus safe manifest metadata to You.md Secret Vault:
187
+
188
+ ```bash
189
+ youmd env vault push --root ~/Desktop/CODE_2025 --out ~/Desktop/youmd-env-vault
190
+ youmd env vault list
191
+ ```
192
+
193
+ The passphrase is still local/trusted-device material. If the new machine needs
194
+ headless restore, store the passphrase in macOS Keychain once from a normal
195
+ trusted Terminal. Input is silent and the value is not printed:
196
+
197
+ ```bash
198
+ read -rs "PW?You.md vault passphrase: " && \
199
+ security add-generic-password -a "$USER" -s youmd-env-vault -w "$PW" -U && \
200
+ unset PW && echo "stored in Keychain"
201
+ ```
202
+
203
+ On the new machine, pull the latest encrypted account snapshot and restore into
204
+ already-cloned project directories without clobbering local agent auth:
205
+
206
+ ```bash
207
+ youmd env vault pull --out ~/.youmd/secret-vault
208
+ youmd env vault pull --restore --root ~/Desktop/CODE_YOU --map-existing --existing-only --skip-agent-auth
209
+ ```
210
+
211
+ Fallback path: create an encrypted archive from the old machine in an
212
+ interactive macOS terminal and transfer the encrypted file by iCloud, AirDrop,
213
+ USB, or private password-manager attachment:
150
214
 
151
215
  ```bash
152
216
  open ~/.agent-shared/bin/env-backup-interactive.command
217
+ youmd env backup --root ~/Desktop/CODE_2025 --out ~/Desktop/youmd-env-vault
153
218
  ```
154
219
 
155
220
  On the new machine, list the encrypted archive by path only before restore:
156
221
 
157
222
  ```bash
158
223
  ~/.agent-shared/bin/env-secure-restore.sh --archive ~/Desktop/env-local-backup.tar.gz.gpg --list
159
- youmd env restore ~/Desktop/env-local-backup.tar.gz.gpg --root ~/Desktop/CODE_YOU --list
160
- youmd env restore ~/Desktop/env-local-backup.tar.gz.gpg --root ~/Desktop/CODE_YOU
224
+ youmd env restore ~/Desktop/env-local-backup.tar.gz.gpg --root ~/Desktop/CODE_YOU --list --map-existing --existing-only --skip-agent-auth
225
+ youmd env restore ~/Desktop/env-local-backup.tar.gz.gpg --root ~/Desktop/CODE_YOU --map-existing --existing-only --skip-agent-auth
161
226
  ```
162
227
 
228
+ If a headless agent reports that Keychain service `youmd-env-vault` is missing,
229
+ do not make it guess. Print the Keychain command above, have Houston run it once
230
+ on the trusted device, then rerun only the restore/setup command.
231
+
163
232
  ## Useful Variants
164
233
 
165
234
  Dry-run the project layout:
166
235
 
167
236
  ```bash
168
- youmd machine projects --root ~/Desktop/CODE_YOU --days 90 --dry-run
237
+ youmd machine projects --root ~/Desktop/CODE_YOU --days 30 --recent-only --dry-run
169
238
  ```
170
239
 
171
240
  Create directories only, without cloning:
@@ -201,13 +270,13 @@ youmd machine projects --root ~/Desktop/CODE_YOU --yes
201
270
  Generate the copy/paste prompt for a new Claude Code or Codex terminal:
202
271
 
203
272
  ```bash
204
- youmd machine prompt --root ~/Desktop/CODE_YOU --days 90 --limit 80
273
+ youmd machine prompt --root ~/Desktop/CODE_YOU --days 30 --limit 80 --require-env-vault
205
274
  ```
206
275
 
207
276
  Generate the same prompt but cap clones for a clean-host proof run:
208
277
 
209
278
  ```bash
210
- youmd machine prompt --root /tmp/youmd-clean-host-CODE_YOU --days 90 --limit 80 --max-clone-projects 2
279
+ youmd machine prompt --root /tmp/youmd-clean-host-CODE_YOU --days 30 --limit 80 --max-clone-projects 2 --require-env-vault
211
280
  ```
212
281
 
213
282
  Fetch the secret-safe project graph directly: