Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Description

Creates comprehensive implementation plan for adding handlebar template support to the Dapr PubSub reaction, enabling custom output formatting similar to Sync Vector Store and MCP reactions.

Plan Contents

  • Current State Analysis: Surveyed existing handlebar implementations in Sync Vector Store (Handlebars.Net) and MCP (TypeScript) reactions
  • Proposed Solution: Add Templated output format with separate templates for added, updated, and deleted results
  • Implementation Details:
    • QueryConfig extension with addedTemplate, updatedTemplate, deletedTemplate properties
    • New TemplateChangeFormatter class with template caching
    • ChangeFormatterFactory updates to route templated events
    • Validation ensuring templates match format setting
  • Testing Strategy: Unit tests for formatter, caching, validation; integration tests for end-to-end flow
  • Documentation: Usage examples, context variables, helper functions
  • Backward Compatibility: Opt-in feature, existing Packed/Unpacked formats unchanged

Template configuration example:

queries:
  inventory-changes: |
    {
      "pubsubName": "drasi-pubsub",
      "topicName": "inventory-events",
      "format": "Templated",
      "addedTemplate": "{\"type\": \"inventory_added\", \"product\": \"{{after.productName}}\", \"quantity\": {{after.quantity}}}",
      "updatedTemplate": "{\"type\": \"inventory_updated\", \"product\": \"{{after.productName}}\", \"oldQty\": {{before.quantity}}, \"newQty\": {{after.quantity}}}"
    }

Plan document: /plans/issue-345-dapr-pubsub-handlebar-templates.md

Type of change

  • This pull request adds or changes features of Drasi and has an approved issue (issue link required).

Fixes: #345

Original prompt

go and create a plan to implement the feature requested in this issue #345. look at other reactions that currently support handlebar templates as guidance. write the plan as a markdown document in the /plans folder of this repo.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add implementation plan for handlebar templates feature Add implementation plan for handlebar template support in Dapr PubSub reaction Nov 19, 2025
Copilot AI requested a review from agentofreality November 19, 2025 18:37
Copilot finished work on behalf of agentofreality November 19, 2025 18:37
@agentofreality agentofreality deleted the copilot/create-implementation-plan branch November 20, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output templating in Dapr PubSub Reaction

2 participants