agent-relay 2.0.4 → 2.0.5
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/dashboard/out/404.html +1 -1
- package/dist/dashboard/out/app/onboarding.html +1 -1
- package/dist/dashboard/out/app/onboarding.txt +1 -1
- package/dist/dashboard/out/app.html +1 -1
- package/dist/dashboard/out/app.txt +1 -1
- package/dist/dashboard/out/cloud/link.html +1 -1
- package/dist/dashboard/out/cloud/link.txt +1 -1
- package/dist/dashboard/out/connect-repos.html +1 -1
- package/dist/dashboard/out/connect-repos.txt +1 -1
- package/dist/dashboard/out/history.html +1 -1
- package/dist/dashboard/out/history.txt +1 -1
- package/dist/dashboard/out/index.html +1 -1
- package/dist/dashboard/out/index.txt +1 -1
- package/dist/dashboard/out/login.html +1 -1
- package/dist/dashboard/out/login.txt +1 -1
- package/dist/dashboard/out/metrics.html +1 -1
- package/dist/dashboard/out/metrics.txt +1 -1
- package/dist/dashboard/out/pricing.html +1 -1
- package/dist/dashboard/out/pricing.txt +1 -1
- package/dist/dashboard/out/providers/setup/claude.html +1 -1
- package/dist/dashboard/out/providers/setup/claude.txt +1 -1
- package/dist/dashboard/out/providers/setup/codex.html +1 -1
- package/dist/dashboard/out/providers/setup/codex.txt +1 -1
- package/dist/dashboard/out/providers/setup/cursor.html +1 -1
- package/dist/dashboard/out/providers/setup/cursor.txt +1 -1
- package/dist/dashboard/out/providers.html +1 -1
- package/dist/dashboard/out/providers.txt +1 -1
- package/dist/dashboard/out/signup.html +1 -1
- package/dist/dashboard/out/signup.txt +1 -1
- package/dist/src/cli/index.js +61 -3
- package/package.json +14 -12
- package/packages/api-types/package.json +1 -1
- package/packages/bridge/package.json +7 -7
- package/packages/cloud/package.json +6 -6
- package/packages/config/package.json +2 -2
- package/packages/continuity/package.json +1 -1
- package/packages/daemon/dist/router.d.ts +2 -1
- package/packages/daemon/dist/router.js +142 -52
- package/packages/daemon/dist/server.d.ts +3 -0
- package/packages/daemon/dist/server.js +31 -1
- package/packages/daemon/dist/spawn-manager.d.ts +5 -0
- package/packages/daemon/dist/spawn-manager.js +39 -0
- package/packages/daemon/package.json +12 -11
- package/packages/dashboard/package.json +12 -12
- package/packages/dashboard/ui-dist/404.html +1 -1
- package/packages/dashboard/ui-dist/app/onboarding.html +1 -1
- package/packages/dashboard/ui-dist/app/onboarding.txt +1 -1
- package/packages/dashboard/ui-dist/app.html +1 -1
- package/packages/dashboard/ui-dist/app.txt +1 -1
- package/packages/dashboard/ui-dist/cloud/link.html +1 -1
- package/packages/dashboard/ui-dist/cloud/link.txt +1 -1
- package/packages/dashboard/ui-dist/connect-repos.html +1 -1
- package/packages/dashboard/ui-dist/connect-repos.txt +1 -1
- package/packages/dashboard/ui-dist/history.html +1 -1
- package/packages/dashboard/ui-dist/history.txt +1 -1
- package/packages/dashboard/ui-dist/index.html +1 -1
- package/packages/dashboard/ui-dist/index.txt +1 -1
- package/packages/dashboard/ui-dist/login.html +1 -1
- package/packages/dashboard/ui-dist/login.txt +1 -1
- package/packages/dashboard/ui-dist/metrics.html +1 -1
- package/packages/dashboard/ui-dist/metrics.txt +1 -1
- package/packages/dashboard/ui-dist/pricing.html +1 -1
- package/packages/dashboard/ui-dist/pricing.txt +1 -1
- package/packages/dashboard/ui-dist/providers/setup/claude.html +1 -1
- package/packages/dashboard/ui-dist/providers/setup/claude.txt +1 -1
- package/packages/dashboard/ui-dist/providers/setup/codex.html +1 -1
- package/packages/dashboard/ui-dist/providers/setup/codex.txt +1 -1
- package/packages/dashboard/ui-dist/providers/setup/cursor.html +1 -1
- package/packages/dashboard/ui-dist/providers/setup/cursor.txt +1 -1
- package/packages/dashboard/ui-dist/providers.html +1 -1
- package/packages/dashboard/ui-dist/providers.txt +1 -1
- package/packages/dashboard/ui-dist/signup.html +1 -1
- package/packages/dashboard/ui-dist/signup.txt +1 -1
- package/packages/dashboard-server/dist/user-bridge.d.ts +7 -3
- package/packages/dashboard-server/dist/user-bridge.js +48 -30
- package/packages/dashboard-server/package.json +12 -12
- package/packages/hooks/package.json +4 -4
- package/packages/mcp/README.md +19 -135
- package/packages/mcp/dist/client.js +67 -27
- package/packages/mcp/dist/cloud.js +1 -18
- package/packages/mcp/package.json +2 -1
- package/packages/memory/package.json +2 -2
- package/packages/policy/package.json +2 -2
- package/packages/protocol/package.json +1 -1
- package/packages/resiliency/package.json +1 -1
- package/packages/sdk/README.md +43 -160
- package/packages/sdk/dist/client.d.ts +3 -99
- package/packages/sdk/dist/client.js +6 -113
- package/packages/sdk/dist/index.d.ts +0 -1
- package/packages/sdk/dist/index.js +0 -2
- package/packages/sdk/dist/standalone.js +0 -1
- package/packages/sdk/package.json +2 -2
- package/packages/spawner/package.json +1 -1
- package/packages/state/package.json +1 -1
- package/packages/storage/package.json +2 -2
- package/packages/telemetry/dist/client.d.ts +19 -0
- package/packages/telemetry/dist/client.js +125 -0
- package/packages/telemetry/dist/config.d.ts +29 -0
- package/packages/telemetry/dist/config.js +88 -0
- package/packages/telemetry/dist/events.d.ts +106 -0
- package/packages/telemetry/dist/events.js +10 -0
- package/packages/telemetry/dist/index.d.ts +8 -0
- package/packages/telemetry/dist/index.js +7 -0
- package/packages/telemetry/dist/machine-id.d.ts +12 -0
- package/packages/telemetry/dist/machine-id.js +58 -0
- package/packages/telemetry/dist/posthog-config.d.ts +16 -0
- package/packages/telemetry/dist/posthog-config.js +33 -0
- package/packages/telemetry/package.json +41 -0
- package/packages/trajectory/package.json +2 -2
- package/packages/user-directory/package.json +2 -2
- package/packages/utils/package.json +1 -1
- package/packages/wrapper/dist/relay-pty-orchestrator.js +1 -1
- package/packages/wrapper/package.json +6 -6
- package/packages/sdk/dist/discovery.d.ts +0 -29
- package/packages/sdk/dist/discovery.js +0 -126
- /package/dist/dashboard/out/_next/static/{72btMIJ64BCAB4UgVkpaq → xtLmZI8Coh2009JpfvOBw}/_buildManifest.js +0 -0
- /package/dist/dashboard/out/_next/static/{72btMIJ64BCAB4UgVkpaq → xtLmZI8Coh2009JpfvOBw}/_ssgManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{0AsOfRemPXJmtynCKT-rx → QWdjV9SGDgz-GkriZP7Ao}/_buildManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{0AsOfRemPXJmtynCKT-rx → QWdjV9SGDgz-GkriZP7Ao}/_ssgManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{72btMIJ64BCAB4UgVkpaq → SySrsm8xdGaeJLrZ2RNuf}/_buildManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{72btMIJ64BCAB4UgVkpaq → SySrsm8xdGaeJLrZ2RNuf}/_ssgManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{clUN2n0bz9HCjKI0qlOxU → xtLmZI8Coh2009JpfvOBw}/_buildManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{clUN2n0bz9HCjKI0qlOxU → xtLmZI8Coh2009JpfvOBw}/_ssgManifest.js +0 -0
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Socket Discovery for Agent Relay SDK
|
|
3
|
-
*
|
|
4
|
-
* Discovers the daemon socket path for local development and cloud environments.
|
|
5
|
-
*/
|
|
6
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
7
|
-
import { join } from 'node:path';
|
|
8
|
-
import { homedir } from 'node:os';
|
|
9
|
-
/**
|
|
10
|
-
* Find project root by looking for common markers.
|
|
11
|
-
* Scans up from startDir until it finds a marker or hits the filesystem root.
|
|
12
|
-
*/
|
|
13
|
-
function findProjectRoot(startDir = process.cwd()) {
|
|
14
|
-
let current = startDir;
|
|
15
|
-
const markers = ['.git', 'package.json', 'Cargo.toml', 'go.mod', 'pyproject.toml', '.agent-relay'];
|
|
16
|
-
// Limit iterations to prevent infinite loops
|
|
17
|
-
for (let i = 0; i < 100; i++) {
|
|
18
|
-
for (const marker of markers) {
|
|
19
|
-
if (existsSync(join(current, marker))) {
|
|
20
|
-
return current;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
const parent = join(current, '..');
|
|
24
|
-
if (parent === current)
|
|
25
|
-
break; // Reached root
|
|
26
|
-
current = parent;
|
|
27
|
-
}
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Discover the relay daemon socket path.
|
|
32
|
-
*
|
|
33
|
-
* Discovery order:
|
|
34
|
-
* 1. RELAY_SOCKET environment variable (explicit override)
|
|
35
|
-
* 2. Cloud workspace socket (if WORKSPACE_ID is set)
|
|
36
|
-
* 3. Project-local socket ({projectRoot}/.agent-relay/relay.sock)
|
|
37
|
-
* 4. Legacy fallback (/tmp/agent-relay.sock)
|
|
38
|
-
*
|
|
39
|
-
* @param cwd - Working directory to start search from (default: process.cwd())
|
|
40
|
-
* @returns Discovery result with socket path and metadata
|
|
41
|
-
*/
|
|
42
|
-
export function discoverSocket(cwd) {
|
|
43
|
-
const startDir = cwd || process.cwd();
|
|
44
|
-
// 1. Explicit socket path from environment
|
|
45
|
-
const socketEnv = process.env.RELAY_SOCKET;
|
|
46
|
-
if (socketEnv && existsSync(socketEnv)) {
|
|
47
|
-
return {
|
|
48
|
-
socketPath: socketEnv,
|
|
49
|
-
projectId: process.env.RELAY_PROJECT || 'env',
|
|
50
|
-
source: 'env',
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
// 2. Cloud workspace socket (if WORKSPACE_ID is set)
|
|
54
|
-
const workspaceId = process.env.WORKSPACE_ID;
|
|
55
|
-
if (workspaceId) {
|
|
56
|
-
const cloudSocket = `/tmp/relay/${workspaceId}/sockets/daemon.sock`;
|
|
57
|
-
if (existsSync(cloudSocket)) {
|
|
58
|
-
return {
|
|
59
|
-
socketPath: cloudSocket,
|
|
60
|
-
projectId: workspaceId,
|
|
61
|
-
source: 'cloud',
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// 3. Project-local socket
|
|
66
|
-
// First try cwd, then scan up to find project root
|
|
67
|
-
const projectRoot = findProjectRoot(startDir);
|
|
68
|
-
const searchDirs = [startDir];
|
|
69
|
-
if (projectRoot && projectRoot !== startDir) {
|
|
70
|
-
searchDirs.push(projectRoot);
|
|
71
|
-
}
|
|
72
|
-
for (const dir of searchDirs) {
|
|
73
|
-
const projectLocalSocket = join(dir, '.agent-relay', 'relay.sock');
|
|
74
|
-
if (existsSync(projectLocalSocket)) {
|
|
75
|
-
// Read project ID from marker file if available
|
|
76
|
-
let projectId = 'local';
|
|
77
|
-
const markerPath = join(dir, '.agent-relay', '.project');
|
|
78
|
-
if (existsSync(markerPath)) {
|
|
79
|
-
try {
|
|
80
|
-
const marker = JSON.parse(readFileSync(markerPath, 'utf-8'));
|
|
81
|
-
projectId = marker.projectId || 'local';
|
|
82
|
-
}
|
|
83
|
-
catch {
|
|
84
|
-
// Ignore marker read errors
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
socketPath: projectLocalSocket,
|
|
89
|
-
projectId,
|
|
90
|
-
source: 'project',
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
// 4. Legacy fallback
|
|
95
|
-
const legacySocket = '/tmp/agent-relay.sock';
|
|
96
|
-
if (existsSync(legacySocket)) {
|
|
97
|
-
return {
|
|
98
|
-
socketPath: legacySocket,
|
|
99
|
-
projectId: 'legacy',
|
|
100
|
-
source: 'legacy',
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
// Also check ~/.agent-relay for legacy global installations
|
|
104
|
-
const homeSocket = join(homedir(), '.agent-relay', 'relay.sock');
|
|
105
|
-
if (existsSync(homeSocket)) {
|
|
106
|
-
return {
|
|
107
|
-
socketPath: homeSocket,
|
|
108
|
-
projectId: 'home',
|
|
109
|
-
source: 'legacy',
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
// Return legacy path even if it doesn't exist (will fail on connect)
|
|
113
|
-
return {
|
|
114
|
-
socketPath: legacySocket,
|
|
115
|
-
projectId: 'unknown',
|
|
116
|
-
source: 'legacy',
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Get the default socket path using discovery.
|
|
121
|
-
* Convenience function that returns just the path.
|
|
122
|
-
*/
|
|
123
|
-
export function getDefaultSocketPath(cwd) {
|
|
124
|
-
return discoverSocket(cwd).socketPath;
|
|
125
|
-
}
|
|
126
|
-
//# sourceMappingURL=discovery.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|