@getpaseo/server 0.1.97-beta.2 → 0.1.97
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 +1 -1
- package/dist/server/server/agent/agent-response-loop.js +9 -3
- package/dist/server/server/agent/agent-storage.d.ts +20 -240
- package/dist/server/server/agent/agent-storage.js +6 -6
- package/dist/server/server/agent/mcp-server.js +9 -4
- package/dist/server/server/agent/mcp-shared.d.ts +35 -179
- package/dist/server/server/agent/provider-snapshot-manager.d.ts +1 -0
- package/dist/server/server/agent/provider-snapshot-manager.js +25 -34
- package/dist/server/server/agent/providers/claude/project-dir.js +9 -6
- package/dist/server/server/agent/providers/claude/task-notification-tool-call.d.ts +2 -22
- package/dist/server/server/agent/providers/codex/app-server-transport.d.ts +8 -118
- package/dist/server/server/agent/providers/generic-acp-agent.d.ts +1 -5
- package/dist/server/server/agent/providers/pi/agent.d.ts +1 -5
- package/dist/server/server/agent/providers/tool-call-detail-primitives.d.ts +391 -1261
- package/dist/server/server/agent/providers/tool-call-detail-primitives.js +26 -16
- package/dist/server/server/loop-service.d.ts +60 -359
- package/dist/server/server/migrations/backfill-workspace-id.migration.js +10 -6
- package/dist/server/server/package-version.d.ts +1 -7
- package/dist/server/server/paseo-worktree-service.js +15 -1
- package/dist/server/server/persisted-config.d.ts +138 -1009
- package/dist/server/server/persisted-config.js +1 -1
- package/dist/server/server/pid-lock.d.ts +1 -15
- package/dist/server/server/session.d.ts +6 -0
- package/dist/server/server/session.js +195 -25
- package/dist/server/server/speech/providers/local/sherpa/model-catalog.d.ts +2 -2
- package/dist/server/server/speech/speech-types.d.ts +9 -11
- package/dist/server/server/websocket-server.js +4 -0
- package/dist/server/server/workspace-registry.d.ts +17 -48
- package/dist/server/server/workspace-registry.js +9 -0
- package/dist/server/terminal/terminal-session-controller.d.ts +8 -0
- package/dist/server/terminal/terminal-session-controller.js +23 -3
- package/dist/server/utils/checkout-git.js +36 -76
- package/dist/server/utils/worktree-metadata.d.ts +7 -59
- package/dist/src/server/persisted-config.js +1 -1
- package/package.json +9 -9
|
@@ -375,7 +375,6 @@ function buildGitDiffArgs(args) {
|
|
|
375
375
|
return ["diff", ...(args.ignoreWhitespace ? ["-w"] : []), ...args.extra];
|
|
376
376
|
}
|
|
377
377
|
const TRACKED_DIFF_NUMSTAT_MAX_BYTES = 2 * 1024 * 1024; // 2MB
|
|
378
|
-
const TRACKED_DIFF_PER_FILE_MAX_CHARS = 1024 * 1024;
|
|
379
378
|
const EMPTY_TREE_OBJECT_ID = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
380
379
|
function isUnbornHeadDiffError(error) {
|
|
381
380
|
return (error instanceof Error &&
|
|
@@ -423,56 +422,20 @@ async function getTrackedNumstatByPath(cwd, refs, ignoreWhitespace = false) {
|
|
|
423
422
|
}
|
|
424
423
|
return stats;
|
|
425
424
|
}
|
|
426
|
-
function
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
return
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const header = firstLine.startsWith("diff --git ") ? firstLine.slice("diff --git ".length) : "";
|
|
441
|
-
const prefixedPathMatch = header.match(/^a\/(.+) b\/(.+)$/);
|
|
442
|
-
if (prefixedPathMatch) {
|
|
443
|
-
return prefixedPathMatch[2] ?? null;
|
|
444
|
-
}
|
|
445
|
-
const metadataPath = extractTrackedDiffMetadataPath(section, "+++ ") ??
|
|
446
|
-
extractTrackedDiffMetadataPath(section, "--- ");
|
|
447
|
-
if (metadataPath) {
|
|
448
|
-
return metadataPath;
|
|
449
|
-
}
|
|
450
|
-
const pathMatch = header.match(/^(\S+)\s+(\S+)$/);
|
|
451
|
-
return pathMatch?.[2] ?? null;
|
|
452
|
-
}
|
|
453
|
-
function splitTrackedDiffSections(diffText) {
|
|
454
|
-
const starts = [];
|
|
455
|
-
const diffHeaderPattern = /^diff --git /gm;
|
|
456
|
-
let match;
|
|
457
|
-
while ((match = diffHeaderPattern.exec(diffText))) {
|
|
458
|
-
starts.push(match.index);
|
|
459
|
-
}
|
|
460
|
-
const sections = [];
|
|
461
|
-
for (let index = 0; index < starts.length; index += 1) {
|
|
462
|
-
const start = starts[index];
|
|
463
|
-
const end = starts[index + 1] ?? diffText.length;
|
|
464
|
-
const text = diffText.slice(start, end);
|
|
465
|
-
const path = extractTrackedDiffSectionPath(text);
|
|
466
|
-
if (!path) {
|
|
467
|
-
continue;
|
|
468
|
-
}
|
|
469
|
-
sections.push({
|
|
470
|
-
path,
|
|
471
|
-
text,
|
|
472
|
-
isTooLarge: text.length > TRACKED_DIFF_PER_FILE_MAX_CHARS,
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
return sections;
|
|
425
|
+
async function getTrackedDiffTextForPath(input) {
|
|
426
|
+
const result = await runGitCommand(buildGitDiffArgs({
|
|
427
|
+
ignoreWhitespace: input.ignoreWhitespace,
|
|
428
|
+
extra: [...getCheckoutDiffRefArgs(input.refsForDiff), "--", input.path],
|
|
429
|
+
}), {
|
|
430
|
+
cwd: input.cwd,
|
|
431
|
+
envOverlay: READ_ONLY_GIT_ENV,
|
|
432
|
+
maxOutputBytes: PER_FILE_DIFF_MAX_BYTES,
|
|
433
|
+
});
|
|
434
|
+
return {
|
|
435
|
+
path: input.path,
|
|
436
|
+
text: result.stdout,
|
|
437
|
+
truncated: result.truncated,
|
|
438
|
+
};
|
|
476
439
|
}
|
|
477
440
|
export class NotGitRepoError extends Error {
|
|
478
441
|
constructor(cwd) {
|
|
@@ -1441,7 +1404,7 @@ export function warmCheckoutShortstatInBackground(cwd, context, onComplete) {
|
|
|
1441
1404
|
});
|
|
1442
1405
|
}
|
|
1443
1406
|
async function appendStructuredTrackedDiffs(input) {
|
|
1444
|
-
const { cwd, trackedChanges, trackedChangeByPath, trackedNumstatByPath, trackedPlaceholderByPath, trackedDiffText,
|
|
1407
|
+
const { cwd, trackedChanges, trackedChangeByPath, trackedNumstatByPath, trackedPlaceholderByPath, trackedDiffText, refsForDiff, ignoreWhitespace, structured, appendTrackedPlaceholderComment, } = input;
|
|
1445
1408
|
const parsedTrackedFiles = trackedDiffText.length > 0
|
|
1446
1409
|
? await parseAndHighlightDiff(trackedDiffText, cwd, {
|
|
1447
1410
|
getOldFileContent: async (file) => {
|
|
@@ -1487,7 +1450,6 @@ async function appendStructuredTrackedDiffs(input) {
|
|
|
1487
1450
|
// whitespace-filtered patch and numstat are both empty. Skip emitting a
|
|
1488
1451
|
// structured placeholder in that case so whitespace-only edits truly disappear.
|
|
1489
1452
|
if (ignoreWhitespace &&
|
|
1490
|
-
!trackedDiffTruncated &&
|
|
1491
1453
|
change.status.startsWith("M") &&
|
|
1492
1454
|
(!stat || (!stat.isBinary && stat.additions === 0 && stat.deletions === 0))) {
|
|
1493
1455
|
continue;
|
|
@@ -1499,7 +1461,7 @@ async function appendStructuredTrackedDiffs(input) {
|
|
|
1499
1461
|
additions: stat?.additions ?? 0,
|
|
1500
1462
|
deletions: stat?.deletions ?? 0,
|
|
1501
1463
|
hunks: [],
|
|
1502
|
-
status:
|
|
1464
|
+
status: "ok",
|
|
1503
1465
|
});
|
|
1504
1466
|
}
|
|
1505
1467
|
}
|
|
@@ -1564,43 +1526,42 @@ async function processTrackedChanges(input) {
|
|
|
1564
1526
|
trackedDiffPaths.push(change.path);
|
|
1565
1527
|
}
|
|
1566
1528
|
let trackedDiffText = "";
|
|
1567
|
-
let
|
|
1529
|
+
let trackedDiffBytes = 0;
|
|
1568
1530
|
if (trackedDiffPaths.length > 0) {
|
|
1569
|
-
const
|
|
1570
|
-
ignoreWhitespace,
|
|
1571
|
-
extra: [...getCheckoutDiffRefArgs(refsForDiff), "--", ...trackedDiffPaths],
|
|
1572
|
-
}), {
|
|
1531
|
+
const trackedDiffs = await Promise.all(trackedDiffPaths.map((path) => getTrackedDiffTextForPath({
|
|
1573
1532
|
cwd,
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1533
|
+
refsForDiff,
|
|
1534
|
+
path,
|
|
1535
|
+
ignoreWhitespace,
|
|
1536
|
+
})));
|
|
1578
1537
|
const visibleTrackedDiffs = [];
|
|
1579
|
-
const
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
const isTruncatedTail = trackedDiffTruncated && index === sections.length - 1;
|
|
1583
|
-
if (section.isTooLarge || isTruncatedTail) {
|
|
1584
|
-
trackedPlaceholderByPath.set(section.path, {
|
|
1538
|
+
for (const fileDiff of trackedDiffs) {
|
|
1539
|
+
if (fileDiff.truncated) {
|
|
1540
|
+
trackedPlaceholderByPath.set(fileDiff.path, {
|
|
1585
1541
|
status: "too_large",
|
|
1586
|
-
stat: trackedNumstatByPath.get(
|
|
1542
|
+
stat: trackedNumstatByPath.get(fileDiff.path) ?? null,
|
|
1587
1543
|
});
|
|
1588
1544
|
continue;
|
|
1589
1545
|
}
|
|
1590
|
-
|
|
1546
|
+
const diffBytes = Buffer.byteLength(fileDiff.text, "utf8");
|
|
1547
|
+
if (trackedDiffBytes + diffBytes > TOTAL_DIFF_MAX_BYTES) {
|
|
1548
|
+
trackedPlaceholderByPath.set(fileDiff.path, {
|
|
1549
|
+
status: "too_large",
|
|
1550
|
+
stat: trackedNumstatByPath.get(fileDiff.path) ?? null,
|
|
1551
|
+
});
|
|
1552
|
+
continue;
|
|
1553
|
+
}
|
|
1554
|
+
trackedDiffBytes += diffBytes;
|
|
1555
|
+
visibleTrackedDiffs.push(fileDiff.text);
|
|
1591
1556
|
}
|
|
1592
1557
|
trackedDiffText = visibleTrackedDiffs.join("");
|
|
1593
1558
|
appendDiff(trackedDiffText);
|
|
1594
|
-
if (trackedDiffTruncated) {
|
|
1595
|
-
appendDiff("# tracked diff truncated\n");
|
|
1596
|
-
}
|
|
1597
1559
|
}
|
|
1598
1560
|
return {
|
|
1599
1561
|
trackedChangeByPath,
|
|
1600
1562
|
trackedNumstatByPath,
|
|
1601
1563
|
trackedPlaceholderByPath,
|
|
1602
1564
|
trackedDiffText,
|
|
1603
|
-
trackedDiffTruncated,
|
|
1604
1565
|
};
|
|
1605
1566
|
}
|
|
1606
1567
|
async function resolveCheckoutDiffRefs(cwd, compare, context) {
|
|
@@ -1690,7 +1651,6 @@ export async function getCheckoutDiff(cwd, compare, context) {
|
|
|
1690
1651
|
trackedNumstatByPath: trackedDiff.trackedNumstatByPath,
|
|
1691
1652
|
trackedPlaceholderByPath: trackedDiff.trackedPlaceholderByPath,
|
|
1692
1653
|
trackedDiffText: trackedDiff.trackedDiffText,
|
|
1693
|
-
trackedDiffTruncated: trackedDiff.trackedDiffTruncated,
|
|
1694
1654
|
refsForDiff: effectiveRefsForDiff,
|
|
1695
1655
|
ignoreWhitespace,
|
|
1696
1656
|
structured,
|
|
@@ -1,74 +1,22 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
declare const PaseoWorktreeMetadataSchema: z.ZodUnion<[z.ZodObject<{
|
|
2
|
+
declare const PaseoWorktreeMetadataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
3
3
|
version: z.ZodLiteral<1>;
|
|
4
4
|
baseRefName: z.ZodString;
|
|
5
|
-
},
|
|
6
|
-
version: 1;
|
|
7
|
-
baseRefName: string;
|
|
8
|
-
}, {
|
|
9
|
-
version: 1;
|
|
10
|
-
baseRefName: string;
|
|
11
|
-
}>, z.ZodObject<{
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
6
|
version: z.ZodLiteral<2>;
|
|
13
7
|
baseRefName: z.ZodString;
|
|
14
|
-
firstAgentBranchAutoName: z.ZodOptional<z.ZodDiscriminatedUnion<
|
|
8
|
+
firstAgentBranchAutoName: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
9
|
status: z.ZodLiteral<"pending">;
|
|
16
10
|
placeholderBranchName: z.ZodString;
|
|
17
|
-
},
|
|
18
|
-
status: "pending";
|
|
19
|
-
placeholderBranchName: string;
|
|
20
|
-
}, {
|
|
21
|
-
status: "pending";
|
|
22
|
-
placeholderBranchName: string;
|
|
23
|
-
}>, z.ZodObject<{
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
24
12
|
status: z.ZodLiteral<"attempted">;
|
|
25
13
|
placeholderBranchName: z.ZodString;
|
|
26
14
|
attemptedAt: z.ZodString;
|
|
27
|
-
},
|
|
28
|
-
status: "attempted";
|
|
29
|
-
placeholderBranchName: string;
|
|
30
|
-
attemptedAt: string;
|
|
31
|
-
}, {
|
|
32
|
-
status: "attempted";
|
|
33
|
-
placeholderBranchName: string;
|
|
34
|
-
attemptedAt: string;
|
|
35
|
-
}>]>>;
|
|
15
|
+
}, z.core.$strip>], "status">>;
|
|
36
16
|
runtime: z.ZodOptional<z.ZodObject<{
|
|
37
17
|
worktreePort: z.ZodNumber;
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
}, {
|
|
41
|
-
worktreePort: number;
|
|
42
|
-
}>>;
|
|
43
|
-
}, "strip", z.ZodTypeAny, {
|
|
44
|
-
version: 2;
|
|
45
|
-
baseRefName: string;
|
|
46
|
-
firstAgentBranchAutoName?: {
|
|
47
|
-
status: "pending";
|
|
48
|
-
placeholderBranchName: string;
|
|
49
|
-
} | {
|
|
50
|
-
status: "attempted";
|
|
51
|
-
placeholderBranchName: string;
|
|
52
|
-
attemptedAt: string;
|
|
53
|
-
} | undefined;
|
|
54
|
-
runtime?: {
|
|
55
|
-
worktreePort: number;
|
|
56
|
-
} | undefined;
|
|
57
|
-
}, {
|
|
58
|
-
version: 2;
|
|
59
|
-
baseRefName: string;
|
|
60
|
-
firstAgentBranchAutoName?: {
|
|
61
|
-
status: "pending";
|
|
62
|
-
placeholderBranchName: string;
|
|
63
|
-
} | {
|
|
64
|
-
status: "attempted";
|
|
65
|
-
placeholderBranchName: string;
|
|
66
|
-
attemptedAt: string;
|
|
67
|
-
} | undefined;
|
|
68
|
-
runtime?: {
|
|
69
|
-
worktreePort: number;
|
|
70
|
-
} | undefined;
|
|
71
|
-
}>]>;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
}, z.core.$strip>]>;
|
|
72
20
|
export type PaseoWorktreeMetadata = z.infer<typeof PaseoWorktreeMetadataSchema>;
|
|
73
21
|
export declare function getPaseoWorktreeMetadataPath(worktreeRoot: string): string;
|
|
74
22
|
export declare function normalizeBaseRefName(input: string): string;
|
|
@@ -213,7 +213,7 @@ export const PersistedConfigSchema = z
|
|
|
213
213
|
// localhost service proxying remains always enabled.
|
|
214
214
|
enabled: z.boolean().optional(),
|
|
215
215
|
listen: z.string().optional(),
|
|
216
|
-
publicBaseUrl: z.
|
|
216
|
+
publicBaseUrl: z.url().optional(),
|
|
217
217
|
})
|
|
218
218
|
.strict()
|
|
219
219
|
.optional(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpaseo/server",
|
|
3
|
-
"version": "0.1.97
|
|
3
|
+
"version": "0.1.97",
|
|
4
4
|
"description": "Paseo backend server",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/server",
|
|
@@ -63,11 +63,12 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@agentclientprotocol/sdk": "^0.17.1",
|
|
66
|
-
"@anthropic-ai/claude-agent-sdk": "^0.
|
|
67
|
-
"@
|
|
68
|
-
"@getpaseo/
|
|
69
|
-
"@getpaseo/
|
|
70
|
-
"@getpaseo/
|
|
66
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.181",
|
|
67
|
+
"@anthropic-ai/sdk": "^0.104.2",
|
|
68
|
+
"@getpaseo/client": "0.1.97",
|
|
69
|
+
"@getpaseo/highlight": "0.1.97",
|
|
70
|
+
"@getpaseo/protocol": "0.1.97",
|
|
71
|
+
"@getpaseo/relay": "0.1.97",
|
|
71
72
|
"@isaacs/ttlcache": "^2.1.4",
|
|
72
73
|
"@modelcontextprotocol/sdk": "^1.20.1",
|
|
73
74
|
"@opencode-ai/sdk": "1.14.46",
|
|
@@ -81,7 +82,7 @@
|
|
|
81
82
|
"lru-cache": "^11.5.1",
|
|
82
83
|
"mnemonic-id": "^3.2.7",
|
|
83
84
|
"node-pty": "1.2.0-beta.11",
|
|
84
|
-
"openai": "^
|
|
85
|
+
"openai": "^6.44.0",
|
|
85
86
|
"p-limit": "^7.3.0",
|
|
86
87
|
"p-memoize": "^8.0.0",
|
|
87
88
|
"pino": "^10.2.0",
|
|
@@ -94,8 +95,7 @@
|
|
|
94
95
|
"uuid": "^9.0.1",
|
|
95
96
|
"which": "^5.0.0",
|
|
96
97
|
"ws": "^8.14.2",
|
|
97
|
-
"zod": "^
|
|
98
|
-
"zod-to-json-schema": "^3.25.1"
|
|
98
|
+
"zod": "^4.4.3"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@playwright/test": "^1.56.1",
|