@vibedeckx/darwin-arm64 0.3.46 → 0.3.48
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/bin.js +121 -28
- package/package.json +5 -1
package/dist/bin.js
CHANGED
|
@@ -231211,6 +231211,15 @@ function normalizeAgentProcessSettings(value) {
|
|
|
231211
231211
|
}
|
|
231212
231212
|
return { maxResidentAgentProcesses };
|
|
231213
231213
|
}
|
|
231214
|
+
var AGENT_PROCESS_SETTING_KEY = "agentProcesses";
|
|
231215
|
+
function parseStoredAgentProcessSettings(saved) {
|
|
231216
|
+
if (!saved) return null;
|
|
231217
|
+
try {
|
|
231218
|
+
return normalizeAgentProcessSettings(JSON.parse(saved));
|
|
231219
|
+
} catch {
|
|
231220
|
+
return null;
|
|
231221
|
+
}
|
|
231222
|
+
}
|
|
231214
231223
|
function isResidentProcessInScope(candidate, scope) {
|
|
231215
231224
|
return candidate.projectId === scope.projectId && candidate.branch === scope.branch;
|
|
231216
231225
|
}
|
|
@@ -232019,14 +232028,28 @@ var AgentSessionManager = class {
|
|
|
232019
232028
|
lastActiveAt: session.lastActiveAt
|
|
232020
232029
|
})).sort((a, b2) => a.lastActiveAt - b2.lastActiveAt);
|
|
232021
232030
|
}
|
|
232022
|
-
|
|
232023
|
-
|
|
232024
|
-
|
|
232025
|
-
|
|
232026
|
-
|
|
232027
|
-
|
|
232028
|
-
|
|
232031
|
+
/**
|
|
232032
|
+
* Where the resident limit is read from. A hub keeps it per user and applies
|
|
232033
|
+
* the project owner's value; a reverse-connect worker (set by
|
|
232034
|
+
* shared-services) belongs to one user and reads the machine-wide value the
|
|
232035
|
+
* hub pushed into its `settings`.
|
|
232036
|
+
*/
|
|
232037
|
+
residentLimitIsMachineWide = false;
|
|
232038
|
+
async getMaxResidentAgentProcesses(projectId) {
|
|
232039
|
+
const machineWide = async () => parseStoredAgentProcessSettings(await this.storage.settings.get(AGENT_PROCESS_SETTING_KEY));
|
|
232040
|
+
let settings = null;
|
|
232041
|
+
if (!this.residentLimitIsMachineWide) {
|
|
232042
|
+
try {
|
|
232043
|
+
const ownerId = await this.storage.projects.getOwnerId(projectId) ?? "local";
|
|
232044
|
+
settings = parseStoredAgentProcessSettings(
|
|
232045
|
+
await this.storage.userSettings.get(ownerId, AGENT_PROCESS_SETTING_KEY)
|
|
232046
|
+
);
|
|
232047
|
+
} catch (error48) {
|
|
232048
|
+
console.warn("[AgentSession] reading the owner's resident limit failed:", error48);
|
|
232049
|
+
}
|
|
232029
232050
|
}
|
|
232051
|
+
settings ??= await machineWide();
|
|
232052
|
+
return (settings ?? DEFAULT_AGENT_PROCESS_SETTINGS).maxResidentAgentProcesses;
|
|
232030
232053
|
}
|
|
232031
232054
|
async withCapacityLock(work) {
|
|
232032
232055
|
const previous = this.capacityQueue;
|
|
@@ -232044,7 +232067,7 @@ var AgentSessionManager = class {
|
|
|
232044
232067
|
}
|
|
232045
232068
|
async ensureResidentCapacity(scope, options) {
|
|
232046
232069
|
await this.withCapacityLock(async () => {
|
|
232047
|
-
const maxResidentAgentProcesses = await this.getMaxResidentAgentProcesses();
|
|
232070
|
+
const maxResidentAgentProcesses = await this.getMaxResidentAgentProcesses(scope.projectId);
|
|
232048
232071
|
const live = [...this.sessions.values()].filter(
|
|
232049
232072
|
(session) => session.id !== options?.excludeSessionId && session.projectId === scope.projectId && session.branch === scope.branch && this.isProcessAlive(session)
|
|
232050
232073
|
);
|
|
@@ -247735,6 +247758,47 @@ async function pushRetentionToWorkers(deps, days, userId) {
|
|
|
247735
247758
|
return Promise.all(servers.map((server) => pushRetentionToWorker(deps, server, days)));
|
|
247736
247759
|
}
|
|
247737
247760
|
|
|
247761
|
+
// src/agent-process-downlink.ts
|
|
247762
|
+
var AGENT_PROCESS_DOWNLINK_PATH = "/api/settings/agent-processes";
|
|
247763
|
+
async function readUserAgentProcessSettings(storage2, userId) {
|
|
247764
|
+
return parseStoredAgentProcessSettings(await storage2.userSettings.get(userId, AGENT_PROCESS_SETTING_KEY));
|
|
247765
|
+
}
|
|
247766
|
+
async function resolveUserAgentProcessSettings(storage2, userId) {
|
|
247767
|
+
return await readUserAgentProcessSettings(storage2, userId) ?? parseStoredAgentProcessSettings(await storage2.settings.get(AGENT_PROCESS_SETTING_KEY)) ?? DEFAULT_AGENT_PROCESS_SETTINGS;
|
|
247768
|
+
}
|
|
247769
|
+
async function pushAgentProcessSettingsToWorker(deps, server, settings) {
|
|
247770
|
+
try {
|
|
247771
|
+
const result = await proxyToRemoteAuto(
|
|
247772
|
+
server.id,
|
|
247773
|
+
"PUT",
|
|
247774
|
+
AGENT_PROCESS_DOWNLINK_PATH,
|
|
247775
|
+
settings,
|
|
247776
|
+
{ reverseConnectManager: deps.reverseConnectManager, timeoutMs: deps.timeoutMs ?? 1e4 }
|
|
247777
|
+
);
|
|
247778
|
+
if (result.ok) return { remoteServerId: server.id, name: server.name, status: "applied" };
|
|
247779
|
+
if (result.errorCode === "network_error") {
|
|
247780
|
+
return { remoteServerId: server.id, name: server.name, status: "offline" };
|
|
247781
|
+
}
|
|
247782
|
+
return {
|
|
247783
|
+
remoteServerId: server.id,
|
|
247784
|
+
name: server.name,
|
|
247785
|
+
status: "error",
|
|
247786
|
+
detail: result.errorCode === "timeout" ? "timed out" : `worker responded ${result.status}`
|
|
247787
|
+
};
|
|
247788
|
+
} catch (error48) {
|
|
247789
|
+
return {
|
|
247790
|
+
remoteServerId: server.id,
|
|
247791
|
+
name: server.name,
|
|
247792
|
+
status: "error",
|
|
247793
|
+
detail: error48 instanceof Error ? error48.message : String(error48)
|
|
247794
|
+
};
|
|
247795
|
+
}
|
|
247796
|
+
}
|
|
247797
|
+
async function pushAgentProcessSettingsToWorkers(deps, userId, settings) {
|
|
247798
|
+
const servers = await deps.storage.remoteServers.getAll(userId);
|
|
247799
|
+
return Promise.all(servers.map((server) => pushAgentProcessSettingsToWorker(deps, server, settings)));
|
|
247800
|
+
}
|
|
247801
|
+
|
|
247738
247802
|
// src/search/refresh.ts
|
|
247739
247803
|
var DEFAULT_TTL_MS = 3e4;
|
|
247740
247804
|
var DEFAULT_DEADLINE_MS = 5e3;
|
|
@@ -248959,6 +249023,7 @@ function assertProjectChatStarted(result) {
|
|
|
248959
249023
|
var sharedServices = async (fastify2, opts) => {
|
|
248960
249024
|
const processManager = new ProcessManager(opts.storage);
|
|
248961
249025
|
const agentSessionManager = new AgentSessionManager(opts.storage);
|
|
249026
|
+
agentSessionManager.residentLimitIsMachineWide = opts.isReverseConnectWorker ?? false;
|
|
248962
249027
|
const agentSessionLifecycle = new AgentSessionLifecycleService({
|
|
248963
249028
|
storage: opts.storage,
|
|
248964
249029
|
runtime: agentSessionManager
|
|
@@ -249381,6 +249446,14 @@ var sharedServices = async (fastify2, opts) => {
|
|
|
249381
249446
|
console.warn(`[SessionRetention] worker ${result.name} is too old to receive the retention window`);
|
|
249382
249447
|
}
|
|
249383
249448
|
})().catch((error48) => console.warn("[SessionRetention] downlink on connect failed:", error48));
|
|
249449
|
+
void (async () => {
|
|
249450
|
+
const server = await opts.storage.remoteServers.getById(remoteServerId);
|
|
249451
|
+
const ownerId = await opts.storage.remoteServers.getOwnerId(remoteServerId);
|
|
249452
|
+
if (!server || !ownerId) return;
|
|
249453
|
+
const settings = await readUserAgentProcessSettings(opts.storage, ownerId);
|
|
249454
|
+
if (!settings) return;
|
|
249455
|
+
await pushAgentProcessSettingsToWorker({ storage: opts.storage, reverseConnectManager }, server, settings);
|
|
249456
|
+
})().catch((error48) => console.warn("[AgentProcesses] downlink on connect failed:", error48));
|
|
249384
249457
|
});
|
|
249385
249458
|
notificationService.start();
|
|
249386
249459
|
notificationService.requestDrain();
|
|
@@ -258552,18 +258625,11 @@ var DEFAULT_CONVERSATION_SETTINGS = {
|
|
|
258552
258625
|
agentFontSize: 16,
|
|
258553
258626
|
chatFontSize: 15,
|
|
258554
258627
|
filesTreeFontSize: 14,
|
|
258555
|
-
filesContentFontSize: 14
|
|
258628
|
+
filesContentFontSize: 14,
|
|
258629
|
+
tasksFontSize: 14
|
|
258556
258630
|
};
|
|
258557
258631
|
var CONV_FONT_SIZE_MIN = 12;
|
|
258558
258632
|
var CONV_FONT_SIZE_MAX = 22;
|
|
258559
|
-
function readStoredAgentProcessSettings(saved) {
|
|
258560
|
-
if (!saved) return normalizeAgentProcessSettings(void 0);
|
|
258561
|
-
try {
|
|
258562
|
-
return normalizeAgentProcessSettings(JSON.parse(saved));
|
|
258563
|
-
} catch {
|
|
258564
|
-
return normalizeAgentProcessSettings(void 0);
|
|
258565
|
-
}
|
|
258566
|
-
}
|
|
258567
258633
|
function validateConvFontSize(value, field) {
|
|
258568
258634
|
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
258569
258635
|
return `${field} must be a finite number`;
|
|
@@ -258584,11 +258650,13 @@ function readStoredConversationSettings(saved) {
|
|
|
258584
258650
|
const chatValid = typeof parsed.chatFontSize === "number" && validateConvFontSize(parsed.chatFontSize, "chatFontSize") === null;
|
|
258585
258651
|
const filesTreeValid = typeof parsed.filesTreeFontSize === "number" && validateConvFontSize(parsed.filesTreeFontSize, "filesTreeFontSize") === null;
|
|
258586
258652
|
const filesContentValid = typeof parsed.filesContentFontSize === "number" && validateConvFontSize(parsed.filesContentFontSize, "filesContentFontSize") === null;
|
|
258653
|
+
const tasksValid = typeof parsed.tasksFontSize === "number" && validateConvFontSize(parsed.tasksFontSize, "tasksFontSize") === null;
|
|
258587
258654
|
return {
|
|
258588
258655
|
agentFontSize: agentValid ? parsed.agentFontSize : DEFAULT_CONVERSATION_SETTINGS.agentFontSize,
|
|
258589
258656
|
chatFontSize: chatValid ? parsed.chatFontSize : DEFAULT_CONVERSATION_SETTINGS.chatFontSize,
|
|
258590
258657
|
filesTreeFontSize: filesTreeValid ? parsed.filesTreeFontSize : DEFAULT_CONVERSATION_SETTINGS.filesTreeFontSize,
|
|
258591
|
-
filesContentFontSize: filesContentValid ? parsed.filesContentFontSize : DEFAULT_CONVERSATION_SETTINGS.filesContentFontSize
|
|
258658
|
+
filesContentFontSize: filesContentValid ? parsed.filesContentFontSize : DEFAULT_CONVERSATION_SETTINGS.filesContentFontSize,
|
|
258659
|
+
tasksFontSize: tasksValid ? parsed.tasksFontSize : DEFAULT_CONVERSATION_SETTINGS.tasksFontSize
|
|
258592
258660
|
};
|
|
258593
258661
|
} catch {
|
|
258594
258662
|
return DEFAULT_CONVERSATION_SETTINGS;
|
|
@@ -258601,12 +258669,17 @@ function requireSettingsUser(req, reply) {
|
|
|
258601
258669
|
}
|
|
258602
258670
|
var routes22 = async (fastify2) => {
|
|
258603
258671
|
fastify2.get("/api/settings/agent-processes", async (req, reply) => {
|
|
258604
|
-
|
|
258605
|
-
|
|
258606
|
-
|
|
258672
|
+
const auth2 = requireAuth(req, reply);
|
|
258673
|
+
if (auth2 === null) return;
|
|
258674
|
+
if (fastify2.isReverseConnectWorker) {
|
|
258675
|
+
const saved = await fastify2.storage.settings.get(AGENT_PROCESS_SETTING_KEY);
|
|
258676
|
+
return reply.code(200).send(parseStoredAgentProcessSettings(saved) ?? DEFAULT_AGENT_PROCESS_SETTINGS);
|
|
258677
|
+
}
|
|
258678
|
+
return reply.code(200).send(await resolveUserAgentProcessSettings(fastify2.storage, resolveUserId(auth2)));
|
|
258607
258679
|
});
|
|
258608
258680
|
fastify2.put("/api/settings/agent-processes", async (req, reply) => {
|
|
258609
|
-
|
|
258681
|
+
const auth2 = requireAuth(req, reply);
|
|
258682
|
+
if (auth2 === null) return;
|
|
258610
258683
|
const value = req.body?.maxResidentAgentProcesses;
|
|
258611
258684
|
if (typeof value !== "number" || !Number.isInteger(value) || value < AGENT_PROCESS_SETTINGS_LIMITS.min || value > AGENT_PROCESS_SETTINGS_LIMITS.max) {
|
|
258612
258685
|
return reply.code(400).send({
|
|
@@ -258614,8 +258687,18 @@ var routes22 = async (fastify2) => {
|
|
|
258614
258687
|
});
|
|
258615
258688
|
}
|
|
258616
258689
|
const config2 = { maxResidentAgentProcesses: value };
|
|
258617
|
-
|
|
258618
|
-
|
|
258690
|
+
if (fastify2.isReverseConnectWorker) {
|
|
258691
|
+
await fastify2.storage.settings.set(AGENT_PROCESS_SETTING_KEY, JSON.stringify(config2));
|
|
258692
|
+
return reply.code(200).send(config2);
|
|
258693
|
+
}
|
|
258694
|
+
const userId = resolveUserId(auth2);
|
|
258695
|
+
await fastify2.storage.userSettings.set(userId, AGENT_PROCESS_SETTING_KEY, JSON.stringify(config2));
|
|
258696
|
+
const workers = await pushAgentProcessSettingsToWorkers(
|
|
258697
|
+
{ storage: fastify2.storage, reverseConnectManager: fastify2.reverseConnectManager },
|
|
258698
|
+
userId,
|
|
258699
|
+
config2
|
|
258700
|
+
);
|
|
258701
|
+
return reply.code(200).send({ ...config2, workers });
|
|
258619
258702
|
});
|
|
258620
258703
|
fastify2.get("/api/settings/session-retention", async (req, reply) => {
|
|
258621
258704
|
if (requireAuth(req, reply) === null) return;
|
|
@@ -258885,7 +258968,7 @@ var routes22 = async (fastify2) => {
|
|
|
258885
258968
|
fastify2.put("/api/settings/conversation", async (req, reply) => {
|
|
258886
258969
|
const userId = requireSettingsUser(req, reply);
|
|
258887
258970
|
if (userId === null) return;
|
|
258888
|
-
const { agentFontSize, chatFontSize, filesTreeFontSize, filesContentFontSize } = req.body;
|
|
258971
|
+
const { agentFontSize, chatFontSize, filesTreeFontSize, filesContentFontSize, tasksFontSize } = req.body;
|
|
258889
258972
|
if (agentFontSize !== void 0) {
|
|
258890
258973
|
const err = validateConvFontSize(agentFontSize, "agentFontSize");
|
|
258891
258974
|
if (err) return reply.code(400).send({ error: err });
|
|
@@ -258902,16 +258985,21 @@ var routes22 = async (fastify2) => {
|
|
|
258902
258985
|
const err = validateConvFontSize(filesContentFontSize, "filesContentFontSize");
|
|
258903
258986
|
if (err) return reply.code(400).send({ error: err });
|
|
258904
258987
|
}
|
|
258988
|
+
if (tasksFontSize !== void 0) {
|
|
258989
|
+
const err = validateConvFontSize(tasksFontSize, "tasksFontSize");
|
|
258990
|
+
if (err) return reply.code(400).send({ error: err });
|
|
258991
|
+
}
|
|
258905
258992
|
const existing = readStoredConversationSettings(await fastify2.storage.userSettings.get(userId, "conversation"));
|
|
258906
258993
|
const updated = {
|
|
258907
258994
|
agentFontSize: agentFontSize ?? existing.agentFontSize,
|
|
258908
258995
|
chatFontSize: chatFontSize ?? existing.chatFontSize,
|
|
258909
258996
|
filesTreeFontSize: filesTreeFontSize ?? existing.filesTreeFontSize,
|
|
258910
|
-
filesContentFontSize: filesContentFontSize ?? existing.filesContentFontSize
|
|
258997
|
+
filesContentFontSize: filesContentFontSize ?? existing.filesContentFontSize,
|
|
258998
|
+
tasksFontSize: tasksFontSize ?? existing.tasksFontSize
|
|
258911
258999
|
};
|
|
258912
259000
|
await fastify2.storage.userSettings.set(userId, "conversation", JSON.stringify(updated));
|
|
258913
259001
|
console.log(
|
|
258914
|
-
`[Settings] Conversation updated: agentFontSize=${updated.agentFontSize}, chatFontSize=${updated.chatFontSize}, filesTreeFontSize=${updated.filesTreeFontSize}, filesContentFontSize=${updated.filesContentFontSize}`
|
|
259002
|
+
`[Settings] Conversation updated: agentFontSize=${updated.agentFontSize}, chatFontSize=${updated.chatFontSize}, filesTreeFontSize=${updated.filesTreeFontSize}, filesContentFontSize=${updated.filesContentFontSize}, tasksFontSize=${updated.tasksFontSize}`
|
|
258915
259003
|
);
|
|
258916
259004
|
return reply.code(200).send(updated);
|
|
258917
259005
|
});
|
|
@@ -268442,6 +268530,7 @@ var createServer = async (opts) => {
|
|
|
268442
268530
|
server.decorate("authEnabled", authEnabled);
|
|
268443
268531
|
server.decorate("uiBuildId", uiBuildId);
|
|
268444
268532
|
server.decorate("noLocalProjects", noLocalProjects);
|
|
268533
|
+
server.decorate("isReverseConnectWorker", acceptRemote);
|
|
268445
268534
|
registerTraceContext(server);
|
|
268446
268535
|
server.addHook("onRequest", (req, reply, done) => {
|
|
268447
268536
|
reply.header("access-control-allow-origin", "*");
|
|
@@ -268494,7 +268583,7 @@ var createServer = async (opts) => {
|
|
|
268494
268583
|
// the entry rather than offering a control that cannot do anything.
|
|
268495
268584
|
crossRemoteSessionGrants: crossRemoteMcpEnabled() && authEnabled
|
|
268496
268585
|
}));
|
|
268497
|
-
server.register(shared_services_default, { storage: opts.storage, authEnabled });
|
|
268586
|
+
server.register(shared_services_default, { storage: opts.storage, authEnabled, isReverseConnectWorker: acceptRemote });
|
|
268498
268587
|
server.register(import_websocket2.default);
|
|
268499
268588
|
server.register(import_multipart.default, {
|
|
268500
268589
|
limits: { fileSize: 50 * 1024 * 1024, files: 50 }
|
|
@@ -268894,6 +268983,10 @@ var WORKER_CAPABILITIES = {
|
|
|
268894
268983
|
// session out of the worker's own retention sweep — retention-holds.ts.
|
|
268895
268984
|
"http:PUT /api/path/retention-holds/:param": { since: "0.3.45", summary: "\u4E0B\u53D1\u4F1A\u8BDD\u4FDD\u7559\u9501(\u9632\u4FDD\u7559\u671F\u6E05\u7406)" },
|
|
268896
268985
|
"http:GET /api/path/retention-holds": { since: "0.3.45", summary: "\u5217\u51FA\u6301\u6709\u4FDD\u7559\u9501\u7684\u4F1A\u8BDD(\u91CA\u653E\u8FC7\u671F\u9501)" },
|
|
268986
|
+
// Resident agent process limit downlink (agent-process-downlink.ts). Reuses
|
|
268987
|
+
// the operator PUT that has existed since the resident pool shipped, so no
|
|
268988
|
+
// worker release is needed; the worker skips onward fan-out by process mode.
|
|
268989
|
+
"http:PUT /api/settings/agent-processes": { since: "0.1.30", summary: "\u4E0B\u53D1\u5E38\u9A7B agent \u8FDB\u7A0B\u4E0A\u9650" },
|
|
268897
268990
|
// --- Search / notifications / cross-remote ---
|
|
268898
268991
|
"http:GET /api/path/search-catalog": { since: "0.2.0", summary: "\u641C\u7D22\u76EE\u5F55\u5FEB\u7167" },
|
|
268899
268992
|
// Empirically probed: 0.2.15 → 404, 0.2.16 → 400 (route exists).
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibedeckx/darwin-arm64",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.48",
|
|
4
4
|
"description": "Vibedeckx platform binaries for macOS ARM64",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/vibedeckx/vibedeckx.git"
|
|
8
|
+
},
|
|
5
9
|
"os": [
|
|
6
10
|
"darwin"
|
|
7
11
|
],
|