@wrongstack/acp 1.0.19 → 1.0.26

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.
@@ -29,6 +29,9 @@ export interface AgentCapabilities {
29
29
  }
30
30
  export interface RunTurnInput {
31
31
  sessionId: string;
32
+ /** Current session configuration, isolated from other sessions. */
33
+ modeId?: string | undefined;
34
+ configOptions?: readonly SessionConfigOption[] | undefined;
32
35
  /** Content blocks the client sent. */
33
36
  prompt: readonly ContentBlock[];
34
37
  /** Cancelled when the client sends `session/cancel` for this session. */
@@ -71,6 +74,9 @@ export interface RunTurnPermissionRequest {
71
74
  }
72
75
  /** Client filesystem/terminal capabilities advertised at initialize. */
73
76
  export interface ClientCapabilities {
77
+ auth?: {
78
+ terminal?: boolean | undefined;
79
+ } | undefined;
74
80
  fs?: {
75
81
  readTextFile?: boolean | undefined;
76
82
  writeTextFile?: boolean | undefined;
@@ -143,6 +149,8 @@ export interface SessionState {
143
149
  abort: AbortController;
144
150
  /** Active mode, advertised to the client in current_mode_update. */
145
151
  modeId: string;
152
+ configOptions?: SessionConfigOption[] | undefined;
153
+ prompting?: boolean | undefined;
146
154
  /** Created at, for session/list ordering. */
147
155
  createdAt: string;
148
156
  /** Last activity timestamp, for session/info_update. */
@@ -225,6 +233,11 @@ export interface ProtocolHandlerOptions {
225
233
  }
226
234
  /** Minimal durable-store contract the handler uses (ACPSessionStore satisfies it). */
227
235
  export interface SessionPersistence {
236
+ list?(): Promise<Array<{
237
+ id: string;
238
+ updatedAt: string;
239
+ }>>;
240
+ delete?(sessionId: string): Promise<void>;
228
241
  save(state: SessionState, history?: Array<{
229
242
  sessionUpdate: string;
230
243
  content: unknown;
@@ -21,6 +21,8 @@ export declare class ACPProtocolHandler {
21
21
  private nextId;
22
22
  private readonly pendingOut;
23
23
  private nextOutId;
24
+ private readonly promptRequests;
25
+ private readonly persistenceWrites;
24
26
  constructor(opts: ProtocolHandlerOptions);
25
27
  /**
26
28
  * Send a request to the client and await its response. Used for
@@ -14,6 +14,7 @@ export interface ProtocolSessionContext {
14
14
  sessionUpdate: string;
15
15
  content: unknown;
16
16
  }>) => void) | undefined;
17
+ disposeFor?: ((sessionId: string) => void) | undefined;
17
18
  onSessionNew: (state: SessionState) => void;
18
19
  allocId: () => string;
19
20
  persist: (state: SessionState, history?: Array<{
@@ -28,7 +29,7 @@ export interface ProtocolSessionContext {
28
29
  clientCapabilities: ClientCapabilities;
29
30
  }
30
31
  export declare function handleSessionNewOp(ctx: ProtocolSessionContext, id: string | number, params: unknown): Promise<boolean>;
31
- export declare function handleSessionLoadOp(ctx: ProtocolSessionContext, id: string | number, params: unknown): Promise<boolean>;
32
+ export declare function handleSessionLoadOp(ctx: ProtocolSessionContext, id: string | number, params: unknown, replayHistory?: boolean): Promise<boolean>;
32
33
  export declare function handleSessionForkOp(ctx: ProtocolSessionContext, id: string | number, params: unknown): Promise<boolean>;
33
34
  export declare function handleSessionPromptOp(ctx: ProtocolSessionContext, id: string | number, params: unknown): Promise<boolean>;
34
35
  export declare function handleSetModeOp(ctx: ProtocolSessionContext, id: string | number, params: unknown): Promise<boolean>;
@@ -21,7 +21,7 @@ export declare function errorToJsonRpc(err: unknown): {
21
21
  data?: unknown;
22
22
  };
23
23
  export declare function createRunTurnApi(sessionId: string, clientCapabilities: ClientCapabilities, request: (method: string, params: unknown) => Promise<unknown>, sendSessionUpdate?: (update: unknown) => Promise<boolean>): RunTurnApi;
24
- export declare function buildInitializeResult(agentName: string, modes: readonly SessionMode[], configOptions: readonly SessionConfigOption[]): {
24
+ export declare function buildInitializeResult(agentName: string, modes: readonly SessionMode[], configOptions: readonly SessionConfigOption[], clientCapabilities?: ClientCapabilities): {
25
25
  protocolVersion: 1;
26
26
  agentCapabilities: {
27
27
  loadSession: boolean;
@@ -41,9 +41,6 @@ export declare function buildInitializeResult(agentName: string, modes: readonly
41
41
  resume: {};
42
42
  fork: {};
43
43
  };
44
- auth: {
45
- logout: {};
46
- };
47
44
  };
48
45
  agentInfo: {
49
46
  name: string;