agent-relay-server 0.10.25 → 0.10.26

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.
@@ -31,6 +31,7 @@ export interface ProviderConfig {
31
31
  defaultCapabilities: string[];
32
32
  defaultApprovalMode: string;
33
33
  defaultTags: string[];
34
+ chatCaptureMode: "final" | "full";
34
35
  headless: {
35
36
  tmuxPrefix: string;
36
37
  shutdownTimeoutMs: number;
@@ -33,6 +33,7 @@ export function defaultProviderConfig(provider: string): ProviderConfig {
33
33
  defaultCapabilities: ["chat", "code", "review"],
34
34
  defaultApprovalMode: "guarded",
35
35
  defaultTags: [],
36
+ chatCaptureMode: "final",
36
37
  headless: {
37
38
  tmuxPrefix: `${provider}-relay`,
38
39
  shutdownTimeoutMs: 10_000,
@@ -63,6 +64,7 @@ export function loadProviderConfig(provider: string, home = agentRelayHome()): L
63
64
  defaultCapabilities: stringArray(raw.defaultCapabilities) ?? defaults.defaultCapabilities,
64
65
  defaultApprovalMode: stringValue(raw.defaultApprovalMode) ?? defaults.defaultApprovalMode,
65
66
  defaultTags: stringArray(raw.defaultTags) ?? defaults.defaultTags,
67
+ chatCaptureMode: enumValue(raw.chatCaptureMode, ["final", "full"]) ?? defaults.chatCaptureMode,
66
68
  headless: {
67
69
  tmuxPrefix: stringValue(recordValue(raw.headless).tmuxPrefix) ?? defaults.headless.tmuxPrefix,
68
70
  shutdownTimeoutMs: positiveInteger(recordValue(raw.headless).shutdownTimeoutMs) ?? defaults.headless.shutdownTimeoutMs,
@@ -88,6 +90,7 @@ export function providerConfigPublic(config: LoadedProviderConfig): Record<strin
88
90
  defaultCapabilities: config.defaultCapabilities,
89
91
  defaultApprovalMode: config.defaultApprovalMode,
90
92
  defaultTags: config.defaultTags,
93
+ chatCaptureMode: config.chatCaptureMode,
91
94
  headless: config.headless,
92
95
  };
93
96
  }
@@ -120,6 +123,10 @@ function positiveInteger(value: unknown): number | undefined {
120
123
  return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : undefined;
121
124
  }
122
125
 
126
+ function enumValue<T extends string>(value: unknown, allowed: T[]): T | undefined {
127
+ return typeof value === "string" && allowed.includes(value as T) ? (value as T) : undefined;
128
+ }
129
+
123
130
  function stringArray(value: unknown): string[] | undefined {
124
131
  return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
125
132
  }
package/src/routes.ts CHANGED
@@ -4705,6 +4705,7 @@ const putProviderConfigRoute: Handler = async (req, params) => {
4705
4705
  defaultCapabilities: cleanStringArray(parsed.body.defaultCapabilities, "defaultCapabilities") ?? defaults.defaultCapabilities,
4706
4706
  defaultApprovalMode: cleanString(parsed.body.defaultApprovalMode, "defaultApprovalMode", { max: 80 }) ?? defaults.defaultApprovalMode,
4707
4707
  defaultTags: cleanStringArray(parsed.body.defaultTags, "defaultTags") ?? defaults.defaultTags,
4708
+ chatCaptureMode: (cleanEnum(parsed.body.chatCaptureMode, "chatCaptureMode", ["final", "full"]) ?? defaults.chatCaptureMode) as "final" | "full",
4708
4709
  headless: {
4709
4710
  tmuxPrefix: cleanString(headless.tmuxPrefix, "headless.tmuxPrefix", { max: 120 }) ?? defaults.headless.tmuxPrefix,
4710
4711
  shutdownTimeoutMs: cleanPositiveInt(headless.shutdownTimeoutMs, "headless.shutdownTimeoutMs") ?? defaults.headless.shutdownTimeoutMs,