[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69A6YMH1EX0N0Z4D2Z9R67N":3,"skill-same:01M69A6YMH1EX0N0Z4D2Z9R67N":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":40,"linkOnly":41,"markdownContent":42,"markdownBody":43,"frontMatter":44,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":17,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M69A6YMH1EX0N0Z4D2Z9R67N","add-event","会话事件类型添加","Add a new event type that flows from the LLM session through to client subscribers. Covers firing the event from ManagedSession, persisting to CMS, and filtering in PilotSwarmSession.on().","添加从 LLM 会话流向客户端订阅者的新事件类型。涵盖从 ManagedSession 触发事件、持久化到 CMS，以及在 PilotSwarmSession.on() 中进行过滤。","microsoft\u002FPilotSwarm","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69A6RNK492A5JSNBTXANKX5",16,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fadd-event\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSFHC0DJXKNN0QBZDDS4K9","定时任务与自动化编排","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39],"add event","add","event","cms","filtering","session","type","client","flows","2026-11-10 10:12:30",false,"---\nname: add-event\ndescription: Add a new event type that flows from the LLM session through to client subscribers. Covers firing the event from ManagedSession, persisting to CMS, and filtering in PilotSwarmSession.on().\n---\n\n# Add a New Event Type\n\nEvents flow from the Copilot SDK through ManagedSession, get persisted to CMS, and are delivered to client subscribers.\n\n## Steps\n\n1. **Fire the event from `ManagedSession`** in `src\u002Fmanaged-session.ts`:\n   - Events are captured via the `onEvent` callback passed to `runTurn()`.\n   - Inside the `copilotSession.on()` handler, events are captured as `CapturedEvent` objects:\n     ```typescript\n     const captured: CapturedEvent = {\n         eventType: \"my.event_type\",\n         data: eventData,\n     };\n     collectedEvents.push(captured);\n     opts?.onEvent?.(captured);\n     ```\n\n2. **Persist to CMS** — events are automatically persisted by the activity in `src\u002Fsession-proxy.ts` via the `onEvent` callback, which calls `catalog.recordEvents()`. No changes needed unless you want special handling.\n\n3. **Filter in `PilotSwarmSession.on()`** — if the event needs special client-side filtering (e.g., excluding ephemeral events from persistence), add logic in `src\u002Fclient.ts`:\n   ```typescript\n   session.on(\"my.event_type\", (event) => { ... });\n   ```\n\n4. **Add a test** — verify the event appears in `session.getMessages()` and\u002For via `session.on()` polling.\n\n## Event naming conventions\n\n- Use dot-separated names: `category.action` (e.g., `assistant.message`, `tool.execution_start`).\n- Ephemeral events (like `assistant.message_delta`) should NOT be persisted to CMS — they are filtered out in `session-proxy.ts`.\n\n## Event flow\n\n```\nCopilotSession.on(event)           ← Copilot SDK fires event\n  ↓\nManagedSession captures as CapturedEvent\n  ↓\nonEvent callback → session-proxy.ts → catalog.recordEvents()   ← persisted to CMS\n  ↓\nPilotSwarmSession.on() polls CMS → delivers to client subscribers\n```\n\n## Key files\n- [src\u002Fmanaged-session.ts](..\u002F..\u002F..\u002Fsrc\u002Fmanaged-session.ts) — event capture during `runTurn()`\n- [src\u002Fsession-proxy.ts](..\u002F..\u002F..\u002Fsrc\u002Fsession-proxy.ts) — event persistence to CMS\n- [src\u002Fcms.ts](..\u002F..\u002F..\u002Fsrc\u002Fcms.ts) — `recordEvents()` and `getSessionEvents()`\n- [src\u002Fclient.ts](..\u002F..\u002F..\u002Fsrc\u002Fclient.ts) — `PilotSwarmSession.on()` polling and dispatch\n","# Add a New Event Type\n\nEvents flow from the Copilot SDK through ManagedSession, get persisted to CMS, and are delivered to client subscribers.\n\n## Steps\n\n1. **Fire the event from `ManagedSession`** in `src\u002Fmanaged-session.ts`:\n   - Events are captured via the `onEvent` callback passed to `runTurn()`.\n   - Inside the `copilotSession.on()` handler, events are captured as `CapturedEvent` objects:\n     ```typescript\n     const captured: CapturedEvent = {\n         eventType: \"my.event_type\",\n         data: eventData,\n     };\n     collectedEvents.push(captured);\n     opts?.onEvent?.(captured);\n     ```\n\n2. **Persist to CMS** — events are automatically persisted by the activity in `src\u002Fsession-proxy.ts` via the `onEvent` callback, which calls `catalog.recordEvents()`. No changes needed unless you want special handling.\n\n3. **Filter in `PilotSwarmSession.on()`** — if the event needs special client-side filtering (e.g., excluding ephemeral events from persistence), add logic in `src\u002Fclient.ts`:\n   ```typescript\n   session.on(\"my.event_type\", (event) => { ... });\n   ```\n\n4. **Add a test** — verify the event appears in `session.getMessages()` and\u002For via `session.on()` polling.\n\n## Event naming conventions\n\n- Use dot-separated names: `category.action` (e.g., `assistant.message`, `tool.execution_start`).\n- Ephemeral events (like `assistant.message_delta`) should NOT be persisted to CMS — they are filtered out in `session-proxy.ts`.\n\n## Event flow\n\n```\nCopilotSession.on(event)           ← Copilot SDK fires event\n  ↓\nManagedSession captures as CapturedEvent\n  ↓\nonEvent callback → session-proxy.ts → catalog.recordEvents()   ← persisted to CMS\n  ↓\nPilotSwarmSession.on() polls CMS → delivers to client subscribers\n```\n\n## Key files\n- [src\u002Fmanaged-session.ts](..\u002F..\u002F..\u002Fsrc\u002Fmanaged-session.ts) — event capture during `runTurn()`\n- [src\u002Fsession-proxy.ts](..\u002F..\u002F..\u002Fsrc\u002Fsession-proxy.ts) — event persistence to CMS\n- [src\u002Fcms.ts](..\u002F..\u002F..\u002Fsrc\u002Fcms.ts) — `recordEvents()` and `getSessionEvents()`\n- [src\u002Fclient.ts](..\u002F..\u002F..\u002Fsrc\u002Fclient.ts) — `PilotSwarmSession.on()` polling and dispatch\n",{"name":5,"description":7},"main","cecafe1ca7a9f2778a6166abdd12f6165d99f777",".github\u002Fskills\u002Fadd-event",10,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-15 00:36:04",{"source":9,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add microsoft\u002FPilotSwarm --skill add-event",{"tool":60,"command":61},"bunx","bunx skills add microsoft\u002FPilotSwarm --skill add-event",{"tool":63,"command":64},"pnpm","pnpm dlx skills add microsoft\u002FPilotSwarm --skill add-event","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fadd-event\u002FSKILL.md",true,[],[69,77,84,91,98,105],{"skillNo":70,"name":71,"nameZh":17,"description":72,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":76},"01M760N7TCZBTY635MYZQ8YAB0","workflow-testing","Load before you test a Workflow with mocked effects — the test, test_respond and test_advance operations, fixtures, interception ids, valid answers, the virtual clock, test evidence and what a test run does not prove.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Ftest-mode-skills\u002Fworkflow-testing\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":78,"name":79,"nameZh":17,"description":80,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":76},"01M760N4RKD6BMYPGHD490SNN2","workflow-tools","Every argument of the Workflow tools, testing a revision, package definitions and the refusals you can fix. Load when a Workflow tool's short description is not enough.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-tools\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":17,"description":87,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":76},"01M760N1P2VTGVE6C4N5WF3FVR","workflow-reference","Field reference for Workflow YAML (root keys, every state type, bindings, outputs, runtime error codes), what the engine guarantees, and a review fan-out example. For design, call load_skill with name workflow-authoring.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-reference\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":17,"description":94,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":76},"01M760MZ5CFSAX4FYMEXZJBGM2","workflow-patterns","Load when one Workflow must run different nodes in its branches at the same time (a different prompt or model for each branch), or loops back to a state (a polling loop). Named branches, the router pattern, examples that compile.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-patterns\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":17,"description":101,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":76},"01M760MWKBDJFEECRFAF3BAVQ2","workflow-authoring","Load before you create, edit, publish or run a Workflow (pilotswarm.dev\u002Fv1) — choosing states, bounded graphs, bindings, typed contracts, agent and parallel states, the lifecycle and failure diagnosis.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-authoring\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":17,"description":108,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":76},"01M760MN4Y9199ARAY85DWD08X","tla-formal-validation","Required for any change to the core orchestrations (the durable session orchestration, session hydration and dehydration, and the Workflow controller and store). Teaches how to model the change in TLA+, update the existing models, run TLC with the repo runner, read the results, turn a counterexample into a fix and a regression test, and record the binding to the code.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftla-formal-validation\u002FSKILL.md",[],[]]