@microsoft/teams.api
Version:
<p> <a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.api/latest" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.api?activeTab=code" t
1 lines • 2.97 kB
Source Map (JSON)
{"version":3,"sources":["../../../src/models/entity/plan-info-entity.ts"],"names":[],"mappings":"AA+EO,SAAS,YAAY,QAAA,EAAwE;AAClG,EAAA,OAAO,SAAS,QAAA,EAAU,IAAA,CAAK,CAAC,MAAA,KAAqC,MAAA,CAAO,SAAS,UAAU,CAAA;AACjG","file":"plan-info-entity.mjs","sourcesContent":["import type { CitationIconName } from './citation-entity';\n\nimport type { Entity } from './index';\n\n/**\n * Plan lifecycle operation.\n *\n * @experimental This API is in preview and may change in the future.\n * Diagnostic: ExperimentalTeamsPlan\n */\nexport type PlanType = 'start' | 'continue' | 'complete' | 'stop' | 'error';\n\n/**\n * Progress state of a Plan step.\n *\n * @experimental This API is in preview and may change in the future.\n * Diagnostic: ExperimentalTeamsPlan\n */\nexport type StepStatus = 'active' | 'proposed' | 'completed' | 'blocked' | 'error';\n\n/**\n * A source displayed alongside a step.\n *\n * @experimental This API is in preview and may change in the future.\n * Diagnostic: ExperimentalTeamsPlan\n */\nexport type StepSource = {\n /** Display title of the source. */\n title: string;\n /** URL of the source. */\n url: string;\n /** Optional icon from the shared citation icon names. */\n icon?: CitationIconName;\n};\n\n/**\n * A versioned progress update; the application owns ordering and execution.\n * Keep the same ID and increment the version whenever any step field changes.\n *\n * @experimental This API is in preview and may change in the future.\n * Diagnostic: ExperimentalTeamsPlan\n */\nexport type Step = {\n /** Stable identifier for this step within the Plan. */\n id: string;\n /** Revision number; increment for every status, title, description, or source change. */\n version: number;\n /** Display title of the step. */\n title: string;\n /** Current progress state. */\n status: StepStatus;\n /** Optional details about the work or current state. */\n description?: string;\n /** Optional reference sources associated with this step. */\n sources?: StepSource[];\n};\n\n/**\n * Prompt-bound Plan metadata carried in an activity's entities.\n * Start begins a Plan, continue adds or updates steps, and the remaining operations end it.\n *\n * @experimental This API is in preview and may change in the future.\n * Diagnostic: ExperimentalTeamsPlan\n */\nexport type PlanInfoEntity = {\n /** Wire discriminator for Plan metadata. */\n readonly type: 'planInfo';\n /** Lifecycle operation to send. */\n planType: PlanType;\n /** Optional step updates; increment the version of every changed step. */\n steps?: Step[];\n};\n\n/**\n * Read the first Plan entity from an activity, if present.\n *\n * @experimental This API is in preview and may change in the future.\n * Diagnostic: ExperimentalTeamsPlan\n */\nexport function getPlanInfo(activity: { entities?: readonly Entity[] }): PlanInfoEntity | undefined {\n return activity.entities?.find((entity): entity is PlanInfoEntity => entity.type === 'planInfo');\n}\n"]}