agent-nuvira 3.1.0 → 3.1.3
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/agents/context-gatherer.d.ts +5 -3
- package/dist/agents/agents/context-gatherer.d.ts.map +1 -1
- package/dist/agents/agents/context-gatherer.js +10 -9
- package/dist/agents/agents/context-gatherer.js.map +1 -1
- package/dist/agents/agents/reasoner.d.ts +2 -1
- package/dist/agents/agents/reasoner.d.ts.map +1 -1
- package/dist/agents/agents/reasoner.js +2 -1
- package/dist/agents/agents/reasoner.js.map +1 -1
- package/dist/agents/agents/reviewer-tool-calling.d.ts +3 -3
- package/dist/agents/agents/reviewer-tool-calling.js +3 -3
- package/dist/agents/agents/writer-tool-calling.d.ts +3 -3
- package/dist/agents/agents/writer-tool-calling.js +3 -3
- package/dist/agents/agents/writer.js +5 -5
- package/dist/agents/agents/writer.js.map +1 -1
- package/dist/agents/answer-quality-gate.d.ts +64 -0
- package/dist/agents/answer-quality-gate.d.ts.map +1 -0
- package/dist/agents/answer-quality-gate.js +94 -0
- package/dist/agents/answer-quality-gate.js.map +1 -0
- package/dist/agents/orchestrator.d.ts +6 -6
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/agents/orchestrator.js +48 -24
- package/dist/agents/orchestrator.js.map +1 -1
- package/dist/agents/prompt-assembly.d.ts +3 -3
- package/dist/agents/prompt-assembly.js +3 -3
- package/dist/agents/tool-calling-agent.d.ts +3 -3
- package/dist/agents/tool-calling-agent.js +3 -3
- package/dist/cli/chat.d.ts +20 -9
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +167 -37
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/config.d.ts +16 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +73 -1
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/execute.d.ts.map +1 -1
- package/dist/cli/execute.js +59 -9
- package/dist/cli/execute.js.map +1 -1
- package/dist/cli/gateway.d.ts +7 -0
- package/dist/cli/gateway.d.ts.map +1 -1
- package/dist/cli/gateway.js +45 -0
- package/dist/cli/gateway.js.map +1 -1
- package/dist/cli/loop-executor.d.ts.map +1 -1
- package/dist/cli/loop-executor.js +87 -27
- package/dist/cli/loop-executor.js.map +1 -1
- package/dist/cli/models.d.ts.map +1 -1
- package/dist/cli/models.js +63 -0
- package/dist/cli/models.js.map +1 -1
- package/dist/cli/nlu.d.ts +8 -0
- package/dist/cli/nlu.d.ts.map +1 -1
- package/dist/cli/nlu.js +57 -0
- package/dist/cli/nlu.js.map +1 -1
- package/dist/config/manager.d.ts.map +1 -1
- package/dist/config/manager.js +17 -3
- package/dist/config/manager.js.map +1 -1
- package/dist/config/types.d.ts +23 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/gateway/adapters.d.ts +24 -0
- package/dist/gateway/adapters.d.ts.map +1 -1
- package/dist/gateway/adapters.js +19 -0
- package/dist/gateway/adapters.js.map +1 -1
- package/dist/gateway/delivery.d.ts +7 -1
- package/dist/gateway/delivery.d.ts.map +1 -1
- package/dist/gateway/delivery.js +7 -1
- package/dist/gateway/delivery.js.map +1 -1
- package/dist/gateway/gateway-log.d.ts +74 -0
- package/dist/gateway/gateway-log.d.ts.map +1 -0
- package/dist/gateway/gateway-log.js +167 -0
- package/dist/gateway/gateway-log.js.map +1 -0
- package/dist/gateway/inbox.d.ts +8 -1
- package/dist/gateway/inbox.d.ts.map +1 -1
- package/dist/gateway/inbox.js.map +1 -1
- package/dist/gateway/registry.d.ts +212 -1
- package/dist/gateway/registry.d.ts.map +1 -1
- package/dist/gateway/registry.js +913 -46
- package/dist/gateway/registry.js.map +1 -1
- package/dist/gateway/whatsapp/baileys-bridge.d.ts +98 -1
- package/dist/gateway/whatsapp/baileys-bridge.d.ts.map +1 -1
- package/dist/gateway/whatsapp/baileys-bridge.js +264 -63
- package/dist/gateway/whatsapp/baileys-bridge.js.map +1 -1
- package/dist/gateway/whatsapp/bridge.d.ts +32 -0
- package/dist/gateway/whatsapp/bridge.d.ts.map +1 -1
- package/dist/gateway/whatsapp/bridge.js.map +1 -1
- package/dist/inference/tool-call-utils.d.ts +146 -0
- package/dist/inference/tool-call-utils.d.ts.map +1 -1
- package/dist/inference/tool-call-utils.js +450 -3
- package/dist/inference/tool-call-utils.js.map +1 -1
- package/dist/learning/auto-router.d.ts +65 -1
- package/dist/learning/auto-router.d.ts.map +1 -1
- package/dist/learning/auto-router.js +156 -1
- package/dist/learning/auto-router.js.map +1 -1
- package/dist/learning/deferred-task.d.ts +159 -0
- package/dist/learning/deferred-task.d.ts.map +1 -0
- package/dist/learning/deferred-task.js +451 -0
- package/dist/learning/deferred-task.js.map +1 -0
- package/dist/learning/hub-skill-catalog.d.ts.map +1 -1
- package/dist/learning/hub-skill-catalog.js +10 -3
- package/dist/learning/hub-skill-catalog.js.map +1 -1
- package/dist/learning/model-first-router.d.ts.map +1 -1
- package/dist/learning/model-first-router.js +8 -0
- package/dist/learning/model-first-router.js.map +1 -1
- package/dist/learning/model-registry.d.ts +30 -0
- package/dist/learning/model-registry.d.ts.map +1 -1
- package/dist/learning/model-registry.js +61 -0
- package/dist/learning/model-registry.js.map +1 -1
- package/dist/learning/reasoning-trace.d.ts +8 -0
- package/dist/learning/reasoning-trace.d.ts.map +1 -1
- package/dist/learning/reasoning-trace.js +1 -0
- package/dist/learning/reasoning-trace.js.map +1 -1
- package/dist/learning/resilient-call.d.ts +116 -0
- package/dist/learning/resilient-call.d.ts.map +1 -1
- package/dist/learning/resilient-call.js +435 -15
- package/dist/learning/resilient-call.js.map +1 -1
- package/dist/nlu/conversation-gate.d.ts +22 -0
- package/dist/nlu/conversation-gate.d.ts.map +1 -1
- package/dist/nlu/conversation-gate.js +52 -8
- package/dist/nlu/conversation-gate.js.map +1 -1
- package/dist/nlu/intent-confirm.d.ts +82 -0
- package/dist/nlu/intent-confirm.d.ts.map +1 -0
- package/dist/nlu/intent-confirm.js +146 -0
- package/dist/nlu/intent-confirm.js.map +1 -0
- package/dist/nlu/intent.d.ts +35 -0
- package/dist/nlu/intent.d.ts.map +1 -1
- package/dist/nlu/intent.js +192 -3
- package/dist/nlu/intent.js.map +1 -1
- package/dist/nlu/learnings.d.ts +101 -0
- package/dist/nlu/learnings.d.ts.map +1 -0
- package/dist/nlu/learnings.js +283 -0
- package/dist/nlu/learnings.js.map +1 -0
- package/dist/nlu/schema.d.ts +2 -2
- package/dist/tools/ask-user.d.ts.map +1 -1
- package/dist/tools/ask-user.js +19 -3
- package/dist/tools/ask-user.js.map +1 -1
- package/dist/tools/coding-tools.d.ts.map +1 -1
- package/dist/tools/coding-tools.js +5 -0
- package/dist/tools/coding-tools.js.map +1 -1
- package/dist/tools/gateway-send.d.ts.map +1 -1
- package/dist/tools/gateway-send.js +14 -4
- package/dist/tools/gateway-send.js.map +1 -1
- package/dist/tools/loop-project-context.d.ts +3 -3
- package/dist/tools/loop-project-context.js +3 -3
- package/dist/tools/loop-skill-hint.d.ts +44 -7
- package/dist/tools/loop-skill-hint.d.ts.map +1 -1
- package/dist/tools/loop-skill-hint.js +117 -26
- package/dist/tools/loop-skill-hint.js.map +1 -1
- package/dist/tools/registry.d.ts +14 -0
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/tool-loop.d.ts +55 -2
- package/dist/tools/tool-loop.d.ts.map +1 -1
- package/dist/tools/tool-loop.js +161 -7
- package/dist/tools/tool-loop.js.map +1 -1
- package/dist/tools/toolsets.js +2 -2
- package/dist/tools/toolsets.js.map +1 -1
- package/dist/tools/unified-diff.d.ts +2 -2
- package/dist/tools/unified-diff.js +2 -2
- package/dist/web-dashboard/chat-console.d.ts +41 -0
- package/dist/web-dashboard/chat-console.d.ts.map +1 -1
- package/dist/web-dashboard/chat-console.js +133 -24
- package/dist/web-dashboard/chat-console.js.map +1 -1
- package/dist/web-dashboard/chat-retry.d.ts +143 -0
- package/dist/web-dashboard/chat-retry.d.ts.map +1 -0
- package/dist/web-dashboard/chat-retry.js +219 -0
- package/dist/web-dashboard/chat-retry.js.map +1 -0
- package/dist/web-dashboard/server.d.ts +21 -2
- package/dist/web-dashboard/server.d.ts.map +1 -1
- package/dist/web-dashboard/server.js +138 -2
- package/dist/web-dashboard/server.js.map +1 -1
- package/dist/web-dashboard/src/types.d.ts +6 -3
- package/dist/web-dashboard/src/types.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/web-dashboard/public/assets/{index-Pzkg6L8v.js → index-Co7Hk2FT.js} +60 -60
- package/src/web-dashboard/public/assets/index-Co7Hk2FT.js.map +1 -0
- package/src/web-dashboard/public/index.html +1 -1
- package/dist/app.js +0 -26
- package/dist/auth-api.d.ts +0 -2
- package/dist/auth-api.d.ts.map +0 -1
- package/dist/auth-api.js +0 -61
- package/dist/auth-api.js.map +0 -1
- package/dist/auth.test.d.ts +0 -1
- package/dist/auth.test.d.ts.map +0 -1
- package/dist/auth.test.js +0 -3
- package/dist/auth.test.js.map +0 -1
- package/dist/config/auth.js +0 -18
- package/dist/config/jwt.js +0 -24
- package/dist/config/keys.js +0 -14
- package/dist/file.d.ts +0 -1
- package/dist/file.d.ts.map +0 -1
- package/dist/file.js +0 -2
- package/dist/file.js.map +0 -1
- package/dist/middleware/auth.js +0 -30
- package/dist/passport.js +0 -34
- package/dist/routes/auth.d.ts +0 -3
- package/dist/routes/auth.d.ts.map +0 -1
- package/dist/routes/auth.js +0 -47
- package/dist/routes/auth.js.map +0 -1
- package/dist/routes/user.js +0 -31
- package/dist/server.js +0 -17
- package/dist/web-dashboard/src/App.js +0 -85
- package/dist/web-dashboard/src/admin-auth.test.js +0 -186
- package/dist/web-dashboard/src/ansi.js +0 -23
- package/dist/web-dashboard/src/ansi.test.js +0 -31
- package/dist/web-dashboard/src/api-admin-auth.test.js +0 -172
- package/dist/web-dashboard/src/api-admin.test.js +0 -65
- package/dist/web-dashboard/src/api-hub.test.js +0 -117
- package/dist/web-dashboard/src/api.js +0 -1421
- package/dist/web-dashboard/src/api.test.js +0 -51
- package/dist/web-dashboard/src/artifacts.js +0 -128
- package/dist/web-dashboard/src/artifacts.test.js +0 -139
- package/dist/web-dashboard/src/components/AdminPanel.js +0 -567
- package/dist/web-dashboard/src/components/AdminPanel.test.js +0 -288
- package/dist/web-dashboard/src/components/AgentHub.js +0 -1580
- package/dist/web-dashboard/src/components/AgentHub.test.js +0 -343
- package/dist/web-dashboard/src/components/BedrockOnboarding.js +0 -320
- package/dist/web-dashboard/src/components/BenchmarkCharts.js +0 -228
- package/dist/web-dashboard/src/components/ChatPage.js +0 -1586
- package/dist/web-dashboard/src/components/ChatPage.test.js +0 -899
- package/dist/web-dashboard/src/components/ContactsPage.js +0 -141
- package/dist/web-dashboard/src/components/CostDashboard.js +0 -105
- package/dist/web-dashboard/src/components/DAGView.js +0 -477
- package/dist/web-dashboard/src/components/DAGView.test.js +0 -147
- package/dist/web-dashboard/src/components/EnvVarEditor.js +0 -138
- package/dist/web-dashboard/src/components/EvalsPage.js +0 -73
- package/dist/web-dashboard/src/components/EvalsPage.test.js +0 -120
- package/dist/web-dashboard/src/components/ExecutionHistory.js +0 -201
- package/dist/web-dashboard/src/components/GatewayPage.js +0 -40
- package/dist/web-dashboard/src/components/GatewayPage.test.js +0 -74
- package/dist/web-dashboard/src/components/HealthPanel.js +0 -68
- package/dist/web-dashboard/src/components/HistoryBrowser.js +0 -34
- package/dist/web-dashboard/src/components/Layout.js +0 -50
- package/dist/web-dashboard/src/components/Markdown.js +0 -152
- package/dist/web-dashboard/src/components/Markdown.test.js +0 -126
- package/dist/web-dashboard/src/components/MarkdownZeroDep.js +0 -237
- package/dist/web-dashboard/src/components/MemoryPanel.js +0 -81
- package/dist/web-dashboard/src/components/ModelTimeline.js +0 -298
- package/dist/web-dashboard/src/components/ModelsPanel.js +0 -1484
- package/dist/web-dashboard/src/components/ModelsPanel.test.js +0 -460
- package/dist/web-dashboard/src/components/Overview.js +0 -123
- package/dist/web-dashboard/src/components/PhaseTimeline.js +0 -359
- package/dist/web-dashboard/src/components/PhaseTimeline.test.js +0 -234
- package/dist/web-dashboard/src/components/PlatformConfigSection.js +0 -384
- package/dist/web-dashboard/src/components/PlatformConfigSection.test.js +0 -106
- package/dist/web-dashboard/src/components/PlatformsPage.js +0 -250
- package/dist/web-dashboard/src/components/QuotaPanel.js +0 -159
- package/dist/web-dashboard/src/components/QuotaPanel.test.js +0 -85
- package/dist/web-dashboard/src/components/RequestsPanel.js +0 -229
- package/dist/web-dashboard/src/components/RequestsPanel.test.js +0 -103
- package/dist/web-dashboard/src/components/RoutingInsightsPanel.js +0 -938
- package/dist/web-dashboard/src/components/RoutingInsightsPanel.test.js +0 -339
- package/dist/web-dashboard/src/components/RoutingWalkthrough.js +0 -408
- package/dist/web-dashboard/src/components/RoutingWalkthrough.test.js +0 -209
- package/dist/web-dashboard/src/components/TaskConsole.js +0 -119
- package/dist/web-dashboard/src/components/TaskConsole.test.js +0 -123
- package/dist/web-dashboard/src/components/TasksPage.js +0 -256
- package/dist/web-dashboard/src/components/TasksPage.test.js +0 -103
- package/dist/web-dashboard/src/components/TracePanel.js +0 -306
- package/dist/web-dashboard/src/components/WhatsAppPanel.js +0 -195
- package/dist/web-dashboard/src/components/WhatsAppPanel.test.js +0 -122
- package/dist/web-dashboard/src/jsonOrNull.js +0 -37
- package/dist/web-dashboard/src/main.js +0 -15
- package/dist/web-dashboard/src/mask.js +0 -11
- package/dist/web-dashboard/vite.config.js +0 -23
- package/dist/web-dashboard/vitest.config.js +0 -15
- package/src/web-dashboard/public/assets/index-Pzkg6L8v.js.map +0 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured gateway log (`src/gateway/gateway-log.ts`).
|
|
3
|
+
*
|
|
4
|
+
* The gateway had NO durable record of what it did: a send that failed printed
|
|
5
|
+
* one `logger.warn` line to a terminal nobody was watching, so a message that
|
|
6
|
+
* never arrived could not be diagnosed after the fact. Live incident
|
|
7
|
+
* (2026-09-21): a WhatsApp send was answered "I have sent…", the recipient
|
|
8
|
+
* received nothing, and there was no artifact to explain why — the delivery
|
|
9
|
+
* ledger is pruned, and the console output was gone.
|
|
10
|
+
*
|
|
11
|
+
* This is a deliberately small, append-only JSONL log for the events that
|
|
12
|
+
* matter when delivery goes wrong:
|
|
13
|
+
*
|
|
14
|
+
* {"at":"2026-09-21T05:09:42.366Z","level":"warn","event":"send.failed",
|
|
15
|
+
* "platform":"whatsapp","channelId":"+918800663237","target":"whatsapp:+918800663237",
|
|
16
|
+
* "reason":"918800663237@s.whatsapp.net is not a WhatsApp account — the message was NOT sent.",
|
|
17
|
+
* "textChars":1660,"textPreview":"…"}
|
|
18
|
+
*
|
|
19
|
+
* Design rules (same as every other persisted store here):
|
|
20
|
+
* - Best-effort — a log write must NEVER break a send or a conversation.
|
|
21
|
+
* - Bounded — one rotation generation (`logs.1.jsonl`), so the directory cannot
|
|
22
|
+
* grow without limit.
|
|
23
|
+
* - Local only, `NUVIRA_CONFIG_DIR` aware (hermetic tests), sibling of
|
|
24
|
+
* `aliases.json` / `inbox.json` / `delivery.json`.
|
|
25
|
+
* - Never logs secrets: message BODIES are truncated to a short preview (the
|
|
26
|
+
* delivery ledger already stores the full text), and any value that looks
|
|
27
|
+
* like a credential is replaced before the record is written.
|
|
28
|
+
*/
|
|
29
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, statSync } from 'node:fs';
|
|
30
|
+
import { join } from 'node:path';
|
|
31
|
+
import { resolveBuffConfigDir } from '../config/paths.js';
|
|
32
|
+
/** Rotate once the active file passes this size (bytes). */
|
|
33
|
+
export const GATEWAY_LOG_MAX_BYTES = 5 * 1024 * 1024;
|
|
34
|
+
/** Message-body preview cap (chars) — never the whole body. */
|
|
35
|
+
export const GATEWAY_LOG_PREVIEW_CHARS = 120;
|
|
36
|
+
/** Directory holding the log (sibling of the other gateway stores). */
|
|
37
|
+
export function gatewayLogDir() {
|
|
38
|
+
return join(resolveBuffConfigDir(), 'gateway');
|
|
39
|
+
}
|
|
40
|
+
/** The active log file path. */
|
|
41
|
+
export function gatewayLogFile() {
|
|
42
|
+
return join(gatewayLogDir(), 'logs.jsonl');
|
|
43
|
+
}
|
|
44
|
+
/** The single rotation generation path. */
|
|
45
|
+
export function gatewayLogRotatedFile() {
|
|
46
|
+
return join(gatewayLogDir(), 'logs.1.jsonl');
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Scrub anything that looks like a credential. Defence in depth: callers are
|
|
50
|
+
* expected not to pass secrets, but a token pasted into a target string (or a
|
|
51
|
+
* provider error echoing an API key) must never be persisted.
|
|
52
|
+
*/
|
|
53
|
+
export function scrubSecrets(value) {
|
|
54
|
+
return value
|
|
55
|
+
.replace(/\b(sk-[A-Za-z0-9_-]{8,})/g, 'sk-***')
|
|
56
|
+
.replace(/\b(gsk_[A-Za-z0-9_-]{8,})/g, 'gsk_***')
|
|
57
|
+
.replace(/\b(AIza[0-9A-Za-z_-]{20,})/g, 'AIza***')
|
|
58
|
+
.replace(/\b(xox[baprs]-[A-Za-z0-9-]{8,})/g, 'xox***')
|
|
59
|
+
.replace(/\b(Bearer\s+)[A-Za-z0-9._-]{8,}/gi, '$1***')
|
|
60
|
+
.replace(/([?&](?:access_token|api_?key|token|key|password)=)[^\s&"']+/gi, '$1***');
|
|
61
|
+
}
|
|
62
|
+
/** Truncate a message body to a short, scrub-safe preview. */
|
|
63
|
+
export function previewText(text) {
|
|
64
|
+
if (typeof text !== 'string' || !text)
|
|
65
|
+
return undefined;
|
|
66
|
+
const flat = text.replace(/\s+/g, ' ').trim();
|
|
67
|
+
if (!flat)
|
|
68
|
+
return undefined;
|
|
69
|
+
const cut = flat.length > GATEWAY_LOG_PREVIEW_CHARS ? `${flat.slice(0, GATEWAY_LOG_PREVIEW_CHARS)}…` : flat;
|
|
70
|
+
return scrubSecrets(cut);
|
|
71
|
+
}
|
|
72
|
+
/** Recursively scrub string values in a field map (bounded depth). */
|
|
73
|
+
function scrubFields(fields, depth = 0) {
|
|
74
|
+
if (depth > 3)
|
|
75
|
+
return {};
|
|
76
|
+
const out = {};
|
|
77
|
+
for (const [k, v] of Object.entries(fields)) {
|
|
78
|
+
if (v === undefined || v === null)
|
|
79
|
+
continue;
|
|
80
|
+
if (typeof v === 'string')
|
|
81
|
+
out[k] = scrubSecrets(v);
|
|
82
|
+
else if (typeof v === 'number' || typeof v === 'boolean')
|
|
83
|
+
out[k] = v;
|
|
84
|
+
else if (Array.isArray(v))
|
|
85
|
+
out[k] = v.slice(0, 20).map((x) => (typeof x === 'string' ? scrubSecrets(x) : x));
|
|
86
|
+
else if (typeof v === 'object')
|
|
87
|
+
out[k] = scrubFields(v, depth + 1);
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
/** Rotate the active log to `logs.1.jsonl` when it exceeds the size cap. */
|
|
92
|
+
function rotateIfNeeded() {
|
|
93
|
+
try {
|
|
94
|
+
const file = gatewayLogFile();
|
|
95
|
+
if (!existsSync(file))
|
|
96
|
+
return;
|
|
97
|
+
if (statSync(file).size < GATEWAY_LOG_MAX_BYTES)
|
|
98
|
+
return;
|
|
99
|
+
// Single-generation rotation: the previous file is replaced. Deliberate —
|
|
100
|
+
// the log exists to explain RECENT failures, not to be an archive.
|
|
101
|
+
renameSync(file, gatewayLogRotatedFile());
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
/* best-effort */
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Append one structured record. Never throws, never blocks — a logging failure
|
|
109
|
+
* must not affect delivery.
|
|
110
|
+
*/
|
|
111
|
+
export function logGatewayEvent(event, fields = {}, level = 'info') {
|
|
112
|
+
try {
|
|
113
|
+
const dir = gatewayLogDir();
|
|
114
|
+
if (!existsSync(dir))
|
|
115
|
+
mkdirSync(dir, { recursive: true });
|
|
116
|
+
rotateIfNeeded();
|
|
117
|
+
const record = {
|
|
118
|
+
at: new Date().toISOString(),
|
|
119
|
+
level,
|
|
120
|
+
event,
|
|
121
|
+
...scrubFields(fields),
|
|
122
|
+
};
|
|
123
|
+
appendFileSync(gatewayLogFile(), `${JSON.stringify(record)}\n`, 'utf-8');
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
/* best-effort — never break a send because the log is unwritable */
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Read the most recent records, newest first. Reads the active file (and the
|
|
131
|
+
* rotation generation when the active file has fewer than `limit` records), so
|
|
132
|
+
* a just-rotated log still answers "what happened?".
|
|
133
|
+
*/
|
|
134
|
+
export function readGatewayLog(limit = 100) {
|
|
135
|
+
const out = [];
|
|
136
|
+
const readOne = (file) => {
|
|
137
|
+
try {
|
|
138
|
+
if (!existsSync(file))
|
|
139
|
+
return [];
|
|
140
|
+
return readFileSync(file, 'utf-8')
|
|
141
|
+
.split('\n')
|
|
142
|
+
.filter((l) => l.trim() !== '')
|
|
143
|
+
.map((l) => {
|
|
144
|
+
try {
|
|
145
|
+
return JSON.parse(l);
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
})
|
|
151
|
+
.filter((r) => r !== null);
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
return [];
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
// Newest generation first: previous log, then the active file.
|
|
158
|
+
const records = [...readOne(gatewayLogRotatedFile()), ...readOne(gatewayLogFile())];
|
|
159
|
+
for (let i = records.length - 1; i >= 0 && out.length < limit; i -= 1)
|
|
160
|
+
out.push(records[i]);
|
|
161
|
+
return out;
|
|
162
|
+
}
|
|
163
|
+
/** Absolute path help text for CLI/dashboard surfaces. */
|
|
164
|
+
export function gatewayLogPath() {
|
|
165
|
+
return gatewayLogFile();
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=gateway-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway-log.js","sourceRoot":"","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
CHANGED
|
@@ -15,7 +15,14 @@ export type InboundDisposition = 'pipeline' | 'chat' | 'help' | 'refused' | 'err
|
|
|
15
15
|
* backfill, webhook retry). Recorded for visibility, but NOT processed and
|
|
16
16
|
* NOT answered — the sender already has the answer.
|
|
17
17
|
*/
|
|
18
|
-
| 'duplicate'
|
|
18
|
+
| 'duplicate'
|
|
19
|
+
/**
|
|
20
|
+
* The message answered a question the agent was WAITING on
|
|
21
|
+
* (`gateway.askUserWait`) — it resolved a pending `ask_user` rather than
|
|
22
|
+
* starting a turn. Recorded so the reply is visible in the ledger instead of
|
|
23
|
+
* looking like a message that vanished.
|
|
24
|
+
*/
|
|
25
|
+
| 'clarified';
|
|
19
26
|
/** One inbound message recorded by the gateway. */
|
|
20
27
|
export interface InboxEntry {
|
|
21
28
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../../src/gateway/inbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,0DAA0D;AAC1D,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GACV,MAAM,GACN,MAAM,GACN,SAAS,GACT,OAAO;AACT;;;;GAIG;GACD,WAAW,CAAC;AAEhB,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oCAAoC;IACpC,OAAO,EAAE,kBAAkB,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C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AE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,0CAA0C;AAC1C,eAAO,MAAM,kBAAkB,QAA0B,CAAC;AAE1D,oCAAoC;AACpC,qBAAa,WAAW;IACtB,OAAO,CAAC,IAAI,CAAS;gBAET,SAAS,CAAC,EAAE,MAAM;IAI9B,wCAAwC;IACxC,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,qDAAqD;IACrD,IAAI,IAAI,UAAU,EAAE;IAUpB,OAAO,CAAC,KAAK;IASb,6EAA6E;IAC7E,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC,GAAG,UAAU;CAQzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../src/gateway/inbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../src/gateway/inbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO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C,CAAC;QACtF,CAAC;QAAC,MAAM,CAAC;YACP,mEAAmE;QACrE,CAAC;IACH,CAAC;IAED,6EAA6E;IAC7E,MAAM,CAAC,KAAoC;QACzC,MAAM,KAAK,GAAe,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QACzE,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACxC,uEAAuE;QACvE,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,kBAAkB,CAAC,CAAC;QAC3E,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC;QAC7C,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -22,6 +22,7 @@ import { DeliveryLedger } from './delivery.js';
|
|
|
22
22
|
import { InboxLedger } from './inbox.js';
|
|
23
23
|
import { InboundDedupLedger } from './dedup.js';
|
|
24
24
|
import { GatewayHeartbeat } from './heartbeat.js';
|
|
25
|
+
import type { AskKind } from '../nlu/conversation-gate.js';
|
|
25
26
|
/**
|
|
26
27
|
* Strip leaked internal reasoning, planning blocks, and meta-commentary from
|
|
27
28
|
* a gateway chat response. The model sometimes emits its chain-of-thought
|
|
@@ -45,6 +46,34 @@ export declare function stripGatewayReasoning(text: string): string;
|
|
|
45
46
|
* gateway_send) instead of the bare orchestrator (which cannot deliver).
|
|
46
47
|
*/
|
|
47
48
|
export declare function hasDeliveryAsk(text: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Match a channel reply against the choices of a pending `ask_user` question.
|
|
51
|
+
*
|
|
52
|
+
* Deliberately conservative, because a WRONG match silently steers the agent:
|
|
53
|
+
* only unambiguous forms resolve, and anything else returns `null` so the
|
|
54
|
+
* caller releases the waiter with its default and handles the text as a normal
|
|
55
|
+
* message. Supported forms:
|
|
56
|
+
* - `1`, `2`, … (1-based, in range) and `option 2` / `#2`
|
|
57
|
+
* - the choice label, case- and punctuation-insensitively ("pdf" → "PDF book")
|
|
58
|
+
* - a prefix of exactly ONE label ("interactive" → "Interactive game")
|
|
59
|
+
* A number OUT of range, or a prefix matching several labels, is NOT a choice.
|
|
60
|
+
*/
|
|
61
|
+
export declare function matchAskUserChoice(text: string, choices: string[]): {
|
|
62
|
+
answer: string;
|
|
63
|
+
index: number;
|
|
64
|
+
} | null;
|
|
65
|
+
/**
|
|
66
|
+
* Normalise the model's `ask_user` choices into displayable labels.
|
|
67
|
+
*
|
|
68
|
+
* `ChatEngine` types this parameter as `unknown[]` and the tool is called with
|
|
69
|
+
* BOTH shapes in the wild — plain strings (`['Book', 'PDF']`) and objects
|
|
70
|
+
* (`[{ label: 'Book', description: … }]`). The previous code assumed objects
|
|
71
|
+
* and read `.label` unconditionally, so a string array rendered as
|
|
72
|
+
* "1. undefined / 2. undefined" and then crashed the inbound path when the
|
|
73
|
+
* contact replied to it. Accept every documented shape; drop what cannot be
|
|
74
|
+
* rendered rather than inventing a placeholder.
|
|
75
|
+
*/
|
|
76
|
+
export declare function normalizeAskUserChoices(choices: unknown): string[];
|
|
48
77
|
/** Compact one-line status from a board event (E2 events → channel text). */
|
|
49
78
|
export declare function eventToStatusLine(event: string, data: any): string | null;
|
|
50
79
|
/**
|
|
@@ -153,6 +182,46 @@ export interface GatewayRegistryOptions {
|
|
|
153
182
|
typing: boolean;
|
|
154
183
|
}) => void;
|
|
155
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Compose the chat-facing result of a pipeline run.
|
|
187
|
+
*
|
|
188
|
+
* The orchestrator's `summary` is the CLI TEXT REPORT — multi-line, already
|
|
189
|
+
* carrying its own verdict emoji, its own goal/duration block, and an
|
|
190
|
+
* `Agent Results:` list. Sending it verbatim after a second verdict is what a
|
|
191
|
+
* WhatsApp user actually received:
|
|
192
|
+
*
|
|
193
|
+
* ❌ Failed — ❌ Completed 2/3 tasks with some failures in 9.6s
|
|
194
|
+
* Goal: Create a project plan to develop a multiple screen calculator … fo
|
|
195
|
+
* ... (truncated)
|
|
196
|
+
* Tasks: 2/3 completed
|
|
197
|
+
* Agent Results: <- the same three lines as the bullets below
|
|
198
|
+
* • Tasks: 0/5 completed <- a different denominator, so this contradicts
|
|
199
|
+
*
|
|
200
|
+
* Three defects, all fixed here rather than by reformatting the shared report
|
|
201
|
+
* (the CLI and the audit trail want the rich form):
|
|
202
|
+
* - ONE verdict, taken from `success`; the summary's own leading verdict is
|
|
203
|
+
* stripped instead of being nested behind a second one.
|
|
204
|
+
* - ONE set of counts, labelled so the two different denominators (pipeline
|
|
205
|
+
* steps vs agent runs) read as detail instead of self-contradiction.
|
|
206
|
+
* - No duplication and no machine sentinel: agent lines come from the
|
|
207
|
+
* STRUCTURED result, and the truncation artifact is removed.
|
|
208
|
+
*
|
|
209
|
+
* `structured` is absent only when the pipeline threw before returning (the
|
|
210
|
+
* catch path), where the summary line is all we truthfully have.
|
|
211
|
+
*/
|
|
212
|
+
export declare function composePipelineReply(pipeline: {
|
|
213
|
+
success: boolean;
|
|
214
|
+
summary: string;
|
|
215
|
+
structured?: {
|
|
216
|
+
tasksCompleted: number;
|
|
217
|
+
tasksTotal: number;
|
|
218
|
+
agentResults: Array<{
|
|
219
|
+
agent: string;
|
|
220
|
+
success: boolean;
|
|
221
|
+
summary: string;
|
|
222
|
+
}>;
|
|
223
|
+
} | null;
|
|
224
|
+
}): string;
|
|
156
225
|
export declare class GatewayRegistry {
|
|
157
226
|
readonly directory: ChannelDirectory;
|
|
158
227
|
/** I2 — guaranteed-delivery ledger for failed sends. */
|
|
@@ -190,6 +259,14 @@ export declare class GatewayRegistry {
|
|
|
190
259
|
* double-count would prematurely fail entries). */
|
|
191
260
|
private drainChain;
|
|
192
261
|
private started;
|
|
262
|
+
/**
|
|
263
|
+
* The deferred-retry drain. A failed turn is queued (see `deferFailedTask`)
|
|
264
|
+
* and re-run here when a model is expected back — the mechanism behind the
|
|
265
|
+
* "Reply *yes*" offer, which used to be a promise with nothing behind it.
|
|
266
|
+
*/
|
|
267
|
+
private retryTimer;
|
|
268
|
+
/** Serializes retry runs so a long one is never started twice. */
|
|
269
|
+
private retryChain;
|
|
193
270
|
/** Epoch ms of start() — the uptime reported in the heartbeat. */
|
|
194
271
|
private startedAt;
|
|
195
272
|
/** Beats written this run (monotonic; a stalled count means a stalled loop). */
|
|
@@ -212,6 +289,21 @@ export declare class GatewayRegistry {
|
|
|
212
289
|
*/
|
|
213
290
|
private lastFollowupsByContact;
|
|
214
291
|
private onTypingCallback;
|
|
292
|
+
/**
|
|
293
|
+
* Last send failure reason per `platform:channelId`, so a caller can report
|
|
294
|
+
* the real cause (e.g. "not a WhatsApp account") instead of a generic line.
|
|
295
|
+
* Bounded; cleared on the next successful send to the same target.
|
|
296
|
+
*/
|
|
297
|
+
private readonly lastSendErrors;
|
|
298
|
+
/**
|
|
299
|
+
* Questions the gateway is WAITING on, per `platform:channelId`
|
|
300
|
+
* (`gateway.askUserWait`). The awaiting turn holds its promise until the
|
|
301
|
+
* contact's next message resolves it — see `consumePendingAsk` — or the
|
|
302
|
+
* timeout applies the default. At most ONE waiter per contact: a second
|
|
303
|
+
* question replaces the first (which receives its default, exactly what it
|
|
304
|
+
* would have received anyway), so this map cannot grow an unbounded queue.
|
|
305
|
+
*/
|
|
306
|
+
private readonly pendingQuestions;
|
|
215
307
|
constructor(options?: GatewayRegistryOptions, configManager?: ConfigManager);
|
|
216
308
|
/**
|
|
217
309
|
* Build the effective policy map: explicit options < env < config (most
|
|
@@ -249,6 +341,15 @@ export declare class GatewayRegistry {
|
|
|
249
341
|
sendMediaToRef(ref: ChannelRef, media: MediaPayload): Promise<boolean>;
|
|
250
342
|
/** Send to an explicit channel ref. I2: a failed send is ledgered for retry. */
|
|
251
343
|
sendToRef(ref: ChannelRef, text: string, target?: string): Promise<boolean>;
|
|
344
|
+
/**
|
|
345
|
+
* WHY the most recent send to this target failed (undefined when it did not).
|
|
346
|
+
* The verified adapters (WhatsApp) fill this in so the caller — and the
|
|
347
|
+
* `gateway_send` tool's model-facing output — can report the real cause
|
|
348
|
+
* instead of a generic "transport unreachable".
|
|
349
|
+
*/
|
|
350
|
+
lastSendError(ref: ChannelRef): string | undefined;
|
|
351
|
+
private recordSendError;
|
|
352
|
+
private clearSendError;
|
|
252
353
|
/**
|
|
253
354
|
* Attempt all due pending delivery entries through the registered adapters.
|
|
254
355
|
* Returns the counters (public so the CLI `nuvira gateway delivery --flush`
|
|
@@ -271,7 +372,45 @@ export declare class GatewayRegistry {
|
|
|
271
372
|
* channel (a second message while a run is active queues behind it).
|
|
272
373
|
* Every message is recorded in the inbox (P2) with its disposition.
|
|
273
374
|
*/
|
|
274
|
-
handleInbound(msg: InboundMessage
|
|
375
|
+
handleInbound(msg: InboundMessage, opts?: {
|
|
376
|
+
/** Set when this message is a queued RETRY of an earlier failed ask. */
|
|
377
|
+
retryOf?: string;
|
|
378
|
+
/**
|
|
379
|
+
* Route as if `resolveAskKind` had returned this.
|
|
380
|
+
*
|
|
381
|
+
* Used ONLY by the intent audit's re-route: when a confirmation proves
|
|
382
|
+
* the ask was read wrong, the corrected route is run through this same
|
|
383
|
+
* entry point so it gets the same gates, the same reply path and the
|
|
384
|
+
* same ledger rows as any other message — rather than a private second
|
|
385
|
+
* implementation that could drift from it.
|
|
386
|
+
*/
|
|
387
|
+
forceKind?: AskKind;
|
|
388
|
+
/** Internal re-entry of the SAME message (already gated + recorded). */
|
|
389
|
+
reentry?: boolean;
|
|
390
|
+
/** The intent audit already ran for this message — never run it twice. */
|
|
391
|
+
audited?: boolean;
|
|
392
|
+
}): Promise<string>;
|
|
393
|
+
/**
|
|
394
|
+
* On a REPEATED failure, ask the model what this ask really needs, and act on
|
|
395
|
+
* the answer.
|
|
396
|
+
*
|
|
397
|
+
* THE PROBLEM IT SOLVES. A failure says nothing about whether the request was
|
|
398
|
+
* read correctly — but a failure that happens TWICE (a queued retry, an audit
|
|
399
|
+
* re-route, or a spent six-step pipeline) is expensive enough that the routing
|
|
400
|
+
* itself is worth one question. Without it, a misreading is permanent: the same
|
|
401
|
+
* ask runs down the same wrong path forever, and the user's only recourse is to
|
|
402
|
+
* rephrase. This is the self-correction half of routing; `learnings.ts` is the
|
|
403
|
+
* memory half, so the NEXT identical ask routes right the first time.
|
|
404
|
+
*
|
|
405
|
+
* Runs at most ONCE per inbound message (the `audited` flag), which is what
|
|
406
|
+
* stops a misreading ping-ponging between the two routes.
|
|
407
|
+
*
|
|
408
|
+
* @returns null when no audit ran; `{rerouted: true}` when the corrected route
|
|
409
|
+
* was run (its reply already delivered); `{rerouted: false, note}` when the
|
|
410
|
+
* model CONFIRMED the reading, so the caller keeps its failure report and
|
|
411
|
+
* adds the confirmation line.
|
|
412
|
+
*/
|
|
413
|
+
private auditAndReroute;
|
|
275
414
|
/**
|
|
276
415
|
* Chat-intent answer (write/explain/ask): run ONE tool-loop turn through the
|
|
277
416
|
* SAME engine the dashboard chat console uses (ChatCommand.answerOnce), so
|
|
@@ -331,6 +470,78 @@ export declare class GatewayRegistry {
|
|
|
331
470
|
private startLiveness;
|
|
332
471
|
/** Retry every configured adapter that is not currently started. */
|
|
333
472
|
private retryPendingAdapters;
|
|
473
|
+
/**
|
|
474
|
+
* Is ask-and-wait enabled? `gateway.askUserWait === true` only — an absent or
|
|
475
|
+
* malformed value keeps the historical no-wait behaviour, so enabling this is
|
|
476
|
+
* an explicit, deliberate act.
|
|
477
|
+
*/
|
|
478
|
+
private askUserWaitEnabled;
|
|
479
|
+
/**
|
|
480
|
+
* How long to hold a turn for a reply. Clamped to 5s–10min so a bad config
|
|
481
|
+
* value can neither hang a turn forever nor time out before the user can
|
|
482
|
+
* physically read the question.
|
|
483
|
+
*/
|
|
484
|
+
private askUserWaitTimeoutMs;
|
|
485
|
+
/**
|
|
486
|
+
* Hold the current turn until `key`'s contact replies, or the window lapses.
|
|
487
|
+
*
|
|
488
|
+
* The promise ALWAYS settles: the timeout resolves it with `fallback`, so a
|
|
489
|
+
* silent contact costs one bounded wait and never a stuck gateway. The timer
|
|
490
|
+
* is unref'd so a pending question cannot keep the process alive on shutdown.
|
|
491
|
+
*
|
|
492
|
+
* On timeout the contact is TOLD the default was applied. The question
|
|
493
|
+
* promises "I will wait", so proceeding silently would leave them reading an
|
|
494
|
+
* answer to a question they never answered — and their later reply would look
|
|
495
|
+
* like it had been ignored.
|
|
496
|
+
*/
|
|
497
|
+
private awaitAskUserReply;
|
|
498
|
+
/** Release a waiter with its default (timeout, replacement, or shutdown). */
|
|
499
|
+
private releasePendingAsk;
|
|
500
|
+
/**
|
|
501
|
+
* Resolve an awaiting question from the contact's next message. Returns a
|
|
502
|
+
* user-facing confirmation when the reply matched a choice, or `null` when it
|
|
503
|
+
* did not — in which case the waiter is released with its default and the
|
|
504
|
+
* message falls through to NORMAL handling. Failing open is the invariant: a
|
|
505
|
+
* message is never swallowed by the question machinery.
|
|
506
|
+
*/
|
|
507
|
+
private consumePendingAsk;
|
|
508
|
+
/**
|
|
509
|
+
* Resolve a reply against a pending retry offer. Returns a user-facing line
|
|
510
|
+
* when the message WAS an answer to that offer, or `null` to let it fall
|
|
511
|
+
* through to normal handling.
|
|
512
|
+
*
|
|
513
|
+
* Failing OPEN is the invariant (same as the pending-question machinery): a
|
|
514
|
+
* message that is not clearly yes/no is never swallowed, and the queued task
|
|
515
|
+
* simply keeps its place — so the sender can still accept or cancel later.
|
|
516
|
+
*/
|
|
517
|
+
private consumeRetryAnswer;
|
|
518
|
+
/**
|
|
519
|
+
* Queue a failed ask for retry. Called from BOTH failure branches (chat and
|
|
520
|
+
* pipeline) at the moment the breadth report — and therefore the "Reply
|
|
521
|
+
* *yes*" offer — is being sent to the sender.
|
|
522
|
+
*
|
|
523
|
+
* Never throws and never awaits: a queue write must not delay or break the
|
|
524
|
+
* failure reply the sender is owed.
|
|
525
|
+
*/
|
|
526
|
+
private deferFailedAsk;
|
|
527
|
+
/**
|
|
528
|
+
* Run every deferred ask whose wait is over (and report the ones that ran
|
|
529
|
+
* out of road).
|
|
530
|
+
*
|
|
531
|
+
* Serialized through `retryChain`: two drains must never run the same ask
|
|
532
|
+
* twice, and a retry is a full chat/pipeline turn that can take minutes.
|
|
533
|
+
*/
|
|
534
|
+
private drainDeferredTasks;
|
|
535
|
+
/**
|
|
536
|
+
* Replay ONE deferred ask through the ordinary inbound path.
|
|
537
|
+
*
|
|
538
|
+
* Replaying the original message (rather than calling an engine directly) is
|
|
539
|
+
* deliberate: the retry gets the SAME authorization, the SAME routing
|
|
540
|
+
* verdict, the SAME pipeline serialization and the SAME reply path as a
|
|
541
|
+
* first-time ask, so a retry can never behave differently from the request
|
|
542
|
+
* it is retrying.
|
|
543
|
+
*/
|
|
544
|
+
private runDeferredTask;
|
|
334
545
|
/** Stop adapters + unsubscribe + stop the delivery drain. Idempotent. */
|
|
335
546
|
stop(): Promise<void>;
|
|
336
547
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/gateway/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,gBAAgB,EAGhB,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,KAAK,SAAS,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,cAAc,EAAsB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,WAAW,EAA2B,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAA6C,MAAM,gBAAgB,CAAC;
|
|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