@hasna/machines 0.0.33 → 0.0.35

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/README.md CHANGED
@@ -30,23 +30,40 @@ Endpoints on `127.0.0.1` only:
30
30
  ```bash
31
31
  machines manifest init
32
32
  machines manifest bootstrap
33
- machines manifest add --id spark01 --platform linux --workspace-path ~/workspace
34
- machines manifest add --id apple03 --platform macos --workspace-path ~/Workspace --app ghostty:cask
33
+ machines manifest add --id linux-dev-01 --platform linux --workspace-path ~/workspace
34
+ machines manifest add --id mac-lab-01 --platform macos --workspace-path ~/Workspace --app ghostty:cask
35
35
  machines manifest validate
36
36
  machines manifest list
37
37
  ```
38
38
 
39
+ Public packages should keep private fleet state behind an opaque source/ref
40
+ boundary. `HASNA_MACHINES_PRIVATE_MANIFEST_REF` (or
41
+ `MACHINES_PRIVATE_MANIFEST_REF`) may point at a private backend, but
42
+ open-machines only reports the redacted ref and falls back to the local
43
+ `machines.json` unless a caller supplies a manifest adapter. The adapter
44
+ contract is backend-agnostic and lives in the package root exports; it does not
45
+ pull in secrets managers, storage SDKs, or org-specific fleet internals.
46
+
39
47
  ## Provision and reconcile
40
48
 
41
49
  ```bash
42
- machines setup --machine spark01 --json
43
- machines setup --machine spark01 --apply --yes
44
- machines sync --machine spark01 --json
45
- machines sync --machine spark01 --apply --yes
46
- machines doctor --machine spark01
50
+ machines setup --machine linux-dev-01
51
+ machines setup --machine linux-dev-01 --json
52
+ machines setup --machine linux-dev-01 --apply --yes
53
+ machines sync --machine linux-dev-01 --json
54
+ machines sync --machine linux-dev-01 --apply --yes
55
+ machines doctor --machine linux-dev-01
47
56
  machines self-test
48
57
  ```
49
58
 
59
+ `machines setup` is a dry-run plan by default. The generated playbook favors
60
+ idempotent operations (`mkdir -p`, command-existence guards, package-manager
61
+ installs) and only executes when both `--apply` and `--yes` are provided.
62
+ `doctor --json` includes public-safe source/ref diagnostics plus optional
63
+ adapter hook results for secrets, configs, monitors, repos, MCPs, and shield
64
+ checks. When no adapter is configured, those checks report a skipped fallback
65
+ instead of importing private dependencies.
66
+
50
67
  ## Topology SDK
51
68
 
52
69
  `@hasna/machines` exposes a compact consumer SDK for other open-core packages
@@ -68,9 +85,9 @@ import {
68
85
  console.log(MACHINES_CONSUMER_CONTRACT.schema_version);
69
86
  const topology = discoverMachineTopology();
70
87
  const local = getLocalMachineTopology();
71
- const route = resolveMachineRoute("spark01");
88
+ const route = resolveMachineRoute("linux-dev-01");
72
89
  const workspace = resolveMachineWorkspace({
73
- machineId: "spark01",
90
+ machineId: "linux-dev-01",
74
91
  projectId: "open-knowledge",
75
92
  repoName: "open-knowledge",
76
93
  });
@@ -115,7 +132,7 @@ CLI and MCP expose the same topology view:
115
132
  ```bash
116
133
  machines topology --json
117
134
  machines topology --no-tailscale --json
118
- machines route --machine spark01 --json
135
+ machines route --machine linux-dev-01 --json
119
136
  ```
120
137
 
121
138
  ## Screen sharing
@@ -125,9 +142,9 @@ IP bookmarks. The route resolver picks the current LAN address or Tailscale name
125
142
  automatically, so it keeps working even when DHCP rotates a machine's IP.
126
143
 
127
144
  ```bash
128
- machines screen machine005 # open Screen Sharing.app → vnc://<user>@<live-route>
129
- machines screen machine005 --print # print the vnc:// URL instead of opening
130
- machines screen machine005 --json # full resolution detail (route, confidence, user)
145
+ machines screen demo-mac-01 # open Screen Sharing.app → vnc://<user>@<live-route>
146
+ machines screen demo-mac-01 --print # print the vnc:// URL instead of opening
147
+ machines screen demo-mac-01 --json # full resolution detail (route, confidence, user)
131
148
  machines screen --all # open every reachable machine
132
149
  machines screen --all --print # list resolved vnc:// URLs for the whole fleet
133
150
  machines screen-credentials --all --check-secret
@@ -138,10 +155,10 @@ Enable Remote Management / Screen Sharing on a fresh macOS machine over SSH
138
155
  Screen Sharing.app and Apple Remote Desktop):
139
156
 
140
157
  ```bash
141
- secrets set machines/screen-sharing/screen-machine005-vnc-password "$VNC_PASSWORD" --type password
142
- machines screen-enable --machine machine005 --user jo \
143
- --vnc-password-secret machines/screen-sharing/screen-machine005-vnc-password
144
- machines screen-enable --machine machine005 --user jo --print # show the SSH command, don't run it
158
+ secrets set machines/screen-sharing/screen-demo-mac-01-vnc-password "$VNC_PASSWORD" --type password
159
+ machines screen-enable --machine demo-mac-01 --user operator \
160
+ --vnc-password-secret machines/screen-sharing/screen-demo-mac-01-vnc-password
161
+ machines screen-enable --machine demo-mac-01 --user operator --print # show the SSH command, don't run it
145
162
  ```
146
163
 
147
164
  The legacy VNC protocol honors only the first 8 password characters. The
@@ -161,7 +178,7 @@ without importing the full machines app:
161
178
  import { resolveMachineWorkspace } from "@hasna/machines/consumer";
162
179
 
163
180
  const workspace = resolveMachineWorkspace({
164
- machineId: "spark01",
181
+ machineId: "linux-dev-01",
165
182
  projectId: "open-knowledge",
166
183
  repoName: "open-knowledge",
167
184
  });
@@ -176,8 +193,8 @@ diagnostics. It uses explicit manifest metadata first and deterministic
176
193
  workspace inference second; consumers can still pass manual overrides.
177
194
 
178
195
  ```bash
179
- machines workspace resolve --machine spark01 --project open-knowledge --repo open-knowledge --json
180
- machines workspace doctor --machine spark01 --project open-knowledge --repo open-knowledge --json
196
+ machines workspace resolve --machine linux-dev-01 --project open-knowledge --repo open-knowledge --json
197
+ machines workspace doctor --machine linux-dev-01 --project open-knowledge --repo open-knowledge --json
181
198
  ```
182
199
 
183
200
  `workspace resolve` and `workspace doctor` include JSON-friendly
@@ -192,8 +209,8 @@ repair the manifest metadata explicitly. The command previews changes by
192
209
  default and only writes when `--apply` is passed:
193
210
 
194
211
  ```bash
195
- machines workspace repair --machine spark01 --project open-knowledge --repo open-knowledge --json
196
- machines workspace repair --machine spark01 --project open-knowledge --repo open-knowledge --apply --json
212
+ machines workspace repair --machine linux-dev-01 --project open-knowledge --repo open-knowledge --json
213
+ machines workspace repair --machine linux-dev-01 --project open-knowledge --repo open-knowledge --apply --json
197
214
  ```
198
215
 
199
216
  ## Compatibility SDK
@@ -205,7 +222,7 @@ attempting app-level sync:
205
222
  import { checkMachineCompatibility } from "@hasna/machines/consumer";
206
223
 
207
224
  const report = checkMachineCompatibility({
208
- machineId: "spark01",
225
+ machineId: "linux-dev-01",
209
226
  commands: [{ command: "bun" }],
210
227
  packages: [{ name: "@example/knowledge", command: "knowledge", expectedVersion: "0.2.29" }],
211
228
  workspaces: [{
@@ -225,7 +242,7 @@ back to its own local checks if `@hasna/machines` is not installed.
225
242
  CLI and MCP expose the same shape:
226
243
 
227
244
  ```bash
228
- machines compatibility --machine spark01 \
245
+ machines compatibility --machine linux-dev-01 \
229
246
  --command bun \
230
247
  --package @example/knowledge:knowledge:0.2.29 \
231
248
  --workspace open-knowledge=/srv/workspaces/open-knowledge:@example/knowledge:0.2.29 \
@@ -265,18 +282,18 @@ deployments to route app-owned backups through explicit storage metadata.
265
282
  ## Applications and tooling
266
283
 
267
284
  ```bash
268
- machines apps list --machine apple03
269
- machines apps status --machine apple03
270
- machines apps diff --machine apple03
271
- machines apps plan --machine apple03 --json
272
- machines apps apply --machine apple03 --yes
273
-
274
- machines install-claude status --machine spark01
275
- machines install-claude diff --machine spark01
276
- machines install-claude plan --machine spark01 --tool claude codex --json
277
- machines install-claude apply --machine spark01 --tool claude codex --yes
278
-
279
- machines install-tailscale --machine apple03 --json
285
+ machines apps list --machine mac-lab-01
286
+ machines apps status --machine mac-lab-01
287
+ machines apps diff --machine mac-lab-01
288
+ machines apps plan --machine mac-lab-01 --json
289
+ machines apps apply --machine mac-lab-01 --yes
290
+
291
+ machines install-claude status --machine linux-dev-01
292
+ machines install-claude diff --machine linux-dev-01
293
+ machines install-claude plan --machine linux-dev-01 --tool claude codex --json
294
+ machines install-claude apply --machine linux-dev-01 --tool claude codex --yes
295
+
296
+ machines install-tailscale --machine mac-lab-01 --json
280
297
  ```
281
298
 
282
299
  ## Notifications