funolio-agent 1.0.75 → 1.1.65
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/auth/credential-reader.d.ts.map +1 -1
- package/dist/auth/credential-reader.js +4 -3
- package/dist/auth/credential-reader.js.map +1 -1
- package/dist/auth/token-refresh.d.ts +8 -0
- package/dist/auth/token-refresh.d.ts.map +1 -1
- package/dist/auth/token-refresh.js +82 -52
- package/dist/auth/token-refresh.js.map +1 -1
- package/dist/auto-organizer.d.ts.map +1 -1
- package/dist/auto-organizer.js +6 -7
- package/dist/auto-organizer.js.map +1 -1
- package/dist/bench-prefix.d.ts +16 -0
- package/dist/bench-prefix.d.ts.map +1 -0
- package/dist/bench-prefix.js +25 -0
- package/dist/bench-prefix.js.map +1 -0
- package/dist/bot-manager.d.ts.map +1 -1
- package/dist/bot-manager.js +23 -14
- package/dist/bot-manager.js.map +1 -1
- package/dist/chat-sync.d.ts +42 -0
- package/dist/chat-sync.d.ts.map +1 -0
- package/dist/chat-sync.js +95 -0
- package/dist/chat-sync.js.map +1 -0
- package/dist/clerk-model.d.ts +7 -0
- package/dist/clerk-model.d.ts.map +1 -1
- package/dist/clerk-model.js +42 -8
- package/dist/clerk-model.js.map +1 -1
- package/dist/cli-bootstrap-history.d.ts +10 -0
- package/dist/cli-bootstrap-history.d.ts.map +1 -0
- package/dist/cli-bootstrap-history.js +112 -0
- package/dist/cli-bootstrap-history.js.map +1 -0
- package/dist/cli-models.d.ts +8 -0
- package/dist/cli-models.d.ts.map +1 -0
- package/dist/cli-models.js +91 -0
- package/dist/cli-models.js.map +1 -0
- package/dist/cli-session-epoch.d.ts +13 -3
- package/dist/cli-session-epoch.d.ts.map +1 -1
- package/dist/cli-session-epoch.js +53 -4
- package/dist/cli-session-epoch.js.map +1 -1
- package/dist/codex-app-server-manager.d.ts +64 -4
- package/dist/codex-app-server-manager.d.ts.map +1 -1
- package/dist/codex-app-server-manager.js +755 -55
- package/dist/codex-app-server-manager.js.map +1 -1
- package/dist/commands/pool.d.ts +32 -0
- package/dist/commands/pool.d.ts.map +1 -1
- package/dist/commands/pool.js +145 -66
- package/dist/commands/pool.js.map +1 -1
- package/dist/commands/start.d.ts +21 -0
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +484 -63
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +5 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +170 -58
- package/dist/config.js.map +1 -1
- package/dist/context-window.d.ts +37 -1
- package/dist/context-window.d.ts.map +1 -1
- package/dist/context-window.js +202 -16
- package/dist/context-window.js.map +1 -1
- package/dist/live-activity.d.ts +3 -1
- package/dist/live-activity.d.ts.map +1 -1
- package/dist/live-activity.js.map +1 -1
- package/dist/local-chat-execution.d.ts +114 -0
- package/dist/local-chat-execution.d.ts.map +1 -0
- package/dist/local-chat-execution.js +349 -0
- package/dist/local-chat-execution.js.map +1 -0
- package/dist/local-cli-pty-manager.d.ts +138 -3
- package/dist/local-cli-pty-manager.d.ts.map +1 -1
- package/dist/local-cli-pty-manager.js +1415 -111
- package/dist/local-cli-pty-manager.js.map +1 -1
- package/dist/local-conversation-gateway.d.ts +110 -0
- package/dist/local-conversation-gateway.d.ts.map +1 -0
- package/dist/local-conversation-gateway.js +175 -0
- package/dist/local-conversation-gateway.js.map +1 -0
- package/dist/local-data.d.ts +235 -5
- package/dist/local-data.d.ts.map +1 -1
- package/dist/local-data.js +1066 -87
- package/dist/local-data.js.map +1 -1
- package/dist/local-db.d.ts +6 -0
- package/dist/local-db.d.ts.map +1 -1
- package/dist/local-db.js +376 -4
- package/dist/local-db.js.map +1 -1
- package/dist/local-funnel.d.ts.map +1 -1
- package/dist/local-funnel.js +6 -5
- package/dist/local-funnel.js.map +1 -1
- package/dist/local-server.d.ts +30 -0
- package/dist/local-server.d.ts.map +1 -1
- package/dist/local-server.js +2898 -319
- package/dist/local-server.js.map +1 -1
- package/dist/managed-process-registry.d.ts +59 -0
- package/dist/managed-process-registry.d.ts.map +1 -0
- package/dist/managed-process-registry.js +390 -0
- package/dist/managed-process-registry.js.map +1 -0
- package/dist/mcp/claude-config-writer.d.ts +5 -5
- package/dist/mcp/claude-config-writer.d.ts.map +1 -1
- package/dist/mcp/claude-config-writer.js +19 -11
- package/dist/mcp/claude-config-writer.js.map +1 -1
- package/dist/mcp/index.d.ts +4 -2
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/sync-cli-config.d.ts +42 -4
- package/dist/mcp/sync-cli-config.d.ts.map +1 -1
- package/dist/mcp/sync-cli-config.js +497 -17
- package/dist/mcp/sync-cli-config.js.map +1 -1
- package/dist/message-loop.d.ts.map +1 -1
- package/dist/message-loop.js +43 -1
- package/dist/message-loop.js.map +1 -1
- package/dist/mqtt-client.d.ts +34 -0
- package/dist/mqtt-client.d.ts.map +1 -1
- package/dist/mqtt-client.js +270 -45
- package/dist/mqtt-client.js.map +1 -1
- package/dist/mqtt-data-relay.d.ts +44 -0
- package/dist/mqtt-data-relay.d.ts.map +1 -0
- package/dist/mqtt-data-relay.js +106 -0
- package/dist/mqtt-data-relay.js.map +1 -0
- package/dist/orchestration/capabilities.d.ts +13 -0
- package/dist/orchestration/capabilities.d.ts.map +1 -0
- package/dist/orchestration/capabilities.js +152 -0
- package/dist/orchestration/capabilities.js.map +1 -0
- package/dist/orchestration/dispatch-executor.d.ts +83 -0
- package/dist/orchestration/dispatch-executor.d.ts.map +1 -0
- package/dist/orchestration/dispatch-executor.js +266 -0
- package/dist/orchestration/dispatch-executor.js.map +1 -0
- package/dist/orchestration/dispatch-hint.d.ts +134 -0
- package/dist/orchestration/dispatch-hint.d.ts.map +1 -0
- package/dist/orchestration/dispatch-hint.js +247 -0
- package/dist/orchestration/dispatch-hint.js.map +1 -0
- package/dist/orchestration/dispatch-runner.d.ts +106 -0
- package/dist/orchestration/dispatch-runner.d.ts.map +1 -0
- package/dist/orchestration/dispatch-runner.js +604 -0
- package/dist/orchestration/dispatch-runner.js.map +1 -0
- package/dist/orchestration/dispatch-tools.d.ts +167 -0
- package/dist/orchestration/dispatch-tools.d.ts.map +1 -0
- package/dist/orchestration/dispatch-tools.js +328 -0
- package/dist/orchestration/dispatch-tools.js.map +1 -0
- package/dist/orchestration/front-door-policy.d.ts +35 -10
- package/dist/orchestration/front-door-policy.d.ts.map +1 -1
- package/dist/orchestration/front-door-policy.js +30 -267
- package/dist/orchestration/front-door-policy.js.map +1 -1
- package/dist/orchestration/orchestrator-dispatch-prompt.d.ts +43 -0
- package/dist/orchestration/orchestrator-dispatch-prompt.d.ts.map +1 -0
- package/dist/orchestration/orchestrator-dispatch-prompt.js +267 -0
- package/dist/orchestration/orchestrator-dispatch-prompt.js.map +1 -0
- package/dist/orchestration/orchestrator-operating-prompt.d.ts +14 -0
- package/dist/orchestration/orchestrator-operating-prompt.d.ts.map +1 -1
- package/dist/orchestration/orchestrator-operating-prompt.js +157 -31
- package/dist/orchestration/orchestrator-operating-prompt.js.map +1 -1
- package/dist/orchestration/plan-import.d.ts +39 -0
- package/dist/orchestration/plan-import.d.ts.map +1 -0
- package/dist/orchestration/plan-import.js +547 -0
- package/dist/orchestration/plan-import.js.map +1 -0
- package/dist/orchestration/worker-operating-prompt.d.ts +2 -0
- package/dist/orchestration/worker-operating-prompt.d.ts.map +1 -1
- package/dist/orchestration/worker-operating-prompt.js +36 -46
- package/dist/orchestration/worker-operating-prompt.js.map +1 -1
- package/dist/orchestrator.d.ts +195 -3
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +1970 -432
- package/dist/orchestrator.js.map +1 -1
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +8 -4
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/claude-cli.d.ts.map +1 -1
- package/dist/providers/claude-cli.js +28 -3
- package/dist/providers/claude-cli.js.map +1 -1
- package/dist/providers/codex-cli.d.ts +10 -6
- package/dist/providers/codex-cli.d.ts.map +1 -1
- package/dist/providers/codex-cli.js +190 -17
- package/dist/providers/codex-cli.js.map +1 -1
- package/dist/providers/google.d.ts.map +1 -1
- package/dist/providers/google.js +15 -5
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/index.d.ts +15 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openai.d.ts +1 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +13 -5
- package/dist/providers/openai.js.map +1 -1
- package/dist/server-adapter.d.ts +8 -0
- package/dist/server-adapter.d.ts.map +1 -1
- package/dist/server-adapter.js +7 -0
- package/dist/server-adapter.js.map +1 -1
- package/dist/service-mode.d.ts +1 -1
- package/dist/service-mode.d.ts.map +1 -1
- package/dist/service-mode.js +64 -1
- package/dist/service-mode.js.map +1 -1
- package/dist/service-setup-only.d.ts +8 -0
- package/dist/service-setup-only.d.ts.map +1 -0
- package/dist/service-setup-only.js +37 -0
- package/dist/service-setup-only.js.map +1 -0
- package/dist/slash-commands.d.ts +21 -0
- package/dist/slash-commands.d.ts.map +1 -0
- package/dist/slash-commands.js +99 -0
- package/dist/slash-commands.js.map +1 -0
- package/dist/subagent/index.d.ts +4 -2
- package/dist/subagent/index.d.ts.map +1 -1
- package/dist/subagent/index.js.map +1 -1
- package/dist/summarization-pipeline.d.ts.map +1 -1
- package/dist/summarization-pipeline.js +1 -9
- package/dist/summarization-pipeline.js.map +1 -1
- package/dist/token-counter.d.ts.map +1 -1
- package/dist/token-counter.js +11 -4
- package/dist/token-counter.js.map +1 -1
- package/dist/tool-filter.d.ts.map +1 -1
- package/dist/tool-filter.js +10 -6
- package/dist/tool-filter.js.map +1 -1
- package/dist/tools/admin-tools.d.ts.map +1 -1
- package/dist/tools/admin-tools.js +13 -4
- package/dist/tools/admin-tools.js.map +1 -1
- package/dist/tools/run-command.d.ts.map +1 -1
- package/dist/tools/run-command.js +5 -1
- package/dist/tools/run-command.js.map +1 -1
- package/dist/tools/search-conversation-history.d.ts.map +1 -1
- package/dist/tools/search-conversation-history.js +12 -2
- package/dist/tools/search-conversation-history.js.map +1 -1
- package/dist/tools/todo-tasks.d.ts.map +1 -1
- package/dist/tools/todo-tasks.js +77 -5
- package/dist/tools/todo-tasks.js.map +1 -1
- package/dist/usage-log.d.ts +62 -0
- package/dist/usage-log.d.ts.map +1 -0
- package/dist/usage-log.js +98 -0
- package/dist/usage-log.js.map +1 -0
- package/dist/wizard-state.d.ts +13 -0
- package/dist/wizard-state.d.ts.map +1 -1
- package/dist/wizard-state.js +61 -3
- package/dist/wizard-state.js.map +1 -1
- package/dist/wizard-support.d.ts.map +1 -1
- package/dist/wizard-support.js +27 -1
- package/dist/wizard-support.js.map +1 -1
- package/dist/workflow-engine.d.ts +40 -1
- package/dist/workflow-engine.d.ts.map +1 -1
- package/dist/workflow-engine.js +753 -93
- package/dist/workflow-engine.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.LocalConversationGateway = void 0;
|
|
37
|
+
const data = __importStar(require("./local-data"));
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
// Helpers
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
function rowToSummary(r) {
|
|
42
|
+
const botId = r.initial_bot_id ?? r.bot_id ?? null;
|
|
43
|
+
return {
|
|
44
|
+
id: r.id,
|
|
45
|
+
title: r.title,
|
|
46
|
+
source: r.source ?? null,
|
|
47
|
+
sourceModel: r.source_model ?? null,
|
|
48
|
+
projectId: r.project_id ?? null,
|
|
49
|
+
botId,
|
|
50
|
+
messageCount: r.message_count ?? 0,
|
|
51
|
+
tokenCount: r.token_count ?? 0,
|
|
52
|
+
isArchived: r.is_archived === 1,
|
|
53
|
+
createdAt: r.created_at,
|
|
54
|
+
updatedAt: r.updated_at,
|
|
55
|
+
bot: botId ? { id: botId, name: null } : null,
|
|
56
|
+
job_status: null,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function rowToDetail(r) {
|
|
60
|
+
return {
|
|
61
|
+
id: r.id,
|
|
62
|
+
title: r.title,
|
|
63
|
+
sourceModel: r.source_model ?? null,
|
|
64
|
+
projectId: r.project_id ?? null,
|
|
65
|
+
messageCount: r.message_count ?? 0,
|
|
66
|
+
tokenCount: r.token_count ?? 0,
|
|
67
|
+
isArchived: r.is_archived === 1,
|
|
68
|
+
createdAt: r.created_at,
|
|
69
|
+
updatedAt: r.updated_at,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function msgRowToMessage(m) {
|
|
73
|
+
let attachments = undefined;
|
|
74
|
+
if (m.attachments_json) {
|
|
75
|
+
try {
|
|
76
|
+
attachments = JSON.parse(m.attachments_json);
|
|
77
|
+
}
|
|
78
|
+
catch { /* skip */ }
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
id: m.id,
|
|
82
|
+
role: m.role,
|
|
83
|
+
content: m.content,
|
|
84
|
+
sequenceNumber: m.seq,
|
|
85
|
+
model: m.model ?? null,
|
|
86
|
+
botId: m.bot_id ?? null,
|
|
87
|
+
tokenCount: m.token_count ?? null,
|
|
88
|
+
promptTokens: null,
|
|
89
|
+
completionTokens: null,
|
|
90
|
+
responseTime: null,
|
|
91
|
+
llmCalls: null,
|
|
92
|
+
promptSnapshot: null,
|
|
93
|
+
ragSnapshot: null,
|
|
94
|
+
timestamp: m.created_at,
|
|
95
|
+
codeBlocks: null,
|
|
96
|
+
attachments,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// Implementation
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
class LocalConversationGateway {
|
|
103
|
+
agentId;
|
|
104
|
+
constructor(agentId) {
|
|
105
|
+
this.agentId = agentId;
|
|
106
|
+
}
|
|
107
|
+
async listConversations(params) {
|
|
108
|
+
const limit = Math.min(params.limit ?? 50, 100);
|
|
109
|
+
const rows = data.listConversations({ limit: limit + 1 });
|
|
110
|
+
const hasMore = rows.length > limit;
|
|
111
|
+
const items = hasMore ? rows.slice(0, limit) : rows;
|
|
112
|
+
const nextCursor = hasMore ? items[items.length - 1]?.id : undefined;
|
|
113
|
+
return {
|
|
114
|
+
conversations: items.map(rowToSummary),
|
|
115
|
+
nextCursor,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
async createConversation(params) {
|
|
119
|
+
const row = data.createConversation(this.agentId, params.title || 'New Conversation', 'web-chat', { projectId: params.projectId ?? null });
|
|
120
|
+
return {
|
|
121
|
+
id: row.id,
|
|
122
|
+
title: row.title ?? 'New Conversation',
|
|
123
|
+
sourceModel: params.model ?? null,
|
|
124
|
+
projectId: row.project_id ?? null,
|
|
125
|
+
createdAt: row.created_at,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
async getConversation(conversationId) {
|
|
129
|
+
const row = data.getConversation(conversationId);
|
|
130
|
+
if (!row)
|
|
131
|
+
throw new Error('Conversation not found');
|
|
132
|
+
return rowToDetail(row);
|
|
133
|
+
}
|
|
134
|
+
async updateConversation(conversationId, params) {
|
|
135
|
+
const existing = data.getConversation(conversationId);
|
|
136
|
+
if (!existing)
|
|
137
|
+
throw new Error('Conversation not found');
|
|
138
|
+
const fields = {};
|
|
139
|
+
if (params.title !== undefined)
|
|
140
|
+
fields.title = params.title;
|
|
141
|
+
if (params.isArchived !== undefined)
|
|
142
|
+
fields.isArchived = params.isArchived;
|
|
143
|
+
if (params.projectId !== undefined)
|
|
144
|
+
fields.projectId = params.projectId || undefined;
|
|
145
|
+
data.updateConversation(conversationId, fields);
|
|
146
|
+
const updated = data.getConversation(conversationId);
|
|
147
|
+
return {
|
|
148
|
+
id: conversationId,
|
|
149
|
+
title: updated?.title ?? existing.title,
|
|
150
|
+
isArchived: (updated?.is_archived ?? existing.is_archived) === 1,
|
|
151
|
+
projectId: updated?.project_id ?? existing.project_id ?? null,
|
|
152
|
+
updatedAt: updated?.updated_at ?? existing.updated_at,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
async deleteConversation(conversationId) {
|
|
156
|
+
const deleted = data.deleteConversation(conversationId);
|
|
157
|
+
return { deleted };
|
|
158
|
+
}
|
|
159
|
+
async listMessages(conversationId, params) {
|
|
160
|
+
const limit = Math.min(params.limit ?? 100, 500);
|
|
161
|
+
let rows;
|
|
162
|
+
if (params.before) {
|
|
163
|
+
rows = data.getMessagesBefore(conversationId, parseInt(params.before), limit);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
rows = data.getMessages(conversationId, { limit });
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
messages: rows.map(msgRowToMessage),
|
|
170
|
+
hasMore: rows.length === limit,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
exports.LocalConversationGateway = LocalConversationGateway;
|
|
175
|
+
//# sourceMappingURL=local-conversation-gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-conversation-gateway.js","sourceRoot":"","sources":["../src/local-conversation-gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAqC;AAmHrC,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAS,YAAY,CAAC,CAAuB;IAC3C,MAAM,KAAK,GAAG,CAAC,CAAC,cAAc,IAAI,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC;IACnD,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,IAAI;QACxB,WAAW,EAAE,CAAC,CAAC,YAAY,IAAI,IAAI;QACnC,SAAS,EAAE,CAAC,CAAC,UAAU,IAAI,IAAI;QAC/B,KAAK;QACL,YAAY,EAAE,CAAC,CAAC,aAAa,IAAI,CAAC;QAClC,UAAU,EAAE,CAAC,CAAC,WAAW,IAAI,CAAC;QAC9B,UAAU,EAAE,CAAC,CAAC,WAAW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|
3
3
|
/** Close the shared database connection */
|
|
4
4
|
export declare function closeDb(): void;
|
|
5
|
+
export declare function getAgentOrchestrationRoleClass(agent: Pick<AgentProfileRow, 'orchestration_role_class' | 'orchestration_role_label' | 'role_class' | 'role_label'> | null | undefined): string | null;
|
|
6
|
+
export declare function getAgentOrchestrationRoleLabel(agent: Pick<AgentProfileRow, 'orchestration_role_label' | 'orchestration_role_class' | 'role_label' | 'role_class'> | null | undefined): string | null;
|
|
5
7
|
export interface AgentProfileRow {
|
|
6
8
|
id: string;
|
|
7
9
|
provider: string;
|
|
@@ -18,6 +20,9 @@ export interface AgentProfileRow {
|
|
|
18
20
|
updated_at: string;
|
|
19
21
|
role_label: string | null;
|
|
20
22
|
role_class: string | null;
|
|
23
|
+
orchestration_role_label: string | null;
|
|
24
|
+
orchestration_role_class: string | null;
|
|
25
|
+
orchestration_include_user_prompt: number;
|
|
21
26
|
is_active: number;
|
|
22
27
|
priority: number;
|
|
23
28
|
provider_connection_id: string | null;
|
|
@@ -35,8 +40,40 @@ export interface AgentProfileRow {
|
|
|
35
40
|
codex_service_tier: string;
|
|
36
41
|
codex_sandbox_policy: string;
|
|
37
42
|
codex_approval_policy: string;
|
|
43
|
+
claude_effort_level: string;
|
|
44
|
+
claude_output_style: string;
|
|
45
|
+
claude_fast_mode: number;
|
|
46
|
+
claude_permissions_json: string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Orchestration role priority list — ordered array of role labels.
|
|
49
|
+
* Position 0 = primary capability. Lower index = higher priority.
|
|
50
|
+
* Source of truth going forward. Nullable during additive migration window;
|
|
51
|
+
* code should use `getAgentRolePriorities()` helper to read, which falls
|
|
52
|
+
* back to parsing `orchestration_role_class` when this field is empty.
|
|
53
|
+
*/
|
|
54
|
+
orchestration_roles_json: string | null;
|
|
38
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Read a bot's role priority list, dual-reading new and old columns.
|
|
58
|
+
* Used everywhere role-based dispatch or display is needed.
|
|
59
|
+
*
|
|
60
|
+
* Reads `orchestration_roles_json` first (authoritative). If empty/missing,
|
|
61
|
+
* falls back to parsing `orchestration_role_class` (comma-separated, left-
|
|
62
|
+
* to-right priority). Returns empty array if neither source has content.
|
|
63
|
+
*
|
|
64
|
+
* Normalization (per Decision 2): trim each entry, drop empties. Does NOT
|
|
65
|
+
* lower-case or canonicalize the role text — comparisons are the caller's
|
|
66
|
+
* responsibility.
|
|
67
|
+
*/
|
|
68
|
+
export declare function getAgentRolePriorities(row: Pick<AgentProfileRow, 'orchestration_roles_json' | 'orchestration_role_class'>): string[];
|
|
69
|
+
/**
|
|
70
|
+
* Compare two role strings for equality per Decision 2 matching rules:
|
|
71
|
+
* case-insensitive + whitespace-normalized. NO alias table.
|
|
72
|
+
* "QA" == "qa" == " QA " == "qa ". "QA" != "Quality Assurance".
|
|
73
|
+
*/
|
|
74
|
+
export declare function rolesMatch(a: string | null | undefined, b: string | null | undefined): boolean;
|
|
39
75
|
export declare function createAgentProfile(p: {
|
|
76
|
+
id?: string;
|
|
40
77
|
provider: string;
|
|
41
78
|
model: string;
|
|
42
79
|
name: string;
|
|
@@ -51,6 +88,9 @@ export declare function createAgentProfile(p: {
|
|
|
51
88
|
roleClass?: string;
|
|
52
89
|
isActive?: boolean;
|
|
53
90
|
priority?: number;
|
|
91
|
+
orchestrationRoleLabel?: string;
|
|
92
|
+
orchestrationRoleClass?: string;
|
|
93
|
+
orchestrationIncludeUserPrompt?: boolean;
|
|
54
94
|
providerConnectionId?: string;
|
|
55
95
|
color?: string;
|
|
56
96
|
purposeMd?: string;
|
|
@@ -65,6 +105,12 @@ export declare function createAgentProfile(p: {
|
|
|
65
105
|
codexServiceTier?: string;
|
|
66
106
|
codexSandboxPolicy?: string;
|
|
67
107
|
codexApprovalPolicy?: string;
|
|
108
|
+
claudeEffortLevel?: string;
|
|
109
|
+
claudeOutputStyle?: string;
|
|
110
|
+
claudeFastMode?: boolean;
|
|
111
|
+
claudePermissionsJson?: string | null;
|
|
112
|
+
/** Ordered role priority list. If provided, also derives orchestration_role_class as comma-separated for compat. */
|
|
113
|
+
orchestrationRolesJson?: string[] | null;
|
|
68
114
|
}): AgentProfileRow;
|
|
69
115
|
export declare function getAgentProfile(id: string): AgentProfileRow | undefined;
|
|
70
116
|
export declare function getDefaultAgentProfile(): AgentProfileRow | undefined;
|
|
@@ -80,6 +126,13 @@ export declare function getCurrentOrchestratorSelection(): {
|
|
|
80
126
|
} | {
|
|
81
127
|
type: 'none';
|
|
82
128
|
};
|
|
129
|
+
export declare function getResolvedClerkConfigInfo(): {
|
|
130
|
+
provider: string | null;
|
|
131
|
+
model: string | null;
|
|
132
|
+
hasSecret: boolean;
|
|
133
|
+
configured: boolean;
|
|
134
|
+
providerConnectionId: string | null;
|
|
135
|
+
};
|
|
83
136
|
export declare function listAgentProfiles(): AgentProfileRow[];
|
|
84
137
|
/**
|
|
85
138
|
* One-time migration helper:
|
|
@@ -104,6 +157,9 @@ export declare function updateAgentProfile(id: string, fields: Partial<{
|
|
|
104
157
|
roleClass: string;
|
|
105
158
|
isActive: boolean;
|
|
106
159
|
priority: number;
|
|
160
|
+
orchestrationRoleLabel: string;
|
|
161
|
+
orchestrationRoleClass: string;
|
|
162
|
+
orchestrationIncludeUserPrompt: boolean;
|
|
107
163
|
providerConnectionId: string;
|
|
108
164
|
color: string;
|
|
109
165
|
purposeMd: string;
|
|
@@ -119,10 +175,31 @@ export declare function updateAgentProfile(id: string, fields: Partial<{
|
|
|
119
175
|
codexServiceTier: string;
|
|
120
176
|
codexSandboxPolicy: string;
|
|
121
177
|
codexApprovalPolicy: string;
|
|
178
|
+
claudeEffortLevel: string;
|
|
179
|
+
claudeOutputStyle: string;
|
|
180
|
+
claudeFastMode: boolean;
|
|
181
|
+
claudePermissionsJson: string | null;
|
|
182
|
+
/** Ordered role priority list. Writing this also updates orchestration_role_class to a derived comma-separated string. */
|
|
183
|
+
orchestrationRolesJson: string[] | null;
|
|
122
184
|
}>): AgentProfileRow | undefined;
|
|
123
185
|
export declare function setOrchestratorBot(botId: string): AgentProfileRow | undefined;
|
|
124
186
|
export declare function setDefaultAgentProfile(botId: string): AgentProfileRow | undefined;
|
|
125
187
|
export declare function isClerkOrchestratorEnabled(): boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Phase B of orchestration-plan.txt: LLM-tool-dispatch is the only
|
|
190
|
+
* orchestration path in local_desktop mode. The feature flag introduced
|
|
191
|
+
* in Phase A has been retired — new path is always active, no user toggle.
|
|
192
|
+
* These helpers are kept for a brief deprecation window so any external
|
|
193
|
+
* callers (settings UI, HTTP endpoints) still compile while they are
|
|
194
|
+
* removed. Do not use in new code.
|
|
195
|
+
*
|
|
196
|
+
* @deprecated Phase B — tool dispatch is the only path.
|
|
197
|
+
*/
|
|
198
|
+
export declare function isOrchestrationToolDispatchEnabled(): boolean;
|
|
199
|
+
/**
|
|
200
|
+
* @deprecated Phase B — no-op. Tool dispatch is the only path.
|
|
201
|
+
*/
|
|
202
|
+
export declare function setOrchestrationToolDispatchEnabled(_enabled: boolean): void;
|
|
126
203
|
export declare function setClerkAsOrchestrator(enabled: boolean): void;
|
|
127
204
|
export interface ProviderConnectionRow {
|
|
128
205
|
id: string;
|
|
@@ -198,6 +275,9 @@ export declare function deleteAgentProfile(id: string): boolean;
|
|
|
198
275
|
export interface ConversationRow {
|
|
199
276
|
id: string;
|
|
200
277
|
agent_id: string;
|
|
278
|
+
initial_bot_id: string | null;
|
|
279
|
+
active_bot_ids_json: string | null;
|
|
280
|
+
active_bot_ids: string[];
|
|
201
281
|
title: string | null;
|
|
202
282
|
source: string;
|
|
203
283
|
imported_from: string | null;
|
|
@@ -205,6 +285,7 @@ export interface ConversationRow {
|
|
|
205
285
|
sentiment: string | null;
|
|
206
286
|
complexity: string | null;
|
|
207
287
|
message_count: number;
|
|
288
|
+
sync_revision: number;
|
|
208
289
|
processing_status: string;
|
|
209
290
|
created_at: string;
|
|
210
291
|
updated_at: string;
|
|
@@ -244,7 +325,11 @@ export interface ConversationRow {
|
|
|
244
325
|
export declare function createConversation(agentId: string, title?: string, source?: string, opts?: {
|
|
245
326
|
projectId?: string | null;
|
|
246
327
|
projectName?: string | null;
|
|
328
|
+
botIds?: string[] | null;
|
|
329
|
+
initialBotId?: string | null;
|
|
247
330
|
}): ConversationRow;
|
|
331
|
+
export declare function getConversationParticipantBotIds(conversationId: string, conversation?: ConversationRow | null): string[];
|
|
332
|
+
export declare function getConversationPrimaryBotId(conversationId: string, conversation?: ConversationRow | null): string | null;
|
|
248
333
|
export declare function getConversation(id: string): ConversationRow | undefined;
|
|
249
334
|
export declare function listConversations(opts?: {
|
|
250
335
|
limit?: number;
|
|
@@ -258,6 +343,11 @@ export interface BotConversationActivityRow extends ConversationRow {
|
|
|
258
343
|
bot_last_message_at: string | null;
|
|
259
344
|
}
|
|
260
345
|
export declare function countMessagesForBot(botId: string): number;
|
|
346
|
+
export declare function countMessagesForBotSince(botId: string, since: string): number;
|
|
347
|
+
export declare function countDecisionsForBot(botId: string): number;
|
|
348
|
+
export declare function countBotActiveDays(botId: string): number;
|
|
349
|
+
export declare function countBotConversationsUpdatedBetween(botId: string, from: string, to?: string): number;
|
|
350
|
+
export declare function sumBotTokenUsageSince(botId: string, since: string): number;
|
|
261
351
|
export declare function listBotConversationActivity(botId: string, limit?: number): BotConversationActivityRow[];
|
|
262
352
|
export declare function updateConversation(id: string, fields: Partial<{
|
|
263
353
|
title: string;
|
|
@@ -299,8 +389,15 @@ export declare function updateConversation(id: string, fields: Partial<{
|
|
|
299
389
|
forkedFromId: string;
|
|
300
390
|
createdAt: string;
|
|
301
391
|
updatedAt: string;
|
|
392
|
+
initialBotId: string;
|
|
393
|
+
activeBotIdsJson: string;
|
|
302
394
|
}>): void;
|
|
395
|
+
export declare function syncConversationParticipants(conversationId: string, botIds: Array<string | null | undefined>, opts?: {
|
|
396
|
+
replace?: boolean;
|
|
397
|
+
initialBotId?: string | null;
|
|
398
|
+
}): void;
|
|
303
399
|
export declare function touchConversationActivity(id: string, ts?: string): void;
|
|
400
|
+
export declare function bumpConversationSyncRevision(id: string, ts?: string): number;
|
|
304
401
|
export declare function deleteConversation(id: string): boolean;
|
|
305
402
|
export interface MessageRow {
|
|
306
403
|
id: string;
|
|
@@ -308,6 +405,7 @@ export interface MessageRow {
|
|
|
308
405
|
seq: number;
|
|
309
406
|
role: string;
|
|
310
407
|
content: string;
|
|
408
|
+
attachments_json: string | null;
|
|
311
409
|
model: string | null;
|
|
312
410
|
token_count: number | null;
|
|
313
411
|
tool_calls_json: string | null;
|
|
@@ -324,7 +422,7 @@ export interface ChatJobRow {
|
|
|
324
422
|
user_message_id: string;
|
|
325
423
|
assistant_message_id: string;
|
|
326
424
|
bot_id: string;
|
|
327
|
-
status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
425
|
+
status: 'pending' | 'queued' | 'running' | 'completed' | 'failed' | 'cancelled' | 'interrupted';
|
|
328
426
|
request_json: string | null;
|
|
329
427
|
error: string | null;
|
|
330
428
|
created_at: string;
|
|
@@ -336,9 +434,11 @@ export interface ChatJobRow {
|
|
|
336
434
|
export interface CliSessionEpochRow {
|
|
337
435
|
id: string;
|
|
338
436
|
conversation_id: string;
|
|
437
|
+
session_scope_key: string;
|
|
339
438
|
bot_id: string;
|
|
340
439
|
provider: string;
|
|
341
440
|
session_id: string;
|
|
441
|
+
topic_id: string | null;
|
|
342
442
|
epoch_turn_count: number;
|
|
343
443
|
last_input_tokens: number | null;
|
|
344
444
|
last_output_tokens: number | null;
|
|
@@ -348,6 +448,24 @@ export interface CliSessionEpochRow {
|
|
|
348
448
|
created_at: string;
|
|
349
449
|
updated_at: string;
|
|
350
450
|
}
|
|
451
|
+
export interface WarmSessionBindingKey {
|
|
452
|
+
conversationId: string;
|
|
453
|
+
botId: string;
|
|
454
|
+
}
|
|
455
|
+
export interface WarmCliSessionInfo {
|
|
456
|
+
conversationId: string;
|
|
457
|
+
sessionScopeKey: string;
|
|
458
|
+
botId: string;
|
|
459
|
+
provider: string;
|
|
460
|
+
sessionId: string;
|
|
461
|
+
topicId: string | null;
|
|
462
|
+
epochTurnCount: number;
|
|
463
|
+
lastUsedAt: string;
|
|
464
|
+
resetReason: string | null;
|
|
465
|
+
}
|
|
466
|
+
export declare function toWarmSessionBindingKey(conversationId: string, botId: string): string;
|
|
467
|
+
export declare function parseWarmSessionBindingKey(key: string): WarmSessionBindingKey | null;
|
|
468
|
+
export declare function epochRowToWarmInfo(row: CliSessionEpochRow): WarmCliSessionInfo;
|
|
351
469
|
export interface MessageActivityRow {
|
|
352
470
|
id: string;
|
|
353
471
|
conversation_id: string;
|
|
@@ -361,9 +479,10 @@ export interface MessageActivityRow {
|
|
|
361
479
|
created_at: string;
|
|
362
480
|
expires_at: string | null;
|
|
363
481
|
}
|
|
364
|
-
export declare function addMessage(conversationId: string, role: string, content: string, model?: string, toolCallsJson?: string, botId?: string, agentName?: string, createdAt?: string): MessageRow;
|
|
482
|
+
export declare function addMessage(conversationId: string, role: string, content: string, model?: string, toolCallsJson?: string, botId?: string, agentName?: string, createdAt?: string, attachmentsJson?: string | null): MessageRow;
|
|
365
483
|
export declare function updateMessage(id: string, fields: Partial<{
|
|
366
484
|
content: string;
|
|
485
|
+
attachmentsJson: string | null;
|
|
367
486
|
model: string | null;
|
|
368
487
|
toolCallsJson: string | null;
|
|
369
488
|
botId: string | null;
|
|
@@ -380,12 +499,14 @@ export declare function createChatJob(input: {
|
|
|
380
499
|
requestJson?: string | null;
|
|
381
500
|
status?: ChatJobRow['status'];
|
|
382
501
|
}): ChatJobRow;
|
|
383
|
-
export declare function getCliSessionEpoch(conversationId: string, botId: string): CliSessionEpochRow | undefined;
|
|
502
|
+
export declare function getCliSessionEpoch(conversationId: string, botId: string, sessionScopeKey?: string | null): CliSessionEpochRow | undefined;
|
|
384
503
|
export declare function upsertCliSessionEpoch(input: {
|
|
385
504
|
conversationId: string;
|
|
505
|
+
sessionScopeKey?: string | null;
|
|
386
506
|
botId: string;
|
|
387
507
|
provider: string;
|
|
388
508
|
sessionId: string;
|
|
509
|
+
topicId?: string | null;
|
|
389
510
|
epochTurnCount: number;
|
|
390
511
|
lastInputTokens?: number | null;
|
|
391
512
|
lastOutputTokens?: number | null;
|
|
@@ -393,7 +514,10 @@ export declare function upsertCliSessionEpoch(input: {
|
|
|
393
514
|
epochStartedAt?: string;
|
|
394
515
|
lastUsedAt?: string;
|
|
395
516
|
}): CliSessionEpochRow;
|
|
396
|
-
export declare function deleteCliSessionEpoch(conversationId: string, botId: string): boolean;
|
|
517
|
+
export declare function deleteCliSessionEpoch(conversationId: string, botId: string, sessionScopeKey?: string | null): boolean;
|
|
518
|
+
export declare function clearCliSessionEpochIfMatches(conversationId: string, botId: string, sessionId: string | null | undefined, sessionScopeKey?: string | null): boolean;
|
|
519
|
+
export declare function cleanupPoisonedClaudePrewarmSessionRows(): number;
|
|
520
|
+
export declare function getCliSessionEpochsByConversation(conversationId: string): CliSessionEpochRow[];
|
|
397
521
|
/**
|
|
398
522
|
* Generate the next sequential Funolio session ID.
|
|
399
523
|
* Format: fff00000-0000-4000-8000-NNNNNNNNNNNN
|
|
@@ -416,6 +540,29 @@ export declare function updateChatJob(id: string, fields: Partial<{
|
|
|
416
540
|
cancelledAt: string | null;
|
|
417
541
|
}>): ChatJobRow | undefined;
|
|
418
542
|
export declare function markRunningChatJobsInterrupted(reason?: string): number;
|
|
543
|
+
export interface CrashRecoveryResult {
|
|
544
|
+
recoveredJobs: Array<{
|
|
545
|
+
jobId: string;
|
|
546
|
+
previousStatus: string;
|
|
547
|
+
}>;
|
|
548
|
+
totalRecovered: number;
|
|
549
|
+
}
|
|
550
|
+
export interface WorkflowCrashRecoveryResult {
|
|
551
|
+
recoveredWorkflowExecutions: Array<{
|
|
552
|
+
workflowId: string;
|
|
553
|
+
conversationId: string | null;
|
|
554
|
+
previousStatus: string;
|
|
555
|
+
}>;
|
|
556
|
+
recoveredImportedPlanRuns: Array<{
|
|
557
|
+
runId: string;
|
|
558
|
+
conversationId: string;
|
|
559
|
+
previousStatus: string;
|
|
560
|
+
remainingTaskCount: number;
|
|
561
|
+
}>;
|
|
562
|
+
totalRecovered: number;
|
|
563
|
+
}
|
|
564
|
+
export declare function recoverInterruptedChatJobs(): CrashRecoveryResult;
|
|
565
|
+
export declare function recoverInterruptedWorkflowRuns(reason?: string): WorkflowCrashRecoveryResult;
|
|
419
566
|
export declare function createMessageActivity(activity: {
|
|
420
567
|
conversationId: string;
|
|
421
568
|
messageId?: string | null;
|
|
@@ -648,6 +795,68 @@ export declare function updateImportJobItem(id: string, fields: Partial<{
|
|
|
648
795
|
attemptCount: number;
|
|
649
796
|
nextAttemptAt: string;
|
|
650
797
|
}>): void;
|
|
798
|
+
type ImportedPlanStageRecord = {
|
|
799
|
+
role: string;
|
|
800
|
+
botId: string;
|
|
801
|
+
};
|
|
802
|
+
type ImportedPlanOptionsRecord = {
|
|
803
|
+
plannerInstructions?: string | null;
|
|
804
|
+
executionOrder?: 'per_item_pipeline' | 'batch_by_stage' | null;
|
|
805
|
+
};
|
|
806
|
+
export interface ImportedPlanRunRow {
|
|
807
|
+
id: string;
|
|
808
|
+
conversation_id: string;
|
|
809
|
+
project_id: string | null;
|
|
810
|
+
source_file_path: string;
|
|
811
|
+
source_file_name: string;
|
|
812
|
+
planner_bot_id: string | null;
|
|
813
|
+
planner_agent_name: string | null;
|
|
814
|
+
planner_provider: string | null;
|
|
815
|
+
planner_model: string | null;
|
|
816
|
+
requested_stages: ImportedPlanStageRecord[];
|
|
817
|
+
requested_options: ImportedPlanOptionsRecord;
|
|
818
|
+
task_ids: number[];
|
|
819
|
+
status: 'paused' | 'running' | 'completed' | 'discarded';
|
|
820
|
+
created_at: string;
|
|
821
|
+
updated_at: string;
|
|
822
|
+
started_at: string | null;
|
|
823
|
+
completed_at: string | null;
|
|
824
|
+
discarded_at: string | null;
|
|
825
|
+
last_error: string | null;
|
|
826
|
+
}
|
|
827
|
+
export declare function createImportedPlanRun(params: {
|
|
828
|
+
conversationId: string;
|
|
829
|
+
projectId?: string | null;
|
|
830
|
+
sourceFilePath: string;
|
|
831
|
+
sourceFileName: string;
|
|
832
|
+
plannerBotId?: string | null;
|
|
833
|
+
plannerAgentName?: string | null;
|
|
834
|
+
plannerProvider?: string | null;
|
|
835
|
+
plannerModel?: string | null;
|
|
836
|
+
requestedStages: ImportedPlanStageRecord[];
|
|
837
|
+
requestedOptions: ImportedPlanOptionsRecord;
|
|
838
|
+
taskIds: number[];
|
|
839
|
+
status?: ImportedPlanRunRow['status'];
|
|
840
|
+
}): ImportedPlanRunRow;
|
|
841
|
+
export declare function getImportedPlanRun(id: string): ImportedPlanRunRow | undefined;
|
|
842
|
+
export declare function listImportedPlanRunsForConversation(conversationId: string): ImportedPlanRunRow[];
|
|
843
|
+
export declare function getLatestImportedPlanRunForConversation(conversationId: string, opts?: {
|
|
844
|
+
includeDiscarded?: boolean;
|
|
845
|
+
includeCompleted?: boolean;
|
|
846
|
+
}): ImportedPlanRunRow | undefined;
|
|
847
|
+
export declare function updateImportedPlanRun(id: string, fields: Partial<{
|
|
848
|
+
taskIds: number[];
|
|
849
|
+
status: ImportedPlanRunRow['status'];
|
|
850
|
+
startedAt: string | null;
|
|
851
|
+
completedAt: string | null;
|
|
852
|
+
discardedAt: string | null;
|
|
853
|
+
lastError: string | null;
|
|
854
|
+
}>): ImportedPlanRunRow | undefined;
|
|
855
|
+
export declare function touchImportedPlanRun(id: string): ImportedPlanRunRow | undefined;
|
|
856
|
+
export declare function getImportedPlanRunTasks(id: string): TodoTaskRow[];
|
|
857
|
+
export declare function getImportedPlanRunRemainingTaskIds(id: string): number[];
|
|
858
|
+
export declare function getImportedPlanRunCurrentTask(id: string): TodoTaskRow | undefined;
|
|
859
|
+
export declare function deleteImportedPlanRunSelectedTasks(id: string, selectedTaskIds: number[], actor: TodoActor): ImportedPlanRunRow | undefined;
|
|
651
860
|
export interface OutboxEventRow {
|
|
652
861
|
id: string;
|
|
653
862
|
event_type: string;
|
|
@@ -833,6 +1042,7 @@ export interface TodoActor {
|
|
|
833
1042
|
export interface TodoTaskRow {
|
|
834
1043
|
id: number;
|
|
835
1044
|
project_id: string | null;
|
|
1045
|
+
topic_id: string | null;
|
|
836
1046
|
conversation_id: string | null;
|
|
837
1047
|
origin: string | null;
|
|
838
1048
|
created_by_bot_id: string | null;
|
|
@@ -988,12 +1198,25 @@ export declare function completeTodoTaskByWorker(taskId: number, params: {
|
|
|
988
1198
|
outputSummary?: string;
|
|
989
1199
|
artifactRefs?: Array<string | TodoArtifactRefInput>;
|
|
990
1200
|
handoffPrompt?: string;
|
|
1201
|
+
/** Structured QA pass/fail signal. "pass" or "not_applicable" never auto-create fix tasks. "fail" auto-creates a fix task for the previous worker unless `requiresFixTask === false`. */
|
|
1202
|
+
qaResult?: 'pass' | 'fail' | 'not_applicable';
|
|
1203
|
+
/** Required when qaResult === 'fail'. Used as the auto-created fix task's taskPrompt. */
|
|
1204
|
+
findings?: string[];
|
|
1205
|
+
/** Defaults to true when qaResult === 'fail'. Set false to signal a failure without creating a fix task. */
|
|
1206
|
+
requiresFixTask?: boolean;
|
|
991
1207
|
insertTask?: TodoWorkerInsertionInput;
|
|
992
1208
|
expectedVersion?: number;
|
|
993
1209
|
expectedLastUpdated?: string;
|
|
994
1210
|
actor: TodoActor;
|
|
995
1211
|
}): TodoWorkerCompletionResult;
|
|
996
1212
|
export declare function blockTodoTaskByWorker(taskId: number, params: TodoWorkerBlockedInput): TodoWorkerBlockedResult;
|
|
1213
|
+
export declare function markTodoTaskRuntimeBlocked(taskId: number, params: {
|
|
1214
|
+
actor: TodoActor;
|
|
1215
|
+
blockerSummary: string;
|
|
1216
|
+
checkedContext?: string;
|
|
1217
|
+
userQuestion?: string;
|
|
1218
|
+
reasonCode?: string;
|
|
1219
|
+
}): TodoTaskRow;
|
|
997
1220
|
export declare function deleteTodoTask(taskId: number, params: {
|
|
998
1221
|
actor: TodoActor;
|
|
999
1222
|
state?: 'active' | 'completed';
|
|
@@ -1013,6 +1236,12 @@ export declare function moveNullTodoTasksToUnassigned(): {
|
|
|
1013
1236
|
export declare function getLatestActiveTodoForConversation(conversationId: string): TodoTaskRow | undefined;
|
|
1014
1237
|
export declare function getNextActiveTodoForConversation(conversationId: string): TodoTaskRow | undefined;
|
|
1015
1238
|
export declare function listCompletedTodoTasksForConversation(conversationId: string): TodoTaskRow[];
|
|
1239
|
+
/**
|
|
1240
|
+
* List all active (non-completed) TODOs for a conversation in creation order.
|
|
1241
|
+
* Used by the orchestration dispatch-runner to feed `existing_todos` into
|
|
1242
|
+
* the orchestrator hint so the LLM can see what's already queued.
|
|
1243
|
+
*/
|
|
1244
|
+
export declare function listActiveTodoTasksForConversation(conversationId: string): TodoTaskRow[];
|
|
1016
1245
|
export interface ProjectRow {
|
|
1017
1246
|
id: string;
|
|
1018
1247
|
name: string;
|
|
@@ -1114,7 +1343,7 @@ export interface TopicRow {
|
|
|
1114
1343
|
export interface ConversationWithPreview extends ConversationRow {
|
|
1115
1344
|
summary_text: string | null;
|
|
1116
1345
|
first_user_message: string | null;
|
|
1117
|
-
job_status: 'working' | 'queued' | 'done' | 'failed' | 'cancelled' | null;
|
|
1346
|
+
job_status: 'pending' | 'working' | 'queued' | 'done' | 'failed' | 'cancelled' | 'interrupted' | null;
|
|
1118
1347
|
}
|
|
1119
1348
|
export interface TopicSegmentRow {
|
|
1120
1349
|
id: string;
|
|
@@ -1444,4 +1673,5 @@ export declare function getDbStats(): DbStats;
|
|
|
1444
1673
|
* Keeps agent_profile, bot config, settings, and optionally projects.
|
|
1445
1674
|
*/
|
|
1446
1675
|
export declare function resetDerivedData(keepProjects: boolean): Record<string, number>;
|
|
1676
|
+
export {};
|
|
1447
1677
|
//# sourceMappingURL=local-data.d.ts.map
|