@getpaseo/server 0.1.93 → 0.1.95

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.
Files changed (33) hide show
  1. package/dist/server/server/agent/agent-manager.d.ts +14 -0
  2. package/dist/server/server/agent/agent-manager.js +36 -0
  3. package/dist/server/server/agent/agent-sdk-types.d.ts +1 -0
  4. package/dist/server/server/agent/providers/claude/agent.d.ts +1 -0
  5. package/dist/server/server/agent/providers/claude/agent.js +58 -3
  6. package/dist/server/server/agent/providers/claude/task-notification-tool-call.d.ts +2 -2
  7. package/dist/server/server/agent/providers/mock-load-test-agent.js +55 -28
  8. package/dist/server/server/agent/providers/pi/agent.js +3 -1
  9. package/dist/server/server/agent/providers/pi/session-descriptor.d.ts +5 -0
  10. package/dist/server/server/agent/providers/pi/session-descriptor.js +74 -12
  11. package/dist/server/server/agent/runtime-mcp-config.d.ts +6 -0
  12. package/dist/server/server/agent/runtime-mcp-config.js +3 -0
  13. package/dist/server/server/auth.d.ts +13 -0
  14. package/dist/server/server/auth.js +35 -0
  15. package/dist/server/server/bootstrap.d.ts +2 -0
  16. package/dist/server/server/bootstrap.js +28 -1
  17. package/dist/server/server/config.js +3 -1
  18. package/dist/server/server/daemon-config-store.js +3 -0
  19. package/dist/server/server/loop-service.d.ts +6 -6
  20. package/dist/server/server/persisted-config.d.ts +61 -0
  21. package/dist/server/server/persisted-config.js +2 -0
  22. package/dist/server/server/session.d.ts +6 -0
  23. package/dist/server/server/session.js +115 -7
  24. package/dist/server/server/websocket-server.js +2 -0
  25. package/dist/server/server/workspace-git-service.d.ts +4 -1
  26. package/dist/server/server/workspace-git-service.js +40 -22
  27. package/dist/server/server/workspace-reconciliation-service.js +10 -5
  28. package/dist/server/services/github-service.d.ts +57 -0
  29. package/dist/server/services/github-service.js +434 -5
  30. package/dist/server/terminal/terminal-session-controller.d.ts +6 -0
  31. package/dist/server/terminal/terminal-session-controller.js +36 -2
  32. package/dist/src/server/persisted-config.js +2 -0
  33. package/package.json +5 -5
@@ -12,7 +12,7 @@ import { listPaseoWorktrees } from "../utils/worktree.js";
12
12
  import { READ_ONLY_GIT_ENV } from "./checkout-git-utils.js";
13
13
  import { buildWorkspaceGitMetadataFromSnapshot, } from "./workspace-git-metadata.js";
14
14
  import { checkoutLiteFromGitSnapshot, normalizeWorkspaceId } from "./workspace-registry-model.js";
15
- const WORKSPACE_GIT_WATCH_DEBOUNCE_MS = 500;
15
+ const WORKSPACE_GIT_WATCH_DEBOUNCE_MS = 1000;
16
16
  const BACKGROUND_GIT_FETCH_INTERVAL_MS = 180000;
17
17
  export const WORKSPACE_GIT_SELF_HEAL_INTERVAL_MS = 60000;
18
18
  const WORKING_TREE_WATCH_FALLBACK_REFRESH_MS = 5000;
@@ -295,6 +295,19 @@ export class WorkspaceGitServiceImpl {
295
295
  this.scheduleWorkspaceRefresh(target);
296
296
  }
297
297
  }
298
+ onWorkspaceStateMayHaveChanged(cwd) {
299
+ const normalizedCwd = normalizeWorkspaceId(cwd);
300
+ const target = this.workspaceTargets.get(normalizedCwd);
301
+ if (!target || target.closed) {
302
+ return;
303
+ }
304
+ this.deps.github.invalidate({ cwd: normalizedCwd });
305
+ this.scheduleWorkspaceRefresh(target, {
306
+ force: true,
307
+ includeGitHub: true,
308
+ reason: "external-state-change",
309
+ });
310
+ }
298
311
  dispose() {
299
312
  for (const target of this.workspaceTargets.values()) {
300
313
  this.closeWorkspaceTarget(target);
@@ -384,6 +397,7 @@ export class WorkspaceGitServiceImpl {
384
397
  listeners: new Set(),
385
398
  watchers: [],
386
399
  debounceTimer: null,
400
+ pendingDebounceRequest: null,
387
401
  selfHealTimer: null,
388
402
  githubPollSubscription: null,
389
403
  githubPollKey: null,
@@ -640,6 +654,8 @@ export class WorkspaceGitServiceImpl {
640
654
  if (!target || target.closed || this.workspaceTargets.get(target.cwd) !== target) {
641
655
  return;
642
656
  }
657
+ const request = this.buildScheduledRefreshRequest(options);
658
+ target.pendingDebounceRequest = this.mergeRefreshRequests(target.pendingDebounceRequest, request);
643
659
  if (target.debounceTimer) {
644
660
  clearTimeout(target.debounceTimer);
645
661
  }
@@ -648,12 +664,11 @@ export class WorkspaceGitServiceImpl {
648
664
  return;
649
665
  }
650
666
  target.debounceTimer = null;
651
- void this.refreshWorkspaceTarget(target, {
652
- force: options?.force === true,
653
- includeGitHub: false,
654
- reason: options?.reason ?? "watch",
655
- notify: true,
656
- });
667
+ const merged = target.pendingDebounceRequest;
668
+ target.pendingDebounceRequest = null;
669
+ if (merged) {
670
+ void this.refreshWorkspaceTarget(target, merged);
671
+ }
657
672
  }, WORKSPACE_GIT_WATCH_DEBOUNCE_MS);
658
673
  }
659
674
  startWorkspaceSubscriptionTimers(target) {
@@ -923,7 +938,7 @@ export class WorkspaceGitServiceImpl {
923
938
  const needsForcedRefresh = request.force && !target.refreshState.force;
924
939
  const needsGitHubRefresh = request.force && request.includeGitHub && !target.refreshState.includeGitHub;
925
940
  if (needsForcedRefresh || needsGitHubRefresh) {
926
- target.refreshState.queued = this.mergeQueuedRefresh(target.refreshState.queued, request);
941
+ target.refreshState.queued = this.mergeRefreshRequests(target.refreshState.queued, request);
927
942
  }
928
943
  return target.refreshState.promise;
929
944
  }
@@ -975,23 +990,26 @@ export class WorkspaceGitServiceImpl {
975
990
  }
976
991
  return this.deps.now().getTime() - target.lastShellOutAtMs < WORKSPACE_GIT_INTERNAL_MIN_GAP_MS;
977
992
  }
978
- mergeQueuedRefresh(queued, request) {
979
- if (!queued) {
980
- return {
981
- force: request.force,
982
- includeGitHub: request.includeGitHub,
983
- reason: request.reason,
984
- notify: request.notify,
985
- };
993
+ buildScheduledRefreshRequest(options) {
994
+ return {
995
+ force: options?.force === true,
996
+ includeGitHub: options?.includeGitHub ?? false,
997
+ reason: options?.reason ?? "watch",
998
+ notify: true,
999
+ };
1000
+ }
1001
+ mergeRefreshRequests(pending, request) {
1002
+ if (!pending) {
1003
+ return request;
986
1004
  }
987
- const force = queued.force || request.force;
988
- const upgradesForce = request.force && !queued.force;
989
- const upgradesGitHub = request.includeGitHub && !queued.includeGitHub;
1005
+ const force = pending.force || request.force;
1006
+ const upgradesForce = request.force && !pending.force;
1007
+ const upgradesGitHub = request.includeGitHub && !pending.includeGitHub;
990
1008
  return {
991
1009
  force,
992
- includeGitHub: queued.includeGitHub || request.includeGitHub,
993
- reason: upgradesForce || upgradesGitHub ? request.reason : queued.reason,
994
- notify: queued.notify || request.notify,
1010
+ includeGitHub: pending.includeGitHub || request.includeGitHub,
1011
+ reason: upgradesForce || upgradesGitHub ? request.reason : pending.reason,
1012
+ notify: pending.notify || request.notify,
995
1013
  };
996
1014
  }
997
1015
  async runWorkspaceRefreshLoop(target, initialRequest) {
@@ -55,10 +55,7 @@ export class WorkspaceReconciliationService {
55
55
  return;
56
56
  this.running = true;
57
57
  try {
58
- const result = await this.reconcile();
59
- if (result.changesApplied.length > 0) {
60
- this.logger.info({ changeCount: result.changesApplied.length, durationMs: result.durationMs }, "Reconciliation pass completed with changes");
61
- }
58
+ await this.reconcile();
62
59
  }
63
60
  catch (error) {
64
61
  this.logger.error({ err: error }, "Reconciliation pass failed");
@@ -130,7 +127,15 @@ export class WorkspaceReconciliationService {
130
127
  if (changes.length > 0 && this.onChanges) {
131
128
  this.onChanges(changes);
132
129
  }
133
- return { changesApplied: changes, durationMs: Date.now() - start };
130
+ const result = { changesApplied: changes, durationMs: Date.now() - start };
131
+ if (changes.length > 0) {
132
+ this.logger.info({
133
+ changeCount: changes.length,
134
+ durationMs: result.durationMs,
135
+ changes,
136
+ }, "Workspace reconciliation applied changes");
137
+ }
138
+ return result;
134
139
  }
135
140
  async mergeDuplicateProjectsByRoot(activeProjects, workspacesByProject, changes) {
136
141
  const projectsByRoot = new Map();
@@ -47,6 +47,8 @@ export interface PullRequestCheck {
47
47
  url: string | null;
48
48
  workflow?: string;
49
49
  duration?: string;
50
+ checkRunId?: number;
51
+ workflowRunId?: number;
50
52
  }
51
53
  export type PullRequestChecksStatus = "none" | "pending" | "success" | "failure";
52
54
  export type PullRequestReviewDecision = "approved" | "changes_requested" | "pending" | null;
@@ -94,6 +96,7 @@ interface PullRequestTimelineItemBase {
94
96
  id: string;
95
97
  author: string;
96
98
  authorUrl: string | null;
99
+ avatarUrl: string | null;
97
100
  body: string;
98
101
  createdAt: number;
99
102
  url: string;
@@ -103,7 +106,17 @@ export type PullRequestTimelineItem = (PullRequestTimelineItemBase & {
103
106
  reviewState: PullRequestTimelineReviewState;
104
107
  }) | (PullRequestTimelineItemBase & {
105
108
  kind: "comment";
109
+ reviewId?: string;
110
+ location?: PullRequestTimelineCommentLocation;
106
111
  });
112
+ export interface PullRequestTimelineCommentLocation {
113
+ path: string;
114
+ line?: number;
115
+ startLine?: number;
116
+ threadId?: string;
117
+ isResolved?: boolean;
118
+ isOutdated?: boolean;
119
+ }
107
120
  export type GitHubPullRequestTimelineErrorKind = "not_found" | "forbidden" | "unknown";
108
121
  export interface GitHubPullRequestTimelineError {
109
122
  kind: GitHubPullRequestTimelineErrorKind;
@@ -176,6 +189,49 @@ export type GetGitHubPullRequestTimelineOptions = {
176
189
  repoOwner: string;
177
190
  repoName: string;
178
191
  } & GitHubReadOptions;
192
+ export type GetGitHubCheckDetailsOptions = {
193
+ cwd: string;
194
+ repoOwner: string;
195
+ repoName: string;
196
+ checkRunId: number;
197
+ workflowRunId?: number;
198
+ } & GitHubReadOptions;
199
+ export interface GitHubCheckAnnotation {
200
+ path?: string;
201
+ startLine?: number;
202
+ endLine?: number;
203
+ annotationLevel?: string;
204
+ message?: string;
205
+ title?: string;
206
+ rawDetails?: string;
207
+ }
208
+ export interface GitHubCheckFailedJob {
209
+ jobId: number;
210
+ name: string;
211
+ status?: string | null;
212
+ conclusion?: string | null;
213
+ url?: string | null;
214
+ completedAt?: string;
215
+ logTail?: string;
216
+ logTruncated?: boolean;
217
+ }
218
+ export interface GitHubCheckDetails {
219
+ checkRunId: number;
220
+ workflowRunId?: number | null;
221
+ name: string;
222
+ status?: string | null;
223
+ conclusion?: string | null;
224
+ url?: string | null;
225
+ detailsUrl?: string | null;
226
+ output?: {
227
+ title?: string | null;
228
+ summary?: string | null;
229
+ text?: string | null;
230
+ } | null;
231
+ annotations: GitHubCheckAnnotation[];
232
+ failedJobs: GitHubCheckFailedJob[];
233
+ truncated: boolean;
234
+ }
179
235
  export interface GitHubSearchResult {
180
236
  items: Array<{
181
237
  kind: "issue" | "pr";
@@ -217,6 +273,7 @@ export interface GitHubService {
217
273
  headRepositoryOwner?: string;
218
274
  } & GitHubReadOptions): Promise<GitHubCurrentPullRequestStatus | null>;
219
275
  getPullRequestTimeline(options: GetGitHubPullRequestTimelineOptions): Promise<GitHubPullRequestTimeline>;
276
+ getGitHubCheckDetails(options: GetGitHubCheckDetailsOptions): Promise<GitHubCheckDetails>;
220
277
  searchIssuesAndPrs(options: SearchGitHubIssuesAndPrsOptions): Promise<GitHubSearchResult>;
221
278
  createPullRequest(options: CreateGitHubPullRequestOptions): Promise<GitHubPullRequestCreateResult>;
222
279
  mergePullRequest(options: MergeGitHubPullRequestOptions): Promise<GitHubPullRequestMergeResult>;