@hallohuman/hightea 0.0.0-stage → 0.1.0
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 +55 -0
- package/dist/chunk-e1ze9fw5.js +5894 -0
- package/dist/plugin/plugin.json +5 -0
- package/dist/plugin/plugin.mjs +10255 -0
- package/package.json +18 -4
- package/README.md +0 -3
package/dist/bin.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/bin.ts
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
// package.json
|
|
6
|
+
var package_default = {
|
|
7
|
+
name: "@hallohuman/hightea",
|
|
8
|
+
version: "0.1.0",
|
|
9
|
+
description: "The Hightea command line: join this machine to a Hightea workspace as a host.",
|
|
10
|
+
publishConfig: { access: "public" },
|
|
11
|
+
type: "module",
|
|
12
|
+
bin: { hightea: "./dist/bin.js" },
|
|
13
|
+
files: ["dist"],
|
|
14
|
+
engines: { node: ">=26.13.1" },
|
|
15
|
+
scripts: { build: "bun build.ts", prepack: "bun run build" },
|
|
16
|
+
dependencies: {
|
|
17
|
+
"@ahpd/sdk": "https://github.com/beorn/ahpd/releases/download/hh-37326-9dff8dc1/ahpd-sdk-0.15.0-rc.4-beorn.9dff8dc1.tgz",
|
|
18
|
+
"@ahpd/server": "https://github.com/beorn/ahpd/releases/download/hh-37326-9dff8dc1/ahpd-server-0.15.0-rc.4-beorn.9dff8dc1.tgz",
|
|
19
|
+
"@silvery/commander": "0.29.3",
|
|
20
|
+
ws: "8.21.0"
|
|
21
|
+
},
|
|
22
|
+
devDependencies: {
|
|
23
|
+
"@hallohuman/hightea-ahp-host": "workspace:*"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// src/cli.ts
|
|
28
|
+
import { Command, CommanderError } from "@silvery/commander";
|
|
29
|
+
async function runCli(argv, options) {
|
|
30
|
+
let code = 0;
|
|
31
|
+
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();
|
|
32
|
+
const host = program.command("host").description("This machine as a host: where your agents run.").exitOverride();
|
|
33
|
+
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").exitOverride().action(async (flags) => {
|
|
34
|
+
const { hostJoin } = await import("./chunk-e1ze9fw5.js");
|
|
35
|
+
code = await hostJoin({ origin: flags.origin ?? "", workspace: flags.workspace ?? "", code: flags.code ?? "", ownerConfig: flags.ownerConfig ?? "" }, { directory: options.pluginDirectory, version: options.version });
|
|
36
|
+
});
|
|
37
|
+
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) => {
|
|
38
|
+
const { hostStatus } = await import("./chunk-e1ze9fw5.js");
|
|
39
|
+
code = await hostStatus({ version: options.version, json: flags.json === true });
|
|
40
|
+
});
|
|
41
|
+
try {
|
|
42
|
+
await program.parseAsync([...argv], { from: "user" });
|
|
43
|
+
} catch (error) {
|
|
44
|
+
if (!(error instanceof CommanderError))
|
|
45
|
+
throw error;
|
|
46
|
+
return error.code === "commander.helpDisplayed" || error.code === "commander.version" || error.code === "commander.help" ? 0 : 1;
|
|
47
|
+
}
|
|
48
|
+
return code;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/bin.ts
|
|
52
|
+
process.exitCode = await runCli(process.argv.slice(2), {
|
|
53
|
+
version: package_default.version,
|
|
54
|
+
pluginDirectory: fileURLToPath(new URL("./plugin/", import.meta.url))
|
|
55
|
+
});
|