Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(server): add Hermes Agent ACP provider #9158

Closedraman325(GitHub profile, opens in a new tab)wants to merge 21 commits intomain fromrefs/pull/9158/headopened View on GitHub

Showing 22 changed files with 157 additions and 0 deletions (loading 21).

x
0 of 22 viewed, 22 left
157 additions and 0 deletionsapps/server/src/provider/Drivers/HermesDriver.tsAdded
View file
@@ -0,0 +1,157 @@
+/**
+ * HermesDriver — `ProviderDriver` for the Hermes Agent (`hermes acp`) runtime.
+ *
+ * Hermes exposes an ACP-based CLI. Model discovery happens during the managed
+ * provider status check via ACP session setup; there is no standalone auth
+ * probe, so a successful discovery doubles as proof of authentication.
+ *
+ * Text generation is supported via the ACP runtime — `makeHermesTextGeneration`
+ * drives `runtime.prompt` with a structured-output schema and collects the
+ * agent's `agent_message_chunk` stream into a single JSON blob.
+ *
+ * @module provider/Drivers/HermesDriver
+ */
+import { HermesSettings, ProviderDriverKind } from "@t3tools/contracts";
+import * as Crypto from "effect/Crypto";
+import * as Effect from "effect/Effect";
+import * as FileSystem from "effect/FileSystem";
+import * as Path from "effect/Path";
+import * as Schema from "effect/Schema";
+import { HttpClient } from "effect/unstable/http";
+import { ChildProcessSpawner } from "effect/unstable/process";
+​
+import * as BackgroundPolicy from "../../background/BackgroundPolicy.ts";
+import { ServerConfig } from "../../config.ts";
+import { ServerSettingsService } from "../../serverSettings.ts";
+import { makeHermesTextGeneration } from "../../textGeneration/HermesTextGeneration.ts";
+import { ProviderDriverError } from "../Errors.ts";
+import { withInstanceIdentity } from "./instanceIdentity.ts";
+import { makeHermesAdapter } from "../Layers/HermesAdapter.ts";
+import {