@agent-link/agent 0.1.332 → 0.1.334

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,102 @@
1
+ import { spawn } from 'child_process';
2
+ import * as acp from '@agentclientprotocol/sdk';
3
+ import type { ProviderCommand, ProviderCommandDiscoveryResult, ProviderCommandScope } from './provider-command-types.js';
4
+ export type CopilotCommandInvocationResult = {
5
+ kind: 'text';
6
+ text: string;
7
+ markdown?: boolean;
8
+ preserveAnsi?: boolean;
9
+ } | {
10
+ kind: 'agent-prompt';
11
+ prompt: string;
12
+ displayPrompt: string;
13
+ mode?: 'interactive' | 'plan' | 'autopilot';
14
+ notice?: string;
15
+ } | {
16
+ kind: 'completed';
17
+ message?: string;
18
+ } | {
19
+ kind: 'select-subcommand';
20
+ command: string;
21
+ title: string;
22
+ options: Array<{
23
+ name: string;
24
+ description: string;
25
+ }>;
26
+ };
27
+ interface CopilotCommandRuntimeOptions {
28
+ providerId: string;
29
+ workDir: string;
30
+ onSessionEvent?: (sessionId: string, event: Record<string, unknown>) => void;
31
+ onUserInputRequest?: (sessionId: string, request: CopilotSdkUserInputRequest) => Promise<CopilotSdkUserInputResponse>;
32
+ onExitPlanModeRequest?: (sessionId: string, request: CopilotSdkExitPlanModeRequest) => Promise<CopilotSdkExitPlanModeResponse>;
33
+ onAcpElicitationRequest?: (request: acp.CreateElicitationRequest) => Promise<acp.CreateElicitationResponse>;
34
+ }
35
+ export interface CopilotSdkUserInputRequest {
36
+ question: string;
37
+ choices?: string[];
38
+ allowFreeform?: boolean;
39
+ }
40
+ export interface CopilotSdkUserInputResponse {
41
+ answer: string;
42
+ wasFreeform: boolean;
43
+ }
44
+ export interface CopilotSdkExitPlanModeRequest {
45
+ summary: string;
46
+ planContent?: string;
47
+ actions: string[];
48
+ recommendedAction: string;
49
+ }
50
+ export interface CopilotSdkExitPlanModeResponse {
51
+ approved: boolean;
52
+ selectedAction?: string;
53
+ feedback?: string;
54
+ }
55
+ export interface CopilotCommandSessionOptions {
56
+ model?: string;
57
+ contextTier?: string;
58
+ reasoningEffort?: string;
59
+ }
60
+ interface SpawnSpec {
61
+ command: string;
62
+ args: string[];
63
+ options: Parameters<typeof spawn>[2];
64
+ }
65
+ export declare function resolveCopilotCommandSpawn(providerId: string, workDir: string): SpawnSpec;
66
+ export declare class CopilotCommandRuntime {
67
+ private readonly options;
68
+ private child;
69
+ private connection;
70
+ private acpConnection;
71
+ private readonly acpSessions;
72
+ private readonly acpCommandWaiters;
73
+ private readonly acpToolNames;
74
+ private stderr;
75
+ private releaseSessionLock;
76
+ constructor(options: CopilotCommandRuntimeOptions);
77
+ start(): Promise<void>;
78
+ request<T>(method: string, params?: Record<string, unknown>, timeoutMs?: number): Promise<T>;
79
+ openSession(sessionId?: string, options?: CopilotCommandSessionOptions): Promise<string>;
80
+ private acquireSessionLock;
81
+ listSessionCommands(sessionId: string): Promise<ProviderCommand[]>;
82
+ invokeCommand(sessionId: string, name: string, input: string): Promise<CopilotCommandInvocationResult>;
83
+ setMode(sessionId: string, mode: 'interactive' | 'plan' | 'autopilot'): Promise<void>;
84
+ getMode(sessionId: string): Promise<'interactive' | 'plan' | 'autopilot'>;
85
+ enableAllowAll(sessionId: string): Promise<void>;
86
+ send(sessionId: string, prompt: string, displayPrompt: string): Promise<void>;
87
+ abort(sessionId: string): Promise<void>;
88
+ abortManualCompaction(sessionId: string): Promise<void>;
89
+ destroySession(sessionId: string): Promise<void>;
90
+ deleteSession(sessionId: string): Promise<void>;
91
+ stop(): Promise<void>;
92
+ private usesAgencyAcp;
93
+ private openAcpSession;
94
+ private requestAcp;
95
+ private notifyAcp;
96
+ private handleAcpSessionUpdate;
97
+ private emitAcpEvent;
98
+ }
99
+ export declare function normalizeAcpCommands(values: acp.AvailableCommand[]): ProviderCommand[];
100
+ export declare function normalizeCopilotCommands(input: unknown): ProviderCommand[];
101
+ export declare function discoverCopilotCommands(scope: ProviderCommandScope): Promise<ProviderCommandDiscoveryResult>;
102
+ export {};