Unified · Split
| @@ -14,7 +14,6 @@ import * as BootService from "../cloud/bootService.ts"; · 13 unmodified lines | ||
| 14 | 14 | import { |
| 15 | 15 | acquireRelayClientForLink, |
| 16 | 16 | headlessSessionConfig, |
| 17 | − isPublishAgentActivityEnabledValue, | |
| 18 | 17 | reportCloudDisconnectResults, |
| 19 | 18 | } from "./connect.ts"; |
| 20 | 19 | import { recoverServiceOnboardingOffer } from "./service.ts"; |
| @@ -190,10 +189,3 @@ it.effect("keeps disconnect causes in structured logs and out of console warning · 169 unmodified lines | ||
| 190 | 189 | ), |
| 191 | 190 | ); |
| 192 | 191 | }); |
| 193 | − | |
| 194 | −it("treats only the literal 'true' as publish-enabled", () => { | |
| 195 | − assert.equal(isPublishAgentActivityEnabledValue("true"), true); | |
| 196 | − assert.equal(isPublishAgentActivityEnabledValue("false"), false); | |
| 197 | − assert.equal(isPublishAgentActivityEnabledValue(null), false); | |
| 198 | − assert.equal(isPublishAgentActivityEnabledValue("TRUE"), false); | |
| 199 | −}); | |
| @@ -144,10 +144,6 @@ function stringToBytes(value: string): Uint8Array { · 143 unmodified lines | ||
| 144 | 144 | return new TextEncoder().encode(value); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | −export function isPublishAgentActivityEnabledValue(value: string | null): boolean { | |
| 148 | − return isAgentActivityPublishingEnabledValue(value); | |
| 149 | −} | |
| 150 | − | |
| 151 | 147 | interface CloudCliStatus { |
| 152 | 148 | readonly desired: boolean; |
| 153 | 149 | readonly authenticated: boolean; |
| @@ -573,7 +569,7 @@ const connectStatusCommand = Command.make("status", { · 419 unmodified lines | ||
| 573 | 569 | linked: Option.isSome(cloudUserId), |
| 574 | 570 | cloudUserId: Option.isSome(cloudUserId) ? bytesToString(cloudUserId.value) : null, |
| 575 | 571 | relayUrl: Option.isSome(relayUrl) ? bytesToString(relayUrl.value) : null, |
| 576 | − publishAgentActivity: isPublishAgentActivityEnabledValue( | |
| 572 | + publishAgentActivity: isAgentActivityPublishingEnabledValue( | |
| 577 | 573 | Option.isSome(publishAgentActivity) ? bytesToString(publishAgentActivity.value) : null, |
| 578 | 574 | ), |
| 579 | 575 | relayClient: executable, |
| @@ -39,6 +39,7 @@ import { · 38 unmodified lines | ||
| 39 | 39 | type ProjectionSnapshotQueryShape, |
| 40 | 40 | } from "../orchestration/Services/ProjectionSnapshotQuery.ts"; |
| 41 | 41 | import { |
| 42 | + isAgentActivityPublishingEnabledValue, | |
| 42 | 43 | RELAY_ENVIRONMENT_CREDENTIAL_SECRET, |
| 43 | 44 | RELAY_ISSUER_SECRET, |
| 44 | 45 | RELAY_URL_SECRET, |
| @@ -220,9 +221,10 @@ describe.sequential("signRelayAgentActivityPublishProof", () => { · 175 unmodified lines | ||
| 220 | 221 | }); |
| 221 | 222 | |
| 222 | 223 | it("requires an explicit opt-in before publishing agent activity", () => { |
| 223 | − expect(AgentAwarenessRelay.isAgentActivityPublishingEnabled(null)).toBe(false); | |
| 224 | − expect(AgentAwarenessRelay.isAgentActivityPublishingEnabled("false")).toBe(false); | |
| 225 | − expect(AgentAwarenessRelay.isAgentActivityPublishingEnabled("true")).toBe(true); | |
| 224 | + expect(isAgentActivityPublishingEnabledValue(null)).toBe(false); | |
| 225 | + expect(isAgentActivityPublishingEnabledValue("false")).toBe(false); | |
| 226 | + expect(isAgentActivityPublishingEnabledValue("TRUE")).toBe(false); | |
| 227 | + expect(isAgentActivityPublishingEnabledValue("true")).toBe(true); | |
| 226 | 228 | }); |
| 227 | 229 | |
| 228 | 230 | it("redacts failed activity details and caps other relay detail", () => { |
| @@ -102,10 +102,6 @@ export function agentAwarenessPublishIdentity(state: RelayAgentActivityState | n · 101 unmodified lines | ||
| 102 | 102 | return JSON.stringify(meaningfulState); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | −export function isAgentActivityPublishingEnabled(value: string | null): boolean { | |
| 106 | − return isAgentActivityPublishingEnabledValue(value); | |
| 107 | −} | |
| 108 | − | |
| 109 | 105 | export function resolveAgentActivityPublishingStartupState(input: { |
| 110 | 106 | readonly relayConfigured: boolean; |
| 111 | 107 | readonly publishEnabled: boolean; |
| @@ -322,7 +318,7 @@ export const make = Effect.gen(function* () { · 210 unmodified lines | ||
| 322 | 318 | }); |
| 323 | 319 | |
| 324 | 320 | const readPublishAgentActivityEnabled = readSecretString(PUBLISH_AGENT_ACTIVITY_SECRET).pipe( |
| 325 | − Effect.map(isAgentActivityPublishingEnabled), | |
| 321 | + Effect.map(isAgentActivityPublishingEnabledValue), | |
| 326 | 322 | ); |
| 327 | 323 | |
| 328 | 324 | const makeRelayClient = (relayConfig: { |