@qlairoslabs/acp-client 0.13.2-alpha.1 → 0.13.3-alpha.1

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/CONSUMER_GUIDE.md CHANGED
@@ -1153,6 +1153,19 @@ environment, or use a scripted model with a local JSONL scenario for offline
1153
1153
  development. Keep the harness home on durable storage. Backend kind stays fixed
1154
1154
  across a conversation's mode changes and handoffs.
1155
1155
 
1156
+ ### Compiled launchers
1157
+
1158
+ A compiled Bun application can import `serve(home)` from
1159
+ `@qlairoslabs/acp-client/native-harness` and call it from its own subprocess
1160
+ command. For example, route `agents __native-harness serve --home <directory>`
1161
+ to `await serve(directory)` in the application, then set `harness.command` to
1162
+ `[process.execPath, "__native-harness", "serve", "--home", directory]`.
1163
+ Handle that command before normal application startup and keep stdout reserved
1164
+ for the harness protocol. The command override includes all arguments, so pass
1165
+ the same directory as `harness.home`.
1166
+
1167
+ ### Configuration
1168
+
1156
1169
  ```ts
1157
1170
  import { Agent, ADAPTERS, type AgentHarnessConfig } from "@qlairoslabs/acp-client";
1158
1171
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qlairoslabs/acp-client",
3
- "version": "0.13.2-alpha.1",
3
+ "version": "0.13.3-alpha.1",
4
4
  "description": "Embeddable Agent Client Protocol (ACP) client library with degraded PTY fallback.",
5
5
  "type": "module",
6
6
  "module": "src/index.ts",
@@ -59,6 +59,7 @@
59
59
  "./repl": "./src/repl/index.ts",
60
60
  "./degraded": "./src/degraded/index.ts",
61
61
  "./parser": "./src/parser/index.ts",
62
+ "./native-harness": "./src/native-harness/src/interfaces/cli/serve.ts",
62
63
  "./cli": "./src/cli/index.ts"
63
64
  },
64
65
  "bin": {
@@ -0,0 +1,4 @@
1
+ declare module "*.md" {
2
+ const text: string;
3
+ export default text;
4
+ }
@@ -1,22 +1,21 @@
1
- import { readFileSync } from "node:fs";
2
-
3
- type InstructionFile = "agent" | "agent-demo" | "harness";
1
+ import agent from "./instructions/agent.md" with { type: "text" };
2
+ import agentDemo from "./instructions/agent-demo.md" with { type: "text" };
3
+ import harness from "./instructions/harness.md" with { type: "text" };
4
4
 
5
5
  // The stable "System prompt" is composed of two parts:
6
6
  // Agent instructions: behavior, personality, etc
7
7
  // Harness instructions: A short, stable explanation of how to interpret attributed history and active input. Tool-specific usage guidance lives with the tool definitions
8
8
 
9
9
 
10
+ // Static text imports also include the built-in instructions in compiled Bun binaries.
11
+ const instructions = { agent, "agent-demo": agentDemo, harness };
12
+
10
13
  /** Load the Markdown selected by the consumer or context builder. */
11
- export function loadInstructions(file: InstructionFile): string {
12
- return readFileSync(new URL(`./instructions/${file}.md`, import.meta.url), "utf8");
14
+ export function loadInstructions(file: keyof typeof instructions): string {
15
+ return instructions[file];
13
16
  }
14
17
 
15
-
16
- let harnessInstructions: string | undefined;
17
-
18
18
  /** Compose the system message used by inference and the Live Context preview. */
19
19
  export function composeSystemPrompt(agentInstructions: string): string {
20
- harnessInstructions ??= loadInstructions("harness").trimEnd();
21
- return [agentInstructions, harnessInstructions].filter(Boolean).join("\n\n");
20
+ return [agentInstructions, harness.trimEnd()].filter(Boolean).join("\n\n");
22
21
  }