@autopilot-agent/adapters 0.3.0 → 0.4.0

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.
@@ -0,0 +1,62 @@
1
+ export declare const DESKTOP_STATUS_VERSION = 1;
2
+ export declare const DESKTOP_STATUS_FRAME_BYTES: number;
3
+ export declare const DESKTOP_STATUS_QUEUE_BYTES: number;
4
+ export interface DesktopSessionStatus {
5
+ sessionId: string;
6
+ turnId?: string;
7
+ selected: boolean;
8
+ relation: "opened" | "locallyDriven" | "relatedObserved";
9
+ freshness: "fresh" | "unknown";
10
+ status: "idle" | "running" | "waiting_approval" | "waiting_user_input" | "completed" | "failed" | "interrupted";
11
+ execution?: "active" | "inactive" | "unconfirmed" | "lost";
12
+ waiting?: "approval" | "user_input" | "threads";
13
+ result?: "completed" | "failed" | "interrupted" | "limit_reached";
14
+ interaction?: "pending" | "decided" | "expired" | "unconfirmed";
15
+ continuation?: "pending" | "applied" | "rejected" | "claimed" | "executing" | "completed" | "failed";
16
+ recoverable?: boolean;
17
+ lastSeq: number;
18
+ }
19
+ export interface DesktopWorkspaceStatus {
20
+ workspaceId: string;
21
+ stateRootId: string;
22
+ projectId: string;
23
+ displayName: string;
24
+ }
25
+ export interface DesktopStatusIdentity {
26
+ desktopInstanceId: string;
27
+ paneId: string;
28
+ generation: number;
29
+ apInstanceId: string;
30
+ }
31
+ export type DesktopStatusFrame = DesktopStatusIdentity & {
32
+ protocolVersion: 1;
33
+ seq: number;
34
+ } & ({
35
+ type: "hello";
36
+ token: string;
37
+ cliVersion: string;
38
+ } | {
39
+ type: "snapshot";
40
+ snapshotId: string;
41
+ part: number;
42
+ final: boolean;
43
+ lifecycle: "starting" | "ready";
44
+ workspace?: DesktopWorkspaceStatus;
45
+ sessions: DesktopSessionStatus[];
46
+ } | {
47
+ type: "heartbeat";
48
+ } | {
49
+ type: "ap_exiting";
50
+ });
51
+ export type DesktopStatusReply = {
52
+ type: "accepted" | "ack" | "resync_required";
53
+ seq: number;
54
+ };
55
+ export declare function isDesktopStatusId(value: unknown): value is string;
56
+ export declare function isDesktopSessionStatus(value: unknown): value is DesktopSessionStatus;
57
+ export declare function isDesktopStatusFrame(value: unknown): value is DesktopStatusFrame;
58
+ export declare function isDesktopStatusReply(value: unknown): value is DesktopStatusReply;
59
+ export declare class DesktopStatusLines {
60
+ private pending;
61
+ push(chunk: Buffer): unknown[];
62
+ }
@@ -2,6 +2,8 @@ export interface FileOperationDiagnostic {
2
2
  phase: "lock" | "temporary_write" | "rename" | "cleanup";
3
3
  osCode?: string;
4
4
  lockWaitMs?: number;
5
+ attempts?: number;
6
+ elapsedMs?: number;
5
7
  cleanupFailed?: boolean;
6
8
  }
7
9
  export declare function getFileOperationDiagnostic(error: unknown): FileOperationDiagnostic | undefined;
@@ -16,6 +18,7 @@ export declare function withFileLock<T>(filePath: string, operation: () => T | P
16
18
  export declare function withAsyncFileLock<T>(filePath: string, operation: () => T | Promise<T>): Promise<T>;
17
19
  export declare function ensureParentDirectory(filePath: string): void;
18
20
  export declare function atomicReplace(filePath: string, content: string): void;
21
+ export declare function replaceSessionFile(filePath: string, content: string): Promise<void>;
19
22
  export declare function safeFilePath(directory: string, key: string, extension: string): string;
20
23
  export declare function readJsonFile<T>(filePath: string): T | null;
21
24
  export declare function readJsonLines<T>(filePath: string): {
@@ -21,6 +21,8 @@ export interface NodeStorageDiagnostic {
21
21
  phase: "prepare" | "identity" | "lock" | "temporary_write" | "rename" | "cleanup";
22
22
  osCode?: string;
23
23
  lockWaitMs?: number;
24
+ attempts?: number;
25
+ elapsedMs?: number;
24
26
  cleanupFailed?: boolean;
25
27
  }
26
28
  export declare class NodeStateError extends Error {
@@ -0,0 +1 @@
1
+ export declare function withNodeRuntimeOwner<T>(stateRoot: string, operation: () => Promise<T>): Promise<T>;
@@ -1,3 +1,4 @@
1
+ import { type ApiProtocol, type ProviderRouteProfile, type ReasoningEffort } from "@autopilot-agent/core";
1
2
  declare const RAG_ROLE_CONTRACT: Readonly<{
2
3
  readonly textRerank: {
3
4
  readonly provider: "bailian";
@@ -22,6 +23,8 @@ declare const RAG_ROLE_CONTRACT: Readonly<{
22
23
  }>;
23
24
  type RagConnectionRole = keyof typeof RAG_ROLE_CONTRACT;
24
25
  export interface MainSettingsCategoryInput {
26
+ apiProtocol?: ApiProtocol;
27
+ compatibilityPreset?: ProviderRouteProfile["compatibilityPreset"];
25
28
  baseUrl: string;
26
29
  model: string;
27
30
  apiKey?: string;
@@ -30,12 +33,17 @@ export interface MainSettingsCategoryInput {
30
33
  sonnetModel?: string;
31
34
  haikuModel?: string;
32
35
  subagentModel?: string;
33
- effort?: "auto" | "low" | "medium" | "high" | "max";
36
+ effort?: "auto" | ReasoningEffort;
34
37
  maxOutputTokens?: number;
35
38
  compactWindow?: number;
36
39
  timeoutMs?: number;
37
40
  alwaysThinkingEnabled?: boolean;
38
41
  }
42
+ export type MainModelCapabilitiesInput = Pick<MainSettingsCategoryInput, "apiProtocol" | "compatibilityPreset" | "baseUrl" | "model">;
43
+ export interface MainModelCapabilities {
44
+ supportedReasoningEfforts: readonly ReasoningEffort[];
45
+ supportsToolCalls: boolean;
46
+ }
39
47
  export interface RagSettingsCategoryConnectionInput {
40
48
  provider: "bailian" | "openai-compatible" | "dashscope";
41
49
  baseUrl: string;
@@ -91,7 +99,9 @@ export declare class NodeUserSettingsError extends Error {
91
99
  export declare function createNodeUserSettingsService(options?: {
92
100
  homeDirectory?: string;
93
101
  fetchImpl?: typeof fetch;
102
+ env?: NodeJS.ProcessEnv;
94
103
  }): {
104
+ getMainModelCapabilities(input: MainModelCapabilitiesInput): MainModelCapabilities;
95
105
  refreshMainModelCatalog(): Promise<MainModelCatalogResult>;
96
106
  getStatus(): UserSettingsStatus;
97
107
  getRevision(): string;
@@ -36,6 +36,10 @@ export interface NodeThreadRunnerStopReport {
36
36
  recoverableTurnIds?: string[];
37
37
  }
38
38
  export interface NodeThreadRunner {
39
+ listExecutions(): Array<{
40
+ threadId: string;
41
+ turnId: string;
42
+ }>;
39
43
  start(): Promise<void>;
40
44
  stop(): Promise<NodeThreadRunnerStopReport>;
41
45
  kick(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autopilot-agent/adapters",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@anthropic-ai/sandbox-runtime": "0.0.78",
45
- "@autopilot-agent/core": "0.3.0",
45
+ "@autopilot-agent/core": "0.4.0",
46
46
  "js-yaml": "4.3.0",
47
47
  "linkedom": "0.18.12"
48
48
  },