@slock-ai/daemon 0.46.2 → 0.47.0-staging.20260511151721
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/chat-bridge.js +4 -4
- package/dist/{chunk-FG5JGA67.js → chunk-77TJIZSE.js} +360 -41
- package/dist/{chunk-Z3PCMYZO.js → chunk-B7XIMLOT.js} +44 -1
- package/dist/cli/index.js +14162 -228
- package/dist/core.js +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -207,6 +207,45 @@ async function executeResponseRequest(url, init, {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
// src/slockHome.ts
|
|
211
|
+
import os from "os";
|
|
212
|
+
import path from "path";
|
|
213
|
+
import { existsSync } from "fs";
|
|
214
|
+
var SLOCK_HOME_ENV = "SLOCK_HOME";
|
|
215
|
+
function resolveDefaultSlockHome(homeDir = os.homedir()) {
|
|
216
|
+
return path.resolve(path.join(homeDir, ".slock"));
|
|
217
|
+
}
|
|
218
|
+
function resolveSlockHome(env = process.env, homeDir = os.homedir()) {
|
|
219
|
+
const raw = env[SLOCK_HOME_ENV]?.trim();
|
|
220
|
+
const root = raw && raw.length > 0 ? raw : resolveDefaultSlockHome(homeDir);
|
|
221
|
+
return path.resolve(root);
|
|
222
|
+
}
|
|
223
|
+
function resolveSlockHomePath(childPath, slockHome = resolveSlockHome()) {
|
|
224
|
+
return path.join(slockHome, childPath);
|
|
225
|
+
}
|
|
226
|
+
function listLegacySlockStatePaths(slockHome = resolveSlockHome(), homeDir = os.homedir()) {
|
|
227
|
+
const defaultHome = resolveDefaultSlockHome(homeDir);
|
|
228
|
+
if (path.resolve(slockHome) === defaultHome) return [];
|
|
229
|
+
const candidates = [
|
|
230
|
+
{
|
|
231
|
+
path: path.join(defaultHome, "agents"),
|
|
232
|
+
destination: path.join(slockHome, "agents"),
|
|
233
|
+
description: "agent workspaces and per-agent runtime wrapper state"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
path: path.join(defaultHome, "machines"),
|
|
237
|
+
destination: path.join(slockHome, "machines"),
|
|
238
|
+
description: "daemon machine locks, local traces, and machine-scoped state"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
path: path.join(defaultHome, "attachments"),
|
|
242
|
+
destination: path.join(slockHome, "attachments"),
|
|
243
|
+
description: "chat bridge attachment download cache"
|
|
244
|
+
}
|
|
245
|
+
];
|
|
246
|
+
return candidates.filter((candidate) => existsSync(candidate.path));
|
|
247
|
+
}
|
|
248
|
+
|
|
210
249
|
export {
|
|
211
250
|
subscribeDaemonLogs,
|
|
212
251
|
logger,
|
|
@@ -214,5 +253,9 @@ export {
|
|
|
214
253
|
buildFetchDispatcher,
|
|
215
254
|
DEFAULT_CHAT_BRIDGE_TOOL_TIMEOUT_MS,
|
|
216
255
|
executeJsonRequest,
|
|
217
|
-
executeResponseRequest
|
|
256
|
+
executeResponseRequest,
|
|
257
|
+
SLOCK_HOME_ENV,
|
|
258
|
+
resolveSlockHome,
|
|
259
|
+
resolveSlockHomePath,
|
|
260
|
+
listLegacySlockStatePaths
|
|
218
261
|
};
|