npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pmcollab/coworkstream-engine-copilot-studio

v0.1.0

Published

Microsoft Copilot Studio AgentRunner adapter for @pmcollab/coworkstream-engine. Talks to a Copilot Studio agent over Direct Line.

Downloads

23

Readme

@pmcollab/coworkstream-engine-copilot-studio

Coding agents: read packages/workstream-engine/AGENTS.md for the engine integration recipe before wiring this adapter. Migrating an existing setup? See packages/workstream-engine/MIGRATION.md.

Microsoft Copilot Studio AgentRunner adapter for @pmcollab/coworkstream-engine. Talks to a Copilot Studio agent over Direct Line v3.

⚠ Data residency. The default baseUrl is https://directline.botframework.com/v3/directline, a globally-routed Microsoft endpoint. Requests carry the full work item (title, summary, meta) and the trust context. For data-residency-sensitive deployments (EU, UK, government cloud, sovereign clouds), pass baseUrl explicitly to a regional endpoint and confirm with your Microsoft tenant admin that the chosen Direct Line region is in your data-residency boundary. Do NOT default to the global endpoint for regulated customer data.

Install

npm install @pmcollab/coworkstream-engine-copilot-studio

Use

import { createEngine } from '@pmcollab/coworkstream-engine'
import { createCopilotStudioAgent } from '@pmcollab/coworkstream-engine-copilot-studio'

const agent = createCopilotStudioAgent({
  id: 'helpdesk',
  directLineSecret: process.env.DIRECT_LINE_SECRET,
})

const engine = createEngine({ agents: [agent], /* ... */ })

The Direct Line secret comes from your Copilot Studio agent's channel settings — Channels → Mobile / Custom → Direct Line.

How position extraction works

The adapter looks for a decision in this priority order:

  1. Adaptive Card data with a position field (recommended). Have your topic emit an Adaptive Card whose data includes { position, reasoning, confidence }.
  2. suggestedActions[0].value — if it's an object with position.
  3. Text fallback — searches the bot's message text for known position keywords (approve, reject, acknowledge, etc.).

Customize via extractPosition(activity, item, ctx) → { position, reasoning, confidence } if your topic uses a different shape.

Recommended Copilot Studio topic pattern

Configure your topic to end with a Question node that emits an Adaptive Card:

{
  "type": "AdaptiveCard",
  "version": "1.4",
  "body": [
    { "type": "TextBlock", "text": "I recommend ${decision}" }
  ],
  "data": {
    "position": "${decision}",
    "reasoning": "${rationale}",
    "confidence": "${confidence}"
  }
}

The adapter picks data straight off the card.

Options

createCopilotStudioAgent({
  id, directLineSecret,           // required
  name?, avatar?, capabilities?,
  baseUrl?: string,               // default Direct Line v3 endpoint
  fetchFn?: typeof fetch,
  pollIntervalMs?: number,        // default 1000
  timeoutMs?: number,             // default 60_000
  defaultConfidence?: number,
  formatItem?: (item, ctx) => string,
  extractPosition?: (activity, item, ctx) => { position, reasoning, confidence },
})

License

Commercial. See LICENSE in the repository root.