From 5babccc097fac1d823ba89d680afcba5ef18aa70 Mon Sep 17 00:00:00 2001 From: Proactive Runtime Bot Date: Sat, 18 Jul 2026 01:45:46 +0200 Subject: [PATCH 1/4] fix(ci): grant detect-changes caller permissions --- .github/workflows/node-compat.yml | 6 ++++++ .github/workflows/package-validation.yml | 6 ++++++ .github/workflows/rust-ci.yml | 6 ++++++ .github/workflows/security.yml | 6 ++++++ .github/workflows/test.yml | 6 ++++++ 5 files changed, 30 insertions(+) diff --git a/.github/workflows/node-compat.yml b/.github/workflows/node-compat.yml index 3b7f7ac0a..1f0d5ba65 100644 --- a/.github/workflows/node-compat.yml +++ b/.github/workflows/node-compat.yml @@ -6,6 +6,12 @@ on: pull_request: branches: [main] +# Reusable workflows cannot elevate the caller's token permissions. +# detect-changes.yml reads pull-request file lists and commit comparisons. +permissions: + contents: read + pull-requests: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/package-validation.yml b/.github/workflows/package-validation.yml index 611e6ffef..1238b84a9 100644 --- a/.github/workflows/package-validation.yml +++ b/.github/workflows/package-validation.yml @@ -6,6 +6,12 @@ on: pull_request: branches: [main] +# Reusable workflows cannot elevate the caller's token permissions. +# detect-changes.yml reads pull-request file lists and commit comparisons. +permissions: + contents: read + pull-requests: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 833d21c4e..d9e2c8ffe 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -5,6 +5,12 @@ on: push: branches: [main] +# Reusable workflows cannot elevate the caller's token permissions. +# detect-changes.yml reads pull-request file lists and commit comparisons. +permissions: + contents: read + pull-requests: read + env: CARGO_TERM_COLOR: always AGENT_RELAY_TELEMETRY_DISABLED: 1 diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index ad0f8276e..13e4df279 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -9,6 +9,12 @@ on: # Run weekly on Sundays at midnight - cron: '0 0 * * 0' +# Reusable workflows cannot elevate the caller's token permissions. +# detect-changes.yml reads pull-request file lists and commit comparisons. +permissions: + contents: read + pull-requests: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b73a49368..436640e5a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,12 @@ on: pull_request: branches: [main] +# Reusable workflows cannot elevate the caller's token permissions. +# detect-changes.yml reads pull-request file lists and commit comparisons. +permissions: + contents: read + pull-requests: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true From 12c851dd2a6c69ae0edfbc026b847557c015f02f Mon Sep 17 00:00:00 2001 From: Proactive Runtime Bot Date: Sat, 18 Jul 2026 02:00:33 +0200 Subject: [PATCH 2/4] fix(swift): bridge hosted lifecycle statuses --- CHANGELOG.md | 1 + .../Sources/AgentRelaySDK/RelaycastBridge.swift | 6 +----- .../Sources/AgentRelaySDK/RelaycastTranslate.swift | 13 +++++++++++-- .../AgentRelaySDKTests/AgentRelaySDKTests.swift | 14 ++++++++++++++ 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9c987f57..52d860ed5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - `agent-relay integration` now discovers relayfile control-plane capabilities before sending API v3 headers, fails fast with upgrade and restart guidance for incompatible daemons, and safely replaces stale daemons when a compatible binary is installed. +- `AgentRelaySDK` now maps Relaycast lifecycle states onto its existing Swift presence states, so root-package consumers compile with Relaycast 6.1 and later while package-local builds remain compatible with 6.0.5. ## [10.6.3] - 2026-07-17 diff --git a/packages/sdk-swift/Sources/AgentRelaySDK/RelaycastBridge.swift b/packages/sdk-swift/Sources/AgentRelaySDK/RelaycastBridge.swift index 7b87ba67f..421fcf519 100644 --- a/packages/sdk-swift/Sources/AgentRelaySDK/RelaycastBridge.swift +++ b/packages/sdk-swift/Sources/AgentRelaySDK/RelaycastBridge.swift @@ -17,11 +17,7 @@ extension RelayAgentType { extension RelayAgentStatus { init(_ status: Relaycast.AgentStatus) { - switch status { - case .online: self = .online - case .offline: self = .offline - case .away: self = .away - } + self.init(hosted: status.rawValue) } } diff --git a/packages/sdk-swift/Sources/AgentRelaySDK/RelaycastTranslate.swift b/packages/sdk-swift/Sources/AgentRelaySDK/RelaycastTranslate.swift index 981535027..9942569ec 100644 --- a/packages/sdk-swift/Sources/AgentRelaySDK/RelaycastTranslate.swift +++ b/packages/sdk-swift/Sources/AgentRelaySDK/RelaycastTranslate.swift @@ -8,9 +8,18 @@ import Relaycast // `Relay*` type built here. extension RelayAgentStatus { - /// Map a hosted status string (`online`/`offline`/`away`) onto the enum. + /// Map hosted presence and lifecycle states onto the legacy public enum. + /// + /// Relaycast 6.1 added lifecycle states while this SDK still supports + /// 6.0.5, so bridge by raw value instead of naming cases that older + /// Relaycast releases do not compile against. init(hosted status: String) { - self = RelayAgentStatus(rawValue: status) ?? .unknown + switch status { + case "active", "online": self = .online + case "idle", "blocked", "waiting", "away": self = .away + case "offline": self = .offline + default: self = .unknown + } } var relaycastStatus: Relaycast.AgentStatus? { diff --git a/packages/sdk-swift/Tests/AgentRelaySDKTests/AgentRelaySDKTests.swift b/packages/sdk-swift/Tests/AgentRelaySDKTests/AgentRelaySDKTests.swift index 3805a8dfa..453406fd6 100644 --- a/packages/sdk-swift/Tests/AgentRelaySDKTests/AgentRelaySDKTests.swift +++ b/packages/sdk-swift/Tests/AgentRelaySDKTests/AgentRelaySDKTests.swift @@ -85,6 +85,20 @@ final class HostedParticipantSDKTests: XCTestCase { XCTAssertEqual(RelayAgentStatus(Relaycast.AgentStatus.online), .online) XCTAssertEqual(RelayAgentStatus(Relaycast.AgentStatus.offline), .offline) XCTAssertEqual(RelayAgentStatus(Relaycast.AgentStatus.away), .away) + + let lifecycleStatuses: [(String, RelayAgentStatus)] = [ + ("active", .online), + ("idle", .away), + ("blocked", .away), + ("waiting", .away), + ] + for (rawValue, expected) in lifecycleStatuses { + XCTAssertEqual(RelayAgentStatus(hosted: rawValue), expected) + if let relaycastStatus = Relaycast.AgentStatus(rawValue: rawValue) { + XCTAssertEqual(RelayAgentStatus(relaycastStatus), expected) + } + } + XCTAssertEqual(RelayAgentStatus(hosted: "future-status"), .unknown) } func testJSONValueBridgingPreservesShape() { From 08544edef018ac4ebbd7382f0c076a0f7c2f06c9 Mon Sep 17 00:00:00 2001 From: Proactive Runtime Bot Date: Sat, 18 Jul 2026 02:03:13 +0200 Subject: [PATCH 3/4] fix(ci): classify agent runtime changes --- .github/workflows/detect-changes.yml | 45 +++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/.github/workflows/detect-changes.yml b/.github/workflows/detect-changes.yml index babeb8d63..d8d49f8ae 100644 --- a/.github/workflows/detect-changes.yml +++ b/.github/workflows/detect-changes.yml @@ -96,24 +96,53 @@ jobs: file.startsWith('.cargo/') || file.endsWith('.rs') || ['Cargo.toml', 'Cargo.lock', 'Cross.toml', 'rust-toolchain', 'rust-toolchain.toml'].includes(file); + // Agent implementations and their tests are part of the Node test + // surface. Other AgentWorkforce records remain inert metadata. + const isAgentRuntime = (file) => + file.startsWith('.agentworkforce/agents/'); // Files no build, test, or lint job consumes. const isInert = (file) => file.startsWith('web/') || file.startsWith('docs/') || file.startsWith('specs/') || file.startsWith('.claude/') || - file.startsWith('.agentworkforce/') || + (file.startsWith('.agentworkforce/') && !isAgentRuntime(file)) || file.startsWith('.agents/') || file === 'LICENSE' || (/\.mdx?$/i.test(file) && !file.includes('/')); - const rustChanged = - unknownScope || - files.some((file) => (isRust(file) && !isInert(file)) || isCi(file)); - const nodeChanged = - unknownScope || files.some((file) => !isSwift(file) && !isInert(file)); - const sdkSwiftChanged = - unknownScope || files.some((file) => isSwift(file) || isCi(file)); + const classifyFiles = (changedFiles) => ({ + rustChanged: changedFiles.some( + (file) => (isRust(file) && !isInert(file)) || isCi(file) + ), + nodeChanged: changedFiles.some( + (file) => !isSwift(file) && !isInert(file) + ), + sdkSwiftChanged: changedFiles.some( + (file) => isSwift(file) || isCi(file) + ), + }); + + // Exercise the exact production classifier with an agent-only + // change so future broad inert-path rules fail visibly. + const agentRuntimeProbe = classifyFiles([ + '.agentworkforce/agents/ci-scope-probe.ts', + ]); + core.info( + `agent_runtime_probe rust_changed=${agentRuntimeProbe.rustChanged} node_changed=${agentRuntimeProbe.nodeChanged} sdk_swift_changed=${agentRuntimeProbe.sdkSwiftChanged}` + ); + if ( + agentRuntimeProbe.rustChanged || + !agentRuntimeProbe.nodeChanged || + agentRuntimeProbe.sdkSwiftChanged + ) { + throw new Error('Agent-only scope probe must select only Node jobs'); + } + + const detectedScope = classifyFiles(files); + const rustChanged = unknownScope || detectedScope.rustChanged; + const nodeChanged = unknownScope || detectedScope.nodeChanged; + const sdkSwiftChanged = unknownScope || detectedScope.sdkSwiftChanged; core.info(`Changed files (${files.length}): ${files.join(', ')}`); core.info( From 740fa1f68a865e88cbe7bbb20be09c9dceff3eb6 Mon Sep 17 00:00:00 2001 From: Proactive Runtime Bot Date: Sat, 18 Jul 2026 02:21:57 +0200 Subject: [PATCH 4/4] fix(packages): remove orphan workflow types workspace --- package-lock.json | 8 -------- packages/workflow-types/package.json | 17 ----------------- 2 files changed, 25 deletions(-) delete mode 100644 packages/workflow-types/package.json diff --git a/package-lock.json b/package-lock.json index fa9d8f2e8..7fd8b37ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1117,10 +1117,6 @@ "resolved": "packages/utils", "link": true }, - "node_modules/@agent-relay/workflow-types": { - "resolved": "packages/workflow-types", - "link": true - }, "node_modules/@agentworkforce/delivery": { "version": "4.1.23", "resolved": "https://registry.npmjs.org/@agentworkforce/delivery/-/delivery-4.1.23.tgz", @@ -11821,10 +11817,6 @@ "vitest": "^4.1.0" } }, - "packages/workflow-types": { - "name": "@agent-relay/workflow-types", - "version": "10.6.0" - }, "web": { "version": "0.0.1", "extraneous": true, diff --git a/packages/workflow-types/package.json b/packages/workflow-types/package.json deleted file mode 100644 index 0dec89e9b..000000000 --- a/packages/workflow-types/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@agent-relay/workflow-types", - "version": "10.6.3", - "type": "module", - "main": "dist/index.js", - "files": [ - "dist", - "package.json" - ], - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "default": "./dist/index.js" - } - } -}