@tablation/crew 0.10.0 → 0.10.1
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/cli.js +18 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6839,14 +6839,30 @@ async function fetchDivergedPrompt(route, role, opts) {
|
|
|
6839
6839
|
headers: { "User-Agent": opts.userAgent ?? "Mozilla/5.0 TablationCrewAgent/1.0" }
|
|
6840
6840
|
});
|
|
6841
6841
|
let row;
|
|
6842
|
+
let agentsModelId;
|
|
6842
6843
|
try {
|
|
6843
6844
|
const agentsModel = await client2.dataModels.get("agents", route.resolved.workspaceId);
|
|
6844
|
-
|
|
6845
|
+
agentsModelId = agentsModel.id;
|
|
6846
|
+
row = await client2.records.get(agentsModelId, agentId);
|
|
6845
6847
|
} catch {
|
|
6846
6848
|
return void 0;
|
|
6847
6849
|
}
|
|
6848
6850
|
const defaultPrompt = personaDefaultPrompt(route.promptsDir, role);
|
|
6849
|
-
|
|
6851
|
+
if (row.prompt === defaultPrompt) return void 0;
|
|
6852
|
+
const cached = route.resolved.agentPersonas?.[role];
|
|
6853
|
+
if (cached?.agentId === agentId && cached.historyId) {
|
|
6854
|
+
const lastSynced = await fetchLastSyncedPrompt(route, agentsModelId, agentId, cached.historyId, opts.userAgent);
|
|
6855
|
+
if (lastSynced !== void 0 && lastSynced === row.prompt) return void 0;
|
|
6856
|
+
}
|
|
6857
|
+
return row.prompt;
|
|
6858
|
+
}
|
|
6859
|
+
async function fetchLastSyncedPrompt(route, agentsModelId, recordId, historyId, userAgent) {
|
|
6860
|
+
try {
|
|
6861
|
+
const entries = await fetchHistoryEntries(route, agentsModelId, recordId, userAgent);
|
|
6862
|
+
return entries.find((e) => e.history_id === historyId)?.prompt;
|
|
6863
|
+
} catch {
|
|
6864
|
+
return void 0;
|
|
6865
|
+
}
|
|
6850
6866
|
}
|
|
6851
6867
|
async function fetchSeatAgentModel(route, role, opts) {
|
|
6852
6868
|
const agentId = await resolveAgentId(route, role, opts);
|
package/package.json
CHANGED