awb-agent-manager 1.6.199 → 1.6.200

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.
@@ -1,60 +1,64 @@
1
+ import { AgentSessionStore } from './agent-session-store.js';
1
2
  import { type AwbConfig } from './rest.js';
3
+ import type { AcpMcpServer } from './runtime/acp/acp-types.js';
2
4
  export interface AgentSessionRequest {
3
- session_id: string;
4
- workspace_id: string;
5
- agent_id: string;
6
- owner_user_id: string;
7
- op: 'open' | 'prompt' | 'permission' | 'cancel' | 'set_mode' | 'close';
8
- runtime: string;
9
- cwd: string;
10
- native_session_id: string | null;
11
- permission_policy: string;
5
+ manager_id: string;
6
+ workspace_id?: string;
7
+ cli: string;
8
+ op: 'list' | 'history' | 'open' | 'prompt' | 'permission' | 'cancel' | 'set_mode' | 'close';
9
+ request_id?: string;
10
+ session_id?: string | null;
11
+ cwd?: string;
12
+ title?: string;
12
13
  turn_id?: string;
13
14
  text?: string;
14
- request_id?: string;
15
+ permission_request_id?: string;
15
16
  option_id?: string | null;
16
17
  mode_id?: string;
18
+ credential_id?: string | null;
19
+ driver_user_id: string;
17
20
  issued_at: string;
18
21
  }
19
- export interface AgentSessionAgentContext {
20
- agent_id: string;
21
- workspace_id: string;
22
- api_key: string;
23
- cwd: string;
24
- cli: string;
25
- cli_home_dir: string;
26
- extra_env?: Record<string, string>;
27
- model?: string | null;
28
- runtime_config?: {
29
- extra?: Record<string, unknown>;
30
- } | null;
31
- }
32
22
  export interface ResolvedAcpCommand {
33
23
  command: string;
34
24
  args: string[];
35
25
  }
36
26
  export interface AgentSessionRunnerOptions {
27
+ getManagerId: () => string;
28
+ store?: AgentSessionStore;
37
29
  idleMinutes?: number;
38
30
  permissionTimeoutMs?: number;
39
31
  requestTimeoutMs?: number;
40
32
  promptTimeoutMs?: number;
41
33
  flushIntervalMs?: number;
42
- commandResolver?: (runtime: string, ctx: AgentSessionAgentContext) => Promise<ResolvedAcpCommand>;
34
+ commandResolver?: (cli: string) => Promise<ResolvedAcpCommand>;
43
35
  baseEnv?: NodeJS.ProcessEnv;
44
36
  clientVersion?: string;
37
+ mcpServers?: (sessionId: string) => AcpMcpServer[];
38
+ sessionHomesDir?: string;
39
+ credentialFetcher?: (credentialId: string, workspaceId: string) => Promise<SessionCredential | null>;
40
+ }
41
+ export interface SessionCredential {
42
+ credential_id: string;
43
+ provider: string;
44
+ fields: Record<string, string>;
45
45
  }
46
- export declare function resolveAcpCommandForRuntime(runtime: string, ctx: AgentSessionAgentContext): Promise<ResolvedAcpCommand>;
46
+ export declare const SESSION_CLI_CREDENTIAL_PREFIX: Record<string, string>;
47
+ export declare const ACP_SESSION_CLIS: readonly ["claude", "codex", "hermes"];
48
+ export declare function findOnPath(name: string): Promise<string | null>;
49
+ export declare function resolveAcpCommandForCli(cli: string): Promise<ResolvedAcpCommand>;
50
+ export declare function detectAcpSessionClis(env?: NodeJS.ProcessEnv): Promise<string[]>;
47
51
  export declare class AgentSessionRunner {
48
52
  #private;
49
- constructor(config: AwbConfig, options?: AgentSessionRunnerOptions);
53
+ constructor(config: AwbConfig, options: AgentSessionRunnerOptions);
54
+ get store(): AgentSessionStore;
50
55
  _snapshot(): Array<{
56
+ cli: string;
51
57
  session_id: string;
52
- agent_id: string;
53
- runtime: string;
54
58
  busy: boolean;
55
59
  pid: number | null;
56
60
  }>;
57
61
  countInFlight(): number;
58
- handle(request: AgentSessionRequest, ctx: AgentSessionAgentContext | undefined): Promise<void>;
62
+ handle(request: AgentSessionRequest): Promise<void>;
59
63
  stopAll(reason?: string): Promise<void>;
60
64
  }