agent-relay 2.1.0 → 2.1.2
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/index.cjs +193 -63
- package/dist/src/cli/index.d.ts +11 -1
- package/dist/src/cli/index.d.ts.map +1 -1
- package/dist/src/cli/index.js +112 -110
- package/dist/src/cli/index.js.map +1 -1
- package/package.json +18 -18
- package/packages/api-types/package.json +1 -1
- package/packages/benchmark/package.json +4 -4
- package/packages/bridge/package.json +8 -8
- package/packages/cli-tester/package.json +1 -1
- package/packages/config/package.json +2 -2
- package/packages/continuity/package.json +2 -2
- package/packages/daemon/dist/connection.d.ts +5 -0
- package/packages/daemon/dist/connection.d.ts.map +1 -1
- package/packages/daemon/dist/connection.js +19 -1
- package/packages/daemon/dist/connection.js.map +1 -1
- package/packages/daemon/dist/server.js +2 -2
- package/packages/daemon/dist/server.js.map +1 -1
- package/packages/daemon/package.json +12 -12
- package/packages/daemon/src/connection.ts +22 -1
- package/packages/daemon/src/router.test.ts +32 -0
- package/packages/daemon/src/server.ts +2 -2
- package/packages/hooks/package.json +4 -4
- package/packages/mcp/package.json +3 -3
- package/packages/memory/package.json +2 -2
- package/packages/policy/package.json +2 -2
- package/packages/protocol/dist/types.d.ts +5 -0
- package/packages/protocol/dist/types.d.ts.map +1 -1
- package/packages/protocol/package.json +1 -1
- package/packages/protocol/src/types.ts +5 -0
- package/packages/resiliency/package.json +1 -1
- package/packages/sdk/dist/client.d.ts +6 -0
- package/packages/sdk/dist/client.d.ts.map +1 -1
- package/packages/sdk/dist/client.js +1 -0
- package/packages/sdk/dist/client.js.map +1 -1
- package/packages/sdk/package.json +2 -2
- package/packages/sdk/src/client.ts +7 -0
- package/packages/spawner/package.json +1 -1
- package/packages/state/package.json +1 -1
- package/packages/storage/package.json +2 -2
- package/packages/telemetry/package.json +1 -1
- package/packages/trajectory/package.json +2 -2
- package/packages/user-directory/package.json +2 -2
- package/packages/utils/dist/cjs/relay-pty-path.js +111 -55
- package/packages/utils/dist/relay-pty-path.d.ts +17 -12
- package/packages/utils/dist/relay-pty-path.d.ts.map +1 -1
- package/packages/utils/dist/relay-pty-path.js +144 -94
- package/packages/utils/dist/relay-pty-path.js.map +1 -1
- package/packages/utils/package.json +2 -2
- package/packages/utils/src/relay-pty-path.test.ts +373 -0
- package/packages/utils/src/relay-pty-path.ts +182 -91
- package/packages/wrapper/dist/base-wrapper.d.ts +5 -0
- package/packages/wrapper/dist/base-wrapper.d.ts.map +1 -1
- package/packages/wrapper/dist/base-wrapper.js +14 -1
- package/packages/wrapper/dist/base-wrapper.js.map +1 -1
- package/packages/wrapper/dist/shared.d.ts +36 -0
- package/packages/wrapper/dist/shared.d.ts.map +1 -1
- package/packages/wrapper/dist/shared.js +123 -2
- package/packages/wrapper/dist/shared.js.map +1 -1
- package/packages/wrapper/dist/tmux-wrapper.js +1 -1
- package/packages/wrapper/dist/tmux-wrapper.js.map +1 -1
- package/packages/wrapper/package.json +6 -6
- package/packages/wrapper/src/base-wrapper.ts +15 -0
- package/packages/wrapper/src/shared.test.ts +156 -11
- package/packages/wrapper/src/shared.ts +154 -2
- package/packages/wrapper/src/tmux-wrapper.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -35497,6 +35497,7 @@ __export(index_exports, {
|
|
|
35497
35497
|
PROTOCOL_VERSION: () => PROTOCOL_VERSION,
|
|
35498
35498
|
PROVIDER_AUTH_PATTERNS: () => PROVIDER_AUTH_PATTERNS,
|
|
35499
35499
|
PostgresDLQAdapter: () => PostgresDLQAdapter,
|
|
35500
|
+
RESERVED_AGENT_NAMES: () => RESERVED_AGENT_NAMES,
|
|
35500
35501
|
RelayClient: () => RelayClient,
|
|
35501
35502
|
RelayEvent: () => RelayEvent,
|
|
35502
35503
|
RelayPtyOrchestrator: () => RelayPtyOrchestrator,
|
|
@@ -35591,6 +35592,7 @@ __export(index_exports, {
|
|
|
35591
35592
|
getPlatformIdentifier: () => getPlatformIdentifier,
|
|
35592
35593
|
getRepoFullName: () => getRepoFullName,
|
|
35593
35594
|
getRepoFullNameFromPath: () => getRepoFullNameFromPath,
|
|
35595
|
+
getSupportedPlatforms: () => getSupportedPlatforms,
|
|
35594
35596
|
getSupportedProviders: () => getSupportedProviders,
|
|
35595
35597
|
getTmuxPanePid: () => getTmuxPanePid,
|
|
35596
35598
|
getTmuxPath: () => getTmuxPath,
|
|
@@ -35622,6 +35624,7 @@ __export(index_exports, {
|
|
|
35622
35624
|
isMatchingResponse: () => isMatchingResponse,
|
|
35623
35625
|
isPlaceholderTarget: () => isPlaceholderTarget,
|
|
35624
35626
|
isPlaceholderTargetFast: () => isPlaceholderTargetFast,
|
|
35627
|
+
isPlatformSupported: () => isPlatformSupported,
|
|
35625
35628
|
isPrivateChannel: () => isPrivateChannel,
|
|
35626
35629
|
isPublicChannel: () => isPublicChannel,
|
|
35627
35630
|
isSpawnOrReleaseCommandFast: () => isSpawnOrReleaseCommandFast,
|
|
@@ -37227,13 +37230,81 @@ function stripAnsi2(str) {
|
|
|
37227
37230
|
function sleep(ms) {
|
|
37228
37231
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
37229
37232
|
}
|
|
37233
|
+
var AUTO_SUGGEST_PATTERNS = {
|
|
37234
|
+
// Dim text styling - commonly used for ghost text
|
|
37235
|
+
dim: /\x1B\[2m/,
|
|
37236
|
+
// Bright black (dark gray) - common for suggestions
|
|
37237
|
+
brightBlack: /\x1B\[90m/,
|
|
37238
|
+
// 256-color grays (8 is dark gray, 240-250 are grays)
|
|
37239
|
+
gray256: /\x1B\[38;5;(?:8|24[0-9]|250)m/,
|
|
37240
|
+
// Cursor save (CSI s or ESC 7)
|
|
37241
|
+
cursorSave: /\x1B\[s|\x1B7/,
|
|
37242
|
+
// Cursor restore (CSI u or ESC 8)
|
|
37243
|
+
cursorRestore: /\x1B\[u|\x1B8/,
|
|
37244
|
+
// Italic text - sometimes used for suggestions
|
|
37245
|
+
italic: /\x1B\[3m/
|
|
37246
|
+
};
|
|
37247
|
+
function detectAutoSuggest(output) {
|
|
37248
|
+
const patterns = [];
|
|
37249
|
+
let confidence = 0;
|
|
37250
|
+
if (AUTO_SUGGEST_PATTERNS.dim.test(output)) {
|
|
37251
|
+
patterns.push("dim");
|
|
37252
|
+
confidence += 0.4;
|
|
37253
|
+
}
|
|
37254
|
+
if (AUTO_SUGGEST_PATTERNS.brightBlack.test(output)) {
|
|
37255
|
+
patterns.push("brightBlack");
|
|
37256
|
+
confidence += 0.4;
|
|
37257
|
+
}
|
|
37258
|
+
if (AUTO_SUGGEST_PATTERNS.gray256.test(output)) {
|
|
37259
|
+
patterns.push("gray256");
|
|
37260
|
+
confidence += 0.3;
|
|
37261
|
+
}
|
|
37262
|
+
if (AUTO_SUGGEST_PATTERNS.italic.test(output)) {
|
|
37263
|
+
patterns.push("italic");
|
|
37264
|
+
confidence += 0.2;
|
|
37265
|
+
}
|
|
37266
|
+
const hasCursorSave = AUTO_SUGGEST_PATTERNS.cursorSave.test(output);
|
|
37267
|
+
const hasCursorRestore = AUTO_SUGGEST_PATTERNS.cursorRestore.test(output);
|
|
37268
|
+
if (hasCursorSave && hasCursorRestore) {
|
|
37269
|
+
patterns.push("cursorSaveRestore");
|
|
37270
|
+
confidence += 0.5;
|
|
37271
|
+
} else if (hasCursorSave || hasCursorRestore) {
|
|
37272
|
+
patterns.push(hasCursorSave ? "cursorSave" : "cursorRestore");
|
|
37273
|
+
confidence += 0.2;
|
|
37274
|
+
}
|
|
37275
|
+
confidence = Math.min(confidence, 1);
|
|
37276
|
+
const stripped = stripAnsi2(output);
|
|
37277
|
+
if (patterns.length === 0) {
|
|
37278
|
+
return { isAutoSuggest: false, confidence: 0, patterns, strippedContent: stripped };
|
|
37279
|
+
}
|
|
37280
|
+
const lines = stripped.split("\n").filter((l) => l.trim().length > 0);
|
|
37281
|
+
if (lines.length > 2) {
|
|
37282
|
+
confidence *= 0.5;
|
|
37283
|
+
}
|
|
37284
|
+
const isAutoSuggest = confidence >= 0.4;
|
|
37285
|
+
return { isAutoSuggest, confidence, patterns, strippedContent: stripped };
|
|
37286
|
+
}
|
|
37287
|
+
function shouldIgnoreForIdleDetection(output) {
|
|
37288
|
+
if (!output || output.length === 0) {
|
|
37289
|
+
return true;
|
|
37290
|
+
}
|
|
37291
|
+
const result = detectAutoSuggest(output);
|
|
37292
|
+
if (result.isAutoSuggest) {
|
|
37293
|
+
return true;
|
|
37294
|
+
}
|
|
37295
|
+
const stripped = stripAnsi2(output).trim();
|
|
37296
|
+
if (stripped.length === 0) {
|
|
37297
|
+
return true;
|
|
37298
|
+
}
|
|
37299
|
+
return false;
|
|
37300
|
+
}
|
|
37230
37301
|
function buildInjectionString(msg) {
|
|
37231
37302
|
const sanitizedBody = stripAnsi2(msg.body || "").replace(/[\r\n]+/g, " ").trim();
|
|
37232
37303
|
if (sanitizedBody.startsWith("Relay message from ")) {
|
|
37233
37304
|
return sanitizedBody;
|
|
37234
37305
|
}
|
|
37235
37306
|
const shortId = msg.messageId.substring(0, 8);
|
|
37236
|
-
const displayFrom = msg.from === "
|
|
37307
|
+
const displayFrom = msg.from === "Dashboard" && typeof msg.data?.senderName === "string" ? msg.data.senderName : msg.from;
|
|
37237
37308
|
const threadHint = msg.thread ? ` [thread:${msg.thread}]` : "";
|
|
37238
37309
|
const importanceHint = msg.importance !== void 0 && msg.importance > 75 ? " [!!]" : msg.importance !== void 0 && msg.importance > 50 ? " [!]" : "";
|
|
37239
37310
|
const channelHint = msg.originalTo === "*" ? " [#general] (reply to #general, not sender)" : msg.originalTo?.startsWith("#") ? ` [${msg.originalTo}] (reply to ${msg.originalTo}, not sender)` : "";
|
|
@@ -42481,8 +42552,17 @@ var BaseWrapper = class extends import_node_events2.EventEmitter {
|
|
|
42481
42552
|
/**
|
|
42482
42553
|
* Feed output to the idle and stuck detectors.
|
|
42483
42554
|
* Call this whenever new output is received from the agent.
|
|
42555
|
+
*
|
|
42556
|
+
* Note: Auto-suggestions (ghost text) are filtered out to prevent
|
|
42557
|
+
* false idle resets. Claude Code and other CLIs show suggestions
|
|
42558
|
+
* in gray/dim text with cursor save/restore, which should not
|
|
42559
|
+
* be treated as "real" output for idle detection.
|
|
42484
42560
|
*/
|
|
42485
42561
|
feedIdleDetectorOutput(output) {
|
|
42562
|
+
if (shouldIgnoreForIdleDetection(output)) {
|
|
42563
|
+
this.stuckDetector.onOutput(output);
|
|
42564
|
+
return;
|
|
42565
|
+
}
|
|
42486
42566
|
this.idleDetector.onOutput(output);
|
|
42487
42567
|
this.stuckDetector.onOutput(output);
|
|
42488
42568
|
}
|
|
@@ -42932,18 +43012,34 @@ var import_node_url2 = require("node:url");
|
|
|
42932
43012
|
var import_node_fs6 = __toESM(require("node:fs"), 1);
|
|
42933
43013
|
var import_node_os5 = __toESM(require("node:os"), 1);
|
|
42934
43014
|
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
43015
|
+
var SUPPORTED_PLATFORMS = {
|
|
43016
|
+
darwin: {
|
|
43017
|
+
arm64: "relay-pty-darwin-arm64",
|
|
43018
|
+
x64: "relay-pty-darwin-x64"
|
|
43019
|
+
},
|
|
43020
|
+
linux: {
|
|
43021
|
+
arm64: "relay-pty-linux-arm64",
|
|
43022
|
+
x64: "relay-pty-linux-x64"
|
|
43023
|
+
}
|
|
43024
|
+
};
|
|
42935
43025
|
function getPlatformBinaryName() {
|
|
42936
43026
|
const platform2 = import_node_os5.default.platform();
|
|
42937
43027
|
const arch = import_node_os5.default.arch();
|
|
42938
|
-
|
|
42939
|
-
|
|
42940
|
-
|
|
42941
|
-
|
|
42942
|
-
|
|
42943
|
-
|
|
42944
|
-
|
|
42945
|
-
|
|
42946
|
-
|
|
43028
|
+
return SUPPORTED_PLATFORMS[platform2]?.[arch] ?? null;
|
|
43029
|
+
}
|
|
43030
|
+
function isPlatformSupported() {
|
|
43031
|
+
const platform2 = import_node_os5.default.platform();
|
|
43032
|
+
const arch = import_node_os5.default.arch();
|
|
43033
|
+
return SUPPORTED_PLATFORMS[platform2]?.[arch] !== void 0;
|
|
43034
|
+
}
|
|
43035
|
+
function getSupportedPlatforms() {
|
|
43036
|
+
const platforms = [];
|
|
43037
|
+
for (const [os17, archs] of Object.entries(SUPPORTED_PLATFORMS)) {
|
|
43038
|
+
for (const arch of Object.keys(archs)) {
|
|
43039
|
+
platforms.push(`${os17}-${arch}`);
|
|
43040
|
+
}
|
|
43041
|
+
}
|
|
43042
|
+
return platforms.join(", ");
|
|
42947
43043
|
}
|
|
42948
43044
|
var cachedBinaryPath;
|
|
42949
43045
|
var cacheChecked = false;
|
|
@@ -42953,70 +43049,86 @@ function getLastSearchPaths() {
|
|
|
42953
43049
|
}
|
|
42954
43050
|
function findRelayPtyBinary(callerDirname) {
|
|
42955
43051
|
const envOverride = process.env.RELAY_PTY_BINARY;
|
|
42956
|
-
if (envOverride &&
|
|
43052
|
+
if (envOverride && isExecutable(envOverride)) {
|
|
42957
43053
|
lastSearchPaths = [envOverride];
|
|
42958
43054
|
return envOverride;
|
|
42959
43055
|
}
|
|
42960
|
-
let packageRoot;
|
|
42961
|
-
if (callerDirname.includes("node_modules/@agent-relay/")) {
|
|
42962
|
-
packageRoot = import_node_path9.default.join(callerDirname, "..", "..", "..", "..");
|
|
42963
|
-
} else if (callerDirname.includes("node_modules/agent-relay")) {
|
|
42964
|
-
packageRoot = import_node_path9.default.join(callerDirname, "..", "..", "..");
|
|
42965
|
-
} else {
|
|
42966
|
-
packageRoot = import_node_path9.default.join(callerDirname, "..", "..", "..");
|
|
42967
|
-
}
|
|
42968
|
-
let nodeModulesRoot = null;
|
|
42969
|
-
const nodeModulesMatch = callerDirname.match(/^(.+?\/node_modules)\/@agent-relay\//);
|
|
42970
|
-
if (nodeModulesMatch) {
|
|
42971
|
-
nodeModulesRoot = nodeModulesMatch[1];
|
|
42972
|
-
}
|
|
42973
43056
|
const platformBinary = getPlatformBinaryName();
|
|
42974
|
-
const
|
|
42975
|
-
|
|
42976
|
-
|
|
42977
|
-
|
|
42978
|
-
|
|
42979
|
-
import_node_path9.default.join(
|
|
42980
|
-
|
|
42981
|
-
|
|
42982
|
-
|
|
42983
|
-
|
|
42984
|
-
|
|
42985
|
-
"
|
|
42986
|
-
|
|
42987
|
-
|
|
42988
|
-
|
|
42989
|
-
import_node_path9.default.join(
|
|
42990
|
-
|
|
42991
|
-
|
|
42992
|
-
|
|
42993
|
-
|
|
42994
|
-
|
|
42995
|
-
|
|
42996
|
-
|
|
42997
|
-
|
|
42998
|
-
|
|
42999
|
-
|
|
43000
|
-
|
|
43001
|
-
candidates.push(import_node_path9.default.join(process.cwd(), "node_modules", "agent-relay", "bin", platformBinary));
|
|
43002
|
-
candidates.push(import_node_path9.default.join(process.env.HOME || "", ".nvm", "versions", "node", process.version, "lib", "node_modules", "agent-relay", "bin", platformBinary));
|
|
43003
|
-
if (nodeModulesRoot) {
|
|
43004
|
-
candidates.push(import_node_path9.default.join(nodeModulesRoot, "agent-relay", "bin", platformBinary));
|
|
43005
|
-
}
|
|
43006
|
-
if (process.env.HOME) {
|
|
43007
|
-
candidates.push(import_node_path9.default.join("/usr/local/lib/node_modules", "agent-relay", "bin", platformBinary));
|
|
43008
|
-
candidates.push(import_node_path9.default.join("/opt/homebrew/lib/node_modules", "agent-relay", "bin", platformBinary));
|
|
43009
|
-
candidates.push(import_node_path9.default.join(process.env.HOME, ".local", "share", "pnpm", "global", "node_modules", "agent-relay", "bin", platformBinary));
|
|
43057
|
+
const normalizedCaller = callerDirname.replace(/\\/g, "/");
|
|
43058
|
+
const packageRoots = [];
|
|
43059
|
+
const scopedMatch = normalizedCaller.match(/^(.+?\/node_modules)\/@agent-relay\//);
|
|
43060
|
+
const directMatch = normalizedCaller.match(/^(.+?\/node_modules\/agent-relay)/);
|
|
43061
|
+
if (scopedMatch) {
|
|
43062
|
+
packageRoots.push(import_node_path9.default.join(scopedMatch[1], "agent-relay"));
|
|
43063
|
+
}
|
|
43064
|
+
if (directMatch) {
|
|
43065
|
+
packageRoots.push(directMatch[1]);
|
|
43066
|
+
}
|
|
43067
|
+
if (!normalizedCaller.includes("node_modules")) {
|
|
43068
|
+
packageRoots.push(import_node_path9.default.join(callerDirname, "..", "..", ".."));
|
|
43069
|
+
}
|
|
43070
|
+
const home = process.env.HOME || process.env.USERPROFILE || "";
|
|
43071
|
+
if (home) {
|
|
43072
|
+
const npxCacheBase = import_node_path9.default.join(home, ".npm", "_npx");
|
|
43073
|
+
if (import_node_fs6.default.existsSync(npxCacheBase)) {
|
|
43074
|
+
try {
|
|
43075
|
+
const entries = import_node_fs6.default.readdirSync(npxCacheBase);
|
|
43076
|
+
for (const entry of entries) {
|
|
43077
|
+
const npxPackage = import_node_path9.default.join(npxCacheBase, entry, "node_modules", "agent-relay");
|
|
43078
|
+
if (import_node_fs6.default.existsSync(npxPackage)) {
|
|
43079
|
+
packageRoots.push(npxPackage);
|
|
43080
|
+
}
|
|
43081
|
+
}
|
|
43082
|
+
} catch {
|
|
43083
|
+
}
|
|
43010
43084
|
}
|
|
43011
43085
|
}
|
|
43086
|
+
packageRoots.push(import_node_path9.default.join(process.cwd(), "node_modules", "agent-relay"));
|
|
43087
|
+
if (home) {
|
|
43088
|
+
packageRoots.push(import_node_path9.default.join(home, ".nvm", "versions", "node", process.version, "lib", "node_modules", "agent-relay"));
|
|
43089
|
+
packageRoots.push(import_node_path9.default.join(home, ".volta", "tools", "image", "packages", "agent-relay", "lib", "node_modules", "agent-relay"));
|
|
43090
|
+
packageRoots.push(import_node_path9.default.join(home, ".fnm", "node-versions", process.version, "installation", "lib", "node_modules", "agent-relay"));
|
|
43091
|
+
packageRoots.push(import_node_path9.default.join(home, "n", "lib", "node_modules", "agent-relay"));
|
|
43092
|
+
packageRoots.push(import_node_path9.default.join(home, ".asdf", "installs", "nodejs", process.version.replace("v", ""), "lib", "node_modules", "agent-relay"));
|
|
43093
|
+
packageRoots.push(import_node_path9.default.join(home, ".local", "share", "pnpm", "global", "node_modules", "agent-relay"));
|
|
43094
|
+
packageRoots.push(import_node_path9.default.join(home, ".config", "yarn", "global", "node_modules", "agent-relay"));
|
|
43095
|
+
packageRoots.push(import_node_path9.default.join(home, ".yarn", "global", "node_modules", "agent-relay"));
|
|
43096
|
+
}
|
|
43097
|
+
packageRoots.push("/usr/local/lib/node_modules/agent-relay");
|
|
43098
|
+
packageRoots.push("/opt/homebrew/lib/node_modules/agent-relay");
|
|
43099
|
+
packageRoots.push("/usr/lib/node_modules/agent-relay");
|
|
43100
|
+
const candidates = [];
|
|
43101
|
+
for (const root of packageRoots) {
|
|
43102
|
+
if (platformBinary) {
|
|
43103
|
+
candidates.push(import_node_path9.default.join(root, "bin", platformBinary));
|
|
43104
|
+
}
|
|
43105
|
+
candidates.push(import_node_path9.default.join(root, "bin", "relay-pty"));
|
|
43106
|
+
}
|
|
43107
|
+
const devRoot = normalizedCaller.includes("node_modules") ? null : import_node_path9.default.join(callerDirname, "..", "..", "..");
|
|
43108
|
+
if (devRoot) {
|
|
43109
|
+
candidates.push(import_node_path9.default.join(devRoot, "relay-pty", "target", "release", "relay-pty"));
|
|
43110
|
+
candidates.push(import_node_path9.default.join(devRoot, "relay-pty", "target", "debug", "relay-pty"));
|
|
43111
|
+
}
|
|
43112
|
+
candidates.push(import_node_path9.default.join(process.cwd(), "relay-pty", "target", "release", "relay-pty"));
|
|
43113
|
+
candidates.push("/app/bin/relay-pty");
|
|
43114
|
+
candidates.push("/usr/local/bin/relay-pty");
|
|
43115
|
+
candidates.push("/usr/bin/relay-pty");
|
|
43012
43116
|
lastSearchPaths = candidates;
|
|
43013
43117
|
for (const candidate of candidates) {
|
|
43014
|
-
if (
|
|
43118
|
+
if (isExecutable(candidate)) {
|
|
43015
43119
|
return candidate;
|
|
43016
43120
|
}
|
|
43017
43121
|
}
|
|
43018
43122
|
return null;
|
|
43019
43123
|
}
|
|
43124
|
+
function isExecutable(filePath) {
|
|
43125
|
+
try {
|
|
43126
|
+
import_node_fs6.default.accessSync(filePath, import_node_fs6.default.constants.X_OK);
|
|
43127
|
+
return true;
|
|
43128
|
+
} catch {
|
|
43129
|
+
return false;
|
|
43130
|
+
}
|
|
43131
|
+
}
|
|
43020
43132
|
function hasRelayPtyBinary(callerDirname) {
|
|
43021
43133
|
if (!cacheChecked) {
|
|
43022
43134
|
cachedBinaryPath = findRelayPtyBinary(callerDirname);
|
|
@@ -52769,6 +52881,16 @@ function generateEventSchemas() {
|
|
|
52769
52881
|
}
|
|
52770
52882
|
|
|
52771
52883
|
// packages/daemon/dist/connection.js
|
|
52884
|
+
var RESERVED_AGENT_NAMES = /* @__PURE__ */ new Set([
|
|
52885
|
+
"Dashboard",
|
|
52886
|
+
// Dashboard system client
|
|
52887
|
+
"cli",
|
|
52888
|
+
// CLI tool
|
|
52889
|
+
"system",
|
|
52890
|
+
// System messages
|
|
52891
|
+
"_router"
|
|
52892
|
+
// Internal router target
|
|
52893
|
+
]);
|
|
52772
52894
|
var DEFAULT_CONFIG10 = {
|
|
52773
52895
|
...DEFAULT_CONNECTION_CONFIG
|
|
52774
52896
|
};
|
|
@@ -52917,7 +53039,12 @@ var Connection = class {
|
|
|
52917
53039
|
this.sendError("BAD_REQUEST", "Unexpected HELLO", false);
|
|
52918
53040
|
return;
|
|
52919
53041
|
}
|
|
52920
|
-
|
|
53042
|
+
const agentName = envelope.payload.agent;
|
|
53043
|
+
if (RESERVED_AGENT_NAMES.has(agentName) && !envelope.payload._isSystemComponent) {
|
|
53044
|
+
this.sendError("BAD_REQUEST", `Agent name "${agentName}" is reserved for system use`, true);
|
|
53045
|
+
return;
|
|
53046
|
+
}
|
|
53047
|
+
this._agentName = agentName;
|
|
52921
53048
|
this._entityType = envelope.payload.entityType;
|
|
52922
53049
|
this._cli = envelope.payload.cli;
|
|
52923
53050
|
this._program = envelope.payload.program;
|
|
@@ -72647,7 +72774,7 @@ var Daemon = class _Daemon {
|
|
|
72647
72774
|
isInternalAgent(name) {
|
|
72648
72775
|
if (name.startsWith("__"))
|
|
72649
72776
|
return true;
|
|
72650
|
-
return name === "Dashboard" || name === "
|
|
72777
|
+
return name === "Dashboard" || name === "cli";
|
|
72651
72778
|
}
|
|
72652
72779
|
/**
|
|
72653
72780
|
* Stop the daemon.
|
|
@@ -78736,6 +78863,7 @@ init_dist();
|
|
|
78736
78863
|
PROTOCOL_VERSION,
|
|
78737
78864
|
PROVIDER_AUTH_PATTERNS,
|
|
78738
78865
|
PostgresDLQAdapter,
|
|
78866
|
+
RESERVED_AGENT_NAMES,
|
|
78739
78867
|
RelayClient,
|
|
78740
78868
|
RelayEvent,
|
|
78741
78869
|
RelayPtyOrchestrator,
|
|
@@ -78830,6 +78958,7 @@ init_dist();
|
|
|
78830
78958
|
getPlatformIdentifier,
|
|
78831
78959
|
getRepoFullName,
|
|
78832
78960
|
getRepoFullNameFromPath,
|
|
78961
|
+
getSupportedPlatforms,
|
|
78833
78962
|
getSupportedProviders,
|
|
78834
78963
|
getTmuxPanePid,
|
|
78835
78964
|
getTmuxPath,
|
|
@@ -78861,6 +78990,7 @@ init_dist();
|
|
|
78861
78990
|
isMatchingResponse,
|
|
78862
78991
|
isPlaceholderTarget,
|
|
78863
78992
|
isPlaceholderTargetFast,
|
|
78993
|
+
isPlatformSupported,
|
|
78864
78994
|
isPrivateChannel,
|
|
78865
78995
|
isPublicChannel,
|
|
78866
78996
|
isSpawnOrReleaseCommandFast,
|
package/dist/src/cli/index.d.ts
CHANGED
|
@@ -12,5 +12,15 @@
|
|
|
12
12
|
* relay agents - List connected agents
|
|
13
13
|
* relay who - Show currently active agents
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Install agent-relay-snippet to markdown files using prpm.
|
|
17
|
+
* Installs to CLAUDE.md, GEMINI.md, and AGENTS.md.
|
|
18
|
+
* prpm handles idempotency - won't duplicate if already installed.
|
|
19
|
+
*/
|
|
20
|
+
export declare function installRelaySnippets(options?: {
|
|
21
|
+
silent?: boolean;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
success: boolean;
|
|
24
|
+
installed: string[];
|
|
25
|
+
}>;
|
|
16
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;AAuGH;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAqC7H"}
|