@getpaseo/server 0.1.88 → 0.1.90
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/server/server/agent/agent-manager.js +4 -1
- package/dist/server/server/agent/agent-prompt.js +4 -1
- package/dist/server/server/agent/agent-sdk-types.d.ts +1 -0
- package/dist/server/server/agent/agent-storage.d.ts +22 -22
- package/dist/server/server/agent/agent-storage.js +2 -9
- package/dist/server/server/agent/create-agent/create.d.ts +2 -0
- package/dist/server/server/agent/create-agent/create.js +26 -7
- package/dist/server/server/agent/create-agent-lifecycle-dispatch.d.ts +1 -0
- package/dist/server/server/agent/create-agent-lifecycle-dispatch.js +4 -0
- package/dist/server/server/agent/create-agent-mode.d.ts +3 -8
- package/dist/server/server/agent/create-agent-mode.js +16 -2
- package/dist/server/server/agent/import-sessions.js +1 -1
- package/dist/server/server/agent/mcp-server.d.ts +1 -0
- package/dist/server/server/agent/mcp-server.js +113 -70
- package/dist/server/server/agent/provider-snapshot-manager.d.ts +2 -1
- package/dist/server/server/agent/provider-snapshot-manager.js +18 -2
- package/dist/server/server/agent/providers/acp-agent.d.ts +3 -3
- package/dist/server/server/agent/providers/acp-agent.js +18 -13
- package/dist/server/server/agent/providers/codex-app-server-agent.js +16 -22
- package/dist/server/server/agent/providers/mock-load-test-agent.d.ts +2 -0
- package/dist/server/server/agent/providers/mock-load-test-agent.js +69 -2
- package/dist/server/server/agent/providers/opencode-agent.js +19 -8
- package/dist/server/server/agent/providers/pi/agent.js +13 -0
- package/dist/server/server/agent/providers/pi/rpc-types.d.ts +3 -0
- package/dist/server/server/agent/timeline-projection.js +30 -1
- package/dist/server/server/atomic-file.d.ts +3 -0
- package/dist/server/server/atomic-file.js +19 -0
- package/dist/server/server/auto-archive-on-merge/archive-if-safe.d.ts +1 -0
- package/dist/server/server/auto-archive-on-merge/archive-if-safe.js +10 -2
- package/dist/server/server/bootstrap.d.ts +7 -2
- package/dist/server/server/bootstrap.js +154 -115
- package/dist/server/server/chat/chat-service.js +2 -4
- package/dist/server/server/config.js +41 -0
- package/dist/server/server/daemon-keypair.js +2 -2
- package/dist/server/server/loop-service.d.ts +26 -22
- package/dist/server/server/loop-service.js +27 -9
- package/dist/server/server/package-version.d.ts +2 -2
- package/dist/server/server/paseo-worktree-archive-service.d.ts +2 -0
- package/dist/server/server/paseo-worktree-archive-service.js +28 -9
- package/dist/server/server/persisted-config.d.ts +84 -28
- package/dist/server/server/persisted-config.js +20 -3
- package/dist/server/server/pid-lock.d.ts +2 -2
- package/dist/server/server/private-files.d.ts +0 -1
- package/dist/server/server/private-files.js +0 -5
- package/dist/server/server/schedule/service.d.ts +6 -0
- package/dist/server/server/schedule/service.js +41 -18
- package/dist/server/server/schedule/store.js +3 -2
- package/dist/server/server/script-health-monitor.d.ts +4 -4
- package/dist/server/server/script-health-monitor.js +6 -6
- package/dist/server/server/script-proxy.d.ts +2 -39
- package/dist/server/server/script-proxy.js +1 -244
- package/dist/server/server/script-route-branch-handler.d.ts +2 -2
- package/dist/server/server/script-route-branch-handler.js +3 -37
- package/dist/server/server/script-status-projection.d.ts +6 -4
- package/dist/server/server/script-status-projection.js +85 -37
- package/dist/server/server/server-id.js +3 -3
- package/dist/server/server/service-proxy.d.ts +237 -0
- package/dist/server/server/service-proxy.js +714 -0
- package/dist/server/server/session.d.ts +12 -18
- package/dist/server/server/session.js +206 -117
- package/dist/server/server/speech/providers/local/worker-client.js +1 -11
- package/dist/server/server/websocket-server.d.ts +7 -4
- package/dist/server/server/websocket-server.js +9 -4
- package/dist/server/server/workspace-bootstrap-dedupe.d.ts +34 -0
- package/dist/server/server/workspace-bootstrap-dedupe.js +23 -0
- package/dist/server/server/workspace-directory.d.ts +8 -0
- package/dist/server/server/workspace-directory.js +141 -11
- package/dist/server/server/workspace-git-service.d.ts +3 -0
- package/dist/server/server/workspace-git-service.js +53 -12
- package/dist/server/server/workspace-registry.d.ts +2 -2
- package/dist/server/server/workspace-registry.js +2 -6
- package/dist/server/server/workspace-service-env.d.ts +1 -0
- package/dist/server/server/workspace-service-env.js +23 -18
- package/dist/server/server/worktree/commands.d.ts +2 -0
- package/dist/server/server/worktree/commands.js +4 -1
- package/dist/server/server/worktree-bootstrap.d.ts +4 -3
- package/dist/server/server/worktree-bootstrap.js +14 -13
- package/dist/server/server/worktree-core.d.ts +1 -0
- package/dist/server/server/worktree-core.js +2 -0
- package/dist/server/server/worktree-session.d.ts +6 -2
- package/dist/server/server/worktree-session.js +3 -0
- package/dist/server/services/github-service.d.ts +1 -0
- package/dist/server/services/github-service.js +7 -1
- package/dist/server/utils/checkout-git.d.ts +6 -3
- package/dist/server/utils/checkout-git.js +40 -38
- package/dist/server/utils/worktree.d.ts +17 -12
- package/dist/server/utils/worktree.js +39 -22
- package/dist/src/server/persisted-config.js +20 -3
- package/dist/src/server/private-files.js +0 -5
- package/package.json +9 -7
- package/dist/server/server/editor-targets.d.ts +0 -18
- package/dist/server/server/editor-targets.js +0 -109
- package/dist/server/utils/script-hostname.d.ts +0 -8
- package/dist/server/utils/script-hostname.js +0 -14
|
@@ -62,6 +62,9 @@ const MODELS = [
|
|
|
62
62
|
function shouldEmitPlanApprovalPrompt(prompt) {
|
|
63
63
|
return /emit\s+(?:a\s+)?synthetic\s+plan\s+approval/i.test(promptToText(prompt));
|
|
64
64
|
}
|
|
65
|
+
function shouldEmitQuestionPrompt(prompt) {
|
|
66
|
+
return /emit\s+(?:a\s+)?synthetic\s+questions?/i.test(promptToText(prompt));
|
|
67
|
+
}
|
|
65
68
|
function resolveModelProfile(modelId) {
|
|
66
69
|
const model = MODELS.find((entry) => entry.id === modelId) ?? MODELS[0];
|
|
67
70
|
const metadata = model.metadata ?? {};
|
|
@@ -389,6 +392,9 @@ export class MockLoadTestAgentSession {
|
|
|
389
392
|
if (shouldEmitPlanApprovalPrompt(prompt)) {
|
|
390
393
|
this.schedulePlanApprovalTurn(turn);
|
|
391
394
|
}
|
|
395
|
+
else if (shouldEmitQuestionPrompt(prompt)) {
|
|
396
|
+
this.scheduleQuestionPromptTurn(turn);
|
|
397
|
+
}
|
|
392
398
|
else if (largePayload) {
|
|
393
399
|
this.scheduleLargePayloadTurn(turn, largePayload);
|
|
394
400
|
}
|
|
@@ -432,9 +438,11 @@ export class MockLoadTestAgentSession {
|
|
|
432
438
|
return Array.from(this.pendingPermissions.values());
|
|
433
439
|
}
|
|
434
440
|
async respondToPermission(requestId, response) {
|
|
435
|
-
|
|
441
|
+
const request = this.pendingPermissions.get(requestId);
|
|
442
|
+
if (!request) {
|
|
436
443
|
return undefined;
|
|
437
444
|
}
|
|
445
|
+
this.pendingPermissions.delete(requestId);
|
|
438
446
|
const turn = this.activeTurn;
|
|
439
447
|
this.emit({
|
|
440
448
|
type: "permission_resolved",
|
|
@@ -444,7 +452,9 @@ export class MockLoadTestAgentSession {
|
|
|
444
452
|
...(turn ? { turnId: turn.turnId } : {}),
|
|
445
453
|
});
|
|
446
454
|
if (turn) {
|
|
447
|
-
this.finishTurnWithText(turn,
|
|
455
|
+
this.finishTurnWithText(turn, request.kind === "question"
|
|
456
|
+
? "Synthetic questions resolved"
|
|
457
|
+
: "Synthetic plan approval resolved");
|
|
448
458
|
}
|
|
449
459
|
return undefined;
|
|
450
460
|
}
|
|
@@ -527,6 +537,12 @@ export class MockLoadTestAgentSession {
|
|
|
527
537
|
}, 0);
|
|
528
538
|
turn.timer.unref?.();
|
|
529
539
|
}
|
|
540
|
+
scheduleQuestionPromptTurn(turn) {
|
|
541
|
+
turn.timer = setTimeout(() => {
|
|
542
|
+
this.emitQuestionPromptTurn(turn);
|
|
543
|
+
}, 0);
|
|
544
|
+
turn.timer.unref?.();
|
|
545
|
+
}
|
|
530
546
|
emitPlanApprovalTurn(turn) {
|
|
531
547
|
if (this.activeTurn !== turn) {
|
|
532
548
|
return;
|
|
@@ -575,6 +591,57 @@ export class MockLoadTestAgentSession {
|
|
|
575
591
|
turnId: turn.turnId,
|
|
576
592
|
});
|
|
577
593
|
}
|
|
594
|
+
emitQuestionPromptTurn(turn) {
|
|
595
|
+
if (this.activeTurn !== turn) {
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
this.clearTurnTimer(turn);
|
|
599
|
+
this.emit({
|
|
600
|
+
type: "turn_started",
|
|
601
|
+
provider: this.provider,
|
|
602
|
+
turnId: turn.turnId,
|
|
603
|
+
});
|
|
604
|
+
const request = {
|
|
605
|
+
id: `mock-questions-${turn.turnId}`,
|
|
606
|
+
provider: this.provider,
|
|
607
|
+
name: "MockQuestions",
|
|
608
|
+
kind: "question",
|
|
609
|
+
title: "Questions",
|
|
610
|
+
input: {
|
|
611
|
+
questions: [
|
|
612
|
+
{
|
|
613
|
+
question: "Which surface should this apply to?",
|
|
614
|
+
header: "surface",
|
|
615
|
+
options: [{ label: "App" }, { label: "Desktop" }],
|
|
616
|
+
multiSelect: false,
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
question: "Which rollout should we use?",
|
|
620
|
+
header: "rollout",
|
|
621
|
+
options: [{ label: "Immediately" }, { label: "Behind feature flag" }],
|
|
622
|
+
multiSelect: false,
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
question: "What success criteria should we use?",
|
|
626
|
+
header: "success",
|
|
627
|
+
options: [],
|
|
628
|
+
multiSelect: false,
|
|
629
|
+
placeholder: "Describe success...",
|
|
630
|
+
},
|
|
631
|
+
],
|
|
632
|
+
},
|
|
633
|
+
metadata: {
|
|
634
|
+
source: "mock_questions",
|
|
635
|
+
},
|
|
636
|
+
};
|
|
637
|
+
this.pendingPermissions.set(request.id, request);
|
|
638
|
+
this.emit({
|
|
639
|
+
type: "permission_requested",
|
|
640
|
+
provider: this.provider,
|
|
641
|
+
request,
|
|
642
|
+
turnId: turn.turnId,
|
|
643
|
+
});
|
|
644
|
+
}
|
|
578
645
|
emitStressTurn(turn, stress) {
|
|
579
646
|
if (this.activeTurn !== turn) {
|
|
580
647
|
return;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
2
|
import { createPathEquivalenceMatcher } from "../../../utils/path.js";
|
|
3
|
+
import pLimit from "p-limit";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { getAgentStreamEventTurnId, } from "../agent-sdk-types.js";
|
|
5
6
|
import { isDefaultAgentCreateConfigUnattended, resolveDefaultAgentCreateConfig, } from "../create-agent-mode.js";
|
|
@@ -57,10 +58,17 @@ function withOpenCodeAutoAcceptFeature(featureValues, enabled) {
|
|
|
57
58
|
}
|
|
58
59
|
function resolveOpenCodeCreateConfig(input) {
|
|
59
60
|
const legacyFullAccess = input.requestedMode === OPENCODE_LEGACY_FULL_ACCESS_MODE_ID;
|
|
60
|
-
const
|
|
61
|
-
const
|
|
61
|
+
const parent = input.parent;
|
|
62
|
+
const isUnattendedCreate = input.unattended || parent?.isUnattended === true;
|
|
63
|
+
const inheritsUnattended = input.requestedMode === undefined && isUnattendedCreate;
|
|
64
|
+
const inheritedOpenCodeMode = inheritsUnattended && parent?.provider === input.provider
|
|
65
|
+
? (parent.modeId ?? undefined)
|
|
66
|
+
: undefined;
|
|
67
|
+
const requestedMode = legacyFullAccess
|
|
68
|
+
? OPENCODE_BUILD_MODE_ID
|
|
69
|
+
: (input.requestedMode ?? inheritedOpenCodeMode);
|
|
62
70
|
const featureValues = legacyFullAccess ||
|
|
63
|
-
(
|
|
71
|
+
(isUnattendedCreate && input.featureValues?.[OPENCODE_AUTO_ACCEPT_FEATURE_ID] === undefined)
|
|
64
72
|
? withOpenCodeAutoAcceptFeature(input.featureValues, true)
|
|
65
73
|
: input.featureValues;
|
|
66
74
|
if (inheritsUnattended && requestedMode === undefined) {
|
|
@@ -124,6 +132,8 @@ function resolveOpenCodePermissionReply(response) {
|
|
|
124
132
|
}
|
|
125
133
|
const MCP_ALREADY_PRESENT_ERROR_TOKENS = ["already", "exists", "connected"];
|
|
126
134
|
const OPENCODE_PROVIDER_LIST_TIMEOUT_MS = 30000;
|
|
135
|
+
const OPENCODE_METADATA_CONCURRENCY = 4;
|
|
136
|
+
const openCodeMetadataLimit = pLimit(OPENCODE_METADATA_CONCURRENCY);
|
|
127
137
|
const OPENCODE_HANDLED_BUILTIN_SLASH_COMMANDS = [
|
|
128
138
|
{ name: "compact", description: "Compact the current session", argumentHint: "" },
|
|
129
139
|
{ name: "summarize", description: "Compact the current session", argumentHint: "" },
|
|
@@ -918,7 +928,7 @@ export class OpenCodeAgentClient {
|
|
|
918
928
|
try {
|
|
919
929
|
// Background model discovery can be legitimately slow while OpenCode refreshes
|
|
920
930
|
// provider state, so allow longer than turn execution paths.
|
|
921
|
-
const response = await withTimeout(client.provider.list({ directory: options.cwd }), OPENCODE_PROVIDER_LIST_TIMEOUT_MS, `OpenCode provider.list timed out after ${OPENCODE_PROVIDER_LIST_TIMEOUT_MS / 1000}s - server may not be authenticated or connected to any providers`);
|
|
931
|
+
const response = await openCodeMetadataLimit(() => withTimeout(client.provider.list({ directory: options.cwd }), OPENCODE_PROVIDER_LIST_TIMEOUT_MS, `OpenCode provider.list timed out after ${OPENCODE_PROVIDER_LIST_TIMEOUT_MS / 1000}s - server may not be authenticated or connected to any providers`));
|
|
922
932
|
if (response.error) {
|
|
923
933
|
throw new Error(`Failed to fetch OpenCode providers: ${JSON.stringify(response.error)}`);
|
|
924
934
|
}
|
|
@@ -964,7 +974,7 @@ export class OpenCodeAgentClient {
|
|
|
964
974
|
const directory = options.cwd;
|
|
965
975
|
const client = this.runtime.createClient({ baseUrl: url, directory });
|
|
966
976
|
try {
|
|
967
|
-
const response = await withTimeout(client.app.agents({ directory }), 10000, "OpenCode app.agents timed out after 10s");
|
|
977
|
+
const response = await openCodeMetadataLimit(() => withTimeout(client.app.agents({ directory }), 10000, "OpenCode app.agents timed out after 10s"));
|
|
968
978
|
if (response.error || !response.data) {
|
|
969
979
|
return DEFAULT_MODES;
|
|
970
980
|
}
|
|
@@ -1102,7 +1112,7 @@ export class OpenCodeAgentClient {
|
|
|
1102
1112
|
return normalizeOpenCodeConfig({ ...config, provider: "opencode" });
|
|
1103
1113
|
}
|
|
1104
1114
|
async populateModelContextWindowCache(client, cwd) {
|
|
1105
|
-
const response = await client.provider.list({ directory: cwd });
|
|
1115
|
+
const response = await openCodeMetadataLimit(() => client.provider.list({ directory: cwd }));
|
|
1106
1116
|
if (response.error || !response.data) {
|
|
1107
1117
|
return;
|
|
1108
1118
|
}
|
|
@@ -1794,6 +1804,7 @@ function appendOpenCodeQuestionAsked(event, state, events) {
|
|
|
1794
1804
|
header: q.header,
|
|
1795
1805
|
options,
|
|
1796
1806
|
...(q.multiple === true ? { multiSelect: true } : {}),
|
|
1807
|
+
allowOther: true,
|
|
1797
1808
|
},
|
|
1798
1809
|
];
|
|
1799
1810
|
});
|
|
@@ -2467,9 +2478,9 @@ class OpenCodeAgentSession {
|
|
|
2467
2478
|
if (this.availableModesCache) {
|
|
2468
2479
|
return this.availableModesCache;
|
|
2469
2480
|
}
|
|
2470
|
-
const response = await this.client.app.agents({
|
|
2481
|
+
const response = await openCodeMetadataLimit(() => this.client.app.agents({
|
|
2471
2482
|
directory: this.config.cwd,
|
|
2472
|
-
});
|
|
2483
|
+
}));
|
|
2473
2484
|
const agents = response.error || !response.data ? [] : response.data;
|
|
2474
2485
|
const discoveredModes = agents.filter(isSelectableOpenCodeAgent).map(mapOpenCodeAgentToMode);
|
|
2475
2486
|
this.availableModesCache = mergeOpenCodeModes(discoveredModes);
|
|
@@ -1148,6 +1148,19 @@ export class PiRpcAgentSession {
|
|
|
1148
1148
|
}
|
|
1149
1149
|
}
|
|
1150
1150
|
handleMessageEnd(event, turnId) {
|
|
1151
|
+
if (event.message.role === "custom") {
|
|
1152
|
+
const text = getUserMessageText(event.message.content);
|
|
1153
|
+
if (text) {
|
|
1154
|
+
this.emit({
|
|
1155
|
+
type: "timeline",
|
|
1156
|
+
provider: PI_PROVIDER,
|
|
1157
|
+
turnId,
|
|
1158
|
+
item: { type: "assistant_message", text },
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
this.completeTurn(turnId, []);
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1151
1164
|
if (event.message.role !== "user") {
|
|
1152
1165
|
return;
|
|
1153
1166
|
}
|
|
@@ -22,6 +22,9 @@ export type PiAssistantContent = PiTextContent | PiThinkingContent | PiToolCallC
|
|
|
22
22
|
export type PiAgentMessage = {
|
|
23
23
|
role: "user";
|
|
24
24
|
content: string | Array<PiTextContent | PiImageContent>;
|
|
25
|
+
} | {
|
|
26
|
+
role: "custom";
|
|
27
|
+
content: string | Array<PiTextContent | PiImageContent>;
|
|
25
28
|
} | {
|
|
26
29
|
role: "assistant";
|
|
27
30
|
content: PiAssistantContent[];
|
|
@@ -270,7 +270,36 @@ export function selectProjectedTimelinePage(input) {
|
|
|
270
270
|
const limit = input.limit === undefined ? 0 : Math.max(0, Math.floor(input.limit));
|
|
271
271
|
const bounds = input.bounds ?? getTimelineBounds(input.rows);
|
|
272
272
|
const projectedAll = projectTimelineRows({ rows: input.rows, mode: "projected" });
|
|
273
|
-
if (
|
|
273
|
+
if (!bounds) {
|
|
274
|
+
return {
|
|
275
|
+
entries: [],
|
|
276
|
+
startSeq: null,
|
|
277
|
+
endSeq: null,
|
|
278
|
+
hasOlder: false,
|
|
279
|
+
hasNewer: false,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
if (projectedAll.length === 0) {
|
|
283
|
+
if (input.direction === "after") {
|
|
284
|
+
const cursorSeq = input.cursorSeq ?? bounds.minSeq - 1;
|
|
285
|
+
return {
|
|
286
|
+
entries: [],
|
|
287
|
+
startSeq: null,
|
|
288
|
+
endSeq: null,
|
|
289
|
+
hasOlder: cursorSeq >= bounds.minSeq,
|
|
290
|
+
hasNewer: cursorSeq < bounds.maxSeq,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
if (input.direction === "before") {
|
|
294
|
+
const cursorSeq = input.cursorSeq ?? bounds.maxSeq + 1;
|
|
295
|
+
return {
|
|
296
|
+
entries: [],
|
|
297
|
+
startSeq: null,
|
|
298
|
+
endSeq: null,
|
|
299
|
+
hasOlder: cursorSeq > bounds.minSeq,
|
|
300
|
+
hasNewer: cursorSeq <= bounds.maxSeq,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
274
303
|
return {
|
|
275
304
|
entries: [],
|
|
276
305
|
startSeq: null,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { promises as fs } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
export async function writeFileAtomic(filePath, data) {
|
|
5
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
6
|
+
const tempPath = path.join(path.dirname(filePath), `.${path.basename(filePath)}.${process.pid}.${Date.now()}.${randomUUID()}.tmp`);
|
|
7
|
+
try {
|
|
8
|
+
await fs.writeFile(tempPath, data, "utf8");
|
|
9
|
+
await fs.rename(tempPath, filePath);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
await fs.rm(tempPath, { force: true });
|
|
13
|
+
throw error;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export async function writeJsonFileAtomic(filePath, value) {
|
|
17
|
+
await writeFileAtomic(filePath, JSON.stringify(value, null, 2));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=atomic-file.js.map
|
|
@@ -10,6 +10,7 @@ import type { TerminalManager } from "../../terminal/terminal-manager.js";
|
|
|
10
10
|
import { isPaseoOwnedWorktreeCwd } from "../../utils/worktree.js";
|
|
11
11
|
export interface AutoArchiveArchiveOptions {
|
|
12
12
|
paseoHome: string;
|
|
13
|
+
worktreesRoot?: string;
|
|
13
14
|
daemonConfigStore: DaemonConfigStore;
|
|
14
15
|
workspaceGitService: WorkspaceGitServiceImpl;
|
|
15
16
|
github: GitHubService;
|
|
@@ -34,16 +34,23 @@ export async function archiveIfSafe(input) {
|
|
|
34
34
|
if (!snapshot) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
if (snapshot.git.isDirty === true ||
|
|
37
|
+
if (snapshot.git.isDirty === true || snapshot.git.aheadOfOrigin === null) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
if (snapshot.git.aheadOfOrigin > 0) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const ownership = await deps.isPaseoOwnedWorktreeCwd(cwd, {
|
|
44
|
+
paseoHome: options.paseoHome,
|
|
45
|
+
worktreesRoot: options.worktreesRoot,
|
|
46
|
+
});
|
|
41
47
|
if (!ownership.allowed) {
|
|
42
48
|
return;
|
|
43
49
|
}
|
|
44
50
|
try {
|
|
45
51
|
await deps.archivePaseoWorktree({
|
|
46
52
|
paseoHome: options.paseoHome,
|
|
53
|
+
worktreesRoot: options.worktreesRoot,
|
|
47
54
|
github: options.github,
|
|
48
55
|
workspaceGitService: options.workspaceGitService,
|
|
49
56
|
agentManager: options.agentManager,
|
|
@@ -64,6 +71,7 @@ export async function archiveIfSafe(input) {
|
|
|
64
71
|
targetPath: cwd,
|
|
65
72
|
repoRoot: ownership.repoRoot ?? null,
|
|
66
73
|
worktreesRoot: ownership.worktreeRoot,
|
|
74
|
+
worktreesBaseRoot: options.worktreesRoot,
|
|
67
75
|
requestId: "auto-archive-on-merge",
|
|
68
76
|
});
|
|
69
77
|
log.info({ cwd }, "Auto-archived worktree after PR merge");
|
|
@@ -21,7 +21,7 @@ import type { PushNotificationSender } from "./push/notifications.js";
|
|
|
21
21
|
import type { AgentClient, AgentProvider } from "./agent/agent-sdk-types.js";
|
|
22
22
|
import type { AgentProviderRuntimeSettingsMap, ProviderOverride } from "./agent/provider-launch-config.js";
|
|
23
23
|
import type { PersistedConfig } from "./persisted-config.js";
|
|
24
|
-
import {
|
|
24
|
+
import { type ServiceProxySubsystem } from "./service-proxy.js";
|
|
25
25
|
import { WorkspaceScriptRuntimeStore } from "./workspace-script-runtime-store.js";
|
|
26
26
|
import { type HostnamesConfig } from "./hostnames.js";
|
|
27
27
|
import { type DaemonAuthConfig } from "./auth.js";
|
|
@@ -49,6 +49,7 @@ export type DaemonLifecycleIntent = {
|
|
|
49
49
|
export interface PaseoDaemonConfig {
|
|
50
50
|
listen: string;
|
|
51
51
|
paseoHome: string;
|
|
52
|
+
worktreesRoot?: string;
|
|
52
53
|
corsAllowedOrigins: string[];
|
|
53
54
|
allowedHosts?: HostnamesConfig;
|
|
54
55
|
hostnames?: HostnamesConfig;
|
|
@@ -66,6 +67,10 @@ export interface PaseoDaemonConfig {
|
|
|
66
67
|
relayPublicEndpoint?: string;
|
|
67
68
|
relayUseTls?: boolean;
|
|
68
69
|
relayPublicUseTls?: boolean;
|
|
70
|
+
serviceProxy?: {
|
|
71
|
+
publicBaseUrl: string | null;
|
|
72
|
+
standaloneListen: string | null;
|
|
73
|
+
};
|
|
69
74
|
appBaseUrl?: string;
|
|
70
75
|
auth?: DaemonAuthConfig;
|
|
71
76
|
openai?: PaseoOpenAIConfig;
|
|
@@ -93,7 +98,7 @@ export interface PaseoDaemon {
|
|
|
93
98
|
agentManager: AgentManager;
|
|
94
99
|
agentStorage: AgentStorage;
|
|
95
100
|
terminalManager: TerminalManager;
|
|
96
|
-
|
|
101
|
+
serviceProxy: ServiceProxySubsystem;
|
|
97
102
|
scriptRuntimeStore: WorkspaceScriptRuntimeStore;
|
|
98
103
|
start(): Promise<void>;
|
|
99
104
|
stop(): Promise<void>;
|