/** * Shared AITask Registry (PIT-6047). * * Vue-FREE leaf module — imports nothing so it can be consumed as a plain * type/const module by any backend (next-core Bedrock, iOS Gemma spec) without * dragging in the Vue component bundle. next-core imports the TYPES only * (`import type ...`) and keeps its OWN authoritative registry value; it must * NOT import `AI_TASK_REGISTRY` at runtime (that would pull the Vue barrel into * Node). See ADR-002. * * The four AITask ids (`meeting_prep`, `discussion_points`, `pitch_deck`, * `post_call_summary`) are a LOCKED cross-backend wire contract shared with * iOS — do NOT rename them. * * `account_insights` (PIT-6122) is a NEW, bedrock-only task added alongside the * locked four (NOT a rename/removal of any). It is the richer PIA "4-section * account brief" that replaces the generic `meeting_prep`, and it can absorb * `discussion_points` later — it always emits `key_discussion_points`. * Deprecating `discussion_points` via a 1-version dual-emit window is DEFERRED * pending Joan's design-review confirm; `meeting_prep` + `discussion_points` are * NOT deprecated here. * * `precall_notes` (PIT-6123) is another NEW task added alongside the locked four * (NOT a rename/removal). One task that ENHANCES existing precall notes when * present, else GENERATES them from CRM context + recent interactions (+ an * optional pre-computed upstream `account_insights` output). Unlike * `account_insights` it does NOT depend on the server-side content-recommendation * engine — its context comes from the caller / iOS SmartStore — so it is * offline/Gemma-capable (`backends: ['bedrock', 'gemma']`). * * `pia_search` (PIT-6863) is another NEW task added alongside the locked four * (NOT a rename/removal). It answers a rep's natural-language question over the * instance's content + metadata (Postgres/Django candidates + aiAnalysis * summaries as context). Online it is served by the next-core Bedrock route; * on-device (iOS) the SAME task is served client-side through the `ai.complete` * Gemma bridge with a hub-assembled context — hence `backends: * ['bedrock', 'gemma']`. `requires` is empty: its inputs (query + instance) are * request-envelope fields, not AITaskRequirement vocabulary, and candidate * retrieval happens server-side. */ /** Locked cross-backend task ids. AITask id === the wire-contract string. */ export type AITask = 'meeting_prep' | 'discussion_points' | 'pitch_deck' | 'post_call_summary' | 'account_insights' | 'precall_notes' | 'pia_search'; /** * Vocabulary of declarative input requirements a task can depend on. A task's * `requires` list is server-enforced in next-core (missing → 400 * `missing_requirement`) and documents to iOS what context to assemble before * invoking. Not every value is used by every task. */ export type AITaskRequirement = 'crm_account' | 'crm_opportunity' | 'files_listing' | 'call_transcript' | 'content_engagement_90d' | 'content_metadata_rules' | 'data_cloud_insights'; /** Backends that can serve a task. `bedrock` = next-core; `gemma` = iOS offline. */ export type AITaskBackend = 'bedrock' | 'gemma'; /** * Public, backend-agnostic description of an AITask. This is the shape the * next-core catalog endpoint (`GET /core/api/protected/ai-tasks/catalog`) * serves. Runtime serving/logic (prompt template, output schema, extractor) * lives ONLY in the next-core registry, never here. */ export type AITaskDefinition = { id: AITask; display_name: string; description: string; backends: AITaskBackend[]; requires: AITaskRequirement[]; /** Bumped when the task's structured output contract changes shape. */ output_schema_version: number; /** next-core route that serves the task, if any. */ route?: string; /** * Whether this task may be exposed as a callable function in the future * Function Catalog (PIA / MCP). Defaults to false in v1. */ expose_as_function?: boolean; }; /** * Shared spec of the four tasks. iOS reads this at cold-start; next-core keeps * a parallel authoritative registry (with templates/schemas/extractors) whose * ids + requires MUST stay in lockstep with this list (asserted by a * conformance test in next-core). */ export declare const AI_TASK_REGISTRY: AITaskDefinition[];