@chaotic1988/pi-subagent 0.2.0 → 0.2.1
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/index.ts +1 -5
- package/package.json +4 -2
- package/runner.ts +0 -6
- package/vitest.config.ts +1 -15
package/index.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
import * as os from "node:os";
|
|
15
15
|
import type { Message } from "@earendil-works/pi-ai";
|
|
16
|
-
import {
|
|
16
|
+
import { type ExtensionAPI, getMarkdownTheme } from "@earendil-works/pi-coding-agent";
|
|
17
17
|
import { Container, Markdown, Spacer, Text } from "@earendil-works/pi-tui";
|
|
18
18
|
import { Type } from "typebox";
|
|
19
19
|
import { type AgentConfig, discoverAgents, formatAgentList } from "./agent.js";
|
|
@@ -201,11 +201,9 @@ function buildDescription(agents: AgentConfig[]): string {
|
|
|
201
201
|
|
|
202
202
|
export default function (pi: ExtensionAPI) {
|
|
203
203
|
let cachedAgents: AgentConfig[] = [];
|
|
204
|
-
let authStorage: AuthStorage;
|
|
205
204
|
|
|
206
205
|
pi.on("session_start", async (_event, ctx) => {
|
|
207
206
|
cachedAgents = discoverAgents(ctx);
|
|
208
|
-
authStorage = AuthStorage.create();
|
|
209
207
|
|
|
210
208
|
pi.registerCommand("agents", {
|
|
211
209
|
description: "List available agents",
|
|
@@ -272,7 +270,6 @@ export default function (pi: ExtensionAPI) {
|
|
|
272
270
|
agents,
|
|
273
271
|
params.tasks,
|
|
274
272
|
ctx.modelRegistry,
|
|
275
|
-
authStorage,
|
|
276
273
|
signal,
|
|
277
274
|
(allResults) => {
|
|
278
275
|
if (!onUpdate) return;
|
|
@@ -328,7 +325,6 @@ export default function (pi: ExtensionAPI) {
|
|
|
328
325
|
params.task,
|
|
329
326
|
params.cwd ?? ctx.cwd,
|
|
330
327
|
ctx.modelRegistry,
|
|
331
|
-
authStorage,
|
|
332
328
|
signal,
|
|
333
329
|
onUpdate
|
|
334
330
|
? (partial) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaotic1988/pi-subagent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"pi-package"
|
|
6
6
|
],
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"test": "vitest run"
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"typecheck": "tsc --noEmit"
|
|
17
18
|
},
|
|
18
19
|
"peerDependencies": {
|
|
19
20
|
"@earendil-works/pi-agent-core": "*",
|
|
@@ -23,6 +24,7 @@
|
|
|
23
24
|
"typebox": "*"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
27
|
+
"@earendil-works/pi-coding-agent": "^0.80.10",
|
|
26
28
|
"@types/node": "^22",
|
|
27
29
|
"typescript": "^6.0.3",
|
|
28
30
|
"vitest": "^4.1.0"
|
package/runner.ts
CHANGED
|
@@ -9,7 +9,6 @@ import type { Message, Model, Api } from "@earendil-works/pi-ai";
|
|
|
9
9
|
import type { ThinkingLevel } from "@earendil-works/pi-agent-core";
|
|
10
10
|
import {
|
|
11
11
|
type AgentSessionEvent,
|
|
12
|
-
AuthStorage,
|
|
13
12
|
createAgentSession,
|
|
14
13
|
DefaultResourceLoader,
|
|
15
14
|
getAgentDir,
|
|
@@ -119,7 +118,6 @@ export async function runAgent(
|
|
|
119
118
|
task: string,
|
|
120
119
|
cwd: string,
|
|
121
120
|
modelRegistry: ModelRegistry,
|
|
122
|
-
authStorage: AuthStorage,
|
|
123
121
|
signal?: AbortSignal,
|
|
124
122
|
onUpdate?: OnUpdateCallback,
|
|
125
123
|
): Promise<SingleResult> {
|
|
@@ -159,8 +157,6 @@ export async function runAgent(
|
|
|
159
157
|
tools: agent.tools,
|
|
160
158
|
resourceLoader: loader,
|
|
161
159
|
sessionManager: SessionManager.create(cwd),
|
|
162
|
-
authStorage,
|
|
163
|
-
modelRegistry,
|
|
164
160
|
settingsManager: SettingsManager.inMemory({ compaction: { enabled: false } }),
|
|
165
161
|
});
|
|
166
162
|
session = createdSession;
|
|
@@ -240,7 +236,6 @@ export async function runParallel(
|
|
|
240
236
|
agents: AgentConfig[],
|
|
241
237
|
tasks: Array<{ agent: string; task: string; cwd?: string }>,
|
|
242
238
|
modelRegistry: ModelRegistry,
|
|
243
|
-
authStorage: AuthStorage,
|
|
244
239
|
signal?: AbortSignal,
|
|
245
240
|
onUpdate?: (results: SingleResult[]) => void,
|
|
246
241
|
): Promise<SingleResult[]> {
|
|
@@ -279,7 +274,6 @@ export async function runParallel(
|
|
|
279
274
|
t.task,
|
|
280
275
|
t.cwd ?? cwd,
|
|
281
276
|
modelRegistry,
|
|
282
|
-
authStorage,
|
|
283
277
|
signal,
|
|
284
278
|
(partial) => {
|
|
285
279
|
allResults[index] = partial;
|
package/vitest.config.ts
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
1
|
import { defineConfig } from "vitest/config";
|
|
2
|
-
import { execSync } from "node:child_process";
|
|
3
|
-
import path from "node:path";
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
const piCodingAgentEntry = path.join(
|
|
7
|
-
globalRoot,
|
|
8
|
-
"@earendil-works/pi-coding-agent/dist/index.js"
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
export default defineConfig({
|
|
12
|
-
resolve: {
|
|
13
|
-
alias: {
|
|
14
|
-
"@earendil-works/pi-coding-agent": piCodingAgentEntry,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
});
|
|
3
|
+
export default defineConfig({});
|