@yitom/agy-acp-map 0.1.3 → 0.1.6

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,2 @@
1
+ export * from './types.ts';
2
+ export * from './session-core.ts';
@@ -0,0 +1,69 @@
1
+ import { type DiscoveryResult } from '../lib/agy-discovery.ts';
2
+ import { SessionStore } from '../lib/session-store.ts';
3
+ import { SessionHistoryStore } from '../lib/session-history.ts';
4
+ import { type SdkSession, type ProtocolVersion } from './types.ts';
5
+ export interface SessionCoreOptions {
6
+ sessionStore?: SessionStore | string;
7
+ historyStore?: SessionHistoryStore | string;
8
+ }
9
+ export declare class AgySessionCore {
10
+ readonly sessions: Map<string, SdkSession>;
11
+ readonly sessionStore: SessionStore;
12
+ readonly historyStore: SessionHistoryStore;
13
+ private catalogPromise;
14
+ constructor(options?: SessionCoreOptions);
15
+ getDiscovery(): Promise<DiscoveryResult>;
16
+ /** Warm-up toggle: AGY_ACP_WARMUP=0/false/no disables connect-time pre-spawn. */
17
+ warmupEnabled(): boolean;
18
+ /** Shared spawn-target builder so warm-up and promptTurn launch identical agy. */
19
+ buildSpawnTarget(session: SdkSession): {
20
+ bin: string;
21
+ args: string[];
22
+ };
23
+ /**
24
+ * Connect-time warm-up: pull agy up in the background right after
25
+ * session/new|resume so the first prompt reuses a writable process.
26
+ * Fire-and-forget — never blocks the new/resume response. First real
27
+ * prompt attaches via setCallbacks; close/delete/cancel still kill.
28
+ */
29
+ warmupSession(sessionId: string): void;
30
+ /** Kill every live child (bridge shutdown path). Clients should still close/delete per session. */
31
+ shutdown(): Promise<void>;
32
+ persistSession(session: SdkSession, opts?: {
33
+ throwOnError?: boolean;
34
+ }): void;
35
+ persistTurnHistory(sessionId: string, userText: string, assistantText: string, stopReason: string, eligible?: boolean): void;
36
+ replayHistory(sessionId: string, protocolVersion: ProtocolVersion, notifyClient: (update: any) => Promise<void> | void): Promise<void>;
37
+ sessionMeta(session: SdkSession): Record<string, unknown> | undefined;
38
+ applyCatalogDefaults(session: SdkSession, discovery: DiscoveryResult): void;
39
+ createSession(params: any, protocolVersion?: ProtocolVersion): Promise<{
40
+ session: SdkSession;
41
+ discovery: DiscoveryResult;
42
+ meta?: Record<string, unknown>;
43
+ }>;
44
+ resumeSession(params: any, protocolVersion?: ProtocolVersion, opts?: {
45
+ warmup?: boolean;
46
+ }): Promise<{
47
+ session: SdkSession;
48
+ discovery: DiscoveryResult;
49
+ meta?: Record<string, unknown>;
50
+ }>;
51
+ updateConfigOption(params: any, protocolVersion: ProtocolVersion | undefined, buildOptionsFn: (discovery: DiscoveryResult, session?: Pick<SdkSession, 'model' | 'agent'>) => any[]): Promise<{
52
+ session: SdkSession;
53
+ discovery: DiscoveryResult;
54
+ configOptions: any[];
55
+ meta?: Record<string, unknown>;
56
+ }>;
57
+ listSessions(params?: any): Promise<{
58
+ sessions: any[];
59
+ nextCursor?: string | null;
60
+ }>;
61
+ deleteSession(params: any): Promise<{}>;
62
+ closeSession(params: any): Promise<{}>;
63
+ cancelSession(params: any): void;
64
+ promptTurn(params: any, protocolVersion: ProtocolVersion | undefined, notifyClient: (update: any) => Promise<void>, opts?: {
65
+ isPreLocked?: boolean;
66
+ }): Promise<{
67
+ stopReason: string;
68
+ }>;
69
+ }
@@ -0,0 +1,69 @@
1
+ import type { AgyProcessManager } from '../lib/agy-process.ts';
2
+ import type { MapperState } from '../lib/map-agy-to-acp.ts';
3
+ import type { SoftDenyInfo } from '../lib/soft-deny.ts';
4
+ export declare const AGENT_INFO: {
5
+ name: string;
6
+ title: string;
7
+ version: string;
8
+ };
9
+ export declare const BRIDGE_CAPABILITIES: {
10
+ prompt: boolean;
11
+ streaming: boolean;
12
+ tools: boolean;
13
+ resume: boolean;
14
+ permissionRoundTrip: boolean;
15
+ permissionMode: string;
16
+ safetyTiers: ("autonomous" | "autonomous-unsandboxed" | "safe")[];
17
+ nativeCancel: boolean;
18
+ cancelMode: string;
19
+ historyReplay: boolean;
20
+ dynamicConfig: string;
21
+ richContentInput: string;
22
+ richContentOutput: string;
23
+ clientFilesystem: boolean;
24
+ clientTerminal: boolean;
25
+ };
26
+ export type ProtocolVersion = 1 | 2;
27
+ export interface CatalogChoice {
28
+ value: string;
29
+ name: string;
30
+ description?: string;
31
+ }
32
+ export declare function catalogChoices(items: unknown, currentValue?: string): CatalogChoice[];
33
+ export interface SdkSession {
34
+ sessionId: string;
35
+ cwd: string;
36
+ additionalDirectories?: string[];
37
+ createdAt: string;
38
+ updatedAt: string;
39
+ title?: string;
40
+ proc: AgyProcessManager;
41
+ mapper: MapperState;
42
+ busy: boolean;
43
+ cancelled: boolean;
44
+ protocolVersion: ProtocolVersion;
45
+ stderrBuf: string;
46
+ softDenies: SoftDenyInfo[];
47
+ softDenyEmitted: boolean;
48
+ stagedFiles: string[];
49
+ conversationId?: string;
50
+ model?: string;
51
+ effort?: string;
52
+ mode?: string;
53
+ agent?: string;
54
+ sandbox?: boolean;
55
+ jsonSchema?: string;
56
+ safety?: 'safe' | 'autonomous' | 'autonomous-unsandboxed';
57
+ skipPermissions?: boolean;
58
+ disableSlashCommands?: boolean;
59
+ printTimeout?: string;
60
+ deleted?: boolean;
61
+ }
62
+ /**
63
+ * Sequential FIFO execution queue to eliminate notification ordering races.
64
+ */
65
+ export declare class AsyncSerialQueue {
66
+ private tail;
67
+ enqueue(fn: () => Promise<void> | void): Promise<void>;
68
+ drain(): Promise<void>;
69
+ }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
1
  /**
2
- * agy-acp-map: Official ACP v1/v2 Bridge for Google Antigravity CLI (agy).
2
+ * agy-acp-map: Universal ACP v1/v2 Bridge for Google Antigravity CLI (agy).
3
3
  * Primary entry point for library consumption in Node, Bun, and Electron.
4
4
  */
5
- export { AgyAcpService, createAcpV1App, createAcpV2App, createDualAcpApp, AGENT_INFO, BRIDGE_CAPABILITIES, type SdkSession, } from './agent-sdk.ts';
5
+ export { AgyAcpService, createAcpV1App, createAcpV2App, createDualAcpApp, AGENT_INFO, BRIDGE_CAPABILITIES, AgySessionCore, AgyAcpV1Service, AgyAcpV2Service, type SdkSession, } from './agent-sdk.ts';
6
+ export * as core from './core/index.ts';
7
+ export * as v1 from './v1/index.ts';
8
+ export * as v2 from './v2/index.ts';
6
9
  export * from './lib/map-agy-to-acp.ts';
7
10
  export * from './lib/agy-process.ts';
8
11
  export * from './lib/agy-args.ts';
@@ -12,3 +15,6 @@ export * from './lib/rich-content.ts';
12
15
  export * from './lib/path-allowlist.ts';
13
16
  export * from './lib/agy-discovery.ts';
14
17
  export * from './lib/session-store.ts';
18
+ export * from './lib/session-history.ts';
19
+ export * from './lib/win32-console.ts';
20
+ export * from './lib/debug-log.ts';