@agent-link/agent 0.1.324 → 0.1.325
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.
- package/dist/backends/index.js +2 -0
- package/dist/backends/index.js.map +1 -1
- package/dist/backends/types.d.ts +11 -1
- package/dist/backends/types.js +74 -1
- package/dist/backends/types.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/connection.js +314 -28
- package/dist/connection.js.map +1 -1
- package/dist/pi.d.ts +109 -0
- package/dist/pi.js +1742 -0
- package/dist/pi.js.map +1 -0
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +17 -1
- package/dist/providers.js.map +1 -1
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.js +5 -0
- package/dist/runtime.js.map +1 -1
- package/dist/sdk.d.ts +3 -1
- package/dist/sdk.js +42 -1
- package/dist/sdk.js.map +1 -1
- package/package.json +1 -1
package/dist/pi.d.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistent PI RPC driver and PI-owned session history operations.
|
|
3
|
+
*
|
|
4
|
+
* PI is intentionally integrated through its public JSONL RPC protocol and
|
|
5
|
+
* session file format. No PI runtime package is imported by AgentLink.
|
|
6
|
+
*/
|
|
7
|
+
import { type ChildProcess } from 'child_process';
|
|
8
|
+
import type { SendFn } from './claude.js';
|
|
9
|
+
import type { GlobalSessionInfo, SessionInfo } from './history.js';
|
|
10
|
+
import type { HistoryMessage } from './history-message-transform.js';
|
|
11
|
+
import { piCapabilities, type UsageInfo } from './backends/types.js';
|
|
12
|
+
export type PiThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
13
|
+
export interface PiOptions {
|
|
14
|
+
/** PI provider/model identifier, for example "anthropic/claude-sonnet-4". */
|
|
15
|
+
model?: string;
|
|
16
|
+
thinking?: PiThinkingLevel;
|
|
17
|
+
}
|
|
18
|
+
interface PiChatFile {
|
|
19
|
+
name: string;
|
|
20
|
+
mimeType: string;
|
|
21
|
+
data: string;
|
|
22
|
+
}
|
|
23
|
+
interface PendingRpc {
|
|
24
|
+
command: string;
|
|
25
|
+
resolve: (response: Record<string, unknown>) => void;
|
|
26
|
+
reject: (error: Error) => void;
|
|
27
|
+
timer: ReturnType<typeof setTimeout>;
|
|
28
|
+
}
|
|
29
|
+
export interface PiConversationState {
|
|
30
|
+
conversationId: string;
|
|
31
|
+
child: ChildProcess | null;
|
|
32
|
+
childProviderId: string | null;
|
|
33
|
+
piSessionId: string | null;
|
|
34
|
+
lastPiSessionId: string | null;
|
|
35
|
+
sessionFile: string | null;
|
|
36
|
+
workDir: string;
|
|
37
|
+
providerId: string;
|
|
38
|
+
turnActive: boolean;
|
|
39
|
+
turnId: string | null;
|
|
40
|
+
stateVersion: number;
|
|
41
|
+
heartbeatTimer: ReturnType<typeof setInterval> | null;
|
|
42
|
+
model: string | null;
|
|
43
|
+
thinking: PiThinkingLevel | null;
|
|
44
|
+
availableModels: string[];
|
|
45
|
+
sessionNotified: boolean;
|
|
46
|
+
cancelRequested: boolean;
|
|
47
|
+
protocolFailed: boolean;
|
|
48
|
+
stderrBuffer: string;
|
|
49
|
+
pendingRpc: Map<string, PendingRpc>;
|
|
50
|
+
attachmentPaths: Set<string>;
|
|
51
|
+
turnAttachmentPaths: Map<string, Set<string>>;
|
|
52
|
+
lastUsage?: UsageInfo;
|
|
53
|
+
launching: Promise<void> | null;
|
|
54
|
+
setupPromise: Promise<void> | null;
|
|
55
|
+
}
|
|
56
|
+
interface PiSessionPage {
|
|
57
|
+
sessions: SessionInfo[];
|
|
58
|
+
hasMore: boolean;
|
|
59
|
+
nextCursor?: string;
|
|
60
|
+
}
|
|
61
|
+
interface PiGlobalSessionPage {
|
|
62
|
+
sessions: GlobalSessionInfo[];
|
|
63
|
+
hasMore: boolean;
|
|
64
|
+
nextCursor?: string;
|
|
65
|
+
indexState: 'ready';
|
|
66
|
+
}
|
|
67
|
+
export declare function addPiSendFn(fn: SendFn): () => void;
|
|
68
|
+
export declare function getPiConversation(conversationId: string): PiConversationState | undefined;
|
|
69
|
+
export declare function getPiConversations(): Map<string, PiConversationState>;
|
|
70
|
+
export declare function createPiPlaceholder(conversationId: string, options?: {
|
|
71
|
+
providerId?: string;
|
|
72
|
+
workDir?: string;
|
|
73
|
+
}): void;
|
|
74
|
+
export declare function rebindPiConversation(piSessionId: string, newConversationId: string, providerId?: string, workDir?: string): boolean;
|
|
75
|
+
export declare function getPiAvailableModels(providerId?: string): string[];
|
|
76
|
+
export interface PiChatOptions {
|
|
77
|
+
resumeSessionId?: string;
|
|
78
|
+
providerId?: string;
|
|
79
|
+
piOptions?: PiOptions;
|
|
80
|
+
}
|
|
81
|
+
export declare function handlePiChat(conversationId: string, text: string, workDir: string, options?: PiChatOptions, files?: PiChatFile[]): void;
|
|
82
|
+
export declare function cancelPiExecution(conversationId: string): void;
|
|
83
|
+
export declare function cleanupAllPiConversations(): void;
|
|
84
|
+
export declare function restartPiConversation(conversationId: string, options?: {
|
|
85
|
+
providerId?: string;
|
|
86
|
+
}): {
|
|
87
|
+
wasTurnActive: boolean;
|
|
88
|
+
piSessionId: string | null;
|
|
89
|
+
};
|
|
90
|
+
export declare function evictByPiSessionId(piSessionId: string, providerId?: string, workDir?: string): boolean;
|
|
91
|
+
export declare function _resetResolvedPiPathForTests(): void;
|
|
92
|
+
export declare function listPiSessions(workDir: string, providerId?: string): SessionInfo[];
|
|
93
|
+
export declare function listPiSessionsPage(workDir: string, options?: {
|
|
94
|
+
limit?: number;
|
|
95
|
+
cursor?: string;
|
|
96
|
+
providerId?: string;
|
|
97
|
+
}): PiSessionPage;
|
|
98
|
+
export declare function listAllPiSessions(limit?: number, providerId?: string): GlobalSessionInfo[];
|
|
99
|
+
export declare function listAllPiSessionsPage(options?: {
|
|
100
|
+
limit?: number;
|
|
101
|
+
cursor?: string;
|
|
102
|
+
providerId?: string;
|
|
103
|
+
}): PiGlobalSessionPage;
|
|
104
|
+
export declare function getPiSessionWorkDir(sessionId: string, providerId?: string, workDir?: string): string | undefined;
|
|
105
|
+
export declare function readPiSessionMessages(workDir: string, sessionId: string, providerId?: string): HistoryMessage[];
|
|
106
|
+
export declare function renamePiSession(workDir: string, sessionId: string, newTitle: string, providerId?: string): boolean;
|
|
107
|
+
export declare function deletePiSession(workDir: string, sessionId: string, providerId?: string): boolean;
|
|
108
|
+
export declare function movePiSession(fromWorkDir: string, toWorkDir: string, sessionId: string, providerId?: string): boolean;
|
|
109
|
+
export { piCapabilities };
|