@ai-development-environment/control-agent 0.0.72 → 0.0.73
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/control-agent.js +42 -21
- package/package.json +1 -1
package/dist/control-agent.js
CHANGED
|
@@ -3937,8 +3937,8 @@ var require_path_key = __commonJS({
|
|
|
3937
3937
|
"use strict";
|
|
3938
3938
|
var pathKey = (options = {}) => {
|
|
3939
3939
|
const environment = options.env || process.env;
|
|
3940
|
-
const
|
|
3941
|
-
if (
|
|
3940
|
+
const platform2 = options.platform || process.platform;
|
|
3941
|
+
if (platform2 !== "win32") {
|
|
3942
3942
|
return "PATH";
|
|
3943
3943
|
}
|
|
3944
3944
|
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
@@ -5590,7 +5590,15 @@ function subscribeToAgentEvents(client2, agentId, onEvent) {
|
|
|
5590
5590
|
|
|
5591
5591
|
// src/inventory.ts
|
|
5592
5592
|
import { statfsSync } from "node:fs";
|
|
5593
|
-
import {
|
|
5593
|
+
import {
|
|
5594
|
+
arch,
|
|
5595
|
+
cpus,
|
|
5596
|
+
freemem,
|
|
5597
|
+
hostname,
|
|
5598
|
+
platform,
|
|
5599
|
+
release,
|
|
5600
|
+
totalmem
|
|
5601
|
+
} from "node:os";
|
|
5594
5602
|
|
|
5595
5603
|
// ../agent-contract/src/build-data.ts
|
|
5596
5604
|
var BUILD_DATA_SCAN_JOB_KIND = "buildData.scan";
|
|
@@ -8164,18 +8172,15 @@ function buildCoverageReportPayload(input) {
|
|
|
8164
8172
|
}
|
|
8165
8173
|
|
|
8166
8174
|
// src/inventory.ts
|
|
8167
|
-
var AGENT_VERSION = "0.1.0";
|
|
8168
|
-
var
|
|
8175
|
+
var AGENT_VERSION = process.env.CONTROL_AGENT_VERSION ?? "0.1.0";
|
|
8176
|
+
var PORTABLE_AGENT_CAPABILITIES = [
|
|
8169
8177
|
COMMAND_RUN_JOB_KIND,
|
|
8170
8178
|
CCUSAGE_REPORT_JOB_KIND,
|
|
8171
|
-
...BUILD_DATA_JOB_KINDS,
|
|
8172
8179
|
...CODEBASE_JOB_KINDS,
|
|
8173
8180
|
CODEBASE_RECONCILE_EVENT_CAPABILITY,
|
|
8174
8181
|
...WORKTREE_JOB_KINDS,
|
|
8175
8182
|
...SKILL_JOB_KINDS,
|
|
8176
|
-
...IOS_BUILD_JOB_KINDS,
|
|
8177
8183
|
...COVERAGE_JOB_KINDS,
|
|
8178
|
-
...SIGNING_ASSET_JOB_KINDS,
|
|
8179
8184
|
"runs.protocol.v1",
|
|
8180
8185
|
"runs.provider.codex",
|
|
8181
8186
|
"runs.provider.claude",
|
|
@@ -8183,12 +8188,28 @@ var AGENT_CAPABILITIES = [
|
|
|
8183
8188
|
RUN_SESSION_READ_JOB_KIND,
|
|
8184
8189
|
...WORKFLOW_JOB_KINDS
|
|
8185
8190
|
];
|
|
8191
|
+
var MACOS_AGENT_CAPABILITIES = [
|
|
8192
|
+
...BUILD_DATA_JOB_KINDS,
|
|
8193
|
+
...IOS_BUILD_JOB_KINDS,
|
|
8194
|
+
...SIGNING_ASSET_JOB_KINDS
|
|
8195
|
+
];
|
|
8196
|
+
function capabilitiesForPlatform(targetPlatform) {
|
|
8197
|
+
return [
|
|
8198
|
+
...PORTABLE_AGENT_CAPABILITIES,
|
|
8199
|
+
...targetPlatform === "darwin" ? MACOS_AGENT_CAPABILITIES : []
|
|
8200
|
+
];
|
|
8201
|
+
}
|
|
8202
|
+
function operatingSystemVersion(targetPlatform, kernelRelease) {
|
|
8203
|
+
const name = targetPlatform === "darwin" ? "macOS" : targetPlatform === "win32" ? "Windows" : targetPlatform === "linux" ? "Linux" : targetPlatform;
|
|
8204
|
+
return `${name} ${kernelRelease}`;
|
|
8205
|
+
}
|
|
8206
|
+
var AGENT_CAPABILITIES = capabilitiesForPlatform(process.platform);
|
|
8186
8207
|
function collectInventory() {
|
|
8187
8208
|
const disk = statfsSync("/", { bigint: true });
|
|
8188
8209
|
return {
|
|
8189
8210
|
hostname: hostname(),
|
|
8190
8211
|
version: AGENT_VERSION,
|
|
8191
|
-
osVersion:
|
|
8212
|
+
osVersion: operatingSystemVersion(platform(), release()),
|
|
8192
8213
|
architecture: arch(),
|
|
8193
8214
|
cpuModel: (cpus()[0]?.model ?? "Unknown").replace(/^Apple\s+/, ""),
|
|
8194
8215
|
memoryTotalBytes: totalmem(),
|
|
@@ -9134,13 +9155,13 @@ function buildSetting(settings, key) {
|
|
|
9134
9155
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
9135
9156
|
}
|
|
9136
9157
|
function signingPlatform(settings) {
|
|
9137
|
-
const
|
|
9138
|
-
if (
|
|
9139
|
-
if (
|
|
9140
|
-
if (
|
|
9141
|
-
if (
|
|
9142
|
-
if (
|
|
9143
|
-
return
|
|
9158
|
+
const platform2 = buildSetting(settings, "PLATFORM_NAME");
|
|
9159
|
+
if (platform2 === "iphoneos") return "iOS";
|
|
9160
|
+
if (platform2 === "watchos") return "watchOS";
|
|
9161
|
+
if (platform2 === "appletvos") return "tvOS";
|
|
9162
|
+
if (platform2 === "xros") return "visionOS";
|
|
9163
|
+
if (platform2 === "macosx") return "macOS";
|
|
9164
|
+
return platform2;
|
|
9144
9165
|
}
|
|
9145
9166
|
function requiresProvisioningProfile(productType) {
|
|
9146
9167
|
return typeof productType === "string" && (productType.includes("application") || productType.includes("app-extension") || productType.includes("watchkit"));
|
|
@@ -9429,11 +9450,11 @@ function physicalDestinations(value) {
|
|
|
9429
9450
|
["hardwareProperties", "udid"],
|
|
9430
9451
|
["deviceProperties", "identifier"]
|
|
9431
9452
|
]);
|
|
9432
|
-
const
|
|
9453
|
+
const platform2 = nestedString(raw, [
|
|
9433
9454
|
["hardwareProperties", "platform"],
|
|
9434
9455
|
["deviceProperties", "osType"]
|
|
9435
9456
|
]);
|
|
9436
|
-
if (!id2 ||
|
|
9457
|
+
if (!id2 || platform2 && !platform2.toLowerCase().includes("ios")) return [];
|
|
9437
9458
|
const state = nestedString(raw, [
|
|
9438
9459
|
["connectionProperties", "tunnelState"],
|
|
9439
9460
|
["deviceProperties", "connectionState"]
|
|
@@ -42724,13 +42745,13 @@ function isExecutable(path) {
|
|
|
42724
42745
|
function findClaudeCodeExecutable(options = {}) {
|
|
42725
42746
|
const env = options.env ?? process.env;
|
|
42726
42747
|
const home = options.home ?? homedir8();
|
|
42727
|
-
const
|
|
42728
|
-
const executable =
|
|
42748
|
+
const platform2 = options.platform ?? process.platform;
|
|
42749
|
+
const executable = platform2 === "win32" ? "claude.exe" : "claude";
|
|
42729
42750
|
const candidates = [
|
|
42730
42751
|
env.CONTROL_AGENT_CLAUDE_EXECUTABLE?.trim(),
|
|
42731
42752
|
...(env.PATH ?? "").split(delimiter).filter(Boolean).map((directory) => join15(directory, executable)),
|
|
42732
42753
|
join15(home, ".local", "bin", executable),
|
|
42733
|
-
...
|
|
42754
|
+
...platform2 === "darwin" ? ["/opt/homebrew/bin/claude", "/usr/local/bin/claude"] : []
|
|
42734
42755
|
].filter((candidate) => Boolean(candidate));
|
|
42735
42756
|
const canExecute = options.isExecutable ?? isExecutable;
|
|
42736
42757
|
return [...new Set(candidates)].find(canExecute);
|