@getpaseo/server 0.1.88 → 0.1.89
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-storage.d.ts +22 -22
- package/dist/server/server/agent/create-agent/create.d.ts +2 -0
- package/dist/server/server/agent/create-agent/create.js +16 -5
- 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/mcp-server.d.ts +1 -0
- package/dist/server/server/agent/mcp-server.js +113 -70
- 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/auto-archive-on-merge/archive-if-safe.d.ts +1 -0
- package/dist/server/server/auto-archive-on-merge/archive-if-safe.js +6 -1
- package/dist/server/server/bootstrap.d.ts +7 -2
- package/dist/server/server/bootstrap.js +152 -115
- package/dist/server/server/config.js +41 -0
- package/dist/server/server/loop-service.d.ts +22 -22
- 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 +17 -0
- package/dist/server/server/pid-lock.d.ts +2 -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/service-proxy.d.ts +237 -0
- package/dist/server/server/service-proxy.js +714 -0
- package/dist/server/server/session.d.ts +7 -3
- package/dist/server/server/session.js +22 -10
- package/dist/server/server/websocket-server.d.ts +7 -4
- package/dist/server/server/websocket-server.js +9 -4
- package/dist/server/server/workspace-directory.js +4 -0
- 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-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 -2
- package/dist/server/utils/checkout-git.js +17 -7
- package/dist/server/utils/worktree.d.ts +17 -12
- package/dist/server/utils/worktree.js +39 -22
- package/dist/src/server/persisted-config.js +17 -0
- package/package.json +5 -5
- package/dist/server/utils/script-hostname.d.ts +0 -8
- package/dist/server/utils/script-hostname.js +0 -14
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import net from "node:net";
|
|
2
|
+
import type { IncomingMessage } from "node:http";
|
|
3
|
+
import { type RequestHandler } from "express";
|
|
4
|
+
import type { Logger } from "pino";
|
|
5
|
+
export type ServiceProxyListenTarget = {
|
|
6
|
+
type: "tcp";
|
|
7
|
+
host: string;
|
|
8
|
+
port: number;
|
|
9
|
+
} | {
|
|
10
|
+
type: "socket";
|
|
11
|
+
path: string;
|
|
12
|
+
} | {
|
|
13
|
+
type: "pipe";
|
|
14
|
+
path: string;
|
|
15
|
+
};
|
|
16
|
+
export interface ServiceProxyRoute {
|
|
17
|
+
hostname: string;
|
|
18
|
+
port: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ServiceProxyRouteEntry extends ServiceProxyRoute {
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
projectSlug: string;
|
|
23
|
+
scriptName: string;
|
|
24
|
+
localHostname?: string;
|
|
25
|
+
publicHostname?: string | null;
|
|
26
|
+
publicBaseUrl?: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface ServiceProxyUrlProjection {
|
|
29
|
+
localProxyUrl: string | null;
|
|
30
|
+
publicProxyUrl: string | null;
|
|
31
|
+
proxyUrl: string | null;
|
|
32
|
+
}
|
|
33
|
+
export interface ServiceProxyScriptProjection extends ServiceProxyUrlProjection {
|
|
34
|
+
hostname: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ServiceProxyWorkspaceScriptProjection extends ServiceProxyScriptProjection {
|
|
37
|
+
port: number | null;
|
|
38
|
+
}
|
|
39
|
+
export interface ServiceProxyHealthTarget {
|
|
40
|
+
workspaceId: string;
|
|
41
|
+
scriptName: string;
|
|
42
|
+
hostname: string;
|
|
43
|
+
port: number;
|
|
44
|
+
}
|
|
45
|
+
export interface WorkspaceServiceIdentity {
|
|
46
|
+
workspaceId: string;
|
|
47
|
+
projectSlug: string;
|
|
48
|
+
branchName: string | null;
|
|
49
|
+
scriptName: string;
|
|
50
|
+
}
|
|
51
|
+
export interface RegisterWorkspaceServiceInput extends WorkspaceServiceIdentity {
|
|
52
|
+
port: number;
|
|
53
|
+
publicBaseUrl?: string | null;
|
|
54
|
+
}
|
|
55
|
+
interface HostClassificationRegistered {
|
|
56
|
+
type: "registered-service";
|
|
57
|
+
route: ServiceProxyRoute;
|
|
58
|
+
}
|
|
59
|
+
interface HostClassificationKnownMiss {
|
|
60
|
+
type: "known-service-miss";
|
|
61
|
+
}
|
|
62
|
+
interface HostClassificationDaemon {
|
|
63
|
+
type: "daemon";
|
|
64
|
+
}
|
|
65
|
+
type HostClassification = HostClassificationRegistered | HostClassificationKnownMiss | HostClassificationDaemon;
|
|
66
|
+
export declare function buildServiceProxyLabel({ projectSlug, branchName, scriptName, }: {
|
|
67
|
+
projectSlug: string;
|
|
68
|
+
branchName: string | null;
|
|
69
|
+
scriptName: string;
|
|
70
|
+
}): string;
|
|
71
|
+
export declare function buildLocalServiceHostname(input: {
|
|
72
|
+
projectSlug: string;
|
|
73
|
+
branchName: string | null;
|
|
74
|
+
scriptName: string;
|
|
75
|
+
}): string;
|
|
76
|
+
export declare function buildPublicServiceHostname({ publicBaseUrl, ...service }: {
|
|
77
|
+
publicBaseUrl: string;
|
|
78
|
+
projectSlug: string;
|
|
79
|
+
branchName: string | null;
|
|
80
|
+
scriptName: string;
|
|
81
|
+
}): string;
|
|
82
|
+
export declare function buildPublicServiceProxyUrl(options: {
|
|
83
|
+
publicBaseUrl: string;
|
|
84
|
+
projectSlug: string;
|
|
85
|
+
branchName: string | null;
|
|
86
|
+
scriptName: string;
|
|
87
|
+
}): string;
|
|
88
|
+
export declare function projectServiceProxyUrls(options: {
|
|
89
|
+
projectSlug: string;
|
|
90
|
+
branchName: string | null;
|
|
91
|
+
scriptName: string;
|
|
92
|
+
daemonPort: number | null | undefined;
|
|
93
|
+
publicBaseUrl?: string | null;
|
|
94
|
+
}): ServiceProxyUrlProjection;
|
|
95
|
+
export declare function projectWorkspaceService(input: {
|
|
96
|
+
projectSlug: string;
|
|
97
|
+
branchName: string | null;
|
|
98
|
+
scriptName: string;
|
|
99
|
+
daemonPort: number | null | undefined;
|
|
100
|
+
publicBaseUrl?: string | null;
|
|
101
|
+
}): ServiceProxyScriptProjection;
|
|
102
|
+
export declare function projectRegisteredServiceProxyUrls(options: {
|
|
103
|
+
route: Pick<ServiceProxyRouteEntry, "hostname" | "publicHostname" | "publicBaseUrl" | "projectSlug" | "scriptName">;
|
|
104
|
+
daemonPort: number | null | undefined;
|
|
105
|
+
}): ServiceProxyUrlProjection;
|
|
106
|
+
export declare class ServiceProxyRouteCollisionError extends Error {
|
|
107
|
+
readonly hostname: string;
|
|
108
|
+
readonly existing: Pick<ServiceProxyRouteEntry, "workspaceId" | "scriptName">;
|
|
109
|
+
readonly incoming: Pick<ServiceProxyRouteEntry, "workspaceId" | "scriptName">;
|
|
110
|
+
constructor(hostname: string, existing: Pick<ServiceProxyRouteEntry, "workspaceId" | "scriptName">, incoming: Pick<ServiceProxyRouteEntry, "workspaceId" | "scriptName">);
|
|
111
|
+
}
|
|
112
|
+
export declare class ServiceProxyRouteRegistry {
|
|
113
|
+
private routes;
|
|
114
|
+
private hostnameAliases;
|
|
115
|
+
private workspaceHostnames;
|
|
116
|
+
private configuredPublicBaseHostnames;
|
|
117
|
+
private publicBaseHostnames;
|
|
118
|
+
constructor(publicBaseUrl?: string | null);
|
|
119
|
+
registerWorkspaceService(input: RegisterWorkspaceServiceInput): ServiceProxyRouteEntry;
|
|
120
|
+
registerRoute(entry: ServiceProxyRouteEntry): void;
|
|
121
|
+
replaceWorkspaceBranchRoutes(params: {
|
|
122
|
+
workspaceId: string;
|
|
123
|
+
newBranch: string | null;
|
|
124
|
+
}): boolean;
|
|
125
|
+
removeRoute(hostname: string): void;
|
|
126
|
+
removeRouteForWorkspaceScript(params: {
|
|
127
|
+
workspaceId: string;
|
|
128
|
+
scriptName: string;
|
|
129
|
+
}): void;
|
|
130
|
+
removeWorkspaceService(params: {
|
|
131
|
+
workspaceId: string;
|
|
132
|
+
scriptName: string;
|
|
133
|
+
}): void;
|
|
134
|
+
projectUrls(input: {
|
|
135
|
+
projectSlug: string;
|
|
136
|
+
branchName: string | null;
|
|
137
|
+
scriptName: string;
|
|
138
|
+
daemonPort: number | null | undefined;
|
|
139
|
+
publicBaseUrl?: string | null;
|
|
140
|
+
}): ServiceProxyUrlProjection;
|
|
141
|
+
projectWorkspaceService(input: {
|
|
142
|
+
projectSlug: string;
|
|
143
|
+
branchName: string | null;
|
|
144
|
+
scriptName: string;
|
|
145
|
+
daemonPort: number | null | undefined;
|
|
146
|
+
publicBaseUrl?: string | null;
|
|
147
|
+
}): ServiceProxyScriptProjection;
|
|
148
|
+
projectWorkspaceServiceState(input: {
|
|
149
|
+
workspaceId: string;
|
|
150
|
+
projectSlug: string;
|
|
151
|
+
branchName: string | null;
|
|
152
|
+
scriptName: string;
|
|
153
|
+
daemonPort: number | null | undefined;
|
|
154
|
+
publicBaseUrl?: string | null;
|
|
155
|
+
}): ServiceProxyWorkspaceScriptProjection;
|
|
156
|
+
getHealthCheckTargets(): ServiceProxyHealthTarget[];
|
|
157
|
+
getWorkspaceHealthTargets(workspaceId: string): ServiceProxyHealthTarget[];
|
|
158
|
+
getHealthTargetForHostname(hostname: string): ServiceProxyHealthTarget | null;
|
|
159
|
+
removeServiceRoutesByHostnames(hostnames: string[]): void;
|
|
160
|
+
removeRoutesForPort(port: number): void;
|
|
161
|
+
classifyHost(host: string | undefined): HostClassification;
|
|
162
|
+
findRoute(host: string): ServiceProxyRoute | null;
|
|
163
|
+
getRouteEntry(hostname: string): ServiceProxyRouteEntry | null;
|
|
164
|
+
listRoutes(): ServiceProxyRouteEntry[];
|
|
165
|
+
listRoutesForWorkspace(workspaceId: string): ServiceProxyRouteEntry[];
|
|
166
|
+
private assertCanRegister;
|
|
167
|
+
private assertNoInternalCollisions;
|
|
168
|
+
private toStoredEntry;
|
|
169
|
+
private getRouteByHostname;
|
|
170
|
+
private getRouteHostnames;
|
|
171
|
+
private addHostnameToWorkspaceIndex;
|
|
172
|
+
private removeHostnameFromWorkspaceIndex;
|
|
173
|
+
private rebuildPublicBaseHostnames;
|
|
174
|
+
}
|
|
175
|
+
export { ServiceProxyRouteRegistry as ScriptRouteStore };
|
|
176
|
+
export type ScriptRoute = ServiceProxyRoute;
|
|
177
|
+
export type ScriptRouteEntry = ServiceProxyRouteEntry;
|
|
178
|
+
export declare function createScriptProxyMiddleware({ routeStore, logger, }: {
|
|
179
|
+
routeStore: ServiceProxyRouteRegistry;
|
|
180
|
+
logger: Logger;
|
|
181
|
+
}): RequestHandler;
|
|
182
|
+
export declare function createScriptProxyUpgradeHandler({ routeStore, logger, passthroughUnknown, }: {
|
|
183
|
+
routeStore: ServiceProxyRouteRegistry;
|
|
184
|
+
logger: Logger;
|
|
185
|
+
passthroughUnknown?: boolean;
|
|
186
|
+
}): (req: IncomingMessage, socket: net.Socket, head: Buffer) => void;
|
|
187
|
+
export interface ServiceProxySubsystem {
|
|
188
|
+
registerWorkspaceService(input: RegisterWorkspaceServiceInput): ServiceProxyRouteEntry;
|
|
189
|
+
removeWorkspaceService(params: {
|
|
190
|
+
workspaceId: string;
|
|
191
|
+
scriptName: string;
|
|
192
|
+
}): void;
|
|
193
|
+
removeServiceRoutesByHostnames(hostnames: string[]): void;
|
|
194
|
+
replaceWorkspaceBranchRoutes(params: {
|
|
195
|
+
workspaceId: string;
|
|
196
|
+
newBranch: string | null;
|
|
197
|
+
}): boolean;
|
|
198
|
+
getHealthCheckTargets(): ServiceProxyHealthTarget[];
|
|
199
|
+
getWorkspaceHealthTargets(workspaceId: string): ServiceProxyHealthTarget[];
|
|
200
|
+
getHealthTargetForHostname(hostname: string): ServiceProxyHealthTarget | null;
|
|
201
|
+
projectUrls(input: {
|
|
202
|
+
projectSlug: string;
|
|
203
|
+
branchName: string | null;
|
|
204
|
+
scriptName: string;
|
|
205
|
+
daemonPort: number | null | undefined;
|
|
206
|
+
publicBaseUrl?: string | null;
|
|
207
|
+
}): ServiceProxyUrlProjection;
|
|
208
|
+
projectWorkspaceService(input: {
|
|
209
|
+
projectSlug: string;
|
|
210
|
+
branchName: string | null;
|
|
211
|
+
scriptName: string;
|
|
212
|
+
daemonPort: number | null | undefined;
|
|
213
|
+
publicBaseUrl?: string | null;
|
|
214
|
+
}): ServiceProxyScriptProjection;
|
|
215
|
+
projectWorkspaceServiceState(input: {
|
|
216
|
+
workspaceId: string;
|
|
217
|
+
projectSlug: string;
|
|
218
|
+
branchName: string | null;
|
|
219
|
+
scriptName: string;
|
|
220
|
+
daemonPort: number | null | undefined;
|
|
221
|
+
publicBaseUrl?: string | null;
|
|
222
|
+
}): ServiceProxyWorkspaceScriptProjection;
|
|
223
|
+
middleware(): RequestHandler;
|
|
224
|
+
upgradeHandler(options: {
|
|
225
|
+
passthroughUnknown: boolean;
|
|
226
|
+
}): (req: IncomingMessage, socket: net.Socket, head: Buffer) => void;
|
|
227
|
+
startStandalone(options: {
|
|
228
|
+
listenTarget: ServiceProxyListenTarget;
|
|
229
|
+
}): Promise<ServiceProxyListenTarget>;
|
|
230
|
+
stopStandalone(): Promise<void>;
|
|
231
|
+
}
|
|
232
|
+
export declare function createServiceProxySubsystem({ logger, publicBaseUrl, }: {
|
|
233
|
+
logger: Logger;
|
|
234
|
+
publicBaseUrl?: string | null;
|
|
235
|
+
}): ServiceProxySubsystem;
|
|
236
|
+
export declare function findFreePort(): Promise<number>;
|
|
237
|
+
//# sourceMappingURL=service-proxy.d.ts.map
|