@hallohuman/hightea 0.1.9 → 0.1.13
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/dist/bin.js +20 -13
- package/dist/{chunk-99e0mv8w.js → chunk-1kzh6qrv.js} +2 -2
- package/dist/{chunk-py45wjd1.js → chunk-f5kk24rj.js} +1 -1
- package/dist/{chunk-k2ws7xvy.js → chunk-hqjkbadp.js} +1891 -26
- package/dist/{chunk-v59kcfmj.js → chunk-n6qgzk8y.js} +1 -1
- package/dist/{chunk-3qbh10ga.js → chunk-pk0ntfzc.js} +4 -2
- package/dist/{chunk-c8kc1c68.js → chunk-rs0vvh3x.js} +1 -1
- package/dist/plugin/plugin.json +1 -1
- package/dist/plugin/plugin.mjs +6563 -6459
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
// package.json
|
|
6
6
|
var package_default = {
|
|
7
7
|
name: "@hallohuman/hightea",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.13",
|
|
9
9
|
description: "The Hightea command line: join this machine to a Hightea workspace as a host.",
|
|
10
10
|
publishConfig: {
|
|
11
11
|
access: "public"
|
|
@@ -45,7 +45,7 @@ async function runCli(argv, options) {
|
|
|
45
45
|
const program = new Command("hightea").description("Hightea: join this machine to a Hightea workspace as a host for your own agents.").version(options.version, "-v, --version").exitOverride();
|
|
46
46
|
program.command("apply <file>").description("Apply a native process-compose file, or a TypeScript program that returns a plan, to one machine's ahpd: preview first, write only with --yes.").option("--machine <url>", "The machine's ahpd WebSocket endpoint, e.g. ws://127.0.0.1:7777").option("--token <token>", "The machine's token for this client (default: AHP_TKN)").option("--yes", "Send the previewed changes; without it nothing is sent").option("--prune", "After the preview lists them, remove entries this same source created that the plan no longer carries").option("--json", "Print one JSON document").addHelpText("after", `
|
|
47
47
|
Exit status: 0 previewed or applied; 1 the machine refused the plan or could not be reached.`).exitOverride().action(async (file, flags) => {
|
|
48
|
-
const { applyFile } = await import("./chunk-
|
|
48
|
+
const { applyFile } = await import("./chunk-1kzh6qrv.js");
|
|
49
49
|
code = await applyFile(file, {
|
|
50
50
|
machine: flags.machine ?? "",
|
|
51
51
|
token: flags.token ?? process.env.AHP_TKN,
|
|
@@ -58,12 +58,12 @@ Exit status: 0 previewed or applied; 1 the machine refused the plan or could not
|
|
|
58
58
|
host.command("join").description("Join this machine to a workspace with a one-use host join code from the workspace owner.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--code <code>", "The one-use join code").option("--owner-config <file>", "Your owner configuration: agents, provider plugins and their credentials").addHelpText("after", `
|
|
59
59
|
Exit status: 0 registered; 2 pending, rerun the same command; 3 not authorised for that workspace or agent;
|
|
60
60
|
4 an agent is already bound to another host; 1 any other failure.`).exitOverride().action(async (flags) => {
|
|
61
|
-
const { hostJoin } = await import("./chunk-
|
|
61
|
+
const { hostJoin } = await import("./chunk-pk0ntfzc.js");
|
|
62
62
|
code = await hostJoin({ origin: flags.origin ?? "", workspace: flags.workspace ?? "", code: flags.code ?? "", ownerConfig: flags.ownerConfig ?? "" }, { directory: options.pluginDirectory, version: options.version });
|
|
63
63
|
});
|
|
64
64
|
host.command("list").description("List the workspace's registered hosts and which agents each runs; a workspace owner sees every host.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--json", "Print one JSON document").addHelpText("after", `
|
|
65
65
|
Exit status: 0 listed; 3 your account is not a person of this workspace; 1 any other failure.`).exitOverride().action(async (flags) => {
|
|
66
|
-
const { hostList } = await import("./chunk-
|
|
66
|
+
const { hostList } = await import("./chunk-rs0vvh3x.js");
|
|
67
67
|
code = await hostList({
|
|
68
68
|
origin: flags.origin ?? "",
|
|
69
69
|
workspace: flags.workspace ?? "",
|
|
@@ -73,7 +73,7 @@ Exit status: 0 listed; 3 your account is not a person of this workspace; 1 any o
|
|
|
73
73
|
});
|
|
74
74
|
host.command("remove").description("Remove a registered host from a workspace, as the workspace owner; its agents need a new join code.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--host <id>", "The registered host's id, e.g. host_01").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--json", "Print one JSON document").addHelpText("after", `
|
|
75
75
|
Exit status: 0 removed or already removed; 3 your account is not this workspace's owner; 1 any other failure, including an unknown host id.`).exitOverride().action(async (flags) => {
|
|
76
|
-
const { hostRemove } = await import("./chunk-
|
|
76
|
+
const { hostRemove } = await import("./chunk-rs0vvh3x.js");
|
|
77
77
|
code = await hostRemove({
|
|
78
78
|
origin: flags.origin ?? "",
|
|
79
79
|
workspace: flags.workspace ?? "",
|
|
@@ -83,25 +83,32 @@ Exit status: 0 removed or already removed; 3 your account is not this workspace'
|
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
85
|
host.command("status").description("Show every joined host on this machine and whether its plugin bundle is intact. Changes nothing.").option("--json", "Print one JSON document").exitOverride().action(async (flags) => {
|
|
86
|
-
const { hostStatus } = await import("./chunk-
|
|
86
|
+
const { hostStatus } = await import("./chunk-pk0ntfzc.js");
|
|
87
87
|
code = await hostStatus({ version: options.version, json: flags.json === true });
|
|
88
88
|
});
|
|
89
|
+
host.command("update").description("Move a joined host on this machine to this CLI's plugin bundle; same host id and credentials. Restart the host after.").option("--host <id>", "The joined host's id, when this machine holds more than one").addHelpText("after", `
|
|
90
|
+
The old bundle is kept until the host has connected once on the new one; a later update removes it.
|
|
91
|
+
` + `A bundle newer than this CLI's is refused (HOST_UPDATE_DOWNGRADE).
|
|
92
|
+
Exit status: 0 updated or already current; 1 any refusal, named on stderr.`).exitOverride().action(async (flags) => {
|
|
93
|
+
const { hostUpdate } = await import("./chunk-pk0ntfzc.js");
|
|
94
|
+
code = await hostUpdate({ host: flags.host }, { directory: options.pluginDirectory, version: options.version });
|
|
95
|
+
});
|
|
89
96
|
const trust = host.command("trust").description("The browser and host keys this machine trusts to ask its agents through a room.").addHelpText("after", `
|
|
90
97
|
What it protects against: an ask forged by a compromised Hightea server or database.
|
|
91
98
|
` + `What it does not: a compromised page script, since the script that signs comes from Hightea, or a process
|
|
92
99
|
` + "running as this machine's user, which can edit trusted-keys.json as it can config.json.").exitOverride();
|
|
93
100
|
trust.command("add").description("Trust a browser's (or another host's) public key, under a name of your choosing.").argument("<name>", "A name for the key, e.g. the browser it came from").argument("<public-key>", "The raw Ed25519 public key, base64url, as the browser's Members page shows it").option("--host <id>", "Which of this machine's joined hosts, when it holds more than one").addHelpText("after", `
|
|
94
101
|
Exit status: 0 trusted or already trusted; 1 any failure, with the file left unchanged.`).exitOverride().action(async (name, publicKey, flags) => {
|
|
95
|
-
const { hostTrust } = await import("./chunk-
|
|
102
|
+
const { hostTrust } = await import("./chunk-f5kk24rj.js");
|
|
96
103
|
code = await hostTrust({ action: "add", name, publicKey, ...flags.host === undefined ? {} : { host: flags.host } });
|
|
97
104
|
});
|
|
98
105
|
trust.command("remove").description("Stop trusting the key with this name; asks signed with it are refused from then on.").argument("<name>", "The key's name, as `hightea host trust list` shows it").option("--host <id>", "Which of this machine's joined hosts, when it holds more than one").addHelpText("after", `
|
|
99
106
|
Exit status: 0 removed; 1 any failure, including an unknown name, with the file left unchanged.`).exitOverride().action(async (name, flags) => {
|
|
100
|
-
const { hostTrust } = await import("./chunk-
|
|
107
|
+
const { hostTrust } = await import("./chunk-f5kk24rj.js");
|
|
101
108
|
code = await hostTrust({ action: "remove", name, ...flags.host === undefined ? {} : { host: flags.host } });
|
|
102
109
|
});
|
|
103
110
|
trust.command("list").description("List the keys this machine trusts. Changes nothing.").option("--host <id>", "Which of this machine's joined hosts, when it holds more than one").option("--json", "Print one JSON document").exitOverride().action(async (flags) => {
|
|
104
|
-
const { hostTrust } = await import("./chunk-
|
|
111
|
+
const { hostTrust } = await import("./chunk-f5kk24rj.js");
|
|
105
112
|
code = await hostTrust({ action: "list", json: flags.json === true, ...flags.host === undefined ? {} : { host: flags.host } });
|
|
106
113
|
});
|
|
107
114
|
const auth = program.command("auth").description("Sign this machine in to a Hightea deployment for the owner commands.").exitOverride();
|
|
@@ -182,7 +189,7 @@ Exit status: 0 set; 3 your account is not this workspace's owner; 1 any other fa
|
|
|
182
189
|
Exit status: 0 done; 3 your account may not manage this host's services; 1 any other failure, named on stderr.`).exitOverride().action(async (...args) => {
|
|
183
190
|
const name = options.named ? String(args[0]) : undefined;
|
|
184
191
|
const flags = options.named ? args[1] : args[0];
|
|
185
|
-
const { serviceCommand } = await import("./chunk-
|
|
192
|
+
const { serviceCommand } = await import("./chunk-n6qgzk8y.js");
|
|
186
193
|
const text = (key) => typeof flags[key] === "string" ? flags[key] : undefined;
|
|
187
194
|
code = await serviceCommand({
|
|
188
195
|
origin: text("origin") ?? "",
|
|
@@ -205,7 +212,7 @@ Exit status: 0 done; 3 your account may not manage this host's services; 1 any o
|
|
|
205
212
|
serviceAction("acknowledge", "Accept the process-compose files as they are now, so drift stops alerting on a hand edit.");
|
|
206
213
|
service.command("backup").description("Show Hightea's backup of a host's services and their change log, labelled with how far it reaches; works while the host is offline or revoked.").requiredOption("--host <id>", "The registered host's id").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--json", "Print the backup as one JSON document").addHelpText("after", `
|
|
207
214
|
Exit status: 0 shown; 3 your account may not read this host's backup; 1 any other failure, named on stderr.`).exitOverride().action(async (flags) => {
|
|
208
|
-
const { serviceBackupCommand } = await import("./chunk-
|
|
215
|
+
const { serviceBackupCommand } = await import("./chunk-n6qgzk8y.js");
|
|
209
216
|
const text = (key) => typeof flags[key] === "string" ? flags[key] : undefined;
|
|
210
217
|
code = await serviceBackupCommand({
|
|
211
218
|
origin: text("origin") ?? "",
|
|
@@ -218,7 +225,7 @@ Exit status: 0 shown; 3 your account may not read this host's backup; 1 any othe
|
|
|
218
225
|
});
|
|
219
226
|
service.command("restore").description("Create a host's backed-up services on a new host, create-only: shows what it will create and asks first.").argument("[names...]", "Which services; every one in the backup when none is named").requiredOption("--from <id>", "The old host whose backup is read").option("--host <id>", "The new registered host's id; with --local, which of this machine's joined hosts").option("--local", "Create them on this machine, in-process, as you").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--yes", "Do not ask; for scripts").option("--json", "Print each service's outcome as one JSON document").addHelpText("after", `
|
|
220
227
|
Exit status: 0 every service created; 3 your account may not read the old host's backup; 1 anything else, each named.`).exitOverride().action(async (names, flags) => {
|
|
221
|
-
const { serviceRestore } = await import("./chunk-
|
|
228
|
+
const { serviceRestore } = await import("./chunk-n6qgzk8y.js");
|
|
222
229
|
const text = (key) => typeof flags[key] === "string" ? flags[key] : undefined;
|
|
223
230
|
code = await serviceRestore({
|
|
224
231
|
origin: text("origin") ?? "",
|
|
@@ -232,7 +239,7 @@ Exit status: 0 every service created; 3 your account may not read the old host's
|
|
|
232
239
|
for (const [verb, enable] of [["enable", true], ["disable", false]]) {
|
|
233
240
|
service.command(verb).description(enable ? "On this machine: let Hightea list, read logs of, change, start and stop this machine's services (adds the services grants)." : "On this machine: stop Hightea managing this machine's services (removes the services grants).").option("--host <id>", "Which of this machine's joined hosts, when it holds more than one").addHelpText("after", `
|
|
234
241
|
Exit status: 0 changed or already so; 1 any failure, named on stderr.`).exitOverride().action(async (flags) => {
|
|
235
|
-
const { hostServicesGrants } = await import("./chunk-
|
|
242
|
+
const { hostServicesGrants } = await import("./chunk-pk0ntfzc.js");
|
|
236
243
|
code = await hostServicesGrants({ enable, ...typeof flags.host === "string" ? { host: flags.host } : {} });
|
|
237
244
|
});
|
|
238
245
|
}
|
|
@@ -6984,12 +6984,12 @@ async function applyPreview(shown, host) {
|
|
|
6984
6984
|
let ifVersion = shown.ifVersion;
|
|
6985
6985
|
const written = [];
|
|
6986
6986
|
for (const service of shown.create) {
|
|
6987
|
-
const answer = await host.call("x-ahpd/services/put", { service, ifVersion
|
|
6987
|
+
const answer = await host.call("x-ahpd/services/put", { service, ifVersion: "absent" });
|
|
6988
6988
|
ifVersion = answer.ifVersion ?? ifVersion;
|
|
6989
6989
|
written.push(service.name);
|
|
6990
6990
|
}
|
|
6991
6991
|
for (const entry of shown.change) {
|
|
6992
|
-
const answer = await host.call("x-ahpd/services/put", { service: entry.after, ifVersion
|
|
6992
|
+
const answer = await host.call("x-ahpd/services/put", { service: entry.after, ifVersion });
|
|
6993
6993
|
ifVersion = answer.ifVersion ?? ifVersion;
|
|
6994
6994
|
written.push(entry.name);
|
|
6995
6995
|
}
|