pi-gentic 0.1.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.
- package/README.md +499 -0
- package/dist/commands.d.ts +93 -0
- package/dist/commands.js +422 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.js +407 -0
- package/dist/core.d.ts +19 -0
- package/dist/core.js +125 -0
- package/dist/extension.d.ts +2 -0
- package/dist/extension.js +476 -0
- package/dist/orchestrator.d.ts +277 -0
- package/dist/orchestrator.js +633 -0
- package/dist/policy.d.ts +43 -0
- package/dist/policy.js +136 -0
- package/dist/prompt.d.ts +12 -0
- package/dist/prompt.js +226 -0
- package/dist/runs.d.ts +99 -0
- package/dist/runs.js +540 -0
- package/dist/runtime.d.ts +127 -0
- package/dist/runtime.js +360 -0
- package/dist/sessions.d.ts +56 -0
- package/dist/sessions.js +487 -0
- package/dist/ui.d.ts +108 -0
- package/dist/ui.js +957 -0
- package/dist/worktrees.d.ts +1 -0
- package/dist/worktrees.js +86 -0
- package/docs/assets/error-card.png +0 -0
- package/docs/assets/load-agent.png +0 -0
- package/docs/assets/orchestration-tree.png +0 -0
- package/docs/assets/send-background.png +0 -0
- package/docs/assets/send-foreground.png +0 -0
- package/package.json +58 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/** Main application service used by commands, shortcuts, events, and tools. */
|
|
2
|
+
export declare class PiGenticOrchestrator {
|
|
3
|
+
pi: PiApi;
|
|
4
|
+
currentAgentName?: string;
|
|
5
|
+
constructor(pi: PiApi);
|
|
6
|
+
load(ctx: any): {
|
|
7
|
+
settings: {
|
|
8
|
+
agentDefinitions: AnyRecord[];
|
|
9
|
+
agentlessSession: {};
|
|
10
|
+
agentDefaults: {};
|
|
11
|
+
globalMaxSubagentDepth: number;
|
|
12
|
+
};
|
|
13
|
+
agents: AnyRecord[];
|
|
14
|
+
diagnostics: AnyRecord[];
|
|
15
|
+
roots: string[];
|
|
16
|
+
};
|
|
17
|
+
getActiveAgent(ctx: any, config?: {
|
|
18
|
+
settings: {
|
|
19
|
+
agentDefinitions: AnyRecord[];
|
|
20
|
+
agentlessSession: {};
|
|
21
|
+
agentDefaults: {};
|
|
22
|
+
globalMaxSubagentDepth: number;
|
|
23
|
+
};
|
|
24
|
+
agents: AnyRecord[];
|
|
25
|
+
diagnostics: AnyRecord[];
|
|
26
|
+
roots: string[];
|
|
27
|
+
}): AnyRecord;
|
|
28
|
+
resolvePolicy(ctx: PiContext, config?: AnyRecord, state?: {
|
|
29
|
+
agentName: any;
|
|
30
|
+
overrides: any;
|
|
31
|
+
}, resources?: AnyRecord): {
|
|
32
|
+
agentName: any;
|
|
33
|
+
description: any;
|
|
34
|
+
instructions: any;
|
|
35
|
+
model: any;
|
|
36
|
+
thinking: any;
|
|
37
|
+
theme: any;
|
|
38
|
+
maxSubagentDepth: any;
|
|
39
|
+
agentsTool: any;
|
|
40
|
+
systemPromptFiles: string[];
|
|
41
|
+
resources: {
|
|
42
|
+
agents: string[];
|
|
43
|
+
tools: string[];
|
|
44
|
+
skills: string[];
|
|
45
|
+
};
|
|
46
|
+
recipe: {
|
|
47
|
+
agentReference: any;
|
|
48
|
+
overrides: any;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
availableAgents(ctx: PiContext, config?: AnyRecord): AnyRecord[];
|
|
52
|
+
assertAgentAvailable(ctx: PiContext, agentName: unknown, config?: AnyRecord): AnyRecord;
|
|
53
|
+
/** Applies the current session policy to Pi tools, model, thinking, theme, and labels. */
|
|
54
|
+
applyCurrentPolicy(ctx: PiContext, options?: AnyRecord): Promise<{
|
|
55
|
+
config: {
|
|
56
|
+
settings: {
|
|
57
|
+
agentDefinitions: AnyRecord[];
|
|
58
|
+
agentlessSession: {};
|
|
59
|
+
agentDefaults: {};
|
|
60
|
+
globalMaxSubagentDepth: number;
|
|
61
|
+
};
|
|
62
|
+
agents: AnyRecord[];
|
|
63
|
+
diagnostics: AnyRecord[];
|
|
64
|
+
roots: string[];
|
|
65
|
+
};
|
|
66
|
+
policy: {
|
|
67
|
+
agentName: any;
|
|
68
|
+
description: any;
|
|
69
|
+
instructions: any;
|
|
70
|
+
model: any;
|
|
71
|
+
thinking: any;
|
|
72
|
+
theme: any;
|
|
73
|
+
maxSubagentDepth: any;
|
|
74
|
+
agentsTool: any;
|
|
75
|
+
systemPromptFiles: string[];
|
|
76
|
+
resources: {
|
|
77
|
+
agents: string[];
|
|
78
|
+
tools: string[];
|
|
79
|
+
skills: string[];
|
|
80
|
+
};
|
|
81
|
+
recipe: {
|
|
82
|
+
agentReference: any;
|
|
83
|
+
overrides: any;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
}>;
|
|
87
|
+
setTitle(ctx: any, running?: boolean): void;
|
|
88
|
+
setAgentWidget(ctx: any): void;
|
|
89
|
+
buildPromptAppend(ctx: any, event: any): {
|
|
90
|
+
systemPrompt: string;
|
|
91
|
+
};
|
|
92
|
+
applyPolicySnapshot(ctx: PiContext, resources?: AnyRecord): {
|
|
93
|
+
config: {
|
|
94
|
+
settings: {
|
|
95
|
+
agentDefinitions: AnyRecord[];
|
|
96
|
+
agentlessSession: {};
|
|
97
|
+
agentDefaults: {};
|
|
98
|
+
globalMaxSubagentDepth: number;
|
|
99
|
+
};
|
|
100
|
+
agents: AnyRecord[];
|
|
101
|
+
diagnostics: AnyRecord[];
|
|
102
|
+
roots: string[];
|
|
103
|
+
};
|
|
104
|
+
policy: {
|
|
105
|
+
agentName: any;
|
|
106
|
+
description: any;
|
|
107
|
+
instructions: any;
|
|
108
|
+
model: any;
|
|
109
|
+
thinking: any;
|
|
110
|
+
theme: any;
|
|
111
|
+
maxSubagentDepth: any;
|
|
112
|
+
agentsTool: any;
|
|
113
|
+
systemPromptFiles: string[];
|
|
114
|
+
resources: {
|
|
115
|
+
agents: string[];
|
|
116
|
+
tools: string[];
|
|
117
|
+
skills: string[];
|
|
118
|
+
};
|
|
119
|
+
recipe: {
|
|
120
|
+
agentReference: any;
|
|
121
|
+
overrides: any;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
activeAgent: AnyRecord;
|
|
125
|
+
};
|
|
126
|
+
loadDefaultAgent(ctx: any, event: any): Promise<{
|
|
127
|
+
text: string;
|
|
128
|
+
details: {
|
|
129
|
+
kind: any;
|
|
130
|
+
status: any;
|
|
131
|
+
updatedAt: number;
|
|
132
|
+
};
|
|
133
|
+
}>;
|
|
134
|
+
cycleAgent(ctx: any): Promise<{
|
|
135
|
+
text: string;
|
|
136
|
+
details: {
|
|
137
|
+
kind: any;
|
|
138
|
+
status: any;
|
|
139
|
+
updatedAt: number;
|
|
140
|
+
};
|
|
141
|
+
}>;
|
|
142
|
+
/** Stores a handoff in session history, then re-applies the resolved policy. */
|
|
143
|
+
loadAgent(ctx: PiContext, agentName: unknown, options?: AnyRecord): Promise<{
|
|
144
|
+
text: string;
|
|
145
|
+
details: {
|
|
146
|
+
kind: any;
|
|
147
|
+
status: any;
|
|
148
|
+
updatedAt: number;
|
|
149
|
+
};
|
|
150
|
+
}>;
|
|
151
|
+
resolvedPromptForCard(ctx: any, config: any, policy: any, activeAgent: any): string;
|
|
152
|
+
/** Sends one message to a child or existing session and tracks the resulting run. */
|
|
153
|
+
send(ctx: PiContext, input: AnyRecord, callbacks?: AnyRecord): Promise<{
|
|
154
|
+
text: string;
|
|
155
|
+
details: any;
|
|
156
|
+
}>;
|
|
157
|
+
resolveSendCwd(ctx: PiContext, input: AnyRecord): Promise<string>;
|
|
158
|
+
prepareWorktree(ctx: PiContext, input: AnyRecord): Promise<string>;
|
|
159
|
+
resolveTargetSession(ctx: PiContext, input: AnyRecord, config: AnyRecord): Promise<PiRuntimeSession>;
|
|
160
|
+
createChildSession(ctx: PiContext, input: AnyRecord): Promise<PiRuntimeSession>;
|
|
161
|
+
getOrOpenSession(ctx: PiContext, reference: unknown, cwd?: string): Promise<PiRuntimeSession>;
|
|
162
|
+
loadAgentIntoSession(session: PiAgentSession, agentName: string, overrides: unknown, config: AnyRecord, accessContext?: PiContext): Promise<void>;
|
|
163
|
+
applySessionOverrides(session: any, overrides: any, config: any): Promise<{
|
|
164
|
+
agentName: any;
|
|
165
|
+
description: any;
|
|
166
|
+
instructions: any;
|
|
167
|
+
model: any;
|
|
168
|
+
thinking: any;
|
|
169
|
+
theme: any;
|
|
170
|
+
maxSubagentDepth: any;
|
|
171
|
+
agentsTool: any;
|
|
172
|
+
systemPromptFiles: string[];
|
|
173
|
+
resources: {
|
|
174
|
+
agents: string[];
|
|
175
|
+
tools: string[];
|
|
176
|
+
skills: string[];
|
|
177
|
+
};
|
|
178
|
+
recipe: {
|
|
179
|
+
agentReference: any;
|
|
180
|
+
overrides: any;
|
|
181
|
+
};
|
|
182
|
+
}>;
|
|
183
|
+
applyPolicyToAgentSession(session: any, config: any): Promise<{
|
|
184
|
+
agentName: any;
|
|
185
|
+
description: any;
|
|
186
|
+
instructions: any;
|
|
187
|
+
model: any;
|
|
188
|
+
thinking: any;
|
|
189
|
+
theme: any;
|
|
190
|
+
maxSubagentDepth: any;
|
|
191
|
+
agentsTool: any;
|
|
192
|
+
systemPromptFiles: string[];
|
|
193
|
+
resources: {
|
|
194
|
+
agents: string[];
|
|
195
|
+
tools: string[];
|
|
196
|
+
skills: string[];
|
|
197
|
+
};
|
|
198
|
+
recipe: {
|
|
199
|
+
agentReference: any;
|
|
200
|
+
overrides: any;
|
|
201
|
+
};
|
|
202
|
+
}>;
|
|
203
|
+
applyAgentlessPolicyToNewSession(session: any, config: any, inheritedModel: any): Promise<{
|
|
204
|
+
agentName: any;
|
|
205
|
+
description: any;
|
|
206
|
+
instructions: any;
|
|
207
|
+
model: any;
|
|
208
|
+
thinking: any;
|
|
209
|
+
theme: any;
|
|
210
|
+
maxSubagentDepth: any;
|
|
211
|
+
agentsTool: any;
|
|
212
|
+
systemPromptFiles: string[];
|
|
213
|
+
resources: {
|
|
214
|
+
agents: string[];
|
|
215
|
+
tools: string[];
|
|
216
|
+
skills: string[];
|
|
217
|
+
};
|
|
218
|
+
recipe: {
|
|
219
|
+
agentReference: any;
|
|
220
|
+
overrides: any;
|
|
221
|
+
};
|
|
222
|
+
}>;
|
|
223
|
+
resolveAgentSessionPolicy(session: any, config: any): {
|
|
224
|
+
agentName: any;
|
|
225
|
+
description: any;
|
|
226
|
+
instructions: any;
|
|
227
|
+
model: any;
|
|
228
|
+
thinking: any;
|
|
229
|
+
theme: any;
|
|
230
|
+
maxSubagentDepth: any;
|
|
231
|
+
agentsTool: any;
|
|
232
|
+
systemPromptFiles: string[];
|
|
233
|
+
resources: {
|
|
234
|
+
agents: string[];
|
|
235
|
+
tools: string[];
|
|
236
|
+
skills: string[];
|
|
237
|
+
};
|
|
238
|
+
recipe: {
|
|
239
|
+
agentReference: any;
|
|
240
|
+
overrides: any;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
status(ctx: any, sessionId: any): Promise<{
|
|
244
|
+
text: string;
|
|
245
|
+
sessionId: any;
|
|
246
|
+
agentName: any;
|
|
247
|
+
running: boolean;
|
|
248
|
+
state: string;
|
|
249
|
+
pendingMessages: number;
|
|
250
|
+
pendingText: string;
|
|
251
|
+
inactiveMs: number;
|
|
252
|
+
inactiveText: string;
|
|
253
|
+
runningMs: number;
|
|
254
|
+
runningText: string;
|
|
255
|
+
lastActivities: any;
|
|
256
|
+
}>;
|
|
257
|
+
abort(ctx: any, sessionId: any): Promise<string>;
|
|
258
|
+
invokeCallerSession({ callerSessionManager, callerCwd, text, config }: {
|
|
259
|
+
callerSessionManager: any;
|
|
260
|
+
callerCwd: any;
|
|
261
|
+
text: any;
|
|
262
|
+
config: any;
|
|
263
|
+
}): Promise<void>;
|
|
264
|
+
createRuntimeForSessionManager(sessionManager: PiSessionManager, cwd?: string): Promise<PiRuntimeSession>;
|
|
265
|
+
/** Builds the orchestration tree visible to the agents tool and TUI picker. */
|
|
266
|
+
discoverSessions(ctx: any, input: any): Promise<{
|
|
267
|
+
rx: number;
|
|
268
|
+
ry: number;
|
|
269
|
+
sessions: any;
|
|
270
|
+
}>;
|
|
271
|
+
resolveModel(ctx: any, modelName: any): any;
|
|
272
|
+
cardDetails(kind: any, status: any, details?: {}): {
|
|
273
|
+
kind: any;
|
|
274
|
+
status: any;
|
|
275
|
+
updatedAt: number;
|
|
276
|
+
};
|
|
277
|
+
}
|