@rubytech/taskmaster 1.0.10 → 1.0.12
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/agents/pi-embedded-helpers/errors.js +6 -7
- package/dist/agents/pi-embedded-runner/compact.js +5 -0
- package/dist/agents/pi-embedded-runner/run/attempt.js +5 -0
- package/dist/agents/pi-embedded-runner/run/payloads.js +4 -4
- package/dist/agents/pi-embedded-runner/run.js +4 -4
- package/dist/agents/pi-tools.js +1 -0
- package/dist/agents/skills/workspace.js +40 -3
- package/dist/agents/system-prompt.js +12 -6
- package/dist/agents/taskmaster-tools.js +10 -0
- package/dist/agents/tool-display.json +5 -0
- package/dist/agents/tool-policy.js +1 -0
- package/dist/agents/tools/memory-reindex-tool.js +67 -0
- package/dist/agents/tools/skill-read-tool.js +75 -0
- package/dist/agents/workspace.js +2 -2
- package/dist/auto-reply/reply/agent-runner-execution.js +17 -40
- package/dist/auto-reply/reply/agent-runner.js +14 -24
- package/dist/auto-reply/reply/session.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli/gateway-cli/dev.js +1 -1
- package/dist/cli/provision-seed.js +1 -0
- package/dist/control-ui/assets/{index-Dcwiyz6o.js → index-D8ayJUWC.js} +205 -195
- package/dist/control-ui/assets/index-D8ayJUWC.js.map +1 -0
- package/dist/control-ui/assets/{index-DE-53MKi.css → index-dMMqL7A5.css} +1 -1
- package/dist/control-ui/index.html +2 -2
- package/dist/gateway/protocol/schema/sessions-transcript.js +1 -0
- package/dist/gateway/server-methods/memory.js +62 -0
- package/dist/gateway/server-methods/sessions-transcript.js +10 -9
- package/dist/gateway/server-methods.js +5 -1
- package/dist/memory/manager.js +17 -1
- package/dist/memory/memory-schema.js +23 -1
- package/dist/web/auto-reply/monitor.js +1 -1
- package/package.json +1 -1
- package/taskmaster-docs/USER-GUIDE.md +43 -12
- package/templates/customer/agents/admin/AGENTS.md +6 -5
- package/templates/customer/agents/admin/TOOLS.md +36 -0
- package/templates/taskmaster/agents/admin/AGENTS.md +7 -5
- package/templates/tradesupport/agents/admin/AGENTS.md +6 -5
- package/dist/control-ui/assets/index-Dcwiyz6o.js.map +0 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
|
-
import fs from "node:fs";
|
|
3
2
|
import { lookupContextTokens } from "../../agents/context.js";
|
|
4
3
|
import { DEFAULT_CONTEXT_TOKENS } from "../../agents/defaults.js";
|
|
5
4
|
import { resolveModelAuthMode } from "../../agents/model-auth.js";
|
|
6
5
|
import { isCliProvider } from "../../agents/model-selection.js";
|
|
7
6
|
import { queueEmbeddedPiMessage } from "../../agents/pi-embedded.js";
|
|
8
7
|
import { hasNonzeroUsage } from "../../agents/usage.js";
|
|
9
|
-
import { resolveAgentIdFromSessionKey,
|
|
8
|
+
import { resolveAgentIdFromSessionKey, resolveSessionTranscriptPath, updateSessionStore, updateSessionStoreEntry, } from "../../config/sessions.js";
|
|
10
9
|
import { defaultRuntime } from "../../runtime.js";
|
|
11
10
|
import { estimateUsageCost, resolveModelCostConfig } from "../../utils/usage-format.js";
|
|
12
11
|
import { resolveResponseUsageMode } from "../thinking.js";
|
|
@@ -128,20 +127,29 @@ export async function runReplyAgent(params) {
|
|
|
128
127
|
agentCfgContextTokens,
|
|
129
128
|
});
|
|
130
129
|
let responseUsageLine;
|
|
131
|
-
const resetSession = async ({ failureLabel, buildLogMessage,
|
|
130
|
+
const resetSession = async ({ failureLabel, buildLogMessage, }) => {
|
|
132
131
|
if (!sessionKey || !activeSessionStore || !storePath)
|
|
133
132
|
return false;
|
|
134
133
|
const prevEntry = activeSessionStore[sessionKey] ?? activeSessionEntry;
|
|
135
134
|
if (!prevEntry)
|
|
136
135
|
return false;
|
|
137
|
-
const prevSessionId = cleanupTranscripts ? prevEntry.sessionId : undefined;
|
|
138
136
|
const nextSessionId = crypto.randomUUID();
|
|
137
|
+
// Archive the previous session so it remains accessible via sessions_history.
|
|
138
|
+
const prevArchive = prevEntry.sessionId && prevEntry.sessionId !== nextSessionId
|
|
139
|
+
? {
|
|
140
|
+
sessionId: prevEntry.sessionId,
|
|
141
|
+
sessionFile: prevEntry.sessionFile,
|
|
142
|
+
endedAt: Date.now(),
|
|
143
|
+
}
|
|
144
|
+
: undefined;
|
|
145
|
+
const existingArchive = prevEntry.previousSessions ?? [];
|
|
139
146
|
const nextEntry = {
|
|
140
147
|
...prevEntry,
|
|
141
148
|
sessionId: nextSessionId,
|
|
142
149
|
updatedAt: Date.now(),
|
|
143
150
|
systemSent: false,
|
|
144
151
|
abortedLastRun: false,
|
|
152
|
+
previousSessions: prevArchive ? [...existingArchive, prevArchive] : existingArchive,
|
|
145
153
|
};
|
|
146
154
|
const agentId = resolveAgentIdFromSessionKey(sessionKey);
|
|
147
155
|
const nextSessionFile = resolveSessionTranscriptPath(nextSessionId, agentId, sessionCtx.MessageThreadId);
|
|
@@ -160,21 +168,6 @@ export async function runReplyAgent(params) {
|
|
|
160
168
|
activeSessionEntry = nextEntry;
|
|
161
169
|
activeIsNewSession = true;
|
|
162
170
|
defaultRuntime.error(buildLogMessage(nextSessionId));
|
|
163
|
-
if (cleanupTranscripts && prevSessionId) {
|
|
164
|
-
const transcriptCandidates = new Set();
|
|
165
|
-
const resolved = resolveSessionFilePath(prevSessionId, prevEntry, { agentId });
|
|
166
|
-
if (resolved)
|
|
167
|
-
transcriptCandidates.add(resolved);
|
|
168
|
-
transcriptCandidates.add(resolveSessionTranscriptPath(prevSessionId, agentId));
|
|
169
|
-
for (const candidate of transcriptCandidates) {
|
|
170
|
-
try {
|
|
171
|
-
fs.unlinkSync(candidate);
|
|
172
|
-
}
|
|
173
|
-
catch {
|
|
174
|
-
// Best-effort cleanup.
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
171
|
return true;
|
|
179
172
|
};
|
|
180
173
|
const resetSessionAfterCompactionFailure = async (reason) => resetSession({
|
|
@@ -182,9 +175,8 @@ export async function runReplyAgent(params) {
|
|
|
182
175
|
buildLogMessage: (nextSessionId) => `Auto-compaction failed (${reason}). Restarting session ${sessionKey} -> ${nextSessionId} and retrying.`,
|
|
183
176
|
});
|
|
184
177
|
const resetSessionAfterRoleOrderingConflict = async (reason) => resetSession({
|
|
185
|
-
failureLabel: "
|
|
186
|
-
buildLogMessage: (nextSessionId) => `
|
|
187
|
-
cleanupTranscripts: true,
|
|
178
|
+
failureLabel: "session corruption",
|
|
179
|
+
buildLogMessage: (nextSessionId) => `Session corruption (${reason}). Restarting session ${sessionKey} -> ${nextSessionId}.`,
|
|
188
180
|
});
|
|
189
181
|
try {
|
|
190
182
|
const runStartedAt = Date.now();
|
|
@@ -207,8 +199,6 @@ export async function runReplyAgent(params) {
|
|
|
207
199
|
isHeartbeat,
|
|
208
200
|
sessionKey,
|
|
209
201
|
getActiveSessionEntry: () => activeSessionEntry,
|
|
210
|
-
activeSessionStore,
|
|
211
|
-
storePath,
|
|
212
202
|
resolvedVerboseLevel,
|
|
213
203
|
});
|
|
214
204
|
if (runOutcome.kind === "final") {
|
|
@@ -260,7 +260,7 @@ export async function initSessionState(params) {
|
|
|
260
260
|
sessionFile: previousSessionEntry.sessionFile,
|
|
261
261
|
endedAt: Date.now(),
|
|
262
262
|
};
|
|
263
|
-
const existing =
|
|
263
|
+
const existing = entry?.previousSessions ?? [];
|
|
264
264
|
sessionEntry.previousSessions = [...existing, prev];
|
|
265
265
|
}
|
|
266
266
|
// Preserve per-session overrides while resetting compaction state on /new.
|
package/dist/build-info.json
CHANGED
|
@@ -10,7 +10,7 @@ const DEV_IDENTITY_NAME = "C3-PO";
|
|
|
10
10
|
const DEV_IDENTITY_THEME = "protocol droid";
|
|
11
11
|
const DEV_IDENTITY_EMOJI = "🤖";
|
|
12
12
|
const DEV_AGENT_WORKSPACE_SUFFIX = "dev";
|
|
13
|
-
const DEV_TEMPLATE_DIR = path.resolve(path.dirname(new URL(import.meta.url).pathname), "../../../
|
|
13
|
+
const DEV_TEMPLATE_DIR = path.resolve(path.dirname(new URL(import.meta.url).pathname), "../../../templates/customer/agents/admin");
|
|
14
14
|
async function loadDevTemplate(name, fallback) {
|
|
15
15
|
try {
|
|
16
16
|
const raw = await fs.promises.readFile(path.join(DEV_TEMPLATE_DIR, name), "utf-8");
|