@pasko70/pibo 1.7.9 → 1.7.10
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/apps/chat/chat-user-skill-routes.js +10 -13
- package/dist/apps/chat/model-catalog.js +1 -1
- package/dist/apps/chat/trace.js +1 -1
- package/dist/apps/chat/web-app.js +4 -1
- package/dist/auth/login-actions.js +1 -1
- package/dist/auth/openai-codex-usage.js +1 -1
- package/dist/core/compaction-prompt.js +2 -2
- package/dist/core/context-build.js +1 -1
- package/dist/core/context-guard.js +1 -1
- package/dist/core/routed-session.js +1 -1
- package/dist/core/runtime.js +1 -1
- package/dist/gateway/tool.js +2 -2
- package/dist/gateway/web.js +5 -0
- package/dist/local/extension.js +2 -2
- package/dist/pi-packages/metadata.js +1 -1
- package/dist/plugins/chat-user-skills.js +41 -0
- package/dist/providers/glm.js +1 -1
- package/dist/providers/minimax.js +1 -1
- package/dist/providers/openai-gpt56.js +2 -2
- package/dist/ralph/service.js +13 -8
- package/dist/runs/tools.js +2 -2
- package/dist/subagents/tool.js +2 -2
- package/dist/tools/codex-compat.js +2 -2
- package/dist/tools/codex-image-generation.js +3 -3
- package/dist/tools/runtime/tool.js +2 -2
- package/dist/web-annotations/tools.js +2 -2
- package/package.json +5 -3
- package/skills/builtin/pi-agent-harness/SKILL.md +1 -1
- package/dist/apps/vscode-artifacts/latest.vsix +0 -0
- package/dist/apps/vscode-artifacts/pibo-vscode-ext-1.7.9.vsix +0 -0
|
@@ -40,7 +40,10 @@ export function syncChatUserSkills(options) {
|
|
|
40
40
|
enabledSkillByName.set(skill.name, skill);
|
|
41
41
|
}
|
|
42
42
|
const enabledNames = new Set(enabledSkillByName.keys());
|
|
43
|
-
const syncedNames =
|
|
43
|
+
const syncedNames = new Set([
|
|
44
|
+
...catalogSkills.filter((skill) => skill.kind === "user").map((skill) => skill.name),
|
|
45
|
+
...(previouslySyncedNames ?? []),
|
|
46
|
+
]);
|
|
44
47
|
// Unregister disabled, removed, or now built-in user skills. Avoid removing a
|
|
45
48
|
// built-in/plugin skill if a promoted user skill has the same name.
|
|
46
49
|
for (const name of syncedNames) {
|
|
@@ -59,16 +62,15 @@ export function syncChatUserSkills(options) {
|
|
|
59
62
|
unregisterSkill(skill.name);
|
|
60
63
|
registerSkill({ name: skill.name, path: skill.path, enabled: true, kind: "user" });
|
|
61
64
|
}
|
|
62
|
-
else if (!
|
|
65
|
+
else if (!catalogSkill) {
|
|
63
66
|
registerSkill({ name: skill.name, path: skill.path, enabled: true, kind: "user" });
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
setSyncedUserSkillNames(enabledNames);
|
|
67
70
|
}
|
|
68
71
|
function assertUserSkillNameIsAvailable(options) {
|
|
69
|
-
const {
|
|
70
|
-
const
|
|
71
|
-
const conflict = (channelContext.getCapabilityCatalog?.().skills ?? []).find((skill) => (skill.name === name && skill.kind !== "user" && (!currentSkill || currentSkill.name !== name)));
|
|
72
|
+
const { channelContext, name } = options;
|
|
73
|
+
const conflict = (channelContext.getCapabilityCatalog?.().skills ?? []).find((skill) => (skill.name === name && skill.kind !== "user"));
|
|
72
74
|
if (conflict) {
|
|
73
75
|
throw new PiboWebHttpError(`Skill name "${name}" conflicts with an existing registered skill`, 409);
|
|
74
76
|
}
|
|
@@ -105,7 +107,7 @@ export async function handleChatUserSkillRoute(options) {
|
|
|
105
107
|
const body = await readJsonBody(request);
|
|
106
108
|
const scope = bodyScope(body);
|
|
107
109
|
const name = normalizeUserSkillName(body.name);
|
|
108
|
-
assertUserSkillNameIsAvailable({
|
|
110
|
+
assertUserSkillNameIsAvailable({ channelContext, name });
|
|
109
111
|
const skill = userSkillManager.create({
|
|
110
112
|
name,
|
|
111
113
|
description: normalizeUserSkillDescription(body.description ?? ""),
|
|
@@ -119,7 +121,7 @@ export async function handleChatUserSkillRoute(options) {
|
|
|
119
121
|
const scope = bodyScope(body);
|
|
120
122
|
const skill = await userSkillManager.installFromUrl(normalizeUserSkillUrl(body.url), scope);
|
|
121
123
|
try {
|
|
122
|
-
assertUserSkillNameIsAvailable({
|
|
124
|
+
assertUserSkillNameIsAvailable({ channelContext, name: skill.name });
|
|
123
125
|
}
|
|
124
126
|
catch (error) {
|
|
125
127
|
userSkillManager.remove(skill.id, scope);
|
|
@@ -157,12 +159,7 @@ export async function handleChatUserSkillRoute(options) {
|
|
|
157
159
|
const nextName = input.name ?? existing.name;
|
|
158
160
|
const nextEnabled = input.enabled ?? existing.enabled;
|
|
159
161
|
if (nextEnabled) {
|
|
160
|
-
assertUserSkillNameIsAvailable({
|
|
161
|
-
userSkillManager,
|
|
162
|
-
channelContext,
|
|
163
|
-
name: nextName,
|
|
164
|
-
currentSkillId: existing.id,
|
|
165
|
-
});
|
|
162
|
+
assertUserSkillNameIsAvailable({ channelContext, name: nextName });
|
|
166
163
|
}
|
|
167
164
|
const skill = userSkillManager.update(existing.id, input, scope);
|
|
168
165
|
syncAndInvalidate(options);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createAgentSessionServices } from "@
|
|
1
|
+
import { createAgentSessionServices } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { registerMiniMaxProvider } from "../../providers/minimax.js";
|
|
3
3
|
import { registerGlmProvider } from "../../providers/glm.js";
|
|
4
4
|
import { registerOpenAiGpt56Models } from "../../providers/openai-gpt56.js";
|
package/dist/apps/chat/trace.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { closeSync, existsSync, openSync, readFileSync, readSync, readdirSync, statSync } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
import { parseSessionEntries, SessionManager } from "@
|
|
5
|
+
import { parseSessionEntries, SessionManager } from "@earendil-works/pi-coding-agent";
|
|
6
6
|
import { buildTraceViewFromEvents } from "../../shared/trace-engine.js";
|
|
7
7
|
import { isChatWebSessionArchived } from "./session-metadata.js";
|
|
8
8
|
import { workflowSessionKindFromMetadata } from "../../sessions/workflow-session-kind.js";
|
|
@@ -3029,7 +3029,10 @@ export function createChatWebApp(options = {}) {
|
|
|
3029
3029
|
persistenceMetrics: createPersistenceMetrics(),
|
|
3030
3030
|
resourceMetrics: createResourceMetrics(),
|
|
3031
3031
|
eventLoopDelay,
|
|
3032
|
-
userSkillManager: new ScopedUserSkillManager({
|
|
3032
|
+
userSkillManager: new ScopedUserSkillManager({
|
|
3033
|
+
globalRoot: options.userSkillGlobalRoot ?? os.homedir(),
|
|
3034
|
+
workspaceRoot: options.userSkillWorkspaceRoot ?? process.cwd(),
|
|
3035
|
+
}),
|
|
3033
3036
|
workflowDraftStore: new ChatWorkflowDraftStore(dataStore),
|
|
3034
3037
|
workflowPublishedVersionStore: new ChatWorkflowPublishedVersionStore(dataStore),
|
|
3035
3038
|
workflowArchiveStore: new ChatWorkflowArchiveStore(dataStore),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthStorage } from "@
|
|
1
|
+
import { AuthStorage } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { randomBytes } from "node:crypto";
|
|
3
3
|
const OPENAI_CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann";
|
|
4
4
|
const OPENAI_AUTHORIZE_URL = "https://auth.openai.com/oauth/authorize";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthStorage } from "@
|
|
1
|
+
import { AuthStorage } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
const OPENAI_CODEX_PROVIDER = "openai-codex";
|
|
3
3
|
const OPENAI_CODEX_USAGE_URL = "https://chatgpt.com/backend-api/wham/usage";
|
|
4
4
|
const OPENAI_JWT_CLAIM_PATH = "https://api.openai.com/auth";
|
|
@@ -2,8 +2,8 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { readFile, writeFile } from "node:fs/promises";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { completeSimple } from "@
|
|
6
|
-
import { buildSessionContext, convertToLlm, serializeConversation, } from "@
|
|
5
|
+
import { completeSimple } from "@earendil-works/pi-ai/compat";
|
|
6
|
+
import { buildSessionContext, convertToLlm, serializeConversation, } from "@earendil-works/pi-coding-agent";
|
|
7
7
|
const PROJECT_ROOT = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
|
|
8
8
|
export const PIBO_LIBRARY_COMPACTION_PROMPT_PATH = resolve(PROJECT_ROOT, "context/pibo-compaction-prompt.md");
|
|
9
9
|
function getCompactionPromptStatePath(cwd) {
|
|
@@ -244,7 +244,7 @@ async function readSkillMarkdown(path) {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
// Skills are advertised to the model via a small XML summary in the system
|
|
247
|
-
// prompt (see formatSkillsForPrompt in @
|
|
247
|
+
// prompt (see formatSkillsForPrompt in @earendil-works/pi-coding-agent). Only the
|
|
248
248
|
// name, description, and location land in the prompt; the full SKILL.md body
|
|
249
249
|
// is loaded lazily by the model via the read tool. Mirror that exact
|
|
250
250
|
// per-skill entry shape here so the inspector's token estimate matches what
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_COMPACTION_SETTINGS, buildSessionContext, estimateTokens, } from "@
|
|
1
|
+
import { DEFAULT_COMPACTION_SETTINGS, buildSessionContext, estimateTokens, } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
export const PIBO_CONTEXT_GUARD_NOTICE = "Context safety interrupted this response before adding it to long-term context. Pibo is compacting the session before continuing.";
|
|
3
3
|
const DEFAULT_MIN_COMPACTION_RESERVE_TOKENS = 1024;
|
|
4
4
|
const FALLBACK_CONTEXT_WINDOW = 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SessionManager, shouldCompact } from "@
|
|
1
|
+
import { SessionManager, shouldCompact } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { getOpenAiCodexProviderUsageForActiveModel } from "../auth/openai-codex-usage.js";
|
|
3
3
|
import { normalizeSessionErrorDetails, runtimeSessionErrorDetails } from "./session-errors.js";
|
|
4
4
|
import { expandInlineSkills } from "./skill-expansion.js";
|
package/dist/core/runtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import { isAbsolute, resolve } from "node:path";
|
|
3
|
-
import { AuthStorage, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createBashToolDefinition, getAgentDir, InteractiveMode, SessionManager, } from "@
|
|
3
|
+
import { AuthStorage, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createBashToolDefinition, getAgentDir, InteractiveMode, SessionManager, } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
import { DEFAULT_BUILTIN_TOOL_NAMES, InitialSessionContext, } from "./profiles.js";
|
|
5
5
|
import { loadPiboModelDefaults, selectRequestedModelProfile, selectRequestedThinkingLevel } from "./model-defaults.js";
|
|
6
6
|
import { createDefaultPiboProfile } from "../plugins/builtin.js";
|
package/dist/gateway/tool.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Type } from "@
|
|
2
|
-
import { defineTool } from "@
|
|
1
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
2
|
+
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { sendGatewayMessageAndWaitForReply } from "./request.js";
|
|
4
4
|
export function createPiboGatewaySendTool(sendGatewayMessage = sendGatewayMessageAndWaitForReply) {
|
|
5
5
|
return defineTool({
|
package/dist/gateway/web.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createDefaultPiboPlugins } from "../plugins/builtin.js";
|
|
2
2
|
import { createPiboBetterAuthPlugin } from "../plugins/better-auth.js";
|
|
3
3
|
import { createPiboChatCustomAgentProfilesPlugin } from "../plugins/chat-custom-agents.js";
|
|
4
|
+
import { createPiboChatUserSkillsPlugin } from "../plugins/chat-user-skills.js";
|
|
4
5
|
import { createPiboChatWebPlugin } from "../plugins/chat-web.js";
|
|
5
6
|
import { createPiboChatVscodeWebPlugin } from "../plugins/chat-vscode-web.js";
|
|
6
7
|
import { createPiboContextFilesPlugin } from "../plugins/context-files.js";
|
|
@@ -145,6 +146,10 @@ export function createWebPiboPluginRegistry(options = {}) {
|
|
|
145
146
|
useDevAuth ? createPiboDevAuthPlugin() : createPiboBetterAuthPlugin(resolvedOptions.auth),
|
|
146
147
|
createPiboWebHostPlugin({ announce: false, canonicalBaseURL: useDevAuth ? undefined : authBaseURL(resolvedOptions), gatewayMode: webGatewayMode(resolvedOptions, useDevAuth), ...resolvedOptions.web }),
|
|
147
148
|
createPiboCronPlugin({ cronStorePath: resolvedOptions.chat?.cronStorePath, dataStorePath: resolvedOptions.chat?.dataStorePath, dataPayloadRootDir: resolvedOptions.chat?.dataPayloadRootDir }),
|
|
149
|
+
createPiboChatUserSkillsPlugin({
|
|
150
|
+
globalRoot: resolvedOptions.chat?.userSkillGlobalRoot,
|
|
151
|
+
workspaceRoot: resolvedOptions.chat?.userSkillWorkspaceRoot,
|
|
152
|
+
}),
|
|
148
153
|
createPiboChatCustomAgentProfilesPlugin({ agentStorePath: resolvedOptions.chat?.agentStorePath }),
|
|
149
154
|
createPiboRalphPlugin({ ralphStorePath: resolvedOptions.chat?.ralphStorePath, dataStorePath: resolvedOptions.chat?.dataStorePath, dataPayloadRootDir: resolvedOptions.chat?.dataPayloadRootDir }),
|
|
150
155
|
createPiboContextFilesPlugin(resolvedOptions.contextFiles),
|
package/dist/local/extension.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AssistantMessageComponent, ToolExecutionComponent, UserMessageComponent, } from "@
|
|
2
|
-
import { Container, Spacer } from "@
|
|
1
|
+
import { AssistantMessageComponent, ToolExecutionComponent, UserMessageComponent, } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { Container, Spacer } from "@earendil-works/pi-tui";
|
|
3
3
|
import { parsePiboThinkingLevel } from "../core/thinking.js";
|
|
4
4
|
const LOCAL_MESSAGE_TYPE = "pibo.local-routed";
|
|
5
5
|
const STREAMING_WIDGET_KEY = "pibo.local.streaming";
|
|
@@ -2,7 +2,7 @@ import { execFile } from "node:child_process";
|
|
|
2
2
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
3
3
|
import { basename, extname, resolve } from "node:path";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
|
-
import { DefaultPackageManager, getAgentDir, SettingsManager, } from "@
|
|
5
|
+
import { DefaultPackageManager, getAgentDir, SettingsManager, } from "@earendil-works/pi-coding-agent";
|
|
6
6
|
import { installOrResolvePiPackage } from "./installer.js";
|
|
7
7
|
const execFileAsync = promisify(execFile);
|
|
8
8
|
export async function inspectPiPackageSource(source, cwd = process.cwd()) {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import os from "node:os";
|
|
2
|
+
import { ScopedUserSkillManager } from "../user-skills/manager.js";
|
|
3
|
+
import { definePiboPlugin } from "./registry.js";
|
|
4
|
+
export function createPiboChatUserSkillsPlugin(options = {}) {
|
|
5
|
+
return definePiboPlugin({
|
|
6
|
+
id: "pibo.chat-user-skills",
|
|
7
|
+
name: "Pibo Chat User Skills",
|
|
8
|
+
register(api) {
|
|
9
|
+
const manager = new ScopedUserSkillManager({
|
|
10
|
+
globalRoot: options.globalRoot ?? os.homedir(),
|
|
11
|
+
workspaceRoot: options.workspaceRoot ?? process.cwd(),
|
|
12
|
+
});
|
|
13
|
+
const userSkills = [];
|
|
14
|
+
for (const [scope, scopedManager] of [["global", manager.global], ["workspace", manager.workspace]]) {
|
|
15
|
+
try {
|
|
16
|
+
userSkills.push(...scopedManager.list());
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
console.warn(`[pibo] Skipping ${scope} startup user-skill registration: ${error instanceof Error ? error.message : String(error)}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const enabledSkillByName = new Map();
|
|
23
|
+
for (const skill of userSkills) {
|
|
24
|
+
if (!skill.enabled)
|
|
25
|
+
continue;
|
|
26
|
+
const existing = enabledSkillByName.get(skill.name);
|
|
27
|
+
if (!existing || skill.scope === "workspace")
|
|
28
|
+
enabledSkillByName.set(skill.name, skill);
|
|
29
|
+
}
|
|
30
|
+
for (const skill of enabledSkillByName.values()) {
|
|
31
|
+
try {
|
|
32
|
+
api.registerSkill({ name: skill.name, path: skill.path, enabled: true, kind: "user" });
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (!(error instanceof Error) || error.message !== `Duplicate skill "${skill.name}"`)
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
package/dist/providers/glm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getModels } from "@
|
|
1
|
+
import { getModels } from "@earendil-works/pi-ai/compat";
|
|
2
2
|
import { OPENAI_COMPLETIONS_API, registerOpenAiCompatProvider, resetOpenAiCompatProviderRegistration, unregisterOpenAiCompatProvider, } from "./openai-compat.js";
|
|
3
3
|
export const GLM_PROVIDER_ID = "glm";
|
|
4
4
|
export const GLM_DEFAULT_BASE_URL = "https://api.z.ai/api/coding/paas/v4";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getModels } from "@
|
|
1
|
+
import { getModels } from "@earendil-works/pi-ai/compat";
|
|
2
2
|
import { OPENAI_COMPLETIONS_API, registerOpenAiCompatProvider, resetOpenAiCompatProviderRegistration, unregisterOpenAiCompatProvider, } from "./openai-compat.js";
|
|
3
3
|
export const MINIMAX_PROVIDER_ID = "minimax";
|
|
4
4
|
export const MINIMAX_CN_PROVIDER_ID = "minimax-cn";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getModels } from "@
|
|
2
|
-
import { getOAuthProvider } from "@
|
|
1
|
+
import { getModels } from "@earendil-works/pi-ai/compat";
|
|
2
|
+
import { getOAuthProvider } from "@earendil-works/pi-ai/oauth";
|
|
3
3
|
export const OPENAI_PROVIDER_ID = "openai";
|
|
4
4
|
export const OPENAI_RESPONSES_API = "openai-responses";
|
|
5
5
|
export const OPENAI_BASE_URL = "https://api.openai.com/v1";
|
package/dist/ralph/service.js
CHANGED
|
@@ -48,7 +48,7 @@ export class PiboRalphService {
|
|
|
48
48
|
this.roomService = new ChatRoomService(this.dataStore);
|
|
49
49
|
this.intervalMs = options.intervalMs ?? 5_000;
|
|
50
50
|
this.maxConcurrentRuns = Math.max(1, options.maxConcurrentRuns ?? 2);
|
|
51
|
-
this.runTimeoutMs = options.runTimeoutMs
|
|
51
|
+
this.runTimeoutMs = options.runTimeoutMs;
|
|
52
52
|
}
|
|
53
53
|
start() { if (!this.stopped)
|
|
54
54
|
return; this.stopped = false; this.store.recoverInterruptedRuns(); this.unsubscribeProductEvents = this.options.context.subscribeProductEvents?.((event) => this.handleProductEvent(event)); this.arm(250); }
|
|
@@ -256,18 +256,23 @@ export class PiboRalphService {
|
|
|
256
256
|
} const room = this.roomService.ensureDefaultRoom({ name: 'Shared Chat' }); return { roomId: room.id, workspace: room.workspace ?? getDefaultPiboWorkspace() }; }
|
|
257
257
|
async emitMessageAndWait(piboSessionId, text, options = {}) {
|
|
258
258
|
const eventId = `ralph_msg_${randomUUID()}`;
|
|
259
|
-
return await new Promise((resolve, reject) => { let settled = false; let deltaAnswer = ''; let finalAnswer = ''; let lastSessionError; let unsubscribe;
|
|
260
|
-
return; settled = true;
|
|
259
|
+
return await new Promise((resolve, reject) => { let settled = false; let deltaAnswer = ''; let finalAnswer = ''; let lastSessionError; let unsubscribe; let timeout; const finish = (error) => { if (settled)
|
|
260
|
+
return; settled = true; if (timeout)
|
|
261
|
+
clearTimeout(timeout); unsubscribe?.(); if (error)
|
|
261
262
|
reject(error);
|
|
262
263
|
else
|
|
263
|
-
resolve(finalAnswer || deltaAnswer); };
|
|
264
|
+
resolve(finalAnswer || deltaAnswer); }; if (this.runTimeoutMs !== undefined)
|
|
265
|
+
timeout = setTimeout(() => finish(new Error(lastSessionError ? `Ralph run timed out after session error: ${lastSessionError}` : 'Ralph run timed out')), this.runTimeoutMs); unsubscribe = this.options.context.subscribe((event) => { if (event.piboSessionId !== piboSessionId)
|
|
264
266
|
return; if ('eventId' in event && event.eventId !== eventId)
|
|
265
267
|
return; if (event.type === 'assistant_delta')
|
|
266
|
-
deltaAnswer += event.text; if (event.type === 'assistant_message')
|
|
267
|
-
finalAnswer = event.text;
|
|
268
|
-
|
|
268
|
+
deltaAnswer += event.text; if (event.type === 'assistant_message') {
|
|
269
|
+
finalAnswer = event.text;
|
|
270
|
+
lastSessionError = undefined;
|
|
271
|
+
} if (event.type === 'message_finished')
|
|
272
|
+
finish(lastSessionError ? new Error(lastSessionError) : undefined); if (event.type === 'session_error') {
|
|
269
273
|
lastSessionError = event.error;
|
|
270
|
-
|
|
274
|
+
const providerAttempt = event.errorDetails?.origin === 'provider' && Boolean(event.errorDetails.api || event.errorDetails.provider || event.errorDetails.model);
|
|
275
|
+
if (!providerAttempt || options.isCancelled?.())
|
|
271
276
|
finish(new Error(event.error));
|
|
272
277
|
} }); this.options.context.emit({ type: 'message', piboSessionId, id: eventId, source: 'service', text }).catch((error) => finish(error instanceof Error ? error : new Error(String(error)))); });
|
|
273
278
|
}
|
package/dist/runs/tools.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StringEnum, Type } from "@
|
|
2
|
-
import { defineTool } from "@
|
|
1
|
+
import { StringEnum, Type } from "@earendil-works/pi-ai";
|
|
2
|
+
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
function resultText(prefix, value) {
|
|
4
4
|
return `${prefix}\n${JSON.stringify(value, null, 2)}`;
|
|
5
5
|
}
|
package/dist/subagents/tool.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { Type } from "@
|
|
3
|
-
import { defineTool } from "@
|
|
2
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
3
|
+
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
function hashPart(value) {
|
|
5
5
|
return createHash("sha256").update(value).digest("hex").slice(0, 12);
|
|
6
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { extname, isAbsolute, resolve } from "node:path";
|
|
4
|
-
import { StringEnum, Type } from "@
|
|
5
|
-
import { defineTool } from "@
|
|
4
|
+
import { StringEnum, Type } from "@earendil-works/pi-ai";
|
|
5
|
+
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
6
6
|
function resolveCwd(baseCwd, workdir) {
|
|
7
7
|
if (!workdir || workdir.trim().length === 0)
|
|
8
8
|
return baseCwd;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
2
|
import { platform, release, arch } from "node:os";
|
|
3
3
|
import { dirname, extname, isAbsolute, join, resolve } from "node:path";
|
|
4
|
-
import { AuthStorage } from "@
|
|
5
|
-
import { Type } from "@
|
|
6
|
-
import { defineTool } from "@
|
|
4
|
+
import { AuthStorage } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
6
|
+
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
7
7
|
import { getPiboHome } from "../core/pibo-home.js";
|
|
8
8
|
const OPENAI_CODEX_PROVIDER = "openai-codex";
|
|
9
9
|
const DEFAULT_CODEX_BACKEND_BASE_URL = "https://chatgpt.com/backend-api";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StringEnum, Type } from "@
|
|
2
|
-
import { defineTool } from "@
|
|
1
|
+
import { StringEnum, Type } from "@earendil-works/pi-ai";
|
|
2
|
+
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
export function createRuntimeToolProfile() {
|
|
4
4
|
return {
|
|
5
5
|
name: "runtime",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StringEnum, Type } from "@
|
|
2
|
-
import { defineTool } from "@
|
|
1
|
+
import { StringEnum, Type } from "@earendil-works/pi-ai";
|
|
2
|
+
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { WEB_ANNOTATION_STATUSES, } from "./types.js";
|
|
4
4
|
import { createDefaultWebAnnotationStore } from "./store.js";
|
|
5
5
|
import { assertWebAnnotationStatusTransition, sanitizeWebAnnotationText, WEB_ANNOTATION_LIMITS } from "./validation.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pasko70/pibo",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"vscode": "./src/apps/chat-vscode/extension/src/vscode-shim.js"
|
|
@@ -52,8 +52,10 @@
|
|
|
52
52
|
"prepack": "npm run build"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
55
|
+
"@earendil-works/pi-agent-core": "^0.80.6",
|
|
56
|
+
"@earendil-works/pi-ai": "^0.80.6",
|
|
57
|
+
"@earendil-works/pi-coding-agent": "^0.80.6",
|
|
58
|
+
"@earendil-works/pi-tui": "^0.80.6",
|
|
57
59
|
"@mdxeditor/editor": "^3.55.0",
|
|
58
60
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
59
61
|
"@tailwindcss/vite": "^4.2.4",
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
DefaultResourceLoader,
|
|
91
91
|
SessionManager,
|
|
92
92
|
SettingsManager,
|
|
93
|
-
} from "@
|
|
93
|
+
} from "@earendil-works/pi-coding-agent";
|
|
94
94
|
|
|
95
95
|
const sessionManager = SessionManager.open(sessionFile, sessionDir, workspaceDir);
|
|
96
96
|
const settingsManager = SettingsManager.create(workspaceDir, agentDir);
|
|
Binary file
|
|
Binary file
|