update on the agents and registry side
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
getTenantLocations
|
||||
} from 'pages/api/doormileApi';
|
||||
import { getalltenants, getallridersummary } from 'pages/api/api';
|
||||
import { buildBriefing } from '@/lib/assistant/agent/briefing';
|
||||
import { parseDoormileTimestamp } from 'utils/doormileTimestamp';
|
||||
import { getRowBatchId, getBatchLabel, BATCHES } from 'utils/batchBucket';
|
||||
import { STATUS } from 'themes/dt/tokens';
|
||||
@@ -745,6 +746,48 @@ const COMPARE_TRIGGER = /\bvs\b|\bversus\b|\bcompared?\s*to\b|\bcompare\b/i;
|
||||
const MULTI_SPLIT = /\band\b|,|\+|&/i;
|
||||
|
||||
const INTENTS = [
|
||||
{
|
||||
// The ops briefing: every monitoring skill enabled in the agent registry,
|
||||
// run over the same booking scan the rest of the catalog answers from —
|
||||
// the SAME engine as the Exceptions banner (AgentFactory), so the chat and
|
||||
// the banner can never disagree about a parcel. Ported from
|
||||
// feat/agentic-ops-layer (docs/agent-platform-plan.md, Phase 3).
|
||||
//
|
||||
// FIRST on purpose: later intents match bare "orders"/"riders", which
|
||||
// appear in most phrasings of a sweep.
|
||||
//
|
||||
// Narrower than the branch on purpose. The branch also claimed
|
||||
// "late/overdue/delayed orders", which would have stolen the existing
|
||||
// delayed-orders answer (a count on the Orders taxonomy) and replaced it
|
||||
// with a briefing. Only an explicit request for a sweep lands here.
|
||||
id: 'opsBriefing',
|
||||
label: 'What needs attention right now — e.g. "what needs attention", "anything going wrong", "ops check"',
|
||||
match: (text) => {
|
||||
const t = String(text).toLowerCase();
|
||||
const asksForSweep =
|
||||
/\b(what|anything|any)\b.{0,24}\b(needs?\s+(my\s+)?attention|going\s+wrong|at\s+risk|urgent|on\s+fire)\b/.test(t) ||
|
||||
/\b(ops|operations|status|health|daily)\s+(check|sweep|briefing|brief)\b/.test(t) ||
|
||||
/\bwhat\s+should\s+i\s+(do|look\s+at)\b/.test(t);
|
||||
return asksForSweep ? {} : null;
|
||||
},
|
||||
run: async () => {
|
||||
const scan = await scanBookings();
|
||||
const briefing = buildBriefing(scan);
|
||||
return {
|
||||
headline: briefing.headline,
|
||||
detail: briefing.detail,
|
||||
metric: briefing.metric,
|
||||
sourceCalls: [
|
||||
scanCall(
|
||||
scan,
|
||||
briefing.findings.length
|
||||
? `${briefing.findings.length} finding${briefing.findings.length === 1 ? '' : 's'} over ${scan.rows.length} rows`
|
||||
: `no issues over ${scan.rows.length} rows`
|
||||
)
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
// Ordered ahead of BOTH create triggers. "repeat yesterday's orders"
|
||||
// contains "orders", so createBulkOrders and createOrder would otherwise
|
||||
|
||||
Reference in New Issue
Block a user