@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.
Files changed (2) hide show
  1. package/dist/cli.js +18 -2
  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
- row = await client2.records.get(agentsModel.id, agentId);
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
- return row.prompt !== defaultPrompt ? row.prompt : void 0;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tablation/crew",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "A standing team of headless agents that picks work off a Tablation board, does it on a machine you control, and reports back.",
5
5
  "type": "module",
6
6
  "license": "MIT",