mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-19 14:55:27 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8dbfedbb54 | ||
|
|
8edccf0503 | ||
|
|
ac633eb096 | ||
|
|
25ff8adf06 | ||
|
|
09a15abb06 | ||
|
|
81fb9c03f6 |
@@ -1,5 +1,26 @@
|
||||
# Changelog
|
||||
|
||||
## 0.16.2 - 2026-11-18
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Collapse turns hiding a finished reply when Claude answers a later background task notification ([#10092](https://github.com/getpaseo/paseo/pull/10092))
|
||||
- Fixed detached worktree commits getting lost when archiving a workspace ([#10009](https://github.com/getpaseo/paseo/pull/10009) by [@ragokan](https://github.com/ragokan))
|
||||
- Fixed Desktop updates leaving an older daemon running when an earlier Desktop session started it ([#10067](https://github.com/getpaseo/paseo/pull/10067))
|
||||
- Fixed daemons losing their Hub connection after execution permissions changed ([#10113](https://github.com/getpaseo/paseo/pull/10113))
|
||||
- Fixed saved hosts disappearing when one stored entry could not be read ([#9847](https://github.com/getpaseo/paseo/pull/9847) by [@ragokan](https://github.com/ragokan))
|
||||
- Fixed worktree creation timing out while scanning large ignored folders that `.worktreeinclude` does not name ([#10020](https://github.com/getpaseo/paseo/pull/10020) by [@mgranderath](https://github.com/mgranderath))
|
||||
- Fixed Steer cancelling a Claude compaction in progress ([#10028](https://github.com/getpaseo/paseo/pull/10028) by [@NightMachinery](https://github.com/NightMachinery))
|
||||
- Fixed agents getting stuck after a second Stop when the provider reused the cancelled turn ID ([#9774](https://github.com/getpaseo/paseo/pull/9774) by [@DAnaeto](https://github.com/DAnaeto))
|
||||
- Fixed Desktop staying blank after its renderer exited unexpectedly ([#10035](https://github.com/getpaseo/paseo/pull/10035))
|
||||
- Fixed failed file downloads taking over the app window on web and Desktop ([#9937](https://github.com/getpaseo/paseo/pull/9937) by [@panta82](https://github.com/panta82))
|
||||
- Fixed Import Session losing its scroll position when you select Load more ([#9974](https://github.com/getpaseo/paseo/pull/9974))
|
||||
- Fixed terminals failing to open when the home filesystem refuses Unix sockets, such as on AFS ([#9214](https://github.com/getpaseo/paseo/pull/9214) by [@bendavid](https://github.com/bendavid))
|
||||
- Fixed timed-out Git watchers repeatedly rescanning large repositories ([#9828](https://github.com/getpaseo/paseo/pull/9828) by [@Spshulem](https://github.com/Spshulem))
|
||||
- Fixed `paseo workspace create --path .` using the local daemon's directory instead of the caller's ([#10010](https://github.com/getpaseo/paseo/pull/10010))
|
||||
- Fixed MCP agent status and list responses omitting background work for idle agents ([#10022](https://github.com/getpaseo/paseo/pull/10022) by [@ortschun](https://github.com/ortschun))
|
||||
- Fixed the thinking selector showing an old level after OMP changes it ([#9841](https://github.com/getpaseo/paseo/pull/9841) by [@dsingal0](https://github.com/dsingal0))
|
||||
|
||||
## 0.16.1 - 2026-11-17
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
# Changelog
|
||||
|
||||
## 0.16.2 - 2026-11-18
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复启用“折叠轮次”时,Claude 回复后续后台任务通知导致上一条已完成的回复被折叠的问题 ([#10092](https://github.com/getpaseo/paseo/pull/10092))
|
||||
- 修复归档工作区时丢失分离 HEAD 的 worktree 提交的问题 ([#10009](https://github.com/getpaseo/paseo/pull/10009),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 修复 Desktop 更新后,由上一次 Desktop 会话启动的旧版 daemon 仍在运行的问题 ([#10067](https://github.com/getpaseo/paseo/pull/10067))
|
||||
- 修复更改执行权限后 daemon 与 Hub 断开连接的问题 ([#10113](https://github.com/getpaseo/paseo/pull/10113))
|
||||
- 修复一条已保存的主机记录无法读取时,其他主机也消失的问题 ([#9847](https://github.com/getpaseo/paseo/pull/9847),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 修复创建 worktree 时,扫描 `.worktreeinclude` 未指定的大型忽略目录导致超时的问题 ([#10020](https://github.com/getpaseo/paseo/pull/10020),贡献者:[@mgranderath](https://github.com/mgranderath))
|
||||
- 修复发送引导消息时取消 Claude 正在进行的上下文压缩的问题 ([#10028](https://github.com/getpaseo/paseo/pull/10028),贡献者:[@NightMachinery](https://github.com/NightMachinery))
|
||||
- 修复 Provider 重用已取消的轮次 ID 时,再次停止导致 Agent 卡住的问题 ([#9774](https://github.com/getpaseo/paseo/pull/9774),贡献者:[@DAnaeto](https://github.com/DAnaeto))
|
||||
- 修复 Desktop 渲染进程意外退出后窗口一直空白的问题 ([#10035](https://github.com/getpaseo/paseo/pull/10035))
|
||||
- 修复 Web 和 Desktop 上文件下载失败时,错误页面占据应用窗口的问题 ([#9937](https://github.com/getpaseo/paseo/pull/9937),贡献者:[@panta82](https://github.com/panta82))
|
||||
- 修复在“导入会话”中选择“加载更多”时丢失滚动位置的问题 ([#9974](https://github.com/getpaseo/paseo/pull/9974))
|
||||
- 修复主目录所在的文件系统拒绝 Unix 套接字时无法打开终端的问题,例如 AFS ([#9214](https://github.com/getpaseo/paseo/pull/9214),贡献者:[@bendavid](https://github.com/bendavid))
|
||||
- 修复 Git 监视器设置超时后反复扫描大型仓库的问题 ([#9828](https://github.com/getpaseo/paseo/pull/9828),贡献者:[@Spshulem](https://github.com/Spshulem))
|
||||
- 修复 `paseo workspace create --path .` 使用本地 daemon 的目录而非命令所在目录的问题 ([#10010](https://github.com/getpaseo/paseo/pull/10010))
|
||||
- 修复针对空闲 Agent 查询 MCP 状态或列表时漏报后台任务的问题 ([#10022](https://github.com/getpaseo/paseo/pull/10022),贡献者:[@ortschun](https://github.com/ortschun))
|
||||
- 修复 OMP 更改思考级别后,选择器仍显示旧级别的问题 ([#9841](https://github.com/getpaseo/paseo/pull/9841),贡献者:[@dsingal0](https://github.com/dsingal0))
|
||||
|
||||
## 0.16.1 - 2026-11-17
|
||||
|
||||
### 修复
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Fixed
|
||||
- Fixed Collapse turns hiding a finished reply when Claude answers a later background task notification
|
||||
- Fixed detached worktree commits getting lost when archiving a workspace
|
||||
- Fixed Desktop updates leaving an older daemon running when an earlier Desktop session started it
|
||||
- Fixed daemons losing their Hub connection after execution permissions changed
|
||||
- Fixed saved hosts disappearing when one stored entry could not be read
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,8 @@
|
||||
Fixed
|
||||
- Fixed Collapse turns hiding a finished reply when Claude answers a later background task notification
|
||||
- Fixed detached worktree commits getting lost when archiving a workspace
|
||||
- Fixed Desktop updates leaving an older daemon running when an earlier Desktop session started it
|
||||
- Fixed daemons losing their Hub connection after execution permissions changed
|
||||
- Fixed saved hosts disappearing when one stored entry could not be read
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,8 @@
|
||||
Fixed
|
||||
- Fixed Collapse turns hiding a finished reply when Claude answers a later background task notification
|
||||
- Fixed detached worktree commits getting lost when archiving a workspace
|
||||
- Fixed Desktop updates leaving an older daemon running when an earlier Desktop session started it
|
||||
- Fixed daemons losing their Hub connection after execution permissions changed
|
||||
- Fixed saved hosts disappearing when one stored entry could not be read
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,8 @@
|
||||
Fixed
|
||||
- Fixed Collapse turns hiding a finished reply when Claude answers a later background task notification
|
||||
- Fixed detached worktree commits getting lost when archiving a workspace
|
||||
- Fixed Desktop updates leaving an older daemon running when an earlier Desktop session started it
|
||||
- Fixed daemons losing their Hub connection after execution permissions changed
|
||||
- Fixed saved hosts disappearing when one stored entry could not be read
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
+1
-1
@@ -1 +1 @@
|
||||
sha256-k7+5S/4tyAmHdZmUdhpuZ7GOc7hp9cG8wUBFdJI32ng=
|
||||
sha256-yLTaVMgu3tc/dgngJ7RP0htJcWE0ZtQ4mouypevyv0s=
|
||||
|
||||
Generated
+28
-28
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "paseo",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"workspaces": [
|
||||
@@ -37468,7 +37468,7 @@
|
||||
},
|
||||
"packages/app": {
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"dependencies": {
|
||||
"@codemirror/commands": "6.10.4",
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -39637,13 +39637,13 @@
|
||||
},
|
||||
"packages/cli": {
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.16.1",
|
||||
"@getpaseo/protocol": "0.16.1",
|
||||
"@getpaseo/server": "0.16.1",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/server": "0.16.2",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
@@ -39890,11 +39890,11 @@
|
||||
},
|
||||
"packages/client": {
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.16.1",
|
||||
"@getpaseo/relay": "0.16.1",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/relay": "0.16.2",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
@@ -39906,7 +39906,7 @@
|
||||
},
|
||||
"packages/desktop": {
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/cli": "*",
|
||||
@@ -40149,7 +40149,7 @@
|
||||
},
|
||||
"packages/expo-two-way-audio": {
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
@@ -40195,7 +40195,7 @@
|
||||
},
|
||||
"packages/highlight": {
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -40225,7 +40225,7 @@
|
||||
},
|
||||
"packages/plugin": {
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^1.4.0",
|
||||
@@ -40233,8 +40233,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.16.1",
|
||||
"@getpaseo/protocol": "0.16.1",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.2.3",
|
||||
@@ -40244,8 +40244,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.16.1",
|
||||
"@getpaseo/protocol": "0.16.1",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
@@ -40267,7 +40267,7 @@
|
||||
},
|
||||
"packages/protocol": {
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"semver": "^7.8.5",
|
||||
@@ -40295,7 +40295,7 @@
|
||||
},
|
||||
"packages/relay": {
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@noble/ciphers": "^2.4.0",
|
||||
@@ -40517,17 +40517,17 @@
|
||||
},
|
||||
"packages/server": {
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.16.1",
|
||||
"@getpaseo/highlight": "0.16.1",
|
||||
"@getpaseo/plugin": "0.16.1",
|
||||
"@getpaseo/protocol": "0.16.1",
|
||||
"@getpaseo/relay": "0.16.1",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/highlight": "0.16.2",
|
||||
"@getpaseo/plugin": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/relay": "0.16.2",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
@@ -41474,7 +41474,7 @@
|
||||
},
|
||||
"packages/website": {
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"dependencies": {
|
||||
"@cloudflare/vite-plugin": "^1.29.1",
|
||||
"@cloudflare/workers-types": "^4.20260317.1",
|
||||
@@ -43084,7 +43084,7 @@
|
||||
},
|
||||
"plugins": {
|
||||
"name": "@getpaseo/builtin-plugins",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"dependencies": {
|
||||
"@getpaseo/plugin": "*",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"private": true,
|
||||
"description": "Paseo: voice-controlled development environment for local AI coding agents",
|
||||
"keywords": [
|
||||
|
||||
@@ -56,11 +56,20 @@ function inFlightTurn(page: Page) {
|
||||
return page.getByTestId("turn-working-indicator");
|
||||
}
|
||||
|
||||
/**
|
||||
* Presses a fork trigger until its menu shows.
|
||||
*
|
||||
* The in-flight turn's trigger sits below text that is still streaming in. While the chat is
|
||||
* shorter than the viewport, each new line moves the trigger down. A line that arrives between
|
||||
* the press and the release moves the trigger away from the pointer, so the press opens nothing,
|
||||
* and the next press lands on the trigger where it is now.
|
||||
*/
|
||||
async function openForkMenu(page: Page, trigger: ReturnType<Page["getByRole"]>): Promise<void> {
|
||||
await trigger.click();
|
||||
await expect(page.getByRole("menuitem", { name: "Fork in a new tab" })).toBeVisible({
|
||||
timeout: 10_000,
|
||||
});
|
||||
const forkInNewTab = page.getByRole("menuitem", { name: "Fork in a new tab" });
|
||||
await expect(async () => {
|
||||
await trigger.click({ timeout: 5_000 });
|
||||
await expect(forkInNewTab).toBeVisible({ timeout: 5_000 });
|
||||
}).toPass({ timeout: 30_000 });
|
||||
}
|
||||
|
||||
export async function openMostRecentAssistantForkMenu(page: Page): Promise<void> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"private": true,
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
// @vitest-environment jsdom
|
||||
import type { ReactNode } from "react";
|
||||
import { cleanup, renderHook, waitFor } from "@testing-library/react";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { afterEach, beforeEach, expect, it } from "vitest";
|
||||
import type { FileReadResult } from "@getpaseo/client/internal/daemon-client";
|
||||
import { __setAttachmentStoreForTests } from "@/attachments/store";
|
||||
import type { AttachmentStore } from "@/attachments/types";
|
||||
import { useMarkdownSource, type MarkdownImageContext } from "./images";
|
||||
import { PENDING_MARKDOWN_IMAGE } from "./source";
|
||||
|
||||
const memoryStore: AttachmentStore = {
|
||||
storageType: "web-indexeddb",
|
||||
async save(input) {
|
||||
return {
|
||||
id: input.id ?? "att_chart",
|
||||
mimeType: input.mimeType ?? "image/png",
|
||||
storageType: "web-indexeddb",
|
||||
storageKey: input.id ?? "att_chart",
|
||||
fileName: input.fileName,
|
||||
createdAt: 1,
|
||||
};
|
||||
},
|
||||
async encodeBase64() {
|
||||
return "";
|
||||
},
|
||||
async resolvePreviewUrl() {
|
||||
return "blob:chart";
|
||||
},
|
||||
async releasePreviewUrl() {},
|
||||
async delete() {},
|
||||
async garbageCollect() {},
|
||||
};
|
||||
|
||||
function createHostFiles() {
|
||||
const reads: { cwd: string; path: string }[] = [];
|
||||
return {
|
||||
reads,
|
||||
async readFile(cwd: string, path: string): Promise<FileReadResult> {
|
||||
reads.push({ cwd, path });
|
||||
return {
|
||||
kind: "image",
|
||||
path,
|
||||
mime: "image/png",
|
||||
size: 4,
|
||||
modifiedAt: "2026-11-18T00:00:00.000Z",
|
||||
bytes: new Uint8Array([1, 2, 3, 4]),
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
__setAttachmentStoreForTests(memoryStore);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
__setAttachmentStoreForTests(null);
|
||||
});
|
||||
|
||||
function renderMarkdownSource(text: string, initialProps: MarkdownImageContext) {
|
||||
// No retries: a failed read settles at once. For a host's Markdown this is the state once the
|
||||
// retries have run out on a host that is slow to connect.
|
||||
const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } });
|
||||
const wrapper = ({ children }: { children: ReactNode }) => (
|
||||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
||||
);
|
||||
const rendered = renderHook((props: MarkdownImageContext) => useMarkdownSource(text, props), {
|
||||
wrapper,
|
||||
initialProps,
|
||||
});
|
||||
return { ...rendered, queryClient };
|
||||
}
|
||||
|
||||
it("waits for the host's client before reading a workspace image", async () => {
|
||||
const context = { serverId: "srv_test", workspaceRoot: "/repo" };
|
||||
const { result, rerender, queryClient } = renderMarkdownSource("", {
|
||||
...context,
|
||||
client: null,
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(queryClient.isFetching()).toBe(0);
|
||||
expect(result.current.markdown.replace(PENDING_MARKDOWN_IMAGE, "pending")).toBe(
|
||||
"",
|
||||
);
|
||||
});
|
||||
|
||||
const files = createHostFiles();
|
||||
rerender({ ...context, client: files });
|
||||
|
||||
await waitFor(() => expect(result.current.imageSources).toEqual({ "blob:chart": "chart.png" }));
|
||||
expect(files.reads).toEqual([{ cwd: "/repo", path: "chart.png" }]);
|
||||
});
|
||||
|
||||
it("shows the alt text of a file image in Markdown that belongs to no host", async () => {
|
||||
const { result } = renderMarkdownSource("", {});
|
||||
|
||||
await waitFor(() =>
|
||||
expect(result.current.markdown.replace(PENDING_MARKDOWN_IMAGE, "pending")).toBe("Chart"),
|
||||
);
|
||||
});
|
||||
@@ -81,7 +81,10 @@ export function useMarkdownSource(
|
||||
const results = useFetchQueries(
|
||||
acquisitions.map((acquisition, index) => ({
|
||||
queryKey: ["markdownImage", acquisition?.key ?? sources[index]],
|
||||
enabled: acquisition !== null,
|
||||
// A host that hasn't connected yet has no client. Its images stay pending until it does: the
|
||||
// key doesn't change when the client arrives, so a read that already failed would not run
|
||||
// again. Markdown with no host has no client to wait for and falls back to its alt text.
|
||||
enabled: acquisition !== null && (context.client != null || !context.serverId),
|
||||
immutableWhen: () => true,
|
||||
dataShape: "value",
|
||||
gcTime: 0,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"description": "Paseo CLI - control your AI coding agents from the command line",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
@@ -29,9 +29,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.16.1",
|
||||
"@getpaseo/protocol": "0.16.1",
|
||||
"@getpaseo/server": "0.16.1",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/server": "0.16.2",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"description": "Paseo client SDK package",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -49,8 +49,8 @@
|
||||
"measure:diff-materialization": "tsx scripts/measure-diff-materialization.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.16.1",
|
||||
"@getpaseo/relay": "0.16.1",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/relay": "0.16.2",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"private": true,
|
||||
"description": "Paseo desktop app (Electron wrapper)",
|
||||
"homepage": "https://paseo.sh",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"description": "Native module for two way audio streaming",
|
||||
"keywords": [
|
||||
"ExpoTwoWayAudio",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"description": "Paseo plugin SDK package",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -78,8 +78,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.16.1",
|
||||
"@getpaseo/protocol": "0.16.1",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.2.3",
|
||||
@@ -89,8 +89,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.16.1",
|
||||
"@getpaseo/protocol": "0.16.1",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"description": "Paseo shared protocol schemas and wire types",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"description": "Paseo relay for bridging daemon and client connections",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"description": "Paseo backend server",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -109,11 +109,11 @@
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.16.1",
|
||||
"@getpaseo/highlight": "0.16.1",
|
||||
"@getpaseo/plugin": "0.16.1",
|
||||
"@getpaseo/protocol": "0.16.1",
|
||||
"@getpaseo/relay": "0.16.1",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/highlight": "0.16.2",
|
||||
"@getpaseo/plugin": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/relay": "0.16.2",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
|
||||
@@ -9920,6 +9920,166 @@ test("canceling a pending Codex start settles as canceled without accepting its
|
||||
}
|
||||
});
|
||||
|
||||
test("a Codex message whose turn/start acknowledgement outlasts the timeout is not reported as failed and then answered", async () => {
|
||||
vi.useFakeTimers({ toFake: ["setTimeout", "clearTimeout"] });
|
||||
const workdir = mkdtempSync(join(tmpdir(), "agent-manager-codex-admission-timeout-"));
|
||||
// Codex accepted the turn, but its acknowledgement arrives after Paseo's 90 s deadline.
|
||||
const lateAcknowledgement = deferred<Record<string, never>>();
|
||||
const appServer = createFakeCodexAppServer({ "turn/start": () => lateAcknowledgement.promise });
|
||||
class SlowAdmissionClient extends TestAgentClient {
|
||||
override async createSession(config: AgentSessionConfig): Promise<AgentSession> {
|
||||
return new CodexAppServerAgentSession(config, null, logger, async () => appServer.child);
|
||||
}
|
||||
}
|
||||
const manager = new AgentManager({
|
||||
clients: { codex: new SlowAdmissionClient() },
|
||||
registry: new AgentStorage(join(workdir, "agents"), logger),
|
||||
logger,
|
||||
});
|
||||
try {
|
||||
const agent = await manager.createAgent({ provider: "codex", cwd: workdir }, undefined, {
|
||||
workspaceId: undefined,
|
||||
});
|
||||
const run = drainAsyncGenerator(
|
||||
manager.streamAgent(agent.id, "Run the migration", { clientMessageId: "migration" }),
|
||||
);
|
||||
void run.catch(() => undefined);
|
||||
await vi.waitFor(() =>
|
||||
expect(appServer.requests().some((request) => request.method === "turn/start")).toBe(true),
|
||||
);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(90_000);
|
||||
const startError = await run.then(
|
||||
() => null,
|
||||
(error: unknown) => error,
|
||||
);
|
||||
// Codex then runs the message it accepted.
|
||||
appServer.startsTurn({ threadId: "thread-1", turnId: "native-A" });
|
||||
appServer.says({ threadId: "thread-1", text: "Migration done" });
|
||||
appServer.completeTurn();
|
||||
lateAcknowledgement.resolve({});
|
||||
await vi.advanceTimersByTimeAsync(0);
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
|
||||
const timeline = manager.getTimeline(agent.id);
|
||||
const reportedFailed = timeline.some(
|
||||
(item) => item.type === "assistant_message" && item.text.startsWith("[System Error]"),
|
||||
);
|
||||
const codexReplied = timeline.some(
|
||||
(item) => item.type === "assistant_message" && item.text === "Migration done",
|
||||
);
|
||||
// The sender is told the message failed, and Codex then answers it.
|
||||
expect({ startError: String(startError), reportedFailed, codexReplied }).not.toEqual({
|
||||
startError: "Error: Codex app-server request timed out for turn/start",
|
||||
reportedFailed: true,
|
||||
codexReplied: true,
|
||||
});
|
||||
} finally {
|
||||
vi.useRealTimers();
|
||||
lateAcknowledgement.resolve({});
|
||||
manager.prepareForShutdown();
|
||||
await Promise.all(manager.listAgents().map((agent) => manager.closeAgent(agent.id)));
|
||||
await manager.flushForShutdown();
|
||||
rmSync(workdir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test("Stop on a Codex agent whose turn/start is still in flight settles the run", async () => {
|
||||
vi.useFakeTimers({ toFake: ["setTimeout", "clearTimeout"] });
|
||||
const workdir = mkdtempSync(join(tmpdir(), "agent-manager-codex-stop-pending-start-"));
|
||||
const lateAcknowledgement = deferred<Record<string, never>>();
|
||||
const appServer = createFakeCodexAppServer({
|
||||
"turn/start": () => lateAcknowledgement.promise,
|
||||
"turn/interrupt": () => ({}),
|
||||
});
|
||||
class SlowAdmissionClient extends TestAgentClient {
|
||||
override async createSession(config: AgentSessionConfig): Promise<AgentSession> {
|
||||
return new CodexAppServerAgentSession(config, null, logger, async () => appServer.child);
|
||||
}
|
||||
}
|
||||
const manager = new AgentManager({
|
||||
clients: { codex: new SlowAdmissionClient() },
|
||||
registry: new AgentStorage(join(workdir, "agents"), logger),
|
||||
logger,
|
||||
});
|
||||
try {
|
||||
const agent = await manager.createAgent({ provider: "codex", cwd: workdir }, undefined, {
|
||||
workspaceId: undefined,
|
||||
});
|
||||
const run = drainAsyncGenerator(
|
||||
manager.streamAgent(agent.id, "Run the migration", { clientMessageId: "migration" }),
|
||||
);
|
||||
void run.catch(() => undefined);
|
||||
await vi.waitFor(() =>
|
||||
expect(appServer.requests().some((request) => request.method === "turn/start")).toBe(true),
|
||||
);
|
||||
|
||||
const stop = manager.cancelAgentRun(agent.id);
|
||||
await vi.advanceTimersByTimeAsync(10_000);
|
||||
|
||||
expect(await stop).toEqual({ status: "settled" });
|
||||
} finally {
|
||||
vi.useRealTimers();
|
||||
lateAcknowledgement.resolve({});
|
||||
manager.prepareForShutdown();
|
||||
await Promise.all(manager.listAgents().map((agent) => manager.closeAgent(agent.id)));
|
||||
await manager.flushForShutdown();
|
||||
rmSync(workdir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test("Stop on a Codex agent is not held behind a steer that Codex has not acknowledged", async () => {
|
||||
vi.useFakeTimers({ toFake: ["setTimeout", "clearTimeout"] });
|
||||
const workdir = mkdtempSync(join(tmpdir(), "agent-manager-codex-stop-behind-steer-"));
|
||||
const steerAcknowledgement = deferred<{ turnId: string }>();
|
||||
const appServer = createFakeCodexAppServer({
|
||||
"turn/steer": () => steerAcknowledgement.promise,
|
||||
"turn/interrupt": () => ({}),
|
||||
});
|
||||
class SlowSteerClient extends TestAgentClient {
|
||||
override async createSession(config: AgentSessionConfig): Promise<AgentSession> {
|
||||
return new CodexAppServerAgentSession(config, null, logger, async () => appServer.child);
|
||||
}
|
||||
}
|
||||
const manager = new AgentManager({
|
||||
clients: { codex: new SlowSteerClient() },
|
||||
registry: new AgentStorage(join(workdir, "agents"), logger),
|
||||
logger,
|
||||
});
|
||||
try {
|
||||
const agent = await manager.createAgent({ provider: "codex", cwd: workdir }, undefined, {
|
||||
workspaceId: undefined,
|
||||
});
|
||||
const run = drainAsyncGenerator(manager.streamAgent(agent.id, "Run the migration"));
|
||||
void run.catch(() => undefined);
|
||||
await appServer.waitForRequest("turn/start");
|
||||
appServer.startsTurn({ threadId: "thread-1", turnId: "native-A" });
|
||||
await vi.waitFor(() => expect(manager.getAgent(agent.id)?.lifecycle).toBe("running"));
|
||||
|
||||
const steer = manager.steerAgentRun(agent.id, "Also update the docs");
|
||||
void steer.catch(() => undefined);
|
||||
await appServer.waitForRequest("turn/steer");
|
||||
let stopResult: unknown = "still waiting";
|
||||
const stop = manager.cancelAgentRun(agent.id).then((result) => {
|
||||
stopResult = result;
|
||||
return result;
|
||||
});
|
||||
await vi.advanceTimersByTimeAsync(10_000);
|
||||
|
||||
expect(stopResult).toEqual({ status: "settled" });
|
||||
steerAcknowledgement.resolve({ turnId: "native-A" });
|
||||
await vi.advanceTimersByTimeAsync(0);
|
||||
await stop;
|
||||
} finally {
|
||||
vi.useRealTimers();
|
||||
steerAcknowledgement.resolve({ turnId: "native-A" });
|
||||
manager.prepareForShutdown();
|
||||
await Promise.all(manager.listAgents().map((agent) => manager.closeAgent(agent.id)));
|
||||
await manager.flushForShutdown();
|
||||
rmSync(workdir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test("stopping a Codex replacement of a stalled start clears replacement activity", async () => {
|
||||
const workdir = mkdtempSync(join(tmpdir(), "agent-manager-codex-replacement-cancel-"));
|
||||
const firstLoaded = deferred<{ data: string[] }>();
|
||||
|
||||
@@ -136,6 +136,94 @@ describe("OMP rpc-ui permission mapper", () => {
|
||||
).toEqual({ kind: "passthrough" });
|
||||
});
|
||||
|
||||
test("maps approvals that offer session and grant choices beside the one-call approval", () => {
|
||||
const session = classifyOmpRpcUiPermissionRequest({
|
||||
type: "extension_ui_request",
|
||||
id: "session-write",
|
||||
method: "select",
|
||||
title: "Allow tool: write\nPath: cap.txt\nContent:\nhello",
|
||||
options: ["Approve", "Approve write for this session", "Deny"],
|
||||
});
|
||||
if (session.kind !== "tool") throw new Error("Expected session approval to map as a tool");
|
||||
expect(
|
||||
session.request.actions?.map((action) => [action.id, action.label, action.behavior]),
|
||||
).toEqual([
|
||||
["deny", "Deny", "deny"],
|
||||
["approve", "Approve", "allow"],
|
||||
["approve-option-0", "Approve write for this session", "allow"],
|
||||
]);
|
||||
expect(buildOmpRpcUiPermissionResponse(session.request, { behavior: "allow" })).toEqual({
|
||||
value: "Approve",
|
||||
});
|
||||
expect(
|
||||
buildOmpRpcUiPermissionResponse(session.request, {
|
||||
behavior: "allow",
|
||||
selectedActionId: "approve-option-0",
|
||||
}),
|
||||
).toEqual({ value: "Approve write for this session" });
|
||||
expect(
|
||||
buildOmpRpcUiPermissionResponse(session.request, {
|
||||
behavior: "deny",
|
||||
selectedActionId: "approve-option-0",
|
||||
}),
|
||||
).toEqual({ value: "Deny" });
|
||||
|
||||
const grants = classifyOmpRpcUiPermissionRequest({
|
||||
type: "extension_ui_request",
|
||||
id: "grant-edit",
|
||||
method: "select",
|
||||
title: "Allow tool: edit\nFile: src/a.ts",
|
||||
options: ["Approve File", "Always Approve File", "Approve Once", "Deny"],
|
||||
});
|
||||
if (grants.kind !== "tool") throw new Error("Expected grant approval to map as a tool");
|
||||
expect(buildOmpRpcUiPermissionResponse(grants.request, { behavior: "allow" })).toEqual({
|
||||
value: "Approve Once",
|
||||
});
|
||||
expect(
|
||||
buildOmpRpcUiPermissionResponse(grants.request, {
|
||||
behavior: "allow",
|
||||
selectedActionId: "approve-option-1",
|
||||
}),
|
||||
).toEqual({ value: "Always Approve File" });
|
||||
});
|
||||
|
||||
test("allows one call when a grant is labeled Approve beside Approve Once", () => {
|
||||
// OMP names the one-call choice "Approve Once" whenever it offers grants. A grant for a
|
||||
// target that is not a file is then labeled "Approve", which remembers more than one call.
|
||||
const grants = classifyOmpRpcUiPermissionRequest({
|
||||
type: "extension_ui_request",
|
||||
id: "grant-target",
|
||||
method: "select",
|
||||
title: "Allow tool: edit\nFile: src/a.ts",
|
||||
options: ["Approve", "Always Approve", "Approve Once", "Deny"],
|
||||
});
|
||||
if (grants.kind !== "tool") throw new Error("Expected grant approval to map as a tool");
|
||||
expect(buildOmpRpcUiPermissionResponse(grants.request, { behavior: "allow" })).toEqual({
|
||||
value: "Approve Once",
|
||||
});
|
||||
});
|
||||
|
||||
test("passes through selects whose extra choices are not approvals", () => {
|
||||
expect(
|
||||
classifyOmpRpcUiPermissionRequest({
|
||||
type: "extension_ui_request",
|
||||
id: "odd-choice",
|
||||
method: "select",
|
||||
title: "Allow tool: bash\nCommand: echo hi",
|
||||
options: ["Approve", "Edit command", "Deny"],
|
||||
}),
|
||||
).toEqual({ kind: "passthrough" });
|
||||
expect(
|
||||
classifyOmpRpcUiPermissionRequest({
|
||||
type: "extension_ui_request",
|
||||
id: "deny-first",
|
||||
method: "select",
|
||||
title: "Allow tool: bash\nCommand: echo hi",
|
||||
options: ["Deny", "Approve"],
|
||||
}),
|
||||
).toEqual({ kind: "passthrough" });
|
||||
});
|
||||
|
||||
test("responds to tool approvals with exact select values", () => {
|
||||
const request = toolApproval("bash");
|
||||
|
||||
|
||||
@@ -10,8 +10,13 @@ import type { OmpRuntimeEvent } from "./rpc-types.js";
|
||||
const OMP_PROVIDER = "omp";
|
||||
const OMP_RPC_UI_TOOL_APPROVAL_METADATA = "omp_rpc_ui_tool_approval";
|
||||
const TOOL_APPROVAL_APPROVE_VALUE = "Approve";
|
||||
// OMP labels the approve-this-call choice "Approve Once" when it also offers grants that remember
|
||||
// more. A grant can then be labeled "Approve", so "Approve" is the one-call choice only without it.
|
||||
const TOOL_APPROVAL_ONCE_VALUE = "Approve Once";
|
||||
const TOOL_APPROVAL_DENY_VALUE = "Deny";
|
||||
const TOOL_APPROVAL_OPTIONS = [TOOL_APPROVAL_APPROVE_VALUE, TOOL_APPROVAL_DENY_VALUE] as const;
|
||||
// Session and grant choices OMP offers beside the one-call approval, e.g. "Approve write for this session".
|
||||
const TOOL_APPROVAL_EXTRA_CHOICE = /^(?:Always )?Approve\b/;
|
||||
const TOOL_APPROVAL_EXTRA_ACTION_PREFIX = "approve-option-";
|
||||
const TOOL_TITLE_PREFIX = "Allow tool: ";
|
||||
|
||||
export type OmpRpcUiPermissionClassification =
|
||||
@@ -25,6 +30,12 @@ interface ToolApprovalDescriptor {
|
||||
args: AgentMetadata;
|
||||
detail: ToolCallDetail;
|
||||
description?: string;
|
||||
choices: ToolApprovalChoices;
|
||||
}
|
||||
|
||||
interface ToolApprovalChoices {
|
||||
approveValue: string;
|
||||
extraValues: string[];
|
||||
}
|
||||
|
||||
export function classifyOmpRpcUiPermissionRequest(
|
||||
@@ -37,6 +48,13 @@ export function classifyOmpRpcUiPermissionRequest(
|
||||
}
|
||||
|
||||
const provider = options.provider ?? OMP_PROVIDER;
|
||||
const { approveValue, extraValues } = descriptor.choices;
|
||||
const extraActions = extraValues.map((value, index) => ({
|
||||
id: `${TOOL_APPROVAL_EXTRA_ACTION_PREFIX}${index}`,
|
||||
label: value,
|
||||
behavior: "allow" as const,
|
||||
variant: "secondary" as const,
|
||||
}));
|
||||
return {
|
||||
kind: "tool",
|
||||
request: {
|
||||
@@ -57,17 +75,18 @@ export function classifyOmpRpcUiPermissionRequest(
|
||||
},
|
||||
{
|
||||
id: "approve",
|
||||
label: TOOL_APPROVAL_APPROVE_VALUE,
|
||||
label: approveValue,
|
||||
behavior: "allow",
|
||||
variant: "primary",
|
||||
},
|
||||
...extraActions,
|
||||
],
|
||||
metadata: {
|
||||
extensionUiMethod: "select",
|
||||
toolApproval: OMP_RPC_UI_TOOL_APPROVAL_METADATA,
|
||||
toolName: descriptor.toolName,
|
||||
toolArgs: descriptor.args,
|
||||
approveValue: TOOL_APPROVAL_APPROVE_VALUE,
|
||||
approveValue,
|
||||
denyValue: TOOL_APPROVAL_DENY_VALUE,
|
||||
},
|
||||
},
|
||||
@@ -95,13 +114,23 @@ export function buildOmpRpcUiPermissionResponse(
|
||||
|
||||
const approveValue = readString(request.metadata.approveValue) ?? TOOL_APPROVAL_APPROVE_VALUE;
|
||||
const denyValue = readString(request.metadata.denyValue) ?? TOOL_APPROVAL_DENY_VALUE;
|
||||
return { value: response.behavior === "allow" ? approveValue : denyValue };
|
||||
if (response.behavior !== "allow") {
|
||||
return { value: denyValue };
|
||||
}
|
||||
// Each extra choice's action label is the exact select value OMP offered.
|
||||
const selectedExtraChoice = request.actions?.find(
|
||||
(action) =>
|
||||
action.id === response.selectedActionId &&
|
||||
action.id.startsWith(TOOL_APPROVAL_EXTRA_ACTION_PREFIX),
|
||||
);
|
||||
return { value: selectedExtraChoice?.label ?? approveValue };
|
||||
}
|
||||
|
||||
function parseToolApprovalDescriptor(
|
||||
event: ExtensionUiRequestEvent,
|
||||
): ToolApprovalDescriptor | null {
|
||||
if (event.method !== "select" || !hasExactToolApprovalOptions(event.options)) {
|
||||
const choices = event.method === "select" ? readToolApprovalChoices(event.options) : null;
|
||||
if (!choices) {
|
||||
return null;
|
||||
}
|
||||
const title = readString(event.title);
|
||||
@@ -118,6 +147,15 @@ function parseToolApprovalDescriptor(
|
||||
const body = firstLineBreak < 0 ? "" : title.slice(firstLineBreak).replace(/^\r?\n/, "");
|
||||
const bodyLines = body.split(/\r?\n/);
|
||||
|
||||
const parsed = parseToolApprovalBody(rawToolName, body, bodyLines);
|
||||
return parsed ? { ...parsed, choices } : null;
|
||||
}
|
||||
|
||||
function parseToolApprovalBody(
|
||||
rawToolName: string,
|
||||
body: string,
|
||||
bodyLines: string[],
|
||||
): Omit<ToolApprovalDescriptor, "choices"> | null {
|
||||
switch (rawToolName) {
|
||||
case "bash":
|
||||
return parseBashApproval(body);
|
||||
@@ -130,7 +168,7 @@ function parseToolApprovalDescriptor(
|
||||
}
|
||||
}
|
||||
|
||||
function parseBashApproval(body: string): ToolApprovalDescriptor | null {
|
||||
function parseBashApproval(body: string): Omit<ToolApprovalDescriptor, "choices"> | null {
|
||||
const match = /(?:^|\r?\n)[\t ]*Command:[\t ]?(.*)$/s.exec(body);
|
||||
const command = match?.[1];
|
||||
if (!command) {
|
||||
@@ -144,7 +182,7 @@ function parseBashApproval(body: string): ToolApprovalDescriptor | null {
|
||||
};
|
||||
}
|
||||
|
||||
function parseEditApproval(lines: string[]): ToolApprovalDescriptor | null {
|
||||
function parseEditApproval(lines: string[]): Omit<ToolApprovalDescriptor, "choices"> | null {
|
||||
const filePath = readPrefixedValue(lines, "File:");
|
||||
if (!filePath) {
|
||||
return null;
|
||||
@@ -157,7 +195,7 @@ function parseEditApproval(lines: string[]): ToolApprovalDescriptor | null {
|
||||
};
|
||||
}
|
||||
|
||||
function parseWriteApproval(lines: string[]): ToolApprovalDescriptor | null {
|
||||
function parseWriteApproval(lines: string[]): Omit<ToolApprovalDescriptor, "choices"> | null {
|
||||
const pathLineIndex = lines.findIndex((line) => line.trim().startsWith("Path:"));
|
||||
if (pathLineIndex < 0) {
|
||||
return null;
|
||||
@@ -182,12 +220,28 @@ function parseWriteApproval(lines: string[]): ToolApprovalDescriptor | null {
|
||||
};
|
||||
}
|
||||
|
||||
function hasExactToolApprovalOptions(options: unknown): boolean {
|
||||
return (
|
||||
Array.isArray(options) &&
|
||||
options.length === TOOL_APPROVAL_OPTIONS.length &&
|
||||
options.every((option, index) => option === TOOL_APPROVAL_OPTIONS[index])
|
||||
function readToolApprovalChoices(options: unknown): ToolApprovalChoices | null {
|
||||
if (!Array.isArray(options) || !options.every((option) => typeof option === "string")) {
|
||||
return null;
|
||||
}
|
||||
const labels = options as string[];
|
||||
if (
|
||||
labels.at(-1) !== TOOL_APPROVAL_DENY_VALUE ||
|
||||
labels.indexOf(TOOL_APPROVAL_DENY_VALUE) !== labels.length - 1
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
const approveValue = [TOOL_APPROVAL_ONCE_VALUE, TOOL_APPROVAL_APPROVE_VALUE].find((value) =>
|
||||
labels.includes(value),
|
||||
);
|
||||
if (!approveValue) {
|
||||
return null;
|
||||
}
|
||||
const extraValues = labels.slice(0, -1).filter((label) => label !== approveValue);
|
||||
if (!extraValues.every((label) => TOOL_APPROVAL_EXTRA_CHOICE.test(label))) {
|
||||
return null;
|
||||
}
|
||||
return { approveValue, extraValues };
|
||||
}
|
||||
|
||||
function readPrefixedValue(lines: readonly string[], prefix: string): string | null {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/builtin-plugins",
|
||||
"version": "0.16.1",
|
||||
"version": "0.16.2",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user