pi-harness-runtime 1.1.430 โ†’ 1.1.432

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/package.json +1 -1
  2. package/packages/a2a-adapter/package.json +1 -1
  3. package/packages/agent-policy/package.json +1 -1
  4. package/packages/architecture-generator/package.json +1 -1
  5. package/packages/auth/package.json +1 -1
  6. package/packages/autonomous-refactor/package.json +1 -1
  7. package/packages/autonomous-runtime/package.json +1 -1
  8. package/packages/cache-strategy/package.json +1 -1
  9. package/packages/capability-registry/package.json +1 -1
  10. package/packages/checkpoint/package.json +1 -1
  11. package/packages/cli-plugin-sdk/package.json +1 -1
  12. package/packages/clipboard/package.json +1 -1
  13. package/packages/clipboard-plugin/package.json +1 -1
  14. package/packages/code-generation/package.json +1 -1
  15. package/packages/code-review/package.json +1 -1
  16. package/packages/codex-adapter/package.json +1 -1
  17. package/packages/codex-watcher/package.json +1 -1
  18. package/packages/config-capture/package.json +1 -1
  19. package/packages/connection-runtime/package.json +1 -1
  20. package/packages/context-compiler/package.json +1 -1
  21. package/packages/context-discovery/package.json +1 -1
  22. package/packages/context-manager/package.json +1 -1
  23. package/packages/contracts/package.json +1 -1
  24. package/packages/cookie-sanitizer/package.json +1 -1
  25. package/packages/cost-optimizer/package.json +1 -1
  26. package/packages/dependency-analyzer/package.json +1 -1
  27. package/packages/django-plugin/package.json +1 -1
  28. package/packages/doc-generator/package.json +1 -1
  29. package/packages/durable-review/package.json +1 -1
  30. package/packages/e2e-tester/package.json +1 -1
  31. package/packages/evaluation-engine/package.json +1 -1
  32. package/packages/evaluation-runner/package.json +1 -1
  33. package/packages/event-bus/package.json +1 -1
  34. package/packages/event-sink/package.json +1 -1
  35. package/packages/event-store/package.json +1 -1
  36. package/packages/experience-replay/package.json +1 -1
  37. package/packages/feedback-collector/package.json +1 -1
  38. package/packages/file-copy-helper/package.json +1 -1
  39. package/packages/framework-detector/package.json +1 -1
  40. package/packages/framework-plugin-sdk/package.json +1 -1
  41. package/packages/frappe-plugin/package.json +1 -1
  42. package/packages/generic-web-plugin/package.json +1 -1
  43. package/packages/health-monitor/package.json +1 -1
  44. package/packages/intent-analyzer/package.json +1 -1
  45. package/packages/jev-judge/package.json +1 -1
  46. package/packages/knowledge-graph/package.json +1 -1
  47. package/packages/knowledge-retrieval/package.json +1 -1
  48. package/packages/laravel-plugin/package.json +1 -1
  49. package/packages/learning-engine/package.json +1 -1
  50. package/packages/logging/package.json +1 -1
  51. package/packages/mcp-adapter/package.json +1 -1
  52. package/packages/memory-engine/package.json +1 -1
  53. package/packages/milestone-manager/package.json +1 -1
  54. package/packages/model-registry/package.json +1 -1
  55. package/packages/nextjs-plugin/package.json +1 -1
  56. package/packages/notification/package.json +1 -1
  57. package/packages/observability/package.json +1 -1
  58. package/packages/okf-indexer/package.json +1 -1
  59. package/packages/paperclip-integration/package.json +1 -1
  60. package/packages/performance-optimizer/package.json +1 -1
  61. package/packages/permission-mode/package.json +1 -1
  62. package/packages/privilege-broker/package.json +1 -1
  63. package/packages/project-analyzer/package.json +1 -1
  64. package/packages/project-bootstrap/package.json +1 -1
  65. package/packages/projection-engine/package.json +1 -1
  66. package/packages/prompt-compiler/package.json +1 -1
  67. package/packages/prompt-versioning/package.json +1 -1
  68. package/packages/provider-adapter-sdk/package.json +1 -1
  69. package/packages/provider-router/package.json +1 -1
  70. package/packages/provider-selector/package.json +1 -1
  71. package/packages/providers/package.json +1 -1
  72. package/packages/qdrant-skills/package.json +1 -1
  73. package/packages/quota-manager/package.json +1 -1
  74. package/packages/rate-limiter/package.json +1 -1
  75. package/packages/react-vite-plugin/package.json +1 -1
  76. package/packages/relay/package.json +1 -1
  77. package/packages/release-manager/package.json +1 -1
  78. package/packages/requirement-compiler/package.json +1 -1
  79. package/packages/runtime/package.json +1 -1
  80. package/packages/scheduler/package.json +1 -1
  81. package/packages/scheduler-adapter/package.json +1 -1
  82. package/packages/session/package.json +1 -1
  83. package/packages/session-api/package.json +1 -1
  84. package/packages/session-export/package.json +1 -1
  85. package/packages/shared-context/package.json +1 -1
  86. package/packages/skill-mcp-client/package.json +1 -1
  87. package/packages/skill-registry/package.json +1 -1
  88. package/packages/skills/package.json +1 -1
  89. package/packages/sprint-planner/package.json +1 -1
  90. package/packages/subscription-engine/package.json +1 -1
  91. package/packages/task-compiler/package.json +1 -1
  92. package/packages/tencentdb-memory/package.json +1 -1
  93. package/packages/tencentdb-sync/package.json +1 -1
  94. package/packages/test-data-generator/package.json +1 -1
  95. package/packages/test-generator/package.json +1 -1
  96. package/packages/todo-bd-sync/package.json +1 -1
  97. package/packages/token-estimation/package.json +1 -1
  98. package/packages/token-optimizer/package.json +1 -1
  99. package/packages/tooling-preference/package.json +1 -1
  100. package/packages/trajectory/package.json +1 -1
  101. package/packages/tui/package.json +1 -1
  102. package/packages/two-phase-review/package.json +1 -1
  103. package/packages/types/package.json +1 -1
  104. package/packages/voice-api/package.json +1 -1
  105. package/packages/webmcp-tester/package.json +1 -1
  106. package/packages/wiki/package.json +1 -1
  107. package/packages/workflow-events/package.json +1 -1
  108. package/packages/workspace-scanner/package.json +1 -1
  109. package/packages/worktree/package.json +1 -1
  110. package/packages/write-review/package.json +1 -1
  111. package/packages/notification/adapters/email-adapter.ts +0 -126
  112. package/packages/notification/adapters/ntfy-adapter.ts +0 -100
  113. package/packages/notification/adapters/telegram-adapter.ts +0 -107
  114. package/packages/notification/adapters/webhook-adapter.ts +0 -75
  115. package/packages/notification/base-adapter.ts +0 -75
  116. package/packages/notification/index.ts +0 -51
  117. package/packages/notification/notification-center.ts +0 -286
  118. package/packages/notification/types.ts +0 -89
  119. package/packages/quota-manager/index.ts +0 -28
  120. package/packages/quota-manager/quota-manager.ts +0 -339
  121. package/packages/quota-manager/tui-usage-monitor.ts +0 -355
  122. package/packages/types/src/ai-providers.d.ts +0 -36
  123. package/packages/types/src/runtime-types.d.ts +0 -418
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/provider-adapter-sdk",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "SDK for building, testing, and registering AI provider adapters",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/provider-router",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Enhanced Provider Router for pi-harness-runtime โ€” intelligent routing with capabilities, costs, and quotas",
5
5
  "type": "module",
6
6
  "main": "./dist/provider-router.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/provider-selector",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Multi-Provider Selector โ€” route requests by cost, quality, and latency (RFC-0012)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/providers",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "pi-harness-runtime โ€” providers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/qdrant-skills",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Qdrant vector search integration for Hermes-style skill system",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/quota-manager",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "pi-harness-runtime โ€” quota-manager",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/rate-limiter",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "type": "module",
5
5
  "description": "Rate limiting with token bucket algorithm (RFC-0023)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/react-vite-plugin",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "React/Vite framework analysis โ€” components, config, TypeScript setup",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/relay",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "type": "module",
5
5
  "description": "Cloud relay for remote access - T3 Connect style for pi-harness",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/release-manager",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "type": "module",
5
5
  "description": "Release management for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/requirement-compiler",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Compiles raw requirements into validated CompiledRequirement with ambiguity detection and risk tagging",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/runtime",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "pi-harness-runtime โ€” runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/scheduler",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "pi-harness-runtime โ€” scheduler",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/scheduler-adapter",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Scheduler Adapter โ€” cron, systemd, launchd, internal adapters for autonomous runtime (RFC-0101 ยง6)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/session",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Session management system for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/session-api",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/session-export",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/shared-context",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "pi-harness-runtime โ€” shared-context",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/skill-mcp-client",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "MCP client for Skills SaaS backend",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/skill-registry",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Skill Registry for pi-harness-runtime โ€” dynamic skill discovery and invocation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/skills",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "File-based skill system with pi.dev compatibility and Hermes self-improvement",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/sprint-planner",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "type": "module",
5
5
  "description": "Sprint planning engine for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/subscription-engine",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/task-compiler",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Task Compiler for pi-harness-runtime โ€” produces deterministic task DAG from CompiledRequirement",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/tencentdb-memory",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "TencentDB Agent Memory client - sync skills to centralized knowledge base",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tencentdb-sync",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Sync SKILL.md skills to TencentDB-Agent-Memory server (RFC-0105/0106)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/test-data-generator",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Test data generation for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/test-generator",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Auto-Test Generator โ€” generate unit and E2E tests from source code (RFC-0013)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/todo-bd-sync",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Two-way sync between rpiv-todo overlay and bd issue tracker",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/token-estimation",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "pi-harness-runtime โ€” token-estimation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/token-optimizer",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Token Budget Optimizer โ€” maximize prompt value within token limits (RFC-0011)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tooling-preference",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "pi-harness-runtime โ€” JS/TS tooling preference (Biome vs ESLint/Prettier) proposal",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/trajectory",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Trajectory capture for the write-review loop โ€” persists cycle records for learning",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tui",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "pi-harness-runtime โ€” tui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/two-phase-review",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "pi-harness-runtime โ€” two-phase implementation and review workflow (queue review signals, gate the phase, scope the diff)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/types",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Shared TypeScript types for pi-harness-runtime packages",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/voice-api",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "type": "module",
5
5
  "description": "Voice-to-text API using Whisper for Telegram and LINE integration",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/webmcp-tester",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "WebMCP-powered E2E testing for pi-harness - natural language test scenarios",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/wiki",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "LLM Wiki integration for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/workflow-events",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/workspace-scanner",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/worktree",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "pi-harness-runtime โ€” worktree",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/write-review",
3
- "version": "1.1.430",
3
+ "version": "1.1.432",
4
4
  "description": "Two-agent write-review loop with blackboard coordination",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,126 +0,0 @@
1
- /**
2
- * Email Adapter โ€” RFC-0022
3
- *
4
- * Sends notifications via SMTP.
5
- */
6
-
7
- import type {
8
- NotificationPayload,
9
- NotificationResult,
10
- EmailConfig,
11
- } from "../types.js";
12
- import { BaseChannelAdapter } from "../base-adapter.js";
13
-
14
- // Simple SMTP client using built-in net module
15
- async function sendSmtpEmail(
16
- host: string,
17
- port: number,
18
- user: string,
19
- password: string,
20
- from: string,
21
- to: string[],
22
- subject: string,
23
- body: string,
24
- tls: boolean = false,
25
- ): Promise<void> {
26
- // For a production implementation, you'd use a proper SMTP library
27
- // This is a placeholder that logs the email
28
- console.log(`[Email] Would send to ${to.join(", ")}`);
29
- console.log(`[Email] Subject: ${subject}`);
30
- console.log(`[Email] Body: ${body}`);
31
-
32
- // In practice, you'd use something like:
33
- // import { createClient } from "nodemailer";
34
- // const transporter = nodemailer.createTransport({ ... });
35
- // await transporter.sendMail({ ... });
36
- }
37
-
38
- export class EmailAdapter extends BaseChannelAdapter {
39
- readonly id = "email";
40
- readonly type = "email";
41
-
42
- constructor(config: EmailConfig) {
43
- super({ id: "email", type: "email", enabled: true, config });
44
- }
45
-
46
- async initialize(): Promise<boolean> {
47
- // Verify SMTP connection
48
- try {
49
- const cfg = this.config.config as EmailConfig;
50
- // In production, verify SMTP credentials
51
- return Boolean(
52
- cfg.smtpHost && cfg.smtpUser && cfg.from && cfg.to.length > 0,
53
- );
54
- } catch {
55
- return false;
56
- }
57
- }
58
-
59
- async send(payload: NotificationPayload): Promise<NotificationResult> {
60
- try {
61
- const cfg = this.config.config as EmailConfig;
62
- const subject = `${this.getEmoji(payload.event)} ${payload.title}`;
63
- const body = this.formatBody(payload);
64
-
65
- await sendSmtpEmail(
66
- cfg.smtpHost,
67
- cfg.smtpPort,
68
- cfg.smtpUser,
69
- cfg.smtpPassword,
70
- cfg.from,
71
- cfg.to,
72
- subject,
73
- body,
74
- cfg.tls,
75
- );
76
-
77
- return { success: true, channel: this.id };
78
- } catch (error) {
79
- return {
80
- success: false,
81
- channel: this.id,
82
- error: String(error),
83
- };
84
- }
85
- }
86
-
87
- private formatBody(payload: NotificationPayload): string {
88
- const lines = [
89
- payload.message,
90
- "",
91
- "---",
92
- `Event: ${payload.event}`,
93
- `Time: ${payload.timestamp}`,
94
- ];
95
-
96
- if (payload.details?.taskTitle) {
97
- lines.push(`Task: ${payload.details.taskTitle}`);
98
- }
99
- if (payload.details?.jobId) {
100
- lines.push(`Job ID: ${payload.details.jobId}`);
101
- }
102
- if (payload.details?.error) {
103
- lines.push("", `Error: ${payload.details.error}`);
104
- }
105
-
106
- return lines.join("\n");
107
- }
108
-
109
- private getEmoji(event: NotificationPayload["event"]): string {
110
- const map: Record<string, string> = {
111
- JobStarted: "[๐Ÿš€]",
112
- TaskCompleted: "[โœ…]",
113
- TaskFailed: "[โŒ]",
114
- QuotaPaused: "[โธ]",
115
- ResumeScheduled: "[โ–ถ]",
116
- ContextCompacted: "[๐Ÿ“ฆ]",
117
- OutputLimitContinued: "[๐Ÿ”„]",
118
- E2EFailed: "[๐Ÿงช]",
119
- HumanReviewNeeded: "[๐Ÿ‘ค]",
120
- ReadyForClient: "[๐ŸŽ‰]",
121
- JobCancelled: "[๐Ÿšซ]",
122
- Error: "[โš ]",
123
- };
124
- return map[event] ?? "[๐Ÿ“ข]";
125
- }
126
- }
@@ -1,100 +0,0 @@
1
- /**
2
- * Ntfy Adapter โ€” RFC-0022
3
- *
4
- * Sends notifications via ntfy.sh (or self-hosted ntfy server).
5
- */
6
-
7
- import type {
8
- NotificationPayload,
9
- NotificationResult,
10
- NtfyConfig,
11
- } from "../types.js";
12
- import { BaseChannelAdapter } from "../base-adapter.js";
13
-
14
- export class NtfyAdapter extends BaseChannelAdapter {
15
- readonly id = "ntfy";
16
- readonly type = "ntfy";
17
-
18
- constructor(config: NtfyConfig) {
19
- super({ id: "ntfy", type: "ntfy", enabled: true, config });
20
- }
21
-
22
- async initialize(): Promise<boolean> {
23
- // Ntfy doesn't require initialization; it's fire-and-forget
24
- return true;
25
- }
26
-
27
- async send(payload: NotificationPayload): Promise<NotificationResult> {
28
- try {
29
- const cfg = this.config.config as NtfyConfig;
30
- const message = this.formatMessage(payload);
31
- const headers: Record<string, string> = {
32
- "Content-Type": "text/plain",
33
- Title: payload.title,
34
- Tags: this.getTags(payload.event),
35
- };
36
-
37
- // Add auth if configured
38
- if (cfg.authToken) {
39
- headers["Authorization"] = `Bearer ${cfg.authToken}`;
40
- }
41
-
42
- const response = await fetch(`${cfg.server}/${cfg.topic}`, {
43
- method: "POST",
44
- headers,
45
- body: message,
46
- });
47
-
48
- if (!response.ok) {
49
- const error = await response.text();
50
- return {
51
- success: false,
52
- channel: this.id,
53
- error: `Ntfy error: ${error}`,
54
- };
55
- }
56
-
57
- return { success: true, channel: this.id };
58
- } catch (error) {
59
- return {
60
- success: false,
61
- channel: this.id,
62
- error: String(error),
63
- };
64
- }
65
- }
66
-
67
- private formatMessage(payload: NotificationPayload): string {
68
- const lines = [payload.message];
69
-
70
- if (payload.details?.taskTitle) {
71
- lines.push(`\nTask: ${payload.details.taskTitle}`);
72
- }
73
- if (payload.details?.jobId) {
74
- lines.push(`Job: ${payload.details.jobId}`);
75
- }
76
- if (payload.details?.error) {
77
- lines.push(`\nError: ${payload.details.error}`);
78
- }
79
-
80
- return lines.join("");
81
- }
82
-
83
- private getTags(event: NotificationPayload["event"]): string {
84
- const map: Record<string, string> = {
85
- JobStarted: "rocket",
86
- TaskCompleted: "white_check_mark",
87
- TaskFailed: "x",
88
- QuotaPaused: "pause_button",
89
- ResumeScheduled: "play_button",
90
- ContextCompacted: "package",
91
- OutputLimitContinued: "repeat",
92
- E2EFailed: "test_tube",
93
- HumanReviewNeeded: "bust_in_silhouette",
94
- ReadyForClient: "tada",
95
- JobCancelled: "no_entry",
96
- Error: "warning",
97
- };
98
- return map[event] ?? "bell";
99
- }
100
- }