@getpaseo/client 0.1.107 → 0.1.109

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.
@@ -1,7 +1,7 @@
1
1
  import type { z } from "zod";
2
2
  import { type ClientCapability } from "@getpaseo/protocol/client-capabilities";
3
3
  import { AgentRefreshedStatusPayloadSchema, CheckoutRenameBranchResponseSchema, RenameTerminalResponseSchema, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, type ServerInfoStatusPayload } from "@getpaseo/protocol/messages";
4
- import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreatePaseoWorktreeRequest, FileDownloadTokenResponse, FileUploadResponse, FileExplorerResponse, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommitResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutGithubSetAutoMergeResponse, CheckoutGithubGetCheckDetailsResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, GitHubSearchResponse, GitHubSearchRequest, DirectorySuggestionsResponse, PaseoWorktreeListResponse, PaseoWorktreeArchiveResponse, ProjectIconResponse, ProjectAddResponse, OpenProjectResponseMessage, 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 } from "@getpaseo/protocol/messages";
4
+ import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreatePaseoWorktreeRequest, FileDownloadTokenResponse, FileUploadResponse, FileExplorerResponse, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommitResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutGithubSetAutoMergeResponse, CheckoutGithubGetCheckDetailsResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, GitHubSearchResponse, GitHubSearchRequest, DirectorySuggestionsResponse, PaseoWorktreeListResponse, PaseoWorktreeArchiveResponse, ProjectIconResponse, 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 } from "@getpaseo/protocol/messages";
5
5
  import type { AgentPermissionRequest, AgentPermissionResponse, AgentPersistenceHandle, AgentProviderNotice, AgentProvider, AgentSessionConfig } from "@getpaseo/protocol/agent-types";
6
6
  import type { MutableDaemonConfig, MutableDaemonConfigPatch } from "@getpaseo/protocol/messages";
7
7
  import { type DaemonTransportFactory, type WebSocketFactory } from "./daemon-client-transport.js";
@@ -341,6 +341,7 @@ export interface FetchProviderSubagentTimelineOptions {
341
341
  timeout?: number;
342
342
  }
343
343
  export interface AgentForkContextOptions {
344
+ boundaryCursor?: FetchAgentTimelineCursor;
344
345
  boundaryMessageId?: string;
345
346
  requestId?: string;
346
347
  }
@@ -552,6 +553,9 @@ export interface RenameTerminalInput {
552
553
  }
553
554
  type OpenProjectPayload = OpenProjectResponseMessage["payload"];
554
555
  type ProjectAddPayload = ProjectAddResponse["payload"];
556
+ export type ProjectCreateDirectoryPayload = ProjectCreateDirectoryResponse["payload"];
557
+ export type WorkspaceGithubSearchRepositoriesPayload = WorkspaceGithubSearchRepositoriesResponse["payload"];
558
+ type ProjectGithubClonePayload = ProjectGithubCloneResponse["payload"];
555
559
  type ArchiveWorkspacePayload = ArchiveWorkspaceResponseMessage["payload"];
556
560
  type WorkspaceSetupStatusPayload = WorkspaceSetupStatusResponseMessage["payload"];
557
561
  export interface FetchAgentResult {
@@ -684,6 +688,19 @@ export declare class DaemonClient {
684
688
  fetchWorkspaces(options?: FetchWorkspacesOptions): Promise<FetchWorkspacesPayload>;
685
689
  openProject(cwd: string, requestId?: string): Promise<OpenProjectPayload>;
686
690
  addProject(cwd: string, requestId?: string): Promise<ProjectAddPayload>;
691
+ createProjectDirectory(input: {
692
+ parentPath: string;
693
+ name: string;
694
+ }, requestId?: string): Promise<ProjectCreateDirectoryPayload>;
695
+ searchGithubRepositories(input: {
696
+ query: string;
697
+ limit?: number;
698
+ }, requestId?: string): Promise<WorkspaceGithubSearchRepositoriesPayload>;
699
+ cloneGithubProject(input: {
700
+ repo: string;
701
+ targetDirectory: string;
702
+ cloneProtocol?: ProjectGithubCloneProtocol;
703
+ }, requestId?: string): Promise<ProjectGithubClonePayload>;
687
704
  startWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
688
705
  type: "start_workspace_script_response";
689
706
  }>["payload"]>;
@@ -713,6 +730,9 @@ export declare class DaemonClient {
713
730
  setWorkspaceTitle(workspaceId: string, title: string | null, requestId?: string): Promise<{
714
731
  title: string | null;
715
732
  }>;
733
+ setWorkspacePinned(workspaceId: string, pinned: boolean, requestId?: string): Promise<{
734
+ pinnedAt: string | null;
735
+ }>;
716
736
  resumeAgent(handle: AgentPersistenceHandle, overrides?: Partial<AgentSessionConfig>): Promise<AgentSnapshotPayload>;
717
737
  importAgent(input: ImportAgentInput): Promise<AgentSnapshotPayload>;
718
738
  refreshAgent(agentId: string, requestId?: string): Promise<AgentRefreshedStatusPayload>;
@@ -17,6 +17,7 @@ const consoleLogger = {
17
17
  const perfNow = typeof performance !== "undefined" && typeof performance.now === "function"
18
18
  ? () => performance.now()
19
19
  : () => Date.now();
20
+ const PROJECT_GITHUB_CLONE_TIMEOUT_MS = 5 * 60 * 1000;
20
21
  function normalizePassword(value) {
21
22
  if (typeof value !== "string") {
22
23
  return null;
@@ -1020,6 +1021,39 @@ export class DaemonClient {
1020
1021
  responseType: "project.add.response",
1021
1022
  });
1022
1023
  }
1024
+ async createProjectDirectory(input, requestId) {
1025
+ return this.sendNamespacedCorrelatedSessionRequest({
1026
+ requestId,
1027
+ message: {
1028
+ type: "project.create_directory.request",
1029
+ parentPath: input.parentPath,
1030
+ name: input.name,
1031
+ },
1032
+ });
1033
+ }
1034
+ async searchGithubRepositories(input, requestId) {
1035
+ return this.sendNamespacedCorrelatedSessionRequest({
1036
+ requestId,
1037
+ message: {
1038
+ type: "workspace.github.search_repositories.request",
1039
+ query: input.query,
1040
+ limit: input.limit,
1041
+ },
1042
+ });
1043
+ }
1044
+ async cloneGithubProject(input, requestId) {
1045
+ const message = {
1046
+ type: "project.github.clone.request",
1047
+ repo: input.repo,
1048
+ targetDirectory: input.targetDirectory,
1049
+ ...(input.cloneProtocol ? { cloneProtocol: input.cloneProtocol } : {}),
1050
+ };
1051
+ return this.sendNamespacedCorrelatedSessionRequest({
1052
+ requestId,
1053
+ message,
1054
+ timeout: PROJECT_GITHUB_CLONE_TIMEOUT_MS,
1055
+ });
1056
+ }
1023
1057
  async startWorkspaceScript(workspaceId, scriptName, requestId) {
1024
1058
  return this.sendCorrelatedSessionRequest({
1025
1059
  requestId,
@@ -1290,6 +1324,21 @@ export class DaemonClient {
1290
1324
  }
1291
1325
  return { title: payload.title };
1292
1326
  }
1327
+ async setWorkspacePinned(workspaceId, pinned, requestId) {
1328
+ const payload = await this.sendCorrelatedSessionRequest({
1329
+ requestId,
1330
+ message: {
1331
+ type: "workspace.pin.set.request",
1332
+ workspaceId,
1333
+ pinned,
1334
+ },
1335
+ responseType: "workspace.pin.set.response",
1336
+ });
1337
+ if (!payload.accepted) {
1338
+ throw new Error(payload.error ?? "setWorkspacePinned rejected");
1339
+ }
1340
+ return { pinnedAt: payload.pinnedAt };
1341
+ }
1293
1342
  async resumeAgent(handle, overrides) {
1294
1343
  const requestId = this.createRequestId();
1295
1344
  const message = SessionInboundMessageSchema.parse({
@@ -1458,6 +1507,7 @@ export class DaemonClient {
1458
1507
  type: "agent.fork_context.request",
1459
1508
  agentId,
1460
1509
  requestId: resolvedRequestId,
1510
+ ...(options.boundaryCursor ? { boundaryCursor: options.boundaryCursor } : {}),
1461
1511
  ...(options.boundaryMessageId ? { boundaryMessageId: options.boundaryMessageId } : {}),
1462
1512
  });
1463
1513
  const payload = await this.sendRequest({
@@ -1551,7 +1601,7 @@ export class DaemonClient {
1551
1601
  agentId,
1552
1602
  requestId,
1553
1603
  });
1554
- await this.sendRequest({
1604
+ const payload = await this.sendRequest({
1555
1605
  requestId,
1556
1606
  message,
1557
1607
  options: { skipQueue: true },
@@ -1565,6 +1615,9 @@ export class DaemonClient {
1565
1615
  return msg.payload;
1566
1616
  },
1567
1617
  });
1618
+ if (payload.error) {
1619
+ throw new Error(payload.error);
1620
+ }
1568
1621
  }
1569
1622
  async setAgentMode(agentId, modeId) {
1570
1623
  const requestId = this.createRequestId();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/client",
3
- "version": "0.1.107",
3
+ "version": "0.1.109",
4
4
  "description": "Paseo client SDK package",
5
5
  "files": [
6
6
  "dist",
@@ -35,8 +35,8 @@
35
35
  "test": "vitest run"
36
36
  },
37
37
  "dependencies": {
38
- "@getpaseo/protocol": "0.1.107",
39
- "@getpaseo/relay": "0.1.107",
38
+ "@getpaseo/protocol": "0.1.109",
39
+ "@getpaseo/relay": "0.1.109",
40
40
  "zod": "^4.4.3"
41
41
  },
42
42
  "devDependencies": {