talentos 1.4.14 → 1.4.16
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/agent/adapters.js +50 -68
- package/dist/agent/codex-policy.js +15 -0
- package/dist/agent/gemini-policy.js +3 -3
- package/dist/agent/gemini-probe.js +33 -122
- package/dist/agent/gemini-room.js +92 -0
- package/dist/agent/hermes-login.js +166 -0
- package/dist/agent/hermes-policy.js +179 -0
- package/dist/agent/hermes-probe.js +255 -0
- package/dist/agent/hermes-room.js +99 -0
- package/dist/agent/native/codex-fence.js +10 -0
- package/dist/agent/native/codex-launch.js +2 -0
- package/dist/agent/native/config.js +27 -13
- package/dist/agent/native/gate.js +7 -4
- package/dist/agent/native/hook-entry.js +1 -0
- package/dist/agent/native/launch.js +4 -0
- package/dist/agent/native/paths.js +29 -2
- package/dist/agent/native/policy.js +2 -1
- package/dist/agent/native/projects.js +38 -1
- package/dist/agent/packet-order.js +26 -0
- package/dist/agent/provider-login.js +4 -3
- package/dist/agent/room-probe.js +129 -0
- package/dist/agent/room-profile.js +21 -45
- package/dist/agent/room-provider.js +7 -0
- package/dist/agent/room-providers.js +11 -0
- package/dist/agent-config.js +2 -1
- package/dist/agent-http.js +8 -6
- package/dist/agent-link.js +3 -2
- package/dist/commands/agent-serve.js +6 -6
- package/dist/provider-binary.js +8 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProviderFailureError } from "./provider-failure.js";
|
|
2
|
+
/** A provider could not be kept apart from the owner's setup, so no job runs. */
|
|
3
|
+
export class RoomIsolationError extends ProviderFailureError {
|
|
4
|
+
constructor(label = "Codex") {
|
|
5
|
+
super("unknown", `${label} could not be isolated from your setup on this computer.`);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { geminiRoomProfile } from "./gemini-room.js";
|
|
2
|
+
import { hermesRoomProfile } from "./hermes-room.js";
|
|
3
|
+
// Every provider that runs as a room-only profile. Claude Code and Codex are
|
|
4
|
+
// not here: they also run the owner's setup and keep their own launch code.
|
|
5
|
+
const ROOM_PROVIDERS = {
|
|
6
|
+
gemini_cli: geminiRoomProfile,
|
|
7
|
+
hermes_agent: hermesRoomProfile,
|
|
8
|
+
};
|
|
9
|
+
export function roomProvider(provider) {
|
|
10
|
+
return ROOM_PROVIDERS[provider];
|
|
11
|
+
}
|
package/dist/agent-config.js
CHANGED
|
@@ -103,7 +103,8 @@ function isLinkedAgent(value) {
|
|
|
103
103
|
isAbsolute(config.providerPath))) &&
|
|
104
104
|
(config.provider === "claude_code" ||
|
|
105
105
|
config.provider === "codex" ||
|
|
106
|
-
config.provider === "gemini_cli"
|
|
106
|
+
config.provider === "gemini_cli" ||
|
|
107
|
+
config.provider === "hermes_agent"));
|
|
107
108
|
}
|
|
108
109
|
export function isMissing(error) {
|
|
109
110
|
return (error !== null &&
|
package/dist/agent-http.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import { childEnvironment } from "./agent/adapters.js";
|
|
3
|
-
import {
|
|
3
|
+
import { roomProvider } from "./agent/room-providers.js";
|
|
4
4
|
import { isSecureUrl, } from "./agent-link.js";
|
|
5
5
|
import { resolveProviderBinary } from "./provider-binary.js";
|
|
6
6
|
const REQUEST_TIMEOUT_MS = 10_000;
|
|
@@ -55,8 +55,8 @@ export async function setupApiOrigin(link, override) {
|
|
|
55
55
|
}
|
|
56
56
|
return apiOrigin(apiUrl);
|
|
57
57
|
}
|
|
58
|
-
//
|
|
59
|
-
// leaves
|
|
58
|
+
// A room-only provider with no sign-in status command is checked by what a
|
|
59
|
+
// sign-in leaves (its profile's signInProblem; Gemini: agent/gemini-login.ts).
|
|
60
60
|
export function inspectProvider(provider, configured) {
|
|
61
61
|
const binary = resolveProviderBinary(provider, configured);
|
|
62
62
|
const version = spawnSync(binary, ["--version"], {
|
|
@@ -67,9 +67,11 @@ export function inspectProvider(provider, configured) {
|
|
|
67
67
|
if (version.status !== 0 || !version.stdout?.trim()) {
|
|
68
68
|
throw new Error(`Install the official ${binary} CLI and sign in before linking.`);
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
const room = roomProvider(provider);
|
|
71
|
+
if (room) {
|
|
72
|
+
const problem = room.signInProblem(process.env);
|
|
73
|
+
if (problem) {
|
|
74
|
+
throw new Error(problem);
|
|
73
75
|
}
|
|
74
76
|
return version.stdout.trim().split("\n")[0]?.slice(0, 200) ?? "unknown";
|
|
75
77
|
}
|
package/dist/agent-link.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const INVALID_LINK = "Get a new setup prompt from TalentOS and pass its complete URL with --url.";
|
|
2
|
-
const SETUP_PATH = /^\/agent-setup\/(claude_code|codex|gemini_cli)\/?$/;
|
|
2
|
+
const SETUP_PATH = /^\/agent-setup\/(claude_code|codex|gemini_cli|hermes_agent)\/?$/;
|
|
3
3
|
const FRAGMENT_TOKEN = /((?:#|%23)token(?:=|%3d))[^\s"'<>]+/giu;
|
|
4
4
|
const RAW_KEY = /\btos_[a-z\d_-]+/giu;
|
|
5
5
|
const BEARER = /\bBearer\s+\S+/giu;
|
|
@@ -14,7 +14,8 @@ export function parseAgentLink(value) {
|
|
|
14
14
|
if (!(isSecureUrl(url) &&
|
|
15
15
|
(provider === "claude_code" ||
|
|
16
16
|
provider === "codex" ||
|
|
17
|
-
provider === "gemini_cli"
|
|
17
|
+
provider === "gemini_cli" ||
|
|
18
|
+
provider === "hermes_agent") &&
|
|
18
19
|
!url.search &&
|
|
19
20
|
fragment.size === 1 &&
|
|
20
21
|
tokens.length === 1 &&
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import { dirname } from "node:path";
|
|
3
|
-
import { verifyClaudeCode, verifyCodex, verifyCodexImages, verifyCodexWeb,
|
|
3
|
+
import { verifyClaudeCode, verifyCodex, verifyCodexImages, verifyCodexWeb, verifyRoomProvider, } from "../agent/adapters.js";
|
|
4
4
|
import { CodexBoundaryError } from "../agent/codex-probe.js";
|
|
5
5
|
import { AgentGateway, GatewayError } from "../agent/gateway.js";
|
|
6
|
-
import {
|
|
6
|
+
import { roomProvider } from "../agent/room-providers.js";
|
|
7
7
|
import { serveAgent } from "../agent/serve.js";
|
|
8
8
|
import { agentWorkDir, localAgents, storeAgent, } from "../agent-config.js";
|
|
9
9
|
import { AgentHttpError, fetchAgentStatus } from "../agent-http.js";
|
|
@@ -55,6 +55,7 @@ export async function runAgentServe(parsed, options = {}) {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
async function verifyAgent(config, options, signal) {
|
|
58
|
+
const room = roomProvider(config.provider);
|
|
58
59
|
try {
|
|
59
60
|
let binary;
|
|
60
61
|
try {
|
|
@@ -71,8 +72,8 @@ async function verifyAgent(config, options, signal) {
|
|
|
71
72
|
if (config.provider === "claude_code") {
|
|
72
73
|
await verifyClaudeCode(binary);
|
|
73
74
|
}
|
|
74
|
-
else if (
|
|
75
|
-
await
|
|
75
|
+
else if (room) {
|
|
76
|
+
await verifyRoomProvider(room, binary, signal);
|
|
76
77
|
}
|
|
77
78
|
else {
|
|
78
79
|
await verifyCodex(binary, signal);
|
|
@@ -82,8 +83,7 @@ async function verifyAgent(config, options, signal) {
|
|
|
82
83
|
}
|
|
83
84
|
catch (error) {
|
|
84
85
|
if (error instanceof ProviderBinaryError) {
|
|
85
|
-
if (!(error instanceof CodexBoundaryError ||
|
|
86
|
-
error instanceof GeminiBoundaryError)) {
|
|
86
|
+
if (!(error instanceof CodexBoundaryError || room?.isBoundaryError(error))) {
|
|
87
87
|
try {
|
|
88
88
|
await new AgentGateway(config).request("/agent-gateway/provider-unavailable");
|
|
89
89
|
}
|
package/dist/provider-binary.js
CHANGED
|
@@ -5,11 +5,18 @@ const BINARY = {
|
|
|
5
5
|
claude_code: "claude",
|
|
6
6
|
codex: "codex",
|
|
7
7
|
gemini_cli: "gemini",
|
|
8
|
+
hermes_agent: "hermes",
|
|
8
9
|
};
|
|
9
10
|
const LABEL = {
|
|
10
11
|
claude_code: "Claude Code",
|
|
11
12
|
codex: "Codex",
|
|
12
13
|
gemini_cli: "Gemini CLI",
|
|
14
|
+
hermes_agent: "Hermes Agent",
|
|
15
|
+
};
|
|
16
|
+
// TalentOS never installs a provider. Hermes Agent is not an npm package (the
|
|
17
|
+
// one under that name is an unofficial bridge), so its message says where it comes from.
|
|
18
|
+
const INSTALL_HINT = {
|
|
19
|
+
hermes_agent: "install it from hermes-agent.nousresearch.com, then ",
|
|
13
20
|
};
|
|
14
21
|
export class ProviderBinaryError extends Error {
|
|
15
22
|
exitCode = 78;
|
|
@@ -39,7 +46,7 @@ export function resolveProviderBinary(provider, configured) {
|
|
|
39
46
|
}
|
|
40
47
|
}
|
|
41
48
|
const label = LABEL[provider];
|
|
42
|
-
throw new ProviderBinaryError(`${label} not found at ${configured ?? join(homeDir(), ".local/bin", binary)}; run talentos agent repair`);
|
|
49
|
+
throw new ProviderBinaryError(`${label} not found at ${configured ?? join(homeDir(), ".local/bin", binary)}; ${INSTALL_HINT[provider] ?? ""}run talentos agent repair`);
|
|
43
50
|
}
|
|
44
51
|
export function providerPathEnv(binary, home = homeDir(), includeRuntimeNode = true) {
|
|
45
52
|
return [
|
package/package.json
CHANGED