@fideliosai/adapter-hermes-local 2026.331.0-canary.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/LICENSE +22 -0
- package/package.json +29 -0
- package/src/cli/format-event.d.ts +14 -0
- package/src/cli/format-event.d.ts.map +1 -0
- package/src/cli/format-event.js +52 -0
- package/src/cli/format-event.js.map +1 -0
- package/src/cli/index.d.ts +5 -0
- package/src/cli/index.d.ts.map +1 -0
- package/src/cli/index.js +5 -0
- package/src/cli/index.js.map +1 -0
- package/src/index.d.ts +28 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +81 -0
- package/src/index.js.map +1 -0
- package/src/server/detect-model.d.ts +21 -0
- package/src/server/detect-model.d.ts.map +1 -0
- package/src/server/detect-model.js +63 -0
- package/src/server/detect-model.js.map +1 -0
- package/src/server/execute.d.ts +20 -0
- package/src/server/execute.d.ts.map +1 -0
- package/src/server/execute.js +389 -0
- package/src/server/execute.js.map +1 -0
- package/src/server/index.d.ts +16 -0
- package/src/server/index.d.ts.map +1 -0
- package/src/server/index.js +43 -0
- package/src/server/index.js.map +1 -0
- package/src/server/skills.d.ts +8 -0
- package/src/server/skills.d.ts.map +1 -0
- package/src/server/skills.js +179 -0
- package/src/server/skills.js.map +1 -0
- package/src/server/test.d.ts +9 -0
- package/src/server/test.d.ts.map +1 -0
- package/src/server/test.js +196 -0
- package/src/server/test.js.map +1 -0
- package/src/shared/constants.d.ts +31 -0
- package/src/shared/constants.d.ts.map +1 -0
- package/src/shared/constants.js +40 -0
- package/src/shared/constants.js.map +1 -0
- package/src/ui/build-config.d.ts +12 -0
- package/src/ui/build-config.d.ts.map +1 -0
- package/src/ui/build-config.js +47 -0
- package/src/ui/build-config.js.map +1 -0
- package/src/ui/index.d.ts +7 -0
- package/src/ui/index.d.ts.map +1 -0
- package/src/ui/index.js +7 -0
- package/src/ui/index.js.map +1 -0
- package/src/ui/parse-stdout.d.ts +25 -0
- package/src/ui/parse-stdout.d.ts.map +1 -0
- package/src/ui/parse-stdout.js +237 -0
- package/src/ui/parse-stdout.js.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Paperclip AI (original)
|
|
4
|
+
Copyright (c) 2026 FideliOS (fork modifications)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fideliosai/adapter-hermes-local",
|
|
3
|
+
"version": "2026.331.0-canary.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Hermes AI agent adapter for FideliOS (forked from hermes adapter by NousResearch)",
|
|
6
|
+
"homepage": "https://github.com/fideliosai/fidelios",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/fideliosai/fidelios",
|
|
10
|
+
"directory": "packages/adapters/hermes-local"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./src/index.js",
|
|
15
|
+
"./server": "./src/server/index.js",
|
|
16
|
+
"./ui": "./src/ui/index.js",
|
|
17
|
+
"./cli": "./src/cli/index.js"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"src"
|
|
24
|
+
],
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@fideliosai/adapter-utils": "2026.331.0-canary.0",
|
|
27
|
+
"picocolors": "^1.1.0"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI output formatting for Hermes Agent adapter.
|
|
3
|
+
*
|
|
4
|
+
* Pretty-prints Hermes output lines in the terminal when running
|
|
5
|
+
* FideliOS's CLI tools.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Format a Hermes Agent stdout event for terminal display.
|
|
9
|
+
*
|
|
10
|
+
* @param raw Raw stdout line from Hermes
|
|
11
|
+
* @param debug If true, show extra metadata with color coding
|
|
12
|
+
*/
|
|
13
|
+
export declare function printHermesStreamEvent(raw: string, debug: boolean): void;
|
|
14
|
+
//# sourceMappingURL=format-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-event.d.ts","sourceRoot":"","sources":["../../src/cli/format-event.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CA6CxE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI output formatting for Hermes Agent adapter.
|
|
3
|
+
*
|
|
4
|
+
* Pretty-prints Hermes output lines in the terminal when running
|
|
5
|
+
* FideliOS's CLI tools.
|
|
6
|
+
*/
|
|
7
|
+
import pc from "picocolors";
|
|
8
|
+
/**
|
|
9
|
+
* Format a Hermes Agent stdout event for terminal display.
|
|
10
|
+
*
|
|
11
|
+
* @param raw Raw stdout line from Hermes
|
|
12
|
+
* @param debug If true, show extra metadata with color coding
|
|
13
|
+
*/
|
|
14
|
+
export function printHermesStreamEvent(raw, debug) {
|
|
15
|
+
const line = raw.trim();
|
|
16
|
+
if (!line)
|
|
17
|
+
return;
|
|
18
|
+
if (!debug) {
|
|
19
|
+
console.log(line);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
// Adapter log lines
|
|
23
|
+
if (line.startsWith("[hermes]")) {
|
|
24
|
+
console.log(pc.blue(line));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
// Tool output (┊ prefix)
|
|
28
|
+
if (line.startsWith("┊")) {
|
|
29
|
+
console.log(pc.cyan(line));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// Thinking
|
|
33
|
+
if (line.includes("💭") || line.startsWith("<thinking>")) {
|
|
34
|
+
console.log(pc.dim(line));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
// Errors
|
|
38
|
+
if (line.startsWith("Error:") ||
|
|
39
|
+
line.startsWith("ERROR:") ||
|
|
40
|
+
line.startsWith("Traceback")) {
|
|
41
|
+
console.log(pc.red(line));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
// Session info
|
|
45
|
+
if (/session/i.test(line) && /id|saved|resumed/i.test(line)) {
|
|
46
|
+
console.log(pc.green(line));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
// Default: gray in debug mode
|
|
50
|
+
console.log(pc.gray(line));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=format-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-event.js","sourceRoot":"","sources":["../../src/cli/format-event.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAW,EAAE,KAAc;IAChE,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACxB,IAAI,CAAC,IAAI;QAAE,OAAO;IAElB,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO;IACT,CAAC;IAED,oBAAoB;IACpB,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3B,OAAO;IACT,CAAC;IAED,yBAAyB;IACzB,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3B,OAAO;IACT,CAAC;IAED,WAAW;IACX,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,SAAS;IACT,IACE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAC5B,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,eAAe;IACf,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5B,OAAO;IACT,CAAC;IAED,8BAA8B;IAC9B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/src/cli/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hermes Agent adapter for FideliOS.
|
|
3
|
+
*
|
|
4
|
+
* Runs Hermes Agent (https://github.com/NousResearch/hermes-agent)
|
|
5
|
+
* as a managed employee in a FideliOS company. Hermes Agent is a
|
|
6
|
+
* full-featured AI agent with 30+ native tools, persistent memory,
|
|
7
|
+
* skills, session persistence, and MCP support.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
export declare const type = "hermes_local";
|
|
12
|
+
export declare const label = "Hermes Agent";
|
|
13
|
+
/**
|
|
14
|
+
* Models available through Hermes Agent.
|
|
15
|
+
*
|
|
16
|
+
* Hermes supports any model via any provider. The FideliOS UI should
|
|
17
|
+
* prefer detectModel() plus manual entry over curated placeholder models,
|
|
18
|
+
* since Hermes availability depends on the user's local configuration.
|
|
19
|
+
*/
|
|
20
|
+
export declare const models: {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
}[];
|
|
24
|
+
/**
|
|
25
|
+
* Documentation shown in the FideliOS UI when configuring a Hermes agent.
|
|
26
|
+
*/
|
|
27
|
+
export declare const agentConfigurationDoc = "# Hermes Agent Configuration\n\nHermes Agent is a full-featured AI agent by Nous Research with 30+ native\ntools, persistent memory, session persistence, skills, and MCP support.\n\n## Prerequisites\n\n- Python 3.10+ installed\n- Hermes Agent installed: `pip install hermes-agent`\n- At least one LLM API key configured in ~/.hermes/.env\n\n## Core Configuration\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| model | string | (Hermes configured default) | Optional explicit model in provider/model format. Leave blank to use Hermes's configured default model. |\n| provider | string | (auto) | API provider: auto, openrouter, nous, openai-codex, zai, kimi-coding, minimax, minimax-cn. Usually not needed \u2014 Hermes auto-detects from model name. |\n| timeoutSec | number | 300 | Execution timeout in seconds |\n| graceSec | number | 10 | Grace period after SIGTERM before SIGKILL |\n\n## Tool Configuration\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| toolsets | string | (all) | Comma-separated toolsets to enable (e.g. \"terminal,file,web\") |\n\n## Session & Workspace\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| persistSession | boolean | true | Resume sessions across heartbeats |\n| worktreeMode | boolean | false | Use git worktree for isolated changes |\n| checkpoints | boolean | false | Enable filesystem checkpoints |\n\n## Advanced\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| hermesCommand | string | hermes | Path to hermes CLI binary |\n| verbose | boolean | false | Enable verbose output |\n| extraArgs | string[] | [] | Additional CLI arguments |\n| env | object | {} | Extra environment variables |\n| promptTemplate | string | (default) | Custom prompt template with {{variable}} placeholders |\n\n## Available Template Variables\n\n- `{{agentId}}` \u2014 FideliOS agent ID\n- `{{agentName}}` \u2014 Agent display name\n- `{{companyId}}` \u2014 FideliOS company ID\n- `{{companyName}}` \u2014 Company display name\n- `{{runId}}` \u2014 Current heartbeat run ID\n- `{{taskId}}` \u2014 Current task/issue ID (if assigned)\n- `{{taskTitle}}` \u2014 Task title (if assigned)\n- `{{taskBody}}` \u2014 Task description (if assigned)\n- `{{projectName}}` \u2014 Project name (if scoped to a project)\n";
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,eAAO,MAAM,IAAI,iBAAe,CAAC;AACjC,eAAO,MAAM,KAAK,iBAAgB,CAAC;AAEnC;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAO,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,qBAAqB,81EAuDjC,CAAC"}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hermes Agent adapter for FideliOS.
|
|
3
|
+
*
|
|
4
|
+
* Runs Hermes Agent (https://github.com/NousResearch/hermes-agent)
|
|
5
|
+
* as a managed employee in a FideliOS company. Hermes Agent is a
|
|
6
|
+
* full-featured AI agent with 30+ native tools, persistent memory,
|
|
7
|
+
* skills, session persistence, and MCP support.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
import { ADAPTER_TYPE, ADAPTER_LABEL } from "./shared/constants.js";
|
|
12
|
+
export const type = ADAPTER_TYPE;
|
|
13
|
+
export const label = ADAPTER_LABEL;
|
|
14
|
+
/**
|
|
15
|
+
* Models available through Hermes Agent.
|
|
16
|
+
*
|
|
17
|
+
* Hermes supports any model via any provider. The FideliOS UI should
|
|
18
|
+
* prefer detectModel() plus manual entry over curated placeholder models,
|
|
19
|
+
* since Hermes availability depends on the user's local configuration.
|
|
20
|
+
*/
|
|
21
|
+
export const models = [];
|
|
22
|
+
/**
|
|
23
|
+
* Documentation shown in the FideliOS UI when configuring a Hermes agent.
|
|
24
|
+
*/
|
|
25
|
+
export const agentConfigurationDoc = `# Hermes Agent Configuration
|
|
26
|
+
|
|
27
|
+
Hermes Agent is a full-featured AI agent by Nous Research with 30+ native
|
|
28
|
+
tools, persistent memory, session persistence, skills, and MCP support.
|
|
29
|
+
|
|
30
|
+
## Prerequisites
|
|
31
|
+
|
|
32
|
+
- Python 3.10+ installed
|
|
33
|
+
- Hermes Agent installed: \`pip install hermes-agent\`
|
|
34
|
+
- At least one LLM API key configured in ~/.hermes/.env
|
|
35
|
+
|
|
36
|
+
## Core Configuration
|
|
37
|
+
|
|
38
|
+
| Field | Type | Default | Description |
|
|
39
|
+
|-------|------|---------|-------------|
|
|
40
|
+
| model | string | (Hermes configured default) | Optional explicit model in provider/model format. Leave blank to use Hermes's configured default model. |
|
|
41
|
+
| provider | string | (auto) | API provider: auto, openrouter, nous, openai-codex, zai, kimi-coding, minimax, minimax-cn. Usually not needed — Hermes auto-detects from model name. |
|
|
42
|
+
| timeoutSec | number | 300 | Execution timeout in seconds |
|
|
43
|
+
| graceSec | number | 10 | Grace period after SIGTERM before SIGKILL |
|
|
44
|
+
|
|
45
|
+
## Tool Configuration
|
|
46
|
+
|
|
47
|
+
| Field | Type | Default | Description |
|
|
48
|
+
|-------|------|---------|-------------|
|
|
49
|
+
| toolsets | string | (all) | Comma-separated toolsets to enable (e.g. "terminal,file,web") |
|
|
50
|
+
|
|
51
|
+
## Session & Workspace
|
|
52
|
+
|
|
53
|
+
| Field | Type | Default | Description |
|
|
54
|
+
|-------|------|---------|-------------|
|
|
55
|
+
| persistSession | boolean | true | Resume sessions across heartbeats |
|
|
56
|
+
| worktreeMode | boolean | false | Use git worktree for isolated changes |
|
|
57
|
+
| checkpoints | boolean | false | Enable filesystem checkpoints |
|
|
58
|
+
|
|
59
|
+
## Advanced
|
|
60
|
+
|
|
61
|
+
| Field | Type | Default | Description |
|
|
62
|
+
|-------|------|---------|-------------|
|
|
63
|
+
| hermesCommand | string | hermes | Path to hermes CLI binary |
|
|
64
|
+
| verbose | boolean | false | Enable verbose output |
|
|
65
|
+
| extraArgs | string[] | [] | Additional CLI arguments |
|
|
66
|
+
| env | object | {} | Extra environment variables |
|
|
67
|
+
| promptTemplate | string | (default) | Custom prompt template with {{variable}} placeholders |
|
|
68
|
+
|
|
69
|
+
## Available Template Variables
|
|
70
|
+
|
|
71
|
+
- \`{{agentId}}\` — FideliOS agent ID
|
|
72
|
+
- \`{{agentName}}\` — Agent display name
|
|
73
|
+
- \`{{companyId}}\` — FideliOS company ID
|
|
74
|
+
- \`{{companyName}}\` — Company display name
|
|
75
|
+
- \`{{runId}}\` — Current heartbeat run ID
|
|
76
|
+
- \`{{taskId}}\` — Current task/issue ID (if assigned)
|
|
77
|
+
- \`{{taskTitle}}\` — Task title (if assigned)
|
|
78
|
+
- \`{{taskBody}}\` — Task description (if assigned)
|
|
79
|
+
- \`{{projectName}}\` — Project name (if scoped to a project)
|
|
80
|
+
`;
|
|
81
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEpE,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAC;AACjC,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAoC,EAAE,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDpC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect the current model from the user's Hermes config.
|
|
3
|
+
*
|
|
4
|
+
* Reads ~/.hermes/config.yaml and extracts the default model
|
|
5
|
+
* and provider settings.
|
|
6
|
+
*/
|
|
7
|
+
export interface DetectedModel {
|
|
8
|
+
model: string;
|
|
9
|
+
provider: string;
|
|
10
|
+
source: "config";
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Read the Hermes config file and extract the default model.
|
|
14
|
+
*/
|
|
15
|
+
export declare function detectModel(configPath?: string): Promise<DetectedModel | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Parse model.default and model.provider from raw YAML content.
|
|
18
|
+
* Uses simple regex parsing to avoid a YAML dependency.
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseModelFromConfig(content: string): DetectedModel | null;
|
|
21
|
+
//# sourceMappingURL=detect-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-model.d.ts","sourceRoot":"","sources":["../../src/server/detect-model.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,QAAQ,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAW/B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAqC1E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect the current model from the user's Hermes config.
|
|
3
|
+
*
|
|
4
|
+
* Reads ~/.hermes/config.yaml and extracts the default model
|
|
5
|
+
* and provider settings.
|
|
6
|
+
*/
|
|
7
|
+
import { readFile } from "node:fs/promises";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { homedir } from "node:os";
|
|
10
|
+
/**
|
|
11
|
+
* Read the Hermes config file and extract the default model.
|
|
12
|
+
*/
|
|
13
|
+
export async function detectModel(configPath) {
|
|
14
|
+
const filePath = configPath ?? join(homedir(), ".hermes", "config.yaml");
|
|
15
|
+
let content;
|
|
16
|
+
try {
|
|
17
|
+
content = await readFile(filePath, "utf-8");
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return parseModelFromConfig(content);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Parse model.default and model.provider from raw YAML content.
|
|
26
|
+
* Uses simple regex parsing to avoid a YAML dependency.
|
|
27
|
+
*/
|
|
28
|
+
export function parseModelFromConfig(content) {
|
|
29
|
+
const lines = content.split("\n");
|
|
30
|
+
let model = "";
|
|
31
|
+
let provider = "";
|
|
32
|
+
let inModelSection = false;
|
|
33
|
+
let modelSectionIndent = 0;
|
|
34
|
+
for (const line of lines) {
|
|
35
|
+
const trimmed = line.trimEnd();
|
|
36
|
+
const indent = line.length - line.trimStart().length;
|
|
37
|
+
// Track model: section (indent 0)
|
|
38
|
+
if (/^model:\s*$/.test(trimmed) && indent === 0) {
|
|
39
|
+
inModelSection = true;
|
|
40
|
+
modelSectionIndent = 0;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
// We left the model section if indent drops back to the section level or below
|
|
44
|
+
if (inModelSection && indent <= modelSectionIndent && trimmed && !trimmed.startsWith("#")) {
|
|
45
|
+
inModelSection = false;
|
|
46
|
+
}
|
|
47
|
+
if (inModelSection) {
|
|
48
|
+
const match = trimmed.match(/^\s*(\w+)\s*:\s*(.+)$/);
|
|
49
|
+
if (match) {
|
|
50
|
+
const key = match[1];
|
|
51
|
+
const val = match[2].trim().replace(/#.*$/, "").trim().replace(/^['"]|['"]$/g, "");
|
|
52
|
+
if (key === "default")
|
|
53
|
+
model = val;
|
|
54
|
+
if (key === "provider")
|
|
55
|
+
provider = val;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (!model)
|
|
60
|
+
return null;
|
|
61
|
+
return { model, provider, source: "config" };
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=detect-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-model.js","sourceRoot":"","sources":["../../src/server/detect-model.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAQlC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,UAAmB;IAEnB,MAAM,QAAQ,GAAG,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IAEzE,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,IAAI,kBAAkB,GAAG,CAAC,CAAC;IAE3B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;QAErD,kCAAkC;QAClC,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;YAChD,cAAc,GAAG,IAAI,CAAC;YACtB,kBAAkB,GAAG,CAAC,CAAC;YACvB,SAAS;QACX,CAAC;QAED,+EAA+E;QAC/E,IAAI,cAAc,IAAI,MAAM,IAAI,kBAAkB,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1F,cAAc,GAAG,KAAK,CAAC;QACzB,CAAC;QAED,IAAI,cAAc,EAAE,CAAC;YACnB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;YACrD,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBACrB,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;gBACnF,IAAI,GAAG,KAAK,SAAS;oBAAE,KAAK,GAAG,GAAG,CAAC;gBACnC,IAAI,GAAG,KAAK,UAAU;oBAAE,QAAQ,GAAG,GAAG,CAAC;YACzC,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side execution logic for the Hermes Agent adapter.
|
|
3
|
+
*
|
|
4
|
+
* Spawns `hermes chat -q "..." -Q` as a child process, streams output,
|
|
5
|
+
* and returns structured results to FideliOS.
|
|
6
|
+
*
|
|
7
|
+
* Verified CLI flags (hermes chat):
|
|
8
|
+
* -q/--query single query (non-interactive)
|
|
9
|
+
* -Q/--quiet quiet mode (no banner/spinner, only response + session_id)
|
|
10
|
+
* -m/--model model name (e.g. anthropic/claude-sonnet-4)
|
|
11
|
+
* -t/--toolsets comma-separated toolsets to enable
|
|
12
|
+
* --provider inference provider (auto, openrouter, nous, etc.)
|
|
13
|
+
* -r/--resume resume session by ID
|
|
14
|
+
* -w/--worktree isolated git worktree
|
|
15
|
+
* -v/--verbose verbose output
|
|
16
|
+
* --checkpoints filesystem checkpoints
|
|
17
|
+
*/
|
|
18
|
+
import type { AdapterExecutionContext, AdapterExecutionResult } from "@fideliosai/adapter-utils";
|
|
19
|
+
export declare function execute(ctx: AdapterExecutionContext): Promise<AdapterExecutionResult>;
|
|
20
|
+
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/server/execute.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EAEvB,MAAM,4BAA4B,CAAC;AAyRpC,wBAAsB,OAAO,CAC3B,GAAG,EAAE,uBAAuB,GAC3B,OAAO,CAAC,sBAAsB,CAAC,CAiLjC"}
|