@rubytech/taskmaster 1.0.84 → 1.0.85
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.
|
@@ -112,6 +112,18 @@ export function resolveAgentWorkspaceDir(cfg, agentId) {
|
|
|
112
112
|
}
|
|
113
113
|
return path.join(os.homedir(), `taskmaster-${id}`);
|
|
114
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Resolve the workspace ROOT directory for an agent.
|
|
117
|
+
* Multi-agent workspaces set each agent's workspace to a subdirectory
|
|
118
|
+
* (e.g. ~/taskmaster/agents/admin). Shared resources — memory/, skills/,
|
|
119
|
+
* files — live at the workspace root (~/taskmaster), not the agent subdir.
|
|
120
|
+
*/
|
|
121
|
+
export function resolveAgentWorkspaceRoot(cfg, agentId) {
|
|
122
|
+
const agentDir = resolveAgentWorkspaceDir(cfg, agentId);
|
|
123
|
+
const normalised = agentDir.replace(/\/+$/, "");
|
|
124
|
+
const match = normalised.match(/^(.+)\/agents\/[^/]+$/);
|
|
125
|
+
return match ? match[1] : normalised;
|
|
126
|
+
}
|
|
115
127
|
export function resolveAgentDir(cfg, agentId) {
|
|
116
128
|
const id = normalizeAgentId(agentId);
|
|
117
129
|
const configured = resolveAgentConfig(cfg, id)?.agentDir?.trim();
|
package/dist/build-info.json
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
1
|
import fsp from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveAgentWorkspaceRoot, resolveDefaultAgentId } from "../../agents/agent-scope.js";
|
|
4
4
|
import { loadConfig } from "../../config/config.js";
|
|
5
5
|
import { ErrorCodes, errorShape } from "../protocol/index.js";
|
|
6
6
|
const MAX_PREVIEW_BYTES = 256 * 1024; // 256 KB for preview
|
|
7
7
|
const MAX_DOWNLOAD_BYTES = 5 * 1024 * 1024; // 5 MB for download
|
|
8
8
|
const MAX_UPLOAD_BYTES = 5 * 1024 * 1024; // 5 MB for upload
|
|
9
|
-
/**
|
|
10
|
-
* Multi-agent workspaces set each agent's workspace to a subdirectory
|
|
11
|
-
* (e.g. ~/taskmaster/agents/admin). The files page should show the
|
|
12
|
-
* workspace root (~/taskmaster), not the agent subdir.
|
|
13
|
-
*/
|
|
14
|
-
function stripAgentSubdir(agentWorkspaceDir) {
|
|
15
|
-
const normalised = agentWorkspaceDir.replace(/\/+$/, "");
|
|
16
|
-
const match = normalised.match(/^(.+)\/agents\/[^/]+$/);
|
|
17
|
-
return match ? match[1] : normalised;
|
|
18
|
-
}
|
|
19
9
|
function resolveWorkspaceRoot() {
|
|
20
10
|
const cfg = loadConfig();
|
|
21
|
-
return
|
|
11
|
+
return resolveAgentWorkspaceRoot(cfg, resolveDefaultAgentId(cfg));
|
|
22
12
|
}
|
|
23
13
|
/**
|
|
24
14
|
* Resolve workspace root from request params.
|
|
@@ -30,7 +20,7 @@ function resolveWorkspaceForRequest(params) {
|
|
|
30
20
|
if (!agentId)
|
|
31
21
|
return resolveWorkspaceRoot();
|
|
32
22
|
const cfg = loadConfig();
|
|
33
|
-
return
|
|
23
|
+
return resolveAgentWorkspaceRoot(cfg, agentId);
|
|
34
24
|
}
|
|
35
25
|
/**
|
|
36
26
|
* Validate and resolve a relative path within the workspace.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveAgentWorkspaceRoot, resolveDefaultAgentId } from "../../agents/agent-scope.js";
|
|
2
2
|
import { loadConfig } from "../../config/config.js";
|
|
3
3
|
import { clearAuditEntries, getUnreviewedEntries } from "../../memory/audit.js";
|
|
4
4
|
import { getMemorySearchManager } from "../../memory/index.js";
|
|
@@ -69,7 +69,7 @@ export const memoryHandlers = {
|
|
|
69
69
|
const agentId = typeof params.agentId === "string" && params.agentId.trim()
|
|
70
70
|
? params.agentId.trim()
|
|
71
71
|
: resolveDefaultAgentId(cfg);
|
|
72
|
-
const workspaceDir =
|
|
72
|
+
const workspaceDir = resolveAgentWorkspaceRoot(cfg, agentId);
|
|
73
73
|
const entries = getUnreviewedEntries(workspaceDir);
|
|
74
74
|
respond(true, { ok: true, entries });
|
|
75
75
|
}
|
|
@@ -119,7 +119,7 @@ export const memoryHandlers = {
|
|
|
119
119
|
const agentId = typeof params.agentId === "string" && params.agentId.trim()
|
|
120
120
|
? params.agentId.trim()
|
|
121
121
|
: resolveDefaultAgentId(cfg);
|
|
122
|
-
const workspaceDir =
|
|
122
|
+
const workspaceDir = resolveAgentWorkspaceRoot(cfg, agentId);
|
|
123
123
|
const result = clearAuditEntries(workspaceDir);
|
|
124
124
|
respond(true, { ok: true, cleared: result.cleared });
|
|
125
125
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveAgentWorkspaceRoot, resolveDefaultAgentId } from "../../agents/agent-scope.js";
|
|
2
2
|
import { installSkill } from "../../agents/skills-install.js";
|
|
3
3
|
import { buildWorkspaceSkillStatus } from "../../agents/skills-status.js";
|
|
4
4
|
import { loadWorkspaceSkillEntries } from "../../agents/skills.js";
|
|
@@ -11,11 +11,11 @@ function listWorkspaceDirs(cfg) {
|
|
|
11
11
|
if (Array.isArray(list)) {
|
|
12
12
|
for (const entry of list) {
|
|
13
13
|
if (entry && typeof entry === "object" && typeof entry.id === "string") {
|
|
14
|
-
dirs.add(
|
|
14
|
+
dirs.add(resolveAgentWorkspaceRoot(cfg, entry.id));
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
dirs.add(
|
|
18
|
+
dirs.add(resolveAgentWorkspaceRoot(cfg, resolveDefaultAgentId(cfg)));
|
|
19
19
|
return [...dirs];
|
|
20
20
|
}
|
|
21
21
|
function collectSkillBins(entries) {
|
|
@@ -52,7 +52,7 @@ export const skillsHandlers = {
|
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
const cfg = loadConfig();
|
|
55
|
-
const workspaceDir =
|
|
55
|
+
const workspaceDir = resolveAgentWorkspaceRoot(cfg, resolveDefaultAgentId(cfg));
|
|
56
56
|
const report = buildWorkspaceSkillStatus(workspaceDir, {
|
|
57
57
|
config: cfg,
|
|
58
58
|
eligibility: { remote: getRemoteSkillEligibility() },
|
|
@@ -81,7 +81,7 @@ export const skillsHandlers = {
|
|
|
81
81
|
}
|
|
82
82
|
const p = params;
|
|
83
83
|
const cfg = loadConfig();
|
|
84
|
-
const workspaceDirRaw =
|
|
84
|
+
const workspaceDirRaw = resolveAgentWorkspaceRoot(cfg, resolveDefaultAgentId(cfg));
|
|
85
85
|
const result = await installSkill({
|
|
86
86
|
workspaceDir: workspaceDirRaw,
|
|
87
87
|
skillName: p.name,
|
package/dist/memory/manager.js
CHANGED
|
@@ -3,7 +3,7 @@ import fsSync from "node:fs";
|
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import chokidar from "chokidar";
|
|
6
|
-
import { resolveAgentDir,
|
|
6
|
+
import { resolveAgentDir, resolveAgentWorkspaceRoot } from "../agents/agent-scope.js";
|
|
7
7
|
import { resolveMemorySearchConfig } from "../agents/memory-search.js";
|
|
8
8
|
import { createInternalHookEvent, triggerInternalHook } from "../hooks/internal-hooks.js";
|
|
9
9
|
import { resolveSessionTranscriptsDirForAgent } from "../config/sessions/paths.js";
|
|
@@ -299,7 +299,7 @@ export class MemoryIndexManager {
|
|
|
299
299
|
const settings = resolveMemorySearchConfig(cfg, agentId);
|
|
300
300
|
if (!settings)
|
|
301
301
|
return null;
|
|
302
|
-
const workspaceDir =
|
|
302
|
+
const workspaceDir = resolveAgentWorkspaceRoot(cfg, agentId);
|
|
303
303
|
// Ensure standard memory folder structure exists
|
|
304
304
|
await MemoryIndexManager.ensureMemoryStructure(workspaceDir);
|
|
305
305
|
const key = `${agentId}:${workspaceDir}:${JSON.stringify(settings)}`;
|