@hasna/machines 0.0.23 → 0.0.25
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 +49 -5
- package/dist/agent/index.js +1 -1
- package/dist/cli/index.js +272 -41
- package/dist/commands/apps.d.ts.map +1 -1
- package/dist/commands/manifest.d.ts.map +1 -1
- package/dist/commands/screen.d.ts +35 -0
- package/dist/commands/screen.d.ts.map +1 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/consumer-schema.d.ts +21 -0
- package/dist/consumer-schema.d.ts.map +1 -0
- package/dist/consumer.d.ts +4 -2
- package/dist/consumer.d.ts.map +1 -1
- package/dist/consumer.js +499 -13
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +339 -31
- package/dist/manifests.d.ts.map +1 -1
- package/dist/mcp/index.js +146 -37
- package/dist/topology.d.ts +117 -1
- package/dist/topology.d.ts.map +1 -1
- package/package.json +2 -1
- package/schemas/machines-consumer.schema.json +47 -0
- package/scripts/consumer-conformance.mjs +27 -2
package/README.md
CHANGED
|
@@ -57,15 +57,25 @@ should import `@hasna/machines/consumer`:
|
|
|
57
57
|
```ts
|
|
58
58
|
import {
|
|
59
59
|
MACHINES_CONSUMER_CONTRACT,
|
|
60
|
+
createMachineResolverSnapshot,
|
|
60
61
|
discoverMachineTopology,
|
|
61
62
|
getLocalMachineTopology,
|
|
62
63
|
resolveMachineRoute,
|
|
64
|
+
resolveMachineWorkspace,
|
|
65
|
+
validateMachinesConsumerEnvelope,
|
|
63
66
|
} from "@hasna/machines/consumer";
|
|
64
67
|
|
|
65
68
|
console.log(MACHINES_CONSUMER_CONTRACT.schema_version);
|
|
66
69
|
const topology = discoverMachineTopology();
|
|
67
70
|
const local = getLocalMachineTopology();
|
|
68
71
|
const route = resolveMachineRoute("spark01");
|
|
72
|
+
const workspace = resolveMachineWorkspace({
|
|
73
|
+
machineId: "spark01",
|
|
74
|
+
projectId: "open-knowledge",
|
|
75
|
+
repoName: "open-knowledge",
|
|
76
|
+
});
|
|
77
|
+
const snapshot = createMachineResolverSnapshot({ route, workspace });
|
|
78
|
+
console.log(validateMachinesConsumerEnvelope("resolver_snapshot", snapshot).ok);
|
|
69
79
|
```
|
|
70
80
|
|
|
71
81
|
The SDK merges manifest entries, local heartbeats, SSH route hints, and
|
|
@@ -74,11 +84,19 @@ The SDK merges manifest entries, local heartbeats, SSH route hints, and
|
|
|
74
84
|
when present, and fall back to local probes or app-local machine registries when
|
|
75
85
|
it is absent.
|
|
76
86
|
|
|
77
|
-
Topology, route, workspace, and
|
|
78
|
-
package version metadata,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
87
|
+
Topology, route, workspace, compatibility, and resolver-snapshot JSON include
|
|
88
|
+
`schema_version`, package version metadata, capability flags, and cacheability
|
|
89
|
+
metadata where downstream apps may persist resolver evidence. The current
|
|
90
|
+
consumer contract version is `1`; the exported `MACHINES_CONSUMER_CONTRACT`
|
|
91
|
+
records the stable entrypoint, envelope names, schema artifact, field
|
|
92
|
+
capabilities, default resolver TTL, and stable exports used by downstream apps
|
|
93
|
+
such as `@hasna/knowledge`.
|
|
94
|
+
|
|
95
|
+
The package includes `schemas/machines-consumer.schema.json` and also exports
|
|
96
|
+
`MACHINES_CONSUMER_SCHEMA_BUNDLE`, `getMachinesConsumerSchemaBundle()`, and
|
|
97
|
+
`validateMachinesConsumerEnvelope()`. Downstream apps can use these helpers to
|
|
98
|
+
validate route, workspace, compatibility, and resolver-snapshot envelopes
|
|
99
|
+
without importing CLI, MCP, agent, installer, or storage-heavy internals.
|
|
82
100
|
|
|
83
101
|
The package also ships a downstream conformance fixture for consumers that want
|
|
84
102
|
to verify their optional adapter boundary without copying app-specific smoke
|
|
@@ -100,6 +118,32 @@ machines topology --no-tailscale --json
|
|
|
100
118
|
machines route --machine spark01 --json
|
|
101
119
|
```
|
|
102
120
|
|
|
121
|
+
## Screen sharing
|
|
122
|
+
|
|
123
|
+
Open Screen Sharing (VNC) to any machine using its best live route — no stale
|
|
124
|
+
IP bookmarks. The route resolver picks the current LAN address or Tailscale name
|
|
125
|
+
automatically, so it keeps working even when DHCP rotates a machine's IP.
|
|
126
|
+
|
|
127
|
+
```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)
|
|
131
|
+
machines screen --all # open every reachable machine
|
|
132
|
+
machines screen --all --print # list resolved vnc:// URLs for the whole fleet
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Enable Remote Management / Screen Sharing on a fresh macOS machine over SSH
|
|
136
|
+
(kickstart + SRP + legacy VNC password so user-password auth works from
|
|
137
|
+
Screen Sharing.app and Apple Remote Desktop):
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
machines screen-enable --machine machine005 --user jo --vnc-password steaua17
|
|
141
|
+
machines screen-enable --machine machine005 --user jo --print # show the SSH command, don't run it
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
`--vnc-password` is truncated to 8 characters by the legacy VNC protocol. The
|
|
145
|
+
user comes from the manifest (`metadata.user`) when present, or `--user`.
|
|
146
|
+
|
|
103
147
|
Consumers that need repo paths can resolve trust-aware workspace mappings
|
|
104
148
|
without importing the full machines app:
|
|
105
149
|
|