Skip to content

Commit ede3bec

Browse files
RoyLinRoyLin
authored andcommitted
fix(node-sdk): remove unimplemented AHP harness code
- Remove HarnessServer class and JsHarnessServer interface - Remove harness_server field from SessionOptions - Remove a3s_ahp module reference that caused build failures - This fixes CI build failures for Node SDK on all platforms
1 parent 3d3562f commit ede3bec

2 files changed

Lines changed: 0 additions & 92 deletions

File tree

sdk/node/index.d.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ export interface JsSessionStore {
5757
export interface JsSecurityProvider {
5858
kind: string
5959
}
60-
/** Plain shim for `HarnessServer` — used as the `SessionOptions.harnessServer` field type. */
61-
export interface JsHarnessServer {
62-
program: string
63-
args: Array<string>
64-
}
6560
export interface SessionOptions {
6661
/** Override the default model. Format: "provider/model" (e.g., "openai/gpt-4o"). */
6762
model?: string
@@ -156,17 +151,6 @@ export interface SessionOptions {
156151
sessionId?: string
157152
/** Automatically save the session to the configured store after each turn (default: false). */
158153
autoSave?: boolean
159-
/**
160-
* External AHP harness server.
161-
*
162-
* Pass `new HarnessServer("python3", ["harness.py"])` to attach an external
163-
* supervision process. The harness receives every `pre_tool_use` and `pre_prompt`
164-
* event and can return `block`, `skip`, `retry`, or `continue`.
165-
* ```js
166-
* agent.session('.', { harnessServer: new HarnessServer('python3', ['harness.py']) });
167-
* ```
168-
*/
169-
harnessServer?: JsHarnessServer
170154
}
171155
/** A single message in conversation history. */
172156
export interface MessageObject {
@@ -580,27 +564,6 @@ export declare class DefaultSecurityProvider {
580564
kind: string
581565
constructor()
582566
}
583-
/**
584-
* External AHP harness server configuration.
585-
*
586-
* Pass to `SessionOptions.harnessServer` to attach an external harness process
587-
* that supervises every tool call and prompt in this session via JSON-RPC 2.0.
588-
*
589-
* ```js
590-
* agent.session('.', { harnessServer: new HarnessServer('python3', ['harness.py']) });
591-
* ```
592-
*/
593-
export declare class HarnessServer {
594-
program: string
595-
args: Array<string>
596-
/**
597-
* Create a harness server config.
598-
*
599-
* @param program - Executable to launch (e.g. "python3")
600-
* @param args - Arguments passed to the executable (e.g. ["harness.py"])
601-
*/
602-
constructor(program: string, args: Array<string>)
603-
}
604567
/** AI coding agent. Create with `Agent.create()`, then call `agent.session()`. */
605568
export declare class Agent {
606569
/**

sdk/node/src/lib.rs

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -418,39 +418,6 @@ impl DefaultSecurityProvider {
418418
}
419419
}
420420

421-
/// Plain shim for `HarnessServer` — used as the `SessionOptions.harnessServer` field type.
422-
#[napi(object)]
423-
#[derive(Clone, Default)]
424-
pub struct JsHarnessServer {
425-
pub program: String,
426-
pub args: Vec<String>,
427-
}
428-
429-
/// External AHP harness server configuration.
430-
///
431-
/// Pass to `SessionOptions.harnessServer` to attach an external harness process
432-
/// that supervises every tool call and prompt in this session via JSON-RPC 2.0.
433-
///
434-
/// ```js
435-
/// agent.session('.', { harnessServer: new HarnessServer('python3', ['harness.py']) });
436-
/// ```
437-
#[napi]
438-
pub struct HarnessServer {
439-
pub program: String,
440-
pub args: Vec<String>,
441-
}
442-
443-
#[napi]
444-
impl HarnessServer {
445-
/// Create a harness server config.
446-
///
447-
/// @param program - Executable to launch (e.g. "python3")
448-
/// @param args - Arguments passed to the executable (e.g. ["harness.py"])
449-
#[napi(constructor)]
450-
pub fn new(program: String, args: Vec<String>) -> Self {
451-
Self { program, args }
452-
}
453-
}
454421

455422
// ============================================================================
456423
// SessionOptions
@@ -538,15 +505,6 @@ pub struct SessionOptions {
538505
pub session_id: Option<String>,
539506
/// Automatically save the session to the configured store after each turn (default: false).
540507
pub auto_save: Option<bool>,
541-
/// External AHP harness server.
542-
///
543-
/// Pass `new HarnessServer("python3", ["harness.py"])` to attach an external
544-
/// supervision process. The harness receives every `pre_tool_use` and `pre_prompt`
545-
/// event and can return `block`, `skip`, `retry`, or `continue`.
546-
/// ```js
547-
/// agent.session('.', { harnessServer: new HarnessServer('python3', ['harness.py']) });
548-
/// ```
549-
pub harness_server: Option<JsHarnessServer>,
550508
}
551509

552510
/// A single message in conversation history.
@@ -847,19 +805,6 @@ fn js_session_options_to_rust(options: Option<SessionOptions>) -> RustSessionOpt
847805
if o.auto_save.unwrap_or(false) {
848806
opts = opts.with_auto_save(true);
849807
}
850-
if let Some(hs) = o.harness_server {
851-
match get_runtime().block_on(a3s_ahp::AhpHookExecutor::spawn(
852-
&hs.program,
853-
hs.args.as_slice(),
854-
)) {
855-
Ok(executor) => {
856-
opts = opts.with_hook_executor(executor);
857-
}
858-
Err(e) => {
859-
eprintln!("a3s-code: AHP harness spawn failed: {e}");
860-
}
861-
}
862-
}
863808
opts
864809
}
865810

0 commit comments

Comments
 (0)