@alan-ai-hq/agent-manager 0.1.110 → 0.1.111
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/index.cjs +57 -9
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -14593,6 +14593,15 @@ var SANDBOX_DESKTOP_BROWSER_ENV = Object.freeze({
|
|
|
14593
14593
|
AGENT_BROWSER_NO_XVFB: "1",
|
|
14594
14594
|
AGENT_BROWSER_EXECUTABLE_PATH: "/usr/bin/google-chrome-stable"
|
|
14595
14595
|
});
|
|
14596
|
+
var SANDBOX_GUEST_CLOCK_CHRONY_CONF = [
|
|
14597
|
+
"# Managed by daytona-template/desktop-snapshot.ts (SANDBOX_GUEST_CLOCK_CHRONY_CONF).",
|
|
14598
|
+
"# Memory pauses and hot snapshots resume with the guest clock frozen at capture",
|
|
14599
|
+
"# time. The KVM PTP clock exposes host time without network; makestep -1 lets",
|
|
14600
|
+
"# chronyd step a multi-day offset instead of slewing it for months.",
|
|
14601
|
+
"refclock PHC /dev/ptp0 poll 2 dpoll -2 offset 0 stratum 2 prefer",
|
|
14602
|
+
"makestep 1 -1",
|
|
14603
|
+
""
|
|
14604
|
+
].join("\n");
|
|
14596
14605
|
var definitions = [
|
|
14597
14606
|
{
|
|
14598
14607
|
id: "claude",
|
|
@@ -15537,7 +15546,7 @@ function describeError(error61) {
|
|
|
15537
15546
|
}
|
|
15538
15547
|
|
|
15539
15548
|
// src/version.ts
|
|
15540
|
-
var AGENT_VERSION = "0.1.
|
|
15549
|
+
var AGENT_VERSION = "0.1.111";
|
|
15541
15550
|
|
|
15542
15551
|
// src/daemon-workspace.ts
|
|
15543
15552
|
var import_node_child_process3 = require("child_process");
|
|
@@ -35443,6 +35452,16 @@ var WORKFLOW_ALWAYS_ALLOWED_BUILTIN_TOOLS = [
|
|
|
35443
35452
|
"list_prototypes",
|
|
35444
35453
|
"get_prototype"
|
|
35445
35454
|
];
|
|
35455
|
+
var LEGACY_WORKFLOW_BUILTIN_TOOLS = {
|
|
35456
|
+
list_document_comments: "get_document",
|
|
35457
|
+
list_artifact_comments: "get_artifact",
|
|
35458
|
+
list_epic_comments: "get_epic",
|
|
35459
|
+
// Renamed when the thread reply became platform-neutral (Slack + Microsoft Teams).
|
|
35460
|
+
slack_reply_in_thread: "reply_in_thread"
|
|
35461
|
+
};
|
|
35462
|
+
function normalizeWorkflowToolId(id) {
|
|
35463
|
+
return LEGACY_WORKFLOW_BUILTIN_TOOLS[id] ?? id;
|
|
35464
|
+
}
|
|
35446
35465
|
function createWorkflowToolsFilter(workflowTools) {
|
|
35447
35466
|
const hasFilter = !!workflowTools && workflowTools.length > 0;
|
|
35448
35467
|
if (!hasFilter) {
|
|
@@ -35454,7 +35473,7 @@ function createWorkflowToolsFilter(workflowTools) {
|
|
|
35454
35473
|
}
|
|
35455
35474
|
const tools = workflowTools;
|
|
35456
35475
|
const mcpServerIds = new Set(tools.filter((t) => t.type === "mcp").map((t) => t.id));
|
|
35457
|
-
const builtinToolIds = tools.filter((t) => t.type === "builtin" || t.type === "integration").map((t) => t.id);
|
|
35476
|
+
const builtinToolIds = tools.filter((t) => t.type === "builtin" || t.type === "integration").map((t) => normalizeWorkflowToolId(t.id));
|
|
35458
35477
|
return {
|
|
35459
35478
|
hasFilter: true,
|
|
35460
35479
|
isMcpServerAllowed: (serverName) => mcpServerIds.has(serverName),
|
|
@@ -65503,13 +65522,15 @@ function systemdArg(value2) {
|
|
|
65503
65522
|
function powershellLiteral(value2) {
|
|
65504
65523
|
return `'${value2.replaceAll("'", "''")}'`;
|
|
65505
65524
|
}
|
|
65506
|
-
function powershellCommand(script, tolerateFailure = false) {
|
|
65525
|
+
function powershellCommand(script, tolerateFailure = false, commandTimeoutMs) {
|
|
65507
65526
|
return {
|
|
65508
65527
|
command: "powershell.exe",
|
|
65509
65528
|
args: ["-NoProfile", "-NonInteractive", "-Command", script],
|
|
65510
|
-
tolerateFailure
|
|
65529
|
+
tolerateFailure,
|
|
65530
|
+
commandTimeoutMs
|
|
65511
65531
|
};
|
|
65512
65532
|
}
|
|
65533
|
+
var WINDOWS_STATUS_COMMAND_TIMEOUT_MS = 2e4;
|
|
65513
65534
|
function windowsCommandLineArgument(value2) {
|
|
65514
65535
|
if (value2 && !/[\s"]/u.test(value2)) return value2;
|
|
65515
65536
|
const escaped = value2.replace(/(\\*)"/gu, (_match, slashes) => `${slashes}${slashes}\\"`).replace(/\\+$/u, (slashes) => `${slashes}${slashes}`);
|
|
@@ -65890,8 +65911,8 @@ WantedBy=default.target
|
|
|
65890
65911
|
],
|
|
65891
65912
|
forceStopCommands: [],
|
|
65892
65913
|
uninstallCommands: [powershellCommand(uninstallScript)],
|
|
65893
|
-
statusCommand: powershellCommand(statusScript, true),
|
|
65894
|
-
isActiveCommand: powershellCommand(statusScript, true),
|
|
65914
|
+
statusCommand: powershellCommand(statusScript, true, WINDOWS_STATUS_COMMAND_TIMEOUT_MS),
|
|
65915
|
+
isActiveCommand: powershellCommand(statusScript, true, WINDOWS_STATUS_COMMAND_TIMEOUT_MS),
|
|
65895
65916
|
definitionMarker
|
|
65896
65917
|
};
|
|
65897
65918
|
}
|
|
@@ -66116,9 +66137,11 @@ function createHostContext(options = {}) {
|
|
|
66116
66137
|
const run = async (command) => {
|
|
66117
66138
|
const remainingMs = options.deadlineMs === void 0 ? 15e3 : options.deadlineMs - nowMs();
|
|
66118
66139
|
if (remainingMs <= 0) throw new Error("Windows service setup deadline expired");
|
|
66140
|
+
const configuredTimeoutMs = command.commandTimeoutMs ?? options.commandTimeoutMs ?? 1e4;
|
|
66141
|
+
const effectiveTimeoutMs = options.deadlineMs === void 0 ? configuredTimeoutMs : Math.min(configuredTimeoutMs, remainingMs);
|
|
66119
66142
|
const result = options.runCommand ? await options.runCommand(command) : await runServiceCommand(command, {
|
|
66120
66143
|
signal: options.signal,
|
|
66121
|
-
commandTimeoutMs:
|
|
66144
|
+
commandTimeoutMs: effectiveTimeoutMs
|
|
66122
66145
|
});
|
|
66123
66146
|
if (options.deadlineMs !== void 0 && nowMs() >= options.deadlineMs) {
|
|
66124
66147
|
throw new Error("Windows service setup deadline expired");
|
|
@@ -66151,9 +66174,26 @@ function createHostContext(options = {}) {
|
|
|
66151
66174
|
releaseMaintenance: options.releaseMaintenance ?? releaseLocalDaemonMaintenanceLease
|
|
66152
66175
|
};
|
|
66153
66176
|
}
|
|
66177
|
+
function isTransientServiceCommandError(error61) {
|
|
66178
|
+
const cause = error61 instanceof Error ? error61.cause : void 0;
|
|
66179
|
+
return Boolean(cause?.killed) || cause?.name === "AbortError";
|
|
66180
|
+
}
|
|
66154
66181
|
async function inspectDaemonService(options = {}) {
|
|
66155
66182
|
const { plan, run, nowMs } = createHostContext(options);
|
|
66156
|
-
|
|
66183
|
+
let result;
|
|
66184
|
+
try {
|
|
66185
|
+
result = await run(plan.isActiveCommand);
|
|
66186
|
+
} catch (error61) {
|
|
66187
|
+
if (plan.platform === "win32" && isTransientServiceCommandError(error61)) {
|
|
66188
|
+
return {
|
|
66189
|
+
state: "unknown",
|
|
66190
|
+
platform: plan.platform,
|
|
66191
|
+
detail: error61 instanceof Error ? error61.message : String(error61),
|
|
66192
|
+
observedAtMs: nowMs()
|
|
66193
|
+
};
|
|
66194
|
+
}
|
|
66195
|
+
throw error61;
|
|
66196
|
+
}
|
|
66157
66197
|
let state;
|
|
66158
66198
|
if (plan.platform === "win32") {
|
|
66159
66199
|
try {
|
|
@@ -66187,7 +66227,15 @@ async function ensureDaemonServiceDefinition(options = {}) {
|
|
|
66187
66227
|
}
|
|
66188
66228
|
} else if (plan.platform === "win32") {
|
|
66189
66229
|
ensureLogDir();
|
|
66190
|
-
|
|
66230
|
+
let result;
|
|
66231
|
+
try {
|
|
66232
|
+
result = await run(plan.statusCommand);
|
|
66233
|
+
} catch (error61) {
|
|
66234
|
+
if (!isTransientServiceCommandError(error61)) throw error61;
|
|
66235
|
+
}
|
|
66236
|
+
if (!result) {
|
|
66237
|
+
return { changed: false, updatePending: false };
|
|
66238
|
+
}
|
|
66191
66239
|
const tasks = parseWindowsTaskInspection(result);
|
|
66192
66240
|
assertWindowsTaskOwnership(tasks);
|
|
66193
66241
|
if (tasks.currentPresent && tasks.currentState === "unknown" || tasks.legacyPresent && tasks.legacyState === "unknown") {
|