pi-harness-runtime 1.1.397 → 1.1.402
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.
- package/AGENTS.md +44 -2
- package/CHANGELOG.md +21 -0
- package/RULES.md +28 -0
- package/harness/agent-handoff.ts +2 -3
- package/harness/autonomous-review.ts +1 -1
- package/harness/blackboard.ts +2 -3
- package/harness/context-compact-orchestrator.ts +1 -1
- package/harness/context-window-manager.ts +2 -2
- package/harness/e2e/playwright-runner.ts +6 -4
- package/harness/herdr-agents.ts +1 -1
- package/harness/job-state-machine.ts +1 -1
- package/harness/langchain/daemon.ts +3 -3
- package/harness/langchain/graph.ts +2 -2
- package/harness/langchain/ping-pong-middleware.ts +2 -2
- package/harness/loop-code-agent.ts +6 -4
- package/harness/loop-controller.ts +1 -1
- package/harness/loop-review-agent.ts +1 -1
- package/harness/loop-types.ts +1 -1
- package/harness/master-planner.ts +1 -1
- package/harness/notification-events.ts +6 -6
- package/harness/project-detector/detector.ts +1 -2
- package/harness/repair-engine.ts +2 -4
- package/harness/service-diagnostics.ts +1 -1
- package/harness/skill-sync.ts +3 -3
- package/index.ts +276 -55
- package/mirror.ts +1 -1
- package/package.json +5 -3
- package/packages/a2a-adapter/dist/discovery.d.ts.map +1 -1
- package/packages/a2a-adapter/dist/discovery.js +0 -1
- package/packages/a2a-adapter/dist/discovery.js.map +1 -1
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/a2a-adapter/src/discovery.ts +0 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/architecture-generator/package.json +1 -1
- package/packages/auth/dist/index.d.ts +9 -0
- package/packages/auth/dist/index.d.ts.map +1 -0
- package/packages/auth/dist/index.js +9 -0
- package/packages/auth/dist/index.js.map +1 -0
- package/packages/auth/package.json +1 -1
- package/packages/auth/src/index.ts +9 -0
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard-plugin/package.json +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/dist/index.d.ts +52 -0
- package/packages/config-capture/dist/index.d.ts.map +1 -0
- package/packages/config-capture/dist/index.js +261 -0
- package/packages/config-capture/dist/index.js.map +1 -0
- package/packages/config-capture/package.json +1 -1
- package/packages/connection-runtime/package.json +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/package.json +1 -1
- package/packages/doc-generator/package.json +1 -1
- package/packages/durable-review/package.json +1 -1
- package/packages/e2e-tester/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-sink/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/feedback-collector/package.json +1 -1
- package/packages/file-copy-helper/dist/extension.d.ts +15 -0
- package/packages/file-copy-helper/dist/extension.d.ts.map +1 -0
- package/packages/file-copy-helper/dist/extension.debug.d.ts +15 -0
- package/packages/file-copy-helper/dist/extension.debug.d.ts.map +1 -0
- package/packages/file-copy-helper/dist/extension.debug.js +215 -0
- package/packages/file-copy-helper/dist/extension.debug.js.map +1 -0
- package/packages/file-copy-helper/dist/extension.js +222 -0
- package/packages/file-copy-helper/dist/extension.js.map +1 -0
- package/packages/file-copy-helper/dist/index.d.ts +3 -0
- package/packages/file-copy-helper/dist/index.d.ts.map +1 -0
- package/packages/file-copy-helper/dist/index.js +3 -0
- package/packages/file-copy-helper/dist/index.js.map +1 -0
- package/packages/file-copy-helper/dist/intent-detector.d.ts +21 -0
- package/packages/file-copy-helper/dist/intent-detector.d.ts.map +1 -0
- package/packages/file-copy-helper/dist/intent-detector.js +348 -0
- package/packages/file-copy-helper/dist/intent-detector.js.map +1 -0
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/health-monitor/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/dist/auto-continue.d.ts +161 -2
- package/packages/jev-judge/dist/auto-continue.d.ts.map +1 -1
- package/packages/jev-judge/dist/auto-continue.js +267 -22
- package/packages/jev-judge/dist/auto-continue.js.map +1 -1
- package/packages/jev-judge/dist/index.d.ts +2 -0
- package/packages/jev-judge/dist/index.d.ts.map +1 -1
- package/packages/jev-judge/dist/index.js +2 -0
- package/packages/jev-judge/dist/index.js.map +1 -1
- package/packages/jev-judge/dist/question-risk.d.ts +50 -0
- package/packages/jev-judge/dist/question-risk.d.ts.map +1 -0
- package/packages/jev-judge/dist/question-risk.js +100 -0
- package/packages/jev-judge/dist/question-risk.js.map +1 -0
- package/packages/jev-judge/package.json +1 -1
- package/packages/jev-judge/src/auto-continue.ts +426 -29
- package/packages/jev-judge/src/index.ts +4 -0
- package/packages/jev-judge/src/question-risk.ts +151 -0
- package/packages/jev-judge/tests/auto-continue-context.test.ts +221 -0
- package/packages/jev-judge/tests/outcome-application.test.ts +132 -0
- package/packages/jev-judge/tests/question-risk.test.ts +116 -0
- package/packages/knowledge-graph/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/logging/README.md +36 -3
- package/packages/logging/dist/config.d.ts +7 -0
- package/packages/logging/dist/config.d.ts.map +1 -1
- package/packages/logging/dist/config.js +14 -0
- package/packages/logging/dist/config.js.map +1 -1
- package/packages/logging/dist/incidents/schema.d.ts +111 -0
- package/packages/logging/dist/incidents/schema.d.ts.map +1 -0
- package/packages/logging/dist/incidents/schema.js +0 -0
- package/packages/logging/dist/incidents/schema.js.map +1 -0
- package/packages/logging/dist/index.d.ts +2 -0
- package/packages/logging/dist/index.d.ts.map +1 -1
- package/packages/logging/dist/index.js +2 -0
- package/packages/logging/dist/index.js.map +1 -1
- package/packages/logging/dist/server/http.d.ts +4 -3
- package/packages/logging/dist/server/http.d.ts.map +1 -1
- package/packages/logging/dist/server/http.js +35 -3
- package/packages/logging/dist/server/http.js.map +1 -1
- package/packages/logging/dist/server/incident-qdrant.d.ts +83 -0
- package/packages/logging/dist/server/incident-qdrant.d.ts.map +1 -0
- package/packages/logging/dist/server/incident-qdrant.js +129 -0
- package/packages/logging/dist/server/incident-qdrant.js.map +1 -0
- package/packages/logging/dist/server/incident-store.d.ts +76 -0
- package/packages/logging/dist/server/incident-store.d.ts.map +1 -0
- package/packages/logging/dist/server/incident-store.js +157 -0
- package/packages/logging/dist/server/incident-store.js.map +1 -0
- package/packages/logging/dist/server/index.d.ts +4 -0
- package/packages/logging/dist/server/index.d.ts.map +1 -1
- package/packages/logging/dist/server/index.js +2 -0
- package/packages/logging/dist/server/index.js.map +1 -1
- package/packages/logging/dist/server/service.d.ts +33 -0
- package/packages/logging/dist/server/service.d.ts.map +1 -1
- package/packages/logging/dist/server/service.js +63 -0
- package/packages/logging/dist/server/service.js.map +1 -1
- package/packages/logging/dist/shipper.d.ts +74 -3
- package/packages/logging/dist/shipper.d.ts.map +1 -1
- package/packages/logging/dist/shipper.js +88 -5
- package/packages/logging/dist/shipper.js.map +1 -1
- package/packages/logging/dist/singleton.d.ts.map +1 -1
- package/packages/logging/dist/singleton.js +1 -0
- package/packages/logging/dist/singleton.js.map +1 -1
- package/packages/logging/package.json +1 -1
- package/packages/logging/src/config.ts +22 -0
- package/packages/logging/src/incidents/schema.ts +0 -0
- package/packages/logging/src/index.ts +17 -0
- package/packages/logging/src/server/http.ts +42 -3
- package/packages/logging/src/server/incident-qdrant.ts +177 -0
- package/packages/logging/src/server/incident-store.ts +192 -0
- package/packages/logging/src/server/index.ts +21 -0
- package/packages/logging/src/server/service.ts +79 -0
- package/packages/logging/src/shipper.ts +120 -5
- package/packages/logging/src/singleton.ts +1 -0
- package/packages/logging/test/fanout.test.ts +186 -0
- package/packages/logging/test/incidents.test.ts +404 -0
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/milestone-manager/package.json +1 -1
- package/packages/model-registry/package.json +1 -1
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/notification/dist/adapters/detail-format.d.ts +42 -0
- package/packages/notification/dist/adapters/detail-format.d.ts.map +1 -0
- package/packages/notification/dist/adapters/detail-format.js +94 -0
- package/packages/notification/dist/adapters/detail-format.js.map +1 -0
- package/packages/notification/dist/adapters/email-adapter.d.ts.map +1 -1
- package/packages/notification/dist/adapters/email-adapter.js +3 -2
- package/packages/notification/dist/adapters/email-adapter.js.map +1 -1
- package/packages/notification/dist/adapters/line-adapter.d.ts +33 -0
- package/packages/notification/dist/adapters/line-adapter.d.ts.map +1 -1
- package/packages/notification/dist/adapters/line-adapter.js +87 -9
- package/packages/notification/dist/adapters/line-adapter.js.map +1 -1
- package/packages/notification/dist/adapters/ntfy-adapter.d.ts.map +1 -1
- package/packages/notification/dist/adapters/ntfy-adapter.js +3 -2
- package/packages/notification/dist/adapters/ntfy-adapter.js.map +1 -1
- package/packages/notification/dist/adapters/telegram-adapter.d.ts +14 -0
- package/packages/notification/dist/adapters/telegram-adapter.d.ts.map +1 -1
- package/packages/notification/dist/adapters/telegram-adapter.js +89 -69
- package/packages/notification/dist/adapters/telegram-adapter.js.map +1 -1
- package/packages/notification/dist/notification-center.d.ts.map +1 -1
- package/packages/notification/dist/notification-center.js +60 -7
- package/packages/notification/dist/notification-center.js.map +1 -1
- package/packages/notification/dist/pending-question.d.ts +69 -2
- package/packages/notification/dist/pending-question.d.ts.map +1 -1
- package/packages/notification/dist/pending-question.js +88 -2
- package/packages/notification/dist/pending-question.js.map +1 -1
- package/packages/notification/dist/types.d.ts +21 -0
- package/packages/notification/dist/types.d.ts.map +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/adapters/detail-format.ts +114 -0
- package/packages/notification/src/adapters/email-adapter.ts +3 -2
- package/packages/notification/src/adapters/line-adapter.ts +97 -9
- package/packages/notification/src/adapters/ntfy-adapter.ts +3 -2
- package/packages/notification/src/adapters/telegram-adapter.ts +98 -76
- package/packages/notification/src/notification-center.ts +66 -8
- package/packages/notification/src/pending-question.ts +160 -8
- package/packages/notification/src/types.ts +21 -0
- package/packages/notification/test/approval-payload.test.ts +269 -0
- package/packages/notification/test/detail-format.test.ts +106 -0
- package/packages/notification/test/pending-question-lifecycle.test.ts +195 -0
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/dist/index.d.ts +9 -0
- package/packages/okf-indexer/dist/index.d.ts.map +1 -0
- package/packages/okf-indexer/dist/index.js +9 -0
- package/packages/okf-indexer/dist/index.js.map +1 -0
- package/packages/okf-indexer/package.json +1 -1
- package/packages/okf-indexer/src/index.ts +9 -0
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/permission-mode/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-bootstrap/package.json +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-router/dist/provider-router.d.ts.map +1 -1
- package/packages/provider-router/dist/types.d.ts +2 -2
- package/packages/provider-router/dist/types.d.ts.map +1 -1
- package/packages/provider-router/dist/types.js +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-router/src/types.ts +2 -2
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/relay/package.json +1 -1
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/scheduler/dist/index.d.ts +9 -0
- package/packages/scheduler/dist/index.d.ts.map +1 -0
- package/packages/scheduler/dist/index.js +9 -0
- package/packages/scheduler/dist/index.js.map +1 -0
- package/packages/scheduler/dist/scheduler.d.ts +17 -0
- package/packages/scheduler/dist/scheduler.d.ts.map +1 -0
- package/packages/scheduler/dist/scheduler.js +41 -0
- package/packages/scheduler/dist/scheduler.js.map +1 -0
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler/src/index.ts +9 -0
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/dist/index.d.ts +7 -0
- package/packages/shared-context/dist/index.d.ts.map +1 -0
- package/packages/shared-context/dist/index.js +7 -0
- package/packages/shared-context/dist/index.js.map +1 -0
- package/packages/shared-context/dist/shared-context.d.ts +12 -0
- package/packages/shared-context/dist/shared-context.d.ts.map +1 -0
- package/packages/shared-context/dist/shared-context.js +39 -0
- package/packages/shared-context/dist/shared-context.js.map +1 -0
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-mcp-client/dist/client.d.ts +56 -0
- package/packages/skill-mcp-client/dist/client.d.ts.map +1 -0
- package/packages/skill-mcp-client/dist/client.js +101 -0
- package/packages/skill-mcp-client/dist/client.js.map +1 -0
- package/packages/skill-mcp-client/dist/errors.d.ts +44 -0
- package/packages/skill-mcp-client/dist/errors.d.ts.map +1 -0
- package/packages/skill-mcp-client/dist/errors.js +68 -0
- package/packages/skill-mcp-client/dist/errors.js.map +1 -0
- package/packages/skill-mcp-client/dist/index.d.ts +9 -0
- package/packages/skill-mcp-client/dist/index.d.ts.map +1 -0
- package/packages/skill-mcp-client/dist/index.js +9 -0
- package/packages/skill-mcp-client/dist/index.js.map +1 -0
- package/packages/skill-mcp-client/dist/types.d.ts +106 -0
- package/packages/skill-mcp-client/dist/types.d.ts.map +1 -0
- package/packages/skill-mcp-client/dist/types.js +14 -0
- package/packages/skill-mcp-client/dist/types.js.map +1 -0
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/skills/package.json +1 -5
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/package.json +1 -1
- package/packages/telegram/package.json +1 -1
- package/packages/telegram/src/agent-messages.d.ts +28 -0
- package/packages/telegram/src/agent-messages.js +90 -0
- package/packages/telegram/src/bindings.d.ts +296 -0
- package/packages/telegram/src/bindings.js +1086 -0
- package/packages/telegram/src/bus.d.ts +759 -0
- package/packages/telegram/src/bus.js +2732 -0
- package/packages/telegram/src/commands.d.ts +761 -0
- package/packages/telegram/src/commands.js +2622 -0
- package/packages/telegram/src/config.d.ts +222 -0
- package/packages/telegram/src/config.js +844 -0
- package/packages/telegram/src/delivery.d.ts +161 -0
- package/packages/telegram/src/delivery.js +550 -0
- package/packages/telegram/src/extension.d.ts +7 -0
- package/packages/telegram/src/extension.js +2444 -0
- package/packages/telegram/src/inbound.d.ts +94 -0
- package/packages/telegram/src/inbound.js +478 -0
- package/packages/telegram/src/index.d.ts +6 -0
- package/packages/telegram/src/index.js +6 -0
- package/packages/telegram/src/keyboard.d.ts +21 -0
- package/packages/telegram/src/keyboard.js +37 -0
- package/packages/telegram/src/lifecycle.d.ts +210 -0
- package/packages/telegram/src/lifecycle.js +538 -0
- package/packages/telegram/src/pi.d.ts +76 -0
- package/packages/telegram/src/pi.js +130 -0
- package/packages/telegram/src/polling.d.ts +332 -0
- package/packages/telegram/src/polling.js +1219 -0
- package/packages/telegram/src/replies.d.ts +210 -0
- package/packages/telegram/src/replies.js +752 -0
- package/packages/telegram/src/routing.d.ts +388 -0
- package/packages/telegram/src/routing.js +7886 -0
- package/packages/telegram/src/runtime.d.ts +159 -0
- package/packages/telegram/src/runtime.js +351 -0
- package/packages/telegram/src/telegram-api.d.ts +564 -0
- package/packages/telegram/src/telegram-api.js +1332 -0
- package/packages/telegram/src/turns.d.ts +108 -0
- package/packages/telegram/src/turns.js +482 -0
- package/packages/telegram/src/updates.d.ts +1545 -0
- package/packages/telegram/src/updates.js +6420 -0
- package/packages/tencentdb-memory/package.json +1 -1
- package/packages/tencentdb-sync/package.json +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/todo-bd-sync/dist/detector.d.ts +54 -0
- package/packages/todo-bd-sync/dist/detector.d.ts.map +1 -0
- package/packages/todo-bd-sync/dist/detector.js +132 -0
- package/packages/todo-bd-sync/dist/detector.js.map +1 -0
- package/packages/todo-bd-sync/dist/extension.d.ts +30 -0
- package/packages/todo-bd-sync/dist/extension.d.ts.map +1 -0
- package/packages/todo-bd-sync/dist/extension.js +35 -0
- package/packages/todo-bd-sync/dist/extension.js.map +1 -0
- package/packages/todo-bd-sync/dist/index.d.ts +87 -0
- package/packages/todo-bd-sync/dist/index.d.ts.map +1 -0
- package/packages/todo-bd-sync/dist/index.js +296 -0
- package/packages/todo-bd-sync/dist/index.js.map +1 -0
- package/packages/todo-bd-sync/dist/sync.d.ts +72 -0
- package/packages/todo-bd-sync/dist/sync.d.ts.map +1 -0
- package/packages/todo-bd-sync/dist/sync.js +290 -0
- package/packages/todo-bd-sync/dist/sync.js.map +1 -0
- package/packages/todo-bd-sync/dist/task-analyzer.d.ts +49 -0
- package/packages/todo-bd-sync/dist/task-analyzer.d.ts.map +1 -0
- package/packages/todo-bd-sync/dist/task-analyzer.js +240 -0
- package/packages/todo-bd-sync/dist/task-analyzer.js.map +1 -0
- package/packages/todo-bd-sync/dist/todo-reminder.d.ts +126 -0
- package/packages/todo-bd-sync/dist/todo-reminder.d.ts.map +1 -0
- package/packages/todo-bd-sync/dist/todo-reminder.js +329 -0
- package/packages/todo-bd-sync/dist/todo-reminder.js.map +1 -0
- package/packages/todo-bd-sync/dist/types.d.ts +65 -0
- package/packages/todo-bd-sync/dist/types.d.ts.map +1 -0
- package/packages/todo-bd-sync/dist/types.js +67 -0
- package/packages/todo-bd-sync/dist/types.js.map +1 -0
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/dist/index.d.ts +94 -0
- package/packages/token-estimation/dist/index.d.ts.map +1 -0
- package/packages/token-estimation/dist/index.js +115 -0
- package/packages/token-estimation/dist/index.js.map +1 -0
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/types/dist/ai-providers.d.ts +36 -0
- package/packages/types/dist/ai-providers.d.ts.map +1 -0
- package/packages/types/dist/ai-providers.js +66 -0
- package/packages/types/dist/ai-providers.js.map +1 -0
- package/packages/types/dist/index.d.ts +12 -0
- package/packages/types/dist/index.d.ts.map +1 -0
- package/packages/types/dist/index.js +12 -0
- package/packages/types/dist/index.js.map +1 -0
- package/packages/types/package.json +5 -5
- package/packages/types/src/index.ts +12 -0
- package/packages/voice-api/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/wiki/package.json +1 -1
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/packages/worktree/worktree.ts +1 -1
- package/packages/write-review/package.json +1 -1
- package/renderer.ts +1 -1
- package/scripts/build-packages.ts +162 -0
- package/scripts/relay-client.ts +2 -2
- package/scripts/typecheck-packages.mjs +3 -3
- package/scripts/unified-webhook-server.ts +22 -10
- package/scripts/verify-package-contents.ts +345 -0
- package/scripts/ws-server.ts +1 -1
- package/tracker.ts +1 -1
- package/harness/browser-scrapers/base-browser-scraper.d.ts +0 -91
- package/harness/browser-scrapers/chrome-profile-manager.d.ts +0 -80
- package/harness/browser-scrapers/codex-browser-scraper.d.ts +0 -60
- package/harness/browser-scrapers/index.d.ts +0 -29
- package/harness/browser-scrapers/zai-browser-scraper.d.ts +0 -79
- package/harness/e2e/browser-scrapers/base-browser-scraper.d.ts +0 -92
- package/harness/e2e/browser-scrapers/chrome-profile-manager.d.ts +0 -81
- package/harness/e2e/browser-scrapers/codex-browser-scraper.d.ts +0 -61
- package/harness/e2e/browser-scrapers/index.d.ts +0 -30
- package/harness/e2e/browser-scrapers/zai-browser-scraper.d.ts +0 -80
- package/harness/langchain/agents.d.ts +0 -143
- package/harness/langchain/agents.test.d.ts +0 -2
- package/harness/langchain/checkpointer.d.ts +0 -48
- package/harness/langchain/checkpointer.test.d.ts +0 -8
- package/harness/langchain/cron-cli.d.ts +0 -12
- package/harness/langchain/daemon.d.ts +0 -161
- package/harness/langchain/daemon.test.d.ts +0 -11
- package/harness/langchain/file-tools.d.ts +0 -97
- package/harness/langchain/graph.d.ts +0 -706
- package/harness/langchain/model-router.d.ts +0 -63
- package/harness/langchain/model-router.test.d.ts +0 -2
- package/harness/langchain/models.d.ts +0 -72
- package/harness/langchain/ping-pong-middleware.d.ts +0 -28
- package/harness/langchain/ping-pong-middleware.test.d.ts +0 -2
- package/harness/langchain/run.d.ts +0 -15
- package/harness/langchain/scoreboard.test.d.ts +0 -13
- package/harness/langchain/status-line.d.ts +0 -91
- package/harness/langchain/status-line.test.d.ts +0 -8
- package/harness/langchain/surge.d.ts +0 -111
- package/harness/langchain/surge.test.d.ts +0 -10
- package/harness/langchain/widget.d.ts +0 -105
- package/harness/langchain/widget.test.d.ts +0 -8
- package/packages/autonomous-runtime/dist/worker.d.ts +0 -63
- package/packages/autonomous-runtime/dist/worker.js +0 -133
- package/packages/capability-registry/src/types.d.ts +0 -47
- package/packages/clipboard/dist/clipboard.d.ts +0 -11
- package/packages/clipboard/dist/clipboard.js +0 -40
- package/packages/clipboard/dist/index.d.ts +0 -2
- package/packages/clipboard/dist/index.js +0 -2
- package/packages/clipboard/dist/types.d.ts +0 -13
- package/packages/clipboard/dist/types.js +0 -5
- package/packages/context-discovery/dist/discover.d.ts +0 -3
- package/packages/context-discovery/dist/discover.js +0 -42
- package/packages/context-discovery/dist/discovery.d.ts +0 -28
- package/packages/context-discovery/dist/discovery.js +0 -21
- package/packages/context-discovery/dist/index.d.ts +0 -3
- package/packages/context-discovery/dist/index.js +0 -2
- package/packages/context-discovery/dist/types.d.ts +0 -16
- package/packages/context-discovery/dist/types.js +0 -2
- package/packages/event-bus/dist/bus.d.ts +0 -15
- package/packages/event-bus/dist/bus.js +0 -90
- package/packages/event-bus/dist/index.d.ts +0 -4
- package/packages/event-bus/dist/index.js +0 -3
- package/packages/event-bus/dist/test/bus.test.js +0 -52
- package/packages/event-bus/dist/types.d.ts +0 -27
- package/packages/event-bus/dist/types.js +0 -10
- package/packages/event-store/dist/index.d.ts +0 -3
- package/packages/event-store/dist/index.js +0 -2
- package/packages/event-store/dist/store.d.ts +0 -15
- package/packages/event-store/dist/store.js +0 -131
- package/packages/event-store/dist/test/store.test.js +0 -57
- package/packages/event-store/dist/types.d.ts +0 -48
- package/packages/event-store/dist/types.js +0 -5
- package/packages/event-store/src/types.d.ts +0 -48
- package/packages/file-copy-helper/dist/src/extension.js +0 -186
- package/packages/model-registry/src/types.d.ts +0 -63
- package/packages/notification/dist/src/adapters/email-adapter.d.ts +0 -17
- package/packages/notification/dist/src/adapters/email-adapter.d.ts.map +0 -1
- package/packages/notification/dist/src/adapters/email-adapter.js +0 -89
- package/packages/notification/dist/src/adapters/email-adapter.js.map +0 -1
- package/packages/notification/dist/src/adapters/line-adapter.d.ts +0 -17
- package/packages/notification/dist/src/adapters/line-adapter.d.ts.map +0 -1
- package/packages/notification/dist/src/adapters/line-adapter.js +0 -99
- package/packages/notification/dist/src/adapters/line-adapter.js.map +0 -1
- package/packages/notification/dist/src/adapters/ntfy-adapter.d.ts +0 -17
- package/packages/notification/dist/src/adapters/ntfy-adapter.d.ts.map +0 -1
- package/packages/notification/dist/src/adapters/ntfy-adapter.js +0 -84
- package/packages/notification/dist/src/adapters/ntfy-adapter.js.map +0 -1
- package/packages/notification/dist/src/adapters/telegram-adapter.d.ts +0 -56
- package/packages/notification/dist/src/adapters/telegram-adapter.d.ts.map +0 -1
- package/packages/notification/dist/src/adapters/telegram-adapter.js +0 -251
- package/packages/notification/dist/src/adapters/telegram-adapter.js.map +0 -1
- package/packages/notification/dist/src/adapters/webhook-adapter.d.ts +0 -15
- package/packages/notification/dist/src/adapters/webhook-adapter.d.ts.map +0 -1
- package/packages/notification/dist/src/adapters/webhook-adapter.js +0 -64
- package/packages/notification/dist/src/adapters/webhook-adapter.js.map +0 -1
- package/packages/notification/dist/src/base-adapter.d.ts +0 -36
- package/packages/notification/dist/src/base-adapter.d.ts.map +0 -1
- package/packages/notification/dist/src/base-adapter.js +0 -39
- package/packages/notification/dist/src/base-adapter.js.map +0 -1
- package/packages/notification/dist/src/index.d.ts +0 -12
- package/packages/notification/dist/src/index.d.ts.map +0 -1
- package/packages/notification/dist/src/index.js +0 -12
- package/packages/notification/dist/src/index.js.map +0 -1
- package/packages/notification/dist/src/notification-center.d.ts +0 -89
- package/packages/notification/dist/src/notification-center.d.ts.map +0 -1
- package/packages/notification/dist/src/notification-center.js +0 -356
- package/packages/notification/dist/src/notification-center.js.map +0 -1
- package/packages/notification/dist/src/notification-policy.d.ts +0 -66
- package/packages/notification/dist/src/notification-policy.d.ts.map +0 -1
- package/packages/notification/dist/src/notification-policy.js +0 -153
- package/packages/notification/dist/src/notification-policy.js.map +0 -1
- package/packages/notification/dist/src/telegram-webhook-handler.d.ts +0 -86
- package/packages/notification/dist/src/telegram-webhook-handler.d.ts.map +0 -1
- package/packages/notification/dist/src/telegram-webhook-handler.js +0 -149
- package/packages/notification/dist/src/telegram-webhook-handler.js.map +0 -1
- package/packages/notification/dist/src/types.d.ts +0 -106
- package/packages/notification/dist/src/types.d.ts.map +0 -1
- package/packages/notification/dist/src/types.js +0 -7
- package/packages/notification/dist/src/types.js.map +0 -1
- package/packages/projection-engine/dist/engine.d.ts +0 -61
- package/packages/projection-engine/dist/engine.js +0 -76
- package/packages/projection-engine/dist/index.d.ts +0 -2
- package/packages/projection-engine/dist/index.js +0 -2
- package/packages/projection-engine/dist/project.d.ts +0 -3
- package/packages/projection-engine/dist/project.js +0 -24
- package/packages/projection-engine/dist/types.d.ts +0 -55
- package/packages/projection-engine/dist/types.js +0 -5
- package/packages/projection-engine/src/types.d.ts +0 -55
- package/packages/provider-adapter-sdk/dist/src/builder.d.ts +0 -140
- package/packages/provider-adapter-sdk/dist/src/builder.d.ts.map +0 -1
- package/packages/provider-adapter-sdk/dist/src/builder.js +0 -332
- package/packages/provider-adapter-sdk/dist/src/builder.js.map +0 -1
- package/packages/provider-adapter-sdk/dist/src/errors.d.ts +0 -71
- package/packages/provider-adapter-sdk/dist/src/errors.d.ts.map +0 -1
- package/packages/provider-adapter-sdk/dist/src/errors.js +0 -111
- package/packages/provider-adapter-sdk/dist/src/errors.js.map +0 -1
- package/packages/provider-adapter-sdk/dist/src/index.d.ts +0 -15
- package/packages/provider-adapter-sdk/dist/src/index.d.ts.map +0 -1
- package/packages/provider-adapter-sdk/dist/src/index.js +0 -19
- package/packages/provider-adapter-sdk/dist/src/index.js.map +0 -1
- package/packages/provider-adapter-sdk/dist/src/registry.d.ts +0 -108
- package/packages/provider-adapter-sdk/dist/src/registry.d.ts.map +0 -1
- package/packages/provider-adapter-sdk/dist/src/registry.js +0 -301
- package/packages/provider-adapter-sdk/dist/src/registry.js.map +0 -1
- package/packages/provider-adapter-sdk/dist/src/tester.d.ts +0 -71
- package/packages/provider-adapter-sdk/dist/src/tester.d.ts.map +0 -1
- package/packages/provider-adapter-sdk/dist/src/tester.js +0 -392
- package/packages/provider-adapter-sdk/dist/src/tester.js.map +0 -1
- package/packages/provider-adapter-sdk/dist/src/types.d.ts +0 -182
- package/packages/provider-adapter-sdk/dist/src/types.d.ts.map +0 -1
- package/packages/provider-adapter-sdk/dist/src/types.js +0 -11
- package/packages/provider-adapter-sdk/dist/src/types.js.map +0 -1
- package/packages/provider-router/dist/capability-registry/src/types.d.ts +0 -47
- package/packages/provider-router/dist/capability-registry/src/types.d.ts.map +0 -1
- package/packages/provider-router/dist/capability-registry/src/types.js +0 -10
- package/packages/provider-router/dist/capability-registry/src/types.js.map +0 -1
- package/packages/provider-router/dist/provider-router/src/index.d.ts +0 -23
- package/packages/provider-router/dist/provider-router/src/index.d.ts.map +0 -1
- package/packages/provider-router/dist/provider-router/src/index.js +0 -25
- package/packages/provider-router/dist/provider-router/src/index.js.map +0 -1
- package/packages/provider-router/dist/provider-router/src/policy.d.ts +0 -10
- package/packages/provider-router/dist/provider-router/src/policy.d.ts.map +0 -1
- package/packages/provider-router/dist/provider-router/src/policy.js +0 -45
- package/packages/provider-router/dist/provider-router/src/policy.js.map +0 -1
- package/packages/provider-router/dist/provider-router/src/provider-router.d.ts +0 -56
- package/packages/provider-router/dist/provider-router/src/provider-router.d.ts.map +0 -1
- package/packages/provider-router/dist/provider-router/src/provider-router.js +0 -222
- package/packages/provider-router/dist/provider-router/src/provider-router.js.map +0 -1
- package/packages/provider-router/dist/provider-router/src/strategies.d.ts +0 -19
- package/packages/provider-router/dist/provider-router/src/strategies.d.ts.map +0 -1
- package/packages/provider-router/dist/provider-router/src/strategies.js +0 -110
- package/packages/provider-router/dist/provider-router/src/strategies.js.map +0 -1
- package/packages/provider-router/dist/provider-router/src/types.d.ts +0 -91
- package/packages/provider-router/dist/provider-router/src/types.d.ts.map +0 -1
- package/packages/provider-router/dist/provider-router/src/types.js +0 -10
- package/packages/provider-router/dist/provider-router/src/types.js.map +0 -1
- package/packages/provider-router/dist/src/index.d.ts +0 -23
- package/packages/provider-router/dist/src/index.d.ts.map +0 -1
- package/packages/provider-router/dist/src/index.js +0 -25
- package/packages/provider-router/dist/src/index.js.map +0 -1
- package/packages/provider-router/dist/src/policy.d.ts +0 -10
- package/packages/provider-router/dist/src/policy.d.ts.map +0 -1
- package/packages/provider-router/dist/src/policy.js +0 -45
- package/packages/provider-router/dist/src/policy.js.map +0 -1
- package/packages/provider-router/dist/src/provider-router.d.ts +0 -56
- package/packages/provider-router/dist/src/provider-router.d.ts.map +0 -1
- package/packages/provider-router/dist/src/provider-router.js +0 -222
- package/packages/provider-router/dist/src/provider-router.js.map +0 -1
- package/packages/provider-router/dist/src/strategies.d.ts +0 -19
- package/packages/provider-router/dist/src/strategies.d.ts.map +0 -1
- package/packages/provider-router/dist/src/strategies.js +0 -110
- package/packages/provider-router/dist/src/strategies.js.map +0 -1
- package/packages/provider-router/dist/src/types.d.ts +0 -91
- package/packages/provider-router/dist/src/types.d.ts.map +0 -1
- package/packages/provider-router/dist/src/types.js +0 -10
- package/packages/provider-router/dist/src/types.js.map +0 -1
- package/packages/provider-router/dist/types/src/runtime-types.d.ts +0 -412
- package/packages/provider-router/dist/types/src/runtime-types.d.ts.map +0 -1
- package/packages/provider-router/dist/types/src/runtime-types.js +0 -2
- package/packages/provider-router/dist/types/src/runtime-types.js.map +0 -1
- package/packages/session-api/dist/api.d.ts +0 -83
- package/packages/session-api/dist/api.js +0 -35
- package/packages/session-api/dist/index.d.ts +0 -2
- package/packages/session-api/dist/index.js +0 -2
- package/packages/session-api/dist/types.d.ts +0 -22
- package/packages/session-api/dist/types.js +0 -5
- package/packages/session-export/dist/exporter.d.ts +0 -28
- package/packages/session-export/dist/exporter.js +0 -38
- package/packages/session-export/dist/index.d.ts +0 -2
- package/packages/session-export/dist/index.js +0 -2
- package/packages/session-export/dist/types.d.ts +0 -20
- package/packages/session-export/dist/types.js +0 -5
- package/packages/subscription-engine/dist/engine.d.ts +0 -13
- package/packages/subscription-engine/dist/engine.js +0 -40
- package/packages/subscription-engine/dist/index.d.ts +0 -2
- package/packages/subscription-engine/dist/index.js +0 -2
- package/packages/subscription-engine/dist/subscriptions.d.ts +0 -19
- package/packages/subscription-engine/dist/subscriptions.js +0 -32
- package/packages/subscription-engine/dist/types.d.ts +0 -24
- package/packages/subscription-engine/dist/types.js +0 -5
- package/packages/trajectory/test/store.test.d.ts +0 -2
- package/packages/workflow-events/dist/events.d.ts +0 -38
- package/packages/workflow-events/dist/events.js +0 -46
- package/packages/workflow-events/dist/index.d.ts +0 -2
- package/packages/workflow-events/dist/index.js +0 -2
- package/packages/workflow-events/dist/pipeline.d.ts +0 -21
- package/packages/workflow-events/dist/pipeline.js +0 -27
- package/packages/workflow-events/dist/types.d.ts +0 -110
- package/packages/workflow-events/dist/types.js +0 -5
- package/packages/workflow-events/src/types.d.ts +0 -110
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill MCP Client Types (RFC-0106)
|
|
3
|
+
*/
|
|
4
|
+
// Error codes
|
|
5
|
+
export const ErrorCodes = {
|
|
6
|
+
INVALID_REQUEST: -32600,
|
|
7
|
+
INVALID_PARAMS: -32602,
|
|
8
|
+
METHOD_NOT_FOUND: -32601,
|
|
9
|
+
UNAUTHORIZED: -32001,
|
|
10
|
+
TIER_RESTRICTED: -32002,
|
|
11
|
+
NOT_FOUND: -32003,
|
|
12
|
+
RATE_LIMITED: -32004,
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AA6GH,cAAc;AACd,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,eAAe,EAAE,CAAC,KAAK;IACvB,cAAc,EAAE,CAAC,KAAK;IACtB,gBAAgB,EAAE,CAAC,KAAK;IACxB,YAAY,EAAE,CAAC,KAAK;IACpB,eAAe,EAAE,CAAC,KAAK;IACvB,SAAS,EAAE,CAAC,KAAK;IACjB,YAAY,EAAE,CAAC,KAAK;CACZ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/skills",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.402",
|
|
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",
|
|
@@ -22,10 +22,6 @@
|
|
|
22
22
|
"import": "./src/scanner.ts",
|
|
23
23
|
"types": "./src/scanner.ts"
|
|
24
24
|
},
|
|
25
|
-
"./registry": {
|
|
26
|
-
"import": "./src/registry.ts",
|
|
27
|
-
"types": "./src/registry.ts"
|
|
28
|
-
},
|
|
29
25
|
"./loader": {
|
|
30
26
|
"import": "./src/loader.ts",
|
|
31
27
|
"types": "./src/loader.ts"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-instance Telegram agent message resolution and turn injection
|
|
3
|
+
* Zones: multi-instance bus, inbound routing, operational delivery
|
|
4
|
+
* Owns live target resolution, source attribution, same-target fencing, and synthetic turn construction; excludes Bot API delivery and bus transport.
|
|
5
|
+
*/
|
|
6
|
+
import type { TelegramBusAgentMessage, TelegramBusAgentTargetSelector, TelegramBusFollowerRegistry } from "./bus.ts";
|
|
7
|
+
import type { TelegramTarget } from "./target.ts";
|
|
8
|
+
export interface TelegramAgentMessageRuntimeDeps<TContext, TUpdate> {
|
|
9
|
+
instanceId: string;
|
|
10
|
+
getAllowedChatId: () => number | undefined;
|
|
11
|
+
getLeaderTarget: () => TelegramTarget | undefined;
|
|
12
|
+
getLeaderThreadName: () => string | undefined;
|
|
13
|
+
getDisplayTitle?: (target: TelegramTarget) => string | undefined;
|
|
14
|
+
followerRegistry: TelegramBusFollowerRegistry;
|
|
15
|
+
getContext: () => TContext | undefined;
|
|
16
|
+
handleUpdate: (update: TUpdate, ctx: TContext) => Promise<void>;
|
|
17
|
+
getNowMs?: () => number;
|
|
18
|
+
}
|
|
19
|
+
export declare function createTelegramAgentMessageRuntime<TContext, TUpdate>(deps: TelegramAgentMessageRuntimeDeps<TContext, TUpdate>): {
|
|
20
|
+
resolveTarget: (selector: TelegramBusAgentTargetSelector, sourceTarget?: TelegramTarget) => (TelegramTarget & {
|
|
21
|
+
threadId: number;
|
|
22
|
+
}) | undefined;
|
|
23
|
+
route(input: {
|
|
24
|
+
sourceTarget?: TelegramTarget;
|
|
25
|
+
sourceThreadName?: string;
|
|
26
|
+
message: TelegramBusAgentMessage;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-instance Telegram agent message resolution and turn injection
|
|
3
|
+
* Zones: multi-instance bus, inbound routing, operational delivery
|
|
4
|
+
* Owns live target resolution, source attribution, same-target fencing, and synthetic turn construction; excludes Bot API delivery and bus transport.
|
|
5
|
+
*/
|
|
6
|
+
import { TELEGRAM_INTERNAL_AGENT_MESSAGE } from "./updates.js";
|
|
7
|
+
export function createTelegramAgentMessageRuntime(deps) {
|
|
8
|
+
const getNowMs = deps.getNowMs ?? Date.now;
|
|
9
|
+
const sameTarget = (left, right) => left?.chatId === right?.chatId && left?.threadId === right?.threadId;
|
|
10
|
+
const listLiveTargets = () => {
|
|
11
|
+
const targets = [];
|
|
12
|
+
const leaderTarget = deps.getLeaderTarget();
|
|
13
|
+
if (leaderTarget?.threadId) {
|
|
14
|
+
targets.push({
|
|
15
|
+
target: {
|
|
16
|
+
chatId: leaderTarget.chatId,
|
|
17
|
+
threadId: leaderTarget.threadId,
|
|
18
|
+
},
|
|
19
|
+
threadName: deps.getDisplayTitle?.(leaderTarget) ?? deps.getLeaderThreadName(),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
for (const follower of deps.followerRegistry.list()) {
|
|
23
|
+
if (!follower.target?.threadId)
|
|
24
|
+
continue;
|
|
25
|
+
targets.push({
|
|
26
|
+
target: {
|
|
27
|
+
chatId: follower.target.chatId,
|
|
28
|
+
threadId: follower.target.threadId,
|
|
29
|
+
},
|
|
30
|
+
threadName: deps.getDisplayTitle?.(follower.target) ?? follower.threadName,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return targets;
|
|
34
|
+
};
|
|
35
|
+
const resolveTarget = (selector, sourceTarget) => {
|
|
36
|
+
const allowedChatId = deps.getAllowedChatId();
|
|
37
|
+
const chatId = selector.chatId ?? allowedChatId;
|
|
38
|
+
if (chatId === undefined || chatId !== allowedChatId)
|
|
39
|
+
return undefined;
|
|
40
|
+
const matches = listLiveTargets().filter((candidate) => {
|
|
41
|
+
if (candidate.target.chatId !== chatId)
|
|
42
|
+
return false;
|
|
43
|
+
if (selector.threadId !== undefined) {
|
|
44
|
+
return candidate.target.threadId === selector.threadId;
|
|
45
|
+
}
|
|
46
|
+
const requestedName = selector.threadName?.trim().toLocaleLowerCase();
|
|
47
|
+
return (requestedName !== undefined &&
|
|
48
|
+
requestedName.length > 0 &&
|
|
49
|
+
candidate.threadName?.trim().toLocaleLowerCase() === requestedName);
|
|
50
|
+
});
|
|
51
|
+
if (matches.length !== 1)
|
|
52
|
+
return undefined;
|
|
53
|
+
return sameTarget(matches[0].target, sourceTarget)
|
|
54
|
+
? undefined
|
|
55
|
+
: matches[0].target;
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
resolveTarget,
|
|
59
|
+
async route(input) {
|
|
60
|
+
const target = resolveTarget({
|
|
61
|
+
chatId: input.message.target.chatId,
|
|
62
|
+
threadId: input.message.target.threadId,
|
|
63
|
+
}, input.sourceTarget);
|
|
64
|
+
if (!target)
|
|
65
|
+
throw new Error("Telegram agent target is no longer live.");
|
|
66
|
+
const allowedChatId = deps.getAllowedChatId();
|
|
67
|
+
const ctx = deps.getContext();
|
|
68
|
+
if (allowedChatId === undefined || !ctx) {
|
|
69
|
+
throw new Error("Telegram agent turn routing is unavailable.");
|
|
70
|
+
}
|
|
71
|
+
const sourceTitle = (input.sourceTarget
|
|
72
|
+
? deps.getDisplayTitle?.(input.sourceTarget)
|
|
73
|
+
: undefined) ?? input.sourceThreadName;
|
|
74
|
+
const sourceLabel = sourceTitle
|
|
75
|
+
?.replace(/[\r\n\[\]]+/g, " ")
|
|
76
|
+
.trim()
|
|
77
|
+
.slice(0, 64) || "Pi";
|
|
78
|
+
const message = {
|
|
79
|
+
message_id: input.message.messageId,
|
|
80
|
+
date: Math.floor(getNowMs() / 1000),
|
|
81
|
+
chat: { id: target.chatId, type: "private" },
|
|
82
|
+
from: { id: allowedChatId, is_bot: false, first_name: "Pi Agent" },
|
|
83
|
+
message_thread_id: target.threadId,
|
|
84
|
+
pi_telegram_agent_source_thread: sourceLabel,
|
|
85
|
+
text: input.message.text,
|
|
86
|
+
};
|
|
87
|
+
await deps.handleUpdate({ message, [TELEGRAM_INTERNAL_AGENT_MESSAGE]: true }, ctx);
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telegram bridge binding composition
|
|
3
|
+
* Zones: telegram, pi agent, orchestration
|
|
4
|
+
* Owns pi-facing tool, command, and lifecycle hook registration for the entrypoint
|
|
5
|
+
*/
|
|
6
|
+
import * as ActivityVerbosity from "./activity-verbosity.ts";
|
|
7
|
+
import * as Activity from "./activity.ts";
|
|
8
|
+
import * as BusApi from "./bus-api.ts";
|
|
9
|
+
import type { TelegramBusFollowerCommandOwner } from "./bus-follower.ts";
|
|
10
|
+
import type { TelegramBusLiveRebindWorkState } from "./bus.ts";
|
|
11
|
+
import * as ChannelPosts from "./channel-posts.ts";
|
|
12
|
+
import * as Commands from "./commands.ts";
|
|
13
|
+
import * as Config from "./config.ts";
|
|
14
|
+
import * as Delivery from "./delivery.ts";
|
|
15
|
+
import * as GenerativeApps from "./generative-apps.ts";
|
|
16
|
+
import * as Keyboard from "./keyboard.ts";
|
|
17
|
+
import * as Lifecycle from "./lifecycle.ts";
|
|
18
|
+
import * as Locks from "./locks.ts";
|
|
19
|
+
import * as Menu from "./menu.ts";
|
|
20
|
+
import * as Model from "./model.ts";
|
|
21
|
+
import * as OutboundAttachments from "./outbound-attachments.ts";
|
|
22
|
+
import * as OutboundHandlers from "./outbound.ts";
|
|
23
|
+
import * as Pi from "./pi.ts";
|
|
24
|
+
import * as Preview from "./preview.ts";
|
|
25
|
+
import * as Prompts from "./prompts.ts";
|
|
26
|
+
import * as Queue from "./queue.ts";
|
|
27
|
+
import * as Replies from "./replies.ts";
|
|
28
|
+
import * as Routing from "./routing.ts";
|
|
29
|
+
import * as Runtime from "./runtime.ts";
|
|
30
|
+
import * as Setup from "./setup.ts";
|
|
31
|
+
import * as Status from "./status.ts";
|
|
32
|
+
import type { TelegramTarget } from "./target.ts";
|
|
33
|
+
import * as TelegramApi from "./telegram-api.ts";
|
|
34
|
+
/** Compose any registered held command over captured recipient effects; no ordinary follower API fallback. */
|
|
35
|
+
export declare function createTelegramFollowerSelectedCommandBinding<TContext, TModel extends Model.MenuModel = Model.MenuModel>(deps: {
|
|
36
|
+
ctx: TContext;
|
|
37
|
+
operationId: string;
|
|
38
|
+
registrationGeneration: string;
|
|
39
|
+
name: string;
|
|
40
|
+
target: TelegramTarget & {
|
|
41
|
+
threadId: number;
|
|
42
|
+
};
|
|
43
|
+
recipient: Pick<TelegramBusFollowerCommandOwner<TContext>, "isCurrent" | "assertRecipientCurrent">;
|
|
44
|
+
command: Pick<ReturnType<typeof Commands.createTelegramCommandHandlerTargetRuntime<Commands.TelegramCommandRuntimeMessage, TContext>>, "prepareHeldCommand" | "canPrepareHeldCommand">;
|
|
45
|
+
menu?: Omit<Menu.TelegramMenuActionRuntimeDeps<TContext, TModel>, "sendTextReply" | "sendInteractiveMessage" | "editInteractiveMessage">;
|
|
46
|
+
deliver: Parameters<typeof BusApi.createTelegramSelectedMenuTextApi>[0]["deliver"];
|
|
47
|
+
recordOwnership: NonNullable<Replies.TelegramRenderedMessageDeliveryRuntimeDeps<Menu.TelegramReplyMarkup>["recordOwnership"]>;
|
|
48
|
+
}): TelegramBusFollowerCommandOwner<TContext> | undefined;
|
|
49
|
+
type ActivePiModel = NonNullable<Pi.ExtensionContext["model"]>;
|
|
50
|
+
type TelegramRuntimeEventRecorder = (category: string, error: unknown, details?: Record<string, unknown>) => void;
|
|
51
|
+
type TelegramBridgeStatusUpdater = Status.TelegramStatusRuntime<Pi.ExtensionContext>["updateStatus"];
|
|
52
|
+
type TelegramAgentTargetResolver = NonNullable<OutboundAttachments.TelegramOutboundMessageToolRegistrationDeps["resolveAgentTarget"]>;
|
|
53
|
+
type TelegramAgentMessageRouter = NonNullable<OutboundAttachments.TelegramOutboundMessageToolRegistrationDeps["routeAgentMessage"]>;
|
|
54
|
+
export interface TelegramQueueBindingRuntime<TContext> {
|
|
55
|
+
mutation: Queue.TelegramQueueMutationController<TContext>;
|
|
56
|
+
dispatchNext: (ctx: TContext) => void;
|
|
57
|
+
requestNextDispatchAnnouncement: () => void;
|
|
58
|
+
cancelNextDispatchAnnouncement: () => void;
|
|
59
|
+
watchdog: Queue.TelegramQueueDispatchWatchdogRuntime<TContext>;
|
|
60
|
+
}
|
|
61
|
+
export declare function createTelegramQueueBindingRuntime<TContext>(deps: {
|
|
62
|
+
store: Queue.TelegramQueueStateStore<TContext>;
|
|
63
|
+
queue: Pick<Runtime.TelegramBridgeRuntime["queue"], "allocateItemOrder">;
|
|
64
|
+
lifecycle: Pick<Runtime.TelegramBridgeRuntime["lifecycle"], "isCompactionInProgress" | "hasDispatchPending">;
|
|
65
|
+
activeTurn: Pick<Queue.TelegramActiveTurnStore, "has">;
|
|
66
|
+
admission: {
|
|
67
|
+
getSettlement: () => {
|
|
68
|
+
onItemsDiscarded: (items: readonly Queue.TelegramQueueItem<TContext>[], ctx: TContext) => boolean;
|
|
69
|
+
isItemReady: (item: Queue.TelegramQueueItem<TContext>) => boolean;
|
|
70
|
+
onPromptHandedOff?: (item: Queue.PendingTelegramTurn, ctx: TContext) => boolean;
|
|
71
|
+
onControlSettled: (item: Queue.PendingTelegramControlItem<TContext>, ctx: TContext) => void;
|
|
72
|
+
} | undefined;
|
|
73
|
+
hasPendingQueueMutationForItem: (item: Queue.TelegramQueueItem<TContext>) => boolean;
|
|
74
|
+
};
|
|
75
|
+
transportStamp: Pick<Queue.TelegramTransportStampRuntime, "isActive">;
|
|
76
|
+
deferredDispatch: Pick<Queue.TelegramDeferredQueueDispatchRuntime<TContext>, "isBound" | "getGeneration" | "isGenerationActive">;
|
|
77
|
+
promptDispatch: Runtime.TelegramPromptDispatchRuntime<TContext>;
|
|
78
|
+
isIdle: (ctx: TContext) => boolean;
|
|
79
|
+
hasPendingMessages: (ctx: TContext) => boolean;
|
|
80
|
+
updateStatus: (ctx: TContext, error?: string) => void;
|
|
81
|
+
sendTextReply: Queue.TelegramQueueDispatchRuntimeDeps<TContext>["sendTextReply"];
|
|
82
|
+
sendUserMessage: Queue.TelegramQueueDispatchRuntimeDeps<TContext>["sendUserMessage"];
|
|
83
|
+
reconcileNextDispatchAnnouncementReplyOwnership?: (item: Queue.PendingTelegramTurn) => void;
|
|
84
|
+
recordRuntimeEvent?: TelegramRuntimeEventRecorder;
|
|
85
|
+
}): TelegramQueueBindingRuntime<TContext>;
|
|
86
|
+
export interface TelegramGenerativeAppLiveSurfaceBinding {
|
|
87
|
+
get: () => GenerativeApps.GenerativeAppLiveSurfaceRuntime<GenerativeApps.TelegramBindLiveHandle> | undefined;
|
|
88
|
+
set: (runtime: GenerativeApps.GenerativeAppLiveSurfaceRuntime<GenerativeApps.TelegramBindLiveHandle> | undefined) => void;
|
|
89
|
+
shutdown: () => void;
|
|
90
|
+
}
|
|
91
|
+
export declare function createTelegramGenerativeAppLiveSurfaceBinding(): TelegramGenerativeAppLiveSurfaceBinding;
|
|
92
|
+
export declare function createTelegramGenerativeAppBoundButtonActionInvoker<TQuery extends {
|
|
93
|
+
message?: {
|
|
94
|
+
chat?: {
|
|
95
|
+
id?: number;
|
|
96
|
+
};
|
|
97
|
+
message_id?: number;
|
|
98
|
+
message_thread_id?: number;
|
|
99
|
+
};
|
|
100
|
+
}>(deps: {
|
|
101
|
+
agentDir: string;
|
|
102
|
+
assertExecutionCurrent: (query: TQuery) => void;
|
|
103
|
+
getExecutionFence: (query: TQuery) => GenerativeApps.GenerativeAppExecutionFence | undefined;
|
|
104
|
+
getActiveProfileName?: () => string | undefined;
|
|
105
|
+
getLiveSurfaceRuntime?: () => GenerativeApps.GenerativeAppLiveSurfaceRuntime<GenerativeApps.TelegramBindLiveHandle> | undefined;
|
|
106
|
+
planOutput: ReturnType<typeof OutboundHandlers.createTelegramOutboundReplyPlanner>;
|
|
107
|
+
sendMarkdownReply: (chatId: number, replyToMessageId: number, markdown: string, options?: {
|
|
108
|
+
replyMarkup?: OutboundHandlers.TelegramOutboundButtonMarkup;
|
|
109
|
+
}) => Promise<unknown>;
|
|
110
|
+
editInteractiveMessage?: (chatId: number, messageId: number, markdown: string, mode: "markdown", replyMarkup: OutboundHandlers.TelegramOutboundButtonMarkup) => Promise<void>;
|
|
111
|
+
recordRuntimeEvent: TelegramRuntimeEventRecorder;
|
|
112
|
+
}): (action: OutboundHandlers.TelegramOutboundButtonAction, query: TQuery) => Promise<false | "new" | "edit">;
|
|
113
|
+
export interface TelegramAgentMessageToolRoutingRuntime {
|
|
114
|
+
resolveAgentTarget: TelegramAgentTargetResolver;
|
|
115
|
+
routeAgentMessage: TelegramAgentMessageRouter;
|
|
116
|
+
canSendDirect: () => boolean;
|
|
117
|
+
}
|
|
118
|
+
export declare function createTelegramAgentMessageToolRoutingRuntime(deps: {
|
|
119
|
+
ownsLeader: () => boolean;
|
|
120
|
+
ownsDirectDelivery: () => boolean;
|
|
121
|
+
isFollowerRegistered: () => boolean;
|
|
122
|
+
getSourceTarget: () => TelegramTarget | undefined;
|
|
123
|
+
getSourceThreadName: () => string | undefined;
|
|
124
|
+
local: {
|
|
125
|
+
resolveTarget: (selector: Parameters<TelegramAgentTargetResolver>[0], sourceTarget?: TelegramTarget) => Awaited<ReturnType<TelegramAgentTargetResolver>> | undefined;
|
|
126
|
+
route: (input: {
|
|
127
|
+
sourceTarget?: TelegramTarget;
|
|
128
|
+
sourceThreadName?: string;
|
|
129
|
+
message: Parameters<TelegramAgentMessageRouter>[0];
|
|
130
|
+
}) => Promise<void>;
|
|
131
|
+
};
|
|
132
|
+
follower: {
|
|
133
|
+
resolveTarget: TelegramAgentTargetResolver;
|
|
134
|
+
routeMessage: TelegramAgentMessageRouter;
|
|
135
|
+
};
|
|
136
|
+
}): TelegramAgentMessageToolRoutingRuntime;
|
|
137
|
+
export interface TelegramAssistantOutputBindingRuntime<TTransportStamp> {
|
|
138
|
+
runtime: Activity.TelegramAssistantOutputRuntime;
|
|
139
|
+
observeEvent: (event: Activity.TelegramActivityEvent) => void;
|
|
140
|
+
authority: Routing.TelegramAssistantOutputAuthorityRuntime<TTransportStamp>;
|
|
141
|
+
}
|
|
142
|
+
export declare function createTelegramAssistantOutputBindingRuntime<TTransportStamp>(deps: {
|
|
143
|
+
authority: {
|
|
144
|
+
getPreferredTarget: () => OutboundAttachments.TelegramQueuedOutboundAttachmentTurnView["target"] | undefined;
|
|
145
|
+
getFallbackChatId: () => number | undefined;
|
|
146
|
+
getTransportStamp: () => TTransportStamp;
|
|
147
|
+
isTransportStampActive: (stamp: TTransportStamp) => boolean;
|
|
148
|
+
ownsDirect: () => boolean;
|
|
149
|
+
getDirectEpoch: () => number | string | undefined;
|
|
150
|
+
isFollowerRegistered: () => boolean;
|
|
151
|
+
getFollowerGeneration: () => string | undefined;
|
|
152
|
+
};
|
|
153
|
+
sender: Parameters<typeof OutboundHandlers.createTelegramAssistantOutputSender<TTransportStamp>>[0];
|
|
154
|
+
waitForActivityIdle?: () => Promise<void>;
|
|
155
|
+
prepareTelegramPreview?: () => Activity.TelegramAssistantOutputPreparation | undefined;
|
|
156
|
+
enqueue?: Activity.TelegramActivityPublicationRuntime["enqueue"];
|
|
157
|
+
recordRuntimeEvent: TelegramRuntimeEventRecorder;
|
|
158
|
+
}): TelegramAssistantOutputBindingRuntime<TTransportStamp>;
|
|
159
|
+
type TelegramAssistantOutputAuthority<TTransportStamp> = ReturnType<Routing.TelegramAssistantOutputAuthorityRuntime<TTransportStamp>["captureAuthority"]>;
|
|
160
|
+
export interface TelegramBridgePublicationRuntime {
|
|
161
|
+
enqueue: Activity.TelegramActivityPublicationRuntime["enqueue"];
|
|
162
|
+
reserve: Activity.TelegramActivityPublicationRuntime["reserve"];
|
|
163
|
+
hasPending: Activity.TelegramActivityPublicationRuntime["hasPending"];
|
|
164
|
+
beginWork: Activity.TelegramActivityPublicationRuntime["beginWork"];
|
|
165
|
+
hasUnconfirmed: Activity.TelegramActivityPublicationRuntime["hasUnconfirmed"];
|
|
166
|
+
capture: () => {
|
|
167
|
+
target?: Queue.TelegramQueueTarget;
|
|
168
|
+
isCurrent: () => boolean;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
export interface TelegramActivityBindingRuntime {
|
|
172
|
+
publicationRuntime: TelegramBridgePublicationRuntime;
|
|
173
|
+
activityRuntime: Activity.TelegramActivityRuntime;
|
|
174
|
+
activityVerbosityRuntime: ActivityVerbosity.TelegramActivityVerbosityRuntime;
|
|
175
|
+
assistantOutputRuntime: Activity.TelegramAssistantOutputRuntime;
|
|
176
|
+
}
|
|
177
|
+
/** Compose public activity fanout, verbosity, and assistant output ordering. */
|
|
178
|
+
export declare function createTelegramActivityBindingRuntime<TTransportStamp>(deps: {
|
|
179
|
+
generation: string;
|
|
180
|
+
assistantOutput: Omit<Parameters<typeof createTelegramAssistantOutputBindingRuntime<TTransportStamp>>[0], "waitForActivityIdle" | "enqueue">;
|
|
181
|
+
activityVerbosity: Omit<Parameters<typeof ActivityVerbosity.createTelegramActivityVerbosityRuntime<TelegramAssistantOutputAuthority<TTransportStamp>>>[0], "captureAuthority" | "isAuthorityActive" | "recordFailure" | "enqueue">;
|
|
182
|
+
}): TelegramActivityBindingRuntime;
|
|
183
|
+
/** Fresh current work projection; a snapshot is not a cleanup grant or target-application ACK. */
|
|
184
|
+
export declare function createTelegramLiveTargetWorkObserver<TContext>(deps: {
|
|
185
|
+
queue: Pick<Queue.TelegramQueueStateStore<TContext>, "getQueuedItems">;
|
|
186
|
+
activeTurn: Pick<Queue.TelegramActiveTurnStore, "get">;
|
|
187
|
+
lifecycle: Pick<Runtime.TelegramBridgeRuntime["lifecycle"], "hasDispatchPending" | "isCompactionInProgress" | "getActiveToolExecutions">;
|
|
188
|
+
isIdle(ctx: TContext): boolean;
|
|
189
|
+
hasPendingMessages(ctx: TContext): boolean;
|
|
190
|
+
hasPendingControl(): boolean;
|
|
191
|
+
publication: Pick<TelegramBridgePublicationRuntime, "hasPending" | "hasUnconfirmed">;
|
|
192
|
+
activity: Pick<Activity.TelegramActivityRuntime, "hasPending">;
|
|
193
|
+
delivery: Pick<ReturnType<typeof Delivery.createTelegramDeliveryLifecycleHooks>, "hasPendingTarget">;
|
|
194
|
+
api: Pick<TelegramApi.TelegramApiTargetActivityRuntime, "hasPendingTarget">;
|
|
195
|
+
}): (target: TelegramTarget & {
|
|
196
|
+
threadId: number;
|
|
197
|
+
}, ctx: TContext) => TelegramBusLiveRebindWorkState;
|
|
198
|
+
interface TelegramCommandsAndToolsBindingDeps {
|
|
199
|
+
pi: Pi.ExtensionAPI;
|
|
200
|
+
agentDir: string;
|
|
201
|
+
configStore: Config.TelegramConfigStore;
|
|
202
|
+
persistConfig: (config?: Config.TelegramConfig) => Promise<void>;
|
|
203
|
+
setup: Setup.TelegramSetupGuard;
|
|
204
|
+
activeTurnRuntime: Queue.TelegramActiveTurnStore<Queue.PendingTelegramTurn>;
|
|
205
|
+
lockedPollingRuntime: Locks.TelegramLockedPollingRuntime<Pi.ExtensionContext>;
|
|
206
|
+
stopPolling?: () => Promise<void | string>;
|
|
207
|
+
getDisconnectThreadName?: () => string | undefined;
|
|
208
|
+
onTransportChanged?: () => Promise<void> | void;
|
|
209
|
+
getStatusLines: (options?: Status.TelegramBridgeStatusLineOptions) => string[];
|
|
210
|
+
buttonActionStore: OutboundHandlers.TelegramButtonActionStore;
|
|
211
|
+
sendMarkdownReply: (chatId: number, replyToMessageId: number | undefined, markdown: string, options?: {
|
|
212
|
+
replyMarkup?: unknown;
|
|
213
|
+
target?: {
|
|
214
|
+
chatId: number;
|
|
215
|
+
threadId?: number;
|
|
216
|
+
};
|
|
217
|
+
}) => Promise<number | undefined>;
|
|
218
|
+
sendChannelMarkdownMessage: NonNullable<OutboundAttachments.TelegramOutboundMessageToolRegistrationDeps["sendChannelMarkdownMessage"]>;
|
|
219
|
+
sendChannelMediaMessage: NonNullable<OutboundAttachments.TelegramOutboundMessageToolRegistrationDeps["sendChannelMediaMessage"]>;
|
|
220
|
+
listChannelPosts: ChannelPosts.TelegramChannelPostJournalStore["list"];
|
|
221
|
+
mutateChannelPost(input: {
|
|
222
|
+
action: "edit" | "delete";
|
|
223
|
+
operationId: string;
|
|
224
|
+
mutationId: string;
|
|
225
|
+
markdown?: string;
|
|
226
|
+
}): Promise<ChannelPosts.TelegramChannelPostRecord>;
|
|
227
|
+
callMultipart: OutboundHandlers.TelegramVoiceReplySenderDeps["sendMultipart"];
|
|
228
|
+
getDefaultChatId: () => number | undefined;
|
|
229
|
+
getDefaultTarget?: () => OutboundAttachments.TelegramQueuedOutboundAttachmentTurnView["target"];
|
|
230
|
+
resolveAgentTarget?: OutboundAttachments.TelegramOutboundMessageToolRegistrationDeps["resolveAgentTarget"];
|
|
231
|
+
routeAgentMessage?: OutboundAttachments.TelegramOutboundMessageToolRegistrationDeps["routeAgentMessage"];
|
|
232
|
+
canSendDirect: () => boolean;
|
|
233
|
+
setGenerativeAppLiveSurfaceRuntime?: (runtime: GenerativeApps.GenerativeAppLiveSurfaceRuntime<GenerativeApps.TelegramBindLiveHandle> | undefined) => void;
|
|
234
|
+
updateStatus: TelegramBridgeStatusUpdater;
|
|
235
|
+
isContextCurrent: (ctx: Pi.ExtensionContext) => boolean;
|
|
236
|
+
getSessionGeneration: () => number;
|
|
237
|
+
connectionIntent: NonNullable<Commands.TelegramBridgeCommandRegistrationDeps["connectionIntent"]>;
|
|
238
|
+
recordRuntimeEvent: TelegramRuntimeEventRecorder;
|
|
239
|
+
}
|
|
240
|
+
export declare function registerTelegramCommandsAndTools({ pi, agentDir, configStore, persistConfig, setup, activeTurnRuntime, lockedPollingRuntime, stopPolling, getDisconnectThreadName, onTransportChanged, getStatusLines, buttonActionStore, sendMarkdownReply, sendChannelMarkdownMessage, sendChannelMediaMessage, listChannelPosts, mutateChannelPost, callMultipart, getDefaultChatId, getDefaultTarget, resolveAgentTarget, routeAgentMessage, canSendDirect, setGenerativeAppLiveSurfaceRuntime, recordRuntimeEvent, updateStatus, isContextCurrent, getSessionGeneration, connectionIntent, }: TelegramCommandsAndToolsBindingDeps): void;
|
|
241
|
+
interface TelegramLifecycleBindingDeps {
|
|
242
|
+
pi: Pi.ExtensionAPI;
|
|
243
|
+
publicationRuntime: TelegramBridgePublicationRuntime;
|
|
244
|
+
activityRuntime: Activity.TelegramActivityRuntime;
|
|
245
|
+
activityVerbosityRuntime?: ActivityVerbosity.TelegramActivityVerbosityRuntime;
|
|
246
|
+
diagnostics?: {
|
|
247
|
+
onSessionStart(): void;
|
|
248
|
+
onSessionShutdown(): Promise<void>;
|
|
249
|
+
};
|
|
250
|
+
assistantOutputRuntime: Pick<Activity.TelegramAssistantOutputRuntime, "start" | "beginTurn" | "hasAdmittedTelegramIntermediate" | "waitForIdle" | "stop">;
|
|
251
|
+
sessionLifecycleRuntime: Pick<Lifecycle.TelegramLifecycleRegistrationDeps, "onSessionStart" | "onSessionShutdown" | "onModelSelect">;
|
|
252
|
+
configStore: Pick<Config.TelegramConfigStore, "get" | "getOutboundHandlers" | "hasBotToken" | "load">;
|
|
253
|
+
abort: Runtime.TelegramRuntimeAbortPort;
|
|
254
|
+
typing: Runtime.TelegramRuntimeTypingPort;
|
|
255
|
+
lifecycle: Runtime.TelegramRuntimeLifecyclePort;
|
|
256
|
+
activeTurnRuntime: Queue.TelegramActiveTurnStore<Queue.PendingTelegramTurn>;
|
|
257
|
+
telegramQueueStore: Queue.TelegramQueueStore<Pi.ExtensionContext>;
|
|
258
|
+
modelSwitchController: Model.TelegramModelSwitchController<Pi.ExtensionContext, Model.ScopedTelegramModel<ActivePiModel>>;
|
|
259
|
+
previewRuntime: Preview.TelegramAssistantPreviewRuntime<Pi.AgentEndEvent["messages"][number], Keyboard.TelegramInlineKeyboardMarkup>;
|
|
260
|
+
promptDispatchRuntime: Runtime.TelegramPromptDispatchRuntime<Pi.ExtensionContext>;
|
|
261
|
+
deferredQueueDispatchRuntime: Queue.TelegramDeferredQueueDispatchRuntime<Pi.ExtensionContext>;
|
|
262
|
+
modelContextAvailabilityRuntime: Prompts.TelegramModelContextAvailabilityRuntime;
|
|
263
|
+
disconnectOnQuit?: () => Promise<unknown>;
|
|
264
|
+
onSessionStarted?: (event: Pi.SessionStartEvent, ctx: Pi.ExtensionContext) => void;
|
|
265
|
+
shutdownGenerativeAppLiveSurfaces?: () => void;
|
|
266
|
+
resolveAutomaticThreadCleanupEnabled?: () => boolean | Promise<boolean>;
|
|
267
|
+
buttonActionStore: OutboundHandlers.TelegramButtonActionStore;
|
|
268
|
+
callMultipart: OutboundHandlers.TelegramVoiceReplySenderDeps["sendMultipart"];
|
|
269
|
+
sendChatAction: NonNullable<OutboundHandlers.TelegramVoiceReplySenderDeps["sendChatAction"]>;
|
|
270
|
+
sendRecordVoiceAction: NonNullable<OutboundHandlers.TelegramVoiceReplySenderDeps["sendRecordVoiceAction"]>;
|
|
271
|
+
sendMarkdownReply: Queue.TelegramAgentEndHookRuntimeDeps<Queue.PendingTelegramTurn, Pi.ExtensionContext, Pi.AgentEndEvent["messages"][number], Keyboard.TelegramInlineKeyboardMarkup>["sendMarkdownReply"];
|
|
272
|
+
sendTextReply: Queue.TelegramAgentEndHookRuntimeDeps<Queue.PendingTelegramTurn, Pi.ExtensionContext, Pi.AgentEndEvent["messages"][number], Keyboard.TelegramInlineKeyboardMarkup>["sendTextReply"] & NonNullable<OutboundHandlers.TelegramVoiceReplySenderDeps["sendTextReply"]>;
|
|
273
|
+
dispatchNextQueuedTelegramTurn: (ctx: Pi.ExtensionContext) => void;
|
|
274
|
+
onPromptHandedOff?: (turn: Queue.PendingTelegramTurn, ctx: Pi.ExtensionContext) => void;
|
|
275
|
+
answerGuestQuery: TelegramApi.TelegramBridgeApiRuntime["answerGuestQuery"];
|
|
276
|
+
deleteMessage: TelegramApi.TelegramBridgeApiRuntime["deleteMessage"];
|
|
277
|
+
sendGuestReply: NonNullable<Queue.TelegramAgentEndHookRuntimeDeps<Queue.PendingTelegramTurn, Pi.ExtensionContext, Pi.AgentEndEvent["messages"][number], Keyboard.TelegramInlineKeyboardMarkup>["sendGuestReply"]>;
|
|
278
|
+
editGuestReply?: Queue.TelegramAgentEndHookRuntimeDeps<Queue.PendingTelegramTurn, Pi.ExtensionContext, Pi.AgentEndEvent["messages"][number], Keyboard.TelegramInlineKeyboardMarkup>["editGuestReply"];
|
|
279
|
+
stopGuestPlaceholder?: Queue.TelegramAgentEndHookRuntimeDeps<Queue.PendingTelegramTurn, Pi.ExtensionContext, Pi.AgentEndEvent["messages"][number], Keyboard.TelegramInlineKeyboardMarkup>["stopGuestPlaceholder"];
|
|
280
|
+
preparePreviewDelivery?: Queue.TelegramAgentEndRuntimeDeps<Queue.PendingTelegramTurn>["preparePreviewDelivery"];
|
|
281
|
+
finalizeMarkdownPreview: Queue.TelegramAgentEndHookRuntimeDeps<Queue.PendingTelegramTurn, Pi.ExtensionContext, Pi.AgentEndEvent["messages"][number], Keyboard.TelegramInlineKeyboardMarkup>["finalizeMarkdownPreview"];
|
|
282
|
+
proactivePushTargetGetter: () => Queue.TelegramQueueTarget | undefined;
|
|
283
|
+
getAssistantRenderingMode: () => "rich" | "html";
|
|
284
|
+
recordMessageOwnership?: (input: {
|
|
285
|
+
chatId: number;
|
|
286
|
+
messageId: number;
|
|
287
|
+
target?: Queue.TelegramQueueTarget;
|
|
288
|
+
}) => void;
|
|
289
|
+
canSendAgentActivity: (ctx: Pi.ExtensionContext) => boolean;
|
|
290
|
+
isSessionContextActive: (ctx: Pi.ExtensionContext) => boolean;
|
|
291
|
+
isTurnTransportActive?: (turn: Queue.PendingTelegramTurn) => boolean;
|
|
292
|
+
updateStatus: TelegramBridgeStatusUpdater;
|
|
293
|
+
recordRuntimeEvent: TelegramRuntimeEventRecorder;
|
|
294
|
+
}
|
|
295
|
+
export declare function registerTelegramLifecycleRuntimeHooks({ pi, publicationRuntime, activityRuntime, activityVerbosityRuntime, diagnostics, assistantOutputRuntime, sessionLifecycleRuntime, configStore, abort, typing, lifecycle, activeTurnRuntime, telegramQueueStore, modelSwitchController, previewRuntime, promptDispatchRuntime, deferredQueueDispatchRuntime, modelContextAvailabilityRuntime, disconnectOnQuit, onSessionStarted, shutdownGenerativeAppLiveSurfaces, resolveAutomaticThreadCleanupEnabled, buttonActionStore, callMultipart, sendChatAction, sendRecordVoiceAction, sendMarkdownReply, sendTextReply, dispatchNextQueuedTelegramTurn, onPromptHandedOff, answerGuestQuery, deleteMessage, sendGuestReply, editGuestReply, stopGuestPlaceholder, preparePreviewDelivery, finalizeMarkdownPreview, proactivePushTargetGetter, getAssistantRenderingMode, recordMessageOwnership, canSendAgentActivity, isSessionContextActive, isTurnTransportActive, updateStatus, recordRuntimeEvent, }: TelegramLifecycleBindingDeps): void;
|
|
296
|
+
export {};
|