@volter/supercode-orchestrator 0.4.138 → 0.4.139
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/board/dispatch.mjs +5 -4
- package/package.json +1 -1
package/board/dispatch.mjs
CHANGED
|
@@ -1307,9 +1307,9 @@ function deliverNow(board, to, body, key) {
|
|
|
1307
1307
|
if (!answer.receipt?.delivered) throw new Error(answer.receipt?.reason ?? 'native delivery confirmation pending');
|
|
1308
1308
|
}
|
|
1309
1309
|
|
|
1310
|
-
async function send(from, label, to, body, key, { queue = false, ask = false } = {}) {
|
|
1310
|
+
async function send(from, label, to, body, key, { queue = false, ask = false, subject } = {}) {
|
|
1311
1311
|
const request = {
|
|
1312
|
-
op: 'send', from, from_name: `${label} board`, to, queue, id: key, subject: String(body).split('\n')[0].slice(0, 160),
|
|
1312
|
+
op: 'send', from, from_name: `${label} board`, to, queue, id: key, subject: String(subject ?? String(body).split('\n')[0]).slice(0, 160),
|
|
1313
1313
|
// a question the board waits on is answered by a reply; a notice is not
|
|
1314
1314
|
body: ask ? `[A question from the ${label} board] ${body}` : `[Board notice from the ${label} board] ${body}\n\n(An automated notice from the board's dispatcher; replies to this address go nowhere.)`,
|
|
1315
1315
|
};
|
|
@@ -1333,7 +1333,8 @@ export async function sendBoardMessages(board, report, taskId = null) {
|
|
|
1333
1333
|
if (taskId && row.task_id !== taskId) continue;
|
|
1334
1334
|
const m = json(row.payload, {}) ?? {};
|
|
1335
1335
|
try {
|
|
1336
|
-
const
|
|
1336
|
+
const task = view(board, db => getTask(db, row.task_id));
|
|
1337
|
+
const receipt = await send(boardAddress(board.label), board.label, m.to, m.text, m.message_id ?? `board-message-${row.id}`, { ask: Boolean(m.message_id), subject: `${task?.title || row.task_id} · ${m.message_id ? 'Question' : 'Update'}` });
|
|
1337
1338
|
if (!receipt.delivered) throw new Error(receipt.reason ?? 'queued; native transcript confirmation pending');
|
|
1338
1339
|
tx(board, (db) => event(db, row.task_id, 'board_message_sent', { event: row.id, to: m.to, receipt, ...(m.message_id ? { message_id: m.message_id } : {}) }));
|
|
1339
1340
|
} catch (error) {
|
|
@@ -1420,7 +1421,7 @@ async function notify(board, fleet, report, entry) {
|
|
|
1420
1421
|
text = c ? noticeOf(entry, role, ev.kind, task, p, c) : null;
|
|
1421
1422
|
} else text = noticeOf(entry, role, ev.kind, task, p);
|
|
1422
1423
|
if (text) {
|
|
1423
|
-
const receipt = await send(from, board.label, sub.chat_id, text, `board-${sub.task_id}-${ev.id}-${sub.chat_id.slice(-12)}`, { queue: !entry.workflow.run && sub.delivery_mode === 'notify' });
|
|
1424
|
+
const receipt = await send(from, board.label, sub.chat_id, text, `board-${sub.task_id}-${ev.id}-${sub.chat_id.slice(-12)}`, { queue: !entry.workflow.run && sub.delivery_mode === 'notify', subject: `${task?.title || sub.task_id} · ${ev.kind.replaceAll('_', ' ')}` });
|
|
1424
1425
|
if (!receipt.delivered) { pending = Boolean(receipt.queued); throw new Error(receipt.reason ?? 'native delivery confirmation pending'); }
|
|
1425
1426
|
tx(board, (db) => event(db, sub.task_id, 'notice_delivered', { source_event: ev.id, kind: ev.kind, address: sub.chat_id, receipt }));
|
|
1426
1427
|
report.notified.push([sub.task_id, ev.kind, sub.chat_id]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-orchestrator",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.139",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The orchestrator runtime over the Volter Harness ontology: one typed operational model whose folder is its serialization, read and written through the harness orchestration doors (docs/ORCHESTRATOR-IR.md)",
|
|
6
6
|
"exports": {
|