paseo-smart-session 3.6.1 → 3.6.2
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/client/chat.tsx +3 -2
- package/package.json +1 -1
- package/shared/chat.ts +16 -0
- package/shared/version.ts +1 -1
package/client/chat.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { Platform, Pressable, Text, View } from "react-native";
|
|
|
3
3
|
import type { PluginClientContext, PluginTimelineItemProps } from "@getpaseo/plugin/client";
|
|
4
4
|
import { Icon, ScrollView } from "@getpaseo/plugin/client/ui";
|
|
5
5
|
|
|
6
|
-
import { PROMPT_CARD_KIND, PromptCardSchema, TOOL_ROW_KIND, ToolRowSchema, fileName, promptCard,
|
|
6
|
+
import { PROMPT_CARD_KIND, PromptCardSchema, TOOL_ROW_KIND, ToolRowSchema, fileName, promptCard, chatToolRow, type PromptCard, type ToolRow } from "../shared/chat";
|
|
7
7
|
import { raised } from "./theme";
|
|
8
8
|
|
|
9
9
|
const ICONS: Record<ToolRow["tool"], string> = {
|
|
@@ -99,11 +99,12 @@ function PromptCardView({ item, theme, layout }: PluginTimelineItemProps<PromptC
|
|
|
99
99
|
|
|
100
100
|
export function contributeChat(client: PluginClientContext) {
|
|
101
101
|
const removers = [
|
|
102
|
+
// Bookkeeping stays Paseo's own grouped tool call (a plugin item always seals Paseo's group). See TOOL_PRESENTATION.
|
|
102
103
|
client.addTimelineTransformer({
|
|
103
104
|
id: "smart-session-tool-calls",
|
|
104
105
|
query: { itemType: "tool_call" },
|
|
105
106
|
transform({ item }) {
|
|
106
|
-
const row =
|
|
107
|
+
const row = chatToolRow(item.name, item.status, item.detail, item.error);
|
|
107
108
|
return row === null ? undefined : { items: [{ type: "plugin" as const, kind: TOOL_ROW_KIND, version: 1, data: row }] };
|
|
108
109
|
},
|
|
109
110
|
}),
|
package/package.json
CHANGED
package/shared/chat.ts
CHANGED
|
@@ -98,6 +98,22 @@ function checkpointDetail(input: Record<string, unknown>): string {
|
|
|
98
98
|
return clip(lines.join("\n"), 4000);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
* How each agent tool shows in a chat. Paseo 0.15.2 groups a run only from tool_call and thought items, and a timeline
|
|
103
|
+
* transform can only return plugin items, so a transformed call always leaves Paseo's group and sits loose. All of
|
|
104
|
+
* Smart Session's tools are bookkeeping (Paseo shows the compaction itself), so they stay Paseo's own tool calls. A new
|
|
105
|
+
* tool must be classified here (chat-grouping.test.ts fails otherwise); only a moment the developer must see becomes a row.
|
|
106
|
+
*/
|
|
107
|
+
export const TOOL_PRESENTATION: Record<SmartSessionTool, "routine" | "moment"> = {
|
|
108
|
+
context_status: "routine", budget_status: "routine", checkpoint: "routine", request_compaction: "routine", defer_compaction: "routine",
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/** The chat row for a tool call, or null to leave it as Paseo's own grouped tool call. */
|
|
112
|
+
export function chatToolRow(name: string, status: string, detail: unknown, error: unknown): ToolRow | null {
|
|
113
|
+
const tool = smartSessionTool(name);
|
|
114
|
+
return tool !== null && TOOL_PRESENTATION[tool] === "moment" ? toolRow(name, status, detail, error) : null;
|
|
115
|
+
}
|
|
116
|
+
|
|
101
117
|
/** Builds a row from a tool call, or null when the call is not one of Smart Session's. */
|
|
102
118
|
export function toolRow(name: string, status: string, detail: unknown, error: unknown): ToolRow | null {
|
|
103
119
|
const tool = smartSessionTool(name);
|
package/shared/version.ts
CHANGED