@getpaseo/client 0.4.0-beta.2 → 0.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/daemon-client.d.ts +83 -3
- package/dist/daemon-client.js +195 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +10 -4
- package/package.json +3 -3
package/dist/daemon-client.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
2
|
import { type ClientCapability } from "@getpaseo/protocol/client-capabilities";
|
|
3
3
|
import type { AgentAttentionNotificationPayload } from "@getpaseo/protocol/agent-attention-notification";
|
|
4
|
-
import { AgentRefreshedStatusPayloadSchema, CheckoutRenameBranchResponseSchema, RenameTerminalResponseSchema, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, type ServerInfoStatusPayload } from "@getpaseo/protocol/messages";
|
|
5
|
-
import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreatePaseoWorktreeRequest, FileDownloadTokenResponse, FileUploadResponse, FileExplorerResponse, FileVersion, FileWriteResult, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommit, ParsedDiffFile, CheckoutCommitResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutForgeSetAutoMergeResponse, CheckoutGithubSetAutoMergeResponse, CheckoutForgeGetCheckDetailsResponse, CheckoutGithubGetCheckDetailsResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, ForgeSearchResponse, ForgeSearchRequest, GitHubSearchResponse, GitHubSearchRequest, DirectorySuggestionsResponse, PaseoWorktreeListResponse, PaseoWorktreeArchiveResponse, ProjectIconSource, ProjectIconResponse, ProjectIconGetResponse, ProjectAddResponse, ProjectCreateDirectoryResponse, OpenProjectResponseMessage, WorkspaceGithubSearchRepositoriesResponse, ProjectGithubCloneProtocol, ProjectGithubCloneResponse, ArchiveWorkspaceResponseMessage, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, PaseoConfigRaw, PaseoConfigRevision, WorkspaceCreateRequest, WorkspaceRecoveryState } from "@getpaseo/protocol/messages";
|
|
4
|
+
import { AgentRefreshedStatusPayloadSchema, CheckoutRenameBranchResponseSchema, RenameTerminalResponseSchema, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, type ActiveTurnBehavior, type ServerInfoStatusPayload } from "@getpaseo/protocol/messages";
|
|
5
|
+
import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreatePaseoWorktreeRequest, FileDownloadTokenResponse, FileUploadResponse, FileExplorerResponse, FileVersion, FileWriteResult, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommit, ParsedDiffFile, CheckoutCommitResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutForgeSetAutoMergeResponse, CheckoutGithubSetAutoMergeResponse, CheckoutForgeGetCheckDetailsResponse, CheckoutGithubGetCheckDetailsResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, ForgeSearchResponse, ForgeSearchRequest, GitHubSearchResponse, GitHubSearchRequest, DirectorySuggestionsResponse, PaseoWorktreeListResponse, PaseoWorktreeArchiveResponse, ProjectIconSource, ProjectIconResponse, ProjectIconGetResponse, ProjectAddResponse, ProjectCreateDirectoryResponse, OpenProjectResponseMessage, WorkspaceGithubSearchRepositoriesResponse, ProjectGithubCloneProtocol, ProjectGithubCloneResponse, ArchiveWorkspaceResponseMessage, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DaemonConfigReloadResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, PaseoConfigRaw, PaseoConfigRevision, WorkspaceCreateRequest, WorkspaceRecoveryState, PluginListItem, PluginLogEntry, AgentSkillSelection, AgentSkillsStatus, AgentSkillsSaveResult } from "@getpaseo/protocol/messages";
|
|
6
6
|
import type { AgentPermissionRequest, AgentPermissionResponse, AgentPersistenceHandle, AgentProviderNotice, AgentProvider, AgentSessionConfig } from "@getpaseo/protocol/agent-types";
|
|
7
7
|
import type { AgentConfigApply, MutableDaemonConfig, MutableDaemonConfigPatch } from "@getpaseo/protocol/messages";
|
|
8
8
|
import { type DaemonTransportFactory, type WebSocketFactory } from "./daemon-client-transport.js";
|
|
@@ -134,6 +134,7 @@ export interface DaemonClientTrace {
|
|
|
134
134
|
}
|
|
135
135
|
export interface SendMessageOptions {
|
|
136
136
|
messageId?: string;
|
|
137
|
+
activeTurnBehavior?: ActiveTurnBehavior;
|
|
137
138
|
images?: Array<{
|
|
138
139
|
data: string;
|
|
139
140
|
mimeType: string;
|
|
@@ -398,9 +399,30 @@ export type FetchWorkspacesOptions = Omit<FetchWorkspacesRequest, "type" | "requ
|
|
|
398
399
|
};
|
|
399
400
|
export type FetchWorkspacesEntry = FetchWorkspacesPayload["entries"][number];
|
|
400
401
|
export type FetchWorkspacesPageInfo = FetchWorkspacesPayload["pageInfo"];
|
|
402
|
+
export type WorkspaceLabelListPayload = Extract<SessionOutboundMessage, {
|
|
403
|
+
type: "workspace.label.list.response";
|
|
404
|
+
}>["payload"];
|
|
405
|
+
export type WorkspaceLabelAssignmentPayload = Extract<SessionOutboundMessage, {
|
|
406
|
+
type: "workspace.label.assignment.set.response";
|
|
407
|
+
}>["payload"];
|
|
408
|
+
export type WorkspaceLabelUpdatePayload = Extract<SessionOutboundMessage, {
|
|
409
|
+
type: "workspace.label.update.response";
|
|
410
|
+
}>["payload"];
|
|
411
|
+
export type WorkspaceLabelDeletePayload = Extract<SessionOutboundMessage, {
|
|
412
|
+
type: "workspace.label.delete.response";
|
|
413
|
+
}>["payload"];
|
|
414
|
+
export type WorkspaceLabelDeleteInspectPayload = Extract<SessionOutboundMessage, {
|
|
415
|
+
type: "workspace.label.delete.inspect.response";
|
|
416
|
+
}>["payload"];
|
|
401
417
|
export type ProjectListPayload = Extract<SessionOutboundMessage, {
|
|
402
418
|
type: "project.list.response";
|
|
403
419
|
}>["payload"];
|
|
420
|
+
type ProjectListRequest = Extract<SessionInboundMessage, {
|
|
421
|
+
type: "project.list.request";
|
|
422
|
+
}>;
|
|
423
|
+
export type ProjectListOptions = Omit<ProjectListRequest, "type" | "requestId"> & {
|
|
424
|
+
requestId?: string;
|
|
425
|
+
};
|
|
404
426
|
export interface CreateScheduleOptions {
|
|
405
427
|
prompt: string;
|
|
406
428
|
name?: string | null;
|
|
@@ -631,7 +653,39 @@ export declare class DaemonClient {
|
|
|
631
653
|
fetchAgentHistory(options?: FetchAgentHistoryOptions): Promise<FetchAgentHistoryPayload>;
|
|
632
654
|
fetchRecentProviderSessions(options?: FetchRecentProviderSessionsOptions): Promise<FetchRecentProviderSessionsPayload>;
|
|
633
655
|
fetchWorkspaces(options?: FetchWorkspacesOptions): Promise<FetchWorkspacesPayload>;
|
|
634
|
-
|
|
656
|
+
listWorkspaceLabels(options: {
|
|
657
|
+
subscriptionId: string;
|
|
658
|
+
sync?: {
|
|
659
|
+
generation: string;
|
|
660
|
+
afterSeq: number;
|
|
661
|
+
};
|
|
662
|
+
requestId?: string;
|
|
663
|
+
}): Promise<WorkspaceLabelListPayload>;
|
|
664
|
+
setWorkspaceLabel(options: {
|
|
665
|
+
workspaceId: string;
|
|
666
|
+
label: Extract<SessionInboundMessage, {
|
|
667
|
+
type: "workspace.label.assignment.set.request";
|
|
668
|
+
}>["label"];
|
|
669
|
+
assigned: boolean;
|
|
670
|
+
requestId?: string;
|
|
671
|
+
}): Promise<WorkspaceLabelAssignmentPayload>;
|
|
672
|
+
updateWorkspaceLabel(options: {
|
|
673
|
+
name: string;
|
|
674
|
+
newName?: string;
|
|
675
|
+
color?: Extract<SessionInboundMessage, {
|
|
676
|
+
type: "workspace.label.update.request";
|
|
677
|
+
}>["color"];
|
|
678
|
+
requestId?: string;
|
|
679
|
+
}): Promise<WorkspaceLabelUpdatePayload>;
|
|
680
|
+
deleteWorkspaceLabel(options: {
|
|
681
|
+
name: string;
|
|
682
|
+
requestId?: string;
|
|
683
|
+
}): Promise<WorkspaceLabelDeletePayload>;
|
|
684
|
+
inspectWorkspaceLabelDelete(options: {
|
|
685
|
+
name: string;
|
|
686
|
+
requestId?: string;
|
|
687
|
+
}): Promise<WorkspaceLabelDeleteInspectPayload>;
|
|
688
|
+
listProjects(options?: string | ProjectListOptions): Promise<ProjectListPayload>;
|
|
635
689
|
openProject(cwd: string, requestId?: string): Promise<OpenProjectPayload>;
|
|
636
690
|
addProject(cwd: string, requestId?: string): Promise<ProjectAddPayload>;
|
|
637
691
|
createProjectDirectory(input: {
|
|
@@ -942,6 +996,7 @@ export declare class DaemonClient {
|
|
|
942
996
|
config: MutableDaemonConfig;
|
|
943
997
|
}>;
|
|
944
998
|
getDaemonStatus(options?: DaemonStatusOptions): Promise<DaemonStatusPayload>;
|
|
999
|
+
reloadDaemonConfig(requestId?: string): Promise<DaemonConfigReloadResponse["payload"]>;
|
|
945
1000
|
connectHub(hubUrl: string, token: string, requestId?: string): Promise<{
|
|
946
1001
|
requestId: string;
|
|
947
1002
|
status: {
|
|
@@ -1000,6 +1055,30 @@ export declare class DaemonClient {
|
|
|
1000
1055
|
listCommands(agentId: string, requestId?: string): Promise<ListCommandsPayload>;
|
|
1001
1056
|
listCommands(agentId: string, options?: LegacyListCommandsOptions): Promise<ListCommandsPayload>;
|
|
1002
1057
|
respondToPermission(agentId: string, requestId: string, response: AgentPermissionResponse): Promise<void>;
|
|
1058
|
+
getPluginCatalog(): Promise<Array<{
|
|
1059
|
+
id: string;
|
|
1060
|
+
clientBundle: string;
|
|
1061
|
+
}>>;
|
|
1062
|
+
listPlugins(): Promise<PluginListItem[]>;
|
|
1063
|
+
getPluginLogs(pluginId: string): Promise<PluginLogEntry[]>;
|
|
1064
|
+
getAgentSkillsStatus(): Promise<AgentSkillsStatus>;
|
|
1065
|
+
reconcileAgentSkills(): Promise<AgentSkillsStatus>;
|
|
1066
|
+
uninstallAgentSkills(): Promise<AgentSkillsStatus>;
|
|
1067
|
+
saveAgentSkillsSelection(selection: AgentSkillSelection, confirmedRemovals?: readonly string[]): Promise<AgentSkillsSaveResult>;
|
|
1068
|
+
importLegacyAgentSkillsSelection(selection: AgentSkillSelection): Promise<{
|
|
1069
|
+
imported: boolean;
|
|
1070
|
+
selection: AgentSkillSelection;
|
|
1071
|
+
}>;
|
|
1072
|
+
installDirectoryPlugin(path: string, id?: string): Promise<PluginListItem>;
|
|
1073
|
+
inspectDirectoryPlugin(path: string): Promise<{
|
|
1074
|
+
id: string;
|
|
1075
|
+
}>;
|
|
1076
|
+
reloadPlugin(pluginId: string): Promise<PluginListItem>;
|
|
1077
|
+
enablePlugin(pluginId: string): Promise<PluginListItem>;
|
|
1078
|
+
disablePlugin(pluginId: string): Promise<PluginListItem>;
|
|
1079
|
+
removePlugin(pluginId: string): Promise<void>;
|
|
1080
|
+
private managePlugin;
|
|
1081
|
+
invokePluginRpc(pluginId: string, method: string, input: unknown): Promise<unknown>;
|
|
1003
1082
|
respondToPermissionAndWait(agentId: string, requestId: string, response: AgentPermissionResponse, timeout?: number): Promise<AgentPermissionResolvedPayload>;
|
|
1004
1083
|
waitForAgentUpsert(agentId: string, predicate: (snapshot: AgentSnapshotPayload) => boolean, timeout?: number): Promise<AgentSnapshotPayload>;
|
|
1005
1084
|
waitForFinish(agentId: string, timeout?: number): Promise<WaitForFinishResult>;
|
|
@@ -1055,6 +1134,7 @@ export declare class DaemonClient {
|
|
|
1055
1134
|
private createRequestId;
|
|
1056
1135
|
getLastServerInfoMessage(): ServerInfoStatusPayload | null;
|
|
1057
1136
|
private requireHubRelationshipSupport;
|
|
1137
|
+
private requireDaemonConfigReloadSupport;
|
|
1058
1138
|
private resolveTransportUrlForAttempt;
|
|
1059
1139
|
private sendHelloMessage;
|
|
1060
1140
|
private disposeTransport;
|
package/dist/daemon-client.js
CHANGED
|
@@ -1041,6 +1041,7 @@ export class DaemonClient {
|
|
|
1041
1041
|
...(options?.sort ? { sort: options.sort } : {}),
|
|
1042
1042
|
...(options?.page ? { page: options.page } : {}),
|
|
1043
1043
|
...(options?.subscribe ? { subscribe: options.subscribe } : {}),
|
|
1044
|
+
...(options?.sync ? { sync: options.sync } : {}),
|
|
1044
1045
|
});
|
|
1045
1046
|
return this.sendRequest({
|
|
1046
1047
|
requestId: resolvedRequestId,
|
|
@@ -1117,6 +1118,7 @@ export class DaemonClient {
|
|
|
1117
1118
|
...(options?.sort ? { sort: options.sort } : {}),
|
|
1118
1119
|
...(options?.page ? { page: options.page } : {}),
|
|
1119
1120
|
...(options?.subscribe ? { subscribe: options.subscribe } : {}),
|
|
1121
|
+
...(options?.sync ? { sync: options.sync } : {}),
|
|
1120
1122
|
});
|
|
1121
1123
|
return this.sendRequest({
|
|
1122
1124
|
requestId: resolvedRequestId,
|
|
@@ -1133,11 +1135,60 @@ export class DaemonClient {
|
|
|
1133
1135
|
},
|
|
1134
1136
|
});
|
|
1135
1137
|
}
|
|
1136
|
-
|
|
1138
|
+
listWorkspaceLabels(options) {
|
|
1139
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
1140
|
+
requestId: options.requestId,
|
|
1141
|
+
message: {
|
|
1142
|
+
type: "workspace.label.list.request",
|
|
1143
|
+
subscribe: { subscriptionId: options.subscriptionId },
|
|
1144
|
+
...(options.sync ? { sync: options.sync } : {}),
|
|
1145
|
+
},
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
setWorkspaceLabel(options) {
|
|
1149
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
1150
|
+
requestId: options.requestId,
|
|
1151
|
+
message: {
|
|
1152
|
+
type: "workspace.label.assignment.set.request",
|
|
1153
|
+
workspaceId: options.workspaceId,
|
|
1154
|
+
label: options.label,
|
|
1155
|
+
assigned: options.assigned,
|
|
1156
|
+
},
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
updateWorkspaceLabel(options) {
|
|
1160
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
1161
|
+
requestId: options.requestId,
|
|
1162
|
+
message: {
|
|
1163
|
+
type: "workspace.label.update.request",
|
|
1164
|
+
name: options.name,
|
|
1165
|
+
...(options.newName === undefined ? {} : { newName: options.newName }),
|
|
1166
|
+
...(options.color === undefined ? {} : { color: options.color }),
|
|
1167
|
+
},
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
deleteWorkspaceLabel(options) {
|
|
1171
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
1172
|
+
requestId: options.requestId,
|
|
1173
|
+
message: { type: "workspace.label.delete.request", name: options.name },
|
|
1174
|
+
});
|
|
1175
|
+
}
|
|
1176
|
+
inspectWorkspaceLabelDelete(options) {
|
|
1177
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
1178
|
+
requestId: options.requestId,
|
|
1179
|
+
message: {
|
|
1180
|
+
type: "workspace.label.delete.inspect.request",
|
|
1181
|
+
name: options.name,
|
|
1182
|
+
},
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
async listProjects(options) {
|
|
1186
|
+
const requestId = typeof options === "string" ? options : options?.requestId;
|
|
1137
1187
|
const resolvedRequestId = this.createRequestId(requestId);
|
|
1138
1188
|
const message = SessionInboundMessageSchema.parse({
|
|
1139
1189
|
type: "project.list.request",
|
|
1140
1190
|
requestId: resolvedRequestId,
|
|
1191
|
+
...(typeof options === "object" && options.sync ? { sync: options.sync } : {}),
|
|
1141
1192
|
});
|
|
1142
1193
|
return this.sendRequest({
|
|
1143
1194
|
requestId: resolvedRequestId,
|
|
@@ -1811,6 +1862,7 @@ export class DaemonClient {
|
|
|
1811
1862
|
agentId,
|
|
1812
1863
|
text,
|
|
1813
1864
|
...(messageId ? { messageId } : {}),
|
|
1865
|
+
...(options?.activeTurnBehavior ? { activeTurnBehavior: options.activeTurnBehavior } : {}),
|
|
1814
1866
|
...(options?.images ? { images: options.images } : {}),
|
|
1815
1867
|
...(options?.attachments ? { attachments: options.attachments } : {}),
|
|
1816
1868
|
});
|
|
@@ -3072,6 +3124,13 @@ export class DaemonClient {
|
|
|
3072
3124
|
timeout: options?.timeout,
|
|
3073
3125
|
});
|
|
3074
3126
|
}
|
|
3127
|
+
async reloadDaemonConfig(requestId) {
|
|
3128
|
+
this.requireDaemonConfigReloadSupport();
|
|
3129
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
3130
|
+
requestId,
|
|
3131
|
+
message: { type: "daemon.config.reload.request" },
|
|
3132
|
+
});
|
|
3133
|
+
}
|
|
3075
3134
|
async connectHub(hubUrl, token, requestId) {
|
|
3076
3135
|
this.requireHubRelationshipSupport();
|
|
3077
3136
|
return this.sendCorrelatedSessionRequest({
|
|
@@ -3203,6 +3262,135 @@ export class DaemonClient {
|
|
|
3203
3262
|
response,
|
|
3204
3263
|
});
|
|
3205
3264
|
}
|
|
3265
|
+
async getPluginCatalog() {
|
|
3266
|
+
const requestId = this.createRequestId();
|
|
3267
|
+
const payload = await this.sendCorrelatedSessionRequest({
|
|
3268
|
+
requestId,
|
|
3269
|
+
message: { type: "plugin.catalog.get.request", requestId },
|
|
3270
|
+
responseType: "plugin.catalog.get.response",
|
|
3271
|
+
});
|
|
3272
|
+
return payload.plugins;
|
|
3273
|
+
}
|
|
3274
|
+
async listPlugins() {
|
|
3275
|
+
const requestId = this.createRequestId();
|
|
3276
|
+
const payload = await this.sendCorrelatedSessionRequest({
|
|
3277
|
+
requestId,
|
|
3278
|
+
message: { type: "plugin.list.request", requestId },
|
|
3279
|
+
responseType: "plugin.list.response",
|
|
3280
|
+
});
|
|
3281
|
+
return payload.plugins;
|
|
3282
|
+
}
|
|
3283
|
+
async getPluginLogs(pluginId) {
|
|
3284
|
+
const requestId = this.createRequestId();
|
|
3285
|
+
const payload = await this.sendCorrelatedSessionRequest({
|
|
3286
|
+
requestId,
|
|
3287
|
+
message: { type: "plugin.logs.get.request", requestId, pluginId },
|
|
3288
|
+
responseType: "plugin.logs.get.response",
|
|
3289
|
+
});
|
|
3290
|
+
return payload.entries;
|
|
3291
|
+
}
|
|
3292
|
+
async getAgentSkillsStatus() {
|
|
3293
|
+
const requestId = this.createRequestId();
|
|
3294
|
+
return this.sendCorrelatedSessionRequest({
|
|
3295
|
+
message: { type: "agent.skills.get_status.request", requestId },
|
|
3296
|
+
responseType: "agent.skills.get_status.response",
|
|
3297
|
+
});
|
|
3298
|
+
}
|
|
3299
|
+
async reconcileAgentSkills() {
|
|
3300
|
+
const requestId = this.createRequestId();
|
|
3301
|
+
return this.sendCorrelatedSessionRequest({
|
|
3302
|
+
message: { type: "agent.skills.reconcile.request", requestId },
|
|
3303
|
+
responseType: "agent.skills.reconcile.response",
|
|
3304
|
+
});
|
|
3305
|
+
}
|
|
3306
|
+
async uninstallAgentSkills() {
|
|
3307
|
+
const requestId = this.createRequestId();
|
|
3308
|
+
return this.sendCorrelatedSessionRequest({
|
|
3309
|
+
message: { type: "agent.skills.uninstall.request", requestId },
|
|
3310
|
+
responseType: "agent.skills.uninstall.response",
|
|
3311
|
+
});
|
|
3312
|
+
}
|
|
3313
|
+
async saveAgentSkillsSelection(selection, confirmedRemovals) {
|
|
3314
|
+
const requestId = this.createRequestId();
|
|
3315
|
+
return this.sendCorrelatedSessionRequest({
|
|
3316
|
+
message: {
|
|
3317
|
+
type: "agent.skills.save_selection.request",
|
|
3318
|
+
requestId,
|
|
3319
|
+
selection,
|
|
3320
|
+
...(confirmedRemovals ? { confirmedRemovals: [...confirmedRemovals] } : {}),
|
|
3321
|
+
},
|
|
3322
|
+
responseType: "agent.skills.save_selection.response",
|
|
3323
|
+
});
|
|
3324
|
+
}
|
|
3325
|
+
async importLegacyAgentSkillsSelection(selection) {
|
|
3326
|
+
const requestId = this.createRequestId();
|
|
3327
|
+
return this.sendCorrelatedSessionRequest({
|
|
3328
|
+
message: {
|
|
3329
|
+
type: "agent.skills.import_legacy_selection.request",
|
|
3330
|
+
requestId,
|
|
3331
|
+
selection,
|
|
3332
|
+
},
|
|
3333
|
+
responseType: "agent.skills.import_legacy_selection.response",
|
|
3334
|
+
});
|
|
3335
|
+
}
|
|
3336
|
+
async installDirectoryPlugin(path, id) {
|
|
3337
|
+
const requestId = this.createRequestId();
|
|
3338
|
+
const payload = await this.sendCorrelatedSessionRequest({
|
|
3339
|
+
requestId,
|
|
3340
|
+
message: { type: "plugin.directory.install.request", requestId, path, ...(id ? { id } : {}) },
|
|
3341
|
+
responseType: "plugin.directory.install.response",
|
|
3342
|
+
});
|
|
3343
|
+
return payload.plugin;
|
|
3344
|
+
}
|
|
3345
|
+
async inspectDirectoryPlugin(path) {
|
|
3346
|
+
const requestId = this.createRequestId();
|
|
3347
|
+
return this.sendCorrelatedSessionRequest({
|
|
3348
|
+
requestId,
|
|
3349
|
+
message: { type: "plugin.directory.inspect.request", requestId, path },
|
|
3350
|
+
responseType: "plugin.directory.inspect.response",
|
|
3351
|
+
});
|
|
3352
|
+
}
|
|
3353
|
+
async reloadPlugin(pluginId) {
|
|
3354
|
+
return this.managePlugin("reload", pluginId);
|
|
3355
|
+
}
|
|
3356
|
+
async enablePlugin(pluginId) {
|
|
3357
|
+
return this.managePlugin("enable", pluginId);
|
|
3358
|
+
}
|
|
3359
|
+
async disablePlugin(pluginId) {
|
|
3360
|
+
return this.managePlugin("disable", pluginId);
|
|
3361
|
+
}
|
|
3362
|
+
async removePlugin(pluginId) {
|
|
3363
|
+
const requestId = this.createRequestId();
|
|
3364
|
+
await this.sendCorrelatedSessionRequest({
|
|
3365
|
+
requestId,
|
|
3366
|
+
message: { type: "plugin.remove.request", requestId, pluginId },
|
|
3367
|
+
responseType: "plugin.remove.response",
|
|
3368
|
+
});
|
|
3369
|
+
}
|
|
3370
|
+
async managePlugin(action, pluginId) {
|
|
3371
|
+
const requestId = this.createRequestId();
|
|
3372
|
+
const payload = await this.sendCorrelatedSessionRequest({
|
|
3373
|
+
requestId,
|
|
3374
|
+
message: { type: `plugin.${action}.request`, requestId, pluginId },
|
|
3375
|
+
responseType: `plugin.${action}.response`,
|
|
3376
|
+
});
|
|
3377
|
+
return payload.plugin;
|
|
3378
|
+
}
|
|
3379
|
+
async invokePluginRpc(pluginId, method, input) {
|
|
3380
|
+
const requestId = this.createRequestId();
|
|
3381
|
+
const payload = await this.sendCorrelatedSessionRequest({
|
|
3382
|
+
requestId,
|
|
3383
|
+
message: {
|
|
3384
|
+
type: "plugin.rpc.invoke.request",
|
|
3385
|
+
requestId,
|
|
3386
|
+
pluginId,
|
|
3387
|
+
method,
|
|
3388
|
+
input,
|
|
3389
|
+
},
|
|
3390
|
+
responseType: "plugin.rpc.invoke.response",
|
|
3391
|
+
});
|
|
3392
|
+
return payload.output;
|
|
3393
|
+
}
|
|
3206
3394
|
async respondToPermissionAndWait(agentId, requestId, response, timeout = 15000) {
|
|
3207
3395
|
const message = SessionInboundMessageSchema.parse({
|
|
3208
3396
|
type: "agent_permission_response",
|
|
@@ -3640,6 +3828,12 @@ export class DaemonClient {
|
|
|
3640
3828
|
throw new Error("Update the host to use Hub relationship management.");
|
|
3641
3829
|
}
|
|
3642
3830
|
}
|
|
3831
|
+
requireDaemonConfigReloadSupport() {
|
|
3832
|
+
// COMPAT(daemonConfigReload): added in v0.4.0, remove gate after 2027-02-14.
|
|
3833
|
+
if (this.lastServerInfoMessage?.features?.daemonConfigReload !== true) {
|
|
3834
|
+
throw new Error("Update the host to reload daemon configuration.");
|
|
3835
|
+
}
|
|
3836
|
+
}
|
|
3643
3837
|
resolveTransportUrlForAttempt() {
|
|
3644
3838
|
return this.config.url;
|
|
3645
3839
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentSnapshotPayload, CreateAgentRequestMessage, FetchWorkspacesRequestMessage, FetchWorkspacesResponseMessage, GetProvidersSnapshotResponseMessage, ListAvailableProvidersResponse, ListProviderFeaturesRequestMessage, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, MutableDaemonConfig, MutableDaemonConfigPatch, ProviderDiagnosticResponseMessage, ProjectPlacementPayload, RefreshProvidersSnapshotResponseMessage, SendAgentMessageRequest, SessionOutboundMessage, WorkspaceDescriptorPayload, WorkspaceCreateRequest } from "@getpaseo/protocol/messages";
|
|
2
|
+
import { DaemonClient } from "./daemon-client.js";
|
|
2
3
|
import type { FetchAgentsEntry, FetchAgentsOptions, FetchAgentsPageInfo, FetchAgentTimelineCursor, FetchAgentTimelineDirection, FetchAgentTimelinePayload, FetchAgentTimelineProjection, WaitForFinishResult } from "./daemon-client.js";
|
|
3
4
|
export type ConnectionState = {
|
|
4
5
|
status: "idle";
|
|
@@ -89,6 +90,9 @@ export interface PaseoWorkspaceHandle {
|
|
|
89
90
|
refresh(options?: {
|
|
90
91
|
requestId?: string;
|
|
91
92
|
}): Promise<PaseoWorkspace | null>;
|
|
93
|
+
setTitle(title: string | null, requestId?: string): Promise<{
|
|
94
|
+
title: string | null;
|
|
95
|
+
}>;
|
|
92
96
|
archive(requestId?: string): Promise<PaseoWorkspaceArchiveResult>;
|
|
93
97
|
/**
|
|
94
98
|
* Subscribes to already-emitted daemon workspace_update events for this id.
|
|
@@ -282,16 +286,19 @@ export interface PaseoConfigActions {
|
|
|
282
286
|
config: MutableDaemonConfig;
|
|
283
287
|
}>;
|
|
284
288
|
}
|
|
285
|
-
export interface
|
|
289
|
+
export interface PaseoApi {
|
|
286
290
|
readonly workspaces: PaseoWorkspaceActions;
|
|
287
291
|
readonly agents: PaseoAgentActions;
|
|
288
292
|
readonly providers: PaseoProviderActions;
|
|
289
293
|
readonly config: PaseoConfigActions;
|
|
294
|
+
}
|
|
295
|
+
export interface PaseoClient extends PaseoApi {
|
|
290
296
|
connect(): Promise<void>;
|
|
291
297
|
close(): Promise<void>;
|
|
292
298
|
ensureConnected(): void;
|
|
293
299
|
getConnectionState(): ConnectionState;
|
|
294
300
|
}
|
|
295
301
|
export declare function createPaseoClient(config: PaseoClientConfig): PaseoClient;
|
|
302
|
+
export declare function createPaseoApi(daemonClient: DaemonClient): PaseoApi;
|
|
296
303
|
export {};
|
|
297
304
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,15 @@ export function createPaseoClient(config) {
|
|
|
10
10
|
clientId: config.clientId ?? createGeneratedClientId(),
|
|
11
11
|
clientType: "cli",
|
|
12
12
|
});
|
|
13
|
+
return {
|
|
14
|
+
...createPaseoApi(daemonClient),
|
|
15
|
+
connect: () => daemonClient.connect(),
|
|
16
|
+
close: () => daemonClient.close(),
|
|
17
|
+
ensureConnected: () => daemonClient.ensureConnected(),
|
|
18
|
+
getConnectionState: () => daemonClient.getConnectionState(),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function createPaseoApi(daemonClient) {
|
|
13
22
|
const createAgentHandle = createAgentHandleFactory(daemonClient);
|
|
14
23
|
const createAgent = async (options, placement) => {
|
|
15
24
|
const { config: agentConfig, cwd, parent, title, prompt, ...requestOptions } = options;
|
|
@@ -78,10 +87,6 @@ export function createPaseoClient(config) {
|
|
|
78
87
|
get: (requestId) => daemonClient.getDaemonConfig(requestId),
|
|
79
88
|
patch: (patch, requestId) => daemonClient.patchDaemonConfig(patch, requestId),
|
|
80
89
|
},
|
|
81
|
-
connect: () => daemonClient.connect(),
|
|
82
|
-
close: () => daemonClient.close(),
|
|
83
|
-
ensureConnected: () => daemonClient.ensureConnected(),
|
|
84
|
-
getConnectionState: () => daemonClient.getConnectionState(),
|
|
85
90
|
};
|
|
86
91
|
}
|
|
87
92
|
function createWorkspaceHandleFactory(daemonClient, createAgent) {
|
|
@@ -132,6 +137,7 @@ function createWorkspaceHandleFactory(daemonClient, createAgent) {
|
|
|
132
137
|
},
|
|
133
138
|
current: () => current,
|
|
134
139
|
refresh,
|
|
140
|
+
setTitle: (title, requestId) => daemonClient.setWorkspaceTitle(id, title, requestId),
|
|
135
141
|
archive: async (requestId) => {
|
|
136
142
|
const result = await daemonClient.archiveWorkspace(id, requestId);
|
|
137
143
|
if (current) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpaseo/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-beta.1",
|
|
4
4
|
"description": "Paseo client SDK package",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"test": "vitest run"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@getpaseo/protocol": "0.
|
|
43
|
-
"@getpaseo/relay": "0.
|
|
42
|
+
"@getpaseo/protocol": "0.5.0-beta.1",
|
|
43
|
+
"@getpaseo/relay": "0.5.0-beta.1",
|
|
44
44
|
"zod": "^4.4.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|