@getpaseo/protocol 0.7.0-beta.1 → 0.7.0-beta.3
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/generated/validation/ws-outbound.aot.js +11419 -11354
- package/dist/messages.d.ts +437 -13
- package/dist/messages.js +29 -2
- package/dist/paseo-tool-call-detail.d.ts +15 -0
- package/dist/paseo-tool-call-detail.js +305 -0
- package/dist/ssh-transport.d.ts +11 -0
- package/dist/ssh-transport.js +72 -0
- package/dist/tool-call-display.js +4 -3
- package/dist/validation/ws-outbound-schema-metadata.d.ts +63 -3
- package/package.json +1 -1
package/dist/messages.js
CHANGED
|
@@ -16,6 +16,18 @@ export { PaseoConfigRawSchema, PaseoLifecycleCommandRawSchema, PaseoMetadataGene
|
|
|
16
16
|
// ---------------------------------------------------------------------------
|
|
17
17
|
// Mutable daemon config schemas (shared between server store and client)
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
|
+
export const DAEMON_PERMISSIONS = [
|
|
20
|
+
"daemon.read",
|
|
21
|
+
"daemon.manage",
|
|
22
|
+
"tunnel.manage",
|
|
23
|
+
"access.manage",
|
|
24
|
+
"workspace.read",
|
|
25
|
+
"workspace.write",
|
|
26
|
+
"workspace.manage",
|
|
27
|
+
"automation.manage",
|
|
28
|
+
"hub.execute",
|
|
29
|
+
];
|
|
30
|
+
export const DaemonPermissionSchema = z.enum(DAEMON_PERMISSIONS);
|
|
19
31
|
const MutableDaemonProviderModelSchema = z
|
|
20
32
|
.object({
|
|
21
33
|
id: z.string().min(1),
|
|
@@ -1150,6 +1162,7 @@ export const HubManagementDaemonConnectRequestSchema = z.object({
|
|
|
1150
1162
|
requestId: z.string(),
|
|
1151
1163
|
hubUrl: z.string(),
|
|
1152
1164
|
token: z.string(),
|
|
1165
|
+
permissions: z.array(DaemonPermissionSchema).default([]),
|
|
1153
1166
|
});
|
|
1154
1167
|
export const HubManagementDaemonGetStatusRequestSchema = z.object({
|
|
1155
1168
|
type: z.literal("hub.management.daemon.get_status.request"),
|
|
@@ -1160,6 +1173,12 @@ export const HubManagementDaemonDisconnectRequestSchema = z.object({
|
|
|
1160
1173
|
requestId: z.string(),
|
|
1161
1174
|
force: z.boolean().optional(),
|
|
1162
1175
|
});
|
|
1176
|
+
export const HubManagementDaemonPermissionsUpdateRequestSchema = z.object({
|
|
1177
|
+
type: z.literal("hub.management.daemon.permissions.update.request"),
|
|
1178
|
+
requestId: z.string(),
|
|
1179
|
+
grant: z.array(DaemonPermissionSchema).default([]),
|
|
1180
|
+
revoke: z.array(DaemonPermissionSchema).default([]),
|
|
1181
|
+
});
|
|
1163
1182
|
export const DiagnosticsRequestSchema = z.object({
|
|
1164
1183
|
type: z.literal("diagnostics.request"),
|
|
1165
1184
|
requestId: z.string(),
|
|
@@ -2544,6 +2563,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
2544
2563
|
HubManagementDaemonConnectRequestSchema,
|
|
2545
2564
|
HubManagementDaemonGetStatusRequestSchema,
|
|
2546
2565
|
HubManagementDaemonDisconnectRequestSchema,
|
|
2566
|
+
HubManagementDaemonPermissionsUpdateRequestSchema,
|
|
2547
2567
|
DiagnosticsRequestSchema,
|
|
2548
2568
|
PluginCatalogGetRequestSchema,
|
|
2549
2569
|
PluginListRequestSchema,
|
|
@@ -2837,6 +2857,8 @@ export const ServerInfoStatusPayloadSchema = z
|
|
|
2837
2857
|
serverId: z.string().trim().min(1),
|
|
2838
2858
|
hostname: ServerInfoHostnameSchema.optional(),
|
|
2839
2859
|
version: ServerInfoVersionSchema.optional(),
|
|
2860
|
+
// COMPAT(sessionPermissions): optional while clients support older daemons.
|
|
2861
|
+
permissions: z.array(DaemonPermissionSchema).optional(),
|
|
2840
2862
|
// COMPAT(desktopManaged): added in v0.1.X, remove optional parsing after 2027-01-16.
|
|
2841
2863
|
desktopManaged: z.boolean().optional(),
|
|
2842
2864
|
capabilities: ServerCapabilitiesFromUnknownSchema.optional(),
|
|
@@ -4007,7 +4029,7 @@ export const HubRelationshipStatusSchema = z.object({
|
|
|
4007
4029
|
]),
|
|
4008
4030
|
daemonId: z.string().nullable(),
|
|
4009
4031
|
hubOrigin: z.string().nullable(),
|
|
4010
|
-
|
|
4032
|
+
permissions: z.array(DaemonPermissionSchema),
|
|
4011
4033
|
connectedAt: z.string().nullable(),
|
|
4012
4034
|
lastError: z.string().nullable(),
|
|
4013
4035
|
});
|
|
@@ -4027,6 +4049,10 @@ export const HubManagementDaemonDisconnectResponseSchema = z.object({
|
|
|
4027
4049
|
warning: z.string().optional(),
|
|
4028
4050
|
}),
|
|
4029
4051
|
});
|
|
4052
|
+
export const HubManagementDaemonPermissionsUpdateResponseSchema = z.object({
|
|
4053
|
+
type: z.literal("hub.management.daemon.permissions.update.response"),
|
|
4054
|
+
payload: z.object({ requestId: z.string(), status: HubRelationshipStatusSchema }),
|
|
4055
|
+
});
|
|
4030
4056
|
export const DaemonGetPairingOfferResponseSchema = z.object({
|
|
4031
4057
|
type: z.literal("daemon.get_pairing_offer.response"),
|
|
4032
4058
|
payload: z
|
|
@@ -5563,6 +5589,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
5563
5589
|
HubManagementDaemonConnectResponseSchema,
|
|
5564
5590
|
HubManagementDaemonGetStatusResponseSchema,
|
|
5565
5591
|
HubManagementDaemonDisconnectResponseSchema,
|
|
5592
|
+
HubManagementDaemonPermissionsUpdateResponseSchema,
|
|
5566
5593
|
DiagnosticsResponseSchema,
|
|
5567
5594
|
GetDaemonConfigResponseMessageSchema,
|
|
5568
5595
|
SetDaemonConfigResponseMessageSchema,
|
|
@@ -5692,7 +5719,7 @@ export const WSPongMessageSchema = z.object({
|
|
|
5692
5719
|
export const WSHelloMessageSchema = z.object({
|
|
5693
5720
|
type: z.literal("hello"),
|
|
5694
5721
|
clientId: z.string().min(1),
|
|
5695
|
-
clientType: z.enum(["mobile", "browser", "cli", "mcp"]),
|
|
5722
|
+
clientType: z.enum(["mobile", "browser", "cli", "mcp", "hub"]),
|
|
5696
5723
|
protocolVersion: z.number().int(),
|
|
5697
5724
|
appVersion: z.string().optional(),
|
|
5698
5725
|
capabilities: z
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface PaseoToolDetailField {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export type PaseoToolDetailSection = {
|
|
6
|
+
kind: "prose";
|
|
7
|
+
title: string;
|
|
8
|
+
text: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: "fields";
|
|
11
|
+
title: string;
|
|
12
|
+
fields: PaseoToolDetailField[];
|
|
13
|
+
};
|
|
14
|
+
export declare function buildPaseoToolDetailSections(toolName: string, input: unknown, output: unknown): PaseoToolDetailSection[] | null;
|
|
15
|
+
//# sourceMappingURL=paseo-tool-call-detail.d.ts.map
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { getPaseoToolLeafName } from "./tool-name-normalization.js";
|
|
2
|
+
const WORKSPACE_FIELDS = [
|
|
3
|
+
"title",
|
|
4
|
+
"workspaceId",
|
|
5
|
+
"projectId",
|
|
6
|
+
"isolation",
|
|
7
|
+
"path",
|
|
8
|
+
"mode",
|
|
9
|
+
"worktreeSlug",
|
|
10
|
+
"branchName",
|
|
11
|
+
"baseBranch",
|
|
12
|
+
"branch",
|
|
13
|
+
"prNumber",
|
|
14
|
+
"forge",
|
|
15
|
+
];
|
|
16
|
+
const AGENT_FIELDS = [
|
|
17
|
+
"title",
|
|
18
|
+
"agentId",
|
|
19
|
+
"provider",
|
|
20
|
+
"workspaceId",
|
|
21
|
+
"cwd",
|
|
22
|
+
"sessionMode",
|
|
23
|
+
"modeId",
|
|
24
|
+
"background",
|
|
25
|
+
"notifyOnFinish",
|
|
26
|
+
"settings",
|
|
27
|
+
"labels",
|
|
28
|
+
];
|
|
29
|
+
const AUTOMATION_FIELDS = [
|
|
30
|
+
"name",
|
|
31
|
+
"id",
|
|
32
|
+
"cron",
|
|
33
|
+
"timezone",
|
|
34
|
+
"provider",
|
|
35
|
+
"cwd",
|
|
36
|
+
"isolation",
|
|
37
|
+
"maxRuns",
|
|
38
|
+
"expiresIn",
|
|
39
|
+
"clearExpires",
|
|
40
|
+
];
|
|
41
|
+
const BROWSER_FIELDS = [
|
|
42
|
+
"browserId",
|
|
43
|
+
"url",
|
|
44
|
+
"ref",
|
|
45
|
+
"sourceRef",
|
|
46
|
+
"targetRef",
|
|
47
|
+
"value",
|
|
48
|
+
"text",
|
|
49
|
+
"key",
|
|
50
|
+
"button",
|
|
51
|
+
"doubleClick",
|
|
52
|
+
"modifiers",
|
|
53
|
+
"filePaths",
|
|
54
|
+
"fullPage",
|
|
55
|
+
"maxEntries",
|
|
56
|
+
"timeoutMs",
|
|
57
|
+
"deltaX",
|
|
58
|
+
"deltaY",
|
|
59
|
+
"width",
|
|
60
|
+
"height",
|
|
61
|
+
"function",
|
|
62
|
+
];
|
|
63
|
+
const TOOL_SPECS = {
|
|
64
|
+
create_workspace: {
|
|
65
|
+
inputOrder: WORKSPACE_FIELDS,
|
|
66
|
+
outputFields: ["workspaceId", "projectId"],
|
|
67
|
+
},
|
|
68
|
+
list_workspaces: {},
|
|
69
|
+
archive_workspace: {
|
|
70
|
+
inputOrder: ["workspaceId"],
|
|
71
|
+
outputFields: ["workspaceId", "archivedAgentIds", "removedDirectory"],
|
|
72
|
+
},
|
|
73
|
+
rename_workspace: { inputOrder: ["title", "workspaceId"] },
|
|
74
|
+
create_agent: {
|
|
75
|
+
promptField: "initialPrompt",
|
|
76
|
+
inputOrder: AGENT_FIELDS,
|
|
77
|
+
outputFields: ["agentId", "status", "currentModeId", "cwd"],
|
|
78
|
+
},
|
|
79
|
+
send_agent_prompt: {
|
|
80
|
+
promptField: "prompt",
|
|
81
|
+
inputOrder: AGENT_FIELDS,
|
|
82
|
+
outputFields: ["status", "lastMessage", "permission"],
|
|
83
|
+
},
|
|
84
|
+
get_agent_status: { inputOrder: ["agentId"] },
|
|
85
|
+
list_agents: { inputOrder: ["cwd", "statuses", "sinceHours", "limit", "includeArchived"] },
|
|
86
|
+
cancel_agent: { inputOrder: ["agentId"] },
|
|
87
|
+
archive_agent: { inputOrder: ["agentId"] },
|
|
88
|
+
kill_agent: { inputOrder: ["agentId"] },
|
|
89
|
+
update_agent: { inputOrder: AGENT_FIELDS },
|
|
90
|
+
get_agent_activity: { inputOrder: ["agentId", "limit"] },
|
|
91
|
+
set_agent_mode: { inputOrder: ["agentId", "modeId"] },
|
|
92
|
+
list_workspace_scripts: { inputOrder: ["workspaceId"] },
|
|
93
|
+
start_workspace_script: { inputOrder: ["workspaceId", "scriptName"] },
|
|
94
|
+
stop_workspace_script: { inputOrder: ["workspaceId", "scriptName"] },
|
|
95
|
+
list_terminals: { inputOrder: ["cwd", "all"] },
|
|
96
|
+
create_terminal: { inputOrder: ["cwd", "workspaceId", "name", "command"] },
|
|
97
|
+
kill_terminal: { inputOrder: ["terminalId"] },
|
|
98
|
+
capture_terminal: { inputOrder: ["terminalId", "lines"] },
|
|
99
|
+
send_terminal_keys: { inputOrder: ["terminalId", "keys", "literal"] },
|
|
100
|
+
create_schedule: {
|
|
101
|
+
promptField: "prompt",
|
|
102
|
+
inputOrder: AUTOMATION_FIELDS,
|
|
103
|
+
outputFields: ["id", "status", "nextRunAt", "expiresAt"],
|
|
104
|
+
},
|
|
105
|
+
create_heartbeat: {
|
|
106
|
+
promptField: "prompt",
|
|
107
|
+
inputOrder: AUTOMATION_FIELDS,
|
|
108
|
+
outputFields: ["id", "status", "nextRunAt", "expiresAt"],
|
|
109
|
+
},
|
|
110
|
+
delete_heartbeat: { inputOrder: ["id"] },
|
|
111
|
+
list_schedules: {},
|
|
112
|
+
inspect_schedule: { inputOrder: ["id"] },
|
|
113
|
+
pause_schedule: { inputOrder: ["id"] },
|
|
114
|
+
resume_schedule: { inputOrder: ["id"] },
|
|
115
|
+
delete_schedule: { inputOrder: ["id"] },
|
|
116
|
+
update_schedule: { promptField: "prompt", inputOrder: AUTOMATION_FIELDS },
|
|
117
|
+
schedule_logs: { inputOrder: ["id"] },
|
|
118
|
+
run_schedule_once: { inputOrder: ["id"] },
|
|
119
|
+
list_providers: {},
|
|
120
|
+
list_models: { inputOrder: ["provider"] },
|
|
121
|
+
list_profiles: {},
|
|
122
|
+
inspect_provider: { inputOrder: ["provider", "cwd", "settings"] },
|
|
123
|
+
list_pending_permissions: {},
|
|
124
|
+
respond_to_permission: { inputOrder: ["agentId", "requestId", "response"] },
|
|
125
|
+
browser_list_tabs: {},
|
|
126
|
+
browser_new_tab: { inputOrder: BROWSER_FIELDS },
|
|
127
|
+
browser_snapshot: { inputOrder: BROWSER_FIELDS },
|
|
128
|
+
browser_click: { inputOrder: BROWSER_FIELDS },
|
|
129
|
+
browser_fill: { inputOrder: BROWSER_FIELDS },
|
|
130
|
+
browser_wait: { inputOrder: BROWSER_FIELDS },
|
|
131
|
+
browser_type: { inputOrder: BROWSER_FIELDS },
|
|
132
|
+
browser_keypress: { inputOrder: BROWSER_FIELDS },
|
|
133
|
+
browser_navigate: { inputOrder: BROWSER_FIELDS },
|
|
134
|
+
browser_back: { inputOrder: BROWSER_FIELDS },
|
|
135
|
+
browser_forward: { inputOrder: BROWSER_FIELDS },
|
|
136
|
+
browser_reload: { inputOrder: BROWSER_FIELDS },
|
|
137
|
+
browser_screenshot: { inputOrder: BROWSER_FIELDS },
|
|
138
|
+
browser_upload: { inputOrder: BROWSER_FIELDS },
|
|
139
|
+
browser_hover: { inputOrder: BROWSER_FIELDS },
|
|
140
|
+
browser_select: { inputOrder: BROWSER_FIELDS },
|
|
141
|
+
browser_drag: { inputOrder: BROWSER_FIELDS },
|
|
142
|
+
browser_logs: { inputOrder: BROWSER_FIELDS },
|
|
143
|
+
browser_evaluate: { inputOrder: BROWSER_FIELDS },
|
|
144
|
+
browser_scroll: { inputOrder: BROWSER_FIELDS },
|
|
145
|
+
browser_resize: { inputOrder: BROWSER_FIELDS },
|
|
146
|
+
browser_close_tab: { inputOrder: BROWSER_FIELDS },
|
|
147
|
+
};
|
|
148
|
+
const FIELD_LABELS = {
|
|
149
|
+
agentId: "Agent",
|
|
150
|
+
archivedAgentIds: "Archived agents",
|
|
151
|
+
baseBranch: "Base branch",
|
|
152
|
+
branchName: "New branch",
|
|
153
|
+
browserId: "Browser tab",
|
|
154
|
+
clearExpires: "Clear expiry",
|
|
155
|
+
currentModeId: "Current mode",
|
|
156
|
+
cwd: "Working directory",
|
|
157
|
+
deltaX: "Horizontal delta",
|
|
158
|
+
deltaY: "Vertical delta",
|
|
159
|
+
doubleClick: "Double click",
|
|
160
|
+
expiresIn: "Expires in",
|
|
161
|
+
expiresAt: "Expires",
|
|
162
|
+
filePaths: "Files",
|
|
163
|
+
fullPage: "Full page",
|
|
164
|
+
initialPrompt: "Prompt",
|
|
165
|
+
id: "ID",
|
|
166
|
+
lastMessage: "Last message",
|
|
167
|
+
maxEntries: "Maximum entries",
|
|
168
|
+
maxRuns: "Maximum runs",
|
|
169
|
+
modeId: "Mode",
|
|
170
|
+
newMode: "New mode",
|
|
171
|
+
nextRunAt: "Next run",
|
|
172
|
+
notifyOnFinish: "Notify on finish",
|
|
173
|
+
prNumber: "Change request",
|
|
174
|
+
projectId: "Project",
|
|
175
|
+
removedDirectory: "Removed directory",
|
|
176
|
+
requestId: "Request",
|
|
177
|
+
scriptName: "Script",
|
|
178
|
+
sessionMode: "Session mode",
|
|
179
|
+
sinceHours: "Since (hours)",
|
|
180
|
+
sourceRef: "Source",
|
|
181
|
+
targetRef: "Target",
|
|
182
|
+
terminalId: "Terminal",
|
|
183
|
+
thinkingOptionId: "Thinking",
|
|
184
|
+
timeoutMs: "Timeout (ms)",
|
|
185
|
+
updateCount: "Updates",
|
|
186
|
+
workspaceId: "Workspace",
|
|
187
|
+
worktreeSlug: "Worktree",
|
|
188
|
+
};
|
|
189
|
+
function isRecord(value) {
|
|
190
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
191
|
+
}
|
|
192
|
+
function humanizeKey(key) {
|
|
193
|
+
const known = FIELD_LABELS[key];
|
|
194
|
+
if (known)
|
|
195
|
+
return known;
|
|
196
|
+
const words = key
|
|
197
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1 $2")
|
|
198
|
+
.replace(/[._-]+/g, " ")
|
|
199
|
+
.split(" ")
|
|
200
|
+
.filter(Boolean);
|
|
201
|
+
const sentence = words.join(" ").toLowerCase();
|
|
202
|
+
return `${sentence[0]?.toUpperCase() ?? ""}${sentence.slice(1)}`;
|
|
203
|
+
}
|
|
204
|
+
function formatValue(value, depth = 0) {
|
|
205
|
+
if (value === null)
|
|
206
|
+
return "None";
|
|
207
|
+
if (value === undefined)
|
|
208
|
+
return "";
|
|
209
|
+
if (typeof value === "boolean")
|
|
210
|
+
return value ? "Yes" : "No";
|
|
211
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "bigint") {
|
|
212
|
+
return String(value);
|
|
213
|
+
}
|
|
214
|
+
if (Array.isArray(value)) {
|
|
215
|
+
if (value.length === 0)
|
|
216
|
+
return "None";
|
|
217
|
+
return value.map((item) => `• ${indentMultiline(formatValue(item, depth + 1), 2)}`).join("\n");
|
|
218
|
+
}
|
|
219
|
+
if (isRecord(value)) {
|
|
220
|
+
const entries = Object.entries(value).filter(([, child]) => child !== undefined);
|
|
221
|
+
if (entries.length === 0)
|
|
222
|
+
return "None";
|
|
223
|
+
return entries
|
|
224
|
+
.map(([key, child]) => {
|
|
225
|
+
const formatted = formatValue(child, depth + 1);
|
|
226
|
+
return `${humanizeKey(key)}: ${indentMultiline(formatted, 2)}`;
|
|
227
|
+
})
|
|
228
|
+
.join("\n");
|
|
229
|
+
}
|
|
230
|
+
return String(value);
|
|
231
|
+
}
|
|
232
|
+
function indentMultiline(value, spaces) {
|
|
233
|
+
const indentation = " ".repeat(spaces);
|
|
234
|
+
return value.replace(/\n/g, `\n${indentation}`);
|
|
235
|
+
}
|
|
236
|
+
function orderedEntries(value, order = [], omittedKey, includedKeys) {
|
|
237
|
+
const included = includedKeys ? new Set(includedKeys) : null;
|
|
238
|
+
const keys = Object.keys(value).filter((key) => key !== omittedKey && value[key] !== undefined && (!included || included.has(key)));
|
|
239
|
+
const rank = new Map(order.map((key, index) => [key, index]));
|
|
240
|
+
keys.sort((left, right) => {
|
|
241
|
+
const leftRank = rank.get(left) ?? Number.MAX_SAFE_INTEGER;
|
|
242
|
+
const rightRank = rank.get(right) ?? Number.MAX_SAFE_INTEGER;
|
|
243
|
+
return leftRank - rightRank || left.localeCompare(right);
|
|
244
|
+
});
|
|
245
|
+
return keys.map((key) => [key, value[key]]);
|
|
246
|
+
}
|
|
247
|
+
function fieldsFromValue(value, order, omittedKey, includedKeys) {
|
|
248
|
+
if (value === null || value === undefined)
|
|
249
|
+
return [];
|
|
250
|
+
if (!isRecord(value)) {
|
|
251
|
+
const formatted = formatValue(value);
|
|
252
|
+
return formatted ? [{ label: "Value", value: formatted }] : [];
|
|
253
|
+
}
|
|
254
|
+
return orderedEntries(value, order, omittedKey, includedKeys).map(([key, child]) => ({
|
|
255
|
+
label: humanizeKey(key),
|
|
256
|
+
value: formatValue(child),
|
|
257
|
+
}));
|
|
258
|
+
}
|
|
259
|
+
function parseJsonText(value) {
|
|
260
|
+
if (typeof value !== "string")
|
|
261
|
+
return undefined;
|
|
262
|
+
try {
|
|
263
|
+
return JSON.parse(value);
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function unwrapMcpResult(output) {
|
|
270
|
+
if (!isRecord(output))
|
|
271
|
+
return output;
|
|
272
|
+
if (output.structuredContent !== undefined) {
|
|
273
|
+
return output.structuredContent;
|
|
274
|
+
}
|
|
275
|
+
if (Array.isArray(output.content) && output.content.length === 1) {
|
|
276
|
+
const item = output.content[0];
|
|
277
|
+
if (isRecord(item) && item.type === "text") {
|
|
278
|
+
return parseJsonText(item.text) ?? item.text;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return output;
|
|
282
|
+
}
|
|
283
|
+
export function buildPaseoToolDetailSections(toolName, input, output) {
|
|
284
|
+
const leafName = getPaseoToolLeafName(toolName);
|
|
285
|
+
if (!leafName)
|
|
286
|
+
return null;
|
|
287
|
+
const spec = TOOL_SPECS[leafName] ?? {};
|
|
288
|
+
const sections = [];
|
|
289
|
+
if (spec.promptField && isRecord(input)) {
|
|
290
|
+
const prompt = input[spec.promptField];
|
|
291
|
+
if (typeof prompt === "string" && prompt.length > 0) {
|
|
292
|
+
sections.push({ kind: "prose", title: "Prompt", text: prompt });
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
const inputFields = fieldsFromValue(input, spec.inputOrder, spec.promptField);
|
|
296
|
+
if (inputFields.length > 0) {
|
|
297
|
+
sections.push({ kind: "fields", title: "Details", fields: inputFields });
|
|
298
|
+
}
|
|
299
|
+
const outputFields = fieldsFromValue(unwrapMcpResult(output), spec.outputFields, undefined, spec.outputFields);
|
|
300
|
+
if (outputFields.length > 0) {
|
|
301
|
+
sections.push({ kind: "fields", title: "Result", fields: outputFields });
|
|
302
|
+
}
|
|
303
|
+
return sections;
|
|
304
|
+
}
|
|
305
|
+
//# sourceMappingURL=paseo-tool-call-detail.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DEFAULT_SSH_DAEMON_PORT = 6767;
|
|
2
|
+
export interface SshTransportTarget {
|
|
3
|
+
host: string;
|
|
4
|
+
sshPort?: number;
|
|
5
|
+
daemonPort: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function validatePort(value: string | number, label: string): number;
|
|
8
|
+
export declare function validateSshHost(host: string): string;
|
|
9
|
+
export declare function parseSshTransportUri(value: string): SshTransportTarget;
|
|
10
|
+
export declare function buildSshTunnelArgs(target: SshTransportTarget): string[];
|
|
11
|
+
//# sourceMappingURL=ssh-transport.d.ts.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export const DEFAULT_SSH_DAEMON_PORT = 6767;
|
|
2
|
+
export function validatePort(value, label) {
|
|
3
|
+
const port = Number(value);
|
|
4
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) {
|
|
5
|
+
throw new Error(`${label} must be between 1 and 65535`);
|
|
6
|
+
}
|
|
7
|
+
return port;
|
|
8
|
+
}
|
|
9
|
+
export function validateSshHost(host) {
|
|
10
|
+
const normalized = host.trim();
|
|
11
|
+
if (!normalized)
|
|
12
|
+
throw new Error("SSH host is required");
|
|
13
|
+
if (/\s/u.test(normalized) || normalized.startsWith("-")) {
|
|
14
|
+
throw new Error("SSH host is invalid");
|
|
15
|
+
}
|
|
16
|
+
return normalized;
|
|
17
|
+
}
|
|
18
|
+
export function parseSshTransportUri(value) {
|
|
19
|
+
let url;
|
|
20
|
+
try {
|
|
21
|
+
url = new URL(value);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
throw new Error("Invalid SSH host URI", { cause: error });
|
|
25
|
+
}
|
|
26
|
+
if (url.protocol !== "ssh:" || url.password || (url.pathname !== "" && url.pathname !== "/")) {
|
|
27
|
+
throw new Error("Invalid SSH host URI");
|
|
28
|
+
}
|
|
29
|
+
if (url.hash)
|
|
30
|
+
throw new Error("SSH host URI does not support fragments");
|
|
31
|
+
for (const key of url.searchParams.keys()) {
|
|
32
|
+
if (key !== "daemonPort")
|
|
33
|
+
throw new Error(`Unsupported SSH host option: ${key}`);
|
|
34
|
+
}
|
|
35
|
+
const daemonPorts = url.searchParams.getAll("daemonPort");
|
|
36
|
+
if (daemonPorts.length > 1)
|
|
37
|
+
throw new Error("daemonPort may only be specified once");
|
|
38
|
+
const urlHostname = url.hostname;
|
|
39
|
+
const hostname = validateSshHost(urlHostname.startsWith("[") && urlHostname.endsWith("]")
|
|
40
|
+
? urlHostname.slice(1, -1)
|
|
41
|
+
: urlHostname);
|
|
42
|
+
const username = decodeURIComponent(url.username);
|
|
43
|
+
const host = validateSshHost(username ? `${username}@${hostname}` : hostname);
|
|
44
|
+
return {
|
|
45
|
+
host,
|
|
46
|
+
...(url.port ? { sshPort: validatePort(url.port, "SSH port") } : {}),
|
|
47
|
+
daemonPort: daemonPorts[0] === undefined
|
|
48
|
+
? DEFAULT_SSH_DAEMON_PORT
|
|
49
|
+
: validatePort(daemonPorts[0], "Daemon port"),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export function buildSshTunnelArgs(target) {
|
|
53
|
+
const host = validateSshHost(target.host);
|
|
54
|
+
const daemonPort = validatePort(target.daemonPort, "Daemon port");
|
|
55
|
+
const args = [
|
|
56
|
+
"-T",
|
|
57
|
+
"-o",
|
|
58
|
+
"BatchMode=yes",
|
|
59
|
+
"-o",
|
|
60
|
+
"ConnectTimeout=10",
|
|
61
|
+
"-o",
|
|
62
|
+
"ClearAllForwardings=yes",
|
|
63
|
+
"-o",
|
|
64
|
+
"ExitOnForwardFailure=yes",
|
|
65
|
+
];
|
|
66
|
+
if (target.sshPort !== undefined) {
|
|
67
|
+
args.push("-p", String(validatePort(target.sshPort, "SSH port")));
|
|
68
|
+
}
|
|
69
|
+
args.push("-W", `127.0.0.1:${daemonPort}`, host);
|
|
70
|
+
return args;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=ssh-transport.js.map
|
|
@@ -24,8 +24,9 @@ function humanizeToolName(name) {
|
|
|
24
24
|
.replace(/[._-]+/g, " ")
|
|
25
25
|
.split(" ")
|
|
26
26
|
.filter((segment) => segment.length > 0)
|
|
27
|
-
.
|
|
28
|
-
.
|
|
27
|
+
.join(" ")
|
|
28
|
+
.toLowerCase()
|
|
29
|
+
.replace(/^./, (character) => character.toUpperCase());
|
|
29
30
|
}
|
|
30
31
|
function formatErrorText(error) {
|
|
31
32
|
if (error === null || error === undefined) {
|
|
@@ -75,7 +76,7 @@ function buildCanonicalDetailDisplay(input) {
|
|
|
75
76
|
};
|
|
76
77
|
case "worktree_setup":
|
|
77
78
|
return {
|
|
78
|
-
displayName: "Worktree
|
|
79
|
+
displayName: "Worktree setup",
|
|
79
80
|
summary: input.detail.branchName,
|
|
80
81
|
};
|
|
81
82
|
case "sub_agent":
|
|
@@ -4650,7 +4650,17 @@ export declare const WSOutboundMessageSchema: {
|
|
|
4650
4650
|
}>;
|
|
4651
4651
|
daemonId: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4652
4652
|
hubOrigin: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4653
|
-
|
|
4653
|
+
permissions: import("zod").ZodArray<import("zod").ZodEnum<{
|
|
4654
|
+
"daemon.read": "daemon.read";
|
|
4655
|
+
"daemon.manage": "daemon.manage";
|
|
4656
|
+
"tunnel.manage": "tunnel.manage";
|
|
4657
|
+
"access.manage": "access.manage";
|
|
4658
|
+
"workspace.read": "workspace.read";
|
|
4659
|
+
"workspace.write": "workspace.write";
|
|
4660
|
+
"workspace.manage": "workspace.manage";
|
|
4661
|
+
"automation.manage": "automation.manage";
|
|
4662
|
+
"hub.execute": "hub.execute";
|
|
4663
|
+
}>>;
|
|
4654
4664
|
connectedAt: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4655
4665
|
lastError: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4656
4666
|
}, import("zod/v4/core").$strip>;
|
|
@@ -4670,7 +4680,17 @@ export declare const WSOutboundMessageSchema: {
|
|
|
4670
4680
|
}>;
|
|
4671
4681
|
daemonId: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4672
4682
|
hubOrigin: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4673
|
-
|
|
4683
|
+
permissions: import("zod").ZodArray<import("zod").ZodEnum<{
|
|
4684
|
+
"daemon.read": "daemon.read";
|
|
4685
|
+
"daemon.manage": "daemon.manage";
|
|
4686
|
+
"tunnel.manage": "tunnel.manage";
|
|
4687
|
+
"access.manage": "access.manage";
|
|
4688
|
+
"workspace.read": "workspace.read";
|
|
4689
|
+
"workspace.write": "workspace.write";
|
|
4690
|
+
"workspace.manage": "workspace.manage";
|
|
4691
|
+
"automation.manage": "automation.manage";
|
|
4692
|
+
"hub.execute": "hub.execute";
|
|
4693
|
+
}>>;
|
|
4674
4694
|
connectedAt: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4675
4695
|
lastError: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4676
4696
|
}, import("zod/v4/core").$strip>;
|
|
@@ -4690,12 +4710,52 @@ export declare const WSOutboundMessageSchema: {
|
|
|
4690
4710
|
}>;
|
|
4691
4711
|
daemonId: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4692
4712
|
hubOrigin: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4693
|
-
|
|
4713
|
+
permissions: import("zod").ZodArray<import("zod").ZodEnum<{
|
|
4714
|
+
"daemon.read": "daemon.read";
|
|
4715
|
+
"daemon.manage": "daemon.manage";
|
|
4716
|
+
"tunnel.manage": "tunnel.manage";
|
|
4717
|
+
"access.manage": "access.manage";
|
|
4718
|
+
"workspace.read": "workspace.read";
|
|
4719
|
+
"workspace.write": "workspace.write";
|
|
4720
|
+
"workspace.manage": "workspace.manage";
|
|
4721
|
+
"automation.manage": "automation.manage";
|
|
4722
|
+
"hub.execute": "hub.execute";
|
|
4723
|
+
}>>;
|
|
4694
4724
|
connectedAt: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4695
4725
|
lastError: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4696
4726
|
}, import("zod/v4/core").$strip>;
|
|
4697
4727
|
warning: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4698
4728
|
}, import("zod/v4/core").$strip>;
|
|
4729
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
4730
|
+
type: import("zod").ZodLiteral<"hub.management.daemon.permissions.update.response">;
|
|
4731
|
+
payload: import("zod").ZodObject<{
|
|
4732
|
+
requestId: import("zod").ZodString;
|
|
4733
|
+
status: import("zod").ZodObject<{
|
|
4734
|
+
state: import("zod").ZodEnum<{
|
|
4735
|
+
not_connected: "not_connected";
|
|
4736
|
+
connecting: "connecting";
|
|
4737
|
+
connected: "connected";
|
|
4738
|
+
reconnecting: "reconnecting";
|
|
4739
|
+
disconnecting: "disconnecting";
|
|
4740
|
+
revoked: "revoked";
|
|
4741
|
+
}>;
|
|
4742
|
+
daemonId: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4743
|
+
hubOrigin: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4744
|
+
permissions: import("zod").ZodArray<import("zod").ZodEnum<{
|
|
4745
|
+
"daemon.read": "daemon.read";
|
|
4746
|
+
"daemon.manage": "daemon.manage";
|
|
4747
|
+
"tunnel.manage": "tunnel.manage";
|
|
4748
|
+
"access.manage": "access.manage";
|
|
4749
|
+
"workspace.read": "workspace.read";
|
|
4750
|
+
"workspace.write": "workspace.write";
|
|
4751
|
+
"workspace.manage": "workspace.manage";
|
|
4752
|
+
"automation.manage": "automation.manage";
|
|
4753
|
+
"hub.execute": "hub.execute";
|
|
4754
|
+
}>>;
|
|
4755
|
+
connectedAt: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4756
|
+
lastError: import("zod").ZodNullable<import("zod").ZodString>;
|
|
4757
|
+
}, import("zod/v4/core").$strip>;
|
|
4758
|
+
}, import("zod/v4/core").$strip>;
|
|
4699
4759
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
4700
4760
|
type: import("zod").ZodLiteral<"diagnostics.response">;
|
|
4701
4761
|
payload: import("zod").ZodObject<{
|